Lines Matching refs: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()
664 if (!brcmf_chip_iscoreup(&sysmem->pub)) in brcmf_chip_sysmem_ramsize()
665 brcmf_chip_resetcore(&sysmem->pub, 0, 0, 0); in brcmf_chip_sysmem_ramsize()
706 switch (ci->pub.chip) { in brcmf_chip_tcm_rambase()
730 return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; in brcmf_chip_tcm_rambase()
739 return ((ci->pub.chiprev < 9) ? 0x180000 : 0x160000); in brcmf_chip_tcm_rambase()
741 brcmf_err("unknown chip: %s\n", ci->pub.name); in brcmf_chip_tcm_rambase()
747 int brcmf_chip_get_raminfo(struct brcmf_chip *pub) in brcmf_chip_get_raminfo() argument
749 struct brcmf_chip_priv *ci = container_of(pub, struct brcmf_chip_priv, in brcmf_chip_get_raminfo()
750 pub); in brcmf_chip_get_raminfo()
754 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_get_raminfo()
756 mem_core = container_of(mem, struct brcmf_core_priv, pub); in brcmf_chip_get_raminfo()
757 ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); in brcmf_chip_get_raminfo()
758 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
759 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
764 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_SYS_MEM); in brcmf_chip_get_raminfo()
767 pub); in brcmf_chip_get_raminfo()
768 ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core); in brcmf_chip_get_raminfo()
769 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
770 if (ci->pub.rambase == INVALID_RAMBASE) { in brcmf_chip_get_raminfo()
775 mem = brcmf_chip_get_core(&ci->pub, in brcmf_chip_get_raminfo()
782 pub); in brcmf_chip_get_raminfo()
783 brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, in brcmf_chip_get_raminfo()
784 &ci->pub.srsize); in brcmf_chip_get_raminfo()
788 ci->pub.rambase, ci->pub.ramsize, ci->pub.ramsize, in brcmf_chip_get_raminfo()
789 ci->pub.srsize, ci->pub.srsize); in brcmf_chip_get_raminfo()
791 if (!ci->pub.ramsize) { in brcmf_chip_get_raminfo()
796 if (ci->pub.ramsize > BRCMF_CHIP_MAX_MEMSIZE) { in brcmf_chip_get_raminfo()
908 CORE_CC_REG(ci->pub.enum_base, eromptr)); in brcmf_chip_dmp_erom_scan()
974 CORE_CC_REG(ci->pub.enum_base, chipid)); in brcmf_chip_recognition()
975 ci->pub.chip = regdata & CID_ID_MASK; in brcmf_chip_recognition()
976 ci->pub.chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT; in brcmf_chip_recognition()
979 brcmf_chip_name(ci->pub.chip, ci->pub.chiprev, in brcmf_chip_recognition()
980 ci->pub.name, sizeof(ci->pub.name)); in brcmf_chip_recognition()
982 socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name); in brcmf_chip_recognition()
985 if (ci->pub.chip != BRCM_CC_4329_CHIP_ID) { in brcmf_chip_recognition()
1025 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1031 ci->ops->reset(ci->ctx, &ci->pub); in brcmf_chip_recognition()
1032 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
1035 return brcmf_chip_get_raminfo(&ci->pub); in brcmf_chip_recognition()
1045 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
1055 cpu = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
1071 struct brcmf_chip *pub; in brcmf_chip_setup() local
1078 pub = &chip->pub; in brcmf_chip_setup()
1080 base = cc->pub.base; in brcmf_chip_setup()
1083 pub->cc_caps = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1085 pub->cc_caps_ext = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
1090 pmu = brcmf_chip_get_pmu(pub); /* after reading cc_caps_ext */ in brcmf_chip_setup()
1091 if (pub->cc_caps & CC_CAP_PMU) { in brcmf_chip_setup()
1094 pub->pmurev = val & PCAP_REV_MASK; in brcmf_chip_setup()
1095 pub->pmucaps = val; in brcmf_chip_setup()
1099 cc->pub.rev, pub->pmurev, pub->pmucaps); in brcmf_chip_setup()
1103 ret = chip->ops->setup(chip->ctx, pub); in brcmf_chip_setup()
1133 chip->pub.enum_base = brcmf_chip_enum_base(devid); in brcmf_chip_attach()
1147 return &chip->pub; in brcmf_chip_attach()
1150 brcmf_chip_detach(&chip->pub); in brcmf_chip_attach()
1154 void brcmf_chip_detach(struct brcmf_chip *pub) in brcmf_chip_detach() argument
1160 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_detach()
1168 struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit) in brcmf_chip_get_d11core() argument
1173 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_d11core()
1175 if (core->pub.id == BCMA_CORE_80211) { in brcmf_chip_get_d11core()
1177 return &core->pub; in brcmf_chip_get_d11core()
1183 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) in brcmf_chip_get_core() argument
1188 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_core()
1190 if (core->pub.id == coreid) in brcmf_chip_get_core()
1191 return &core->pub; in brcmf_chip_get_core()
1196 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *pub) in brcmf_chip_get_chipcommon() argument
1201 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_chipcommon()
1203 if (WARN_ON(!cc || cc->pub.id != BCMA_CORE_CHIPCOMMON)) in brcmf_chip_get_chipcommon()
1204 return brcmf_chip_get_core(pub, BCMA_CORE_CHIPCOMMON); in brcmf_chip_get_chipcommon()
1205 return &cc->pub; in brcmf_chip_get_chipcommon()
1208 struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub) in brcmf_chip_get_pmu() argument
1210 struct brcmf_core *cc = brcmf_chip_get_chipcommon(pub); in brcmf_chip_get_pmu()
1215 pub->cc_caps_ext & BCMA_CC_CAP_EXT_AOB_PRESENT) { in brcmf_chip_get_pmu()
1216 pmu = brcmf_chip_get_core(pub, BCMA_CORE_PMU); in brcmf_chip_get_pmu()
1225 bool brcmf_chip_iscoreup(struct brcmf_core *pub) in brcmf_chip_iscoreup() argument
1229 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1233 void brcmf_chip_coredisable(struct brcmf_core *pub, u32 prereset, u32 reset) in brcmf_chip_coredisable() argument
1237 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1241 void brcmf_chip_resetcore(struct brcmf_core *pub, u32 prereset, u32 reset, in brcmf_chip_resetcore() argument
1246 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1257 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1262 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1266 if (chip->pub.chip == BRCM_CC_43430_CHIP_ID || in brcmf_chip_cm3_set_passive()
1267 chip->pub.chip == CY_CC_43439_CHIP_ID) { in brcmf_chip_cm3_set_passive()
1268 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1278 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1284 chip->ops->activate(chip->ctx, &chip->pub, 0); in brcmf_chip_cm3_set_active()
1286 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1299 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cr4_set_passive()
1310 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_cr4_set_active()
1313 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1326 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_ca7_set_passive()
1337 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_ca7_set_active()
1340 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CA7); in brcmf_chip_ca7_set_active()
1346 void brcmf_chip_set_passive(struct brcmf_chip *pub) in brcmf_chip_set_passive() argument
1353 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_passive()
1354 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_passive()
1359 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_passive()
1364 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_passive()
1371 bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) in brcmf_chip_set_active() argument
1378 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_active()
1379 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_active()
1382 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CA7); in brcmf_chip_set_active()
1385 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CM3); in brcmf_chip_set_active()
1392 bool brcmf_chip_sr_capable(struct brcmf_chip *pub) in brcmf_chip_sr_capable() argument
1396 struct brcmf_core *pmu = brcmf_chip_get_pmu(pub); in brcmf_chip_sr_capable()
1401 if (pub->pmurev < 17) in brcmf_chip_sr_capable()
1404 base = brcmf_chip_get_chipcommon(pub)->base; in brcmf_chip_sr_capable()
1405 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_sr_capable()
1407 switch (pub->chip) { in brcmf_chip_sr_capable()