Merge tag 'dm-pull-28jun22' of https://source.denx.de/u-boot/custodians/u-boot-dm...
authorTom Rini <trini@konsulko.com>
Fri, 8 Jul 2022 18:39:07 +0000 (14:39 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 8 Jul 2022 18:39:07 +0000 (14:39 -0400)
nman external-symbol improvements
Driver model memory-usage reporting
patman test-reporting improvements
Add bloblist design goals

1  2 
common/spl/Kconfig
drivers/core/Kconfig
include/spl.h

diff --combined common/spl/Kconfig
@@@ -82,7 -82,6 +82,7 @@@ config SPL_MAX_SIZ
        default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x20000 && !MACH_SUN50I_H616
        default 0x7000 if RCAR_GEN3
        default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0
 +      default 0x10000 if ASPEED_AST2600
        default 0x0
        help
          Maximum size of the SPL image (text, data, rodata, and linker lists
@@@ -191,12 -190,25 +191,25 @@@ config SPL_BINMAN_SYMBOL
        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().
+         This enables use of symbols in SPL which refer to other entries in
+         the same binman image as the SPL. These can be declared with the
+         binman_sym_declare(type, entry, prop) macro and accessed by the
+         binman_sym(type, entry, prop) macro defined in binman_sym.h.
  
-         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.
+         See tools/binman/binman.rst for a detailed explanation.
+ config SPL_BINMAN_UBOOT_SYMBOLS
+       bool "Declare binman symbols for U-Boot phases in SPL"
+       depends on SPL_BINMAN_SYMBOLS
+       default n if ARCH_IMX8M
+       default y
+       help
+         This enables use of symbols in SPL which refer to U-Boot phases,
+         enabling SPL to obtain the location and size of its next phase simply
+         by calling spl_get_image_pos() and spl_get_image_size().
+         For this to work, you must have all U-Boot phases in the same binman
+         image, so binman can update SPL with the locations of everything.
  
  source "common/spl/Kconfig.nxp"
  
@@@ -222,18 -234,6 +235,18 @@@ config SPL_HANDOF
  
  config SPL_LDSCRIPT
        string "Linker script for the SPL stage"
 +      default "arch/arm/cpu/arm926ejs/sunxi/u-boot-spl.lds" if MACH_SUNIV
 +      default "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds" if ARCH_SUNXI && !MACH_SUNIV && !ARM64
 +      default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
 +      default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
 +      default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || ARCH_LS1046A || ARCH_LS2080A
 +      default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
 +      default "arch/arm/mach-at91/arm926ejs/u-boot-spl.lds" if ARCH_AT91 && CPU_ARM926EJS
 +      default "arch/arm/mach-at91/armv7/u-boot-spl.lds" if ARCH_AT91 && CPU_V7A
 +      default "arch/arm/mach-omap2/u-boot-spl.lds" if ARCH_MX6 || ARCH_OMAP2PLUS || (ARCH_K3 && !ARM64)
 +      default "arch/arm/mach-zynq/u-boot-spl.lds" if ARCH_ZYNQ
 +      default "board/samsung/common/exynos-uboot-spl.lds" if ARCH_EXYNOS5 || ARCH_EXYNOS4
 +      default "board/davinci/da8xxevm/u-boot-spl-da850evm.lds" if ARCH_DAVINCI
        default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
        help
          The SPL stage will usually require a different linker-script
@@@ -1318,13 -1318,6 +1331,13 @@@ config SPL_USB_STORAG
          config options. This enables loading from USB using a configured
          device.
  
 +config SYS_USB_FAT_BOOT_PARTITION
 +      int "Partition on USB to use to load U-Boot from"
 +      depends on SPL_USB_STORAGE
 +      default 1
 +      help
 +        Partition on the USB storage device to load U-Boot from
 +
  config SPL_USB_GADGET
        bool "Suppport USB Gadget drivers"
        help
diff --combined drivers/core/Kconfig
@@@ -75,6 -75,27 +75,27 @@@ config DM_DEBU
        help
          Say Y here if you want to compile in debug messages in DM core.
  
+ config DM_STATS
+       bool "Collect and show driver model stats"
+       depends on DM
+       default y if SANDBOX
+       help
+         Enable this to collect and display memory statistics about driver
+         model. This can help to figure out where all the memory is going and
+         to find optimisations.
+         To display the memory stats, use the 'dm mem' command.
+ config SPL_DM_STATS
+       bool "Collect and show driver model stats in SPL"
+       depends on DM_SPL
+       help
+         Enable this to collect and display memory statistics about driver
+         model. This can help to figure out where all the memory is going and
+         to find optimisations.
+         The stats are displayed just before SPL boots to the next phase.
  config DM_DEVICE_REMOVE
        bool "Support device removal"
        depends on DM
@@@ -224,7 -245,7 +245,7 @@@ config SPL_SYSCO
  
  config TPL_SYSCON
        bool "Support system controllers in TPL"
 -      depends on SPL_REGMAP
 +      depends on TPL_REGMAP
        help
          Many SoCs have a number of system controllers which are dealt with
          as a group by a single driver. Some common functionality is provided
diff --combined include/spl.h
@@@ -288,6 -288,8 +288,8 @@@ binman_sym_extern(ulong, u_boot_any, im
  binman_sym_extern(ulong, u_boot_any, size);
  binman_sym_extern(ulong, u_boot_spl, image_pos);
  binman_sym_extern(ulong, u_boot_spl, size);
+ binman_sym_extern(ulong, u_boot_vpl, image_pos);
+ binman_sym_extern(ulong, u_boot_vpl, size);
  
  /**
   * spl_get_image_pos() - get the image position of the next phase
@@@ -378,22 -380,6 +380,22 @@@ void preloader_console_init(void)
  u32 spl_boot_device(void);
  
  /**
 + * spl_spi_boot_bus() - Lookup function for the SPI boot bus source.
 + *
 + * This function returns the SF bus to load from.
 + * If not overridden, it is weakly defined in common/spl/spl_spi.c.
 + */
 +u32 spl_spi_boot_bus(void);
 +
 +/**
 + * spl_spi_boot_cs() - Lookup function for the SPI boot CS source.
 + *
 + * This function returns the SF CS to load from.
 + * If not overridden, it is weakly defined in common/spl/spl_spi.c.
 + */
 +u32 spl_spi_boot_cs(void);
 +
 +/**
   * spl_mmc_boot_mode() - Lookup function for the mode of an MMC boot source.
   * @boot_device:      ID of the device which the MMC driver wants to read
   *                    from.  Common values are e.g. BOOT_DEVICE_MMC1,