Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/812858/?format=api
{ "id": 812858, "url": "http://patchwork.ozlabs.org/api/patches/812858/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1505224652-29989-1-git-send-email-andy.yan@rock-chips.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "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": "<1505224652-29989-1-git-send-email-andy.yan@rock-chips.com>", "list_archive_url": null, "date": "2017-09-12T13:57:32", "name": "[U-Boot,1/3] rockchip: make boot_mode releated codes reused across all platforms", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e25fe9b55f4cf2ee90dadc86685223b73e624e69", "submitter": { "id": 65124, "url": "http://patchwork.ozlabs.org/api/people/65124/?format=api", "name": "Andy Yan", "email": "andy.yan@rock-chips.com" }, "delegate": { "id": 69486, "url": "http://patchwork.ozlabs.org/api/users/69486/?format=api", "username": "ptomsich", "first_name": "Philipp", "last_name": "Tomsich", "email": "philipp.tomsich@theobroma-systems.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1505224652-29989-1-git-send-email-andy.yan@rock-chips.com/mbox/", "series": [ { "id": 2709, "url": "http://patchwork.ozlabs.org/api/series/2709/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2709", "date": "2017-09-12T13:55:49", "name": "support enter download mode on rockchip platform", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2709/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/812858/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/812858/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 3xs5xt4GQrz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 23:59:14 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 5DAF1C221AD; Tue, 12 Sep 2017 13:58:45 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 76470C21FCF;\n\tTue, 12 Sep 2017 13:58:42 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid B9B5AC221DC; Tue, 12 Sep 2017 13:57:51 +0000 (UTC)", "from regular1.263xmail.com (regular1.263xmail.com [211.150.99.135])\n\tby lists.denx.de (Postfix) with ESMTPS id 00853C221AA\n\tfor <u-boot@lists.denx.de>; Tue, 12 Sep 2017 13:57:47 +0000 (UTC)", "from andy.yan?rock-chips.com (unknown [192.168.167.161])\n\tby regular1.263xmail.com (Postfix) with ESMTP id 889DC1E165\n\tfor <u-boot@lists.denx.de>; Tue, 12 Sep 2017 21:57:38 +0800 (CST)", "from localhost.localdomain (localhost [127.0.0.1])\n\tby smtp.263.net (Postfix) with ESMTPA id A4D8E387;\n\tTue, 12 Sep 2017 21:57:38 +0800 (CST)", "from localhost.localdomain (unknown [58.22.7.114])\n\tby smtp.263.net (Postfix) whith ESMTP id 31569VXJHFZ;\n\tTue, 12 Sep 2017 21:57:39 +0800 (CST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.6 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_SORBS_WEB autolearn=no autolearn_force=no version=3.4.0", "X-263anti-spam": "KSV:0;", "X-MAIL-GRAY": "0", "X-MAIL-DELIVERY": "1", "X-KSVirus-check": "0", "X-ABS-CHECKED": "4", "X-RL-SENDER": "andy.yan@rock-chips.com", "X-FST-TO": "philipp.tomsich@theobroma-systems.com", "X-SENDER-IP": "58.22.7.114", "X-LOGIN-NAME": "andy.yan@rock-chips.com", "X-UNIQUE-TAG": "<d4b803dda6bd53d23a15f294854a4a5d>", "X-ATTACHMENT-NUM": "0", "X-SENDER": "yxj@rock-chips.com", "X-DNS-TYPE": "0", "From": "Andy Yan <andy.yan@rock-chips.com>", "To": "philipp.tomsich@theobroma-systems.com,\n\tsjg@chromium.org", "Date": "Tue, 12 Sep 2017 21:57:32 +0800", "Message-Id": "<1505224652-29989-1-git-send-email-andy.yan@rock-chips.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1505224549-29936-1-git-send-email-andy.yan@rock-chips.com>", "References": "<1505224549-29936-1-git-send-email-andy.yan@rock-chips.com>", "Cc": "u-boot@lists.denx.de, Andy Yan <andy.yan@rock-chips.com>", "Subject": "[U-Boot] [PATCH 1/3] rockchip: make boot_mode releated codes reused\n\tacross all platforms", "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": "setup_boot_mode function use the same logic but different\nmode register address across all the rockchip platforms,\nso it's better to make this function reused across all the\nplatforms, and let the mode register address setting from\nthe config file.\n\nSigned-off-by: Andy Yan <andy.yan@rock-chips.com>\n\n---\n\n arch/arm/include/asm/arch-rockchip/boot_mode.h | 2 ++\n arch/arm/mach-rockchip/Kconfig | 14 +++++++++++\n arch/arm/mach-rockchip/Makefile | 5 +++-\n arch/arm/mach-rockchip/boot_mode.c | 33 ++++++++++++++++++++++++++\n arch/arm/mach-rockchip/rk3036-board.c | 24 -------------------\n arch/arm/mach-rockchip/rk322x-board.c | 24 -------------------\n arch/arm/mach-rockchip/rk3288-board.c | 25 -------------------\n arch/arm/mach-rockchip/rk3399-board.c | 14 +++++++++++\n 8 files changed, 67 insertions(+), 74 deletions(-)\n create mode 100644 arch/arm/mach-rockchip/boot_mode.c\n create mode 100644 arch/arm/mach-rockchip/rk3399-board.c", "diff": "diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h\nindex bd65f60..163b2e7 100644\n--- a/arch/arm/include/asm/arch-rockchip/boot_mode.h\n+++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h\n@@ -16,4 +16,6 @@\n /* enter usb mass storage mode */\n #define BOOT_UMS\t\t(REBOOT_FLAG + 12)\n \n+int setup_boot_mode(void);\n+\n #endif\ndiff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig\nindex d9b25d5..527ca60 100644\n--- a/arch/arm/mach-rockchip/Kconfig\n+++ b/arch/arm/mach-rockchip/Kconfig\n@@ -114,6 +114,7 @@ config ROCKCHIP_RK3399\n \tselect SPL_DRIVERS_MISC_SUPPORT\n \tselect ENABLE_ARM_SOC_BOOT0_HOOK\n \tselect DEBUG_UART_BOARD_INIT\n+\tselect BOARD_LATE_INIT\n \thelp\n \t The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72\n \t and quad-core Cortex-A53.\n@@ -149,6 +150,19 @@ config TPL_ROCKCHIP_BACK_TO_BROM\n SPL will return to the boot rom, which will then load the U-Boot\n binary to keep going on.\n \n+config ROCKCHIP_BOOT_MODE_REG\n+\thex \"Rockchip boot mode flag register address\"\n+\tdefault 0x200081c8 if ROCKCHIP_RK3036\n+\tdefault 0x110005d8 if ROCKCHIP_RK322X\n+\tdefault 0xff730094 if ROCKCHIP_RK3288\n+\tdefault 0xff738200 if ROCKCHIP_RK3368\n+\tdefault 0xff320300 if ROCKCHIP_RK3399\n+\tdefault 0x10300580 if ROCKCHIP_RV1108\n+\tdefault 0\n+\thelp\n+\t The Soc will enter to different boot mode according to different\n+\t value of this register.\n+\n config ROCKCHIP_SPL_RESERVE_IRAM\n \thex \"Size of IRAM reserved in SPL\"\n \tdefault 0x4000\ndiff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile\nindex 79e9704..b7624cb 100644\n--- a/arch/arm/mach-rockchip/Makefile\n+++ b/arch/arm/mach-rockchip/Makefile\n@@ -10,7 +10,6 @@\n # the stack-pointer is valid before switching to the U-Boot stack).\n obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o\n obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o\n\n obj-tpl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.o\n obj-tpl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-tpl.o\n \n@@ -22,10 +21,14 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o\n obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o\n \n ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)\n+ifneq ($(CONFIG_ROCKCHIP_BOOT_MODE_REG),0)\n+obj-y += boot_mode.o\n+endif\n obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board.o\n obj-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board.o\n obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o\n obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o\n+obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board.o\n endif\n \n obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o\ndiff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c\nnew file mode 100644\nindex 0000000..7b3cbc5\n--- /dev/null\n+++ b/arch/arm/mach-rockchip/boot_mode.c\n@@ -0,0 +1,33 @@\n+/*\n+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd\n+ *\n+ * SPDX-License-Identifier: GPL-2.0+\n+ */\n+\n+#include <common.h>\n+#include <asm/io.h>\n+#include <asm/arch/boot_mode.h>\n+\n+int setup_boot_mode(void)\n+{\n+\tvoid *reg = (void *)CONFIG_ROCKCHIP_BOOT_MODE_REG;\n+\tint boot_mode = readl(reg);\n+\n+\tdebug(\"boot mode %x.\\n\", boot_mode);\n+\n+\t/* Clear boot mode */\n+\twritel(BOOT_NORMAL, reg);\n+\n+\tswitch (boot_mode) {\n+\tcase BOOT_FASTBOOT:\n+\t\tprintf(\"enter fastboot!\\n\");\n+\t\tenv_set(\"preboot\", \"setenv preboot; fastboot usb0\");\n+\t\tbreak;\n+\tcase BOOT_UMS:\n+\t\tprintf(\"enter UMS!\\n\");\n+\t\tenv_set(\"preboot\", \"setenv preboot; ums mmc 0\");\n+\t\tbreak;\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/arch/arm/mach-rockchip/rk3036-board.c b/arch/arm/mach-rockchip/rk3036-board.c\nindex a3457f3..a5d2571 100644\n--- a/arch/arm/mach-rockchip/rk3036-board.c\n+++ b/arch/arm/mach-rockchip/rk3036-board.c\n@@ -19,30 +19,6 @@\n \n DECLARE_GLOBAL_DATA_PTR;\n \n-#define GRF_BASE\t0x20008000\n-\n-static void setup_boot_mode(void)\n-{\n-\tstruct rk3036_grf *const grf = (void *)GRF_BASE;\n-\tint boot_mode = readl(&grf->os_reg[4]);\n-\n-\tdebug(\"boot mode %x.\\n\", boot_mode);\n-\n-\t/* Clear boot mode */\n-\twritel(BOOT_NORMAL, &grf->os_reg[4]);\n-\n-\tswitch (boot_mode) {\n-\tcase BOOT_FASTBOOT:\n-\t\tprintf(\"enter fastboot!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; fastboot usb0\");\n-\t\tbreak;\n-\tcase BOOT_UMS:\n-\t\tprintf(\"enter UMS!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; ums mmc 0\");\n-\t\tbreak;\n-\t}\n-}\n-\n __weak int rk_board_late_init(void)\n {\n \treturn 0;\ndiff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c\nindex c0ac2e9..3af137e 100644\n--- a/arch/arm/mach-rockchip/rk322x-board.c\n+++ b/arch/arm/mach-rockchip/rk322x-board.c\n@@ -15,30 +15,6 @@\n \n DECLARE_GLOBAL_DATA_PTR;\n \n-#define GRF_BASE\t0x11000000\n-\n-static void setup_boot_mode(void)\n-{\n-\tstruct rk322x_grf *const grf = (void *)GRF_BASE;\n-\tint boot_mode = readl(&grf->os_reg[4]);\n-\n-\tdebug(\"boot mode %x.\\n\", boot_mode);\n-\n-\t/* Clear boot mode */\n-\twritel(BOOT_NORMAL, &grf->os_reg[4]);\n-\n-\tswitch (boot_mode) {\n-\tcase BOOT_FASTBOOT:\n-\t\tprintf(\"enter fastboot!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; fastboot usb0\");\n-\t\tbreak;\n-\tcase BOOT_UMS:\n-\t\tprintf(\"enter UMS!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; ums mmc 0\");\n-\t\tbreak;\n-\t}\n-}\n-\n __weak int rk_board_late_init(void)\n {\n \treturn 0;\ndiff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c\nindex 278bb40..1c53cca 100644\n--- a/arch/arm/mach-rockchip/rk3288-board.c\n+++ b/arch/arm/mach-rockchip/rk3288-board.c\n@@ -23,31 +23,6 @@\n \n DECLARE_GLOBAL_DATA_PTR;\n \n-#define PMU_BASE\t0xff730000\n-\n-static void setup_boot_mode(void)\n-{\n-\tstruct rk3288_pmu *const pmu = (void *)PMU_BASE;\n-\tint boot_mode = readl(&pmu->sys_reg[0]);\n-\n-\tdebug(\"boot mode %x.\\n\", boot_mode);\n-\n-\t/* Clear boot mode */\n-\twritel(BOOT_NORMAL, &pmu->sys_reg[0]);\n-\n-\tswitch (boot_mode) {\n-\tcase BOOT_FASTBOOT:\n-\t\tprintf(\"enter fastboot!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; fastboot usb0\");\n-\t\tbreak;\n-\tcase BOOT_UMS:\n-\t\tprintf(\"enter UMS!\\n\");\n-\t\tenv_set(\"preboot\", \"setenv preboot; if mmc dev 0;\"\n-\t\t \"then ums mmc 0; else ums mmc 1;fi\");\n-\t\tbreak;\n-\t}\n-}\n-\n __weak int rk_board_late_init(void)\n {\n \treturn 0;\ndiff --git a/arch/arm/mach-rockchip/rk3399-board.c b/arch/arm/mach-rockchip/rk3399-board.c\nnew file mode 100644\nindex 0000000..9293843\n--- /dev/null\n+++ b/arch/arm/mach-rockchip/rk3399-board.c\n@@ -0,0 +1,14 @@\n+/*\n+ * Copyright (c) 2017 Rockchip Electronics Co., Ltd\n+ *\n+ * SPDX-License-Identifier: GPL-2.0+\n+ */\n+\n+#include <common.h>\n+#include <asm/arch/boot_mode.h>\n+\n+int board_late_init(void)\n+{\n+\tsetup_boot_mode();\n+\treturn 0;\n+}\n", "prefixes": [ "U-Boot", "1/3" ] }