drivers/bcma/driver_mips.c
Source file repositories/reference/linux-study-clean/drivers/bcma/driver_mips.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bcma/driver_mips.c- Extension
.c- Size
- 9573 bytes
- Lines
- 355
- Domain
- Driver Families
- Bucket
- drivers/bcma
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
bcma_private.hlinux/bcma/bcma.hlinux/serial.hlinux/serial_core.hlinux/serial_reg.hlinux/time.hlinux/bcm47xx_nvram.h
Detected Declarations
enum bcma_boot_devfunction bcma_core_mips_bcm47162a0_quirkfunction bcma_core_mips_bcm5357b0_quirkfunction bcma_core_mips_irqflagfunction bcma_core_mips_irqfunction bcma_core_mips_set_irqfunction list_for_each_entryfunction bcma_core_mips_set_irq_namefunction bcma_core_mips_print_irqfunction bcma_core_mips_dump_irqfunction list_for_each_entryfunction bcma_cpu_clockfunction bcma_boot_devfunction bcma_core_mips_nvram_initfunction bcma_core_mips_early_initfunction bcma_fix_i2s_irqflagfunction bcma_aread32function bcma_core_mips_initfunction list_for_each_entryexport bcma_cpu_clock
Annotated Snippet
if (irqinitmask) {
struct bcma_device *core;
/* backplane irq line is in use, find out who uses
* it and set user to irq 0
*/
list_for_each_entry(core, &bus->cores, list) {
if ((1 << bcma_core_mips_irqflag(core)) ==
irqinitmask) {
bcma_core_mips_set_irq(core, 0);
break;
}
}
}
bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq),
1 << irqflag);
}
bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n",
dev->id.id, oldirq <= 4 ? oldirq + 2 : 0, irq + 2);
}
static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
u16 coreid, u8 unit)
{
struct bcma_device *core;
core = bcma_find_core_unit(bus, coreid, unit);
if (!core) {
bcma_warn(bus,
"Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n",
coreid, unit);
return;
}
bcma_core_mips_set_irq(core, irq);
}
static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq)
{
int i;
static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"};
char interrupts[25];
char *ints = interrupts;
for (i = 0; i < ARRAY_SIZE(irq_name); i++)
ints += sprintf(ints, " %s%c",
irq_name[i], i == irq ? '*' : ' ');
bcma_debug(dev->bus, "core 0x%04x, irq:%s\n", dev->id.id, interrupts);
}
static void bcma_core_mips_dump_irq(struct bcma_bus *bus)
{
struct bcma_device *core;
list_for_each_entry(core, &bus->cores, list) {
bcma_core_mips_print_irq(core, bcma_core_mips_irq(core));
}
}
u32 bcma_cpu_clock(struct bcma_drv_mips *mcore)
{
struct bcma_bus *bus = mcore->core->bus;
if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU)
return bcma_pmu_get_cpu_clock(&bus->drv_cc);
bcma_err(bus, "No PMU available, need this to get the cpu clock\n");
return 0;
}
EXPORT_SYMBOL(bcma_cpu_clock);
static enum bcma_boot_dev bcma_boot_dev(struct bcma_bus *bus)
{
struct bcma_drv_cc *cc = &bus->drv_cc;
u8 cc_rev = cc->core->id.rev;
if (cc_rev == 42) {
struct bcma_device *core;
core = bcma_find_core(bus, BCMA_CORE_NS_ROM);
if (core) {
switch (bcma_aread32(core, BCMA_IOST) &
BCMA_NS_ROM_IOST_BOOT_DEV_MASK) {
case BCMA_NS_ROM_IOST_BOOT_DEV_NOR:
return BCMA_BOOT_DEV_SERIAL;
case BCMA_NS_ROM_IOST_BOOT_DEV_NAND:
return BCMA_BOOT_DEV_NAND;
case BCMA_NS_ROM_IOST_BOOT_DEV_ROM:
Annotation
- Immediate include surface: `bcma_private.h`, `linux/bcma/bcma.h`, `linux/serial.h`, `linux/serial_core.h`, `linux/serial_reg.h`, `linux/time.h`, `linux/bcm47xx_nvram.h`.
- Detected declarations: `enum bcma_boot_dev`, `function bcma_core_mips_bcm47162a0_quirk`, `function bcma_core_mips_bcm5357b0_quirk`, `function bcma_core_mips_irqflag`, `function bcma_core_mips_irq`, `function bcma_core_mips_set_irq`, `function list_for_each_entry`, `function bcma_core_mips_set_irq_name`, `function bcma_core_mips_print_irq`, `function bcma_core_mips_dump_irq`.
- Atlas domain: Driver Families / drivers/bcma.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.