get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812307,
    "url": "http://patchwork.ozlabs.org/api/patches/812307/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1505126876-32799-1-git-send-email-philipp.tomsich@theobroma-systems.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": "<1505126876-32799-1-git-send-email-philipp.tomsich@theobroma-systems.com>",
    "list_archive_url": null,
    "date": "2017-09-11T10:47:56",
    "name": "[U-Boot] rockchip: rk3399: spl: remove hard-coded addresses for GRF and SGRF",
    "commit_ref": "ba1657338b05337cea516dcfea6614c06f771613",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6069dbab70669f21ec8e5b71e66819d169900c35",
    "submitter": {
        "id": 53488,
        "url": "http://patchwork.ozlabs.org/api/people/53488/?format=api",
        "name": "Philipp Tomsich",
        "email": "philipp.tomsich@theobroma-systems.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/1505126876-32799-1-git-send-email-philipp.tomsich@theobroma-systems.com/mbox/",
    "series": [
        {
            "id": 2476,
            "url": "http://patchwork.ozlabs.org/api/series/2476/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2476",
            "date": "2017-09-11T10:47:56",
            "name": "[U-Boot] rockchip: rk3399: spl: remove hard-coded addresses for GRF and SGRF",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2476/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812307/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812307/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 3xrPm92zvcz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 20:48:25 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 23F89C21E70; Mon, 11 Sep 2017 10:48:15 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id F227AC21C72;\n\tMon, 11 Sep 2017 10:48:12 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 5A5FEC21F2D; Mon, 11 Sep 2017 10:48:05 +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 2CDE2C21EA7\n\tfor <u-boot@lists.denx.de>; Mon, 11 Sep 2017 10:48:05 +0000 (UTC)",
            "from [86.59.122.178] (port=59019 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 1drMG2-0003h0-1n; Mon, 11 Sep 2017 12:48:02 +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, 11 Sep 2017 12:47:56 +0200",
        "Message-Id": "<1505126876-32799-1-git-send-email-philipp.tomsich@theobroma-systems.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "Cc": "Albert Aribaud <albert.u.boot@aribaud.net>",
        "Subject": "[U-Boot] [PATCH] rockchip: rk3399: spl: remove hard-coded addresses\n\tfor GRF and SGRF",
        "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": "On the RK3399, we will have either OF_PLATDATA or full OF_CONTROL\nenabled: this allows the use of syscon to retrieve the addresses of\nGRF and SGRF (except for the early debug UART setup, which runs so\nearly that the device-model is not initialised).\n\nThis removes the hard-coded addresses and goes through syscon to\nretrieve the base-addresses of GRF and SGRF. After that, we use\nthe structure definitions to locate the respective registers.\n\nIn addition to this, the inclusion of header files is also cleaned up:\n- all headers are included at the beginning (there was a spurious\n  inclusion of the grf header from within a function)\n- all #include statements for unused headers are removed\n- the remaining #include statements are sorted (while keeping common.h\n  included in front)\n\nSigned-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>\n---\n\n arch/arm/mach-rockchip/rk3399-board-spl.c | 34 +++++++++++++++----------------\n 1 file changed, 16 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c\nindex d6bf74f..3406156 100644\n--- a/arch/arm/mach-rockchip/rk3399-board-spl.c\n+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c\n@@ -5,19 +5,17 @@\n  */\n \n #include <common.h>\n-#include <debug_uart.h>\n-#include <dm.h>\n-#include <ram.h>\n-#include <spl.h>\n-#include <asm/gpio.h>\n-#include <asm/io.h>\n #include <asm/arch/clock.h>\n+#include <asm/arch/grf_rk3399.h>\n #include <asm/arch/hardware.h>\n #include <asm/arch/periph.h>\n-#include <asm/arch/sdram.h>\n-#include <asm/arch/timer.h>\n+#include <asm/io.h>\n+#include <debug_uart.h>\n+#include <dm.h>\n #include <dm/pinctrl.h>\n-#include <power/regulator.h>\n+#include <ram.h>\n+#include <spl.h>\n+#include <syscon.h>\n \n DECLARE_GLOBAL_DATA_PTR;\n \n@@ -53,7 +51,6 @@ void secure_timer_init(void)\n \n void board_debug_uart_init(void)\n {\n-#include <asm/arch/grf_rk3399.h>\n #define GRF_BASE\t0xff770000\n \tstruct rk3399_grf_regs * const grf = (void *)GRF_BASE;\n \n@@ -80,13 +77,12 @@ void board_debug_uart_init(void)\n #endif\n }\n \n-#define GRF_EMMCCORE_CON11 0xff77f02c\n-#define SGRF_DDR_RGN_CON16 0xff330040\n-#define SGRF_SLV_SECURE_CON4 0xff33e3d0\n void board_init_f(ulong dummy)\n {\n \tstruct udevice *pinctrl;\n \tstruct udevice *dev;\n+\tstruct rk3399_pmusgrf_regs *sgrf;\n+\tstruct rk3399_grf_regs *grf;\n \tint ret;\n \n #define EARLY_UART\n@@ -103,9 +99,6 @@ void board_init_f(ulong dummy)\n \tprintascii(\"U-Boot SPL board init\");\n #endif\n \n-\t/*  Emmc clock generator: disable the clock multipilier */\n-\trk_clrreg(GRF_EMMCCORE_CON11, 0x0ff);\n-\n \tret = spl_early_init();\n \tif (ret) {\n \t\tdebug(\"spl_early_init() failed: %d\\n\", ret);\n@@ -121,8 +114,13 @@ void board_init_f(ulong dummy)\n \t * driver, which tries to DMA from/to the stack (likely)\n \t * located in this range.\n \t */\n-\trk_clrsetreg(SGRF_DDR_RGN_CON16, 0x1FF, 0);\n-\trk_clrreg(SGRF_SLV_SECURE_CON4, 0x2000);\n+\tsgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);\n+\trk_clrsetreg(&sgrf->ddr_rgn_con[16], 0x1ff, 0);\n+\trk_clrreg(&sgrf->slv_secure_con4, 0x2000);\n+\n+\t/*  eMMC clock generator: disable the clock multipilier */\n+\tgrf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);\n+\trk_clrreg(&grf->emmccore_con[11], 0x0ff);\n \n \tsecure_timer_init();\n \n",
    "prefixes": [
        "U-Boot"
    ]
}