Lines Matching full:pub

220 	struct brcmf_core pub;  member
227 struct brcmf_chip pub; member
257 address = CORE_SB(core->pub.base, sbtmstatelow); in brcmf_chip_sb_iscoreup()
287 base = core->pub.base; in brcmf_chip_sb_coredisable()
392 base = core->pub.base; in brcmf_chip_sb_resetcore()
445 if (core->pub.id == BCMA_CORE_80211) { in brcmf_chip_ai_resetcore()
446 d11core2 = brcmf_chip_get_d11core(&ci->pub, 1); in brcmf_chip_ai_resetcore()
450 struct brcmf_core_priv, pub); in brcmf_chip_ai_resetcore()
514 core->pub.id = coreid; in brcmf_chip_add_core()
515 core->pub.base = base; in brcmf_chip_add_core()
520 return &core->pub; in brcmf_chip_add_core()
534 idx++, core->pub.id, core->pub.rev, core->pub.base, in brcmf_chip_cores_check()
537 switch (core->pub.id) { in brcmf_chip_cores_check()
570 return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); in brcmf_chip_core_read32()
576 core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); in brcmf_chip_core_write32()
604 if (WARN_ON(sr->pub.rev < 4)) in brcmf_chip_socram_ramsize()
607 if (!brcmf_chip_iscoreup(&sr->pub)) in brcmf_chip_socram_ramsize()
608 brcmf_chip_resetcore(&sr->pub, 0, 0, 0); in brcmf_chip_socram_ramsize()
614 if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { in brcmf_chip_socram_ramsize()
624 if (sr->pub.rev >= 23) { in brcmf_chip_socram_ramsize()
639 switch (sr->chip->pub.chip) { in brcmf_chip_socram_ramsize()
641 if (sr->chip->pub.chiprev < 2) in brcmf_chip_socram_ramsize()
665 if (!brcmf_chip_iscoreup(&sysmem->pub)) in brcmf_chip_sysmem_ramsize()
666 brcmf_chip_resetcore(&sysmem->pub, 0, 0, 0); in brcmf_chip_sysmem_ramsize()
712 switch (ci->pub.chip) { in brcmf_chip_tcm_rambase()
737 return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; in brcmf_chip_tcm_rambase()
749 brcmf_err("unknown chip: %s\n", ci->pub.name); in brcmf_chip_tcm_rambase()
755 int brcmf_chip_get_raminfo(struct brcmf_chip *pub) in brcmf_chip_get_raminfo() argument
757 struct brcmf_chip_priv *ci = container_of(pub, struct brcmf_chip_priv, in brcmf_chip_get_raminfo()
758 pub); in brcmf_chip_get_raminfo()
762 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_get_raminfo()
764 mem_core = container_of(mem, struct brcmf_core_priv, pub); in brcmf_chip_get_raminfo()
765 ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); in brcmf_chip_get_raminfo()
766 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
767 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
772 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_SYS_MEM); in brcmf_chip_get_raminfo()
775 pub); in brcmf_chip_get_raminfo()
776 ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core); in brcmf_chip_get_raminfo()
777 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
778 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
783 mem = brcmf_chip_get_core(&ci->pub, in brcmf_chip_get_raminfo()
790 pub); in brcmf_chip_get_raminfo()
791 brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, in brcmf_chip_get_raminfo()
792 &ci->pub.srsize); in brcmf_chip_get_raminfo()
796 ci->pub.rambase, ci->pub.ramsize, ci->pub.ramsize, in brcmf_chip_get_raminfo()
797 ci->pub.srsize, ci->pub.srsize); in brcmf_chip_get_raminfo()
799 if (!ci->pub.ramsize) { in brcmf_chip_get_raminfo()
804 if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { in brcmf_chip_get_raminfo()
916 CORE_CC_REG(ci->pub.enum_base, eromptr)); in brcmf_chip_dmp_erom_scan()
983 CORE_CC_REG(ci->pub.enum_base, chipid)); in brcmf_chip_recognition()
989 ci->pub.chip = regdata & CID_ID_MASK; in brcmf_chip_recognition()
990 ci->pub.chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT; in brcmf_chip_recognition()
993 brcmf_chip_name(ci->pub.chip, ci->pub.chiprev, in brcmf_chip_recognition()
994 ci->pub.name, sizeof(ci->pub.name)); in brcmf_chip_recognition()
996 socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name); in brcmf_chip_recognition()
999 if (ci->pub.chip != BRCM_CC_4329_CHIP_ID) { in brcmf_chip_recognition()
1039 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1045 ci->ops->reset(ci->ctx, &ci->pub); in brcmf_chip_recognition()
1046 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1049 return brcmf_chip_get_raminfo(&ci->pub); in brcmf_chip_recognition()
1059 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
1069 cpu = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
1085 struct brcmf_chip *pub; in brcmf_chip_setup() local
1092 pub = &chip->pub; in brcmf_chip_setup()
1094 base = cc->pub.base; in brcmf_chip_setup()
1097 pub->cc_caps = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1099 pub->cc_caps_ext = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1104 pmu = brcmf_chip_get_pmu(pub); /* after reading cc_caps_ext */ in brcmf_chip_setup()
1105 if (pub->cc_caps & CC_CAP_PMU) { in brcmf_chip_setup()
1108 pub->pmurev = val & PCAP_REV_MASK; in brcmf_chip_setup()
1109 pub->pmucaps = val; in brcmf_chip_setup()
1113 cc->pub.rev, pub->pmurev, pub->pmucaps); in brcmf_chip_setup()
1117 ret = chip->ops->setup(chip->ctx, pub); in brcmf_chip_setup()
1147 chip->pub.enum_base = brcmf_chip_enum_base(devid); in brcmf_chip_attach()
1161 return &chip->pub; in brcmf_chip_attach()
1164 brcmf_chip_detach(&chip->pub); in brcmf_chip_attach()
1168 void brcmf_chip_detach(struct brcmf_chip *pub) in brcmf_chip_detach() argument
1174 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_detach()
1182 struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit) in brcmf_chip_get_d11core() argument
1187 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_d11core()
1189 if (core->pub.id == BCMA_CORE_80211) { in brcmf_chip_get_d11core()
1191 return &core->pub; in brcmf_chip_get_d11core()
1197 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) in brcmf_chip_get_core() argument
1202 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_core()
1204 if (core->pub.id == coreid) in brcmf_chip_get_core()
1205 return &core->pub; in brcmf_chip_get_core()
1210 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *pub) in brcmf_chip_get_chipcommon() argument
1215 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_chipcommon()
1217 if (WARN_ON(!cc || cc->pub.id != BCMA_CORE_CHIPCOMMON)) in brcmf_chip_get_chipcommon()
1218 return brcmf_chip_get_core(pub, BCMA_CORE_CHIPCOMMON); in brcmf_chip_get_chipcommon()
1219 return &cc->pub; in brcmf_chip_get_chipcommon()
1222 struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub) in brcmf_chip_get_pmu() argument
1224 struct brcmf_core *cc = brcmf_chip_get_chipcommon(pub); in brcmf_chip_get_pmu()
1229 pub->cc_caps_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) { in brcmf_chip_get_pmu()
1230 pmu = brcmf_chip_get_core(pub, BCMA_CORE_PMU); in brcmf_chip_get_pmu()
1239 bool brcmf_chip_iscoreup(struct brcmf_core *pub) in brcmf_chip_iscoreup() argument
1243 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1247 void brcmf_chip_coredisable(struct brcmf_core *pub, u32 prereset, u32 reset) in brcmf_chip_coredisable() argument
1251 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1255 void brcmf_chip_resetcore(struct brcmf_core *pub, u32 prereset, u32 reset, in brcmf_chip_resetcore() argument
1260 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1271 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1276 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1280 if (chip->pub.chip == BRCM_CC_43430_CHIP_ID || in brcmf_chip_cm3_set_passive()
1281 chip->pub.chip == CY_CC_43439_CHIP_ID) { in brcmf_chip_cm3_set_passive()
1282 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1292 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1298 chip->ops->activate(chip->ctx, &chip->pub, 0); in brcmf_chip_cm3_set_active()
1300 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1317 for (i = 0; (core = brcmf_chip_get_d11core(&chip->pub, i)); i++) in brcmf_chip_cr4_set_passive()
1327 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_cr4_set_active()
1330 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1343 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_ca7_set_passive()
1354 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_ca7_set_active()
1357 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CA7); in brcmf_chip_ca7_set_active()
1363 void brcmf_chip_set_passive(struct brcmf_chip *pub) in brcmf_chip_set_passive() argument
1370 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_passive()
1371 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_passive()
1376 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_passive()
1381 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_passive()
1388 bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) in brcmf_chip_set_active() argument
1395 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_active()
1396 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_active()
1399 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_active()
1402 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_active()
1409 bool brcmf_chip_sr_capable(struct brcmf_chip *pub) in brcmf_chip_sr_capable() argument
1413 struct brcmf_core *pmu = brcmf_chip_get_pmu(pub); in brcmf_chip_sr_capable()
1418 if (pub->pmurev < 17) in brcmf_chip_sr_capable()
1421 base = brcmf_chip_get_chipcommon(pub)->base; in brcmf_chip_sr_capable()
1422 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_sr_capable()
1424 switch (pub->chip) { in brcmf_chip_sr_capable()