[PATCH 2/4] Convert CONFIG_SPL_SYS_MALLOC_SIMPLE to Kconfig

Tom Rini trini at konsulko.com
Mon May 23 21:13:51 CEST 2022


This converts the following to Kconfig:
   CONFIG_SPL_SYS_MALLOC_SIMPLE

The problem here is that a few platforms have been doing:
#ifdef CONFIG_SPL_BUILD
#define CONFIG_SYS_MALLOC_SIMPLE
#endif

instead of defining CONFIG_SPL_SYS_MALLOC_SIMPLE directly.  Correct this
and update the documentation in a few places to match usage.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 configs/clearfog_defconfig          | 1 +
 configs/db-88f6720_defconfig        | 1 +
 configs/db-88f6820-amc_defconfig    | 1 +
 configs/db-88f6820-gp_defconfig     | 1 +
 configs/db-mv784mp-gp_defconfig     | 1 +
 configs/ds414_defconfig             | 1 +
 configs/helios4_defconfig           | 1 +
 configs/maxbcm_defconfig            | 1 +
 configs/theadorable_debug_defconfig | 1 +
 configs/x530_defconfig              | 1 +
 doc/develop/driver-model/design.rst | 2 +-
 drivers/core/Kconfig                | 6 +++---
 include/configs/clearfog.h          | 4 ----
 include/configs/controlcenterdc.h   | 4 ----
 include/configs/db-88f6720.h        | 4 ----
 include/configs/db-88f6820-amc.h    | 4 ----
 include/configs/db-88f6820-gp.h     | 4 ----
 include/configs/db-mv784mp-gp.h     | 4 ----
 include/configs/ds414.h             | 4 ----
 include/configs/helios4.h           | 4 ----
 include/configs/maxbcm.h            | 4 ----
 include/configs/theadorable.h       | 4 ----
 include/configs/x530.h              | 4 ----
 23 files changed, 14 insertions(+), 48 deletions(-)

diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index c26ee5bfacac..7f4ecc3f3ee4 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -26,6 +26,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x22fd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_TLV_EEPROM=y
diff --git a/configs/db-88f6720_defconfig b/configs/db-88f6720_defconfig
index 8d48428c2257..5970e750a837 100644
--- a/configs/db-88f6720_defconfig
+++ b/configs/db-88f6720_defconfig
@@ -25,6 +25,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x1ffd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_I2C=y
diff --git a/configs/db-88f6820-amc_defconfig b/configs/db-88f6820-amc_defconfig
index 7a208ad819b1..aebc1f75fa62 100644
--- a/configs/db-88f6820-amc_defconfig
+++ b/configs/db-88f6820-amc_defconfig
@@ -26,6 +26,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x22fd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=96
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/db-88f6820-gp_defconfig b/configs/db-88f6820-gp_defconfig
index 339558545da5..934b36ae05f9 100644
--- a/configs/db-88f6820-gp_defconfig
+++ b/configs/db-88f6820-gp_defconfig
@@ -25,6 +25,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x22fd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_I2C=y
diff --git a/configs/db-mv784mp-gp_defconfig b/configs/db-mv784mp-gp_defconfig
index 22f76eba174c..b8444e1ab366 100644
--- a/configs/db-mv784mp-gp_defconfig
+++ b/configs/db-mv784mp-gp_defconfig
@@ -25,6 +25,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x1bfd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index 8e1f69d636b2..7c25cce8ff5e 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -33,6 +33,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x1bfd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig
index 30d65acbee99..6988e9bf0d4d 100644
--- a/configs/helios4_defconfig
+++ b/configs/helios4_defconfig
@@ -26,6 +26,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x22fd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_TLV_EEPROM=y
diff --git a/configs/maxbcm_defconfig b/configs/maxbcm_defconfig
index 442af9cb3826..ba0e2089f559 100644
--- a/configs/maxbcm_defconfig
+++ b/configs/maxbcm_defconfig
@@ -24,6 +24,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x1bfd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_I2C=y
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index c5bd8909c914..b6444b244082 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -29,6 +29,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x1bfd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_I2C=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=32
diff --git a/configs/x530_defconfig b/configs/x530_defconfig
index 67d082e883a3..73ea57891956 100644
--- a/configs/x530_defconfig
+++ b/configs/x530_defconfig
@@ -29,6 +29,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x22fd0
 CONFIG_SPL_BSS_MAX_SIZE=0x4000
 CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_WATCHDOG=y
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
diff --git a/doc/develop/driver-model/design.rst b/doc/develop/driver-model/design.rst
index 5f33f9fbb327..a75d637ec331 100644
--- a/doc/develop/driver-model/design.rst
+++ b/doc/develop/driver-model/design.rst
@@ -1135,7 +1135,7 @@ constrained systems.
 To enable driver model in SPL, define CONFIG_SPL_DM. You might want to
 consider the following option also. See the main README for more details.
 
