All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
@ 2022-04-06 14:33 Tom Rini
  2022-04-20 13:11 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2022-04-06 14:33 UTC (permalink / raw)
  To: u-boot

This converts the following to Kconfig:
   CONFIG_SYS_MEM_TOP_HIDE

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 Kconfig                             | 11 +++++++++++
 README                              | 21 ---------------------
 board/samsung/common/board.c        |  4 ++--
 common/board_f.c                    |  2 +-
 configs/odroid-xu3_defconfig        |  3 ++-
 configs/odroid_defconfig            |  3 ++-
 configs/origen_defconfig            |  3 ++-
 configs/s5pc210_universal_defconfig |  3 ++-
 configs/theadorable_debug_defconfig |  3 ++-
 configs/trats2_defconfig            |  3 ++-
 configs/trats_defconfig             |  3 ++-
 include/configs/odroid.h            |  3 ---
 include/configs/odroid_xu3.h        |  3 ---
 include/configs/origen.h            |  2 --
 include/configs/s5pc210_universal.h |  2 --
 include/configs/theadorable.h       |  3 ---
 include/configs/trats.h             |  2 --
 include/configs/trats2.h            |  2 --
 18 files changed, 28 insertions(+), 48 deletions(-)

diff --git a/Kconfig b/Kconfig
index 112745440b5a..cd63f6a74e52 100644
--- a/Kconfig
+++ b/Kconfig
@@ -456,6 +456,17 @@ config STACK_SIZE
 	  by the UEFI sub-system. On some boards initrd_high is calculated as
 	  base stack pointer minus this stack size.
 
+config SYS_MEM_TOP_HIDE
+	hex "Exclude some memory from U-Boot / OS information"
+	default 0x0
+	help
+	  If set, this specified memory area will get subtracted from the top
+	  (end) of RAM and won't get "touched" at all by U-Boot. By fixing up
+	  gd->ram_size the OS / next stage should gets passed the now
+	  "corrected" memory size and won't touch it either.
+	  WARNING: Please make sure that this value is a multiple of the OS
+	  page size.
+
 config SYS_HAS_SRAM
 	bool
 	default y if TARGET_PIC32MZDASK
diff --git a/README b/README
index f31fcd73f196..4deef2789450 100644
--- a/README
+++ b/README
@@ -1887,27 +1887,6 @@ Configuration Settings:
 		the RAM base is not zero, or RAM is divided into banks,
 		this variable needs to be recalcuated to get the address.
 
-- CONFIG_SYS_MEM_TOP_HIDE:
-		If CONFIG_SYS_MEM_TOP_HIDE is defined in the board config header,
-		this specified memory area will get subtracted from the top
-		(end) of RAM and won't get "touched" at all by U-Boot. By
-		fixing up gd->ram_size the Linux kernel should gets passed
-		the now "corrected" memory size and won't touch it either.
-		This should work for arch/ppc and arch/powerpc. Only Linux
-		board ports in arch/powerpc with bootwrapper support that
-		recalculate the memory size from the SDRAM controller setup
-		will have to get fixed in Linux additionally.
-
-		This option can be used as a workaround for the 440EPx/GRx
-		CHIP 11 errata where the last 256 bytes in SDRAM shouldn't
-		be touched.
-
-		WARNING: Please make sure that this value is a multiple of
-		the Linux page size (normally 4k). If this is not the case,
-		then the end address of the Linux memory will be located at a
-		non page size aligned address and this could cause major
-		problems.
-
 - CONFIG_SYS_LOADS_BAUD_CHANGE:
 		Enable temporary baudrate change while serial download
 
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 97791aaeffe2..ff178b7fe677 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -107,9 +107,9 @@ int board_init(void)
 	}
 	boot_temp_check();
 #endif
-#ifdef CONFIG_TZSW_RESERVED_DRAM_SIZE
+#if CONFIG_VAL(SYS_MEM_TOP_HIDE)
 	/* The last few MB of memory can be reserved for secure firmware */
