Lines Matching refs:core
241 bool (*iscoreup)(struct brcmf_core_priv *core);
242 void (*coredisable)(struct brcmf_core_priv *core, u32 prereset,
244 void (*resetcore)(struct brcmf_core_priv *core, u32 prereset, u32 reset,
249 struct brcmf_core *core) in brcmf_chip_sb_corerev() argument
253 regdata = ci->ops->read32(ci->ctx, CORE_SB(core->base, sbidhigh)); in brcmf_chip_sb_corerev()
254 core->rev = SBCOREREV(regdata); in brcmf_chip_sb_corerev()
257 static bool brcmf_chip_sb_iscoreup(struct brcmf_core_priv *core) in brcmf_chip_sb_iscoreup() argument
263 ci = core->chip; in brcmf_chip_sb_iscoreup()
264 address = CORE_SB(core->pub.base, sbtmstatelow); in brcmf_chip_sb_iscoreup()
271 static bool brcmf_chip_ai_iscoreup(struct brcmf_core_priv *core) in brcmf_chip_ai_iscoreup() argument
277 ci = core->chip; in brcmf_chip_ai_iscoreup()
278 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_iscoreup()
281 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL); in brcmf_chip_ai_iscoreup()
287 static void brcmf_chip_sb_coredisable(struct brcmf_core_priv *core, in brcmf_chip_sb_coredisable() argument
293 ci = core->chip; in brcmf_chip_sb_coredisable()
294 base = core->pub.base; in brcmf_chip_sb_coredisable()
357 static void brcmf_chip_ai_coredisable(struct brcmf_core_priv *core, in brcmf_chip_ai_coredisable() argument
363 ci = core->chip; in brcmf_chip_ai_coredisable()
366 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL); in brcmf_chip_ai_coredisable()
371 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_coredisable()
373 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_coredisable()
376 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_RESET_CTL, in brcmf_chip_ai_coredisable()
381 SPINWAIT(ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) != in brcmf_chip_ai_coredisable()
386 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_coredisable()
388 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_coredisable()
391 static void brcmf_chip_sb_resetcore(struct brcmf_core_priv *core, u32 prereset, in brcmf_chip_sb_resetcore() argument
398 ci = core->chip; in brcmf_chip_sb_resetcore()
399 base = core->pub.base; in brcmf_chip_sb_resetcore()
404 brcmf_chip_sb_coredisable(core, 0, 0); in brcmf_chip_sb_resetcore()
441 static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset, in brcmf_chip_ai_resetcore() argument
447 ci = core->chip; in brcmf_chip_ai_resetcore()
450 brcmf_chip_ai_coredisable(core, prereset, reset); in brcmf_chip_ai_resetcore()
453 while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) & in brcmf_chip_ai_resetcore()
455 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_RESET_CTL, 0); in brcmf_chip_ai_resetcore()
462 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_resetcore()
464 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_resetcore()
480 struct brcmf_core_priv *core; in brcmf_chip_add_core() local
482 core = kzalloc(sizeof(*core), GFP_KERNEL); in brcmf_chip_add_core()
483 if (!core) in brcmf_chip_add_core()
486 core->pub.id = coreid; in brcmf_chip_add_core()
487 core->pub.base = base; in brcmf_chip_add_core()
488 core->chip = ci; in brcmf_chip_add_core()
489 core->wrapbase = wrapbase; in brcmf_chip_add_core()
491 list_add_tail(&core->list, &ci->cores); in brcmf_chip_add_core()
492 return &core->pub; in brcmf_chip_add_core()
498 struct brcmf_core_priv *core; in brcmf_chip_cores_check() local
504 list_for_each_entry(core, &ci->cores, list) { in brcmf_chip_cores_check()
506 idx++, core->pub.id, core->pub.rev, core->pub.base, in brcmf_chip_cores_check()
507 core->wrapbase); in brcmf_chip_cores_check()
509 switch (core->pub.id) { in brcmf_chip_cores_check()
540 static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) in brcmf_chip_core_read32() argument
542 return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); in brcmf_chip_core_read32()
545 static void brcmf_chip_core_write32(struct brcmf_core_priv *core, in brcmf_chip_core_write32() argument
548 core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); in brcmf_chip_core_write32()
551 static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, in brcmf_chip_socram_banksize() argument
558 brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); in brcmf_chip_socram_banksize()
559 bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); in brcmf_chip_socram_banksize()
840 struct brcmf_core *core; in brcmf_chip_dmp_erom_scan() local
887 core = brcmf_chip_add_core(ci, id, base, wrap); in brcmf_chip_dmp_erom_scan()
888 if (IS_ERR(core)) in brcmf_chip_dmp_erom_scan()
889 return PTR_ERR(core); in brcmf_chip_dmp_erom_scan()
891 core->rev = rev; in brcmf_chip_dmp_erom_scan()
899 struct brcmf_core *core; in brcmf_chip_recognition() local
928 core = brcmf_chip_add_core(ci, BCMA_CORE_CHIPCOMMON, in brcmf_chip_recognition()
930 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
931 core = brcmf_chip_add_core(ci, BCMA_CORE_SDIO_DEV, in brcmf_chip_recognition()
933 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
934 core = brcmf_chip_add_core(ci, BCMA_CORE_INTERNAL_MEM, in brcmf_chip_recognition()
936 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
937 core = brcmf_chip_add_core(ci, BCMA_CORE_ARM_CM3, in brcmf_chip_recognition()
939 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
941 core = brcmf_chip_add_core(ci, BCMA_CORE_80211, 0x18001000, 0); in brcmf_chip_recognition()
942 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
975 struct brcmf_core *core; in brcmf_chip_disable_arm() local
980 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
981 if (!core) in brcmf_chip_disable_arm()
986 brcmf_chip_coredisable(core, 0, 0); in brcmf_chip_disable_arm()
990 cpu = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
995 brcmf_chip_resetcore(core, val, ARMCR4_BCMA_IOCTL_CPUHALT, in brcmf_chip_disable_arm()
1086 struct brcmf_core_priv *core; in brcmf_chip_detach() local
1090 list_for_each_entry_safe(core, tmp, &chip->cores, list) { in brcmf_chip_detach()
1091 list_del(&core->list); in brcmf_chip_detach()
1092 kfree(core); in brcmf_chip_detach()
1100 struct brcmf_core_priv *core; in brcmf_chip_get_core() local
1103 list_for_each_entry(core, &chip->cores, list) in brcmf_chip_get_core()
1104 if (core->pub.id == coreid) in brcmf_chip_get_core()
1105 return &core->pub; in brcmf_chip_get_core()
1124 struct brcmf_core_priv *core; in brcmf_chip_iscoreup() local
1126 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1127 return core->chip->iscoreup(core); in brcmf_chip_iscoreup()
1132 struct brcmf_core_priv *core; in brcmf_chip_coredisable() local
1134 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1135 core->chip->coredisable(core, prereset, reset); in brcmf_chip_coredisable()
1141 struct brcmf_core_priv *core; in brcmf_chip_resetcore() local
1143 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1144 core->chip->resetcore(core, prereset, reset, postreset); in brcmf_chip_resetcore()
1150 struct brcmf_core *core; in brcmf_chip_cm3_set_passive() local
1154 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1155 brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | in brcmf_chip_cm3_set_passive()
1159 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1160 brcmf_chip_resetcore(core, 0, 0, 0); in brcmf_chip_cm3_set_passive()
1164 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1172 struct brcmf_core *core; in brcmf_chip_cm3_set_active() local
1174 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1175 if (!brcmf_chip_iscoreup(core)) { in brcmf_chip_cm3_set_active()
1182 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1183 brcmf_chip_resetcore(core, 0, 0, 0); in brcmf_chip_cm3_set_active()
1191 struct brcmf_core *core; in brcmf_chip_cr4_set_passive() local
1195 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cr4_set_passive()
1196 brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | in brcmf_chip_cr4_set_passive()
1204 struct brcmf_core *core; in brcmf_chip_cr4_set_active() local
1209 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1210 brcmf_chip_resetcore(core, ARMCR4_BCMA_IOCTL_CPUHALT, 0, 0); in brcmf_chip_cr4_set_active()
1218 struct brcmf_core *core; in brcmf_chip_ca7_set_passive() local
1222 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_ca7_set_passive()
1223 brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | in brcmf_chip_ca7_set_passive()
1231 struct brcmf_core *core; in brcmf_chip_ca7_set_active() local
1236 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CA7); in brcmf_chip_ca7_set_active()
1237 brcmf_chip_resetcore(core, ARMCR4_BCMA_IOCTL_CPUHALT, 0, 0); in brcmf_chip_ca7_set_active()