linux-mips
[Top] [All Lists]

Re: [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during

To: Charles Hardin <ckhardin@exablox.com>
Subject: Re: [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 07 Sep 2012 10:57:35 -0700
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>, David Daney <david.daney@cavium.com>, Jeremy Fitzhardinge <jeremy@exablox.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=m+oCvsuokBD9Qfz63z0Itd5eKEjREZTff9BEbKI/V4c=; b=cbwj9CcChdteR2iqLDLjqVu8jRVp+LF78ON/SRdM61w6/2CkR1U9RzSsJrOGyvGvVf L/nME21bPBj1E8WborSr6jCbnjPCxrU/5DkCvrhXc8G120CJHF9aTj9wgpqir8icK0o7 0R3FoJNZ+3O01ex8XqdnknppXtmHrKiOoS3pAUyz2UgDT1BSUo5VbfMu5dVvohzA4m00 MozVsy7DYsedT9h2I8A1xCarR2osGDH281GQR+r50YAyYfOebkTSFeZvH46uzHyYV1uG DSK2m+GH3mPJcvGTzB0qLJa6yG8nUHcoZ+R9rGlaEO8j5kX8YQloEiSUyilCvdbThZbs Pesg==
In-reply-to: <1346853293-9166-1-git-send-email-ckhardin@exablox.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1346853293-9166-1-git-send-email-ckhardin@exablox.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0
On 09/05/2012 06:54 AM, Charles Hardin wrote:
The cavium code assumed that all NOR on the boot bus was
an 8-bit NOR part and hardcoded the bankwidth. The simple
solution was to add the code that queries the configuration
register for the width of the bus that has been hardware strapped
to the Cavium. This allows both 8-bit and 16-bit parts to be
discovered during boot.

Signed-off-by: Charles Hardin <ckhardin@exablox.com>

diff --git a/arch/mips/cavium-octeon/flash_setup.c 
b/arch/mips/cavium-octeon/flash_setup.c
index e44a55b..9e46976 100644
--- a/arch/mips/cavium-octeon/flash_setup.c
+++ b/arch/mips/cavium-octeon/flash_setup.c
@@ -51,7 +51,17 @@ static int __init flash_init(void)
                flash_map.name = "phys_mapped_flash";
                flash_map.phys = region_cfg.s.base << 16;
                flash_map.size = 0x1fc00000 - flash_map.phys;
-               flash_map.bankwidth = 1;
+               switch (region_cfg.s.width) {
+               default:
+               case 0:
+                       /* 8-bit bus */
+                       flash_map.bankwidth = 1;
+                       break;
+               case 1:
+                       /* 16-bit bus */
+                       flash_map.bankwidth = 2;
+                       break;
+               }

A slightly less verbose version of this would be:

-       flash_map.bankwidth = 1;
+       flash_map.bankwidth = region_cfg.s.width + 1;


Can you test that instead?

If it works, Acked-by me.

David Daney

<Prev in Thread] Current Thread [Next in Thread>