-	ulong size = CONFIG_TZSW_RESERVED_DRAM_SIZE;
+	ulong size = CONFIG_SYS_MEM_TOP_HIDE;
 
 	gd->ram_size -= size;
 	gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= size;
diff --git a/common/board_f.c b/common/board_f.c
index 5b655ad6efe4..4d7e40013e1c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -327,7 +327,7 @@ static int setup_dest_addr(void)
 	 * Ram is setup, size stored in gd !!
 	 */
 	debug("Ram size: %08lX\n", (ulong)gd->ram_size);
-#if defined(CONFIG_SYS_MEM_TOP_HIDE)
+#if CONFIG_VAL(SYS_MEM_TOP_HIDE)
 	/*
 	 * Subtract specified amount of memory to hide so that it won't
 	 * get "touched" at all by U-Boot. By fixing up gd->ram_size
diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig
index 8a507904be9f..250c0b4b3da3 100644
--- a/configs/odroid-xu3_defconfig
+++ b/configs/odroid-xu3_defconfig
@@ -10,9 +10,10 @@ CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x310000
 CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3"
 CONFIG_IDENT_STRING=" for ODROID-XU3/XU4/HC1/HC2"
+CONFIG_SYS_LOAD_ADDR=0x43e00000
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_LOAD_ADDR=0x43e00000
+CONFIG_SYS_MEM_TOP_HIDE=0x01600000
 CONFIG_FIT=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig
index 54ff5799cb73..058e7dc3177c 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -11,9 +11,10 @@ CONFIG_NR_DRAM_BANKS=8
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x140000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4412-odroid"
+CONFIG_SYS_LOAD_ADDR=0x43e00000
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_LOAD_ADDR=0x43e00000
+CONFIG_SYS_MEM_TOP_HIDE=0x00100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/origen_defconfig b/configs/origen_defconfig
index 83a83ab13b14..b4b0d8b1464c 100644
--- a/configs/origen_defconfig
+++ b/configs/origen_defconfig
@@ -14,8 +14,9 @@ CONFIG_DEFAULT_DEVICE_TREE="exynos4210-origen"
 CONFIG_SPL_TEXT_BASE=0x02021410
 CONFIG_SPL=y
 CONFIG_IDENT_STRING=" for ORIGEN"
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_LOAD_ADDR=0x43e00000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_BOOTCOMMAND="if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscript; then run bootscript; fi; fi;load mmc ${mmcdev} ${loadaddr} uImage; bootm ${loadaddr} "
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/s5pc210_universal_defconfig b/configs/s5pc210_universal_defconfig
index 3c0c7b53547b..e70ce25b099d 100644
--- a/configs/s5pc210_universal_defconfig
+++ b/configs/s5pc210_universal_defconfig
@@ -11,8 +11,9 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-universal_c210"
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_LOAD_ADDR=0x44800000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="Please use defined boot"
 CONFIG_BOOTCOMMAND="run mmcboot"
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index 3b841b0c427a..230c086617a5 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -17,9 +17,10 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
+CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_DEBUG_UART=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_LOAD_ADDR=0x800000
+CONFIG_SYS_MEM_TOP_HIDE=0x80000
 CONFIG_FIT=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_PREBOOT=y
diff --git a/configs/trats2_defconfig b/configs/trats2_defconfig
index b93c9eb7175b..690cdef4c4ab 100644
--- a/configs/trats2_defconfig
+++ b/configs/trats2_defconfig
@@ -10,9 +10,10 @@ CONFIG_TARGET_TRATS2=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4412-trats2"
+CONFIG_SYS_LOAD_ADDR=0x43e00000
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_LOAD_ADDR=0x43e00000
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/trats_defconfig b/configs/trats_defconfig
index d55c1d70e64b..18890799535e 100644
--- a/configs/trats_defconfig
+++ b/configs/trats_defconfig
@@ -10,8 +10,9 @@ CONFIG_TARGET_TRATS=y
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-trats"
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_LOAD_ADDR=0x44800000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 42031bb99344..b8b47af4712b 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -21,9 +21,6 @@
 #define CONFIG_SYS_SDRAM_BASE	0x40000000
 #define SDRAM_BANK_SIZE		(256 << 20)	/* 256 MB */
 #define PHYS_SDRAM_1		CONFIG_SYS_SDRAM_BASE
