{"id":815067,"url":"http://patchwork.ozlabs.org/api/1.2/patches/815067/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1505758708-29213-5-git-send-email-philipp.tomsich@theobroma-systems.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505758708-29213-5-git-send-email-philipp.tomsich@theobroma-systems.com>","list_archive_url":null,"date":"2017-09-18T18:18:27","name":"[U-Boot,v2,4/5] rockchip: back-to-bootrom: allow passing a cmd to the bootrom","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"dc5f331c3be0175fd06a1219f7b237b3f1e061d9","submitter":{"id":53488,"url":"http://patchwork.ozlabs.org/api/1.2/people/53488/?format=json","name":"Philipp Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"delegate":{"id":69486,"url":"http://patchwork.ozlabs.org/api/1.2/users/69486/?format=json","username":"ptomsich","first_name":"Philipp","last_name":"Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1505758708-29213-5-git-send-email-philipp.tomsich@theobroma-systems.com/mbox/","series":[{"id":3697,"url":"http://patchwork.ozlabs.org/api/1.2/series/3697/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=3697","date":"2017-09-18T18:18:23","name":"rockchip: back-to-bootrom: replace assembly-implementation with C-code","version":2,"mbox":"http://patchwork.ozlabs.org/series/3697/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/815067/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815067/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwvV15D65z9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 04:21:45 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 6A524C21D8D; Mon, 18 Sep 2017 18:20:12 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 9F148C21DCF;\n\tMon, 18 Sep 2017 18:18:44 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 5B2AAC21C2B; Mon, 18 Sep 2017 18:18:39 +0000 (UTC)","from mail.theobroma-systems.com (vegas.theobroma-systems.com\n\t[144.76.126.164])\n\tby lists.denx.de (Postfix) with ESMTPS id DDEA5C21C62\n\tfor <u-boot@lists.denx.de>; Mon, 18 Sep 2017 18:18:38 +0000 (UTC)","from [86.59.122.178] (port=34776 helo=android.lan)\n\tby mail.theobroma-systems.com with esmtpsa\n\t(TLS1.2:RSA_AES_128_CBC_SHA256:128)\n\t(Exim 4.80) (envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1du0cu-00053h-3U; Mon, 18 Sep 2017 20:18:36 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","To":"u-boot@lists.denx.de","Date":"Mon, 18 Sep 2017 20:18:27 +0200","Message-Id":"<1505758708-29213-5-git-send-email-philipp.tomsich@theobroma-systems.com>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com>","References":"<1505758708-29213-1-git-send-email-philipp.tomsich@theobroma-systems.com>","Cc":"Klaus Goger <klaus.goger@theobroma-systems.com>,\n\tAndy Yan <andy.yan@rock-chips.com>","Subject":"[U-Boot] [PATCH v2 4/5] rockchip: back-to-bootrom: allow passing a\n\tcmd to the bootrom","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"The BROM supports forcing it to enter download-mode, if an appropriate\nresult/cmd-word is returned to it.  There already is a series to\nsupport this in review, so this prepares the (newly C-version) of the\nback-to-bootrom code to accept a cmd to passed on to the BROM.\n\nAll the existing call-sites are adjusted to match the changed function\nsignature.\n\nSigned-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>\n\n---\n\nChanges in v2:\n- adapt the RK3188 spl support file (that I had originally missed)\n\n arch/arm/include/asm/arch-rockchip/bootrom.h | 5 ++++-\n arch/arm/mach-rockchip/bootrom.c             | 4 ++--\n arch/arm/mach-rockchip/rk3036-board-spl.c    | 2 +-\n arch/arm/mach-rockchip/rk3188-board-spl.c    | 4 ++--\n arch/arm/mach-rockchip/rk3188-board-tpl.c    | 4 ++--\n arch/arm/mach-rockchip/rk322x-board-spl.c    | 2 +-\n arch/arm/mach-rockchip/rk3288-board-spl.c    | 4 ++--\n arch/arm/mach-rockchip/rk3368-board-tpl.c    | 2 +-\n arch/arm/mach-rockchip/rk3399-board-spl.c    | 2 +-\n 9 files changed, 16 insertions(+), 13 deletions(-)","diff":"diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h\nindex 2f61a33..103b799 100644\n--- a/arch/arm/include/asm/arch-rockchip/bootrom.h\n+++ b/arch/arm/include/asm/arch-rockchip/bootrom.h\n@@ -24,6 +24,9 @@ extern u32 SAVE_SP_ADDR;\n  * download mode, ...).\n  *\n  * This function does not return.\n+ *\n+ * @brom_cmd: indicates how the bootrom should continue the boot\n+ *            sequence (e.g. load the next stage)\n  */\n enum rockchip_bootrom_cmd {\n \t/*\n@@ -35,7 +38,7 @@ enum rockchip_bootrom_cmd {\n \tBROM_BOOT_ENTER_DNL,      /* have BROM enter download-mode */\n };\n \n-void back_to_bootrom(void);\n+void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);\n \n /**\n  * Boot-device identifiers as used by the BROM\ndiff --git a/arch/arm/mach-rockchip/bootrom.c b/arch/arm/mach-rockchip/bootrom.c\nindex 7b9b307..e369fdc 100644\n--- a/arch/arm/mach-rockchip/bootrom.c\n+++ b/arch/arm/mach-rockchip/bootrom.c\n@@ -15,12 +15,12 @@\n  */\n static jmp_buf brom_ctx __section(\".data\");\n \n-void back_to_bootrom(void)\n+void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd)\n {\n #if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)\n \tputs(\"Returning to boot ROM...\\n\");\n #endif\n-\tlongjmp(brom_ctx, BROM_BOOT_NEXTSTAGE);\n+\tlongjmp(brom_ctx, brom_cmd);\n }\n \n /*\ndiff --git a/arch/arm/mach-rockchip/rk3036-board-spl.c b/arch/arm/mach-rockchip/rk3036-board-spl.c\nindex 9458201..550e3a1 100644\n--- a/arch/arm/mach-rockchip/rk3036-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk3036-board-spl.c\n@@ -40,7 +40,7 @@ void board_init_f(ulong dummy)\n \tsdram_init();\n \n \t/* return to maskrom */\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n }\n \n /* Place Holders */\ndiff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c\nindex 05d4ae6..8e3b8ae 100644\n--- a/arch/arm/mach-rockchip/rk3188-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c\n@@ -158,7 +158,7 @@ void board_init_f(ulong dummy)\n \n \tsetup_arm_clock();\n #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n #endif\n }\n \n@@ -219,7 +219,7 @@ void spl_board_init(void)\n \n \tpreloader_console_init();\n #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n #endif\n \treturn;\n \ndiff --git a/arch/arm/mach-rockchip/rk3188-board-tpl.c b/arch/arm/mach-rockchip/rk3188-board-tpl.c\nindex c714278..dc5cbf3 100644\n--- a/arch/arm/mach-rockchip/rk3188-board-tpl.c\n+++ b/arch/arm/mach-rockchip/rk3188-board-tpl.c\n@@ -75,7 +75,7 @@ void board_init_f(ulong dummy)\n \t\t * really early on.\n \t\t */\n \n-\t\tback_to_bootrom();\n+\t\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n \t} else {\n \t\t/*\n \t\t * SPL part of the loader should now wait for us at\n@@ -84,6 +84,6 @@ void board_init_f(ulong dummy)\n \t\t * through).\n \t\t */\n \t\tjump_to_spl();\n-\t\tback_to_bootrom();\n+\t\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n \t}\n }\ndiff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c\nindex 4ddb8ba..35f4f97 100644\n--- a/arch/arm/mach-rockchip/rk322x-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk322x-board-spl.c\n@@ -76,6 +76,6 @@ void board_init_f(ulong dummy)\n \t/* Disable the ddr secure region setting to make it non-secure */\n \trk_clrreg(SGRF_DDR_CON0, 0x4000);\n #if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n #endif\n }\ndiff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c\nindex 6b7bf85..6fa4909 100644\n--- a/arch/arm/mach-rockchip/rk3288-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c\n@@ -250,7 +250,7 @@ void board_init_f(ulong dummy)\n \t\treturn;\n \t}\n #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n #endif\n }\n \n@@ -317,7 +317,7 @@ void spl_board_init(void)\n \n \tpreloader_console_init();\n #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n #endif\n \treturn;\n err:\ndiff --git a/arch/arm/mach-rockchip/rk3368-board-tpl.c b/arch/arm/mach-rockchip/rk3368-board-tpl.c\nindex b3e6ffa..60d5aea 100644\n--- a/arch/arm/mach-rockchip/rk3368-board-tpl.c\n+++ b/arch/arm/mach-rockchip/rk3368-board-tpl.c\n@@ -148,7 +148,7 @@ void board_init_f(ulong dummy)\n \n void board_return_to_bootrom(void)\n {\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n }\n \n u32 spl_boot_device(void)\ndiff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c\nindex 9c20f56..b96903e 100644\n--- a/arch/arm/mach-rockchip/rk3399-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c\n@@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;\n \n void board_return_to_bootrom(void)\n {\n-\tback_to_bootrom();\n+\tback_to_bootrom(BROM_BOOT_NEXTSTAGE);\n }\n \n static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {\n","prefixes":["U-Boot","v2","4/5"]}