From patchwork Tue Mar 31 22:35:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 237061 List-Id: U-Boot discussion From: pali at kernel.org (=?UTF-8?q?Pali=20Roh=C3=A1r?=) Date: Wed, 1 Apr 2020 00:35:11 +0200 Subject: [PATCH 04/11] Nokia RX-51: Move code from defconfig back to C header file In-Reply-To: <20200331223518.10936-1-pali@kernel.org> References: <20200331223518.10936-1-pali@kernel.org> Message-ID: <20200331223518.10936-5-pali@kernel.org> In commit commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") was moved complicated multiline script code from C header to oneliner in defconfig. After this change multiline to wide oneliner it is hard to read this code and even harder to debug. Moreover this script code should be at place where are other scripts, so move it back to C header file. Define new env variable preboot which stores this script and in option CONFIG_PREBOOT calls this preboot variable. Signed-off-by: Pali Roh?r --- configs/nokia_rx51_defconfig | 2 +- include/configs/nokia_rx51.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index f9e5b0e123..5ba9768d02 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -6,7 +6,7 @@ CONFIG_TARGET_NOKIA_RX51=y CONFIG_NR_DRAM_BANKS=2 CONFIG_BOOTDELAY=30 CONFIG_USE_PREBOOT=y -CONFIG_PREBOOT="setenv mmcnum 1; setenv mmcpart 1;setenv mmcscriptfile bootmenu.scr;if run switchmmc; then setenv mmcdone true;setenv mmctype fat;if run scriptload; then true; else setenv mmctype ext2;if run scriptload; then true; else setenv mmctype ext4;if run scriptload; then true; else setenv mmcdone false;fi;fi;fi;if ${mmcdone}; then run scriptboot;fi;fi;if run slide; then true; else setenv bootmenu_delay 0;setenv bootdelay 0;fi" +CONFIG_PREBOOT="run preboot" # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_HUSH_PARSER=y diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 858951ccf2..57bcbbaae1 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -239,6 +239,28 @@ int rx51_kp_getc(struct stdio_dev *sdev); "fi\0" \ "emmcboot=setenv mmcnum 1; run trymmcboot\0" \ "sdboot=setenv mmcnum 0; run trymmcboot\0" \ + "preboot=setenv mmcnum 1; setenv mmcpart 1;" \ + "setenv mmcscriptfile bootmenu.scr;" \ + "if run switchmmc; then " \ + "setenv mmcdone true;" \ + "setenv mmctype fat;" \ + "if run scriptload; then true; else " \ + "setenv mmctype ext2;" \ + "if run scriptload; then true; else " \ + "setenv mmctype ext4;" \ + "if run scriptload; then true; else " \ + "setenv mmcdone false;" \ + "fi;" \ + "fi;" \ + "fi;" \ + "if ${mmcdone}; then " \ + "run scriptboot;" \ + "fi;" \ + "fi;" \ + "if run slide; then true; else " \ + "setenv bootmenu_delay 0;" \ + "setenv bootdelay 0;" \ + "fi\0" \ "menucmd=bootmenu\0" \ "bootmenu_0=Attached kernel=run attachboot\0" \ "bootmenu_1=Internal eMMC=run emmcboot\0" \