Commit 54c97498 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

ssb: move parallel flash config into an own struct

This is a preparing step for adding serial flash support.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e5c9d7c0
...@@ -43,8 +43,8 @@ static void early_nvram_init(void) ...@@ -43,8 +43,8 @@ static void early_nvram_init(void)
#ifdef CONFIG_BCM47XX_SSB #ifdef CONFIG_BCM47XX_SSB
case BCM47XX_BUS_TYPE_SSB: case BCM47XX_BUS_TYPE_SSB:
mcore_ssb = &bcm47xx_bus.ssb.mipscore; mcore_ssb = &bcm47xx_bus.ssb.mipscore;
base = mcore_ssb->flash_window; base = mcore_ssb->pflash.window;
lim = mcore_ssb->flash_window_size; lim = mcore_ssb->pflash.window_size;
break; break;
#endif #endif
#ifdef CONFIG_BCM47XX_BCMA #ifdef CONFIG_BCM47XX_BCMA
......
...@@ -156,10 +156,10 @@ static int __init wgt634u_init(void) ...@@ -156,10 +156,10 @@ static int __init wgt634u_init(void)
SSB_CHIPCO_IRQ_GPIO); SSB_CHIPCO_IRQ_GPIO);
} }
wgt634u_flash_data.width = mcore->flash_buswidth; wgt634u_flash_data.width = mcore->pflash.buswidth;
wgt634u_flash_resource.start = mcore->flash_window; wgt634u_flash_resource.start = mcore->pflash.window;
wgt634u_flash_resource.end = mcore->flash_window wgt634u_flash_resource.end = mcore->pflash.window
+ mcore->flash_window_size + mcore->pflash.window_size
- 1; - 1;
return platform_add_devices(wgt634u_devices, return platform_add_devices(wgt634u_devices,
ARRAY_SIZE(wgt634u_devices)); ARRAY_SIZE(wgt634u_devices));
......
...@@ -192,9 +192,9 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) ...@@ -192,9 +192,9 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
/* When there is no chipcommon on the bus there is 4MB flash */ /* When there is no chipcommon on the bus there is 4MB flash */
if (!bus->chipco.dev) { if (!bus->chipco.dev) {
mcore->flash_buswidth = 2; mcore->pflash.buswidth = 2;
mcore->flash_window = SSB_FLASH1; mcore->pflash.window = SSB_FLASH1;
mcore->flash_window_size = SSB_FLASH1_SZ; mcore->pflash.window_size = SSB_FLASH1_SZ;
return; return;
} }
...@@ -206,13 +206,13 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) ...@@ -206,13 +206,13 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
break; break;
case SSB_CHIPCO_FLASHT_PARA: case SSB_CHIPCO_FLASHT_PARA:
pr_debug("Found parallel flash\n"); pr_debug("Found parallel flash\n");
mcore->flash_window = SSB_FLASH2; mcore->pflash.window = SSB_FLASH2;
mcore->flash_window_size = SSB_FLASH2_SZ; mcore->pflash.window_size = SSB_FLASH2_SZ;
if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG)
& SSB_CHIPCO_CFG_DS16) == 0) & SSB_CHIPCO_CFG_DS16) == 0)
mcore->flash_buswidth = 1; mcore->pflash.buswidth = 1;
else else
mcore->flash_buswidth = 2; mcore->pflash.buswidth = 2;
break; break;
} }
} }
......
...@@ -13,6 +13,11 @@ struct ssb_serial_port { ...@@ -13,6 +13,11 @@ struct ssb_serial_port {
unsigned int reg_shift; unsigned int reg_shift;
}; };
struct ssb_pflash {
u8 buswidth;
u32 window;
u32 window_size;
};
struct ssb_mipscore { struct ssb_mipscore {
struct ssb_device *dev; struct ssb_device *dev;
...@@ -20,9 +25,7 @@ struct ssb_mipscore { ...@@ -20,9 +25,7 @@ struct ssb_mipscore {
int nr_serial_ports; int nr_serial_ports;
struct ssb_serial_port serial_ports[4]; struct ssb_serial_port serial_ports[4];
u8 flash_buswidth; struct ssb_pflash pflash;
u32 flash_window;
u32 flash_window_size;
}; };
extern void ssb_mipscore_init(struct ssb_mipscore *mcore); extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment