Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbcDNEPQ (ORCPT ); Thu, 14 Apr 2016 00:15:16 -0400 Received: from mail-bl2on0127.outbound.protection.outlook.com ([65.55.169.127]:38833 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751476AbcDNEPN (ORCPT ); Thu, 14 Apr 2016 00:15:13 -0400 X-Greylist: delayed 874 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Apr 2016 00:15:13 EDT Authentication-Results: spf=neutral (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=freescale.com; From: Yunhui Cui To: , , CC: , , , , Yunhui Cui Subject: [PATCH 5/9] mtd: spi-nor: fsl-quadspi:Support qspi for ls2080a Date: Thu, 14 Apr 2016 11:50:51 +0800 Message-ID: <1460605855-6689-6-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1460605855-6689-1-git-send-email-B56489@freescale.com> References: <1460605855-6689-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(199003)(189002)(5008740100001)(2950100001)(1220700001)(1096002)(76176999)(50986999)(5001770100001)(104016004)(81166005)(2906002)(77096005)(105586002)(11100500001)(229853001)(6806005)(106466001)(4326007)(36756003)(189998001)(48376002)(19580395003)(19580405001)(86362001)(50466002)(87936001)(586003)(47776003)(92566002)(5003940100001)(50226001)(2201001)(4001450100002)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB066;H:tx30smr01.am.freescale.net;FPR:;SPF:Neutral;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD047;1:QTQJyyOQZnZRu1In1+bB/fo+isQUW45bcd1i9XjpoCsvao/KWAfVkRPFq03IVXNzezxp2BEbLWuLwUWA+Je6vTJ31bF8H1BFyqPL54kGZvcBNGwcEvidVodMrqpQ1iUUscchzDSQhe9Zb3iVESInsfizguxKNambr19KPtmhsYPtGHxqSsMZf5MANPpBd9sHet/i+HsrV8fQotQ1haqbDE7KM0Y8AH49uynrDOGpq4Fev//15ffXQAevLsTgqrHCpi1buYNesqfF0UrrHtwqyrKTXA3Dl1D5rAiRSfE2ggxBUibnqkXOD/5zwi7+rQDSR2vi115XpR/9YBlCrvapPX9jytXzDvZZ4s2gWrgncrzBp9f1ZnE/UwxqBGIkZpuWI6RlJYqJQInZCILLN3CiZAWhANiY0D03ohGav4anIvAenx5lxUmINy9zlBpKJt9BViLAQcw4xgefGBCTfV+/qE8fAI0O3ePuyrqXlFY0bxT9a5haPdf+dGI9RlAl6Z/uZn9wTmj1OyiZXUEKnobRpOm47ZdwPLLQGjJXs5Hj/H1U64AYn3VY2J17v6eVtJp/iBlQ8XPEhEOHI0/zwSjmzA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: cb587394-4985-47a1-3c01-08d364194f3c X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB066;2:zJPkEcESf7zJKEa6dxgIBdEW4DuedgPDNpEKOfXimkSpRpXwv4CPIcw9IR2OlrSu0NbaW2+KPmFKgsWEmjND7pc3ynCb3ZGM3UjhUtj8FY+5UC+UIdm2Ieh+SWnGeOuY/p0j0feyN/Dpm3DPqmOCoKKOIYQmeyubCJ825qEvASU6/Pwi+mdlx0pWNZShpkaZ;3:2IB4G9rek6Z9iN0OMYi3qs4eYdvy4KmXKzCIB7mnWYDZB+Lt55DwpjP0DqxG79ehMSiOC9+KYdtBmvwenD9PhncOyTd8uZh4yb8emFyOtAsFsu7ivLOA+MYrYkXdPGqBDCVTVUysSXJZPNKmOXCJbnTtXxLxxGBYk+XaNsKbUBlvCA+PWRkx0YSBCuarJej05XzokjSWEKBrS81jeyHbXHiuapFDhCDyvWZlBAL6s9o= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB066; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB066;25:Oev29tve6JpmeuO5U+0TWfxYIutbETYlQIRvHIqr97mRUzlG2g47Bd/BBd+W0PRQbhn/H/CaxWnfbJp/BhflZ2DGlcZ/pLGAlpCiDcafTSODiGHkXsH+ICWBz3/HSfo1fS2+8veUMFXLq3JEVm75Yvk6oKI5qdLqK3qBxggpRQ9UF2lSY64r0oxyukcE2jGRNfXpIaECsEznpycN26OUI81GWtScFuWX+DlXYiaMgZfBVu2QljSiVk/WHogS0QpTbG6uuKLaXT06tOCqaeXwQieJCgYwb2FqSujLpodReDugrtGsX8jgltEj1kKhPGIegshRdq1t70PtGyWpHAW1z9ZYoTg88cwx5DNIwDnsRr6VhyqcqoX0s5MDXolvUNGjXBUW7w1IxtjSIjFjT3CYn41yOfs7dlktu5KDk+aIcCD4JThpGnv02ocL06bjKK7hW6ASVvPDc/vCkLbluU1+oR73oHxZ/KTDAt7NKLQukmSvjzEetGoSxtk+XxV05l0ZmdjC0JQzpA1Xa1TK8nYmpJXFQkNI9h+niUTqtl6bSuPLTcm6NFajH05H6T+BGiiw/cQxORsnTJJxkyZdZ2U9kjJKz0zqwcAXrnG0eAPyzRGNs9uB5LB337vP2PMvgLIhyBsfZbtAiW7kzzzG3pdr3tZ7ZBl+M+6D9FA+B4OKaig= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB066;20:j9crXw0RSoIXwYXHFlbHVbObDDeitB7n3XStkFTV9RvE9HTng8pjSfaFuJ8xwkXKPEp2BCU+vgq9Y0EsUF7tSvFgCYvrqOC4kR0L2+Sm/kQZ4QJdjeiZLIplGLs+C8tllSZrYt9bBsKEhG/P5y5kQx/HC4LP8x62FHq6IdLi37iMiG9DpYAVv8lMxbaGx37wKieQkBOIhMKYbFx9AjTC3m1wZ4sMtRPbrmGMiCaSP0/+yEpy4JYY/azdyadqmgMva5DJuDYiHB6pI0b5qO/sPV7bX6Qk9gsu0WFU2z2AYfEYe9G6cD2aw6EvFpgo46BZ0OxQBXlAwfOIEXZZPnB9/GUWVCYkcZ/WTJB537d6QMOjMvrzgH/XUde4bc4WsUAPOZd4vtE2ih2uRawYWr3dsBS6kJYZ+SGJlLcXvndgzSd1ZzjG2OYrfsqczMfs6rEs;4:I1MAqH7wlnF97etIKCUJatCbFxLbMEsrS4/kJYBs54lkectVHZF6IVmxdbVlI4QF6nh4fWsvBpLPbIVMWYh9VDt9jh+nINb1Qr7jtWVL3i58mfpFjDBCNgopPT9Dmt9bsRu3gwJM62tbonkBZ6IYXtrSbZlhNhXMWuZWbWxX8PHbtnyfcIULhCe3LRUJcvQBl+FU+yYu1ZTL2RQ0ihGbuk0ybpFY7KTXWxsGwQKE06ScJL4BvqaRnFBfe0kz+Oz6R6maQejlWYRhQkWGqYW3n9H2zy62oyq7lF5qz0kYqjabITthti68hMUWvAh/+mBxD5n41GOZ5ixRm12hSYM6gbJyV9zjO3faAVMgzkGPgHJsIptv5Th3+dOyhelrS82ygxyVHmFtM/mbnNrxQ9tIqc2agotWsvgY/YAY2Z7eLr6O+Awe3GHK2Jkf19PiAtuu3COI3EScVWpkMKXa3E/VUqMiV8/nh7XRNcp1+VWHXa4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13023025)(8121501046)(13017025)(13015025)(13018025)(5005006)(13024025)(10201501046)(3002001)(6055026);SRVR:BLUPR03MB066;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB066; X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB066;23:KnpsExlDoNQtOqFXJJZSwFV9wfctNddGUAKnZ1WZQ0?= =?us-ascii?Q?dHJ+PXCyH4ZKJCdj8C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T+K?= =?us-ascii?Q?Px4sMeuM4jbl/PZ4AgL3nrQSk/ZOI+pp7/q+gQ+wC2Bu0NScVc7b/QHBn8Ay?= =?us-ascii?Q?IgkX2oTLChI7vG8Ihq9b+/?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB066;5:En70iZZ5IO2rFLnb0Z1a2hxeu1eCR/nMvP0tN5L6sfGoRi6k2s31S0/duAK+ixj3YXQpTG/Bsx+xLsi8eJM4b1g1/4QznD/bITdIcqsTge2vWqp22S6o78p+afiuohvJvj8382sniv+d4/D4SAWmvg==;24:piYs3Yb82iNiNGhSfwR2UQRPVRGg6ihsN1QtGQOopL38Snc8dV8/5InBO4uJJLRzFxlCZDnGhTBcB02Y7y6fTJHxI935YE+PvsjZ5WU3EqU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 04:00:25.3651 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB066 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2930 Lines: 82 There is a hardware feature that qspi_amba_base is added internally by SOC design on ls2080a. So as to software, the driver need support to the feature. Signed-off-by: Yunhui Cui Signed-off-by: Yunhui Cui --- drivers/mtd/spi-nor/fsl-quadspi.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 16ebabbd..5d9d192 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -41,6 +41,8 @@ #define QUADSPI_QUIRK_TKT253890 (1 << 2) /* Controller cannot wake up from wait mode, TKT245618 */ #define QUADSPI_QUIRK_TKT245618 (1 << 3) +/* QSPI_AMBA_BASE is internally added by SOC design */ +#define QUADSPI_AMBA_BASE_INTERNAL (0x10000) /* The registers */ #define QUADSPI_MCR 0x00 @@ -217,6 +219,7 @@ enum fsl_qspi_devtype { FSL_QUADSPI_IMX7D, FSL_QUADSPI_IMX6UL, FSL_QUADSPI_LS1021A, + FSL_QUADSPI_LS2080A, }; struct fsl_qspi_devtype_data { @@ -270,6 +273,14 @@ static struct fsl_qspi_devtype_data ls1021a_data = { .driver_data = 0, }; +static struct fsl_qspi_devtype_data ls2080a_data = { + .devtype = FSL_QUADSPI_LS2080A, + .rxfifo = 128, + .txfifo = 64, + .ahb_buf_size = 1024, + .driver_data = QUADSPI_AMBA_BASE_INTERNAL, +}; + #define FSL_QSPI_MAX_CHIP 4 struct fsl_qspi { struct spi_nor nor[FSL_QSPI_MAX_CHIP]; @@ -312,6 +323,11 @@ static inline int needs_wakeup_wait_mode(struct fsl_qspi *q) return q->devtype_data->driver_data & QUADSPI_QUIRK_TKT245618; } +static inline int has_added_amba_base_internal(struct fsl_qspi *q) +{ + return q->devtype_data->driver_data & QUADSPI_AMBA_BASE_INTERNAL; +} + /* * R/W functions for big- or little-endian registers: * The qSPI controller's endian is independent of the CPU core's endian. @@ -558,8 +574,11 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len) /* save the reg */ reg = qspi_readl(q, base + QUADSPI_MCR); - qspi_writel(q, q->memmap_phy + q->chip_base_addr + addr, - base + QUADSPI_SFAR); + if (has_added_amba_base_internal(q)) + qspi_writel(q, q->chip_base_addr + addr, base + QUADSPI_SFAR); + else + qspi_writel(q, q->memmap_phy + q->chip_base_addr + addr, + base + QUADSPI_SFAR); qspi_writel(q, QUADSPI_RBCT_WMRK_MASK | QUADSPI_RBCT_RXBRD_USEIPS, base + QUADSPI_RBCT); qspi_writel(q, reg | QUADSPI_MCR_CLR_RXF_MASK, base + QUADSPI_MCR); @@ -849,6 +868,7 @@ static const struct of_device_id fsl_qspi_dt_ids[] = { { .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, }, { .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, }, { .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, }, + { .compatible = "fsl,ls2080a-qspi", .data = (void *)&ls2080a_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids); -- 2.1.0.27.g96db324