-/* Reserve the last 1 MiB for the secure firmware */
-#define CONFIG_SYS_MEM_TOP_HIDE		(1UL << 20UL)
-#define CONFIG_TZSW_RESERVED_DRAM_SIZE	CONFIG_SYS_MEM_TOP_HIDE
 
 #include <linux/sizes.h>
 
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 616f25eafd3e..eb35d7b4ae2d 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -15,9 +15,6 @@
 #define TZPC_BASE_OFFSET		0x10000
 
 #define SDRAM_BANK_SIZE			(256UL << 20UL)	/* 256 MB */
-/* Reserve the last 22 MiB for the secure firmware */
-#define CONFIG_SYS_MEM_TOP_HIDE		(22UL << 20UL)
-#define CONFIG_TZSW_RESERVED_DRAM_SIZE	CONFIG_SYS_MEM_TOP_HIDE
 
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_LOAD_ADDR - 0x1000000)
 
diff --git a/include/configs/origen.h b/include/configs/origen.h
index 278c204ded8a..c4f5997c3dec 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -19,8 +19,6 @@
 #define PHYS_SDRAM_1			CONFIG_SYS_SDRAM_BASE
 #define SDRAM_BANK_SIZE			(256 << 20)	/* 256 MB */
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Power Down Modes */
 #define S5P_CHECK_SLEEP			0x00000BAD
 #define S5P_CHECK_DIDLE			0xBAD00000
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h
index 8cbdbc733c0b..ae56c66e15cd 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -24,8 +24,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
 
 #define NORMAL_MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 14817b165cfa..fdf048b27b3c 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -43,9 +43,6 @@
 /* SATA support */
 #define CONFIG_LBA48
 
-/* Enable LCD and reserve 512KB from top of memory*/
-#define CONFIG_SYS_MEM_TOP_HIDE		0x80000
-
 /* FPGA programming support */
 #define CONFIG_FPGA_STRATIX_V
 
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 41ac6090c270..910fc150b18b 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -28,8 +28,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Tizen - partitions definitions */
 #define PARTS_CSA		"csa-mmc"
 #define PARTS_BOOT		"boot"
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index a980e6c47d11..3e121bc6909a 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -27,8 +27,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Tizen - partitions definitions */
 #define PARTS_CSA		"csa-mmc"
 #define PARTS_BOOT		"boot"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
  2022-04-06 14:33 [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig Tom Rini
@ 2022-04-20 13:11 ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2022-04-20 13:11 UTC (permalink / raw)
  To: u-boot

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]

On Wed, Apr 06, 2022 at 10:33:32AM -0400, Tom Rini wrote:

