Merge branch '2022-05-11-Kconfig-cleanups-etc'
[platform/kernel/u-boot.git] / common / spl / Kconfig
index 34f6fc2..50ff113 100644 (file)
@@ -1,4 +1,4 @@
-menu "SPL / TPL"
+menu "SPL / TPL / VPL"
 
 config SUPPORT_SPL
        bool
 
 config SUPPORT_SPL
        bool
@@ -6,6 +6,9 @@ config SUPPORT_SPL
 config SUPPORT_TPL
        bool
 
 config SUPPORT_TPL
        bool
 
+config SUPPORT_VPL
+       bool
+
 config SPL_DFU_NO_RESET
        bool
 
 config SPL_DFU_NO_RESET
        bool
 
@@ -101,6 +104,18 @@ config SPL_SHOW_ERRORS
 
          This adds a small amount to SPL code size, perhaps 100 bytes.
 
 
          This adds a small amount to SPL code size, perhaps 100 bytes.
 
+config SPL_BINMAN_SYMBOLS
+       bool "Declare binman symbols in SPL"
+       depends on SPL_FRAMEWORK && BINMAN
+       default y
+       help
+         This enables use of symbols in SPL which refer to U-Boot, enabling SPL
+         to obtain the location of U-Boot simply by calling spl_get_image_pos()
+         and spl_get_image_size().
+
+         For this to work, you must have a U-Boot image in the binman image, so
+         binman can update SPL with the location of it.
+
 menu "PowerPC and LayerScape SPL Boot options"
 
 config SPL_NAND_BOOT
 menu "PowerPC and LayerScape SPL Boot options"
 
 config SPL_NAND_BOOT
@@ -174,6 +189,13 @@ config SPL_BOARD_INIT
          spl_board_init() from board_init_r(). This function should be
          provided by the board.
 
          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
 config SPL_BOOTROM_SUPPORT
        bool "Support returning to the BOOTROM"
        help
@@ -197,15 +219,17 @@ config SPL_BOOTCOUNT_LIMIT
 config SPL_RAW_IMAGE_SUPPORT
        bool "Support SPL loading and booting of RAW images"
        default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
 config SPL_RAW_IMAGE_SUPPORT
        bool "Support SPL loading and booting of RAW images"
        default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
-       default y if !TI_SECURE_DEVICE
+       default y
+       depends on !TI_SECURE_DEVICE
        help
          SPL will support loading and booting a RAW image when this option
          is y. If this is not set, SPL will move on to other available
          boot media to find a suitable image.
 
        help
          SPL will support loading and booting a RAW image when this option
          is y. If this is not set, SPL will move on to other available
          boot media to find a suitable image.
 
-config SPL_LEGACY_IMAGE_SUPPORT
+config SPL_LEGACY_IMAGE_FORMAT
        bool "Support SPL loading and booting of Legacy images"
        bool "Support SPL loading and booting of Legacy images"
-       default y if !TI_SECURE_DEVICE && !SPL_LOAD_FIT
+       default y if !SPL_LOAD_FIT
+       depends on !TI_SECURE_DEVICE
        help
          SPL will support loading and booting Legacy images when this option
          is y. If this is not set, SPL will move on to other available
        help
          SPL will support loading and booting Legacy images when this option
          is y. If this is not set, SPL will move on to other available
@@ -213,7 +237,7 @@ config SPL_LEGACY_IMAGE_SUPPORT
 
 config SPL_LEGACY_IMAGE_CRC_CHECK
        bool "Check CRC of Legacy images"
 
 config SPL_LEGACY_IMAGE_CRC_CHECK
        bool "Check CRC of Legacy images"
-       depends on SPL_LEGACY_IMAGE_SUPPORT
+       depends on SPL_LEGACY_IMAGE_FORMAT
        select SPL_CRC32
        help
          Enable this to check the CRC of Legacy images. While this increases
        select SPL_CRC32
        help
          Enable this to check the CRC of Legacy images. While this increases
@@ -290,6 +314,16 @@ config SPL_READ_ONLY
          writeable memory) of anything it wants to modify, such as
          device-private data.
 
          writeable memory) of anything it wants to modify, such as
          device-private data.
 
+config TPL_SEPARATE_BSS
+       bool "BSS section is in a different memory region from text"
+       default y if SPL_SEPARATE_BSS
+       help
+         Some platforms need a large BSS region in TPL and can provide this
+         because RAM is already set up. In this case BSS can be moved to RAM.
+         This option should then be enabled so that the correct device tree
+         location is used. Normally we put the device tree at the end of BSS
+         but with this option enabled, it goes at _image_binary_end.
+
 config SPL_BANNER_PRINT
        bool "Enable output of the SPL banner 'U-Boot SPL ...'"
        default y
 config SPL_BANNER_PRINT
        bool "Enable output of the SPL banner 'U-Boot SPL ...'"
        default y
@@ -419,7 +453,8 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
 
 config SPL_CRC32
        bool "Support CRC32"
 
 config SPL_CRC32
        bool "Support CRC32"
-       default y if SPL_LEGACY_IMAGE_SUPPORT
+       default y if SPL_LEGACY_IMAGE_FORMAT || SPL_EFI_PARTITION
+       default y if SPL_ENV_SUPPORT || TPL_BLOBLIST
        help
          Enable this to support CRC32 in uImages or FIT images within SPL.
          This is a 32-bit checksum value that can be used to verify images.
        help
          Enable this to support CRC32 in uImages or FIT images within SPL.
          This is a 32-bit checksum value that can be used to verify images.
@@ -655,7 +690,8 @@ config SYS_MMCSD_FS_BOOT_PARTITION
        default 1
        help
          Partition on the MMC to load U-Boot from when the MMC is being
        default 1
        help
          Partition on the MMC to load U-Boot from when the MMC is being
