get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 208833,
    "url": "http://patchwork.ozlabs.org/api/patches/208833/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1356952428-19824-4-git-send-email-jagannadh.teki@gmail.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": "<1356952428-19824-4-git-send-email-jagannadh.teki@gmail.com>",
    "list_archive_url": null,
    "date": "2012-12-31T11:13:42",
    "name": "[U-Boot,03/12] cmd_sf: Add wr_inst argument to 'sf update' command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9eabf3f104c3ad82452a5f1c803ad556ae68af03",
    "submitter": {
        "id": 20045,
        "url": "http://patchwork.ozlabs.org/api/people/20045/?format=api",
        "name": "Jagan Teki",
        "email": "jagannadh.teki@gmail.com"
    },
    "delegate": {
        "id": 17739,
        "url": "http://patchwork.ozlabs.org/api/users/17739/?format=api",
        "username": "jagan",
        "first_name": "Jagannadha Sutradharudu",
        "last_name": "Teki",
        "email": "jagannadh.teki@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1356952428-19824-4-git-send-email-jagannadh.teki@gmail.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/208833/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/208833/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",
        "Received": [
            "from theia.denx.de (theia.denx.de [85.214.87.163])\n\tby ozlabs.org (Postfix) with ESMTP id 861482C0086\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 31 Dec 2012 22:16:26 +1100 (EST)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 1830F4A156;\n\tMon, 31 Dec 2012 12:16:24 +0100 (CET)",
            "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id unVEmvoJzNWD; Mon, 31 Dec 2012 12:16:23 +0100 (CET)",
            "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id BB9284A15B;\n\tMon, 31 Dec 2012 12:15:37 +0100 (CET)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id EE8154A11F\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 12:14:58 +0100 (CET)",
            "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id yVj+5vUHJrut for <u-boot@lists.denx.de>;\n\tMon, 31 Dec 2012 12:14:54 +0100 (CET)",
            "from mail-pb0-f50.google.com (mail-pb0-f50.google.com\n\t[209.85.160.50]) by theia.denx.de (Postfix) with ESMTPS id B222C4A01E\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 12:14:17 +0100 (CET)",
            "by mail-pb0-f50.google.com with SMTP id wz7so6989528pbc.9\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 03:14:16 -0800 (PST)",
            "from localhost.localdomain ([49.204.11.250])\n\tby mx.google.com with ESMTPS id\n\tnw9sm24715215pbb.42.2012.12.31.03.14.14\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tMon, 31 Dec 2012 03:14:15 -0800 (PST)"
        ],
        "X-Virus-Scanned": [
            "Debian amavisd-new at theia.denx.de",
            "Debian amavisd-new at theia.denx.de"
        ],
        "X-policyd-weight": "NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5\n\tNOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\n\t:references; bh=XKwRMBDh/jgiiYA5ovV00KmVDD0sx33MYVu+ZoNxWhQ=;\n\tb=YNIALCfJI+rKxbBUDpc/NGK1+oFLP6q0u5BvOWrI7HNJ601SnAMp5QvH9GEJSI1LCv\n\tTAkfx6gNCWfx6NGmvGEFVl3djD87ReCVCJEEbaZjJtI8q5XOLcLYZkOR+yxm7AAyLRr/\n\t84grsCAj0fRE0o8U3GtU5liDlQwvL4ht5M3b9FGTB8Rhqhfcv36rs3cbjuw2bhHYGoBP\n\tBRHOB6vsJx7OWJa8lVCxcD1HMSCXlSbbszdM2aWnXA7yiUfKRu4Sh8n/GXPtroCyI+jc\n\tUEuSKklujDTXJHXqfC45kogKHlFUBm4MH9NeYCqHE3M8kzqDqDgMVpnsxJaBN+dx5nA+\n\tJIZQ==",
        "X-Received": "by 10.68.241.133 with SMTP id wi5mr126119640pbc.48.1356952456060;\n\tMon, 31 Dec 2012 03:14:16 -0800 (PST)",
        "From": "Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>",
        "To": "u-boot@lists.denx.de",
        "Date": "Mon, 31 Dec 2012 16:43:42 +0530",
        "Message-Id": "<1356952428-19824-4-git-send-email-jagannadh.teki@gmail.com>",
        "X-Mailer": "git-send-email 1.7.0.4",
        "In-Reply-To": "<1356952428-19824-1-git-send-email-jagannadh.teki@gmail.com>",
        "References": "<1356952428-19824-1-git-send-email-jagannadh.teki@gmail.com>",
        "Subject": "[U-Boot] [PATCH 03/12] cmd_sf: Add wr_inst argument to 'sf update'\n\tcommand",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<http://lists.denx.de/mailman/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": "<http://lists.denx.de/mailman/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "u-boot-bounces@lists.denx.de",
        "Errors-To": "u-boot-bounces@lists.denx.de"
    },
    "content": "This patch provides a support to add a write instruction(wr_inst)\nargument to 'sf update' command.\n\nUser will dynamically use the specific write instruction while\nprogramming the flash using 'sf update' command.\nCurrently added an existing write instruction called pp(Page Program).\n\nExample:\nerase and write 0x2000 length bytes from memory at 0x10000 address to\nflash offset at 0x0 using pp write instruction.\nu-boot> sf update pp 0x10000 0x0 0x2000\n\nSigned-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>\n---\n common/cmd_sf.c |   37 ++++++++++++++++++++++++++-----------\n 1 files changed, 26 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/common/cmd_sf.c b/common/cmd_sf.c\nindex 88b18f8..0f4e440 100644\n--- a/common/cmd_sf.c\n+++ b/common/cmd_sf.c\n@@ -141,6 +141,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])\n  * If the data being written is the same, then *skipped is incremented by len.\n  *\n  * @param flash\t\tflash context pointer\n+ * @param wr_inst\twrite instruction\n  * @param offset\tflash offset to write\n  * @param len\t\tnumber of bytes to write\n  * @param buf\t\tbuffer to write from\n@@ -148,8 +149,9 @@ static int do_spi_flash_probe(int argc, char * const argv[])\n  * @param skipped\tCount of skipped data (incremented by this function)\n  * @return NULL if OK, else a string containing the stage which failed\n  */\n-static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset,\n-\t\tsize_t len, const char *buf, char *cmp_buf, size_t *skipped)\n+static const char *spi_flash_update_block(struct spi_flash *flash, u8 wr_inst,\n+\t\tu32 offset, size_t len, const char *buf, char *cmp_buf,\n+\t\tsize_t *skipped)\n {\n \tdebug(\"offset=%#x, sector_size=%#x, len=%#zx\\n\",\n \t\toffset, flash->sector_size, len);\n@@ -163,7 +165,7 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset,\n \t}\n \tif (spi_flash_erase(flash, offset, len))\n \t\treturn \"erase\";\n-\tif (spi_flash_write(flash, offset, len, buf))\n+\tif (spi_flash_write(flash, wr_inst, offset, len, buf))\n \t\treturn \"write\";\n \treturn NULL;\n }\n@@ -173,12 +175,13 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset,\n  * to change. Existing blocks with the correct data are left unchanged.\n  *\n  * @param flash\t\tflash context pointer\n+ * @param wr_inst\twrite instruction\n  * @param offset\tflash offset to write\n  * @param len\t\tnumber of bytes to write\n  * @param buf\t\tbuffer to write from\n  * @return 0 if ok, 1 on error\n  */\n-static int spi_flash_update(struct spi_flash *flash, u32 offset,\n+static int spi_flash_update(struct spi_flash *flash, u8 wr_inst, u32 offset,\n \t\tsize_t len, const char *buf)\n {\n \tconst char *err_oper = NULL;\n@@ -206,8 +209,9 @@ static int spi_flash_update(struct spi_flash *flash, u32 offset,\n \t\t\t\t\t\t\t start_time));\n \t\t\t\tlast_update = get_timer(0);\n \t\t\t}\n-\t\t\terr_oper = spi_flash_update_block(flash, offset, todo,\n-\t\t\t\t\tbuf, cmp_buf, &skipped);\n+\t\t\terr_oper = spi_flash_update_block(flash, wr_inst,\n+\t\t\t\t\toffset, todo, buf, cmp_buf,\n+\t\t\t\t\t&skipped);\n \t\t}\n \t} else {\n \t\terr_oper = \"malloc\";\n@@ -264,9 +268,17 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \t\treturn 1;\n \t}\n \n-\tif (strcmp(argv[0], \"update\") == 0)\n-\t\tret = spi_flash_update(flash, offset, len, buf);\n-\telse if (strcmp(argv[0], \"read\") == 0) {\n+\tif (strcmp(argv[0], \"update\") == 0) {\n+\t\tif (strcmp(argv[1], \"pp\") == 0)\n+\t\t\twr_inst = CMD_PAGE_PROGRAM;\n+\t\telse {\n+\t\t\tprintf(\"SF: Unknown %s wr_inst on 'sf update'\\n\",\n+\t\t\t\t\targv[1]);\n+\t\t\treturn 1;\n+\t\t}\n+\n+\t\tret = spi_flash_update(flash, wr_inst, offset, len, buf);\n+\t} else if (strcmp(argv[0], \"read\") == 0) {\n \t\tif (strcmp(argv[1], \"afr\") == 0)\n \t\t\trd_inst = CMD_READ_ARRAY_FAST;\n \t\telse {\n@@ -555,7 +567,10 @@ U_BOOT_CMD(\n \t\"\t\t\t\t  pp (Page Program, 02h)\\n\"\n \t\"sf erase offset [+]len\t\t- erase `len' bytes from `offset'\\n\"\n \t\"\t\t\t\t  `+len' round up `len' to block size\\n\"\n-\t\"sf update addr offset len\t- erase and write `len' bytes from memory\\n\"\n-\t\"\t\t\t\t  at `addr' to flash at `offset'\"\n+\t\"sf update wr_inst addr offset len\\n\"\n+\t\"\t\t\t\t- erase and write `len' bytes from memory\\n\"\n+\t\"\t\t\t\t  at `addr' to flash at `offset' using\\n\"\n+\t\"\t\t\t\t  pp `wr_inst' write instruction\\n\"\n+\t\"\t\t\t\t  pp (Page Program, 02h)\"\n \tSF_TEST_HELP\n );\n",
    "prefixes": [
        "U-Boot",
        "03/12"
    ]
}