Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816903/?format=api
{ "id": 816903, "url": "http://patchwork.ozlabs.org/api/patches/816903/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1506004213-22620-26-git-send-email-jjhiblot@ti.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": "<1506004213-22620-26-git-send-email-jjhiblot@ti.com>", "list_archive_url": null, "date": "2017-09-21T14:30:12", "name": "[U-Boot,v2,25/26] mmc: add a library function to send tuning command", "commit_ref": "9815e3ba807ddf395631be35629498e55af02fa0", "pull_url": null, "state": "accepted", "archived": false, "hash": "4c78cdc76831609e30388490a3686a7ce544a7c7", "submitter": { "id": 70508, "url": "http://patchwork.ozlabs.org/api/people/70508/?format=api", "name": "Jean-Jacques Hiblot", "email": "jjhiblot@ti.com" }, "delegate": { "id": 12423, "url": "http://patchwork.ozlabs.org/api/users/12423/?format=api", "username": "Jaehoon", "first_name": "Jaehoon", "last_name": "Chung", "email": "jh80.chung@samsung.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1506004213-22620-26-git-send-email-jjhiblot@ti.com/mbox/", "series": [ { "id": 4400, "url": "http://patchwork.ozlabs.org/api/series/4400/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=4400", "date": "2017-09-21T14:29:47", "name": "mmc: Add support for HS200 and UHS modes", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/4400/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816903/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816903/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>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ti.com header.i=@ti.com header.b=\"BtjJO9Bg\";\n\tdkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyfQy4500z9t3w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 00:40:09 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 19143C2201E; Thu, 21 Sep 2017 14:34:27 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 58612C22009;\n\tThu, 21 Sep 2017 14:32:00 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 25716C21FEA; Thu, 21 Sep 2017 14:31:23 +0000 (UTC)", "from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77])\n\tby lists.denx.de (Postfix) with ESMTPS id 1A98CC21ED3\n\tfor <u-boot@lists.denx.de>; Thu, 21 Sep 2017 14:31:16 +0000 (UTC)", "from dflxv15.itg.ti.com ([128.247.5.124])\n\tby lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8LEVFFJ029550; \n\tThu, 21 Sep 2017 09:31:15 -0500", "from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31])\n\tby dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEVFWL029567;\n\tThu, 21 Sep 2017 09:31:15 -0500", "from DLEE113.ent.ti.com (157.170.170.24) by DLEE101.ent.ti.com\n\t(157.170.170.31) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34;\n\tThu, 21 Sep 2017 09:31:15 -0500", "from dflp33.itg.ti.com (10.64.6.16) by DLEE113.ent.ti.com\n\t(157.170.170.24) with Microsoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend\n\tTransport; Thu, 21 Sep 2017 09:31:14 -0500", "from localhost (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEVDwC001488;\n\tThu, 21 Sep 2017 09:31:14 -0500" ], "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=RCVD_IN_DNSWL_NONE,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com;\n\ts=ti-com-17Q1; t=1506004275;\n\tbh=I2nrnrowg2g1lmSG2YkxZYYPTUbdk8Yiq2C7Ag2MHOc=;\n\th=From:To:CC:Subject:Date:In-Reply-To:References;\n\tb=BtjJO9BgRjhryOo8qGVmam7kDlKegJkv6X6Yj5WUQPcFFXPejqaZMSM2Pi0o/uUzg\n\trhOr571mEmqfjg2vdGzrwnR5eJaGuxEETTLeWV22fS9axp9YyfTAqiL4ufKxX6+eRf\n\tfxtAK8B/j5s4oAmIJ8fxZBx0g65882o3VrTM1XM4=", "From": "Jean-Jacques Hiblot <jjhiblot@ti.com>", "To": "<jh80.chung@samsung.com>, <trini@konsulko.com>, <kishon@ti.com>,\n\t<sjg@chromium.org>", "Date": "Thu, 21 Sep 2017 16:30:12 +0200", "Message-ID": "<1506004213-22620-26-git-send-email-jjhiblot@ti.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1506004213-22620-1-git-send-email-jjhiblot@ti.com>", "References": "<1506004213-22620-1-git-send-email-jjhiblot@ti.com>", "MIME-Version": "1.0", "X-EXCLAIMER-MD-CONFIG": "e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180", "Cc": "u-boot@lists.denx.de", "Subject": "[U-Boot] [PATCH v2 25/26] mmc: add a library function to send\n\ttuning command", "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>", "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": "HS200/SDR104 requires tuning command to be sent to the card.\nAdd a simple function to send tuning command and to read and\ncompare the received data with the tuning block pattern.\nThis function can be used by platform driver to perform DLL\ntuning.\nThis patch is similar to\ncommit 996903de92f0 (\"mmc: core: add core-level function for\nsending tuning commands\") added in linux kernel.\n\nSigned-off-by: Kishon Vijay Abraham I <kishon@ti.com>\nSigned-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>\n---\n drivers/mmc/mmc.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n include/mmc.h | 1 +\n 2 files changed, 69 insertions(+)", "diff": "diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c\nindex 2d447dd..47e0c99 100644\n--- a/drivers/mmc/mmc.c\n+++ b/drivers/mmc/mmc.c\n@@ -308,6 +308,74 @@ int mmc_set_blocklen(struct mmc *mmc, int len)\n \treturn err;\n }\n \n+static const u8 tuning_blk_pattern_4bit[] = {\n+\t0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc,\n+\t0xc3, 0x3c, 0xcc, 0xff, 0xfe, 0xff, 0xfe, 0xef,\n+\t0xff, 0xdf, 0xff, 0xdd, 0xff, 0xfb, 0xff, 0xfb,\n+\t0xbf, 0xff, 0x7f, 0xff, 0x77, 0xf7, 0xbd, 0xef,\n+\t0xff, 0xf0, 0xff, 0xf0, 0x0f, 0xfc, 0xcc, 0x3c,\n+\t0xcc, 0x33, 0xcc, 0xcf, 0xff, 0xef, 0xff, 0xee,\n+\t0xff, 0xfd, 0xff, 0xfd, 0xdf, 0xff, 0xbf, 0xff,\n+\t0xbb, 0xff, 0xf7, 0xff, 0xf7, 0x7f, 0x7b, 0xde,\n+};\n+\n+static const u8 tuning_blk_pattern_8bit[] = {\n+\t0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,\n+\t0xff, 0xff, 0xcc, 0xcc, 0xcc, 0x33, 0xcc, 0xcc,\n+\t0xcc, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 0xff, 0xff,\n+\t0xff, 0xee, 0xff, 0xff, 0xff, 0xee, 0xee, 0xff,\n+\t0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 0xdd, 0xdd,\n+\t0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xbb,\n+\t0xbb, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff,\n+\t0x77, 0x77, 0xff, 0x77, 0xbb, 0xdd, 0xee, 0xff,\n+\t0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,\n+\t0x00, 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0x33, 0xcc,\n+\t0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 0xff,\n+\t0xff, 0xff, 0xee, 0xff, 0xff, 0xff, 0xee, 0xee,\n+\t0xff, 0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 0xdd,\n+\t0xdd, 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff,\n+\t0xbb, 0xbb, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff,\n+\t0xff, 0x77, 0x77, 0xff, 0x77, 0xbb, 0xdd, 0xee,\n+};\n+\n+int mmc_send_tuning(struct mmc *mmc, u32 opcode, int *cmd_error)\n+{\n+\tstruct mmc_cmd cmd;\n+\tstruct mmc_data data;\n+\tconst u8 *tuning_block_pattern;\n+\tint size, err;\n+\n+\tif (mmc->bus_width == 8) {\n+\t\ttuning_block_pattern = tuning_blk_pattern_8bit;\n+\t\tsize = sizeof(tuning_blk_pattern_8bit);\n+\t} else if (mmc->bus_width == 4) {\n+\t\ttuning_block_pattern = tuning_blk_pattern_4bit;\n+\t\tsize = sizeof(tuning_blk_pattern_4bit);\n+\t} else {\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tALLOC_CACHE_ALIGN_BUFFER(u8, data_buf, size);\n+\n+\tcmd.cmdidx = opcode;\n+\tcmd.cmdarg = 0;\n+\tcmd.resp_type = MMC_RSP_R1;\n+\n+\tdata.dest = (void *)data_buf;\n+\tdata.blocks = 1;\n+\tdata.blocksize = size;\n+\tdata.flags = MMC_DATA_READ;\n+\n+\terr = mmc_send_cmd(mmc, &cmd, &data);\n+\tif (err)\n+\t\treturn err;\n+\n+\tif (memcmp(data_buf, tuning_block_pattern, size))\n+\t\treturn -EIO;\n+\n+\treturn 0;\n+}\n+\n static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,\n \t\t\t lbaint_t blkcnt)\n {\ndiff --git a/include/mmc.h b/include/mmc.h\nindex c11f698..79be6b4 100644\n--- a/include/mmc.h\n+++ b/include/mmc.h\n@@ -650,6 +650,7 @@ void mmc_destroy(struct mmc *mmc);\n int mmc_unbind(struct udevice *dev);\n int mmc_initialize(bd_t *bis);\n int mmc_init(struct mmc *mmc);\n+int mmc_send_tuning(struct mmc *mmc, u32 opcode, int *cmd_error);\n int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);\n \n /**\n", "prefixes": [ "U-Boot", "v2", "25/26" ] }