> This converts the following to Kconfig:
>    CONFIG_SYS_MEM_TOP_HIDE
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
  2022-04-19 14:25 ` Tom Rini
@ 2022-04-19 14:48   ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2022-04-19 14:48 UTC (permalink / raw)
  To: Tom Rini, Michal Simek
  Cc: u-boot, git, Bin Meng, Fabio Estevam, Heiko Schocher,
	Heinrich Schuchardt, Icenowy Zheng, Jaehoon Chung,
	Lukasz Majewski, Marek Behún, Marek Vasut, Minkyu Kang,
	Patrick Delaunay, Peng Fan, Rick Chen, Sean Anderson,
	Simon Glass, Stefan Roese



On 4/19/22 16:25, Tom Rini wrote:
> On Tue, Apr 19, 2022 at 02:01:02PM +0200, Michal Simek wrote:
> 
>> This converts CONFIG_SYS_MEM_TOP_HIDE to Kconfig to be able to enable it
>> also for other boards.
>> Help text description is taken from comment in common/board_f.c.
>> It also slightly change behavior because every board defines it as 0x0 now
>> that's why code is enabled by default but compiler should remove it if not
>> defined.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> 
> I sent
> https://patchwork.ozlabs.org/project/uboot/patch/20220406143332.4057117-1-trini@konsulko.com/
> recently do to this.  And yes, a default of 0x0 works, I used
> CONFIG_VAL(..) to evaluate it instead, but either would be fine.
> 

ok. Good then please ignore this one.

M

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
  2022-04-19 12:01 Michal Simek
@ 2022-04-19 14:25 ` Tom Rini
  2022-04-19 14:48   ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2022-04-19 14:25 UTC (permalink / raw)
  To: Michal Simek
  Cc: u-boot, git, Bin Meng, Fabio Estevam, Heiko Schocher,
	Heinrich Schuchardt, Icenowy Zheng, Jaehoon Chung,
	Lukasz Majewski, Marek Behún, Marek Vasut, Minkyu Kang,
	Patrick Delaunay, Peng Fan, Rick Chen, Sean Anderson,
	Simon Glass, Stefan Roese

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

On Tue, Apr 19, 2022 at 02:01:02PM +0200, Michal Simek wrote:

> This converts CONFIG_SYS_MEM_TOP_HIDE to Kconfig to be able to enable it
> also for other boards.
> Help text description is taken from comment in common/board_f.c.
> It also slightly change behavior because every board defines it as 0x0 now
> that's why code is enabled by default but compiler should remove it if not
> defined.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

I sent
https://patchwork.ozlabs.org/project/uboot/patch/20220406143332.4057117-1-trini@konsulko.com/
recently do to this.  And yes, a default of 0x0 works, I used
CONFIG_VAL(..) to evaluate it instead, but either would be fine.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
@ 2022-04-19 12:01 Michal Simek
  2022-04-19 14:25 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2022-04-19 12:01 UTC (permalink / raw)
  To: u-boot, git
  Cc: Bin Meng, Fabio Estevam, Heiko Schocher, Heinrich Schuchardt,
	Icenowy Zheng, Jaehoon Chung, Lukasz Majewski, Marek Behún,
	Marek Vasut, Minkyu Kang, Patrick Delaunay, Peng Fan, Rick Chen,
	Sean Anderson, Simon Glass, Stefan Roese

This converts CONFIG_SYS_MEM_TOP_HIDE to Kconfig to be able to enable it
also for other boards.
Help text description is taken from comment in common/board_f.c.
It also slightly change behavior because every board defines it as 0x0 now
that's why code is enabled by default but compiler should remove it if not
defined.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Please let me know if logic in board_f.c is not correct.
---
 Kconfig                             |  9 +++++++++
 common/board_f.c                    | 27 ++++++++++++++-------------
 configs/origen_defconfig            |  1 +
 configs/s5pc210_universal_defconfig |  1 +
 configs/theadorable_debug_defconfig |  1 +
 configs/trats2_defconfig            |  1 +
 configs/trats_defconfig             |  1 +
 include/configs/odroid.h            |  1 -
 include/configs/odroid_xu3.h        |  1 -
 include/configs/origen.h            |  2 --
 include/configs/s5pc210_universal.h |  2 --
 include/configs/theadorable.h       |  1 -
 include/configs/trats.h             |  2 --
 include/configs/trats2.h            |  2 --
 scripts/config_whitelist.txt        |  1 -
 15 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/Kconfig b/Kconfig