-   - CONFIG_SYS_MALLOC_SIMPLE
+   - CONFIG_SPL_SYS_MALLOC_SIMPLE
    - CONFIG_DM_WARN
    - CONFIG_DM_DEVICE_REMOVE
    - CONFIG_DM_STDIO
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index 408a8d8e28b1..27d6578772a1 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -15,7 +15,7 @@ config SPL_DM
 	  Enable driver model in SPL. You will need to provide a
 	  suitable malloc() implementation. If you are not using the
 	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
-	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
+	  consider using CONFIG_SPL_SYS_MALLOC_SIMPLE. In that case you
 	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
 	  In most cases driver model will only allocate a few uclasses
 	  and devices in SPL, so 1KB should be enable. See
@@ -28,7 +28,7 @@ config TPL_DM
 	  Enable driver model in TPL. You will need to provide a
 	  suitable malloc() implementation. If you are not using the
 	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
-	  consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you
+	  consider using CONFIG_TPL_SYS_MALLOC_SIMPLE. In that case you
 	  must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
 	  In most cases driver model will only allocate a few uclasses
 	  and devices in SPL, so 1KB should be enough. See
@@ -43,7 +43,7 @@ config VPL_DM
 	  Enable driver model in VPL. You will need to provide a
 	  suitable malloc() implementation. If you are not using the
 	  full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START,
-	  consider using CONFIG_SYS_MALLOC_SIMPLE.
+	  consider using CONFIG_SPL_SYS_MALLOC_SIMPLE.
 
 config DM_WARN
 	bool "Enable warnings in driver model"
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index 22f37495299f..b67a31981b07 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -47,10 +47,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/controlcenterdc.h b/include/configs/controlcenterdc.h
index 9fafa8fe35fc..08eb0dbbf954 100644
--- a/include/configs/controlcenterdc.h
+++ b/include/configs/controlcenterdc.h
@@ -39,10 +39,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((212 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h
index f8d50d259654..89786044c834 100644
--- a/include/configs/db-88f6720.h
+++ b/include/configs/db-88f6720.h
@@ -37,10 +37,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/db-88f6820-amc.h b/include/configs/db-88f6820-amc.h
index 06161e467025..56fd872272d9 100644
--- a/include/configs/db-88f6820-amc.h
+++ b/include/configs/db-88f6820-amc.h
@@ -44,10 +44,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 6294092f8746..0c42ef415da9 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -44,10 +44,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 14b307343ce7..4e0563dd5dae 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -56,10 +56,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/ds414.h b/include/configs/ds414.h
index 94b4ebc39348..41f72eef4fcd 100644
--- a/include/configs/ds414.h
+++ b/include/configs/ds414.h
@@ -48,10 +48,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/helios4.h b/include/configs/helios4.h
index 3a748ea3b893..aed4d7e8f536 100644
--- a/include/configs/helios4.h
+++ b/include/configs/helios4.h
@@ -47,10 +47,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/maxbcm.h b/include/configs/maxbcm.h
index a57946fb0f86..0eaf08e18c93 100644
--- a/include/configs/maxbcm.h
+++ b/include/configs/maxbcm.h
@@ -51,10 +51,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index dbc358d9d8d1..8e13b47eab9c 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -76,10 +76,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
diff --git a/include/configs/x530.h b/include/configs/x530.h
index 6218291c56fa..5065eb87a39d 100644
--- a/include/configs/x530.h
+++ b/include/configs/x530.h
@@ -71,10 +71,6 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MALLOC_SIMPLE
-#endif
-
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
-- 
2.25.1



More information about the U-Boot mailing list