diff options
Diffstat (limited to 'drivers/ssb/driver_mipscore.c')
| -rw-r--r-- | drivers/ssb/driver_mipscore.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c index c6250867a95d..5bd05b136d22 100644 --- a/drivers/ssb/driver_mipscore.c +++ b/drivers/ssb/driver_mipscore.c | |||
| @@ -178,9 +178,9 @@ static void ssb_mips_serial_init(struct ssb_mipscore *mcore) | |||
| 178 | { | 178 | { |
| 179 | struct ssb_bus *bus = mcore->dev->bus; | 179 | struct ssb_bus *bus = mcore->dev->bus; |
| 180 | 180 | ||
| 181 | if (bus->extif.dev) | 181 | if (ssb_extif_available(&bus->extif)) |
| 182 | mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); | 182 | mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); |
| 183 | else if (bus->chipco.dev) | 183 | else if (ssb_chipco_available(&bus->chipco)) |
| 184 | mcore->nr_serial_ports = ssb_chipco_serial_init(&bus->chipco, mcore->serial_ports); | 184 | mcore->nr_serial_ports = ssb_chipco_serial_init(&bus->chipco, mcore->serial_ports); |
| 185 | else | 185 | else |
| 186 | mcore->nr_serial_ports = 0; | 186 | mcore->nr_serial_ports = 0; |
| @@ -191,10 +191,11 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) | |||
| 191 | struct ssb_bus *bus = mcore->dev->bus; | 191 | struct ssb_bus *bus = mcore->dev->bus; |
| 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 (!ssb_chipco_available(&bus->chipco)) { |
| 195 | mcore->flash_buswidth = 2; | 195 | mcore->pflash.present = true; |
| 196 | mcore->flash_window = SSB_FLASH1; | 196 | mcore->pflash.buswidth = 2; |
| 197 | mcore->flash_window_size = SSB_FLASH1_SZ; | 197 | mcore->pflash.window = SSB_FLASH1; |
| 198 | mcore->pflash.window_size = SSB_FLASH1_SZ; | ||
| 198 | return; | 199 | return; |
| 199 | } | 200 | } |
| 200 | 201 | ||
| @@ -206,13 +207,14 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) | |||
| 206 | break; | 207 | break; |
| 207 | case SSB_CHIPCO_FLASHT_PARA: | 208 | case SSB_CHIPCO_FLASHT_PARA: |
| 208 | pr_debug("Found parallel flash\n"); | 209 | pr_debug("Found parallel flash\n"); |
| 209 | mcore->flash_window = SSB_FLASH2; | 210 | mcore->pflash.present = true; |
| 210 | mcore->flash_window_size = SSB_FLASH2_SZ; | 211 | mcore->pflash.window = SSB_FLASH2; |
| 212 | mcore->pflash.window_size = SSB_FLASH2_SZ; | ||
| 211 | if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) | 213 | if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) |
| 212 | & SSB_CHIPCO_CFG_DS16) == 0) | 214 | & SSB_CHIPCO_CFG_DS16) == 0) |
| 213 | mcore->flash_buswidth = 1; | 215 | mcore->pflash.buswidth = 1; |
| 214 | else | 216 | else |
| 215 | mcore->flash_buswidth = 2; | 217 | mcore->pflash.buswidth = 2; |
| 216 | break; | 218 | break; |
| 217 | } | 219 | } |
| 218 | } | 220 | } |
| @@ -225,9 +227,9 @@ u32 ssb_cpu_clock(struct ssb_mipscore *mcore) | |||
| 225 | if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) | 227 | if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) |
| 226 | return ssb_pmu_get_cpu_clock(&bus->chipco); | 228 | return ssb_pmu_get_cpu_clock(&bus->chipco); |
| 227 | 229 | ||
| 228 | if (bus->extif.dev) { | 230 | if (ssb_extif_available(&bus->extif)) { |
| 229 | ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m); | 231 | ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m); |
| 230 | } else if (bus->chipco.dev) { | 232 | } else if (ssb_chipco_available(&bus->chipco)) { |
| 231 | ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m); | 233 | ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m); |
| 232 | } else | 234 | } else |
| 233 | return 0; | 235 | return 0; |
| @@ -263,9 +265,9 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore) | |||
| 263 | hz = 100000000; | 265 | hz = 100000000; |
| 264 | ns = 1000000000 / hz; | 266 | ns = 1000000000 / hz; |
| 265 | 267 | ||
| 266 | if (bus->extif.dev) | 268 | if (ssb_extif_available(&bus->extif)) |
| 267 | ssb_extif_timing_init(&bus->extif, ns); | 269 | ssb_extif_timing_init(&bus->extif, ns); |
| 268 | else if (bus->chipco.dev) | 270 | else if (ssb_chipco_available(&bus->chipco)) |
| 269 | ssb_chipco_timing_init(&bus->chipco, ns); | 271 | ssb_chipco_timing_init(&bus->chipco, ns); |
| 270 | 272 | ||
| 271 | /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ | 273 | /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ |
