get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 208837,
    "url": "http://patchwork.ozlabs.org/api/patches/208837/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1356952428-19824-7-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-7-git-send-email-jagannadh.teki@gmail.com>",
    "list_archive_url": null,
    "date": "2012-12-31T11:13:45",
    "name": "[U-Boot,06/12] cmd_sf: Add QPP(Quad-input Page Program) write instruction support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "98f4747f52fe9496662ba0091b60c26ef036eaa9",
    "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-7-git-send-email-jagannadh.teki@gmail.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/208837/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/208837/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 8811B2C008C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 31 Dec 2012 22:17:04 +1100 (EST)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 2CE5D4A17B;\n\tMon, 31 Dec 2012 12:17:02 +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 7Wgbp93R-MmA; Mon, 31 Dec 2012 12:17:01 +0100 (CET)",
            "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 262194A168;\n\tMon, 31 Dec 2012 12:15:48 +0100 (CET)",
            "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id E3A8B4A026\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 12:15:13 +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 pePCnAzG1f3v for <u-boot@lists.denx.de>;\n\tMon, 31 Dec 2012 12:15:05 +0100 (CET)",
            "from mail-da0-f48.google.com (mail-da0-f48.google.com\n\t[209.85.210.48]) by theia.denx.de (Postfix) with ESMTPS id D3F924A029\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 12:14:23 +0100 (CET)",
            "by mail-da0-f48.google.com with SMTP id k18so5731931dae.21\n\tfor <u-boot@lists.denx.de>; Mon, 31 Dec 2012 03:14:22 -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.20\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tMon, 31 Dec 2012 03:14:21 -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=gvW4SvzE2X44gdCypYfNJ4R2xC9kKWg7S+D377IAE64=;\n\tb=ZYygkZm9WUtbF4DtAnKOKS9ml3LZuboBGUNyjreTB98zc+kLaQLemR9X1J6AuRbqCN\n\ttaFXV8Mf+UfINX/CGANsRhwRbZRUNzGXnDxd4p3Q8A0fcpKixnaRIrTlhrqTO3RExvnX\n\t3kUYLGgy9pVSjqsf/wWryeGXDyBjeXhvDJUydds/W7R2MC9ZXQZCD4kJmZH6yzMCA+Ej\n\tgO2myyHTKHLbFgMy+0SZp8Fp0YmXH99tkFoYrtgT7ExLr2HK/AEG5tjI4woQ4eF4Oqbk\n\t31+izhIqSm295ls6E43MbSdyyLw3VJekHmHg5d/zJpv6Zt89pn4XfDaCsCjGN3FpsXax\n\tlgRg==",
        "X-Received": "by 10.66.80.65 with SMTP id p1mr119671265pax.20.1356952462070;\n\tMon, 31 Dec 2012 03:14:22 -0800 (PST)",
        "From": "Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>",
        "To": "u-boot@lists.denx.de",
        "Date": "Mon, 31 Dec 2012 16:43:45 +0530",
        "Message-Id": "<1356952428-19824-7-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 06/12] cmd_sf: Add QPP(Quad-input Page Program)\n\twrite instruction support",
        "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 program a flash using 'qpp'\nwrite instruction(wr_inst) for 'sf write' and 'sf update' commands.\n\n'qpp' will effectively increases the data transfer rate\nby up to four times, as compared to the pp( Page Program).\n\nExample:\nwrite 0x2000 length bytes from memory at 0x10000 address to\nflash offset at 0x0 using qpp write instruction.\nu-boot> sf write qpp 0x10000 0x0 0x2000\n\nerase and write 0x2000 length bytes from memory at 0x10000 address to\nflash offset at 0x0 using qpp write instruction and afr read instruction.\nu-boot> sf update qpp afr 0x10000 0x0 0x2000\n\nSigned-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>\n---\n common/cmd_sf.c                      |   41 ++++++++++++++++++++++-----------\n drivers/mtd/spi/spi_flash.c          |   12 ++++++++-\n drivers/mtd/spi/spi_flash_internal.h |    4 +-\n include/spi_flash.h                  |    7 +++--\n include/spi_flash_inst.h             |    1 +\n 5 files changed, 44 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/common/cmd_sf.c b/common/cmd_sf.c\nindex d59ecce..b1f19ef 100644\n--- a/common/cmd_sf.c\n+++ b/common/cmd_sf.c\n@@ -143,6 +143,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])\n  * @param flash\t\tflash context pointer\n  * @param wr_inst\twrite instruction\n  * @param rd_inst\tread instruction\n+ * @param wr_qeb_req\tquad enable bit is required for this write operation?\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@@ -151,8 +152,8 @@ static int do_spi_flash_probe(int argc, char * const argv[])\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, u8 wr_inst,\n-\t\tu8 rd_inst, u32 offset, size_t len, const char *buf,\n-\t\tchar *cmp_buf, size_t *skipped)\n+\t\tu8 rd_inst, u8 wr_qeb_req, u32 offset, size_t len,\n+\t\tconst char *buf, char *cmp_buf, size_t *skipped)\n {\n \tdebug(\"offset=%#x, sector_size=%#x, len=%#zx\\n\",\n \t\toffset, flash->sector_size, len);\n@@ -166,7 +167,7 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u8 wr_inst,\n \t}\n \tif (spi_flash_erase(flash, offset, len))\n \t\treturn \"erase\";\n-\tif (spi_flash_write(flash, wr_inst, offset, len, buf))\n+\tif (spi_flash_write(flash, wr_inst, wr_qeb_req, offset, len, buf))\n \t\treturn \"write\";\n \treturn NULL;\n }\n@@ -178,13 +179,14 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u8 wr_inst,\n  * @param flash\t\tflash context pointer\n  * @param wr_inst\twrite instruction\n  * @param rd_inst\tread instruction\n+ * @param wr_qeb_req\tquad enable bit is required for this write operation?\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, u8 wr_inst, u8 rd_inst,\n-\t\tu32 offset, size_t len, const char *buf)\n+\t\tu8 wr_qeb_req, u32 offset, size_t len, const char *buf)\n {\n \tconst char *err_oper = NULL;\n \tchar *cmp_buf;\n@@ -212,7 +214,8 @@ static int spi_flash_update(struct spi_flash *flash, u8 wr_inst, u8 rd_inst,\n \t\t\t\tlast_update = get_timer(0);\n \t\t\t}\n \t\t\terr_oper = spi_flash_update_block(flash, wr_inst,\n-\t\t\t\t\trd_inst, offset, todo, buf,\n+\t\t\t\t\trd_inst, wr_qeb_req,\n+\t\t\t\t\toffset, todo, buf,\n \t\t\t\t\tcmp_buf, &skipped);\n \t\t}\n \t} else {\n@@ -241,15 +244,21 @@ static int spi_flash_update(struct spi_flash *flash, u8 wr_inst, u8 rd_inst,\n  *    arg: specified write instruction from user\n  * Output:\n  *    wr_inst: parsed write instruction for write operation\n+ *    wr_qeb_req: assign to 1 if this instruction require quad enable bit\n+ *\t\tneed to set prior to actual write operation\n  * Return:\n  *    1: for Unknown wr_inst from user\n  *    0: Success\n  */\n-static int sf_parse_wr_inst_arg(char *arg, u8 *wr_inst)\n+static int sf_parse_wr_inst_arg(char *arg, u8 *wr_inst, u8 *wr_qeb_req)\n {\n-\tif (strcmp(arg, \"pp\") == 0)\n+\tif (strcmp(arg, \"pp\") == 0) {\n \t\t*wr_inst = CMD_PAGE_PROGRAM;\n-\telse\n+\t\t*wr_qeb_req = 0;\n+\t} else if (strcmp(arg, \"qpp\") == 0) {\n+\t\t*wr_inst = CMD_QUAD_PAGE_PROGRAM;\n+\t\t*wr_qeb_req = 1;\n+\t} else\n \t\treturn 1;\n \n \treturn 0;\n@@ -284,6 +293,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \tvoid *buf;\n \tchar *endp;\n \tu8 wr_inst, rd_inst;\n+\tu8 wr_qeb_req;\n \tint update_rd_inst;\n \tint ret;\n \n@@ -323,7 +333,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \t}\n \n \tif (strcmp(argv[0], \"update\") == 0) {\n-\t\tret = sf_parse_wr_inst_arg(argv[1], &wr_inst);\n+\t\tret = sf_parse_wr_inst_arg(argv[1], &wr_inst, &wr_qeb_req);\n \t\tif (ret) {\n \t\t\tprintf(\"SF: Unknown %s wr_inst on 'sf update'\\n\",\n \t\t\t\t\targv[1]);\n@@ -338,7 +348,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \t\t}\n \n \t\tret = spi_flash_update(flash, wr_inst, rd_inst,\n-\t\t\t\t\toffset, len, buf);\n+\t\t\t\twr_qeb_req, offset, len, buf);\n \t} else if (strcmp(argv[0], \"read\") == 0) {\n \t\tret = sf_parse_rd_inst_arg(argv[1], &rd_inst);\n \t\tif (ret) {\n@@ -349,14 +359,15 @@ static int do_spi_flash_read_write(int argc, char * const argv[])\n \n \t\tret = spi_flash_read(flash, rd_inst, offset, len, buf);\n \t} else {\n-\t\tret = sf_parse_wr_inst_arg(argv[1], &wr_inst);\n+\t\tret = sf_parse_wr_inst_arg(argv[1], &wr_inst, &wr_qeb_req);\n \t\tif (ret) {\n \t\t\tprintf(\"SF: Unknown %s wr_inst on 'sf write'\\n\",\n \t\t\t\t\targv[1]);\n \t\t\treturn ret;\n \t\t}\n \n-\t\tret = spi_flash_write(flash, wr_inst, offset, len, buf);\n+\t\tret = spi_flash_write(flash, wr_inst, wr_qeb_req,\n+\t\t\t\toffset, len, buf);\n \t}\n \n \tunmap_physmem(buf, len);\n@@ -622,15 +633,17 @@ U_BOOT_CMD(\n \t\"sf write wr_inst addr offset len\\n\"\n \t\"\t\t\t\t- 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 | qpp `wr_inst' write instructions\\n\"\n \t\"\t\t\t\t  pp (Page Program, 02h)\\n\"\n+\t\"\t\t\t\t  qpp (Quad Page Program, 32h)\\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 wr_inst rd_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 and\\n\"\n+\t\"\t\t\t\t  pp | qpp `wr_inst' write instructions and\\n\"\n \t\"\t\t\t\t  pp (Page Program, 02h)\\n\"\n+\t\"\t\t\t\t  qpp (Quad Page Program, 32h)\\n\"\n \t\"\t\t\t\t  afr `rd_inst' read instruction\\n\"\n \t\"\t\t\t\t  afr (Array Fast Read, 0bh)\"\n \tSF_TEST_HELP\ndiff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c\nindex 0c64ac2..3d57863 100644\n--- a/drivers/mtd/spi/spi_flash.c\n+++ b/drivers/mtd/spi/spi_flash.c\n@@ -65,8 +65,8 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,\n \treturn spi_flash_read_write(spi, cmd, cmd_len, data, NULL, data_len);\n }\n \n-int spi_flash_cmd_write_multi(struct spi_flash *flash, u8 wr_inst, u32 offset,\n-\t\tsize_t len, const void *buf)\n+int spi_flash_cmd_write_multi(struct spi_flash *flash, u8 wr_inst,\n+\t\tu8 wr_qeb_req, u32 offset, size_t len, const void *buf)\n {\n \tunsigned long page_addr, byte_addr, page_size;\n \tsize_t chunk_len, actual;\n@@ -83,6 +83,14 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u8 wr_inst, u32 offset,\n \t\treturn ret;\n \t}\n \n+\tif (wr_qeb_req) {\n+\t\tret = spi_flash_set_quad_enable_bit(flash);\n+\t\tif (ret) {\n+\t\t\tdebug(\"SF: set quad enable bit failed\\n\");\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n \tcmd[0] = wr_inst;\n \tfor (actual = 0; actual < len; actual += chunk_len) {\n \t\tchunk_len = min(len - actual, page_size - byte_addr);\ndiff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h\nindex dcf8813..e36f216 100644\n--- a/drivers/mtd/spi/spi_flash_internal.h\n+++ b/drivers/mtd/spi/spi_flash_internal.h\n@@ -57,8 +57,8 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,\n  * Write the requested data out breaking it up into multiple write\n  * commands as needed per the write size.\n  */\n-int spi_flash_cmd_write_multi(struct spi_flash *flash, u8 wr_inst, u32 offset,\n-\t\tsize_t len, const void *buf);\n+int spi_flash_cmd_write_multi(struct spi_flash *flash, u8 wr_inst,\n+\t\tu8 wr_qeb_req, u32 offset, size_t len, const void *buf);\n \n /*\n  * Enable writing on the SPI flash.\ndiff --git a/include/spi_flash.h b/include/spi_flash.h\nindex 6728796..31e7d9e 100644\n--- a/include/spi_flash.h\n+++ b/include/spi_flash.h\n@@ -42,7 +42,8 @@ struct spi_flash {\n \tint\t\t(*read)(struct spi_flash *flash, u8 rd_inst,\n \t\t\t\tu32 offset, size_t len, void *buf);\n \tint\t\t(*write)(struct spi_flash *flash, u8 wr_inst,\n-\t\t\t\tu32 offset, size_t len, const void *buf);\n+\t\t\t\tu8 wr_qeb_req, u32 offset, size_t len,\n+\t\t\t\tconst void *buf);\n \tint\t\t(*erase)(struct spi_flash *flash, u32 offset,\n \t\t\t\tsize_t len);\n };\n@@ -58,9 +59,9 @@ static inline int spi_flash_read(struct spi_flash *flash, u8 rd_inst,\n }\n \n static inline int spi_flash_write(struct spi_flash *flash, u8 wr_inst,\n-\t\tu32 offset, size_t len, const void *buf)\n+\t\tu8 wr_qeb_req, u32 offset, size_t len, const void *buf)\n {\n-\treturn flash->write(flash, wr_inst, offset, len, buf);\n+\treturn flash->write(flash, wr_inst, wr_qeb_req, offset, len, buf);\n }\n \n static inline int spi_flash_erase(struct spi_flash *flash, u32 offset,\ndiff --git a/include/spi_flash_inst.h b/include/spi_flash_inst.h\nindex 7c1b910..a530842 100644\n--- a/include/spi_flash_inst.h\n+++ b/include/spi_flash_inst.h\n@@ -26,6 +26,7 @@\n \n /* Write commands */\n #define CMD_PAGE_PROGRAM\t\t0x02\n+#define CMD_QUAD_PAGE_PROGRAM\t\t0x32\n \n /* Read commands */\n #define CMD_READ_ARRAY_FAST\t\t0x0b\n",
    "prefixes": [
        "U-Boot",
        "06/12"
    ]
}