Skip to content

Commit

Permalink
vpl: Add Kconfig options for VPL
Browse files Browse the repository at this point in the history
Add VPL versions of commonly used Kconfig options.

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 authored and trini committed May 2, 2022
1 parent f86ca5a commit 747093d
Show file tree
Hide file tree
Showing 18 changed files with 612 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ config VALGRIND
it can be handled accurately by Valgrind. If you aren't planning on
using valgrind to debug U-Boot, say 'n'.

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
Expand Down
67 changes: 67 additions & 0 deletions common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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
Expand Down Expand Up @@ -262,6 +271,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
Expand Down Expand Up @@ -431,6 +449,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
Expand Down Expand Up @@ -777,6 +836,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 && VPL_LIBGENERIC_SUPPORT && VPL_LIBCOMMON_SUPPORT
default y if VPL
help
This enables a bloblist in VPL. The bloblist is set up in VPL and
passed to SPL and U-Boot proper.

if BLOBLIST

choice
Expand Down
219 changes: 219 additions & 0 deletions common/spl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,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
Expand Down Expand Up @@ -1632,6 +1639,218 @@ 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_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 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 VPL_CACHE
depends on CACHE
bool "Support cache drivers in VPL"
help
Enable support for cache drivers in VPL.

config VPL_CRC32
bool "Support CRC32 in VPL"
default y if VPL_ENV_SUPPORT || VPL_BLOBLIST
help
Enable this to support CRC32 in uImages or FIT images within VPL.
This is a 32-bit checksum value that can be used to verify images.
For FIT images, this is the least secure type of checksum, suitable
for detected accidental image corruption. For secure applications you
should consider SHA1 or SHA256.

config VPL_DM_SPI
bool "Support SPI DM drivers in VPL"
help
Enable support for SPI DM drivers in VPL.

config VPL_DM_SPI_FLASH
bool "Support SPI DM FLASH drivers in VPL"
help
Enable support for SPI DM flash drivers in 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 a
VPL build.

config VPL_DRIVERS_MISC
bool "Support misc drivers"
default y if TPL_DRIVERS_MISC
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 a 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
bool "Support GPIO in VPL"
default y if SPL_GPIO
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 VPL to enable a 'sign-of-life' LED,
for example. Enable this option to build the drivers in
drivers/gpio as part of a VPL build.

config VPL_HANDOFF
bool "Pass hand-off information from VPL to SPL and U-Boot proper"
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 U-Boot
proper. The information is also available to VPL if it is useful
there.

config VPL_HASH
bool "Support hashing drivers in VPL"
depends on VPL
select SHA1
select SHA256
help
Enable hashing drivers in VPL. 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 a VPL build.

config VPL_I2C_SUPPORT
bool "Support I2C in VPL"
default y if SPL_I2C_SUPPORT
help
Enable support for the I2C bus in VPL. 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
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 a VPL
build.

config VPL_SERIAL
bool "Support serial"
default y if TPL_SERIAL
select VPL_PRINTF
select VPL_STRTO
help
Enable support for serial in VPL. See SPL_SERIAL_SUPPORT for
details.

config VPL_SIZE_LIMIT
hex "Maximum size of VPL image"
depends on VPL
default 0x0
help
Specifies the maximum length of the U-Boot VPL image.
If this value is zero, it is ignored.

config VPL_SPI
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 a
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 # VPL

config SPL_AT91_MCK_BYPASS
bool "Use external clock signal as a source of main clock for AT91 platforms"
depends on ARCH_AT91
Expand Down
12 changes: 12 additions & 0 deletions drivers/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ config TPL_BLK
be partitioned into several areas, called 'partitions' in U-Boot.
A filesystem can be placed in each partition.

config VPL_BLK
bool "Support block devices in VPL"
depends on VPL_DM && BLK
default y
help
Enable support for block devices, such as SCSI, MMC and USB
flash sticks. These provide a block-level interface which permits
reading, writing and (in some cases) erasing blocks. Block
devices often have a partition table which allows the device to
be partitioned into several areas, called 'partitions' in U-Boot.
A filesystem can be placed in each partition.

config BLOCK_CACHE
bool "Use block device cache"
depends on BLK
Expand Down
26 changes: 26 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ 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
default y
help
This clock driver adds support for enabling and disabling peripheral
clocks on BCM6345 SoCs. HW has no rate changing capabilities.

config CLK_BOSTON
def_bool y if TARGET_BOSTON
depends on CLK
select REGMAP
select SYSCON
help
Enable this to support the clocks

config SPL_CLK_CCF
bool "SPL Common Clock Framework [CCF] support "
depends on SPL
Expand Down
Loading

0 comments on commit 747093d

Please sign in to comment.