get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/813748/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 813748,
    "url": "http://patchwork.ozlabs.org/api/patches/813748/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1505379121-5437-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": "<1505379121-5437-1-git-send-email-andy.yan@rock-chips.com>",
    "list_archive_url": null,
    "date": "2017-09-14T08:52:01",
    "name": "[U-Boot,v2,2/3] rockchip: add support for enter to bootrom download mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "98734124f8bfb265a2cc86a0df7a1daa2e187d9c",
    "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/1505379121-5437-1-git-send-email-andy.yan@rock-chips.com/mbox/",
    "series": [
        {
            "id": 3052,
            "url": "http://patchwork.ozlabs.org/api/series/3052/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=3052",
            "date": "2017-09-14T08:51:06",
            "name": "support enter download mode on rockchip platform",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/3052/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813748/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813748/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 3xtC3k0hMsz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 18:53:06 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid DDD50C21EEB; Thu, 14 Sep 2017 08:52:32 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5401EC21EE2;\n\tThu, 14 Sep 2017 08:52:30 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid A2362C21F40; Thu, 14 Sep 2017 08:52:18 +0000 (UTC)",
            "from regular1.263xmail.com (regular1.263xmail.com [211.150.99.133])\n\tby lists.denx.de (Postfix) with ESMTPS id E2DC9C21F0D\n\tfor <u-boot@lists.denx.de>; Thu, 14 Sep 2017 08:52:12 +0000 (UTC)",
            "from andy.yan?rock-chips.com (unknown [192.168.167.84])\n\tby regular1.263xmail.com (Postfix) with ESMTP id 3D4898FA3\n\tfor <u-boot@lists.denx.de>; Thu, 14 Sep 2017 16:52:08 +0800 (CST)",
            "from localhost.localdomain (localhost [127.0.0.1])\n\tby smtp.263.net (Postfix) with ESMTPA id C2D2C3E8;\n\tThu, 14 Sep 2017 16:52:07 +0800 (CST)",
            "from localhost.localdomain (unknown [58.22.7.114])\n\tby smtp.263.net (Postfix) whith ESMTP id 28230WQAWZ0;\n\tThu, 14 Sep 2017 16:52:08 +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_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB autolearn=no\n\tautolearn_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": "sjg@chromium.org",
        "X-SENDER-IP": "58.22.7.114",
        "X-LOGIN-NAME": "andy.yan@rock-chips.com",
        "X-UNIQUE-TAG": "<d54170b5c67718b59168630d75d2d1e2>",
        "X-ATTACHMENT-NUM": "0",
        "X-SENDER": "yxj@rock-chips.com",
        "X-DNS-TYPE": "0",
        "From": "Andy Yan <andy.yan@rock-chips.com>",
        "To": "sjg@chromium.org,\n\tphilipp.tomsich@theobroma-systems.com",
        "Date": "Thu, 14 Sep 2017 16:52:01 +0800",
        "Message-Id": "<1505379121-5437-1-git-send-email-andy.yan@rock-chips.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1505379066-5334-1-git-send-email-andy.yan@rock-chips.com>",
        "References": "<1505379066-5334-1-git-send-email-andy.yan@rock-chips.com>",
        "Cc": "u-boot@lists.denx.de, Andy Yan <andy.yan@rock-chips.com>,\n\tdavid.wu@rock-chips.com",
        "Subject": "[U-Boot] [PATCH v2 2/3] rockchip: add support for enter to bootrom\n\tdownload mode",
        "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": "Rockchip bootrom will enter download mode if it returns from\nspl/tpl with a non-zero value and couldn't find a valid image\nin the backup partition.\nThis patch provide a method to instruct the system to back to\nbootrom download mode by checking the BROM_DOWNLOAD_FLAG register.\nAs the bootrom download function relys on some modules such as\ninterrupts, so we need to back to bootrom as early as possbile\nbefore the tpl/tps code override the interrupt configurations.\n\nSigned-off-by: Andy Yan <andy.yan@rock-chips.com>\nReviewed-by: Kever Yang <kever.yang@rock-chips.com>\n\n---\n\nChanges in v2:\n- implement the back to bootrom download mode check in c, thanks for Dr. Philipp Tomsich's suggestion.\n\n arch/arm/include/asm/arch-rockchip/boot_mode.h |  5 +++++\n arch/arm/include/asm/arch-rockchip/bootrom.h   | 15 ++++++++++++-\n arch/arm/mach-rockchip/Kconfig                 |  1 +\n arch/arm/mach-rockchip/bootrom.c               | 31 +++++++++++++++++++++++++-\n arch/arm/mach-rockchip/save_boot_param.S       | 25 ++++++++++++++-------\n 5 files changed, 67 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h\nindex 163b2e7..c2cf6fd 100644\n--- a/arch/arm/include/asm/arch-rockchip/boot_mode.h\n+++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h\n@@ -15,7 +15,12 @@\n #define BOOT_CHARGING\t\t(REBOOT_FLAG + 11)\n /* enter usb mass storage mode */\n #define BOOT_UMS\t\t(REBOOT_FLAG + 12)\n+/* enter bootrom download mode */\n+#define BOOT_BROM_DOWNLOAD\t0xEF08A53C\n \n+#ifndef __ASSEMBLY__\n int setup_boot_mode(void);\n+void check_back_to_brom_dnl_flag(void);\n+#endif\n \n #endif\ndiff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h\nindex 92eb878..0bdea14 100644\n--- a/arch/arm/include/asm/arch-rockchip/bootrom.h\n+++ b/arch/arm/include/asm/arch-rockchip/bootrom.h\n@@ -8,6 +8,16 @@\n #define _ASM_ARCH_BOOTROM_H\n \n /*\n+ *@BOOT_CONTINUE: bootrom continue load next stage image and boot.\n+ *@BOOT_BROM_DNL, bootrom enter download mode if no valid image\n+ *\t\t  found in backup partition.\n+ */\n+enum {\n+\tBOOT_BROM_CONTINUE = 0,\n+\tBOOT_BROM_DNL = 1\n+};\n+\n+/*\n  * Saved Stack pointer address.\n  * Access might be needed in some special cases.\n  */\n@@ -21,7 +31,10 @@ void back_to_bootrom(void);\n \n /**\n  * Assembler component for the above (do not call this directly)\n+ * @mode: BOOT_BROM_CONTINUE, bootrom continue load next stage image and boot;\n+ *        BOOT_BROM_DNL, bootrom enter download mode if no valid image\n+ *        found in packup partition.\n  */\n-void _back_to_bootrom_s(void);\n+void _back_to_bootrom_s(int mode);\n \n #endif\ndiff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig\nindex bf01395..2fd9eb2 100644\n--- a/arch/arm/mach-rockchip/Kconfig\n+++ b/arch/arm/mach-rockchip/Kconfig\n@@ -113,6 +113,7 @@ config ROCKCHIP_RK3399\n \tselect SPL_SERIAL_SUPPORT\n \tselect SPL_DRIVERS_MISC_SUPPORT\n \tselect ENABLE_ARM_SOC_BOOT0_HOOK\n+\tselect ROCKCHIP_BROM_HELPER\n \tselect DEBUG_UART_BOARD_INIT\n \tselect BOARD_LATE_INIT\n \thelp\ndiff --git a/arch/arm/mach-rockchip/bootrom.c b/arch/arm/mach-rockchip/bootrom.c\nindex 8380e4e..463462c 100644\n--- a/arch/arm/mach-rockchip/bootrom.c\n+++ b/arch/arm/mach-rockchip/bootrom.c\n@@ -5,12 +5,41 @@\n  */\n \n #include <common.h>\n+#include <asm/io.h>\n #include <asm/arch/bootrom.h>\n+#include <asm/arch/boot_mode.h>\n \n void back_to_bootrom(void)\n {\n #if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)\n \tputs(\"Returning to boot ROM...\\n\");\n #endif\n-\t_back_to_bootrom_s();\n+\t_back_to_bootrom_s(BOOT_BROM_CONTINUE);\n+}\n+\n+/*\n+ * we back to bootrom download mode if get a\n+ * BOOT_BROM_DOWNLOAD flag in boot mode register\n+ *\n+ * note: (a)the boot mode register is configured by\n+ * application(next stage bootloader, kernel, etc),\n+ * the bootrom never check this register, so we need\n+ * to check it and back at very early bootstage(before\n+ * some basic configurations such as interrupts been\n+ * changed by TPL/TPL), as the bootrom download operation\n+ * relys on many default settings(such as interrupts) by\n+ * it's self.\n+ *       (b)this function share the sampe SP with bootrom code.\n+ */\n+void check_back_to_brom_dnl_flag(void)\n+{\n+\tu32 boot_mode;\n+\n+\tif (CONFIG_ROCKCHIP_BOOT_MODE_REG) {\n+\t\tboot_mode = readl(CONFIG_ROCKCHIP_BOOT_MODE_REG);\n+\t\tif (boot_mode == BOOT_BROM_DOWNLOAD) {\n+\t\t\twritel(0, CONFIG_ROCKCHIP_BOOT_MODE_REG);\n+\t\t\t_back_to_bootrom_s(BOOT_BROM_DNL);\n+\t\t}\n+\t}\n }\ndiff --git a/arch/arm/mach-rockchip/save_boot_param.S b/arch/arm/mach-rockchip/save_boot_param.S\nindex 50fce20..e8fa10b 100644\n--- a/arch/arm/mach-rockchip/save_boot_param.S\n+++ b/arch/arm/mach-rockchip/save_boot_param.S\n@@ -23,14 +23,19 @@ ENTRY(save_boot_params)\n \tldr\tx8, =SAVE_SP_ADDR\n \tmov\tx9, sp\n \tstr\tx9, [x8]\n+\tbl\tcheck_back_to_brom_dnl_flag\n \tb\tsave_boot_params_ret  /* back to my caller */\n ENDPROC(save_boot_params)\n \n+/*\n+ * x0: return value for bootrom, non-zero for bootrom download\n+ *     mode and zero for normal boot mode\n+ */\n .globl _back_to_bootrom_s\n ENTRY(_back_to_bootrom_s)\n-\tldr\tx0, =SAVE_SP_ADDR\n-\tldr\tx0, [x0]\n-\tmov\tsp, x0\n+\tldr\tx1, =SAVE_SP_ADDR\n+\tldr\tx1, [x1]\n+\tmov\tsp, x1\n \tldp\tx29, x30, [sp, #0x50]\n \tldp\tx27, x28, [sp, #0x40]\n \tldp\tx25, x26, [sp, #0x30]\n@@ -38,7 +43,6 @@ ENTRY(_back_to_bootrom_s)\n \tldp\tx21, x22, [sp, #0x10]\n \tldp\tx19, x20, [sp]\n \tadd\tsp, sp, #0x60\n-\tmov\tx0, xzr\n \tret\n ENDPROC(_back_to_bootrom_s)\n #else\n@@ -55,15 +59,20 @@ ENTRY(save_boot_params)\n \tpush\t{r1-r12, lr}\n \tldr\tr0, =SAVE_SP_ADDR\n \tstr\tsp, [r0]\n-\tb\tsave_boot_params_ret\t\t@ back to my caller\n+\tbl\tcheck_back_to_brom_dnl_flag\n+\tb       save_boot_params_ret            @ back to my caller\n ENDPROC(save_boot_params)\n \n \n+/*\n+ * r0: return value for bootrom, non-zero for\n+ *     bootrom download mode and zero for normal\n+ *     boot mode\n+ */\n .globl _back_to_bootrom_s\n ENTRY(_back_to_bootrom_s)\n-\tldr\tr0, =SAVE_SP_ADDR\n-\tldr\tsp, [r0]\n-\tmov\tr0, #0\n+\tldr\tr1, =SAVE_SP_ADDR\n+\tldr\tsp, [r1]\n \tpop\t{r1-r12, pc}\n ENDPROC(_back_to_bootrom_s)\n #endif\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "2/3"
    ]
}