{"id":816911,"url":"http://patchwork.ozlabs.org/api/patches/816911/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1506004213-22620-27-git-send-email-jjhiblot@ti.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","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-27-git-send-email-jjhiblot@ti.com>","list_archive_url":null,"date":"2017-09-21T14:30:13","name":"[U-Boot,v2,26/26] dm: mmc: Add a library function to parse generic dt binding","commit_ref":"9215ef5ed508b5de8b0c021a87b76f74561d1bad","pull_url":null,"state":"accepted","archived":false,"hash":"2ceac9d5a70ee8eb4eaa94457951443889a5c38d","submitter":{"id":70508,"url":"http://patchwork.ozlabs.org/api/people/70508/?format=json","name":"Jean-Jacques Hiblot","email":"jjhiblot@ti.com"},"delegate":{"id":12423,"url":"http://patchwork.ozlabs.org/api/users/12423/?format=json","username":"Jaehoon","first_name":"Jaehoon","last_name":"Chung","email":"jh80.chung@samsung.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1506004213-22620-27-git-send-email-jjhiblot@ti.com/mbox/","series":[{"id":4400,"url":"http://patchwork.ozlabs.org/api/series/4400/?format=json","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/816911/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816911/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=\"gxAgFzbm\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyfTm3hStz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 00:42:36 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 4B9FBC2202A; Thu, 21 Sep 2017 14:36:02 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 14F08C2200A;\n\tThu, 21 Sep 2017 14:32:55 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 4ADA5C22017; Thu, 21 Sep 2017 14:31:26 +0000 (UTC)","from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17])\n\tby lists.denx.de (Postfix) with ESMTPS id ACF0BC21FF9\n\tfor <u-boot@lists.denx.de>; Thu, 21 Sep 2017 14:31:19 +0000 (UTC)","from dflxv15.itg.ti.com ([128.247.5.124])\n\tby fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8LEVHtE000526; \n\tThu, 21 Sep 2017 09:31:17 -0500","from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26])\n\tby dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEVHCa029640;\n\tThu, 21 Sep 2017 09:31:17 -0500","from DFLE108.ent.ti.com (10.64.6.29) by DFLE105.ent.ti.com\n\t(10.64.6.26) 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:17 -0500","from dlep32.itg.ti.com (157.170.170.100) by DFLE108.ent.ti.com\n\t(10.64.6.29) 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:17 -0500","from localhost (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEVFk3031471;\n\tThu, 21 Sep 2017 09:31:16 -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=1506004277;\n\tbh=+aSH85jPIil0YmIkCkhAsqUZSCCr/rsYvtOv6r2ERTo=;\n\th=From:To:CC:Subject:Date:In-Reply-To:References;\n\tb=gxAgFzbmAcaYw+FsgC4xBP7HVXJ/xXFnhK/nBVat2eq1XCRWO5JnXsa214ogtzP0z\n\tHKYCWQOQ10cIPniIHOII+QXaPPo1xaqobzLR11qm4FS2Q9CXeGwGDPwFX1ciyPqwkQ\n\teIBlGeRnjPk9KJ2sbUx2TR5ggvjQi+QUvBj+iG2Y=","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:13 +0200","Message-ID":"<1506004213-22620-27-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 26/26] dm: mmc: Add a library function to parse\n\tgeneric dt binding","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":"From: Kishon Vijay Abraham I <kishon@ti.com>\n\nAdd a new function to parse host controller dt node and\nset mmc_config. This function can be used by mmc controller\ndrivers to set the generic mmc_config.\nThis function can be extended to set other UHS mode caps\nonce UHS mode support is added.\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-uclass.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++\n include/mmc.h            |  1 +\n 2 files changed, 47 insertions(+)","diff":"diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c\nindex 7856e0a..e30cde7 100644\n--- a/drivers/mmc/mmc-uclass.c\n+++ b/drivers/mmc/mmc-uclass.c\n@@ -120,6 +120,52 @@ int mmc_execute_tuning(struct mmc *mmc, uint opcode)\n \treturn dm_mmc_execute_tuning(mmc->dev, opcode);\n }\n \n+int mmc_of_parse(const void *fdt, int node, struct mmc_config *cfg)\n+{\n+\tint val;\n+\n+\tval = fdtdec_get_int(fdt, node, \"bus-width\", 1);\n+\n+\tswitch (val) {\n+\tcase 0x8:\n+\t\tcfg->host_caps |= MMC_MODE_8BIT;\n+\t\t/* fall through */\n+\tcase 0x4:\n+\t\tcfg->host_caps |= MMC_MODE_4BIT;\n+\t\t/* fall through */\n+\tcase 0x1:\n+\t\tcfg->host_caps |= MMC_MODE_1BIT;\n+\t\tbreak;\n+\tdefault:\n+\t\tprintf(\"error: %s invalid bus-width property %d\\n\",\n+\t\t       fdt_get_name(fdt, node, NULL), val);\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tcfg->f_max = fdtdec_get_int(fdt, node, \"max-frequency\", 52000000);\n+\n+\tif (fdtdec_get_bool(fdt, node, \"cap-sd-highspeed\"))\n+\t\tcfg->host_caps |= MMC_CAP(SD_HS);\n+\tif (fdtdec_get_bool(fdt, node, \"cap-mmc-highspeed\"))\n+\t\tcfg->host_caps |= MMC_CAP(MMC_HS);\n+\tif (fdtdec_get_bool(fdt, node, \"sd-uhs-sdr12\"))\n+\t\tcfg->host_caps |= MMC_CAP(UHS_SDR12);\n+\tif (fdtdec_get_bool(fdt, node, \"sd-uhs-sdr25\"))\n+\t\tcfg->host_caps |= MMC_CAP(UHS_SDR25);\n+\tif (fdtdec_get_bool(fdt, node, \"sd-uhs-sdr50\"))\n+\t\tcfg->host_caps |= MMC_CAP(UHS_SDR50);\n+\tif (fdtdec_get_bool(fdt, node, \"sd-uhs-sdr104\"))\n+\t\tcfg->host_caps |= MMC_CAP(UHS_SDR104);\n+\tif (fdtdec_get_bool(fdt, node, \"sd-uhs-ddr50\"))\n+\t\tcfg->host_caps |= MMC_CAP(UHS_DDR50);\n+\tif (fdtdec_get_bool(fdt, node, \"mmc-ddr-1_8v\"))\n+\t\tcfg->host_caps |= MMC_CAP(MMC_DDR_52);\n+\tif (fdtdec_get_bool(fdt, node, \"mmc-hs200-1_8v\"))\n+\t\tcfg->host_caps |= MMC_CAP(MMC_HS_200);\n+\n+\treturn 0;\n+}\n+\n struct mmc *mmc_get_mmc_dev(struct udevice *dev)\n {\n \tstruct mmc_uclass_priv *upriv;\ndiff --git a/include/mmc.h b/include/mmc.h\nindex 79be6b4..6230a32 100644\n--- a/include/mmc.h\n+++ b/include/mmc.h\n@@ -651,6 +651,7 @@ 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_of_parse(const void *fdt, int node, struct mmc_config *cfg);\n int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);\n \n /**\n","prefixes":["U-Boot","v2","26/26"]}