Lines Matching refs:bus

39 int bcma_arch_register_fallback_sprom(int (*sprom_callback)(struct bcma_bus *bus,  in bcma_arch_register_fallback_sprom()  argument
49 static int bcma_fill_sprom_with_fallback(struct bcma_bus *bus, in bcma_fill_sprom_with_fallback() argument
59 err = get_fallback_sprom(bus, out); in bcma_fill_sprom_with_fallback()
63 bcma_debug(bus, "Using SPROM revision %d provided by platform.\n", in bcma_fill_sprom_with_fallback()
64 bus->sprom.revision); in bcma_fill_sprom_with_fallback()
67 bcma_warn(bus, "Using fallback SPROM failed (err %d)\n", err); in bcma_fill_sprom_with_fallback()
75 static void bcma_sprom_read(struct bcma_bus *bus, u16 offset, u16 *sprom, in bcma_sprom_read() argument
80 sprom[i] = bcma_read16(bus->drv_cc.core, offset + (i * 2)); in bcma_sprom_read()
157 static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom, in bcma_sprom_valid() argument
173 bus->sprom.revision = revision; in bcma_sprom_valid()
174 bcma_debug(bus, "Found SPROM revision %d\n", revision); in bcma_sprom_valid()
186 bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))
189 bus->sprom._field = ((((u32)sprom[SPOFF((_offset)+2)] << 16 | \
221 static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) in bcma_sprom_extract_r8() argument
230 ARRAY_SIZE(bus->sprom.core_pwr_info)); in bcma_sprom_extract_r8()
234 *(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v); in bcma_sprom_extract_r8()
401 bus->sprom.antenna_gain.a0 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
405 bus->sprom.antenna_gain.a1 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
409 bus->sprom.antenna_gain.a2 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
413 bus->sprom.antenna_gain.a3 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
480 static bool bcma_sprom_ext_available(struct bcma_bus *bus) in bcma_sprom_ext_available() argument
486 if (bus->drv_cc.core->id.rev >= 31) { in bcma_sprom_ext_available()
487 if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM)) in bcma_sprom_ext_available()
490 srom_control = bcma_read32(bus->drv_cc.core, in bcma_sprom_ext_available()
496 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT); in bcma_sprom_ext_available()
497 switch (bus->chipinfo.id) { in bcma_sprom_ext_available()
516 static bool bcma_sprom_onchip_available(struct bcma_bus *bus) in bcma_sprom_onchip_available() argument
522 chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT); in bcma_sprom_onchip_available()
523 switch (bus->chipinfo.id) { in bcma_sprom_onchip_available()
550 otpsize = bus->drv_cc.capabilities & BCMA_CC_CAP_OTPS; in bcma_sprom_onchip_available()
563 static int bcma_sprom_onchip_offset(struct bcma_bus *bus) in bcma_sprom_onchip_offset() argument
565 struct bcma_device *cc = bus->drv_cc.core; in bcma_sprom_onchip_offset()
577 int bcma_sprom_get(struct bcma_bus *bus) in bcma_sprom_get() argument
586 if (!bus->drv_cc.core) in bcma_sprom_get()
589 if (!bcma_sprom_ext_available(bus)) { in bcma_sprom_get()
597 sprom_onchip = bcma_sprom_onchip_available(bus); in bcma_sprom_get()
600 offset = bcma_sprom_onchip_offset(bus); in bcma_sprom_get()
608 err = bcma_fill_sprom_with_fallback(bus, &bus->sprom); in bcma_sprom_get()
613 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4331 || in bcma_sprom_get()
614 bus->chipinfo.id == BCMA_CHIP_ID_BCM43431) in bcma_sprom_get()
615 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); in bcma_sprom_get()
617 bcma_debug(bus, "SPROM offset 0x%x\n", offset); in bcma_sprom_get()
625 bcma_sprom_read(bus, offset, sprom, words); in bcma_sprom_get()
626 err = bcma_sprom_valid(bus, sprom, words); in bcma_sprom_get()
633 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4331 || in bcma_sprom_get()
634 bus->chipinfo.id == BCMA_CHIP_ID_BCM43431) in bcma_sprom_get()
635 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); in bcma_sprom_get()
638 bcma_warn(bus, "Invalid SPROM read from the PCIe card, trying to use fallback SPROM\n"); in bcma_sprom_get()
639 err = bcma_fill_sprom_with_fallback(bus, &bus->sprom); in bcma_sprom_get()
641 bcma_sprom_extract_r8(bus, sprom); in bcma_sprom_get()