-         used in fs mode
+         used in fs mode.
+         Use -1 as a special value to use the first bootable partition.
 
 config SPL_MMC_TINY
        bool "Tiny MMC framework in SPL"
 
 config SPL_MMC_TINY
        bool "Tiny MMC framework in SPL"
@@ -918,6 +954,22 @@ config SYS_OS_BASE
 
 endif # SPL_OS_BOOT
 
 
 endif # SPL_OS_BOOT
 
+config SPL_FALCON_BOOT_MMCSD
+       bool "Enable Falcon boot from MMC or SD media"
+       depends on SPL_OS_BOOT && SPL_MMC
+       help
+         Select this if the Falcon mode OS image mode is on MMC or SD media.
+
+config SYS_MMCSD_RAW_MODE_KERNEL_SECTOR
+       hex "Falcon mode: Sector to load kernel uImage from MMC"
+       depends on SPL_FALCON_BOOT_MMCSD
+       help
+         When Falcon mode is used with an MMC or SD media, SPL needs to know
+         where to look for the kernel uImage. The image is expected to begin
+         at the raw MMC specified in this config.
+         Note that the Falcon mode image can also be a FIT, if FIT support is
+         enabled.
+
 config SPL_PAYLOAD
        string "SPL payload"
        default "tpl/u-boot-with-tpl.bin" if TPL
 config SPL_PAYLOAD
        string "SPL payload"
        default "tpl/u-boot-with-tpl.bin" if TPL
@@ -1263,11 +1315,11 @@ config SPL_AM33XX_ENABLE_RTC32K_OSC
          Enable access to the AM33xx RTC and select the external 32kHz clock
          source.
 
          Enable access to the AM33xx RTC and select the external 32kHz clock
          source.
 
-config SPL_OPTEE
-       bool "Support OP-TEE Trusted OS"
+config SPL_OPTEE_IMAGE
+       bool "Support OP-TEE Trusted OS image in SPL"
        depends on ARM
        help
        depends on ARM
        help
-         OP-TEE is an open source Trusted OS  which is loaded by SPL.
+         OP-TEE is an open source Trusted OS which is loaded by SPL.
          More detail at: https://github.com/OP-TEE/optee_os
 
 config SPL_OPENSBI
          More detail at: https://github.com/OP-TEE/optee_os
 
 config SPL_OPENSBI
@@ -1304,6 +1356,18 @@ config TPL_SIZE_LIMIT
          Specifies the maximum length of the U-Boot TPL image.
          If this value is zero, it is ignored.
 
          Specifies the maximum length of the U-Boot TPL image.
          If this value is zero, it is ignored.
 
+config TPL_BINMAN_SYMBOLS
+       bool "Declare binman symbols in TPL"
+       depends on SPL_FRAMEWORK && BINMAN
+       default y
+       help
+         This enables use of symbols in TPL which refer to U-Boot, enabling TPL
+         to obtain the location of U-Boot simply by calling spl_get_image_pos()
+         and spl_get_image_size().
+
+         For this to work, you must have a U-Boot image in the binman image, so
+         binman can update TPL with the location of it.
+
 config TPL_FRAMEWORK
        bool "Support TPL based upon the common SPL framework"
        default y if SPL_FRAMEWORK
 config TPL_FRAMEWORK
        bool "Support TPL based upon the common SPL framework"
        default y if SPL_FRAMEWORK
@@ -1350,14 +1414,6 @@ config TPL_LDSCRIPT
          May be left empty to trigger the Makefile infrastructure to
          fall back to the linker-script used for the SPL stage.
 
          May be left empty to trigger the Makefile infrastructure to
          fall back to the linker-script used for the SPL stage.
 
-config TPL_NEEDS_SEPARATE_TEXT_BASE
-       bool "TPL needs a separate text-base"
-       depends on TPL
-       help
-         Enable, if the TPL stage should not inherit its text-base
-         from the SPL stage.  When enabled, a base address for the
-         .text sections of the TPL stage has to be set below.
-
 config TPL_NEEDS_SEPARATE_STACK
        bool "TPL needs a separate initial stack-pointer"
        depends on TPL
 config TPL_NEEDS_SEPARATE_STACK
        bool "TPL needs a separate initial stack-pointer"
        depends on TPL
@@ -1379,7 +1435,7 @@ config TPL_POWER
 
 config TPL_TEXT_BASE
        hex "Base address for the .text section of the TPL stage"
 
 config TPL_TEXT_BASE
        hex "Base address for the .text section of the TPL stage"
-       depends on TPL_NEEDS_SEPARATE_TEXT_BASE
+       default 0
        help
          The base address for the .text section of the TPL stage.
 
        help
          The base address for the .text section of the TPL stage.
 
@@ -1419,6 +1475,16 @@ config TPL_BOOTROM_SUPPORT
          BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
          boot device list, if not implemented for a given board)
 
          BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
          boot device list, if not implemented for a given board)
 
+config TPL_CRC32
+       bool "Support CRC32 in TPL"
+       default y if TPL_ENV_SUPPORT || TPL_BLOBLIST
+       help
+         Enable this to support CRC32 in uImages or FIT images within SPL.
+         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 TPL_DRIVERS_MISC
        bool "Support misc drivers in TPL"
        help
 config TPL_DRIVERS_MISC
        bool "Support misc drivers in TPL"
        help
@@ -1575,6 +1641,218 @@ config TPL_YMODEM_SUPPORT
 
 endif # TPL
 
 
 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
 config SPL_AT91_MCK_BYPASS
        bool "Use external clock signal as a source of main clock for AT91 platforms"
        depends on ARCH_AT91