From patchwork Wed Nov 8 14:33:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC6A4C4167D for ; Wed, 8 Nov 2023 14:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l9vn5sfeT8S74RNWnHlstscvCxsS0YCz8anuGYb0NT4=; b=UzBt62sfqKDOh3 ELtimYZtQL0TKl23ZZbNZwmXkG9PiZMPVnRkFY7N4/rLpsROwcZHvV3LnVd8+ZrQMdFRPGPRjZLIx qEjatqTydB9KWAwmixwfc5mMCcdioiLcck8vme8XKjZQw+/oAjiP9YZdqzxAB9u9W8dBP000nSlF1 qFFTT5ZLHhLuMA1yp6tk0MH8o7uQ68dXQeYdqrhha/Nz1pXCnoQ2LleFLamMIIgS1F6MPuXQDmxD2 3KJ7HhD+QJu+HfDMAm3rCqOvJ3l5xkPboCJGQDFU9LMOhQ1FnjEUBM+XW5iF3v0FjZ+8vxqJkRddZ IQ7vZnD0umJyBasKlhSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdB-0041Mv-22; Wed, 08 Nov 2023 14:34:09 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd5-0041GV-1o for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:05 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507bd64814fso9468440e87.1 for ; Wed, 08 Nov 2023 06:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454040; x=1700058840; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+oAJ5h0iCYT/XiQuEoEbc72vTkOvqIZdMfvjIyq8PY0=; b=e5Dxz8BenraJ2mPsnZny1/aRTuhXCPPmD3l9gHTu3ZF/eFvdrlxPJrn3b+atNiKxWP vs7eUQpr87aReNLKF4muU1/367KVEs7Dd8qaXc6YlsX6FGWeJVF5h5Nby+x4Uw/9ZCg3 7FHusQLjLmvheylL6dK8uTRc5YOmL60K2ngx1Fj1HXHxcpV1f1C01jmt24E6/MHD9C1+ TCAvxq5eIIAX/1+GBebGJYk7R2dR40+KGwy3qMvoK+4ORCuzLL0NTKPK9ACtDvA5IEQX riQKSLGbbCgVhBdJgSwzux6xsGcri9nLtBFmV0ghoj3pGBiZKI/MaIOET50O9psxG54n BaCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454040; x=1700058840; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+oAJ5h0iCYT/XiQuEoEbc72vTkOvqIZdMfvjIyq8PY0=; b=ZyuJOvcN6IlRCIFEGcHF/E3akdDXqFSDKmKazUfeoJ/PpMk4ezIcWEPMpEVfjByVKm 7eQzIt9OMJ1QgSKD3kxKoBwX6VRgK166vH0iQEBGnZ0HplBZwOPcOELbCDsKSB+ifur3 sXj4Y86FEyw5Db7vBviBBMkaVB+TDGhVJugpBCUBeiKgO02oDJrVopYu7131m9AL8h/5 8h0hqSjFCt4I8Qcw3YIMxWZ1nZ4PSjCseou/SCW+X0cXYpQdpaQ4uQOsWsvxre/V7D+Q TZgj+cW/PTQbDyWNs92DfjYXgSp/q41oWwt7l12kZG3s02vj4xEzi+V3mLStTOVSFZa9 D3vQ== X-Gm-Message-State: AOJu0Yw6gsI8VYQyynaMPi9j9Jl5pvWA8o6QW79WjnJ+Js+TD42DOAZf 3irYFURJEknU2CvYsf+bWaOm5YeUVm7fWXuLYV4= X-Google-Smtp-Source: AGHT+IGSpoq6bysGssnDl5wEZaN1gk2Q3WjefhpADT75fAnEikYjHNfsLUVEUxLoA08b+0hSPIrNHA== X-Received: by 2002:a05:6512:b8d:b0:509:46ff:6e57 with SMTP id b13-20020a0565120b8d00b0050946ff6e57mr1807100lfv.8.1699454038182; Wed, 08 Nov 2023 06:33:58 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:33:57 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:49 +0100 Subject: [PATCH 1/6] mtd: rawnand: ams-delta/gpio: Unify polarity MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-1-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063403_620582_E6F044E0 X-CRM114-Status: GOOD ( 28.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The AMD Delta and GPIO RAW NAND drivers share the same platform data file and pass GPIO descriptors for the same type of signals from a board file. Fix the following problems: - NCE (negative active chip enable) should be just CE (chip enable) and flagged as active low. Rename it in both drivers to just "CE". - NWP (negative active write protect) should be just WP (write protect) and flagged as active low. Rename it in both drivers to just "WP". - NRE (negative active read enable) should be just RE (read enable) and flagged as active low. Rename it in the AMD Delta driver to "RE". The GPIO driver does not have this. - NWE (negative active write enable) should be just WE (write enable) and flagged as active low. Rename it in the AMD Delta driver to "WE". The GPIO driver does not have this. - The generic GPIO NAND driver is not expecting the GPIO polarity on CE and WP to be correct and will instead invert the polarity in the usage of the lines (such as setting the CE GPIO descriptor to 0 to activate the chip enable). Fix this by altering the semantics in the generic GPIO driver to assume it is flagged active low properly where the GPIO line is defined. - Fix up the arch/arm/mach-omap1/board-ams-delta.c to use the non-prefixed line names. (The polarity is right in this board.) Signed-off-by: Linus Walleij --- arch/arm/mach-omap1/board-ams-delta.c | 8 ++--- drivers/mtd/nand/raw/ams-delta.c | 60 +++++++++++++++++------------------ drivers/mtd/nand/raw/gpio.c | 40 +++++++++++------------ 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 0daf6c5b5c1c..3a6ab4e27e3e 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -336,13 +336,13 @@ static struct gpiod_lookup_table ams_delta_nand_gpio_table = { .table = { GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_NAND_RB, "rdy", 0), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce", + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "ce", GPIO_ACTIVE_LOW), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre", + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "re", GPIO_ACTIVE_LOW), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp", + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "wp", GPIO_ACTIVE_LOW), - GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", + GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "we", GPIO_ACTIVE_LOW), GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_ALE, "ale", 0), GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_CLE, "cle", 0), diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 919816a7aca7..ab3c8d3da41d 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -33,10 +33,10 @@ struct gpio_nand { struct nand_controller base; struct nand_chip nand_chip; struct gpio_desc *gpiod_rdy; - struct gpio_desc *gpiod_nce; - struct gpio_desc *gpiod_nre; - struct gpio_desc *gpiod_nwp; - struct gpio_desc *gpiod_nwe; + struct gpio_desc *gpiod_ce; + struct gpio_desc *gpiod_re; + struct gpio_desc *gpiod_wp; + struct gpio_desc *gpiod_we; struct gpio_desc *gpiod_ale; struct gpio_desc *gpiod_cle; struct gpio_descs *data_gpiods; @@ -49,9 +49,9 @@ struct gpio_nand { static void gpio_nand_write_commit(struct gpio_nand *priv) { - gpiod_set_value(priv->gpiod_nwe, 1); + gpiod_set_value(priv->gpiod_we, 1); ndelay(priv->tWP); - gpiod_set_value(priv->gpiod_nwe, 0); + gpiod_set_value(priv->gpiod_we, 0); } static void gpio_nand_io_write(struct gpio_nand *priv, u8 byte) @@ -86,13 +86,13 @@ static u8 gpio_nand_io_read(struct gpio_nand *priv) struct gpio_descs *data_gpiods = priv->data_gpiods; DECLARE_BITMAP(values, BITS_PER_TYPE(res)) = { 0, }; - gpiod_set_value(priv->gpiod_nre, 1); + gpiod_set_value(priv->gpiod_re, 1); ndelay(priv->tRP); gpiod_get_raw_array_value(data_gpiods->ndescs, data_gpiods->desc, data_gpiods->info, values); - gpiod_set_value(priv->gpiod_nre, 0); + gpiod_set_value(priv->gpiod_re, 0); res = values[0]; return res; @@ -133,7 +133,7 @@ static void gpio_nand_read_buf(struct gpio_nand *priv, u8 *buf, int len) static void gpio_nand_ctrl_cs(struct gpio_nand *priv, bool assert) { - gpiod_set_value(priv->gpiod_nce, assert); + gpiod_set_value(priv->gpiod_ce, assert); } static int gpio_nand_exec_op(struct nand_chip *this, @@ -204,7 +204,7 @@ static int gpio_nand_setup_interface(struct nand_chip *this, int csline, if (csline == NAND_DATA_IFACE_CHECK_ONLY) return 0; - if (priv->gpiod_nre) { + if (priv->gpiod_re) { priv->tRP = DIV_ROUND_UP(sdr->tRP_min, 1000); dev_dbg(dev, "using %u ns read pulse width\n", priv->tRP); } @@ -273,35 +273,35 @@ static int gpio_nand_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); /* Set chip enabled but write protected */ - priv->gpiod_nwp = devm_gpiod_get_optional(&pdev->dev, "nwp", + priv->gpiod_wp = devm_gpiod_get_optional(&pdev->dev, "wp", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpiod_nwp)) { - err = PTR_ERR(priv->gpiod_nwp); - dev_err(&pdev->dev, "NWP GPIO request failed (%d)\n", err); + if (IS_ERR(priv->gpiod_wp)) { + err = PTR_ERR(priv->gpiod_wp); + dev_err(&pdev->dev, "WP GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nce = devm_gpiod_get_optional(&pdev->dev, "nce", + priv->gpiod_ce = devm_gpiod_get_optional(&pdev->dev, "ce", GPIOD_OUT_LOW); - if (IS_ERR(priv->gpiod_nce)) { - err = PTR_ERR(priv->gpiod_nce); - dev_err(&pdev->dev, "NCE GPIO request failed (%d)\n", err); + if (IS_ERR(priv->gpiod_ce)) { + err = PTR_ERR(priv->gpiod_ce); + dev_err(&pdev->dev, "CE GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nre = devm_gpiod_get_optional(&pdev->dev, "nre", + priv->gpiod_re = devm_gpiod_get_optional(&pdev->dev, "re", GPIOD_OUT_LOW); - if (IS_ERR(priv->gpiod_nre)) { - err = PTR_ERR(priv->gpiod_nre); - dev_err(&pdev->dev, "NRE GPIO request failed (%d)\n", err); + if (IS_ERR(priv->gpiod_re)) { + err = PTR_ERR(priv->gpiod_re); + dev_err(&pdev->dev, "RE GPIO request failed (%d)\n", err); return err; } - priv->gpiod_nwe = devm_gpiod_get_optional(&pdev->dev, "nwe", + priv->gpiod_we = devm_gpiod_get_optional(&pdev->dev, "we", GPIOD_OUT_LOW); - if (IS_ERR(priv->gpiod_nwe)) { - err = PTR_ERR(priv->gpiod_nwe); - dev_err(&pdev->dev, "NWE GPIO request failed (%d)\n", err); + if (IS_ERR(priv->gpiod_we)) { + err = PTR_ERR(priv->gpiod_we); + dev_err(&pdev->dev, "WE GPIO request failed (%d)\n", err); return err; } @@ -328,9 +328,9 @@ static int gpio_nand_probe(struct platform_device *pdev) return err; } if (priv->data_gpiods) { - if (!priv->gpiod_nwe) { + if (!priv->gpiod_we) { dev_err(&pdev->dev, - "mandatory NWE pin not provided by platform\n"); + "mandatory WE pin not provided by platform\n"); return -ENODEV; } @@ -367,7 +367,7 @@ static int gpio_nand_probe(struct platform_device *pdev) * chip detection/initialization. */ /* Release write protection */ - gpiod_set_value(priv->gpiod_nwp, 0); + gpiod_set_value(priv->gpiod_wp, 0); /* * This driver assumes that the default ECC engine should be TYPE_SOFT. @@ -404,7 +404,7 @@ static void gpio_nand_remove(struct platform_device *pdev) int ret; /* Apply write protection */ - gpiod_set_value(priv->gpiod_nwp, 1); + gpiod_set_value(priv->gpiod_wp, 1); /* Unregister device */ ret = mtd_device_unregister(mtd); diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c index d6cc2cb65214..df6facf0ec9a 100644 --- a/drivers/mtd/nand/raw/gpio.c +++ b/drivers/mtd/nand/raw/gpio.c @@ -33,11 +33,11 @@ struct gpiomtd { void __iomem *io_sync; struct nand_chip nand_chip; struct gpio_nand_platdata plat; - struct gpio_desc *nce; /* Optional chip enable */ + struct gpio_desc *ce; /* Optional chip enable */ struct gpio_desc *cle; struct gpio_desc *ale; struct gpio_desc *rdy; - struct gpio_desc *nwp; /* Optional write protection */ + struct gpio_desc *wp; /* Optional write protection */ }; static inline struct gpiomtd *gpio_nand_getpriv(struct mtd_info *mtd) @@ -146,7 +146,7 @@ static int gpio_nand_exec_op(struct nand_chip *chip, return 0; gpio_nand_dosync(gpiomtd); - gpiod_set_value(gpiomtd->nce, 0); + gpiod_set_value(gpiomtd->ce, 1); for (i = 0; i < op->ninstrs; i++) { ret = gpio_nand_exec_instr(chip, &op->instrs[i]); if (ret) @@ -156,7 +156,7 @@ static int gpio_nand_exec_op(struct nand_chip *chip, ndelay(op->instrs[i].delay_ns); } gpio_nand_dosync(gpiomtd); - gpiod_set_value(gpiomtd->nce, 1); + gpiod_set_value(gpiomtd->ce, 0); return ret; } @@ -276,10 +276,10 @@ static void gpio_nand_remove(struct platform_device *pdev) nand_cleanup(chip); /* Enable write protection and disable the chip */ - if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp)) - gpiod_set_value(gpiomtd->nwp, 0); - if (gpiomtd->nce && !IS_ERR(gpiomtd->nce)) - gpiod_set_value(gpiomtd->nce, 0); + if (gpiomtd->wp && !IS_ERR(gpiomtd->wp)) + gpiod_set_value(gpiomtd->wp, 1); + if (gpiomtd->ce && !IS_ERR(gpiomtd->ce)) + gpiod_set_value(gpiomtd->ce, 0); } static int gpio_nand_probe(struct platform_device *pdev) @@ -316,14 +316,14 @@ static int gpio_nand_probe(struct platform_device *pdev) return ret; /* Just enable the chip */ - gpiomtd->nce = devm_gpiod_get_optional(dev, "nce", GPIOD_OUT_HIGH); - if (IS_ERR(gpiomtd->nce)) - return PTR_ERR(gpiomtd->nce); + gpiomtd->ce = devm_gpiod_get_optional(dev, "ce", GPIOD_OUT_HIGH); + if (IS_ERR(gpiomtd->ce)) + return PTR_ERR(gpiomtd->ce); /* We disable write protection once we know probe() will succeed */ - gpiomtd->nwp = devm_gpiod_get_optional(dev, "nwp", GPIOD_OUT_LOW); - if (IS_ERR(gpiomtd->nwp)) { - ret = PTR_ERR(gpiomtd->nwp); + gpiomtd->wp = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_HIGH); + if (IS_ERR(gpiomtd->wp)) { + ret = PTR_ERR(gpiomtd->wp); goto out_ce; } @@ -358,8 +358,8 @@ static int gpio_nand_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpiomtd); /* Disable write protection, if wired up */ - if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp)) - gpiod_direction_output(gpiomtd->nwp, 1); + if (gpiomtd->wp && !IS_ERR(gpiomtd->wp)) + gpiod_direction_output(gpiomtd->wp, 0); /* * This driver assumes that the default ECC engine should be TYPE_SOFT. @@ -381,11 +381,11 @@ static int gpio_nand_probe(struct platform_device *pdev) return 0; err_wp: - if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp)) - gpiod_set_value(gpiomtd->nwp, 0); + if (gpiomtd->wp && !IS_ERR(gpiomtd->wp)) + gpiod_set_value(gpiomtd->wp, 1); out_ce: - if (gpiomtd->nce && !IS_ERR(gpiomtd->nce)) - gpiod_set_value(gpiomtd->nce, 0); + if (gpiomtd->ce && !IS_ERR(gpiomtd->ce)) + gpiod_set_value(gpiomtd->ce, 0); return ret; } From patchwork Wed Nov 8 14:33:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96828C4332F for ; Wed, 8 Nov 2023 14:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iqtTFXvvACoWS9A5Vje2am6MevoUbP/vW/myjPx1jBg=; b=AwAW+Gr+sDQSEC LqwHi+nLW0JLf+0k6YTfLUhA+IeTlF4AjCrRb67p6Sn3zSvZ0eoaWjQxPjbzsSWSOR43JinEPmxzy z4wQZ0FDEtpXRxMPN9FkHK/I6UlE2qhuvuEju5FfBgRLgpH0R1zEzd9S7mPJMm9xJAWJvFHfGLwca P5tAav1T4qCtBCSd4lLXmHknZUvW9DHS8h60/NXWKc5SU/nWXzhRJq8KKXu/6MNV2VG2vbyTaVZ8T qhpBQJ6tZAEJoVsgqWYtKnQXvezQ8TiFbM2uYjWEIsE3NSFj2dREe/VeimT+JITjsjOVYKc4zCOK9 r6lmAf/vq5rjvW5sfTMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdG-0041Rh-2Q; Wed, 08 Nov 2023 14:34:14 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd6-0041GY-1w for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:08 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507f1c29f25so9194012e87.1 for ; Wed, 08 Nov 2023 06:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454041; x=1700058841; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=M2oP0CAwM9fqA+0Dgb2EoSHPOfdHteJ6dO8seqEUSC8=; b=qYK0AKpsoHujOCnbqAq6q5HqCbVKigWMr5WZfEwzsnPeafF0r2/Brj7yOn6hUd5SHt LQ1ctecqIO/YqkFYPXdVIwr0XGftGIvXNH7W0qR6s7jn45noEsLHK78EnaoOvTDgfQWH Nc6z/hH9l6FFS9n/tHXTrIpmYLwkB/1USkQ5atu5aVnP6rClXtPc+oBkxPsknuERppTl MiuRMCsbv6Ymug2gOmQG4pt06JF+0zDfqNYljjRFX4gsDkPW5lGRaPdAVx2VcawWTrTL eA0HFpqOBRpTEk78GWEKpgL2kh/2wKRMaWS39PbxYEdqDgb8lhUZRU/IPjG53KGwreJ/ y1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454041; x=1700058841; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M2oP0CAwM9fqA+0Dgb2EoSHPOfdHteJ6dO8seqEUSC8=; b=HQvGCoiJk+JPMG+5cuz+vn4+itJvEogabClPXewFJSQdqLDJK3opNzDBbWVJbt68dI y4kgQR7mZYX/OdUtzzyCs1xwq+GjGmkGdDrDcjQEovrvfmfY4l+98YqA7GYnbWi/9n4w sdcWU9RxHoxxrrq7/ot4RhvQzn2QQG0hBrOJ5n3k9YWglKQsLhbZqBDfagIPdOKcozSB QLAUzEqsnuQgzH7e+vB4iZbCxAjUKRGF6pBwIWXw++sNL2//AXbketsYzZsmbE0MVPPt vahBAgYrRpg5B+wx24iyDO+zvWv880AtXtjkLaV7R6tbLRHiCdxwEh0yObtXHuCXbVEL 3/Hw== X-Gm-Message-State: AOJu0Ywr1svku0YgiD5pFwNZYIZG1BrweFVIoyYOdWb0GHqCU53HPcwR mm8kOagJF+q32ybCsQDmH4K+hg== X-Google-Smtp-Source: AGHT+IFeXnsMtyy2DU5D81yc59LJjJ/iZ2FiMOZRYehCSURuyYWkuW9aCmnGrNB56MFltC8JL+AJdA== X-Received: by 2002:a05:6512:2808:b0:509:45ed:1083 with SMTP id cf8-20020a056512280800b0050945ed1083mr2130529lfb.40.1699454040709; Wed, 08 Nov 2023 06:34:00 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:00 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:50 +0100 Subject: [PATCH 2/6] dt-bindings: mtd: Rewrite gpio-control-nand in schema MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-2-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij , Howard Harte X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063404_660524_0EFE4427 X-CRM114-Status: GOOD ( 36.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This creates a schema for GPIO controlled NAND. The txt schema was old and wrong. Mark the old way of passing GPIOs in a long array as deprecated and encourage per-pin GPIO assignments with the named nnn-gpios phandles. I was unable to re-use raw-nand-chip.yaml or even nand-chip.yaml: the reason is that they both assume that we have potentially several NAND chips with chip selects and thus enforce a node name "nand@0" etc, which doesn't quite work for this device. Since the GPIO controlled NAND is both a NAND controller and a NAND chip jitted together, I have to modify the mtd.yaml nodename requirement to include nand-controller@ as this is the nodename that this device should use. Deprecate the custom "band-width" property in favor of "nand-bus-width". Reported-by: Howard Harte Signed-off-by: Linus Walleij --- Check the required section especially. Since there is no hardware default for anything when using GPIOs for this, I think all these parameters are compulsory. --- .../devicetree/bindings/mtd/gpio-control-nand.txt | 47 ------ .../devicetree/bindings/mtd/gpio-control-nand.yaml | 168 +++++++++++++++++++++ Documentation/devicetree/bindings/mtd/mtd.yaml | 2 +- 3 files changed, 169 insertions(+), 48 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt b/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt deleted file mode 100644 index 486a17d533d7..000000000000 --- a/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt +++ /dev/null @@ -1,47 +0,0 @@ -GPIO assisted NAND flash - -The GPIO assisted NAND flash uses a memory mapped interface to -read/write the NAND commands and data and GPIO pins for the control -signals. - -Required properties: -- compatible : "gpio-control-nand" -- reg : should specify localbus chip select and size used for the chip. The - resource describes the data bus connected to the NAND flash and all accesses - are made in native endianness. -- #address-cells, #size-cells : Must be present if the device has sub-nodes - representing partitions. -- gpios : Specifies the GPIO pins to control the NAND device. The order of - GPIO references is: RDY, nCE, ALE, CLE, and nWP. nCE and nWP are optional. - -Optional properties: -- bank-width : Width (in bytes) of the device. If not present, the width - defaults to 1 byte. -- chip-delay : chip dependent delay for transferring data from array to - read registers (tR). If not present then a default of 20us is used. -- gpio-control-nand,io-sync-reg : A 64-bit physical address for a read - location used to guard against bus reordering with regards to accesses to - the GPIO's and the NAND flash data bus. If present, then after changing - GPIO state and before and after command byte writes, this register will be - read to ensure that the GPIO accesses have completed. - -The device tree may optionally contain sub-nodes describing partitions of the -address space. See partition.txt for more detail. - -Examples: - -gpio-nand@1,0 { - compatible = "gpio-control-nand"; - reg = <1 0x0000 0x2>; - #address-cells = <1>; - #size-cells = <1>; - gpios = <&banka 1 0>, /* RDY */ - <0>, /* nCE */ - <&banka 3 0>, /* ALE */ - <&banka 4 0>, /* CLE */ - <0>; /* nWP */ - - partition@0 { - ... - }; -}; diff --git a/Documentation/devicetree/bindings/mtd/gpio-control-nand.yaml b/Documentation/devicetree/bindings/mtd/gpio-control-nand.yaml new file mode 100644 index 000000000000..5b30ee7ad4a5 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/gpio-control-nand.yaml @@ -0,0 +1,168 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/gpio-control-nand.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NAND memory exclusively connected to GPIO lines + +maintainers: + - Linus Walleij + +description: | + It is possible to connect a NAND flash memory without any + dedicated NAND controller hardware, using just general purpose + I/O (GPIO) pins. This will not be fast, but it will work. + The address and data lines of the chip will still need to be + connected so that the contents of a NAND page can be + memory-mapped and accessed after the special lines are toggled + by GPIO. + +# The GPIO controlled NAND has wires going directly to one single +# NAND chip, so it is both a nand controller and a nand chip at +# the same time, but it does not have things such as chip select +# since the use is hammered down to one single chip only. +# There is no point for the chip itself to be a subnode of the +# controller so the raw NAND chip properties are added right into +# the controller node like this. + +allOf: + - $ref: mtd.yaml# + +properties: + $nodename: + pattern: "^(nand|nand-controller)@[a-f0-9]+$" + + compatible: + const: gpio-control-nand + + reg: + description: | + This should specify the address where the NAND page currently + accessed gets memory-mapped, and the size of the page. Usually + this will be the same as the page size of the NAND. + + label: true + + partitions: true + + nand-ecc-algo: true + + nand-ecc-step-size: true + + nand-ecc-strength: true + + nand-use-soft-ecc-engine: true + + gpio-control-nand,io-sync-reg: + description: | + A 64-bit physical address for a read location used to guard + against bus reordering with regards to accesses to the GPIOs and + the NAND flash data bus. If present, then after changing GPIO state + and before and after command byte writes, this register will be + read to ensure that the GPIO accesses have completed. + $ref: /schemas/types.yaml#/definitions/uint64 + + gpios: + description: + Legacy GPIO array for the NAND chip lines, order RDY, + NCE, ALE, CLE, NWP. + deprecated: true + maxItems: 5 + + rdy-gpios: + description: + GPIO for the NAND chip RDY line + maxItems: 1 + + ce-gpios: + description: + GPIO for the NAND chip CE chip enable line, usually + this is active low, so it should be tagged with the GPIO + flag GPIO_ACTIVE_LOW. + maxItems: 1 + + ale-gpios: + description: + GPIO for the NAND chip ALE line + maxItems: 1 + + cle-gpios: + description: + GPIO for the NAND chip CLE line + maxItems: 1 + + wp-gpios: + description: + GPIO for the NAND chip WP line, usually this is + active low, so it should be tagged with the GPIO + flag GPIO_ACTIVE_LOW. + maxItems: 1 + + bank-width: + description: + Width (in bytes) of the device. If not present, the + width defaults to 1 byte. This is deprecated, use + nand-bus-width instead. + deprecated: true + enum: [ 1, 2 ] + default: 1 + + nand-bus-width: + description: + Bus width to the NAND chip + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [8, 16] + default: 8 + + chip-delay: + description: + chip dependent delay for transferring data from array to + read registers (tR). If not present then a default of 20us + is used. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - ale-gpios + - cle-gpios + +additionalProperties: false + +examples: + - | + #include + nand@20200000 { + compatible = "gpio-control-nand"; + /* 512 bytes memory window at 0x20200000 */ + reg = <0x20200000 0x200>; + rdy-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + ce-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + ale-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + cle-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + wp-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + + label = "ixp400 NAND"; + + nand-use-soft-ecc-engine; + nand-ecc-algo = "bch"; + nand-ecc-step-size = <512>; + nand-ecc-strength = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + fs@0 { + label = "SysA Kernel"; + reg = <0x0 0x400000>; + }; + + fs@400000 { + label = "SysA Code"; + reg = <0x400000 0x7C00000>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation/devicetree/bindings/mtd/mtd.yaml index f322290ee516..e6fd82cbc35d 100644 --- a/Documentation/devicetree/bindings/mtd/mtd.yaml +++ b/Documentation/devicetree/bindings/mtd/mtd.yaml @@ -12,7 +12,7 @@ maintainers: properties: $nodename: - pattern: "^(flash|.*sram|nand)(@.*)?$" + pattern: "^(flash|.*sram|nand|nand-controller)(@.*)?$" label: description: From patchwork Wed Nov 8 14:33:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F28BC4332F for ; Wed, 8 Nov 2023 14:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V0ok+skCfY1938hB2UgYwV1B3QruEbPBoAVR0yFEcws=; b=U1sukus9JoieAN VRbJuD++zPaIKU993M0kuUZp693Vhty89uLP4h9CfiwD/q2t1L4cSZBLnm5UuoQEbALWUGh1KTaZb 1MtFWVNY5qkuXQDCo2eDQnWc5cEYsVEcvskiZ5eMNZm5OYilcCJKSP0aIoLjLHsQKTEk4uLOMBJ2r yWy9IJt3WlLmAjP98BmPILrsikda2KEmX9hMsVHG9Jtc0DygdS8b7Cfm9JEDW90+dUXVwvJVdJX1F IVzSDgljKD9fxzemodRiOcZnowlSN8tJFtqxPBOD8iUA8hMWs49NxOl+yMGQdlQ8adSkjfOr1Wmpf Ch37e6UjHszITq9XpVbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdE-0041Pt-2k; Wed, 08 Nov 2023 14:34:12 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd6-0041HD-2C for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:07 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507bd19eac8so9120048e87.0 for ; Wed, 08 Nov 2023 06:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454041; x=1700058841; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XORLfLOVJ2jQDbg32nclaixgD4oigISmdEZzRfl6mkQ=; b=Kw8zkziQQmIk48fQWMi7lP62iuBKowGkgnS3YgQNEVQPM8LtQoipPbeUlEXor8fXBH RXBZ8BKcTb6a4e9CXPwWyM1UP1QBgU52TuMkI3zQW9BOjKXRk17C1fFY7zDXpO984Wg4 sWnga2tKGi4WAKBfdu4SlLIOWQjeDi3NjTZIugxVRT616a9JnC1ZJILR6FrfetJd2nu0 K9QvAFDv6jV417F7bdZ0tap1HCcimdbGNaA9XmzhT8vwJ0bPYdEkSVyjTdx6SRw1lj73 t91ICYkdV29mk2cSQBCeRIDxWiQUAIW6Z7U9Dnb+H0UT8OjsKGnMnQUdGZUD9pu2kRTo YzuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454041; x=1700058841; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XORLfLOVJ2jQDbg32nclaixgD4oigISmdEZzRfl6mkQ=; b=TkFOonnDoVNc5Q/QwcMuTvIwonwN6QfjOIgyV+sK+ZRXH1+hwZ2OwBwxXrHQzpWwii fj9hSSEA7aSfxRlH+isgusGmlRKt9JvJI2GFrqDPdbVD1/LrpOK6P+0+e1+gj6CnHRN2 mUqUhxLUph6HLSnMOKnBplv2XzLDyO0IWcgjhicEsETkquvN3idTlqtDUyy89WHNwqAT igDcUQCww4enpQiopHCC0B7xSTYmCeIb3QfBHIRQVLxiqyuia5MFB1+mHi94qjnOg0nE PiqoDDrg/bLtRfABSIAsbFbw3qPSjXns6Bpi7gwHHJEHRKuFZ9lCed+ZAgqbL1Ink2ES UilQ== X-Gm-Message-State: AOJu0Yw8vwzyhgJVx4NTM/HmyAAEE2MxNrpfPloXed1QjDc2OI/drJgV q79EvSTB+RE1H7A/H6cNDLCDSA== X-Google-Smtp-Source: AGHT+IFUUB+MEIyguPoyxj1+fLJV+aOZb8wF1YqAbqWQ7eWQC+wzmv7GE9RSys2AiakbuL3fuZImwg== X-Received: by 2002:ac2:5d2b:0:b0:500:7685:83d with SMTP id i11-20020ac25d2b000000b005007685083dmr1266850lfb.48.1699454041779; Wed, 08 Nov 2023 06:34:01 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:01 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:51 +0100 Subject: [PATCH 3/6] MIPS: NI 169445: Fix NAND GPIOs MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-3-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063404_719473_BF52EA81 X-CRM114-Status: GOOD ( 15.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This changes the GPIOs defined in the device tree to recommended practice, which is also what the Linux NAND GPIO driver is actually using. In the process, fix up the CE and WP lines to be active low, as is required for proper hardware description. Signed-off-by: Linus Walleij --- arch/mips/boot/dts/ni/169445.dts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/mips/boot/dts/ni/169445.dts b/arch/mips/boot/dts/ni/169445.dts index 5389ef46c480..3e7b46d5072c 100644 --- a/arch/mips/boot/dts/ni/169445.dts +++ b/arch/mips/boot/dts/ni/169445.dts @@ -1,4 +1,5 @@ /dts-v1/; +#include / { #address-cells = <1>; @@ -57,18 +58,18 @@ gpio2: gpio@14 { no-output; }; - nand@0 { + nand-controller@0 { compatible = "gpio-control-nand"; nand-on-flash-bbt; nand-ecc-mode = "soft_bch"; nand-ecc-step-size = <512>; nand-ecc-strength = <4>; reg = <0x0 4>; - gpios = <&gpio2 0 0>, /* rdy */ - <&gpio1 1 0>, /* nce */ - <&gpio1 2 0>, /* ale */ - <&gpio1 3 0>, /* cle */ - <&gpio1 4 0>; /* nwp */ + rdy-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; + ce-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + ale-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + cle-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + wp-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; }; serial@80000 { From patchwork Wed Nov 8 14:33:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4998EC4167B for ; Wed, 8 Nov 2023 14:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QJqzFQZR2N3PPheCY45tfBJRVgeWYJFPDaiItLp3YqY=; b=IePuMYfVOjrfgT sk6ddXIdhoV+DKYjwTukHMBPFxCFImrRnJH+uXBJAW6dujn+Af0ot/PRNYiTOPGiNeUEoh/Lik7Zl Z1HLCRAwR8QOmg0dsni8pO4JE0x7ReGyYkxotJ7469ZVoV+BpO0xD2jngMVmITgxb1p9zw/k2NKN6 L55pXX72R6HnGLACzC3KGTeqQQxWr/TfkQOnYrhxVmE1ta4wCpnHRGyppwDOHe8Xv49UXE/NfcyHi rqoAOQ8ifhlFgMfBE30aRMpcFPs6lPQJCrfab1V6y+MT71hiDV+iFSufNCIUJIDZkDtZNOOCKNeHq hqF5AtykretO+I4eaxiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdF-0041QW-1Z; Wed, 08 Nov 2023 14:34:13 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd6-0041HU-0m for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:08 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5079f9675c6so9453614e87.2 for ; Wed, 08 Nov 2023 06:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454043; x=1700058843; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6aZ+kL6gh2ag7Dh1ER3v2H0746j7EioeKcGfv1Wufa4=; b=G1l8SunryAwxZzuDPjyRSGlJ8624chujB2hin0fqOxJ1PCeF6NlRC1gV3F4yo/2ylX IylXbHusjvOq6nnuSQSrsDU8yET9IzaCb1eE3jsteJTbabWzhllZp1RpnPSYT8LHApJw ihFlXj78jxcLFu2TDlmr7Ben1AcecQR4XFFZ5+ejaZn62g5Zf24whlgcD4PYjX0m1eRs sX6vqv70pkq64JonribK1vjXeQfdXYrKK3LzWbj9NyTNj3bZoueCaZUwO+FjLcRVaN3y o+iGQ4SJ+8O2v76UAcP5q3cTxi6+17EsCxKklVIwPWNowHkfCVCgV7FEtGkEfyJfi9GQ awPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454043; x=1700058843; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6aZ+kL6gh2ag7Dh1ER3v2H0746j7EioeKcGfv1Wufa4=; b=r4qr/VY8Q7tVPes7T/EIBJ8oetzzu/yRvbvoZA3+y6ZtSxI/sLHunmDPXk33cZl03o GjP5vVMjJLa98LMqj/luIXyOB8/sKTSE/gKmWubjYAAtDNL5d6bt26RPaCh0/iMceVRu 96WHDu2OKRedXU8NzCwz/pdooKGvM6coD18oRcuJpr525yYjDLo7XXm+J+9IYKPJpuD5 jTyIR/KtJSTWMxq9SppVS5dAMFsPUzOx5g+N8h9hBnIhRcsRW0IcJZjAFgTa0DMssEqz Y6QY877RioHSlSc6iirAMuN60sqaBEPwjJqIxrWIxqB59NpZcK1zWDf1aQc2TyaP+S72 ASQw== X-Gm-Message-State: AOJu0Ywo27MJfOIyRa/myJLBWlq+0KqjZYg1t7iyXZNDs1jR3aZplkb7 MPkAtCG3ucF4YL9V9qClXSc2EQ== X-Google-Smtp-Source: AGHT+IGG1GNNGOjw1MatPyldmMpT70TP+Kp6b0nAZsqC2/4coTaU8ePyebqXK5jpMs6jLsR4nk0Clg== X-Received: by 2002:a05:6512:3d8f:b0:500:a66b:b189 with SMTP id k15-20020a0565123d8f00b00500a66bb189mr1999537lfv.51.1699454042830; Wed, 08 Nov 2023 06:34:02 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:02 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:52 +0100 Subject: [PATCH 4/6] mtd: rawnand: gpio: Use device properties MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-4-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063404_296803_E799A974 X-CRM114-Status: GOOD ( 29.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The platform data (struct gpio_nand_platdata) isn't really used in any boardfile in the kernel: the only probe path is from device tree. Convert the driver to not use the platform data header at all and read out the device tree properties using device properties so we don't need to have the driver be exclusively device tree either: ACPI or software nodes work fine if need be. Drop the ifdeffery around CONFIG_OF as a consequence. The code reads "bank-width" to plat->options flags and passes it directly to the NAND chip struct, so just assign this directly to the chip instead. The code reads one property "chip-delay" that it stores in pdata->delay and never use, so drop this altogether. If timings should be supported this can probably be done in a more detailed way using the new elaborate timings structs that exist for NAND. The platform data contains a callback to augment partitions, but since there are no board files using this platform data to define a gpio NAND device, this is never used so the code handling it can be deleted. Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/gpio.c | 72 ++++++++------------------------------------- 1 file changed, 12 insertions(+), 60 deletions(-) diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c index df6facf0ec9a..5553101c709c 100644 --- a/drivers/mtd/nand/raw/gpio.c +++ b/drivers/mtd/nand/raw/gpio.c @@ -22,9 +22,7 @@ #include #include #include -#include -#include -#include +#include #include struct gpiomtd { @@ -32,7 +30,6 @@ struct gpiomtd { void __iomem *io; void __iomem *io_sync; struct nand_chip nand_chip; - struct gpio_nand_platdata plat; struct gpio_desc *ce; /* Optional chip enable */ struct gpio_desc *cle; struct gpio_desc *ale; @@ -175,46 +172,38 @@ static const struct nand_controller_ops gpio_nand_ops = { .attach_chip = gpio_nand_attach_chip, }; -#ifdef CONFIG_OF static const struct of_device_id gpio_nand_id_table[] = { { .compatible = "gpio-control-nand" }, {} }; MODULE_DEVICE_TABLE(of, gpio_nand_id_table); -static int gpio_nand_get_config_of(const struct device *dev, - struct gpio_nand_platdata *plat) +static int gpio_nand_get_config(struct device *dev, + struct nand_chip *chip) { u32 val; - if (!dev->of_node) - return -ENODEV; - - if (!of_property_read_u32(dev->of_node, "bank-width", &val)) { + if (!device_property_read_u32(dev, "bank-width", &val)) { if (val == 2) { - plat->options |= NAND_BUSWIDTH_16; + chip->options |= NAND_BUSWIDTH_16; } else if (val != 1) { dev_err(dev, "invalid bank-width %u\n", val); return -EINVAL; } } - if (!of_property_read_u32(dev->of_node, "chip-delay", &val)) - plat->chip_delay = val; - return 0; } -static struct resource *gpio_nand_get_io_sync_of(struct platform_device *pdev) +static struct resource *gpio_nand_get_io_sync_prop(struct device *dev) { struct resource *r; u64 addr; - if (of_property_read_u64(pdev->dev.of_node, - "gpio-control-nand,io-sync-reg", &addr)) + if (device_property_read_u64(dev, "gpio-control-nand,io-sync-reg", &addr)) return NULL; - r = devm_kzalloc(&pdev->dev, sizeof(*r), GFP_KERNEL); + r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL); if (!r) return NULL; @@ -224,40 +213,11 @@ static struct resource *gpio_nand_get_io_sync_of(struct platform_device *pdev) return r; } -#else /* CONFIG_OF */ -static inline int gpio_nand_get_config_of(const struct device *dev, - struct gpio_nand_platdata *plat) -{ - return -ENOSYS; -} - -static inline struct resource * -gpio_nand_get_io_sync_of(struct platform_device *pdev) -{ - return NULL; -} -#endif /* CONFIG_OF */ - -static inline int gpio_nand_get_config(const struct device *dev, - struct gpio_nand_platdata *plat) -{ - int ret = gpio_nand_get_config_of(dev, plat); - - if (!ret) - return ret; - - if (dev_get_platdata(dev)) { - memcpy(plat, dev_get_platdata(dev), sizeof(*plat)); - return 0; - } - - return -EINVAL; -} static inline struct resource * gpio_nand_get_io_sync(struct platform_device *pdev) { - struct resource *r = gpio_nand_get_io_sync_of(pdev); + struct resource *r = gpio_nand_get_io_sync_prop(&pdev->dev); if (r) return r; @@ -291,9 +251,6 @@ static int gpio_nand_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int ret = 0; - if (!dev->of_node && !dev_get_platdata(dev)) - return -EINVAL; - gpiomtd = devm_kzalloc(dev, sizeof(*gpiomtd), GFP_KERNEL); if (!gpiomtd) return -ENOMEM; @@ -311,7 +268,7 @@ static int gpio_nand_probe(struct platform_device *pdev) return PTR_ERR(gpiomtd->io_sync); } - ret = gpio_nand_get_config(dev, &gpiomtd->plat); + ret = gpio_nand_get_config(dev, chip); if (ret) return ret; @@ -349,7 +306,6 @@ static int gpio_nand_probe(struct platform_device *pdev) gpiomtd->base.ops = &gpio_nand_ops; nand_set_flash_node(chip, pdev->dev.of_node); - chip->options = gpiomtd->plat.options; chip->controller = &gpiomtd->base; mtd = nand_to_mtd(chip); @@ -372,11 +328,7 @@ static int gpio_nand_probe(struct platform_device *pdev) if (ret) goto err_wp; - if (gpiomtd->plat.adjust_parts) - gpiomtd->plat.adjust_parts(&gpiomtd->plat, mtd->size); - - ret = mtd_device_register(mtd, gpiomtd->plat.parts, - gpiomtd->plat.num_parts); + ret = mtd_device_register(mtd, NULL, 0); if (!ret) return 0; @@ -395,7 +347,7 @@ static struct platform_driver gpio_nand_driver = { .remove_new = gpio_nand_remove, .driver = { .name = "gpio-nand", - .of_match_table = of_match_ptr(gpio_nand_id_table), + .of_match_table = gpio_nand_id_table, }, }; From patchwork Wed Nov 8 14:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D2F5C4332F for ; Wed, 8 Nov 2023 14:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iUKJrlQwq9Vcn2uhvv4cyiZkm87FFiWtGanVOGX7Ues=; b=CIaf0XmSTlcEUD 5TCbvGDQ5j2plhK7z4taxgvOSPn+1kpbYgzBFE2SzetZR0nT6gX0GxLooozkt8EnEw6Lc0aLkR21R fpxdXv48Sew9X1rNhs8fW1kLcE0X0twN9++pzZwxzYGg9GtixroGe9mjID2LbBcYq1xKoYt+ACyEi ic16DXqWSWiRf4pKs7K3B530W8FelcG+1pv7n/LRTQuJZNiKvWFZRmyfqkDZJqv0WF6wDdfOWy5eH k2FHSEZRDqlZcVFVsO+ZFwr5r1gi0pMqAVi5x3vlf057PRNh6gGiBNL/4AqpozSVlS5J9OL6aoQgJ boK2xHSS89ckBN+qQK8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdI-0041T4-0X; Wed, 08 Nov 2023 14:34:16 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd9-0041Ib-2g for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:10 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507bd64814fso9468534e87.1 for ; Wed, 08 Nov 2023 06:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454044; x=1700058844; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pGzclwbFLS82d1Yy6hJpVSYEp7mUVdHhXoDoAeHaQ9o=; b=HFXabJBIvPEsFCdGOcpLB/SVS4rgICsBnkj6z8rM4SCxCAC+NanTKi28YSWA7VshOW wGBbWts72cyRLKMVcXo4/vY4kjNxZnPCyoxqAqAuR5RgdnDACJynF4xbTADqK0/aZUTq FwjQS5D96t86pWZmGrCAOLojDkmqm/sHNRJT/LmlgM3zbitF2oOEmME7SgRWv77lZ0F9 +eikoc9XA4OJW62wdOT8dD8R1ZMg20rsTPNr6VVCLx8ARF6aFeFEue1gcn5066I3/rRE EHsUIFy8iNcLoxdsSQ7bXLMDDqkDAoRqhZn9Fs0WEsd7ojCViXOwt269vF9fPGXB78fP Vpew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454044; x=1700058844; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pGzclwbFLS82d1Yy6hJpVSYEp7mUVdHhXoDoAeHaQ9o=; b=R27/a6/bHPMpHlGF89LXMAzb+tkjyeI2+nVysptToVa60rAV6kRAjvPif+h2m7Zrqm L6EBENfxTy5PtXnvAuQMyRLXv9ytO+rCyzo/zcuruNnO+ksopGGOac/ik/K9jYn848sw DRjRT1R2tpWtjspdxoSs2AHIqdC1M+xuR9ua9az9GOzUhtYwUAfQR+qibG4SC7m0h2jp Ijukm6qbPDAJBrWjbxs9s0goCH1UzesIoqn/D4pl2k9vOjYLTkKdGUbpQY73spPt/BP9 Mgu/awDKI/LxcTRLduHp9x8xd2LTYLfnZIUcBmdypSpSNhyY8Ftmv1FCnuW9v2bjkXTB YDxQ== X-Gm-Message-State: AOJu0YwSLSO9jpCnlT91WAjUenYq5Pnd9Ta0oMVDzrwKIt5b0LJXtm59 wOqV5D257YCjGMr6dN+A5Su3GA== X-Google-Smtp-Source: AGHT+IHO/EX+mYFpXV9cnozSua00aYKVLxHpApEI0ijPX+/t/mJFnU4RbkNl70WWo+NHt88Fl9uYmA== X-Received: by 2002:ac2:5a1a:0:b0:509:4541:5e97 with SMTP id q26-20020ac25a1a000000b0050945415e97mr1368218lfn.29.1699454043887; Wed, 08 Nov 2023 06:34:03 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:03 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:53 +0100 Subject: [PATCH 5/6] mtd: rawnand: gpio: Support standard nand width MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-5-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063407_957679_CE5B3824 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The standard property for describing the band width of a NAND memory is "nand-bus-width" not "bank-width". The new bindings support both so make Linux check both in priority order. Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/gpio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c index 5553101c709c..d5bd245b0c0d 100644 --- a/drivers/mtd/nand/raw/gpio.c +++ b/drivers/mtd/nand/raw/gpio.c @@ -183,7 +183,15 @@ static int gpio_nand_get_config(struct device *dev, { u32 val; - if (!device_property_read_u32(dev, "bank-width", &val)) { + /* The preferred binding takes precedence */ + if (!device_property_read_u32(dev, "nand-bus-width", &val)) { + if (val == 16) { + chip->options |= NAND_BUSWIDTH_16; + } else if (val != 8) { + dev_err(dev, "invalid nand-bus-width %u\n", val); + return -EINVAL; + } + } else if (!device_property_read_u32(dev, "bank-width", &val)) { if (val == 2) { chip->options |= NAND_BUSWIDTH_16; } else if (val != 1) { From patchwork Wed Nov 8 14:33:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D345C4167D for ; Wed, 8 Nov 2023 14:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=joMeybHDXVL1fWG858CfGtmP1bzOZofibTc4Hdk+G4Y=; b=MOZnZsqABALgQc e17zHeqer5+/BSjh3HXFbD5yFPrW4ERstfBVZHRt58vUTGS2eqG+P/OQT6md5+YffnQmHE5U/idnK IZHBMevvA0RTCarNlh6EWX7gKeTwWhyySA54X8lXADMmldHGJfkCzhiXdJSF6Ke7RkaiYu9mD7ukG pZpIhdHX2Hdjv3yrystUteIi7SBPrihRqmjdce1FFBvEQ6rDFDauSZgQAwPXYepKZY2vDRfMsI5fd qg5hUSdNRNswxoj+V8s6csuG5Ra84cmAk9yec8WKAIEErnHlJhUC3NKRwFoCm0dtcXuHQzTT4vIAN tWkpKHDAf8pc+yMkG8yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdM-0041XI-20; Wed, 08 Nov 2023 14:34:20 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdB-0041JX-07 for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:12 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507bd644a96so10014040e87.3 for ; Wed, 08 Nov 2023 06:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454045; x=1700058845; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=78GU8j4+SoSSNRmxCZnZFjlRCHFt/xGux/FgF9FARuk=; b=F2s4A21L5NTjqS+turOFtU0nEBbokfJ0FQ3j0O/vBQKIRuEhGYLwlscOKwR+s0VJEL hX/Tk3vMAdKY/PCe9HzzdFGVVQk4strb9eAvqgS+NKG+jFI0b/XwM5xwIAwiZ54+pthR rQWBYsZje9isCrh+0sWMZjUpR86VYGTfvdKAPCgIoIYS5UgemvPmBC5opGmQSF0jwHX6 CK/+Pyp399ATd7YkZTPUrc23IOR0Ie03cvUA5iE9in8ddGFz406z6PHUBSTvOiosJX4a py88ckYytqteVC/KexjlInl7QpbMONGSTnYJUfEI0VYTPJuTGDjYyhGAhzoP3Qb1AYwt y8vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454045; x=1700058845; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=78GU8j4+SoSSNRmxCZnZFjlRCHFt/xGux/FgF9FARuk=; b=xNclCK4nhiyp+dtEnk8KvUh7ikLndHB/17OcDeb5lfk7+pmHA4N3RR4CmB++hGFM78 Nu3dbLh6gae+8PtclgWFlDNbMxO/LbZL49Bol1ApkYFjLdu/+CA2wXRFPlSi9vgqQThI GYSUBDvFM7G0oThaMSI3ShBgqfoDI7KDlbSMEYjsOIKGM98fMT4GZvnQB3omfkocpaOs VwxkmoFkbCEjBEBVY7LlCGFQwL9pjGYANFAf6ecqlm3cXcJeKvbK5xL2Y9ae4f+/en5R Fm/n0dhKTwXiyJTAqBmIW+FjGUZ3yvydxky+kjPkGpdSqE/XGH7sxSI4PuQwvR7vgqAs qKUw== X-Gm-Message-State: AOJu0YzVgog1YNZYeRUgOPxTZyQ6VGCxc3btsZWsk30JXUuFlPOd+7O0 jdTW+Wlj3dZO2vs7Ab8mkWCR8A== X-Google-Smtp-Source: AGHT+IH6IcpUsu8l3iZ6cm3VeKSRvHVjWLm4/aWcEw/O+09FccupiAh8GMMm2qcpdhgkIocbk45f1A== X-Received: by 2002:a19:9110:0:b0:507:b935:9f5f with SMTP id t16-20020a199110000000b00507b9359f5fmr1441210lfd.24.1699454044974; Wed, 08 Nov 2023 06:34:04 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:04 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:54 +0100 Subject: [PATCH 6/6] mtd: rawnand: gpio: Rename file MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-6-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063409_114091_BE4F047E X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The implementation of the GPIO NAND controller is just "gpio" with the usecase for NAND implied from the folder nand/raw. This is not so great when the module gets the name "gpio.ko". Rename the implementation to nand-gpio.c so the module is named nand-gpio.ko which is more reasonable. We put "nand" first instead of "gpio" because the order is usually -.c, cf ls drivers/gpio/ Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/Makefile | 2 +- drivers/mtd/nand/raw/{gpio.c => nand-gpio.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile index 25120a4afada..f0e377332812 100644 --- a/drivers/mtd/nand/raw/Makefile +++ b/drivers/mtd/nand/raw/Makefile @@ -18,7 +18,7 @@ obj-$(CONFIG_MTD_NAND_NANDSIM) += nandsim.o obj-$(CONFIG_MTD_NAND_CS553X) += cs553x_nand.o obj-$(CONFIG_MTD_NAND_NDFC) += ndfc.o obj-$(CONFIG_MTD_NAND_ATMEL) += atmel/ -obj-$(CONFIG_MTD_NAND_GPIO) += gpio.o +obj-$(CONFIG_MTD_NAND_GPIO) += nand-gpio.o omap2_nand-objs := omap2.o obj-$(CONFIG_MTD_NAND_OMAP2) += omap2_nand.o obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD) += omap_elm.o diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/nand-gpio.c similarity index 100% rename from drivers/mtd/nand/raw/gpio.c rename to drivers/mtd/nand/raw/nand-gpio.c