[{"id":1773616,"web_url":"http://patchwork.ozlabs.org/comment/1773616/","msgid":"<772a7d63-7895-16b1-6fc2-1bade0be1fdf@samsung.com>","list_archive_url":null,"date":"2017-09-22T13:54:42","subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic dt binding","submitter":{"id":8006,"url":"http://patchwork.ozlabs.org/api/people/8006/","name":"Jaehoon Chung","email":"jh80.chung@samsung.com"},"content":"On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:\n> From: Kishon Vijay Abraham I <kishon@ti.com>\n> \n> Add a new function to parse host controller dt node and\n> set mmc_config. This function can be used by mmc controller\n> drivers to set the generic mmc_config.\n> This function can be extended to set other UHS mode caps\n> once UHS mode support is added.\n> \n> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>\n> Signed-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(+)\n> \n> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c\n> index 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\nI guess it can be set to 1-bit by default and just display message about invalid bus-width property.\n\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\nDon't need to check about 1.2v?\n\n> +\n> +\treturn 0;\n> +}\n> +\n>  struct mmc *mmc_get_mmc_dev(struct udevice *dev)\n>  {\n>  \tstruct mmc_uclass_priv *upriv;\n> diff --git a/include/mmc.h b/include/mmc.h\n> index 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>","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 3xzFS760CSz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 23:58:15 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 89D40C22082; Fri, 22 Sep 2017 13:56:25 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 9DA3EC22064;\n\tFri, 22 Sep 2017 13:55:01 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid BE79FC2201D; Fri, 22 Sep 2017 13:54:55 +0000 (UTC)","from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34])\n\tby lists.denx.de (Postfix) with ESMTPS id 1DDA3C2205E\n\tfor <u-boot@lists.denx.de>; Fri, 22 Sep 2017 13:54:47 +0000 (UTC)","from epcas1p3.samsung.com (unknown [182.195.41.47])\n\tby mailout4.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135444epoutp041039e20224b7bb0fea529018740079b3~ms38jMD443163031630epoutp04h;\n\tFri, 22 Sep 2017 13:54:44 +0000 (GMT)","from epsmges2p2.samsung.com (unknown [182.195.40.65]) by\n\tepcas1p2.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135443epcas1p221775899424c393723b7fc58ef203fde~ms38TGN2i2463224632epcas1p2b;\n\tFri, 22 Sep 2017 13:54:43 +0000 (GMT)","from epcas2p4.samsung.com ( [182.195.41.56]) by\n\tepsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id\n\t9C.03.15349.32615C95; Fri, 22 Sep 2017 22:54:43 +0900 (KST)","from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by\n\tepcas2p2.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135443epcas2p26cecefb9801959fd02635a0a6714f84c~ms37tjqzi2991029910epcas2p2R;\n\tFri, 22 Sep 2017 13:54:43 +0000 (GMT)","from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com\n\t(Symantec Messaging Gateway) with SMTP id 67.ED.10338.22615C95;\n\tFri, 22 Sep 2017 22:54:43 +0900 (KST)","from [10.113.62.216] by mmp2.samsung.com (Oracle Communications\n\tMessaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id\n\t<0OWO000EQPB6R980@mmp2.samsung.com>;\n\tFri, 22 Sep 2017 22:54:42 +0900 (KST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tSPF_HELO_PASS autolearn=unavailable\n\tautolearn_force=no version=3.4.0","X-AuditID":"b6c32a46-f790d6d000003bf5-eb-59c51623038d","To":"Jean-Jacques Hiblot <jjhiblot@ti.com>, trini@konsulko.com,\n\tkishon@ti.com, sjg@chromium.org","From":"Jaehoon Chung <jh80.chung@samsung.com>","Message-id":"<772a7d63-7895-16b1-6fc2-1bade0be1fdf@samsung.com>","Date":"Fri, 22 Sep 2017 22:54:42 +0900","User-Agent":"Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-version":"1.0","In-reply-to":"<1506004213-22620-27-git-send-email-jjhiblot@ti.com>","Content-language":"en-US","X-Brightmail-Tracker":["H4sIAAAAAAAAA+NgFupnk+LIzCtJLcpLzFFi42LZdljTQldZ7GikwZllShYtJycxWVx42sNm\n\tcXTPPWaLb1u2MVpMnbSZ3eLt3k52BzaP2Q0XWTx2zrrL7vHqwCp2j7N3djB6HL+xnSmANSrV\n\tJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwfoBCWFssSc\n\tUqBQQGJxsZK+nU1RfmlJqkJGfnGJrVK0oaGRnqGBuZ6RkZGeiXGslZEpUElCasbP+TEF0yUr\n\t1s58zN7AuFWki5GTQ0LAROJY9zZWCFtM4sK99WxdjFwcQgI7GCVeXFjBDOF8Z5TYOXEzexcj\n\tB1jHpKsJEPENjBJ/Vmxkh3DuMUrMXnyWDWSUsEC0xL8/98AaRAQSJHpbS0HCzAL6Es9Pr2EG\n\tsdkEdCS2fzvOBGLzCthJnJq4CewKFgFVia4bK8FsUYEwiZW/XjFC1AhK/Jh8jwXE5hRwlNi8\n\tv50NYqamxIsvk1ggbHGJ5tabULa8xOY1b8EekBA4wSaxYEYbE8SbLhL3v19khLCFJV4d38IO\n\tYUtLPFu1kRGioZ1R4taPfWwQTgejxMGfe6GBZCxxqquRCWIFn0TH4b/QYOGV6GgTgijxkLj4\n\t+y4bhO0o8WPnbbBlQgKnGCXe7+eYwCg/C8lDs5A8MQvJE7OQPLGAkWUVo1hqQXFuemqxUYGR\n\tXnFibnFpXrpecn7uJkZwYtRy28G45JzPIUYBDkYlHl6Dg4cjhVgTy4orcw8xSnAwK4nwHv13\n\tJFKINyWxsiq1KD++qDQntfgQoykwwCcyS4km5wOTdl5JvKGJpYGJmZmRuZkFMOGJ89ZtuxYh\n\tJJCeWJKanZpakFoE08fEwSnVwBjo3C91Ze1p4/7562ZcE7ZL+b/houPDdy6yxrsdq3d+PrtD\n\t4qyc97zIk5vWZ59WeH7FU8dj4Rm9U7uTpx9LFPx+mt/vxdK6vPvmrE9+fnKdsVdZ9F3LusAs\n\tocJy5ResO7huzK2P+ir7bN22VW6mpcGSMclOe9qYd9t/aHvq8nn3bJeamRXbZVYrsRRnJBpq\n\tMRcVJwIATEnDFaIDAAA=","H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t9jQV1lsaORBrtnsVm0nJzEZHHhaQ+b\n\txdE995gtvm3ZxmgxddJmdou3ezvZHdg8ZjdcZPHYOesuu8erA6vYPc7e2cHocfzGdqYA1igu\n\tm5TUnMyy1CJ9uwSujJ/zYwqmS1asnfmYvYFxq0gXIweHhICJxKSrCV2MXBxCAusYJTqObmLt\n\tYuQEch4wSjzZpgViCwtES7w9fYAFxBYRSJD4v+UKG4jNLKAv8fz0GmaI5lOMEttX7QArYhPQ\n\tkdj+7TgTiM0rYCdxaiLEUBYBVYmuGyvBbFGBMIn+5r/MEDWCEj8m3wPr5RRwlNi8v50N5Dhm\n\tAXWJKVNyIXaJSzS33mSBsOUlNq95yzyBUWAWku5ZCB2zkHTMQtKxgJFlFaNkakFxbnpusVGB\n\tUV5quV5xYm5xaV66XnJ+7iZGYNhvO6zVv4Px8ZL4Q4wCHIxKPLwGBw9HCrEmlhVX5h5ilOBg\n\tVhLhPfrvSKQQb0piZVVqUX58UWlOavEhRmkOFiVx3sy+GZFCAumJJanZqakFqUUwWSYOTqkG\n\txtnOW75eWfLmWfaROouWjeqXNX4HTF7OzO1wdg//wp/Jxm4XvqtUqPswhCcweS6MnPo+t+iG\n\td9j2ry2On87dOuAQF6N52W/5rm//mrkrHSpevyjPuZdhsIpv87Nzxs9ld8nWR/ed/3tnfgB7\n\ttjtP396Ll/9b7j6YFf991T8uk+Kvf3+/XlzBeFyJpTgj0VCLuag4EQBePOXrdwIAAA=="],"X-CMS-MailID":"20170922135443epcas2p26cecefb9801959fd02635a0a6714f84c","X-Msg-Generator":"CA","X-Sender-IP":"182.195.42.143","X-Local-Sender":"=?utf-8?b?7KCV7J6s7ZuIG1RpemVuIFBsYXRmb3JtIExhYihTL1c=?=\n\t=?utf-8?b?7IS87YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?=","X-Global-Sender":"=?utf-8?q?Jaehoon_Chung=1BTizen_Platform_Lab=2E=1BSamsun?=\n\t=?utf-8?q?g_Electronics=1BSenior_Engineer?=","X-Sender-Code":"=?utf-8?q?C10=1BTELE=1BC10V8111?=","CMS-TYPE":"102P","DLP-Filter":"Pass","X-CFilter-Loop":"Reflected","X-CMS-RootMailID":"20170921143123epcas5p4c073b6969b43f75909c1d82f69244bd8","X-RootMTR":"20170921143123epcas5p4c073b6969b43f75909c1d82f69244bd8","References":"<1506004213-22620-1-git-send-email-jjhiblot@ti.com>\n\t<CGME20170921143123epcas5p4c073b6969b43f75909c1d82f69244bd8@epcas5p4.samsung.com>\n\t<1506004213-22620-27-git-send-email-jjhiblot@ti.com>","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic 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>"}},{"id":1774359,"web_url":"http://patchwork.ozlabs.org/comment/1774359/","msgid":"<CAPnjgZ3DmPfU98bXxUC456rUugcCWr3X9WpFvDSiKsJFWeBAKA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-25T02:14:51","subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic dt binding","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"On 21 September 2017 at 08:30, Jean-Jacques Hiblot <jjhiblot@ti.com> wrote:\n> From: Kishon Vijay Abraham I <kishon@ti.com>\n>\n> Add a new function to parse host controller dt node and\n> set mmc_config. This function can be used by mmc controller\n> drivers to set the generic mmc_config.\n> This function can be extended to set other UHS mode caps\n> once UHS mode support is added.\n>\n> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>\n> Signed-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(+)\n\nCan you please use the live API here - e.g. dev_read_bool(). Otherwise\nboards which use live tree will fail.\n\nRegards,\nSimon","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\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"WRDrojLu\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"glFXA82i\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0p53348Qz9sRq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 12:32:07 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 28B38C221B7; Mon, 25 Sep 2017 02:24:16 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id EDC36C22170;\n\tMon, 25 Sep 2017 02:23:53 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 6B47AC221AE; Mon, 25 Sep 2017 02:15:16 +0000 (UTC)","from mail-qk0-f182.google.com (mail-qk0-f182.google.com\n\t[209.85.220.182])\n\tby lists.denx.de (Postfix) with ESMTPS id 3EBEBC220B8\n\tfor <u-boot@lists.denx.de>; Mon, 25 Sep 2017 02:15:13 +0000 (UTC)","by mail-qk0-f182.google.com with SMTP id b23so5391826qkg.1\n\tfor <u-boot@lists.denx.de>; Sun, 24 Sep 2017 19:15:13 -0700 (PDT)","by 10.200.37.200 with HTTP; Sun, 24 Sep 2017 19:14:51 -0700 (PDT)"],"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\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=JKgrOD6k9OrirMky2SuiMxlf5Oe/NBAJRYjgumE3g4s=;\n\tb=WRDrojLulf27Xi/fjfsFfnCZZvNpVIGOvjvHmJZtHmWPRuLHzVrYkfU0Sqym/KA8Cc\n\twrL/YDwoGm8Plntfyba6/HslVScTezUnZdS745CWcel09SwiA2FG/8Ei7nsGyNt0nHeo\n\tECEI/BeqB/BX52rSrE5qcYeABlxoWxdlMpnjTN6WHkGsmisyihHKYRDKIUUxqhZAA8HV\n\t8TDpnxGMgL/uOZgldCtSAgsDHplHnY/rDqEA2DUzVOHNqvV7e6iV1ee0oFdPMChgayd2\n\tZVIJolIbjKeu0lqGzj/NRAOKMcAwdZCC9IwWV2IsFP5usbC6s7oK8GeLR2rU6m2Nkuo7\n\tBr1Q==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=JKgrOD6k9OrirMky2SuiMxlf5Oe/NBAJRYjgumE3g4s=;\n\tb=glFXA82i+L86FJZMUjiR9GuRFxzd9CqgLKBC+s68qbI+t7HCtdSC9t0yKC3P5aGDu/\n\tuldQWjy3XQW/S3l5XCZiDHRMZRTe8+8ItPblVpKf1c352oLzn9iruOGvuHk24VPKwHeQ\n\tk1Bwc3MYTBESDowTglzQ98vqGnnxH6vLvHRyE="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=JKgrOD6k9OrirMky2SuiMxlf5Oe/NBAJRYjgumE3g4s=;\n\tb=bXeM4TM9bFvtf2zGw7Yk8Uv6vExCpgA+lrEHnIbmbKVbA8FbucJqxK1LgzmOEGoQUJ\n\t0UUiMm7WXOiqgVmhFumAXejU+pzD1o7A3PGyRpv3JrhfWhrNi9q+ClrV0HexssGrkOWd\n\t/MtHqG/14mKErr6f90zDHfw8O+F2raQSBk2wAnVWz/Lyl1vt0utKgjYebOKZ07lLIYsW\n\ttoJasgWzLzgrf9TkwFa87x1bv8J9ZxQpGcQ9HRhON6rS6BKlPlUSg6RdvJeuuTO6pQ6a\n\tLQmHNkDGgX/wyrVC/8nWUhuffBY3EtIZVhljJ9RLkDzC8BKvxYdBcfFDNz1EH7Nn2sjy\n\t80SQ==","X-Gm-Message-State":"AHPjjUhZ3IWy7RXMNTmeYdZ+unuNbk8dq2rg4QVAennVsMrFiMDnAhJM\n\tbkO3R9cSh6cTRAPf1Sdji+5NF73RAksI1c/WPbcL8w==","X-Google-Smtp-Source":"AOwi7QAVeBk/rO+mLaYXENHkYgHW+7Xq9x5tQmWNGuOj6Akr2C9TbHmIPid8usJGmzjgpMsD76Cq8/ovR0Va569l1Q4=","X-Received":"by 10.55.214.80 with SMTP id t77mr8485594qki.188.1506305712012; \n\tSun, 24 Sep 2017 19:15:12 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1506004213-22620-27-git-send-email-jjhiblot@ti.com>","References":"<1506004213-22620-1-git-send-email-jjhiblot@ti.com>\n\t<1506004213-22620-27-git-send-email-jjhiblot@ti.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Sun, 24 Sep 2017 22:14:51 -0400","X-Google-Sender-Auth":"hjusa6dmGjG60bAHabBz7BDfbFU","Message-ID":"<CAPnjgZ3DmPfU98bXxUC456rUugcCWr3X9WpFvDSiKsJFWeBAKA@mail.gmail.com>","To":"Jean-Jacques Hiblot <jjhiblot@ti.com>","Cc":"Tom Rini <trini@konsulko.com>, U-Boot Mailing List <u-boot@lists.denx.de>,\n\tKishon Vijay Abraham I <kishon@ti.com>","Subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic 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>"}},{"id":1778212,"web_url":"http://patchwork.ozlabs.org/comment/1778212/","msgid":"<0d9aafc1-533a-a48d-0528-f74242b97203@ti.com>","list_archive_url":null,"date":"2017-10-02T09:08:54","subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic dt binding","submitter":{"id":70508,"url":"http://patchwork.ozlabs.org/api/people/70508/","name":"Jean-Jacques Hiblot","email":"jjhiblot@ti.com"},"content":"On 22/09/2017 15:54, Jaehoon Chung wrote:\n> On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:\n>> From: Kishon Vijay Abraham I <kishon@ti.com>\n>>\n>> Add a new function to parse host controller dt node and\n>> set mmc_config. This function can be used by mmc controller\n>> drivers to set the generic mmc_config.\n>> This function can be extended to set other UHS mode caps\n>> once UHS mode support is added.\n>>\n>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>\n>> Signed-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(+)\n>>\n>> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c\n>> index 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> I guess it can be set to 1-bit by default and just display message about invalid bus-width property.\nOK.\n>\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> Don't need to check about 1.2v?\nI'll add it. I won't be able to test though by lack of hardware.\n\n>\n>> +\n>> +\treturn 0;\n>> +}\n>> +\n>>   struct mmc *mmc_get_mmc_dev(struct udevice *dev)\n>>   {\n>>   \tstruct mmc_uclass_priv *upriv;\n>> diff --git a/include/mmc.h b/include/mmc.h\n>> index 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>>\n>","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=\"s39ZU//9\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y5GYw0Z86z9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  2 Oct 2017 20:09:08 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid BD24DC21E7C; Mon,  2 Oct 2017 09:09:03 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 120EEC21DE8;\n\tMon,  2 Oct 2017 09:09:01 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A3784C21DE8; Mon,  2 Oct 2017 09:08:59 +0000 (UTC)","from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80])\n\tby lists.denx.de (Postfix) with ESMTPS id 1983BC21CB3\n\tfor <u-boot@lists.denx.de>; Mon,  2 Oct 2017 09:08:58 +0000 (UTC)","from dflxv15.itg.ti.com ([128.247.5.124])\n\tby lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9298vYh018913; \n\tMon, 2 Oct 2017 04:08:57 -0500","from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28])\n\tby dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9298vS9029389;\n\tMon, 2 Oct 2017 04:08:57 -0500","from DFLE102.ent.ti.com (10.64.6.23) by DFLE107.ent.ti.com\n\t(10.64.6.28) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34;\n\tMon, 2 Oct 2017 04:08:56 -0500","from dlep32.itg.ti.com (157.170.170.100) by DFLE102.ent.ti.com\n\t(10.64.6.23) 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; Mon, 2 Oct 2017 04:08:56 -0500","from [172.22.129.181] (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9298tq0005454;\n\tMon, 2 Oct 2017 04:08:55 -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=T_DKIM_INVALID\n\tautolearn=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=1506935337;\n\tbh=pm03Pxbv9xN3B8bOlPyMfs5YgWgIIpTAD5FdpLzpWps=;\n\th=Subject:To:CC:References:From:Date:In-Reply-To;\n\tb=s39ZU//9jsGDIuhTVIG4nq0zAw7jr6lBXO7SXt2T4CT0W9APo8SDUwlepC8Ryl1hr\n\tsDsE7pRWetsStsdU1Rga62IoR4yPPss+9NiNJBIfaykL1zOykiLLgtEzQzBAKKTQCX\n\trIG9Igw2ys+y8FW4pDNZ+cTQhhfnodWphT4QsMqU=","To":"Jaehoon Chung <jh80.chung@samsung.com>, <trini@konsulko.com>,\n\t<kishon@ti.com>, <sjg@chromium.org>","References":"<1506004213-22620-1-git-send-email-jjhiblot@ti.com>\n\t<CGME20170921143123epcas5p4c073b6969b43f75909c1d82f69244bd8@epcas5p4.samsung.com>\n\t<1506004213-22620-27-git-send-email-jjhiblot@ti.com>\n\t<772a7d63-7895-16b1-6fc2-1bade0be1fdf@samsung.com>","From":"Jean-Jacques Hiblot <jjhiblot@ti.com>","Message-ID":"<0d9aafc1-533a-a48d-0528-f74242b97203@ti.com>","Date":"Mon, 2 Oct 2017 11:08:54 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<772a7d63-7895-16b1-6fc2-1bade0be1fdf@samsung.com>","Content-Language":"en-US","X-EXCLAIMER-MD-CONFIG":"e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to\n\tparse generic 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-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]