Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752823AbcDVHWv (ORCPT ); Fri, 22 Apr 2016 03:22:51 -0400 Received: from mail-bn1bon0141.outbound.protection.outlook.com ([157.56.111.141]:11184 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751696AbcDVHWt (ORCPT ); Fri, 22 Apr 2016 03:22:49 -0400 Authentication-Results: spf=neutral (sender IP is 192.88.158.2) 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 v2 9/9] mtd: fsl-quadspi: add multi flash chip R/W on ls2080a Date: Fri, 22 Apr 2016 14:39:52 +0800 Message-ID: <1461307192-866-9-git-send-email-B56489@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1461307192-866-1-git-send-email-B56489@freescale.com> References: <1461307192-866-1-git-send-email-B56489@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(189002)(199003)(47776003)(5003940100001)(4001450100002)(48376002)(1096002)(105586002)(5008740100001)(586003)(76176999)(104016004)(229853001)(50986999)(2201001)(86362001)(6806005)(1220700001)(106466001)(4326007)(50466002)(19580395003)(87936001)(19580405001)(2950100001)(50226001)(11100500001)(81166005)(92566002)(5001770100001)(189998001)(77096005)(2906002)(36756003)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB074;H:az84smr01.freescale.net;FPR:;SPF:Neutral;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD007;1:SfybuU/dJRwxWDptlkifGxfc2rzj2UUDx9LvbFICi8wm889QLdzXAELyoqeJdImbPLJh1WtJvqqsHJh+Dh9iW3tGzvsOl10XYeWKbxvDOt/qsNTZfYJ7dyscOznKI9jFW5tLWvKU2bLr/B/S/XYmRCspyqRd2k12FQ9YiWDAQPV2mIS80/Ck/G/hUwuvjiCp3yFsmq9WyVs/cCo5sr9igwB1dKoHm65hz6RJUB8T4R7iEpzUerjj4Hj21NtsqqTIbGQjySpo/cGtS3PZXnZ7Hz636se/U5BMCSNQ+XdUseDGQTejDmcQqJerCZ0sLfM+rdq1MlRYW9tWOch8HQvQyspsNcC0132H+i9M0xA4Ahu1aBLtnERI1NZVPzzJ7QliW5ZEQzpuwF+XbuOfPtrEGozbXmfbcG1yuLOx/Gxsk9nXQHGaAyncV+BdUJ6aqz0yogndEjWnjUvkyuEsUotZ3mUWv964w/6+nnpSETggBQpAUNC74SMnzpdPqy8/fcGQbGtKOKpenTWDzyH9gVs5AnXKi72eQYm3WvE+fVi0PSk3Hy9k2vNeWNcQEGLcdDZR8zFi/wd/iy6gP7lkvLMexg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1126996d-ab33-43bb-32ec-08d36a7a4497 X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB074;2:c7nrFA8UqBAh4L9viWBfgfiUiKgk/U6IkmpvnUtm6mt/BowQZPM3jHy857Vam5f8BwJ70x77nT+POjUDs8H0vvoYHQA8gSI8ZSP8Tff9Jf243uox3RXONnq81Z9gHcMxVR1nCnT+6LdFXQCsaGYxesr00PaHUEoJn9qcAX12VGOIWlrJfqxq7fYA+N4Daymo;3:RZDw1wmlUMc3s7i4DeuCwM89Fj38OJmhvnGN7c6X5k/ypdcBEZNrcF94HTlOjpdRap7MtSLlOd7WKZw+c1addsVGD/0LF0f3TGJK1PDWeY7SEFP14h07IKr3c/hif8YKbGWWpoShpv/KRNuTZ+bb9OIWeWrLBu23snSLYhn8uYZ5zDXCkrJP1iwl5eNeUfrhJPZPbb8pR1D1zbxJVIO3vEowytwKfVEcuJBSMNiHKow= X-Microsoft-Antispam: U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8j4bfcbN9h8icD5FmKxUp3G6f2Vn5tKMO/QC2U4TSeVIKRD/FFeVIpfsTIkUSOzdIIFlfyK7Q18JugTpW0k/nI9ttP0n+bVlA2odG0YLI/YTHGHbBOdnSXCWlCqbGAVdr/BN4Otg9ATj+ck7Dis8l5G95zeNMR;4:LIfgqeGrpQ8KcyvpdCEhPxGwrass70ypkJ48OHWNLkJkTl9t7yW1mw6leqckeQd+DweCVMDZHYP3FgOYzHcNQ/m5a0AVlt2q3Njov1dc2IF1ZgM0upG9acLHHNvss1IpSkd1K3WTTmJhFpASIx3v2SOXYIo9Q/22sjMd3rQhtZ9tDChOHiTCcchY7QosdMwUfLYFKe7DO9UGlmiNAjCmPFAYYEF2Ji3qLOiMtg70rZv3cghLNgW7SteH/fGw44IohzaHQKk57vOf+HObISI1r0VuhE9SzOwDGWLa0NZfSj/VlmhhSY+ivpXNAVOGWUpp7TShpP70zbJcGXfQ213QtuhIhX0aHktilVDiDIk1V6NSygJx/yuwNRf38tn29aLbRYLkXFAFpgE9PHemFAl4s82u8Jx3+39EOf99ByP3FkhD9lAm4pWAXOHSfNcHNq8ARsvwsu8mZk6feCClHFGlhljOJJ5mIcLLWEV3tUedOarX8KLwKjFweP+RsVet5mvY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(8121501046)(13015025)(13017025)(5005006)(13018025)(13023025)(13024025)(3002001)(10201501046)(6055026);SRVR:BY2PR03MB074;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB074; X-Forefront-PRVS: 0920602B08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR03MB074;23:vswxD1qSyh9Ske0yzCSXQYrayBsC079EEHJVEbBIuB?= =?us-ascii?Q?oxZfH1wkOPv9+uVAeHkoPBE4UT/F4qanfFO1jtp/k3Ag0wLpCRo7jkOsh876?= =?us-ascii?Q?jfpoQB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3IcDa?= =?us-ascii?Q?OiWb74sUSc0u0+4wZ/mOj/?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB074;5:AN29t/N7HUWmnF935l5717ksjYVbHmL44b92i0auHn1g2dkC1Rmq8cv/G/nxWtd4gWccT8pkZwk1X3yxzJfD9V3jQyEZZQw+8BMD9sHjPV3PtjSyd+f7ILDQZNT2YinbIj1LIf/si8oRscJ70BB52Q==;24:C1V6+quCkVhpRwfFHy7iMw9g/ksZq8UZJMt2atc0B6FVZb5mkHGy17gNBKX+wnIXX0bBH5qjZftzsBvUjr0ztWhL/UzgKW3l+SShtB2CsXQ= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2016 06:49:35.7593 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB074 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 6a022e7..b415663 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -736,11 +736,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