From patchwork Tue Dec 21 13:17:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1571657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iPrAMFoW; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=GW3KEkW8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JJH982jdrz9sCD for ; Wed, 22 Dec 2021 00:19:08 +1100 (AEDT) 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/yc1zrLO0D5YLhDvjpqKAATf++bNfKZYlv8qR36SjpU=; b=iPrAMFoWBaiTQV nANfm3jbA16TPFZ4NADCGtbRc6H+mnr8xHT2RButRc44G8k+w1Op7it8uk0aqm9Fcm0mN9IbcLDqb 0VW3oNnaHpZykGRiNmBhSvH2npZHU+g5clfiMKmv9jczXXEZTtlItbbaQGgt2NYOpZRAtBA38aQPf rCdocrhiZwtD4S5sRGk3O0DcIT9L8TlV53u2kEdVc5S5PW9arcSWNuvOJiUDVgRNp/ET3xfyv/0wH T1BjvZEnLVAGfsUO4qbwPkbGA/mq+dIukQ4NDrwqFui5/nmjQ5nAU7pRiXjzlZPV7NE8wRYvVrg4u YEVoRneGsoVF8YXqMoJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf28-006v6w-JJ; Tue, 21 Dec 2021 13:18:24 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf1u-006v29-BB for linux-mtd@lists.infradead.org; Tue, 21 Dec 2021 13:18:11 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB7EA615AC; Tue, 21 Dec 2021 13:18:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1C24C36AE8; Tue, 21 Dec 2021 13:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640092688; bh=u60Gy+HM2Cz89/HOSt7nvfcnD1OA0GjqWTWcgPWp9g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GW3KEkW84d4/UGEyZIm2MPN+ABDDa0dQtMkLgqKipAc0mjwvInIp/ZSHzUc2LNnET aRVbyR+GAZruHQSe/nY/y8tYEcmODyCqW5cUqEgaCEmGc3uuMHUA0B6P1Cf3QCrBfb FTurQWgTUaHQptQstGP/h3yDtDZvzKk0dlZWI2bPCszmGbWygcwMDkhQmzj0f5m9Cu TkMa86OgbbXQA+6twpBgjOe9NQBD3FgE1733BV1ZGcMSyCoGUVf9dJSmJ5jL7xhb1Y zm/h4NlxN9Fbd5XyrksSqZIwNuGFP/vcer5CVxiZI162bf413A9k224tSaWFtFw08I 0uMlGncBM4Lvw== From: Roger Quadros To: krzysztof.kozlowski@canonical.com, miquel.raynal@bootlin.com, tony@atomide.com Cc: robh@kernel.org, kishon@ti.com, nm@ti.com, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Roger Quadros Subject: [PATCH v4 1/4] dt-bindings: memory-controllers: ti, gpmc: Add compatible for AM64 Date: Tue, 21 Dec 2021 15:17:54 +0200 Message-Id: <20211221131757.2030-2-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221131757.2030-1-rogerq@kernel.org> References: <20211221131757.2030-1-rogerq@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_051810_445283_E0D542EF X-CRM114-Status: GOOD ( 10.80 ) X-Spam-Score: -0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: AM64 SoC contains the GPMC module. Add compatible for it. Newer SoCs don't necessarily map GPMC data region at the same place as legacy SoCs. Add reg-names "data", to provide this information to the device driver. Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org AM64 SoC contains the GPMC module. Add compatible for it. Newer SoCs don't necessarily map GPMC data region at the same place as legacy SoCs. Add reg-names "data", to provide this information to the device driver. Signed-off-by: Roger Quadros Reviewed-by: Rob Herring --- .../bindings/memory-controllers/ti,gpmc.yaml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml b/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml index 25b42d68f9b3..64dc9d398d9a 100644 --- a/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml @@ -23,13 +23,20 @@ properties: items: - enum: - ti,am3352-gpmc + - ti,am64-gpmc - ti,omap2420-gpmc - ti,omap2430-gpmc - ti,omap3430-gpmc - ti,omap4430-gpmc reg: - maxItems: 1 + minItems: 1 + maxItems: 2 + + reg-names: + items: + - const: cfg + - const: data interrupts: maxItems: 1 @@ -44,6 +51,9 @@ properties: items: - const: fck + power-domains: + maxItems: 1 + dmas: items: - description: DMA channel for GPMC NAND prefetch @@ -133,6 +143,17 @@ required: - "#address-cells" - "#size-cells" +allOf: + - if: + properties: + compatible: + contains: + const: ti,am64-gpmc + then: + required: + - reg-names + - power-domains + additionalProperties: false examples: From patchwork Tue Dec 21 13:17:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1571659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iPzgiiNr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Zit+Yb7c; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JJH9L4Hpyz9s3q for ; Wed, 22 Dec 2021 00:19:18 +1100 (AEDT) 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RbXpMJNlk68dwj7y/rm9esatSbdOKQ2KVL11HeYLJdQ=; b=iPzgiiNrpnwIZs lGK12R6r6LZoHYitlzi0IfdUxtp3Adar87G2uknVI+BouWGS9Uo92I1vxEk+hEeYgYbLdzwYNDzEG K/hB+5oQH9+sj4Aqnwo9lRSnBJOtEAeRhgKYpV6MbwTbJzwwjEQIrhWxHC/fyvWkkM65F+E67yoHc ZKeTfKrwl5S0DQFGzRdI3lydTKByq5XZ+u4cX2YPm1b8OzqsF+HiLxEWd8lXNPPrsiYeoVy4EeuJa rt0nC3hdBxAG9RUotR3fycocvjCjTTQI073C7DAsOr8zFLS/zqWh1EqQCl9A5lLXGCe2YOkaIC7nQ r9oPm24xzm/YLrBqEiRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf2M-006v8o-5j; Tue, 21 Dec 2021 13:18:38 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf1z-006v4D-Cr for linux-mtd@lists.infradead.org; Tue, 21 Dec 2021 13:18:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28967B816AD; Tue, 21 Dec 2021 13:18:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6040BC36AE2; Tue, 21 Dec 2021 13:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640092692; bh=MeirT4xGsKt7osRpBz1wQ0uIbtgu/8LH4Sy26maoJnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zit+Yb7cyDorZ9iSV0bEmdgRNfYpo1kgVyNVeWRoq85n99EIDL8cXIoqMS4XSEtYS nyDFrZQkLxbTMKvd/ZxzariP9NNduubecXv8OSHbqp8MbxambWpfIOP42Y+gD/W+2Y mjij64Ils7tm8CA9O2SXLNurgnEoM/UwYxD2cUlDU7t/PslPHCHkpr1nBvtIvA0pmO eVE5ZjG+GlJB7S0okPMdqGxmOreAKO4yVHs1Ra/3frMyu5WQv/DpXIpQbj8Ajp44Pv pkWj9buEalxcPlxcGYaGreT6cYmxaO/b7Wzfc+emfwhudKDdE+OhU/IdYGxMLQGKvC MVPOsj9UTf61A== From: Roger Quadros To: krzysztof.kozlowski@canonical.com, miquel.raynal@bootlin.com, tony@atomide.com Cc: robh@kernel.org, kishon@ti.com, nm@ti.com, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Roger Quadros Subject: [PATCH v4 2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC Date: Tue, 21 Dec 2021 15:17:55 +0200 Message-Id: <20211221131757.2030-3-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221131757.2030-1-rogerq@kernel.org> References: <20211221131757.2030-1-rogerq@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_051815_731357_233B6236 X-CRM114-Status: GOOD ( 16.91 ) X-Spam-Score: -0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The TI's AM64 SoC has the GPMC module. Add compatible for it. Traditionally GPMC external addresses have always been mapped to first 1GB physical address. However newer platforms, can have it mapped at different locations. Support this address provision via devi [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The TI's AM64 SoC has the GPMC module. Add compatible for it. Traditionally GPMC external addresses have always been mapped to first 1GB physical address. However newer platforms, can have it mapped at different locations. Support this address provision via device tree. Signed-off-by: Roger Quadros --- drivers/memory/omap-gpmc.c | 40 ++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index be0858bff4d3..624153048182 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -237,6 +237,7 @@ struct gpmc_device { struct omap3_gpmc_regs context; int nirqs; unsigned int is_suspended:1; + struct resource *data; }; static struct irq_domain *gpmc_irq_domain; @@ -1456,12 +1457,18 @@ static void gpmc_mem_exit(void) } } -static void gpmc_mem_init(void) +static void gpmc_mem_init(struct gpmc_device *gpmc) { int cs; - gpmc_mem_root.start = GPMC_MEM_START; - gpmc_mem_root.end = GPMC_MEM_END; + if (!gpmc->data) { + /* All legacy devices have same data IO window */ + gpmc_mem_root.start = GPMC_MEM_START; + gpmc_mem_root.end = GPMC_MEM_END; + } else { + gpmc_mem_root.start = gpmc->data->start; + gpmc_mem_root.end = gpmc->data->end; + } /* Reserve all regions that has been set up by bootloader */ for (cs = 0; cs < gpmc_cs_num; cs++) { @@ -1888,6 +1895,7 @@ static const struct of_device_id gpmc_dt_ids[] = { { .compatible = "ti,omap3430-gpmc" }, /* omap3430 & omap3630 */ { .compatible = "ti,omap4430-gpmc" }, /* omap4430 & omap4460 & omap543x */ { .compatible = "ti,am3352-gpmc" }, /* am335x devices */ + { .compatible = "ti,am64-gpmc" }, { } }; @@ -2502,13 +2510,25 @@ static int gpmc_probe(struct platform_device *pdev) gpmc->dev = &pdev->dev; platform_set_drvdata(pdev, gpmc); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENOENT; + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); + if (!res) { + /* legacy DT */ + gpmc_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(gpmc_base)) + return PTR_ERR(gpmc_base); + } else { + gpmc_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(gpmc_base)) + return PTR_ERR(gpmc_base); + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "data"); + if (!res) { + dev_err(&pdev->dev, "couldn't get data reg resource\n"); + return -ENOENT; + } - gpmc_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(gpmc_base)) - return PTR_ERR(gpmc_base); + gpmc->data = res; + } res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { @@ -2562,7 +2582,7 @@ static int gpmc_probe(struct platform_device *pdev) dev_info(gpmc->dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l), GPMC_REVISION_MINOR(l)); - gpmc_mem_init(); + gpmc_mem_init(gpmc); rc = gpmc_gpio_init(gpmc); if (rc) goto gpio_init_failed; From patchwork Tue Dec 21 13:17:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1571660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pciKEv7w; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Q11EtiJn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JJH9V0wp7z9s3q for ; Wed, 22 Dec 2021 00:19:26 +1100 (AEDT) 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZasXDtmtNTCeznrFGQte53rWYYaOG8PlMXCRDc6D+QY=; b=pciKEv7wq1rgdf lDdzjCMBDyWmaOu7L9HYfh2619Gw46j0p++IDHjJ32TyHXkHgxLSYsz9ZQocwXjHjVYLPBhSQHmaR JFKXU9maB7Jj35iP4VtD+3kf21WKZPaAL4VIMGD1bByhOQv293MAU0WdAES1cA+KK4uqyoJoJhAvi T36tcnF0gHncxjk5Lysrn3hfqn284Q5+Ip46+oCMbyYRRNB8Pp2YAlqR5aKbWBqx94L+KY7A7+Hzp dvwHkBqp0RE+lSaM2zz0QP4KSeNPtJIpfdTR+0rUy+DYZc+C3mYsp2cVi+e+Aw+YpcuLZwdqVqEx5 jsgomoYQjHGmVlo9ZNTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf2a-006vCw-Oa; Tue, 21 Dec 2021 13:18:52 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf20-006v4c-Kn for linux-mtd@lists.infradead.org; Tue, 21 Dec 2021 13:18:18 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 39EFA6159B; Tue, 21 Dec 2021 13:18:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCE06C36AE9; Tue, 21 Dec 2021 13:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640092695; bh=Nqe6mT09B1kTX33/VRmKBI2xx5UPngqh2E87CJblXg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q11EtiJnQ+VoC6JNDoZINAHnuKhWEUMv7E0sC7FV5AmFsGffUrgodM7PDzKsrdmKA jJvF7Q7YMIJXB+P5R5xgJY5IwE0JXwbUmtz713iWbBTuwhbqbuyvzpHcFmCRYA6MJa 53i6EJVnT7WcpyNzjVYT0C6kdl9Y2DzoQ9791vDzk/B2cur/IaKIuD9HR53TOGRhV/ uOXD4SbNuCtKfZtkfd5UtixKiYO7flM6Q+k1Kbj9Ssx9F3Pg76NO0s6yyt0+lPoJqo S5MKX27Pswdy3yRLBaffxZKUHSkQBJdQdox/9ihrdowrLOoYdHQ15dMDmPN8e5Zmfe GHi/trBBx+ZVw== From: Roger Quadros To: krzysztof.kozlowski@canonical.com, miquel.raynal@bootlin.com, tony@atomide.com Cc: robh@kernel.org, kishon@ti.com, nm@ti.com, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Roger Quadros Subject: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller Date: Tue, 21 Dec 2021 15:17:56 +0200 Message-Id: <20211221131757.2030-4-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221131757.2030-1-rogerq@kernel.org> References: <20211221131757.2030-1-rogerq@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_051816_780327_EC72F776 X-CRM114-Status: GOOD ( 17.06 ) X-Spam-Score: -0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: As more compatibles can be added to the GPMC NAND controller driver use a compatible match table. Cc: Miquel Raynal Signed-off-by: Roger Quadros --- drivers/memory/omap-gpmc.c | 6 +++++- drivers/mtd/nand/raw/omap2.c | 5 +---- include/linux/platform_d [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org As more compatibles can be added to the GPMC NAND controller driver use a compatible match table. Cc: Miquel Raynal Signed-off-by: Roger Quadros Acked-by: Miquel Raynal --- drivers/memory/omap-gpmc.c | 6 +++++- drivers/mtd/nand/raw/omap2.c | 5 +---- include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 624153048182..d19ffc895e5b 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, u32 val; struct gpio_desc *waitpin_desc = NULL; struct gpmc_device *gpmc = platform_get_drvdata(pdev); + bool is_nand = false; if (of_property_read_u32(child, "reg", &cs) < 0) { dev_err(&pdev->dev, "%pOF has no 'reg' property\n", @@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, } } - if (of_device_is_compatible(child, "ti,omap2-nand")) { + if (of_match_node(omap_nand_ids, child)) + is_nand = true; + + if (is_nand) { /* NAND specific setup */ val = 8; of_property_read_u32(child, "nand-bus-width", &val); diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c index b26d4947af02..e6dd8b4cf0d2 100644 --- a/drivers/mtd/nand/raw/omap2.c +++ b/drivers/mtd/nand/raw/omap2.c @@ -2352,10 +2352,7 @@ static int omap_nand_remove(struct platform_device *pdev) return ret; } -static const struct of_device_id omap_nand_ids[] = { - { .compatible = "ti,omap2-nand", }, - {}, -}; +/* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */ MODULE_DEVICE_TABLE(of, omap_nand_ids); static struct platform_driver omap_nand_driver = { diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index de6ada739121..92f011805ad4 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h @@ -7,6 +7,7 @@ #define _MTD_NAND_OMAP2_H #include +#include #define GPMC_BCH_NUM_REMAINDER 8 @@ -61,4 +62,10 @@ struct gpmc_nand_regs { void __iomem *gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER]; void __iomem *gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER]; }; -#endif + +static const struct of_device_id omap_nand_ids[] = { + { .compatible = "ti,omap2-nand", }, + {}, +}; + +#endif /* _MTD_NAND_OMAP2_H */ From patchwork Tue Dec 21 13:17:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1571661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tY6NLgdH; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pEIoMBrr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JJH9w19hvz9s3q for ; Wed, 22 Dec 2021 00:19:48 +1100 (AEDT) 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dYX8VYy7PxWyC6Ig0MsX1lD8zwRG8b+m35xcz2pyWms=; b=tY6NLgdHJizF/t WMaVjkpYMUAijnlIAM7i9/w+PyFcxlw7BLWwbKph4Sa3ZYe9vvs6e86Fq86Xlp2PYKGKINJDCttgy aQ8JGz6/WEE59oQD/1M4N+uLudbBQfyQgHk8a3oyGsNt3N0USftCQ1uh7TaNyEdfT4Z0G1S0V8t0E C0Z+PT9fOZItMbISoj5crXV1548m+h/q5oLEdVJCWW0HqDAYNBOvHeg9CbSG2xiL8BZeJKHJHd6Yx 7t8WiXhTPK3BBCPwdAqJNApFUM4k0ZwR3MLUQTHu24wky50uA8FzTKDZQf60AVze3OTSlaDAdfydP yXoUmEMq00f86n9PZF+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf2t-006vKx-W0; Tue, 21 Dec 2021 13:19:12 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzf24-006v5t-KA for linux-mtd@lists.infradead.org; Tue, 21 Dec 2021 13:18:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 56E1FB816A7; Tue, 21 Dec 2021 13:18:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27243C36AEB; Tue, 21 Dec 2021 13:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640092699; bh=rmNCe/Fcv2Cch+PQTMUw4LOnj/3R7KOxvik2UJk4xCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pEIoMBrrKnxFBsjjGjh+jvTnZ/d73gaJabQeSpd+S2Ca2PwMsYNNELGBItT1QPg7Y 2I+CR++g4v7Udhme+dzwaT94Q8yUqdPJn9zMMgJLbSRZagbWtjPM7RsmLvFriYHiSj Lwn/duPfkwmi7k8y7un0OQ34F2MKktBhmnpczr+zaEdZlXBpGmvAid1Kr7vGqbMqHD kumI7u3W6+S8eULAF5ywElvzwozEGUKddGcHIC8h4Nw4nqDJU7x3XSjixQ7nPOD6qE bSBI7wWVzrZowFMP7ssHjruyqArqJpnr8ZeXVZTAC1veUwC/DsWiBZPSDth6UqXEBy pv+wgGOWX9oNw== From: Roger Quadros To: krzysztof.kozlowski@canonical.com, miquel.raynal@bootlin.com, tony@atomide.com Cc: robh@kernel.org, kishon@ti.com, nm@ti.com, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Roger Quadros Subject: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 Date: Tue, 21 Dec 2021 15:17:57 +0200 Message-Id: <20211221131757.2030-5-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211221131757.2030-1-rogerq@kernel.org> References: <20211221131757.2030-1-rogerq@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_051820_824414_3CE4CD20 X-CRM114-Status: GOOD ( 10.13 ) X-Spam-Score: -0.4 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required. Cc: Miquel Raynal Signed-off-by: Roger Quadros --- drivers/mtd/nand/raw/Kconfig | 1 + 1 file changed, 1 insertion(+) Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required. Cc: Miquel Raynal Signed-off-by: Roger Quadros Acked-by: Miquel Raynal --- drivers/mtd/nand/raw/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 67b7cb67c030..587f20c6184f 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -42,6 +42,7 @@ config MTD_NAND_OMAP2 tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller" depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST depends on HAS_IOMEM + select OMAP_GPMC if ARCH_K3 help Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4 and Keystone platforms.