From patchwork Tue Apr 19 12:01:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1618891 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=jqoTZrX0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KjMpb25HGz9sG2 for ; Tue, 19 Apr 2022 22:01:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 816E883BBA; Tue, 19 Apr 2022 14:01:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="jqoTZrX0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E67C283B0E; Tue, 19 Apr 2022 14:01:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1336D83BE5 for ; Tue, 19 Apr 2022 14:01:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x62a.google.com with SMTP id r13so32411018ejd.5 for ; Tue, 19 Apr 2022 05:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Y6ZZQf700Qf7vXDgWbHgeTn721PykYij1BVOU7ZxmmU=; b=jqoTZrX0qLgzI2U0D3GOorXOW3Xf6QLOLfBhodKcB+/sBa7CGqAzo0Ae8AdcwXbMt6 DcZxpsHc0Jr7T439tZ9lnKED1yv004EY/CcV5I+JNpJ3gXCuEeKbluxOD8chgpG73Ydd kKAlRdociUwBcH4TC1LWx3myvKlpc+WvL9y699KZnMjlvBAE0xKAAepaop9IGw95QvhJ aQH7xsAEs4iX5GqSPwupGTtXvSS6vY0VydTn1oIKUzkB4XuaOO+mdilT18VWoNuPpihT AUpUZuiJxpr28PLf9XuJjh2wNJn7NA3t0wNXS0Lqg9O29SdovIhJY4jv0ugEU/sqVP0S dybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Y6ZZQf700Qf7vXDgWbHgeTn721PykYij1BVOU7ZxmmU=; b=Jt8reUlwt8on5dm4qFn7Po+BSn2S04NgowN1QEqpGrOaMY2NR16z8hPwSjh/NrsEGQ 4TKsAWM2qDMb17u7iNxkYhDLxQOxqJD/Nw/85tBAqR76F7YY1jDEZ6Eqp1/0XDn5n8Z4 gYC+PQfjtnOcxQmX3DqRyivC3e+uhDsdEojhPzinVen3GJPJAwzaGhllyPuTq0Ovtdty mp8ETdJpK05c+3+vJ++f4WYZBRgkPYAUksU30nznj22XvAP3hPKliOWTQmMXLX5akJXd 8ARR9qDqh2ESAfNz3VPcCOixQh8gS3PB7B+4T/OttN53eH9az4pGbkh5DHyMnsdL9RiY s7WA== X-Gm-Message-State: AOAM531OzMi3paKTRL0LRjNEDA2SNpemtfrpeK1Dn0pwiOFnuojUKjIK eHXSBlhwdudyJ0ssldIgGRVcTXGDKHDdTw== X-Google-Smtp-Source: ABdhPJwxNNwtpR27An7f7HMg9/Vu8LZwr6Ft4a8qPWKZQy5W7jQtcA9l+TpJ2n5d2TC/vUD9c17JyA== X-Received: by 2002:a17:906:4cd8:b0:6db:372:c4ba with SMTP id q24-20020a1709064cd800b006db0372c4bamr12811451ejt.57.1650369667782; Tue, 19 Apr 2022 05:01:07 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id 27-20020a17090600db00b006df6b34d9b8sm5579871eji.211.2022.04.19.05.01.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Apr 2022 05:01:07 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Bin Meng , Fabio Estevam , Heiko Schocher , Heinrich Schuchardt , Icenowy Zheng , Jaehoon Chung , Lukasz Majewski , =?utf-8?q?Marek_Beh=C3=BAn?= , Marek Vasut , Minkyu Kang , Patrick Delaunay , Peng Fan , Rick Chen , Sean Anderson , Simon Glass , Stefan Roese Subject: [PATCH] Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig Date: Tue, 19 Apr 2022 14:01:02 +0200 Message-Id: <27bb67a6420e9d4869ba6d36cd3e47e49423d590.1650369659.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- 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 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