From patchwork Mon Jul 12 02:19:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1503761 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=K9TjBGUt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GNSDY57xJz9sV8 for ; Mon, 12 Jul 2021 12:21:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5813982CE6; Mon, 12 Jul 2021 04:20:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="K9TjBGUt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FBD482C48; Mon, 12 Jul 2021 04:19:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2586982C34 for ; Mon, 12 Jul 2021 04:19:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x334.google.com with SMTP id w15-20020a056830144fb02904af2a0d96f3so17265608otp.6 for ; Sun, 11 Jul 2021 19:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R9PmJEPyB1uYTMU2+Umc7bxwaH6GPxvq/kew45B35Pc=; b=K9TjBGUtOwwnGhhPopjOckgZA+E79k7lfxnmoxWVw1aGljG1GyVJc45ycVsfIsI4Zv xY7MJtfzhSTHsVSWaPevXXvBsyMRD8Tl+84a9iVhDeIvhbt55Rr5Fo7YYvp9pbi27lt7 tJuh6Ia1KTcMXukGqJ7TXkwBdr3S2nl0r1XZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R9PmJEPyB1uYTMU2+Umc7bxwaH6GPxvq/kew45B35Pc=; b=Gs1jasX75uPytQD9H4V8lbRBVruDNuv/qAqpS9VBNXA785X1bXnmxuoDEeblnBxpeY LuRt9y2ba0bAlpNXfG+Bd/AT2oQrNLgOdpUEsEjIOa1IUL/ojZNKu6r/Wu9EvE2McVxy 4R4oopEZPqQDo57aFy28e2X6vj1RxbymVOx8atq5YTHfxLOs7n2LAE9vZRYMwW4dF63N Z0GU6JIJPkNPvg7+ycfTDszeZrZCQFJWNUiQo3JHxp1ApLiY/NuBRKy8mXF6LAFYs1ue RnGGq/gt7oXKiSUzh88yz42CWfRNKcrO4xKRWMEL3wyjLH//g443ZMGISowu08Tsi4Gc XUHg== X-Gm-Message-State: AOAM530lNzqTCgzHmou/z/9gFHDmX60JzCfWfETGIAElUXUAUpWMaSe2 MyjGttgyYgkwLuGuKz6W/cM9rK/Pw8RlHb95 X-Google-Smtp-Source: ABdhPJxrhfnH7Kwz8jgyCQCGs7TnU7pFWcTWjOTh3yQuIIgpTskYZG1D95QZ51/jxu+GBbGqS+t7lQ== X-Received: by 2002:a05:6830:1da1:: with SMTP id z1mr24396284oti.212.1626056370071; Sun, 11 Jul 2021 19:19:30 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a44sm2270312ooj.12.2021.07.11.19.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jul 2021 19:19:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v3 7/7] vpl: Add Kconfig options for VPL Date: Sun, 11 Jul 2021 20:19:19 -0600 Message-Id: <20210711201855.v3.7.I4776f7893bb30890d78332c3477846c5ca4ef724@changeid> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210712021919.3409934-1-sjg@chromium.org> References: <20210712021919.3409934-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Add VPL versions of commonly used Kconfig options. Signed-off-by: Simon Glass --- (no changes since v1) Kconfig | 10 +++ arch/sandbox/Kconfig | 8 ++ common/Kconfig | 67 ++++++++++++++ common/spl/Kconfig | 189 +++++++++++++++++++++++++++++++++++++++ drivers/clk/Kconfig | 10 +++ drivers/core/Makefile | 2 +- drivers/gpio/Kconfig | 11 +++ drivers/i2c/Kconfig | 11 +++ drivers/misc/Kconfig | 19 ++++ drivers/pinctrl/Kconfig | 18 +++- drivers/rtc/Kconfig | 9 ++ drivers/serial/Kconfig | 20 +++++ drivers/sysreset/Kconfig | 10 +++ drivers/timer/Kconfig | 10 +++ lib/Kconfig | 62 +++++++++++++ 15 files changed, 453 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index f8c1a77bedb..8cd8c59d045 100644 --- a/Kconfig +++ b/Kconfig @@ -264,6 +264,16 @@ config TPL_SYS_MALLOC_F_LEN particular needs this to operate, so that it can allocate the initial serial device and any others that are needed. +config VPL_SYS_MALLOC_F_LEN + hex "Size of malloc() pool in VPL before relocation" + depends on SYS_MALLOC_F && VPL + default SYS_MALLOC_F_LEN + help + Before relocation, memory is very limited on many platforms. Still, + we can provide a small malloc() pool if needed. Driver model in + particular needs this to operate, so that it can allocate the + initial serial device and any others that are needed. + menuconfig EXPERT bool "Configure standard U-Boot features (expert users)" default y diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index f83282d9d56..e504b08b951 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -29,6 +29,14 @@ config SANDBOX_SPL bool "Enable SPL for sandbox" select SUPPORT_SPL +config SANDBOX_TPL + bool "Enable TPL for sandbox" + select SUPPORT_TPL + +config SANDBOX_VPL + bool "Enable VPL for sandbox" + select SUPPORT_VPL + config SYS_CONFIG_NAME default "sandbox_spl" if SANDBOX_SPL default "sandbox" if !SANDBOX_SPL diff --git a/common/Kconfig b/common/Kconfig index 26496f9a2e7..2a7f08af1dc 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -81,6 +81,15 @@ config TPL_LOGLEVEL int default LOGLEVEL +config VPL_LOGLEVEL + int "loglevel for VPL" + default LOGLEVEL + help + All Messages with a loglevel smaller than the console loglevel will + be compiled in to VPL. See LOGLEVEL for a list of available log + levels. Setting this to a value above 4 may increase the code size + significantly. + config SILENT_CONSOLE bool "Support a silent console" help @@ -254,6 +263,15 @@ config LOG if LOG +config VPL_LOG + bool "Enable logging support in VPL" + depends on LOG + help + This enables support for logging of status and debug messages. These + can be displayed on the console, recorded in a memory buffer, or + discarded if not needed. Logging supports various categories and + levels of severity. + config LOG_MAX_LEVEL int "Maximum log level to record" default 6 @@ -415,6 +433,47 @@ config TPL_LOG_CONSOLE endif +config VPL_LOG + bool "Enable logging support in VPL" + depends on LOG + help + This enables support for logging of status and debug messages. These + can be displayed on the console, recorded in a memory buffer, or + discarded if not needed. Logging supports various categories and + levels of severity. + +if VPL_LOG + +config VPL_LOG_MAX_LEVEL + int "Maximum log level to record in VPL" + default 3 + help + This selects the maximum log level that will be recorded. Any value + higher than this will be ignored. If possible log statements below + this level will be discarded at build time. Levels: + + 0 - emergency + 1 - alert + 2 - critical + 3 - error + 4 - warning + 5 - note + 6 - info + 7 - debug + 8 - debug content + 9 - debug hardware I/O + +config VPL_LOG_CONSOLE + bool "Allow log output to the console in VPL" + default y + help + Enables a log driver which writes log records to the console. + Generally the console is the serial port or LCD display. Only the + log message is shown - other details like level, category, file and + line number are omitted. + +endif + config LOG_ERROR_RETURN bool "Log all functions which return an error" help @@ -711,6 +770,14 @@ config TPL_BLOBLIST This enables a bloblist in TPL. The bloblist is set up in TPL and passed to SPL and U-Boot proper. +config VPL_BLOBLIST + bool "Support for a bloblist in VPL" + depends on BLOBLIST + default y if TPL_BLOBLIST + help + This enables a bloblist in VPL. The bloblist is set up in VPL and + passed to SPL and U-Boot proper. + config BLOBLIST_SIZE hex "Size of bloblist" depends on BLOBLIST diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 0443197cd55..106296d81d6 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -167,6 +167,13 @@ config SPL_BOARD_INIT spl_board_init() from board_init_r(). This function should be provided by the board. +config VPL_BOARD_INIT + bool "Call board-specific initialization in VPL" + help + If this option is enabled, U-Boot will call the function + spl_board_init() from board_init_r(). This function should be + provided by the board. + config SPL_BOOTROM_SUPPORT bool "Support returning to the BOOTROM" help @@ -310,6 +317,15 @@ config TPL_BANNER_PRINT info. Disabling this option could be useful to reduce TPL boot time (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud). +config VPL_BANNER_PRINT + bool "Enable output of the VPL banner 'U-Boot VPL ...'" + depends on VPL + default y + help + If this option is enabled, VPL will print the banner with version + info. Disabling this option could be useful to reduce VPL boot time + (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud). + config SPL_EARLY_BSS depends on ARM && !ARM64 bool "Allows initializing BSS early before entering board_init_f" @@ -819,6 +835,27 @@ config SPL_DM_SPI_FLASH Enable support for SPI DM flash drivers in SPL. endif + +if TPL + +config VPL_CACHE + depends on CACHE + bool "Support cache drivers in SPL" + help + Enable support for cache drivers in SPL. + +config VPL_DM_SPI + bool "Support SPI DM drivers in SPL" + help + Enable support for SPI DM drivers in SPL. + +config VPL_DM_SPI_FLASH + bool "Support SPI DM FLASH drivers in SPL" + help + Enable support for SPI DM flash drivers in SPL. + +endif + if SPL_UBI config SPL_UBI_LOAD_BY_VOLNAME bool "Support loading volumes by name" @@ -1636,6 +1673,158 @@ config TPL_YMODEM_SUPPORT endif # TPL +config VPL + bool + depends on SUPPORT_SPL + prompt "Enable VPL" + help + If you want to build VPL as well as the normal image, TPL and SPL, + say Y. + +if VPL + +config VPL_FRAMEWORK + bool "Support VPL based upon the common SPL framework" + default y + help + Enable the SPL framework under common/spl/ for VPL builds. + This framework supports MMC, NAND and YMODEM and other methods + loading of U-Boot's next stage. If unsure, say Y. + +config VPL_HANDOFF + bool "Pass hand-off information from VPL to SPL" + depends on HANDOFF && VPL_BLOBLIST + default y + help + This option enables VPL to write handoff information. This can be + used to pass information like the size of SDRAM from VPL to SPL. Also + VPL can receive information from TPL in the same place if that is + enabled. + +config VPL_LIBCOMMON_SUPPORT + bool "Support common libraries" + default y if SPL_LIBCOMMON_SUPPORT + help + Enable support for common U-Boot libraries within VPL. See + SPL_LIBCOMMON_SUPPORT for details. + +config VPL_LIBGENERIC_SUPPORT + bool "Support generic libraries" + default y if SPL_LIBGENERIC_SUPPORT + help + Enable support for generic U-Boot libraries within VPL. These + libraries include generic code to deal with device tree, hashing, + printf(), compression and the like. This option is enabled on many + boards. Enable this option to build the code in lib/ as part of an + SPL build. + +config VPL_DRIVERS_MISC_SUPPORT + bool "Support misc drivers" + default y if TPL_DRIVERS_MISC_SUPPORT + help + Enable miscellaneous drivers in VPL. These drivers perform various + tasks that don't fall nicely into other categories, Enable this + option to build the drivers in drivers/misc as part of an VPL + build, for those that support building in VPL (not all drivers do). + +config VPL_ENV_SUPPORT + bool "Support an environment" + help + Enable environment support in VPL. The U-Boot environment provides + a number of settings (essentially name/value pairs) which can + control many aspects of U-Boot's operation. Enabling this option will + make env_get() and env_set() available in VSPL. + +config VPL_GPIO_SUPPORT + bool "Support GPIO in VPL" + default y if SPL_GPIO_SUPPORT + help + Enable support for GPIOs (General-purpose Input/Output) in VPL. + GPIOs allow U-Boot to read the state of an input line (high or + low) and set the state of an output line. This can be used to + drive LEDs, control power to various system parts and read user + input. GPIOs can be useful in TPL to enable a 'sign-of-life' LED, + for example. Enable this option to build the drivers in + drivers/gpio as part of an TPL build. + +config VPL_HASH_SUPPORT + bool "Support hashing drivers in VPL" + depends on VPL + select SHA1 + select SHA256 + help + Enable hashing drivers in SPL. These drivers can be used to + accelerate secure boot processing in secure applications. Enable + this option to build system-specific drivers for hash acceleration + as part of an SPL build. + +config VPL_I2C_SUPPORT + bool "Support I2C in VPL" + default y if SPL_I2C_SUPPORT + help + Enable support for the I2C bus in TPL. Vee SPL_I2C_SUPPORT for + details. + +config VPL_PCH_SUPPORT + bool "Support PCH drivers" + default y if TPL_PCH_SUPPORT + help + Enable support for PCH (Platform Controller Hub) devices in VPL. + These are used to set up GPIOs and the SPI peripheral early in + boot. This enables the drivers in drivers/pch as part of a VPL + build. + +config VPL_PCI + bool "Support PCI drivers" + default y if SPL_PCI + help + Enable support for PCI in VPL. For platforms that need PCI to boot, + or must perform some init using PCI in VPL, this provides the + necessary driver support. This enables the drivers in drivers/pci + as part of a VPL build. + +config VPL_RTC_SUPPORT + bool "Support RTC drivers" + help + Enable RTC (Real-time Clock) support in VPL. This includes support + for reading and setting the time. Some RTC devices also have some + non-volatile (battery-backed) memory which is accessible if + needed. This enables the drivers in drivers/rtc as part of an VPL + build. + +config VPL_SERIAL_SUPPORT + bool "Support serial" + default y if SPL_SERIAL_SUPPORT + select VPL_PRINTF + select VPL_STRTO + help + Enable support for serial in VPL. See SPL_SERIAL_SUPPORT for + details. + +config VPL_SPI_SUPPORT + bool "Support SPI drivers" + help + Enable support for using SPI in VPL. See SPL_SPI_SUPPORT for + details. + +config VPL_SPI_FLASH_SUPPORT + bool "Support SPI flash drivers" + help + Enable support for using SPI flash in VPL, and loading U-Boot from + SPI flash. SPI flash (Serial Peripheral Bus flash) is named after + the SPI bus that is used to connect it to a system. It is a simple + but fast bidirectional 4-wire bus (clock, chip select and two data + lines). This enables the drivers in drivers/mtd/spi as part of an + VPL build. This normally requires VPL_SPI_SUPPORT. + +config VPL_TEXT_BASE + hex "VPL Text Base" + default 0x0 + help + The address in memory that VPL will be running from. + +endif + config SPL_AT91_MCK_BYPASS bool "Use external clock signal as a source of main clock for AT91 platforms" depends on ARCH_AT91 diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index e07c6dd78a6..4b0bed66bfb 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -30,6 +30,16 @@ config TPL_CLK setting up clocks within TPL, and allows the same drivers to be used as U-Boot proper. +config VPL_CLK + bool "Enable clock support in VPL" + depends on CLK && VPL_DM + help + The clock subsystem adds a small amount of overhead to the image. + If this is acceptable and you have a need to use clock drivers in + SPL, enable this option. It might provide a cleaner interface to + setting up clocks within TPL, and allows the same drivers to be + used as U-Boot proper. + config CLK_BCM6345 bool "Clock controller driver for BCM6345" depends on CLK && ARCH_BMIPS diff --git a/drivers/core/Makefile b/drivers/core/Makefile index 5edd4e41357..07a0886383f 100644 --- a/drivers/core/Makefile +++ b/drivers/core/Makefile @@ -5,7 +5,7 @@ obj-y += device.o fdtaddr.o lists.o root.o uclass.o util.o obj-$(CONFIG_$(SPL_TPL_)ACPIGEN) += acpi.o obj-$(CONFIG_DEVRES) += devres.o -obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE) += device-remove.o +obj-$(CONFIG_$(SPL_TPL_)DM_DEVICE_REMOVE) += device-remove.o obj-$(CONFIG_$(SPL_)SIMPLE_BUS) += simple-bus.o obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o obj-$(CONFIG_DM) += dump.o diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index de4dc51d4b4..36a0074f5b9 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -36,6 +36,17 @@ config TPL_DM_GPIO particular GPIOs that they provide. The uclass interface is defined in include/asm-generic/gpio.h. +config VPL_DM_GPIO + bool "Enable Driver Model for GPIO drivers in VPL" + depends on DM_GPIO && VPL_DM && VPL_GPIO + default y + help + Enable driver model for GPIO access in VPL. The standard GPIO + interface (gpio_get_value(), etc.) is then implemented by + the GPIO uclass. Drivers provide methods to query the + particular GPIOs that they provide. The uclass interface + is defined in include/asm-generic/gpio.h. + config GPIO_HOG bool "Enable GPIO hog support" depends on DM_GPIO diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 35d6e2c8ec5..31f9cb44769 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -25,6 +25,17 @@ config SPL_DM_I2C device (bus child) info is kept as parent platdata. The interface is defined in include/i2c.h. +config VPL_DM_I2C + bool "Enable Driver Model for I2C drivers in VPL" + depends on VPL_DM && DM_I2C + default y + help + Enable driver model for I2C. The I2C uclass interface: probe, read, + write and speed, is implemented with the bus drivers operations, + which provide methods for bus setting and data transfer. Each chip + device (bus child) info is kept as parent platdata. The interface + is defined in include/i2c.h. + config I2C_CROS_EC_TUNNEL tristate "Chrome OS EC tunnel I2C bus" depends on CROS_EC diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 997b7132211..12f419771a2 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -122,6 +122,16 @@ config TPL_CROS_EC control access to the battery and main PMIC depending on the device. You can use the 'crosec' command to access it. +config VPL_CROS_EC + bool "Enable Chrome OS EC in VPL" + depends on VPL + help + Enable access to the Chrome OS EC in VPL. This is a separate + microcontroller typically available on a SPI bus on Chromebooks. It + provides access to the keyboard, some internal storage and may + control access to the battery and main PMIC depending on the + device. You can use the 'crosec' command to access it. + config CROS_EC_I2C bool "Enable Chrome OS EC I2C driver" depends on CROS_EC @@ -185,6 +195,15 @@ config TPL_CROS_EC_SANDBOX EC flash read/write/erase support and a few other things. It is enough to perform a Chrome OS verified boot on sandbox. +config VPL_CROS_EC_SANDBOX + bool "Enable Chrome OS EC sandbox driver in VPL" + depends on VPL_CROS_EC && SANDBOX + help + Enable a sandbox emulation of the Chrome OS EC in VPL. This supports + keyboard (use the -l flag to enable the LCD), verified boot context, + EC flash read/write/erase support and a few other things. It is + enough to perform a Chrome OS verified boot on sandbox. + config CROS_EC_SPI bool "Enable Chrome OS EC SPI driver" depends on CROS_EC diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 77fb8511144..d967a82f726 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -89,20 +89,34 @@ config TPL_PINCTRL This option is an TPL variant of the PINCTRL option. See the help of PINCTRL for details. +config VPL_PINCTRL + bool "Support pin controllers in VPL" + depends on VPL && VPL_DM + help + This option is an VPL variant of the PINCTRL option. + See the help of PINCTRL for details. + config SPL_PINCTRL_FULL bool "Support full pin controllers in SPL" depends on SPL_PINCTRL && SPL_OF_CONTROL default n if TARGET_STM32F746_DISCO default y help - This option is an SPL-variant of the PINCTRL_FULL option. + This option is an SPL variant of the PINCTRL_FULL option. See the help of PINCTRL_FULL for details. config TPL_PINCTRL_FULL bool "Support full pin controllers in TPL" depends on TPL_PINCTRL && TPL_OF_CONTROL help - This option is an TPL-variant of the PINCTRL_FULL option. + This option is a TPL variant of the PINCTRL_FULL option. + See the help of PINCTRL_FULL for details. + +config VPL_PINCTRL_FULL + bool "Support full pin controllers in VPL" + depends on VPL_PINCTRL && VPL_OF_CONTROL + help + This option is a VPL variant of the PINCTRL_FULL option. See the help of PINCTRL_FULL for details. config SPL_PINCTRL_GENERIC diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index cbdfddb80f6..3de6d3fb4d8 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -32,6 +32,15 @@ config TPL_DM_RTC drivers to perform the actual functions. See rtc.h for a description of the API. +config VPL_DM_RTC + bool "Enable Driver Model for RTC drivers in VPL" + depends on VPL_DM + help + Enable drver model for real-time-clock drivers. The RTC uclass + then provides the rtc_get()/rtc_set() interface, delegating to + drivers to perform the actual functions. See rtc.h for a + description of the API. + config RTC_ENABLE_32KHZ_OUTPUT bool "Enable RTC 32Khz output" help diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 961e3fb0314..a8fdffe2ccf 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -63,6 +63,16 @@ config TPL_SERIAL_PRESENT This option enables the full UART in TPL, so if is it disabled, the full UART driver will be omitted, thus saving space. +config VPL_SERIAL_PRESENT + bool "Provide a serial driver in VPL" + depends on DM_SERIAL && VPL + default y + help + In very space-constrained devices even the full UART driver is too + large. In this case the debug UART can still be used in some cases. + This option enables the full UART in TPL, so if is it disabled, + the full UART driver will be omitted, thus saving space. + # Logic to allow us to use the imply keyword to set what the default port # should be. The default is otherwise 1. config CONS_INDEX_0 @@ -172,6 +182,16 @@ config TPL_DM_SERIAL implements serial_putc() etc. The uclass interface is defined in include/serial.h. +config VPL_DM_SERIAL + bool "Enable Driver Model for serial drivers in VPL" + depends on DM_SERIAL + default y if VPL && DM_SERIAL + help + Enable driver model for serial in VPL. This replaces + drivers/serial/serial.c with the serial uclass, which + implements serial_putc() etc. The uclass interface is + defined in include/serial.h. + config DEBUG_UART bool "Enable an early debug UART for debugging" help diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig index ac77ffbc8be..fec6fed6c31 100644 --- a/drivers/sysreset/Kconfig +++ b/drivers/sysreset/Kconfig @@ -31,6 +31,16 @@ config TPL_SYSRESET to effect a reset. The uclass will try all available drivers when reset_walk() is called. +config VPL_SYSRESET + bool "Enable support for system reset drivers in VPL mode" + depends on SYSRESET && VPL_DM + default y if TPL_SYSRESET + help + Enable system reset drivers which can be used to reset the CPU or + board. Each driver can provide a reset method which will be called + to effect a reset. The uclass will try all available drivers when + reset_walk() is called. + if SYSRESET config SYSRESET_CMD_RESET diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index ee81dfa7768..ac601f00ecf 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -27,6 +27,16 @@ config TPL_TIMER function. This enables the drivers in drivers/timer as part of an TPL build. +config VPL_TIMER + bool "Enable driver model for timer drivers in VPL" + depends on TIMER && VPL + default y if TPL_TIMER + help + Enable support for timer drivers in VPL. These can be used to get + a timer value when in VPL, or perhaps for implementing a delay + function. This enables the drivers in drivers/timer as part of an + TPL build. + config TIMER_EARLY bool "Allow timer to be used early in U-Boot" depends on TIMER diff --git a/lib/Kconfig b/lib/Kconfig index ad0cd52edd8..1706eef91c5 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -72,6 +72,11 @@ config TPL_PRINTF select TPL_SPRINTF select TPL_STRTO if !TPL_USE_TINY_PRINTF +config VPL_PRINTF + bool + select VPL_SPRINTF + select VPL_STRTO if !VPL_USE_TINY_PRINTF + config SPRINTF bool default y @@ -82,6 +87,9 @@ config SPL_SPRINTF config TPL_SPRINTF bool +config VPL_SPRINTF + bool + config SSCANF bool default n @@ -96,6 +104,9 @@ config SPL_STRTO config TPL_STRTO bool +config VPL_STRTO + bool + config IMAGE_SPARSE bool @@ -148,6 +159,17 @@ config TPL_USE_TINY_PRINTF The supported format specifiers are %c, %s, %u/%d and %x. +config VPL_USE_TINY_PRINTF + bool "Enable tiny printf() version for VPL" + depends on VPL + help + This option enables a tiny, stripped down printf version. + This should only be used in space limited environments, + like SPL versions with hard memory limits. This version + reduces the code size by about 2.5KiB on armv7. + + The supported format specifiers are %c, %s, %u/%d and %x. + config PANIC_HANG bool "Do not reset the system on fatal error" help @@ -331,6 +353,17 @@ config TPL_TPM for the low-level TPM interface, but only one TPM is supported at a time by the TPM library. +config VPL_TPM + bool "Trusted Platform Module (TPM) Support in VPL" + depends on VPL_DM + help + This enables support for TPMs which can be used to provide security + features for your board. The TPM can be connected via LPC or I2C + and a sandbox TPM is provided for testing purposes. Use the 'tpm' + command to interactive the TPM. Driver model support is provided + for the low-level TPM interface, but only one TPM is supported at + a time by the TPM library. + endmenu menu "Android Verified Boot" @@ -518,6 +551,12 @@ config SPL_LZMA help This enables support for LZMA compression algorithm for SPL boot. +config VPL_LZMA + bool "Enable LZMA decompression support for VPL build" + default y if LZMA + help + This enables support for LZMA compression algorithm for VPL boot. + config SPL_LZO bool "Enable LZO decompression support in SPL" help @@ -598,6 +637,7 @@ config OF_LIBFDT_OVERLAY config SPL_OF_LIBFDT bool "Enable the FDT library for SPL" + depends on SPL_LIBGENERIC_SUPPORT default y if SPL_OF_CONTROL help This enables the FDT library (libfdt). It provides functions for @@ -619,6 +659,7 @@ config SPL_OF_LIBFDT_ASSUME_MASK config TPL_OF_LIBFDT bool "Enable the FDT library for TPL" + depends on TPL_LIBGENERIC_SUPPORT default y if TPL_OF_CONTROL help This enables the FDT library (libfdt). It provides functions for @@ -638,6 +679,27 @@ config TPL_OF_LIBFDT_ASSUME_MASK 0xff means all assumptions are made and any invalid data may cause unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h +config VPL_OF_LIBFDT + bool "Enable the FDT library for VPL" + default y if VPL_OF_CONTROL && !VPL_OF_PLATDATA + help + This enables the FDT library (libfdt). It provides functions for + accessing binary device tree images in memory, such as adding and + removing nodes and properties, scanning through the tree and finding + particular compatible nodes. The library operates on a flattened + version of the device tree. + +config VPL_OF_LIBFDT_ASSUME_MASK + hex "Mask of conditions to assume for libfdt" + depends on VPL_OF_LIBFDT || FIT + default 0xff + help + Use this to change the assumptions made by libfdt in SPL about the + device tree it is working with. A value of 0 means that no assumptions + are made, and libfdt is able to deal with malicious data. A value of + 0xff means all assumptions are made and any invalid data may cause + unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h + config FDT_FIXUP_PARTITIONS bool "overwrite MTD partitions in DTS through defined in 'mtdparts'" depends on OF_LIBFDT