17 #include <linux/serial.h>
18 #include <linux/serial_core.h>
20 #include <linux/time.h>
23 static inline bool bcma_core_mips_bcm47162a0_quirk(
struct bcma_device *
dev)
30 static inline bool bcma_core_mips_bcm5357b0_quirk(
struct bcma_device *
dev)
34 dev->
bus->chipinfo.pkg == 11 &&
41 return bcma_read32(mcore->
core, offset);
48 bcma_write32(mcore->
core, offset, value);
51 static const u32 ipsflag_irq_mask[] = {
59 static const u32 ipsflag_irq_shift[] = {
71 if (bcma_core_mips_bcm47162a0_quirk(dev))
73 if (bcma_core_mips_bcm5357b0_quirk(dev))
89 irqflag = bcma_core_mips_irqflag(dev);
91 for (irq = 1; irq <= 4; irq++)
100 static void bcma_core_mips_set_irq(
struct bcma_device *dev,
unsigned int irq)
107 irqflag = bcma_core_mips_irqflag(dev);
126 u32 oldirqflag = bcma_read32(mdev,
135 if ((1 << bcma_core_mips_irqflag(core)) ==
137 bcma_core_mips_set_irq(core, 0);
146 bcma_info(bus,
"set_irq: core 0x%04x, irq %d => %d\n",
147 dev->
id.id, oldirq + 2, irq + 2);
150 static void bcma_core_mips_print_irq(
struct bcma_device *dev,
unsigned int irq)
153 static const char *irq_name[] = {
"2(S)",
"3",
"4",
"5",
"6",
"D",
"I"};
155 for (i = 0; i <= 6; i++)
156 printk(
" %s%s", irq_name[i], i == irq ?
"*" :
" ");
160 static void bcma_core_mips_dump_irq(
struct bcma_bus *bus)
176 bcma_err(bus,
"No PMU available, need this to get the cpu clock\n");
181 static void bcma_core_mips_flash_detect(
struct bcma_drv_mips *mcore)
193 bus->
drv_cc.pflash.window = 0x1c000000;
194 bus->
drv_cc.pflash.window_size = 0x02000000;
198 bus->
drv_cc.pflash.buswidth = 1;
200 bus->
drv_cc.pflash.buswidth = 2;
203 bcma_err(bus,
"Flash type not supported\n");
206 if (bus->
drv_cc.core->id.rev == 38 ||
219 bus = mcore->
core->bus;
221 bcma_info(bus,
"Initializing MIPS core...\n");
236 core->
irq = mips_irq + 2;
239 switch (core->
id.id) {
251 bcma_core_mips_set_irq(core,
256 bcma_info(bus,
"IRQ reconfiguration done\n");
257 bcma_core_mips_dump_irq(bus);
262 bcma_chipco_serial_init(&bus->
drv_cc);
263 bcma_core_mips_flash_detect(mcore);