Convert CONFIG_FIXED_SDHCI_ALIGNED_BUFFER to Kconfig
authorChris Packham <judge.packham@gmail.com>
Sat, 28 May 2022 23:13:17 +0000 (11:13 +1200)
committerTom Rini <trini@konsulko.com>
Mon, 6 Jun 2022 16:09:29 +0000 (12:09 -0400)
CONFIG_FIXED_SDHCI_ALIGNED_BUFFER is needed on some Marvell SoCs when
booting from MMC. All existing usages of this have the same value so
make this the default and have the Kconfig option depend on SPL &&
MVEBU_SPL_BOOT_DEVICE_MMC.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/mmc/Kconfig
include/configs/clearfog.h
include/configs/controlcenterdc.h
include/configs/db-88f6820-gp.h
include/configs/helios4.h
include/configs/turris_omnia.h

index 5e2921c..c8f9709 100644 (file)
@@ -484,6 +484,19 @@ config SPL_MMC_SDHCI_ADMA
          This enables support for the ADMA (Advanced DMA) defined
          in the SD Host Controller Standard Specification Version 3.00 in SPL.
 
+config FIXED_SDHCI_ALIGNED_BUFFER
+       hex "SDRAM address for fixed buffer"
+       depends on SPL && MVEBU_SPL_BOOT_DEVICE_MMC
+       default 0x00180000
+       help
+         On the Marvell Armada 38x when the SPL runs it located in internal
+         SRAM which is the L2 cache locked to memory. When the MMC buffers
+         are located on the stack (or bss), the SDIO controller (SDHCI) can't
+         write into this L2 cache memory.
+
+         This specifies the address of a fixed buffer located in SDRAM that
+         will be used for all SDHCI transfers in the SPL.
+
 config MMC_SDHCI_ASPEED
        bool "Aspeed SDHCI controller"
        depends on ARCH_ASPEED
index 4aaeba3..8497fe2 100644 (file)
        "fdt_high=0x10000000\0"         \
        "initrd_high=0x10000000\0"
 
-/* SPL */
-
-#if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
-/* SPL related MMC defines */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
-#endif
-#endif
-
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
index 571fdb3..8b0d260 100644 (file)
 #define SPL_BOOT_SDIO_MMC_CARD         2
 #define CONFIG_SPL_BOOT_DEVICE         SPL_BOOT_SPI_NOR_FLASH
 
-#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
-/* SPL related MMC defines */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
-#endif
-#endif
-
 /*
  * Environment Configuration
  */
index acc09da..e01dd49 100644 (file)
 #define SPL_BOOT_SDIO_MMC_CARD         2
 #define CONFIG_SPL_BOOT_DEVICE         SPL_BOOT_SPI_NOR_FLASH
 
-#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
-/* SPL related MMC defines */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
-#endif
-#endif
-
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
index c8aa564..23eb0d4 100644 (file)
        "fdt_high=0x10000000\0"         \
        "initrd_high=0x10000000\0"
 
-/* SPL */
-
-#if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
-/* SPL related MMC defines */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
-#endif
-#endif
-
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
index c4671f1..9013d9a 100644 (file)
        "fdt_high=0x10000000\0"         \
        "initrd_high=0x10000000\0"
 
-#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
-/* SPL related MMC defines */
-# ifdef CONFIG_SPL_BUILD
-#  define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER    0x00180000      /* in SDRAM */
-# endif
-#endif
-
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros