Lines Matching refs:pub
223 struct brcmf_core pub; member
230 struct brcmf_chip pub; member
260 address = CORE_SB(core->pub.base, sbtmstatelow); in brcmf_chip_sb_iscoreup()
290 base = core->pub.base; in brcmf_chip_sb_coredisable()
395 base = core->pub.base; in brcmf_chip_sb_resetcore()
482 core->pub.id = coreid; in brcmf_chip_add_core()
483 core->pub.base = base; in brcmf_chip_add_core()
488 return &core->pub; in brcmf_chip_add_core()
502 idx++, core->pub.id, core->pub.rev, core->pub.base, in brcmf_chip_cores_check()
505 switch (core->pub.id) { in brcmf_chip_cores_check()
535 return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); in brcmf_chip_core_read32()
541 core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); in brcmf_chip_core_write32()
569 if (WARN_ON(sr->pub.rev < 4)) in brcmf_chip_socram_ramsize()
572 if (!brcmf_chip_iscoreup(&sr->pub)) in brcmf_chip_socram_ramsize()
573 brcmf_chip_resetcore(&sr->pub, 0, 0, 0); in brcmf_chip_socram_ramsize()
579 if ((sr->pub.rev <= 7) || (sr->pub.rev == 12)) { in brcmf_chip_socram_ramsize()
598 switch (sr->chip->pub.chip) { in brcmf_chip_socram_ramsize()
600 if (sr->chip->pub.chiprev < 2) in brcmf_chip_socram_ramsize()
642 switch (ci->pub.chip) { in brcmf_chip_tcm_rambase()
655 brcmf_err("unknown chip: %s\n", ci->pub.name); in brcmf_chip_tcm_rambase()
666 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_get_raminfo()
668 mem_core = container_of(mem, struct brcmf_core_priv, pub); in brcmf_chip_get_raminfo()
669 ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core); in brcmf_chip_get_raminfo()
670 ci->pub.rambase = brcmf_chip_tcm_rambase(ci); in brcmf_chip_get_raminfo()
671 if (!ci->pub.rambase) { in brcmf_chip_get_raminfo()
676 mem = brcmf_chip_get_core(&ci->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_get_raminfo()
677 mem_core = container_of(mem, struct brcmf_core_priv, pub); in brcmf_chip_get_raminfo()
678 brcmf_chip_socram_ramsize(mem_core, &ci->pub.ramsize, in brcmf_chip_get_raminfo()
679 &ci->pub.srsize); in brcmf_chip_get_raminfo()
682 ci->pub.rambase, ci->pub.ramsize, ci->pub.ramsize, in brcmf_chip_get_raminfo()
683 ci->pub.srsize, ci->pub.srsize); in brcmf_chip_get_raminfo()
685 if (!ci->pub.ramsize) { in brcmf_chip_get_raminfo()
850 ci->pub.chip = regdata & CID_ID_MASK; in brcmf_chip_recognition()
851 ci->pub.chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT; in brcmf_chip_recognition()
854 brcmf_chip_name(ci->pub.chip, ci->pub.name, sizeof(ci->pub.name)); in brcmf_chip_recognition()
856 socitype == SOCI_SB ? "SB" : "AXI", ci->pub.name, in brcmf_chip_recognition()
857 ci->pub.chiprev); in brcmf_chip_recognition()
860 if (ci->pub.chip != BRCM_CC_4329_CHIP_ID) { in brcmf_chip_recognition()
900 brcmf_chip_set_passive(&ci->pub); in brcmf_chip_recognition()
911 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
920 cr4 = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
936 struct brcmf_chip *pub; in brcmf_chip_setup() local
942 pub = &chip->pub; in brcmf_chip_setup()
944 base = cc->pub.base; in brcmf_chip_setup()
947 pub->cc_caps = chip->ops->read32(chip->ctx, in brcmf_chip_setup()
951 if (pub->cc_caps & CC_CAP_PMU) { in brcmf_chip_setup()
954 pub->pmurev = val & PCAP_REV_MASK; in brcmf_chip_setup()
955 pub->pmucaps = val; in brcmf_chip_setup()
959 cc->pub.rev, pub->pmurev, pub->pmucaps); in brcmf_chip_setup()
963 ret = chip->ops->setup(chip->ctx, pub); in brcmf_chip_setup()
1006 return &chip->pub; in brcmf_chip_attach()
1009 brcmf_chip_detach(&chip->pub); in brcmf_chip_attach()
1013 void brcmf_chip_detach(struct brcmf_chip *pub) in brcmf_chip_detach() argument
1019 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_detach()
1027 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) in brcmf_chip_get_core() argument
1032 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_core()
1034 if (core->pub.id == coreid) in brcmf_chip_get_core()
1035 return &core->pub; in brcmf_chip_get_core()
1040 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *pub) in brcmf_chip_get_chipcommon() argument
1045 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_get_chipcommon()
1047 if (WARN_ON(!cc || cc->pub.id != BCMA_CORE_CHIPCOMMON)) in brcmf_chip_get_chipcommon()
1048 return brcmf_chip_get_core(pub, BCMA_CORE_CHIPCOMMON); in brcmf_chip_get_chipcommon()
1049 return &cc->pub; in brcmf_chip_get_chipcommon()
1052 bool brcmf_chip_iscoreup(struct brcmf_core *pub) in brcmf_chip_iscoreup() argument
1056 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1060 void brcmf_chip_coredisable(struct brcmf_core *pub, u32 prereset, u32 reset) in brcmf_chip_coredisable() argument
1064 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1068 void brcmf_chip_resetcore(struct brcmf_core *pub, u32 prereset, u32 reset, in brcmf_chip_resetcore() argument
1073 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1084 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1089 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1093 if (chip->pub.chip == BRCM_CC_43430_CHIP_ID) { in brcmf_chip_cm3_set_passive()
1094 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1104 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1110 chip->ops->activate(chip->ctx, &chip->pub, 0); in brcmf_chip_cm3_set_active()
1112 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1125 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cr4_set_passive()
1136 chip->ops->activate(chip->ctx, &chip->pub, rstvec); in brcmf_chip_cr4_set_active()
1139 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1145 void brcmf_chip_set_passive(struct brcmf_chip *pub) in brcmf_chip_set_passive() argument
1152 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_passive()
1153 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_passive()
1162 bool brcmf_chip_set_active(struct brcmf_chip *pub, u32 rstvec) in brcmf_chip_set_active() argument
1169 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_set_active()
1170 arm = brcmf_chip_get_core(pub, BCMA_CORE_ARM_CR4); in brcmf_chip_set_active()
1177 bool brcmf_chip_sr_capable(struct brcmf_chip *pub) in brcmf_chip_sr_capable() argument
1185 if (pub->pmurev < 17) in brcmf_chip_sr_capable()
1188 base = brcmf_chip_get_chipcommon(pub)->base; in brcmf_chip_sr_capable()
1189 chip = container_of(pub, struct brcmf_chip_priv, pub); in brcmf_chip_sr_capable()
1191 switch (pub->chip) { in brcmf_chip_sr_capable()