Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
authorTom Rini <trini@konsulko.com>
Wed, 6 Apr 2022 14:33:32 +0000 (10:33 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 19 Apr 2022 18:52:34 +0000 (14:52 -0400)
This converts the following to Kconfig:
   CONFIG_SYS_MEM_TOP_HIDE

Signed-off-by: Tom Rini <trini@konsulko.com>
18 files changed:
Kconfig
README
board/samsung/common/board.c
common/board_f.c
configs/odroid-xu3_defconfig
configs/odroid_defconfig
configs/origen_defconfig
configs/s5pc210_universal_defconfig
configs/theadorable_debug_defconfig
configs/trats2_defconfig
configs/trats_defconfig
include/configs/odroid.h
include/configs/odroid_xu3.h
include/configs/origen.h
include/configs/s5pc210_universal.h
include/configs/theadorable.h
include/configs/trats.h
include/configs/trats2.h

diff --git a/Kconfig b/Kconfig
index b45e60a..e269856 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -489,6 +489,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 d503357..1967961 100644 (file)
--- a/README
+++ b/README
@@ -1876,27 +1876,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
 
index 97791aa..ff178b7 100644 (file)
@@ -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;
index 5b655ad..4d7e400 100644 (file)
@@ -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
index d7f9c20..250c0b4 100644 (file)
@@ -13,6 +13,7 @@ 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_MEM_TOP_HIDE=0x01600000
 CONFIG_FIT=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
index 9f5688e..058e7dc 100644 (file)
@@ -14,6 +14,7 @@ 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_MEM_TOP_HIDE=0x00100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
index 6ffec86..b4b0d8b 100644 (file)
@@ -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
index 8a34908..e70ce25 100644 (file)
@@ -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"
index 64ae291..230c086 100644 (file)
@@ -20,6 +20,7 @@ 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_MEM_TOP_HIDE=0x80000
 CONFIG_FIT=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_PREBOOT=y
index b38ee99..690cdef 100644 (file)
@@ -13,6 +13,7 @@ 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_MEM_TOP_HIDE=0x100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
index d068944..1889079 100644 (file)
@@ -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
index 42031bb..b8b47af 100644 (file)
@@ -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>
 
index 616f25e..eb35d7b 100644 (file)
@@ -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)
 
index 278c204..c4f5997 100644 (file)
@@ -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
index 8cbdbc7..ae56c66 100644 (file)
@@ -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
index 14817b1..fdf048b 100644 (file)
@@ -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
 
index 41ac609..910fc15 100644 (file)
@@ -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"
index a980e6c..3e121bc 100644 (file)
@@ -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"