| To: | linux-mips@linux-mips.org |
|---|---|
| Subject: | [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot |
| From: | Charles Hardin <ckhardin@exablox.com> |
| Date: | Wed, 5 Sep 2012 06:54:53 -0700 |
| Cc: | Ralf Baechle <ralf@linux-mips.org>, David Daney <david.daney@cavium.com>, Jeremy Fitzhardinge <jeremy@exablox.com>, Charles Hardin <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> |
| Sender: | linux-mips-bounce@linux-mips.org |
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;
+ }
flash_map.virt = ioremap(flash_map.phys, flash_map.size);
pr_notice("Bootbus flash: Setting flash for %luMB flash at "
"0x%08llx\n", flash_map.size >> 20, flash_map.phys);
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] clk: add Loongson1B clock support, Turquette, Mike |
|---|---|
| Next by Date: | Re: [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot, David Daney |
| Previous by Thread: | Re: [PATCH] clk: add Loongson1B clock support, Turquette, Mike |
| Next by Thread: | Re: [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot, David Daney |
| Indexes: | [Date] [Thread] [Top] [All Lists] |