Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752430AbcDNEPy (ORCPT ); Thu, 14 Apr 2016 00:15:54 -0400 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:4370 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751997AbcDNEPt (ORCPT ); Thu, 14 Apr 2016 00:15:49 -0400 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 9/9] mtd: fsl-quadspi: add multi flash chip R/W on ls2080a Date: Thu, 14 Apr 2016 11:50:55 +0800 Message-ID: <1460605855-6689-10-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)(2201001)(50986999)(36756003)(76176999)(5001770100001)(2906002)(5008740100001)(4326007)(81166005)(19580405001)(86362001)(19580395003)(1096002)(586003)(1220700001)(105586002)(106466001)(87936001)(92566002)(50226001)(77096005)(2950100001)(5003940100001)(6806005)(47776003)(189998001)(11100500001)(4001450100002)(229853001)(104016004)(50466002)(48376002)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR03MB080;H:tx30smr01.am.freescale.net;FPR:;SPF:Neutral;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD040;1:zdR8XMwm1H+j7MRj831AbYwZf2kZwWtmC8gYJdz0BX1jX8F+47+5HNlEgmwNuEc9b7n2wAdG93lG1wdm6ymj8HV8oeR5yRPx+6C75oK51vWORtLfPRfn0valNVBLF2hX2kBQE/OQSYUiJW1bftYtvdPTo8ESQUS1deQZ2SazHAOc5XrkUcTRtvLSzvByAxiQEictkLfO8NXR4eiFtoESWZ1avy57NDf6rCOeZRVJaMD2/3/OEvErddRyV5sv3eVsV6sw4HsUjamv2e9GApRU68slmtv7mkdx3eGveSWfKxjf1C6Kyk9B7QZZb959b0aTBeGEL7Wfw6OZDqJJJY8NbkNaA1HE+N7tgXUzJNqLt9dTDR23IJlT4r2srSUeOzVEuEAMvnF/+kSjDq8m3jK4o97TUMaU8C4Ib+6Dtyr0/HYxLq6ny3KW2SFt8M9vaZEUMHsV3a+K1xoG1XsGQtlh1IExLXkSiRIqZAxc0sihhQd/zAQeqkzcxVVGBV2oBsd5RnB211KKpbxlEyXKsYP3hcDHajkW9OgKR85orCExFKqt9q/JV1bo5BD2KfZvX5PbNsSpDNytMNr5payDOCheqw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0d95b9ba-5dfa-4181-8233-08d3641955f1 X-Microsoft-Exchange-Diagnostics: 1;SN2PR03MB080;2:0UV626Jh4gA7KqGp27My/5feOxFQxPTeP5yMlmxwFLVk00BqwE4QRged5ex5cQrs3Rir23WSPpdm/26Zxa+GJGuzecEUH/n0x1va1QWoAvmuuSKhhoq50tNB1zi0f26kzwUAqlP26CSN7pHyJf1hE5ZzPkKleqPJNITbOjlge4pKzuon+bu4m4eD1L0XKiY/;3:0VkD99B6Flt0ZSoC+depDnjbAxRt/DEefQDyKal1vLrmEng+pUIwOmO9LCGHr5GfN/Y7ZXgoYJfs6CWm1w8ep/aSdSo/RUBbLsG/LJiwiR6GP47hxmJmhz1pMgA6yS3czQLGlzEQuMh1QNcNXRuFpaqx2kJni37sZMCj85ryqgerOq1lpE4GSEdte6KTg/loYj03T59bbvK5l2PX6YHcQHDbw64+lt277GYwJs4QwiM= X-Microsoft-Antispam: UriScan:;BCL:0;PC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g8L1d/UumsMb0/5ReuCU8MP38GBy6t2tyuIrA9LcfctVDNnhjeFfiIYB1yOaKnlCpZvNn6QE+NwWG8jAH0WPiZ2zucd/U3yTDfgwOpdYwOvqIBThKpa7n35JiP3gA5n4P9HO7pJyOj4vUubIniyiqOf3;4:qL3YBMVBx5+risK7IFHHoNH2JU7z3PnbWMeKBEQmCTM5cL84edAKr7K4Ktt0A23NFVXj/ptUzooFKpFUx7FtQXvknCnkq6fMpuWfIV4JLV4/Q1+QxoDXRoBXYtF796YK61SQq7R51B6uQ+VprZWN1H3ubGCqVy1tqJqotq2EV4X/70my+7VtnVnoq+sDSghNEUabqbGUZoxE6m0vS3ZKm5ITcQBDjt/etsdGd0npsBVGJT3Uq1HaJyo4KkB4yjrGAvIUT2LHQDgikXJ/gdC8Ty2tjbEmt+OI77322xAf8w/oQxyBfA06AytjXvhVvbOhBIlPiFqH+BWr8GfLqSatEooCS40ySy2obInXYO6AQCScQ7ydFx9oQZC3N7//kOkfl1wCuLn2VaFw0zhDtAr7OoqIGYDDksXacx1ufmaXBXCgnLKcCKGb8bJS9KYf+1HB7pNqa2ruk4dmTC1rtLx8XTtZqLWAZwAEj6Ve6ophQxA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13023025)(13017025)(13018025)(13024025)(8121501046)(5005006)(13015025)(10201501046)(3002001)(6055026);SRVR:SN2PR03MB080;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB080; X-Forefront-PRVS: 0912297777 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR03MB080;23:gCXnnCeeDz8k/LHXAUlGys4IDC5LLoKelFlo3Ps3ZC?= =?us-ascii?Q?VgFoMsiPkPMebdQhbn4nYUIgwUqLpHACmpwpJA5y7FecZOnui3eZztvLhOxY?= =?us-ascii?Q?WHy7WrskOKS+Re7v8BUC0HEcozJDcbGuU+8B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ej+ZWcjtP9sU?= X-Microsoft-Exchange-Diagnostics: 1;SN2PR03MB080;5:zHejIHe7UUfRQvLXiWwONElcTSkOYGUFf6+8rcAzYvu8w6S89wdmBrOPR01Ghk19op+9xeG5H/VrxBFN226Whr1OCu8N4t/pSwvYaayhPxQ+JgTh11DwoLrqqI4uONf15O13HhFjIVlXzisD3YZzhg==;24:p+cgSsoQU/My2BNWUv8JTX0r5yGfLPTH+dbweS6ghpKBjXji9FYAkj6NceGD/XPGNK4zVx/nN8JAn12UO+J72h+VP5azmmveZ6qoWKv6Ihg= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 04:00:36.6506 (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: SN2PR03MB080 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1580 Lines: 42 From: Yunhui Cui There is a hardware feature that qspi_amba_base is added internally by SOC design on ls2080a. so memmap_phy need not be added in driver. If memmap_phy is added, the flash A1 addr space is [0, memmap_phy] which far more than flash size. The AMBA memory will be divided into four parts and assign to every chipselect. Every channel will has two valid chipselects. Signed-off-by: Yunhui Cui --- drivers/mtd/spi-nor/fsl-quadspi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index d9f3e50..cab2829 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -728,11 +728,17 @@ static void fsl_qspi_set_map_addr(struct fsl_qspi *q) { int nor_size = q->nor_size; void __iomem *base = q->iobase; + u32 mem_base; - qspi_writel(q, nor_size + q->memmap_phy, base + QUADSPI_SFA1AD); - qspi_writel(q, nor_size * 2 + q->memmap_phy, base + QUADSPI_SFA2AD); - qspi_writel(q, nor_size * 3 + q->memmap_phy, base + QUADSPI_SFB1AD); - qspi_writel(q, nor_size * 4 + q->memmap_phy, base + QUADSPI_SFB2AD); + if (has_added_amba_base_internal(q)) + mem_base = 0x0; + else + mem_base = q->memmap_phy; + + qspi_writel(q, nor_size + mem_base, base + QUADSPI_SFA1AD); + qspi_writel(q, nor_size * 2 + mem_base, base + QUADSPI_SFA2AD); + qspi_writel(q, nor_size * 3 + mem_base, base + QUADSPI_SFB1AD); + qspi_writel(q, nor_size * 4 + mem_base, base + QUADSPI_SFB2AD); } /* -- 2.1.0.27.g96db324