index b45e60a75b93..c0fc8f798b8a 100644
--- a/Kconfig
+++ b/Kconfig
@@ -222,6 +222,15 @@ config NR_DRAM_BANKS
 	help
 	  This defines the number of DRAM banks.
 
+config SYS_MEM_TOP_HIDE
+	hex "Hide space (in bytes) from TOP memory"
+	default 0x0
+	help
+	  Subtract specified amount of memory to hide so that it won't
+	  get "touched" at all by U-Boot. By fixing up gd->ram_size
+	  the Linux kernel should now get passed the now "corrected"
+	  memory size and won't touch it either.
+
 config SYS_BOOT_GET_CMDLINE
 	bool "Enable kernel command line setup"
 	help
diff --git a/common/board_f.c b/common/board_f.c
index 5b655ad6efe4..643bb463580e 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -327,19 +327,20 @@ static int setup_dest_addr(void)
 	 * Ram is setup, size stored in gd !!
 	 */
 	debug("Ram size: %08lX\n", (ulong)gd->ram_size);
-#if defined(CONFIG_SYS_MEM_TOP_HIDE)
-	/*
-	 * Subtract specified amount of memory to hide so that it won't
-	 * get "touched" at all by U-Boot. By fixing up gd->ram_size
-	 * the Linux kernel should now get passed the now "corrected"
-	 * memory size and won't touch it either. This should work
-	 * for arch/ppc and arch/powerpc. Only Linux board ports in
-	 * arch/powerpc with bootwrapper support, that recalculate the
-	 * memory size from the SDRAM controller setup will have to
-	 * get fixed.
-	 */
-	gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
-#endif
+
+	if (CONFIG_SYS_MEM_TOP_HIDE)
+		/*
+		 * Subtract specified amount of memory to hide so that it won't
+		 * get "touched" at all by U-Boot. By fixing up gd->ram_size
+		 * the Linux kernel should now get passed the now "corrected"
+		 * memory size and won't touch it either. This should work
+		 * for arch/ppc and arch/powerpc. Only Linux board ports in
+		 * arch/powerpc with bootwrapper support, that recalculate the
+		 * memory size from the SDRAM controller setup will have to
+		 * get fixed.
+		 */
+		gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
+
 #ifdef CONFIG_SYS_SDRAM_BASE
 	gd->ram_base = CONFIG_SYS_SDRAM_BASE;
 #endif
diff --git a/configs/origen_defconfig b/configs/origen_defconfig
index 6ffec862cd9d..b4b0d8b1464c 100644
--- a/configs/origen_defconfig
+++ b/configs/origen_defconfig
@@ -16,6 +16,7 @@ CONFIG_SPL=y
 CONFIG_IDENT_STRING=" for ORIGEN"
 CONFIG_SYS_LOAD_ADDR=0x43e00000
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_BOOTCOMMAND="if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscript; then run bootscript; fi; fi;load mmc ${mmcdev} ${loadaddr} uImage; bootm ${loadaddr} "
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/s5pc210_universal_defconfig b/configs/s5pc210_universal_defconfig
index 8a34908e85cc..e70ce25b099d 100644
--- a/configs/s5pc210_universal_defconfig
+++ b/configs/s5pc210_universal_defconfig
@@ -13,6 +13,7 @@ CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-universal_c210"
 CONFIG_SYS_LOAD_ADDR=0x44800000
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="Please use defined boot"
 CONFIG_BOOTCOMMAND="run mmcboot"
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index 64ae29113e3e..bee327e7ad6d 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -19,6 +19,7 @@ CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
 CONFIG_SYS_LOAD_ADDR=0x800000
 CONFIG_DEBUG_UART=y
