Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1613113/?format=api
{ "id": 1613113, "url": "http://patchwork.ozlabs.org/api/patches/1613113/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20220404161722.4884-4-pali@kernel.org/", "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": "<20220404161722.4884-4-pali@kernel.org>", "list_archive_url": null, "date": "2022-04-04T16:17:20", "name": "[3/5] mtd: rawnand: fsl_elbc: Use ECC configuration from device tree", "commit_ref": "c9ea9019c5aaeac474d2a243dc1482e1db2b7c6d", "pull_url": null, "state": "accepted", "archived": false, "hash": "9873b3c3dd854ecf69e7a9c34bbe634bc901fa83", "submitter": { "id": 78810, "url": "http://patchwork.ozlabs.org/api/people/78810/?format=api", "name": "Pali Rohár", "email": "pali@kernel.org" }, "delegate": { "id": 87636, "url": "http://patchwork.ozlabs.org/api/users/87636/?format=api", "username": "priyankajain", "first_name": "Priyanka", "last_name": "Jain", "email": "priyanka.jain@nxp.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20220404161722.4884-4-pali@kernel.org/mbox/", "series": [ { "id": 293449, "url": "http://patchwork.ozlabs.org/api/series/293449/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=293449", "date": "2022-04-04T16:17:18", "name": "mtd: rawnand: fsl_elbc: Device tree support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/293449/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1613113/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1613113/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": [ "bilbo.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=qlY5a8bE;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"qlY5a8bE\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org", "phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXGFk1QR6z9sFy\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 5 Apr 2022 02:19:53 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 4D46D83A5B;\n\tMon, 4 Apr 2022 18:19:01 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 614408396B; Mon, 4 Apr 2022 18:18:41 +0200 (CEST)", "from dfw.source.kernel.org (dfw.source.kernel.org\n [IPv6:2604:1380:4641:c500::1])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 28E7B83774\n for <u-boot@lists.denx.de>; Mon, 4 Apr 2022 18:18:25 +0200 (CEST)", "from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by dfw.source.kernel.org (Postfix) with ESMTPS id A023960ACD;\n Mon, 4 Apr 2022 16:18:23 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id E2E1AC340EE;\n Mon, 4 Apr 2022 16:18:22 +0000 (UTC)", "by pali.im (Postfix)\n id 998DD768; Mon, 4 Apr 2022 18:18:22 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no\n version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1649089103;\n bh=6gF0d+MjR4nuh2Anh9irwOl4AjRIpI9VZrjXKt5qA1U=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=qlY5a8bEtMBbupRiXBeOdHbHYvSsUCXXK6wwkPy2WzyN53SPzS4vqgHdt1z9ud0gP\n SqVyv2Qo0oFM8gUWuB5WmRfZlzodrUfEECyRCIHf1w817AMUo+u+EFoxEn2ZYb8Rrs\n iwvPHTmaSeR5OPMag0OkCaRi9aaA4QLl7Pr8mbsnpr62hQNeAc7t6Z3kkM1LPKQeOg\n cP8elbUZ2LuQx11AYI/6JeQ95X3El0Ah4UbDTmlpyu5iNwHC8CoxRuuIoGEDtoc5HY\n hs6e/d2ef3rw+1RgqBEUfY8be35ESteRD+oVTz4HVuVs2CxWiLuvRkKnPx4a7/y6+u\n Clir80TmXu6FQ==", "From": "=?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>", "To": "Priyanka Jain <priyanka.jain@nxp.com>,\n\tWolfgang Denk <wd@denx.de>", "Cc": "Michal Simek <michal.simek@xilinx.com>, Simon Glass <sjg@chromium.org>,\n u-boot@lists.denx.de", "Subject": "[PATCH 3/5] mtd: rawnand: fsl_elbc: Use ECC configuration from device\n tree", "Date": "Mon, 4 Apr 2022 18:17:20 +0200", "Message-Id": "<20220404161722.4884-4-pali@kernel.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20220404161722.4884-1-pali@kernel.org>", "References": "<20220404161722.4884-1-pali@kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://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 <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.5 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Initialize ECC configuration after nand_scan_ident() call and only in case\nnand_scan_ident() have not done it. nand_scan_ident() fills ECC\nconfiguration from device tree.\n\nFixes usage of NAND_ECC_SOFT_BCH when it is specified in device tree.\n\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\n drivers/mtd/nand/raw/fsl_elbc_nand.c | 49 +++++++++++++++-------------\n 1 file changed, 26 insertions(+), 23 deletions(-)", "diff": "diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c\nindex f8d2bdfb1309..e734139b5ea5 100644\n--- a/drivers/mtd/nand/raw/fsl_elbc_nand.c\n+++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c\n@@ -737,36 +737,39 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr, ofnode flash_node)\n \tnand->controller = &elbc_ctrl->controller;\n \tnand_set_controller_data(nand, priv);\n \n-\tnand->ecc.read_page = fsl_elbc_read_page;\n-\tnand->ecc.write_page = fsl_elbc_write_page;\n-\tnand->ecc.write_subpage = fsl_elbc_write_subpage;\n-\n \tpriv->fmr = (15 << FMR_CWTO_SHIFT) | (2 << FMR_AL_SHIFT);\n \n-\t/* If CS Base Register selects full hardware ECC then use it */\n-\tif ((br & BR_DECC) == BR_DECC_CHK_GEN) {\n-\t\tnand->ecc.mode = NAND_ECC_HW;\n-\n-\t\tnand->ecc.layout = (priv->fmr & FMR_ECCM) ?\n-\t\t\t\t &fsl_elbc_oob_sp_eccm1 :\n-\t\t\t\t &fsl_elbc_oob_sp_eccm0;\n+\tret = nand_scan_ident(mtd, 1, NULL);\n+\tif (ret)\n+\t\treturn ret;\n \n-\t\tnand->ecc.size = 512;\n-\t\tnand->ecc.bytes = 3;\n-\t\tnand->ecc.steps = 1;\n-\t\tnand->ecc.strength = 1;\n-\t} else {\n-\t\t/* otherwise fall back to software ECC */\n+\t/* If nand_scan_ident() has not selected ecc.mode, do it now */\n+\tif (nand->ecc.mode == NAND_ECC_NONE) {\n+\t\t/* If CS Base Register selects full hardware ECC then use it */\n+\t\tif ((br & BR_DECC) == BR_DECC_CHK_GEN) {\n+\t\t\tnand->ecc.mode = NAND_ECC_HW;\n+\t\t\tnand->ecc.layout = (priv->fmr & FMR_ECCM) ?\n+\t\t\t\t\t &fsl_elbc_oob_sp_eccm1 :\n+\t\t\t\t\t &fsl_elbc_oob_sp_eccm0;\n+\t\t\tnand->ecc.size = 512;\n+\t\t\tnand->ecc.bytes = 3;\n+\t\t\tnand->ecc.steps = 1;\n+\t\t\tnand->ecc.strength = 1;\n+\t\t} else {\n+\t\t\t/* otherwise fall back to software ECC */\n #if defined(CONFIG_NAND_ECC_BCH)\n-\t\tnand->ecc.mode = NAND_ECC_SOFT_BCH;\n+\t\t\tnand->ecc.mode = NAND_ECC_SOFT_BCH;\n #else\n-\t\tnand->ecc.mode = NAND_ECC_SOFT;\n+\t\t\tnand->ecc.mode = NAND_ECC_SOFT;\n #endif\n+\t\t}\n \t}\n \n-\tret = nand_scan_ident(mtd, 1, NULL);\n-\tif (ret)\n-\t\treturn ret;\n+\tif (nand->ecc.mode == NAND_ECC_HW) {\n+\t\tnand->ecc.read_page = fsl_elbc_read_page;\n+\t\tnand->ecc.write_page = fsl_elbc_write_page;\n+\t\tnand->ecc.write_subpage = fsl_elbc_write_subpage;\n+\t}\n \n \t/* Large-page-specific setup */\n \tif (mtd->writesize == 2048) {\n@@ -785,7 +788,7 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr, ofnode flash_node)\n \t\tpriv->fmr |= FMR_ECCM;\n \n \t\t/* adjust ecc setup if needed */\n-\t\tif ((br & BR_DECC) == BR_DECC_CHK_GEN) {\n+\t\tif (nand->ecc.mode == NAND_ECC_HW) {\n \t\t\tnand->ecc.steps = 4;\n \t\t\tnand->ecc.layout = (priv->fmr & FMR_ECCM) ?\n \t\t\t\t\t &fsl_elbc_oob_lp_eccm1 :\n", "prefixes": [ "3/5" ] }