Lines Matching refs:core
237 bool (*iscoreup)(struct brcmf_core_priv *core);
238 void (*coredisable)(struct brcmf_core_priv *core, u32 prereset,
240 void (*resetcore)(struct brcmf_core_priv *core, u32 prereset, u32 reset,
245 struct brcmf_core *core) in brcmf_chip_sb_corerev() argument
249 regdata = ci->ops->read32(ci->ctx, CORE_SB(core->base, sbidhigh)); in brcmf_chip_sb_corerev()
250 core->rev = SBCOREREV(regdata); in brcmf_chip_sb_corerev()
253 static bool brcmf_chip_sb_iscoreup(struct brcmf_core_priv *core) in brcmf_chip_sb_iscoreup() argument
259 ci = core->chip; in brcmf_chip_sb_iscoreup()
260 address = CORE_SB(core->pub.base, sbtmstatelow); in brcmf_chip_sb_iscoreup()
267 static bool brcmf_chip_ai_iscoreup(struct brcmf_core_priv *core) in brcmf_chip_ai_iscoreup() argument
273 ci = core->chip; in brcmf_chip_ai_iscoreup()
274 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_iscoreup()
277 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL); in brcmf_chip_ai_iscoreup()
283 static void brcmf_chip_sb_coredisable(struct brcmf_core_priv *core, in brcmf_chip_sb_coredisable() argument
289 ci = core->chip; in brcmf_chip_sb_coredisable()
290 base = core->pub.base; in brcmf_chip_sb_coredisable()
353 static void brcmf_chip_ai_coredisable(struct brcmf_core_priv *core, in brcmf_chip_ai_coredisable() argument
359 ci = core->chip; in brcmf_chip_ai_coredisable()
362 regdata = ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL); in brcmf_chip_ai_coredisable()
367 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_coredisable()
369 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_coredisable()
372 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_RESET_CTL, in brcmf_chip_ai_coredisable()
377 SPINWAIT(ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) != in brcmf_chip_ai_coredisable()
382 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_coredisable()
384 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_coredisable()
387 static void brcmf_chip_sb_resetcore(struct brcmf_core_priv *core, u32 prereset, in brcmf_chip_sb_resetcore() argument
394 ci = core->chip; in brcmf_chip_sb_resetcore()
395 base = core->pub.base; in brcmf_chip_sb_resetcore()
400 brcmf_chip_sb_coredisable(core, 0, 0); in brcmf_chip_sb_resetcore()
437 static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset, in brcmf_chip_ai_resetcore() argument
443 ci = core->chip; in brcmf_chip_ai_resetcore()
446 brcmf_chip_ai_coredisable(core, prereset, reset); in brcmf_chip_ai_resetcore()
449 while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) & in brcmf_chip_ai_resetcore()
451 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_RESET_CTL, 0); in brcmf_chip_ai_resetcore()
458 ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, in brcmf_chip_ai_resetcore()
460 ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); in brcmf_chip_ai_resetcore()
476 struct brcmf_core_priv *core; in brcmf_chip_add_core() local
478 core = kzalloc(sizeof(*core), GFP_KERNEL); in brcmf_chip_add_core()
479 if (!core) in brcmf_chip_add_core()
482 core->pub.id = coreid; in brcmf_chip_add_core()
483 core->pub.base = base; in brcmf_chip_add_core()
484 core->chip = ci; in brcmf_chip_add_core()
485 core->wrapbase = wrapbase; in brcmf_chip_add_core()
487 list_add_tail(&core->list, &ci->cores); in brcmf_chip_add_core()
488 return &core->pub; in brcmf_chip_add_core()
494 struct brcmf_core_priv *core; in brcmf_chip_cores_check() local
500 list_for_each_entry(core, &ci->cores, list) { in brcmf_chip_cores_check()
502 idx++, core->pub.id, core->pub.rev, core->pub.base, in brcmf_chip_cores_check()
503 core->wrapbase); in brcmf_chip_cores_check()
505 switch (core->pub.id) { in brcmf_chip_cores_check()
533 static u32 brcmf_chip_core_read32(struct brcmf_core_priv *core, u16 reg) in brcmf_chip_core_read32() argument
535 return core->chip->ops->read32(core->chip->ctx, core->pub.base + reg); in brcmf_chip_core_read32()
538 static void brcmf_chip_core_write32(struct brcmf_core_priv *core, in brcmf_chip_core_write32() argument
541 core->chip->ops->write32(core->chip->ctx, core->pub.base + reg, val); in brcmf_chip_core_write32()
544 static bool brcmf_chip_socram_banksize(struct brcmf_core_priv *core, u8 idx, in brcmf_chip_socram_banksize() argument
551 brcmf_chip_core_write32(core, SOCRAMREGOFFS(bankidx), bankidx); in brcmf_chip_socram_banksize()
552 bankinfo = brcmf_chip_core_read32(core, SOCRAMREGOFFS(bankinfo)); in brcmf_chip_socram_banksize()
780 struct brcmf_core *core; in brcmf_chip_dmp_erom_scan() local
827 core = brcmf_chip_add_core(ci, id, base, wrap); in brcmf_chip_dmp_erom_scan()
828 if (IS_ERR(core)) in brcmf_chip_dmp_erom_scan()
829 return PTR_ERR(core); in brcmf_chip_dmp_erom_scan()
831 core->rev = rev; in brcmf_chip_dmp_erom_scan()
839 struct brcmf_core *core; in brcmf_chip_recognition() local
868 core = brcmf_chip_add_core(ci, BCMA_CORE_CHIPCOMMON, in brcmf_chip_recognition()
870 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
871 core = brcmf_chip_add_core(ci, BCMA_CORE_SDIO_DEV, in brcmf_chip_recognition()
873 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
874 core = brcmf_chip_add_core(ci, BCMA_CORE_INTERNAL_MEM, in brcmf_chip_recognition()
876 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
877 core = brcmf_chip_add_core(ci, BCMA_CORE_ARM_CM3, in brcmf_chip_recognition()
879 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
881 core = brcmf_chip_add_core(ci, BCMA_CORE_80211, 0x18001000, 0); in brcmf_chip_recognition()
882 brcmf_chip_sb_corerev(ci, core); in brcmf_chip_recognition()
906 struct brcmf_core *core; in brcmf_chip_disable_arm() local
911 core = brcmf_chip_get_core(&chip->pub, id); in brcmf_chip_disable_arm()
912 if (!core) in brcmf_chip_disable_arm()
917 brcmf_chip_coredisable(core, 0, 0); in brcmf_chip_disable_arm()
920 cr4 = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_disable_arm()
925 brcmf_chip_resetcore(core, val, ARMCR4_BCMA_IOCTL_CPUHALT, in brcmf_chip_disable_arm()
1016 struct brcmf_core_priv *core; in brcmf_chip_detach() local
1020 list_for_each_entry_safe(core, tmp, &chip->cores, list) { in brcmf_chip_detach()
1021 list_del(&core->list); in brcmf_chip_detach()
1022 kfree(core); in brcmf_chip_detach()
1030 struct brcmf_core_priv *core; in brcmf_chip_get_core() local
1033 list_for_each_entry(core, &chip->cores, list) 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()
1054 struct brcmf_core_priv *core; in brcmf_chip_iscoreup() local
1056 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_iscoreup()
1057 return core->chip->iscoreup(core); in brcmf_chip_iscoreup()
1062 struct brcmf_core_priv *core; in brcmf_chip_coredisable() local
1064 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_coredisable()
1065 core->chip->coredisable(core, prereset, reset); in brcmf_chip_coredisable()
1071 struct brcmf_core_priv *core; in brcmf_chip_resetcore() local
1073 core = container_of(pub, struct brcmf_core_priv, pub); in brcmf_chip_resetcore()
1074 core->chip->resetcore(core, prereset, reset, postreset); in brcmf_chip_resetcore()
1080 struct brcmf_core *core; in brcmf_chip_cm3_set_passive() local
1084 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cm3_set_passive()
1085 brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | in brcmf_chip_cm3_set_passive()
1089 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_passive()
1090 brcmf_chip_resetcore(core, 0, 0, 0); in brcmf_chip_cm3_set_passive()
1094 sr = container_of(core, struct brcmf_core_priv, pub); in brcmf_chip_cm3_set_passive()
1102 struct brcmf_core *core; in brcmf_chip_cm3_set_active() local
1104 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_INTERNAL_MEM); in brcmf_chip_cm3_set_active()
1105 if (!brcmf_chip_iscoreup(core)) { in brcmf_chip_cm3_set_active()
1112 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CM3); in brcmf_chip_cm3_set_active()
1113 brcmf_chip_resetcore(core, 0, 0, 0); in brcmf_chip_cm3_set_active()
1121 struct brcmf_core *core; in brcmf_chip_cr4_set_passive() local
1125 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); in brcmf_chip_cr4_set_passive()
1126 brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | in brcmf_chip_cr4_set_passive()
1134 struct brcmf_core *core; in brcmf_chip_cr4_set_active() local
1139 core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_ARM_CR4); in brcmf_chip_cr4_set_active()
1140 brcmf_chip_resetcore(core, ARMCR4_BCMA_IOCTL_CPUHALT, 0, 0); in brcmf_chip_cr4_set_active()