+CONFIG_SYS_MEM_TOP_HIDE=0x80000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_FIT=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/trats2_defconfig b/configs/trats2_defconfig
index b38ee99371b9..149ee98f590f 100644
--- a/configs/trats2_defconfig
+++ b/configs/trats2_defconfig
@@ -12,6 +12,7 @@ CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4412-trats2"
 CONFIG_SYS_LOAD_ADDR=0x43e00000
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/trats_defconfig b/configs/trats_defconfig
index d0689444f987..18890799535e 100644
--- a/configs/trats_defconfig
+++ b/configs/trats_defconfig
@@ -12,6 +12,7 @@ CONFIG_ENV_OFFSET=0x7000
 CONFIG_DEFAULT_DEVICE_TREE="exynos4210-trats"
 CONFIG_SYS_LOAD_ADDR=0x44800000
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_MEM_TOP_HIDE=0x100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 42031bb99344..d2cbba546705 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -22,7 +22,6 @@
 #define SDRAM_BANK_SIZE		(256 << 20)	/* 256 MB */
 #define PHYS_SDRAM_1		CONFIG_SYS_SDRAM_BASE
 /* Reserve the last 1 MiB for the secure firmware */
-#define CONFIG_SYS_MEM_TOP_HIDE		(1UL << 20UL)
 #define CONFIG_TZSW_RESERVED_DRAM_SIZE	CONFIG_SYS_MEM_TOP_HIDE
 
 #include <linux/sizes.h>
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 616f25eafd3e..a9a00897f56f 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -16,7 +16,6 @@
 
 #define SDRAM_BANK_SIZE			(256UL << 20UL)	/* 256 MB */
 /* Reserve the last 22 MiB for the secure firmware */
-#define CONFIG_SYS_MEM_TOP_HIDE		(22UL << 20UL)
 #define CONFIG_TZSW_RESERVED_DRAM_SIZE	CONFIG_SYS_MEM_TOP_HIDE
 
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_LOAD_ADDR - 0x1000000)
diff --git a/include/configs/origen.h b/include/configs/origen.h
index 278c204ded8a..c4f5997c3dec 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -19,8 +19,6 @@
 #define PHYS_SDRAM_1			CONFIG_SYS_SDRAM_BASE
 #define SDRAM_BANK_SIZE			(256 << 20)	/* 256 MB */
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Power Down Modes */
 #define S5P_CHECK_SLEEP			0x00000BAD
 #define S5P_CHECK_DIDLE			0xBAD00000
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h
index 8cbdbc733c0b..ae56c66e15cd 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -24,8 +24,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
 
 #define NORMAL_MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 14817b165cfa..85a7aa6fccfa 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -44,7 +44,6 @@
 #define CONFIG_LBA48
 
 /* Enable LCD and reserve 512KB from top of memory*/
-#define CONFIG_SYS_MEM_TOP_HIDE		0x80000
 
 /* FPGA programming support */
 #define CONFIG_FPGA_STRATIX_V
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 41ac6090c270..910fc150b18b 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -28,8 +28,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Tizen - partitions definitions */
 #define PARTS_CSA		"csa-mmc"
 #define PARTS_BOOT		"boot"
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index a980e6c47d11..3e121bc6909a 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -27,8 +27,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_MEM_TOP_HIDE	(1 << 20)	/* ram console */
-
 /* Tizen - partitions definitions */
 #define PARTS_CSA		"csa-mmc"
 #define PARTS_BOOT		"boot"
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index df70ae2264da..d4252b9a0b15 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1335,7 +1335,6 @@ CONFIG_SYS_MEMORY_BASE
 CONFIG_SYS_MEMORY_SIZE
 CONFIG_SYS_MEM_RESERVE_SECURE
 CONFIG_SYS_MEM_SIZE
-CONFIG_SYS_MEM_TOP_HIDE
 CONFIG_SYS_MFD
 CONFIG_SYS_MHZ
 CONFIG_SYS_MIPS_TIMER_FREQ
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-20 13:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 14:33 [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig Tom Rini
2022-04-20 13:11 ` Tom Rini
2022-04-19 12:01 Michal Simek
2022-04-19 14:25 ` Tom Rini
2022-04-19 14:48   ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.