Lines Matching +full:bus +full:- +full:id

7  * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
30 if (cc->capabilities & BCMA_CC_CAP_PMU) in bcma_chipco_get_alp_clock()
39 struct bcma_bus *bus = cc->core->bus; in bcma_core_cc_has_pmu_watchdog() local
41 if (cc->capabilities & BCMA_CC_CAP_PMU) { in bcma_core_cc_has_pmu_watchdog()
42 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573) { in bcma_core_cc_has_pmu_watchdog()
43 WARN(bus->chipinfo.rev <= 1, "No watchdog available\n"); in bcma_core_cc_has_pmu_watchdog()
58 struct bcma_bus *bus = cc->core->bus; in bcma_chipco_watchdog_get_max_timer() local
62 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) in bcma_chipco_watchdog_get_max_timer()
64 else if (cc->core->id.rev < 26) in bcma_chipco_watchdog_get_max_timer()
67 nb = (cc->core->id.rev >= 37) ? 32 : 24; in bcma_chipco_watchdog_get_max_timer()
74 return (1 << nb) - 1; in bcma_chipco_watchdog_get_max_timer()
91 ticks = bcma_chipco_watchdog_timer_set(cc, cc->ticks_per_ms * ms); in bcma_chipco_watchdog_timer_set_ms_wdt()
92 return ticks / cc->ticks_per_ms; in bcma_chipco_watchdog_timer_set_ms_wdt()
97 struct bcma_bus *bus = cc->core->bus; in bcma_chipco_watchdog_ticks_per_ms() local
99 if (cc->capabilities & BCMA_CC_CAP_PMU) { in bcma_chipco_watchdog_ticks_per_ms()
100 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) in bcma_chipco_watchdog_ticks_per_ms()
115 struct bcma_bus *bus = cc->core->bus; in bcma_chipco_watchdog_register() local
119 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573 && in bcma_chipco_watchdog_register()
120 bus->chipinfo.rev <= 1) { in bcma_chipco_watchdog_register()
129 bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms; in bcma_chipco_watchdog_register()
131 pdev = platform_device_register_data(NULL, "bcm47xx-wdt", in bcma_chipco_watchdog_register()
132 bus->num, &wdt, in bcma_chipco_watchdog_register()
137 cc->watchdog = pdev; in bcma_chipco_watchdog_register()
144 struct bcma_bus *bus = cc->core->bus; in bcma_core_chipcommon_flash_detect() local
146 switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { in bcma_core_chipcommon_flash_detect()
149 bcma_debug(bus, "Found serial flash\n"); in bcma_core_chipcommon_flash_detect()
153 bcma_debug(bus, "Found parallel flash\n"); in bcma_core_chipcommon_flash_detect()
157 bcma_err(bus, "Flash type not supported\n"); in bcma_core_chipcommon_flash_detect()
160 if (cc->core->id.rev == 38 || in bcma_core_chipcommon_flash_detect()
161 bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { in bcma_core_chipcommon_flash_detect()
162 if (cc->capabilities & BCMA_CC_CAP_NFLASH) { in bcma_core_chipcommon_flash_detect()
163 bcma_debug(bus, "Found NAND flash\n"); in bcma_core_chipcommon_flash_detect()
171 struct bcma_bus *bus = cc->core->bus; in bcma_core_chipcommon_early_init() local
173 if (cc->early_setup_done) in bcma_core_chipcommon_early_init()
176 spin_lock_init(&cc->gpio_lock); in bcma_core_chipcommon_early_init()
178 if (cc->core->id.rev >= 11) in bcma_core_chipcommon_early_init()
179 cc->status = bcma_cc_read32(cc, BCMA_CC_CHIPSTAT); in bcma_core_chipcommon_early_init()
180 cc->capabilities = bcma_cc_read32(cc, BCMA_CC_CAP); in bcma_core_chipcommon_early_init()
181 if (cc->core->id.rev >= 35) in bcma_core_chipcommon_early_init()
182 cc->capabilities_ext = bcma_cc_read32(cc, BCMA_CC_CAP_EXT); in bcma_core_chipcommon_early_init()
184 if (cc->capabilities & BCMA_CC_CAP_PMU) in bcma_core_chipcommon_early_init()
187 if (bus->hosttype == BCMA_HOSTTYPE_SOC) in bcma_core_chipcommon_early_init()
190 cc->early_setup_done = true; in bcma_core_chipcommon_early_init()
198 if (cc->setup_done) in bcma_core_chipcommon_init()
203 if (cc->core->id.rev >= 20) { in bcma_core_chipcommon_init()
206 if (cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM43142) { in bcma_core_chipcommon_init()
215 if (cc->capabilities & BCMA_CC_CAP_PMU) in bcma_core_chipcommon_init()
217 if (cc->capabilities & BCMA_CC_CAP_PCTL) in bcma_core_chipcommon_init()
218 bcma_err(cc->core->bus, "Power control not implemented!\n"); in bcma_core_chipcommon_init()
220 if (cc->core->id.rev >= 16) { in bcma_core_chipcommon_init()
221 if (cc->core->bus->sprom.leddc_on_time && in bcma_core_chipcommon_init()
222 cc->core->bus->sprom.leddc_off_time) { in bcma_core_chipcommon_init()
223 leddc_on = cc->core->bus->sprom.leddc_on_time; in bcma_core_chipcommon_init()
224 leddc_off = cc->core->bus->sprom.leddc_off_time; in bcma_core_chipcommon_init()
230 cc->ticks_per_ms = bcma_chipco_watchdog_ticks_per_ms(cc); in bcma_core_chipcommon_init()
232 cc->setup_done = true; in bcma_core_chipcommon_init()
248 struct bcma_bus *bus = cc->core->bus; in bcma_chipco_watchdog_timer_set() local
250 if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4707 && in bcma_chipco_watchdog_timer_set()
251 bus->chipinfo.id != BCMA_CHIP_ID_BCM47094 && in bcma_chipco_watchdog_timer_set()
252 bus->chipinfo.id != BCMA_CHIP_ID_BCM53018) in bcma_chipco_watchdog_timer_set()
253 bcma_core_set_clockmode(cc->core, in bcma_chipco_watchdog_timer_set()
284 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_out()
286 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_out()
297 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_outen()
299 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_outen()
314 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_control()
316 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_control()
327 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_intmask()
329 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_intmask()
339 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_polarity()
341 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_polarity()
351 if (cc->core->id.rev < 20) in bcma_chipco_gpio_pullup()
354 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_pullup()
356 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_pullup()
366 if (cc->core->id.rev < 20) in bcma_chipco_gpio_pulldown()
369 spin_lock_irqsave(&cc->gpio_lock, flags); in bcma_chipco_gpio_pulldown()
371 spin_unlock_irqrestore(&cc->gpio_lock, flags); in bcma_chipco_gpio_pulldown()
382 unsigned int ccrev = cc->core->id.rev; in bcma_chipco_serial_init()
383 struct bcma_serial_port *ports = cc->serial_ports; in bcma_chipco_serial_init()
398 /* Re-enable the UART clock. */ in bcma_chipco_serial_init()
404 bcma_err(cc->core->bus, "serial not supported on this device ccrev: 0x%x\n", in bcma_chipco_serial_init()
409 irq = bcma_core_irq(cc->core, 0); in bcma_chipco_serial_init()
412 cc->nr_serial_ports = (cc->capabilities & BCMA_CC_CAP_NRUART); in bcma_chipco_serial_init()
413 for (i = 0; i < cc->nr_serial_ports; i++) { in bcma_chipco_serial_init()
414 ports[i].regs = cc->core->io_addr + BCMA_CC_UART0_DATA + in bcma_chipco_serial_init()