Lines Matching full:pub

219 	struct brcmf_core pub;  member
226 struct brcmf_chip pub; member
256 address = CORE_SB(core->pub.base, sbtmstatelow); in brcmf_chip_sb_iscoreup()
286 base = core->pub.base; in brcmf_chip_sb_coredisable()
391 base = core->pub.base; in brcmf_chip_sb_resetcore()
444 if (core->pub.id == BCMA_CORE_80211) { in brcmf_chip_ai_resetcore()
445 d11core2 = brcmf_chip_get_d11core(&ci->pub, 1); in brcmf_chip_ai_resetcore()
449 struct brcmf_core_priv, pub); in brcmf_chip_ai_resetcore()
513 core->pub.id = coreid; in brcmf_chip_add_core()
514 core->pub.base = base; in brcmf_chip_add_core()
519 return &core->pub; in brcmf_chip_add_core()
533 idx++, core->pub.id, core->pub.rev, core->pub.base, in brcmf_chip_cores_check()
536 switch (core->pub.id) { in brcmf_chip_cores_check()
569 return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); in brcmf_chip_core_read32()
575 core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); in brcmf_chip_core_write32()
603 if (WARN_ON(sr->pub.rev < 4)) in brcmf_chip_socram_ramsize()
606 if (!brcmf_chip_iscoreup(&sr->pub)) in brcmf_chip_socram_ramsize()
607 brcmf_chip_resetcore(&sr->pub, 0, 0, 0); in brcmf_chip_socram_ramsize()
613 if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { in brcmf_chip_socram_ramsize()
623 if (sr->pub.rev >= 23) { in brcmf_chip_socram_ramsize()
638 switch (sr->chip->pub.chip) { in brcmf_chip_socram_ramsize()
640 if (sr->chip->pub.chiprev < 2) in brcmf_chip_socram_ramsize()
663 if (!brcmf_chip_iscoreup(&sysmem->pub)) in brcmf_chip_sysmem_ramsize()
664 brcmf_chip_resetcore(&sysmem->pub, 0, 0, 0); in brcmf_chip_sysmem_ramsize()
705 switch (ci->pub.chip) { in brcmf_chip_tcm_rambase()
728 return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; in brcmf_chip_tcm_rambase()
735 brcmf_err("unknown chip: %s\n", ci->pub.name); in brcmf_chip_tcm_rambase()
741 int brcmf_chip_get_raminfo(struct brcmf_chip *pub) in brcmf_chip_get_raminfo() argument
743 struct brcmf_chip_priv *ci = container_of(pub, struct brcmf_chip_priv, in brcmf_chip_get_raminfo()
744 pub); in brcmf_chip_get_raminfo()
748 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_get_raminfo()
750 mem_core = container_of(mem, struct brcmf_core_priv, pub); in brcmf_chip_get_raminfo()
751 ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); in brcmf_chip_get_raminfo()
752 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
753 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
758 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_SYS_MEM); in brcmf_chip_get_raminfo()
761 pub); in brcmf_chip_get_raminfo()
762 ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core); in brcmf_chip_get_raminfo()
763 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
764 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
769 mem = brcmf_chip_get_core(&ci->pub, in brcmf_chip_get_raminfo()
776 pub); in brcmf_chip_get_raminfo()
777 brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, in brcmf_chip_get_raminfo()
778 &ci->pub.srsize); in brcmf_chip_get_raminfo()
782 ci->pub.rambase, ci->pub.ramsize, ci->pub.ramsize, in brcmf_chip_get_raminfo()
783 ci->pub.srsize, ci->pub.srsize); in brcmf_chip_get_raminfo()
785 if (!ci->pub.ramsize) { in brcmf_chip_get_raminfo()
790 if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { in brcmf_chip_get_raminfo()
902 CORE_CC_REG(ci->pub.enum_base, eromptr)); in brcmf_chip_dmp_erom_scan()
968 CORE_CC_REG(ci->pub.enum_base, chipid)); in brcmf_chip_recognition()
969 ci->pub.chip = regdata & CID_ID_MASK; in brcmf_chip_recognition()
970 ci->pub.chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT; in brcmf_chip_recognition()
973 brcmf_chip_name(ci->pub.chip, ci->pub.chiprev, in brcmf_chip_recognition()
974 ci->pub.name, sizeof(ci->pub.name)); in brcmf_chip_recognition()
976 socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name); in brcmf_chip_recognition()
979 if (ci->pub.chip != BRCM_CC_4329_CHIP_ID) { in brcmf_chip_recognition()
1019 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1025 ci->ops->reset(ci->ctx, &ci->pub); in brcmf_chip_recognition()
1026 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1029 return brcmf_chip_get_raminfo(&ci->pub); in brcmf_chip_recognition()
1039 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
1049 cpu = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
1065 struct brcmf_chip *pub; in brcmf_chip_setup() local
1072 pub = &chip->pub; in brcmf_chip_setup()
1074 base = cc->pub.base; in brcmf_chip_setup()
1077 pub->cc_caps = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1079 pub->cc_caps_ext = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1084 pmu = brcmf_chip_get_pmu(pub); /* after reading cc_caps_ext */ in brcmf_chip_setup()
1085 if (pub->cc_caps & CC_CAP_PMU) { in brcmf_chip_setup()
1088 pub->pmurev = val & PCAP_REV_MASK; in brcmf_chip_setup()
1089 pub->pmucaps = val; in brcmf_chip_setup()
1093 cc->pub.rev, pub->pmurev, pub->pmucaps); in brcmf_chip_setup()
1097 ret = chip->ops->setup(chip->ctx, pub); in brcmf_chip_setup()
1127 chip->pub.enum_base = brcmf_chip_enum_base(devid); in brcmf_chip_attach()
1141 return &chip->pub; in brcmf_chip_attach()
1144 brcmf_chip_detach(&chip->pub); in brcmf_chip_attach()
1148 void brcmf_chip_detach(struct brcmf_chip *pub) in brcmf_chip_detach() argument
1154 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_detach()
1162 struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit) in brcmf_chip_get_d11core() argument
1167 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_d11core()
1169 if (core->pub.id == BCMA_CORE_80211) { in brcmf_chip_get_d11core()
1171 return &core->pub; in brcmf_chip_get_d11core()
1177 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) in brcmf_chip_get_core() argument
1182 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_core()
1184 if (core->pub.id == coreid) in brcmf_chip_get_core()
1185 return &core->pub; in brcmf_chip_get_core()
1190 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *pub) in brcmf_chip_get_chipcommon() argument
1195 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_chipcommon()
1197 if (WARN_ON(!cc || cc->pub.id != BCMA_CORE_CHIPCOMMON)) in brcmf_chip_get_chipcommon()
1198 return brcmf_chip_get_core(pub, BCMA_CORE_CHIPCOMMON); in brcmf_chip_get_chipcommon()
1199 return &cc->pub; in brcmf_chip_get_chipcommon()
1202 struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub) in brcmf_chip_get_pmu() argument
1204 struct brcmf_core *cc = brcmf_chip_get_chipcommon(pub); in brcmf_chip_get_pmu()
1209 pub->cc_caps_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) { in brcmf_chip_get_pmu()
1210 pmu = brcmf_chip_get_core(pub, BCMA_CORE_PMU); in brcmf_chip_get_pmu()
1219 bool brcmf_chip_iscoreup(struct brcmf_core *pub) in brcmf_chip_iscoreup() argument
1223 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1227 void brcmf_chip_coredisable(struct brcmf_core *pub, u32 prereset, u32 reset) in brcmf_chip_coredisable() argument
1231 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1235 void brcmf_chip_resetcore(struct brcmf_core *pub, u32 prereset, u32 reset, in brcmf_chip_resetcore() argument
1240 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1251 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1256 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1260 if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { in brcmf_chip_cm3_set_passive()
1261 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1271 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1277 chip->ops->activate(chip->ctx, &chip->pub, 0); in brcmf_chip_cm3_set_active()
1279 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1292 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cr4_set_passive()
1303 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_cr4_set_active()
1306 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1319 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_ca7_set_passive()
1330 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_ca7_set_active()
1333 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CA7); in brcmf_chip_ca7_set_active()
1339 void brcmf_chip_set_passive(struct brcmf_chip *pub) in brcmf_chip_set_passive() argument
1346 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_passive()
1347 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_passive()
1352 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_passive()
1357 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_passive()
1364 bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) in brcmf_chip_set_active() argument
1371 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_active()
1372 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_active()
1375 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_active()
1378 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_active()
1385 bool brcmf_chip_sr_capable(struct brcmf_chip *pub) in brcmf_chip_sr_capable() argument
1389 struct brcmf_core *pmu = brcmf_chip_get_pmu(pub); in brcmf_chip_sr_capable()
1394 if (pub->pmurev < 17) in brcmf_chip_sr_capable()
1397 base = brcmf_chip_get_chipcommon(pub)->base; in brcmf_chip_sr_capable()
1398 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_sr_capable()
1400 switch (pub->chip) { in brcmf_chip_sr_capable()