Lines Matching refs:ctx

42 struct cmn_skeena_ctx *ctx;  variable
56 const struct mod_cmn_skeena_config *config = ctx->config; in process_node_hnf()
69 is_cal_mode_supported(ctx->root)) { in process_node_hnf()
77 ctx->hnf_count--; in process_node_hnf()
92 if (config->hnf_cal_mode == true && is_cal_mode_supported(ctx->root)) { in process_node_hnf()
94 ctx->hnf_cache_group[group] += ((uint64_t)get_node_id(hnf)) in process_node_hnf()
97 ctx->hnf_cache_group[group] += ((uint64_t)get_node_id(hnf)) << bit_pos; in process_node_hnf()
102 if (ctx->chip_id != 0) { in process_node_hnf()
103 base_offset = ((uint64_t)(ctx->config->chip_addr_space * ctx->chip_id)); in process_node_hnf()
193 const struct mod_cmn_skeena_config *config = ctx->config; in cmn_skeena_discovery()
197 fwk_assert(get_node_type(ctx->root) == NODE_TYPE_CFG); in cmn_skeena_discovery()
200 xp_count = get_node_child_count(ctx->root); in cmn_skeena_discovery()
202 xp = get_child_node(config->base, ctx->root, xp_idx); in cmn_skeena_discovery()
231 ctx->cxla_reg = (void *)node; in cmn_skeena_discovery()
236 ctx->external_rnsam_count++; in cmn_skeena_discovery()
244 if (ctx->hnf_count >= MAX_HNF_COUNT) { in cmn_skeena_discovery()
247 ctx->hnf_count, in cmn_skeena_discovery()
251 ctx->hnf_offset[ctx->hnf_count++] = (uint32_t)node; in cmn_skeena_discovery()
255 ctx->internal_rnsam_count++; in cmn_skeena_discovery()
259 if (ctx->rnd_count >= MAX_RND_COUNT) { in cmn_skeena_discovery()
262 ctx->rnd_count, in cmn_skeena_discovery()
266 ctx->rnd_ldid[ctx->rnd_count++] = get_node_logical_id(node); in cmn_skeena_discovery()
270 if (ctx->rni_count >= MAX_RNI_COUNT) { in cmn_skeena_discovery()
273 ctx->rni_count, in cmn_skeena_discovery()
277 ctx->rni_ldid[ctx->rni_count++] = get_node_logical_id(node); in cmn_skeena_discovery()
281 ctx->cxg_ra_reg = (struct cmn_skeena_cxg_ra_reg *)node; in cmn_skeena_discovery()
285 ctx->cxg_ha_reg = (struct cmn_skeena_cxg_ha_reg *)node; in cmn_skeena_discovery()
286 ctx->ccix_host_info.host_ha_count++; in cmn_skeena_discovery()
309 ctx->rnf_count = ctx->internal_rnsam_count + ctx->external_rnsam_count - in cmn_skeena_discovery()
310 (ctx->rnd_count + ctx->rni_count + ctx->ccix_host_info.host_ha_count); in cmn_skeena_discovery()
312 if (ctx->rnf_count > MAX_RNF_COUNT) { in cmn_skeena_discovery()
315 ctx->rnf_count, in cmn_skeena_discovery()
321 if ((ctx->hnf_count % 2 != 0) && (config->hnf_cal_mode == true)) { in cmn_skeena_discovery()
324 ctx->hnf_count); in cmn_skeena_discovery()
329 MOD_NAME "Total internal RN-SAM nodes: %d", ctx->internal_rnsam_count); in cmn_skeena_discovery()
331 MOD_NAME "Total external RN-SAM nodes: %d", ctx->external_rnsam_count); in cmn_skeena_discovery()
332 FWK_LOG_INFO(MOD_NAME "Total HN-F nodes: %d", ctx->hnf_count); in cmn_skeena_discovery()
333 FWK_LOG_INFO(MOD_NAME "Total RN-F nodes: %d", ctx->rnf_count); in cmn_skeena_discovery()
334 FWK_LOG_INFO(MOD_NAME "Total RN-D nodes: %d", ctx->rnd_count); in cmn_skeena_discovery()
335 FWK_LOG_INFO(MOD_NAME "Total RN-I nodes: %d", ctx->rni_count); in cmn_skeena_discovery()
337 if (ctx->cxla_reg != NULL) { in cmn_skeena_discovery()
338 FWK_LOG_INFO(MOD_NAME "CCIX CXLA node at: %p", (void *)ctx->cxla_reg); in cmn_skeena_discovery()
340 if (ctx->cxg_ra_reg != NULL) { in cmn_skeena_discovery()
341 FWK_LOG_INFO(MOD_NAME "CCIX CXRA node at: %p", (void *)ctx->cxg_ra_reg); in cmn_skeena_discovery()
343 if (ctx->cxg_ha_reg != NULL) { in cmn_skeena_discovery()
344 FWK_LOG_INFO(MOD_NAME "CCIX CXHA node at: %p", (void *)ctx->cxg_ha_reg); in cmn_skeena_discovery()
360 const struct mod_cmn_skeena_config *config = ctx->config; in cmn_skeena_configure()
362 fwk_assert(get_node_type(ctx->root) == NODE_TYPE_CFG); in cmn_skeena_configure()
368 xp_count = get_node_child_count(ctx->root); in cmn_skeena_configure()
370 xp = get_child_node(config->base, ctx->root, xp_idx); in cmn_skeena_configure()
388 fwk_assert(xrnsam_entry < ctx->external_rnsam_count); in cmn_skeena_configure()
390 ctx->external_rnsam_table[xrnsam_entry].node_id = node_id; in cmn_skeena_configure()
391 ctx->external_rnsam_table[xrnsam_entry].node = node; in cmn_skeena_configure()
398 fwk_assert(irnsam_entry < ctx->internal_rnsam_count); in cmn_skeena_configure()
400 ctx->internal_rnsam_table[irnsam_entry] = node; in cmn_skeena_configure()
435 const struct mod_cmn_skeena_config *config = ctx->config; in cmn_skeena_setup_sam()
452 if (ctx->chip_id != 0) { in cmn_skeena_setup_sam()
459 ((uint64_t)(ctx->config->chip_addr_space * ctx->chip_id) + in cmn_skeena_setup_sam()
637 group_count = cmn_skeena_hnf_cache_group_count(ctx->hnf_count); in cmn_skeena_setup_sam()
639 rnsam->SYS_CACHE_GRP_HN_NODEID0[group] = ctx->hnf_cache_group[group]; in cmn_skeena_setup_sam()
642 rnsam->SYS_CACHE_GRP_HN_COUNT = ctx->hnf_count; in cmn_skeena_setup_sam()
645 if (is_cal_mode_supported(ctx->root) && config->hnf_cal_mode) { in cmn_skeena_setup_sam()
664 if (!ctx->initialized) { in cmn_skeena_setup()
673 if (ctx->internal_rnsam_count != 0) { in cmn_skeena_setup()
674 ctx->internal_rnsam_table = fwk_mm_calloc( in cmn_skeena_setup()
675 ctx->internal_rnsam_count, sizeof(*ctx->internal_rnsam_table)); in cmn_skeena_setup()
679 if (ctx->external_rnsam_count != 0) { in cmn_skeena_setup()
680 ctx->external_rnsam_table = fwk_mm_calloc( in cmn_skeena_setup()
681 ctx->external_rnsam_count, sizeof(*ctx->external_rnsam_table)); in cmn_skeena_setup()
685 if (ctx->hnf_count != 0) { in cmn_skeena_setup()
690 ctx->hnf_cache_group = fwk_mm_calloc( in cmn_skeena_setup()
691 cmn_skeena_hnf_cache_group_count(ctx->hnf_count), in cmn_skeena_setup()
692 sizeof(*ctx->hnf_cache_group)); in cmn_skeena_setup()
699 for (rnsam_idx = 0; rnsam_idx < ctx->internal_rnsam_count; rnsam_idx++) in cmn_skeena_setup()
700 cmn_skeena_setup_sam(ctx->internal_rnsam_table[rnsam_idx]); in cmn_skeena_setup()
703 for (i = 0; i < ctx->config->mmap_count; i++) { in cmn_skeena_setup()
704 if (ctx->config->mmap_table[i].type == in cmn_skeena_setup()
706 ccix_mmap_idx = ctx->ccix_host_info.ccix_host_mmap_count; in cmn_skeena_setup()
710 ctx->ccix_host_info.ccix_host_mmap[ccix_mmap_idx].base = in cmn_skeena_setup()
711 ctx->config->mmap_table[i].base; in cmn_skeena_setup()
712 ctx->ccix_host_info.ccix_host_mmap[ccix_mmap_idx].size = in cmn_skeena_setup()
713 ctx->config->mmap_table[i].size; in cmn_skeena_setup()
714 ctx->ccix_host_info.ccix_host_mmap_count++; in cmn_skeena_setup()
720 ctx->initialized = true; in cmn_skeena_setup()
729 for (node_idx = 0; node_idx < ctx->external_rnsam_count; node_idx++) { in cmn_skeena_setup_rnsam()
730 if (ctx->external_rnsam_table[node_idx].node_id == node_id) { in cmn_skeena_setup_rnsam()
731 cmn_skeena_setup_sam(ctx->external_rnsam_table[node_idx].node); in cmn_skeena_setup_rnsam()
761 if (ctx->internal_rnsam_count == 0) in cmn_skeena_ccix_config_get()
764 ctx->ccix_host_info.host_ra_count = in cmn_skeena_ccix_config_get()
765 ctx->internal_rnsam_count + ctx->external_rnsam_count; in cmn_skeena_ccix_config_get()
766 ctx->ccix_host_info.host_sa_count = ctx->config->sa_count; in cmn_skeena_ccix_config_get()
768 ccix_capabilities_get(ctx); in cmn_skeena_ccix_config_get()
772 (void *)&ctx->ccix_host_info, in cmn_skeena_ccix_config_get()
783 status = ccix_setup(ctx, config); in cmn_skeena_ccix_config_set()
787 for (i = 0; i < ctx->config->mmap_count; i++) { in cmn_skeena_ccix_config_set()
788 if (ctx->config->mmap_table[i].type == MOD_CMN_SKEENA_REGION_TYPE_CCIX) in cmn_skeena_ccix_config_set()
789 cmn_skeena_setup_rnsam(ctx->config->mmap_table[i].node_id); in cmn_skeena_ccix_config_set()
796 return ccix_exchange_protocol_credit(ctx, link_id); in cmn_skeena_ccix_exchange_protocol_credit()
801 return ccix_enter_system_coherency(ctx, link_id); in cmn_skeena_ccix_enter_system_coherency()
806 return ccix_enter_dvm_domain(ctx, link_id); in cmn_skeena_ccix_enter_dvm_domain()
834 ctx = fwk_mm_calloc(1, sizeof(*ctx)); in cmn_skeena_init()
850 ctx->root = get_root_node( in cmn_skeena_init()
856 ctx->config = config; in cmn_skeena_init()
871 &ctx->timer_api); in cmn_skeena_bind()
911 if (fwk_id_is_equal(ctx->config->clock_id, FWK_ID_NONE)) { in cmn_skeena_start()
916 status = system_info_api->get_system_info(&ctx->system_info); in cmn_skeena_start()
918 chip_id = ctx->system_info->chip_id; in cmn_skeena_start()
919 mc_mode = ctx->system_info->multi_chip_mode; in cmn_skeena_start()
922 ctx->chip_id = chip_id; in cmn_skeena_start()
930 mod_clock_notification_id_state_changed, ctx->config->clock_id, id); in cmn_skeena_start()