diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-09-29 14:36:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 15:52:44 -0400 |
commit | 54c974984e8840c9e20390ce16e3d9f4ea674499 (patch) | |
tree | 2698ea78262a6fcc3fe29a1dbf1f33e04c9448dd | |
parent | e5c9d7c0757c2e1dcd7e3130b4c3446a7e9236c8 (diff) |
ssb: move parallel flash config into an own struct
This is a preparing step for adding serial flash support.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | arch/mips/bcm47xx/nvram.c | 4 | ||||
-rw-r--r-- | arch/mips/bcm47xx/wgt634u.c | 8 | ||||
-rw-r--r-- | drivers/ssb/driver_mipscore.c | 14 | ||||
-rw-r--r-- | include/linux/ssb/ssb_driver_mips.h | 9 |
4 files changed, 19 insertions, 16 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index d43ceff5be4..48a4c70b384 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c | |||
@@ -43,8 +43,8 @@ static void early_nvram_init(void) | |||
43 | #ifdef CONFIG_BCM47XX_SSB | 43 | #ifdef CONFIG_BCM47XX_SSB |
44 | case BCM47XX_BUS_TYPE_SSB: | 44 | case BCM47XX_BUS_TYPE_SSB: |
45 | mcore_ssb = &bcm47xx_bus.ssb.mipscore; | 45 | mcore_ssb = &bcm47xx_bus.ssb.mipscore; |
46 | base = mcore_ssb->flash_window; | 46 | base = mcore_ssb->pflash.window; |
47 | lim = mcore_ssb->flash_window_size; | 47 | lim = mcore_ssb->pflash.window_size; |
48 | break; | 48 | break; |
49 | #endif | 49 | #endif |
50 | #ifdef CONFIG_BCM47XX_BCMA | 50 | #ifdef CONFIG_BCM47XX_BCMA |
diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c index e9f9ec8d443..e80d585731a 100644 --- a/arch/mips/bcm47xx/wgt634u.c +++ b/arch/mips/bcm47xx/wgt634u.c | |||
@@ -156,10 +156,10 @@ static int __init wgt634u_init(void) | |||
156 | SSB_CHIPCO_IRQ_GPIO); | 156 | SSB_CHIPCO_IRQ_GPIO); |
157 | } | 157 | } |
158 | 158 | ||
159 | wgt634u_flash_data.width = mcore->flash_buswidth; | 159 | wgt634u_flash_data.width = mcore->pflash.buswidth; |
160 | wgt634u_flash_resource.start = mcore->flash_window; | 160 | wgt634u_flash_resource.start = mcore->pflash.window; |
161 | wgt634u_flash_resource.end = mcore->flash_window | 161 | wgt634u_flash_resource.end = mcore->pflash.window |
162 | + mcore->flash_window_size | 162 | + mcore->pflash.window_size |
163 | - 1; | 163 | - 1; |
164 | return platform_add_devices(wgt634u_devices, | 164 | return platform_add_devices(wgt634u_devices, |
165 | ARRAY_SIZE(wgt634u_devices)); | 165 | ARRAY_SIZE(wgt634u_devices)); |
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c index c6250867a95..dcad2c40836 100644 --- a/drivers/ssb/driver_mipscore.c +++ b/drivers/ssb/driver_mipscore.c | |||
@@ -192,9 +192,9 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) | |||
192 | 192 | ||
193 | /* When there is no chipcommon on the bus there is 4MB flash */ | 193 | /* When there is no chipcommon on the bus there is 4MB flash */ |
194 | if (!bus->chipco.dev) { | 194 | if (!bus->chipco.dev) { |
195 | mcore->flash_buswidth = 2; | 195 | mcore->pflash.buswidth = 2; |
196 | mcore->flash_window = SSB_FLASH1; | 196 | mcore->pflash.window = SSB_FLASH1; |
197 | mcore->flash_window_size = SSB_FLASH1_SZ; | 197 | mcore->pflash.window_size = SSB_FLASH1_SZ; |
198 | return; | 198 | return; |
199 | } | 199 | } |
200 | 200 | ||
@@ -206,13 +206,13 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) | |||
206 | break; | 206 | break; |
207 | case SSB_CHIPCO_FLASHT_PARA: | 207 | case SSB_CHIPCO_FLASHT_PARA: |
208 | pr_debug("Found parallel flash\n"); | 208 | pr_debug("Found parallel flash\n"); |
209 | mcore->flash_window = SSB_FLASH2; | 209 | mcore->pflash.window = SSB_FLASH2; |
210 | mcore->flash_window_size = SSB_FLASH2_SZ; | 210 | mcore->pflash.window_size = SSB_FLASH2_SZ; |
211 | if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) | 211 | if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) |
212 | & SSB_CHIPCO_CFG_DS16) == 0) | 212 | & SSB_CHIPCO_CFG_DS16) == 0) |
213 | mcore->flash_buswidth = 1; | 213 | mcore->pflash.buswidth = 1; |
214 | else | 214 | else |
215 | mcore->flash_buswidth = 2; | 215 | mcore->pflash.buswidth = 2; |
216 | break; | 216 | break; |
217 | } | 217 | } |
218 | } | 218 | } |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index 5f44e9740cd..5d057db5307 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -13,6 +13,11 @@ struct ssb_serial_port { | |||
13 | unsigned int reg_shift; | 13 | unsigned int reg_shift; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct ssb_pflash { | ||
17 | u8 buswidth; | ||
18 | u32 window; | ||
19 | u32 window_size; | ||
20 | }; | ||
16 | 21 | ||
17 | struct ssb_mipscore { | 22 | struct ssb_mipscore { |
18 | struct ssb_device *dev; | 23 | struct ssb_device *dev; |
@@ -20,9 +25,7 @@ struct ssb_mipscore { | |||
20 | int nr_serial_ports; | 25 | int nr_serial_ports; |
21 | struct ssb_serial_port serial_ports[4]; | 26 | struct ssb_serial_port serial_ports[4]; |
22 | 27 | ||
23 | u8 flash_buswidth; | 28 | struct ssb_pflash pflash; |
24 | u32 flash_window; | ||
25 | u32 flash_window_size; | ||
26 | }; | 29 | }; |
27 | 30 | ||
28 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 31 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |