Lines Matching refs:imc
161 struct igen6_imc imc[NUM_IMC]; member
453 struct igen6_imc *imc = &igen6_pvt->imc[mc]; in adl_err_addr_to_imc_addr() local
460 mc_hash = readl(imc->window + MAD_MC_HASH_OFFSET); in adl_err_addr_to_imc_addr()
702 struct igen6_imc *imc = &igen6_pvt->imc[res->mc]; in igen6_decode() local
713 hash = readl(imc->window + CHANNEL_HASH_OFFSET); in igen6_decode()
714 s_size = imc->ch_s_size; in igen6_decode()
715 l_map = imc->ch_l_map; in igen6_decode()
721 hash = readl(imc->window + CHANNEL_EHASH_OFFSET); in igen6_decode()
722 s_size = imc->dimm_s_size[idx]; in igen6_decode()
723 l_map = imc->dimm_l_map[idx]; in igen6_decode()
784 static u64 ecclog_read_and_clear(struct igen6_imc *imc) in ecclog_read_and_clear() argument
786 u64 ecclog = readq(imc->window + ECC_ERROR_LOG_OFFSET); in ecclog_read_and_clear()
790 writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET); in ecclog_read_and_clear()
797 static void errsts_clear(struct igen6_imc *imc) in errsts_clear() argument
801 if (pci_read_config_word(imc->pdev, ERRSTS_OFFSET, &errsts)) { in errsts_clear()
808 pci_write_config_word(imc->pdev, ERRSTS_OFFSET, errsts); in errsts_clear()
813 struct igen6_imc *imc = &igen6_pvt->imc[0]; in errcmd_enable_error_reporting() local
817 rc = pci_read_config_word(imc->pdev, ERRCMD_OFFSET, &errcmd); in errcmd_enable_error_reporting()
826 rc = pci_write_config_word(imc->pdev, ERRCMD_OFFSET, errcmd); in errcmd_enable_error_reporting()
835 struct igen6_imc *imc; in ecclog_handler() local
840 imc = &igen6_pvt->imc[i]; in ecclog_handler()
844 ecclog = ecclog_read_and_clear(imc); in ecclog_handler()
880 mci = igen6_pvt->imc[res.mc].mci; in ecclog_work_cb()
898 errsts_clear(&igen6_pvt->imc[i]); in ecclog_irq_work_cb()
978 static bool igen6_check_ecc(struct igen6_imc *imc) in igen6_check_ecc() argument
980 u32 activate = readl(imc->window + IBECC_ACTIVATE_OFFSET); in igen6_check_ecc()
987 struct igen6_imc *imc = mci->pvt_info; in igen6_get_dimm_config() local
989 int i, j, ndimms, mc = imc->mc; in igen6_get_dimm_config()
998 mad_inter = readl(imc->window + MAD_INTER_CHANNEL_OFFSET); in igen6_get_dimm_config()
1000 ecc = igen6_check_ecc(imc); in igen6_get_dimm_config()
1001 imc->ch_s_size = MAD_INTER_CHANNEL_CH_S_SIZE(mad_inter); in igen6_get_dimm_config()
1002 imc->ch_l_map = MAD_INTER_CHANNEL_CH_L_MAP(mad_inter); in igen6_get_dimm_config()
1005 mad_intra = readl(imc->window + MAD_INTRA_CH0_OFFSET + i * 4); in igen6_get_dimm_config()
1006 mad_dimm = readl(imc->window + MAD_DIMM_CH0_OFFSET + i * 4); in igen6_get_dimm_config()
1008 imc->dimm_l_size[i] = MAD_DIMM_CH_DIMM_L_SIZE(mad_dimm); in igen6_get_dimm_config()
1009 imc->dimm_s_size[i] = MAD_DIMM_CH_DIMM_S_SIZE(mad_dimm); in igen6_get_dimm_config()
1010 imc->dimm_l_map[i] = MAD_INTRA_CH_DIMM_L_MAP(mad_intra); in igen6_get_dimm_config()
1011 imc->size += imc->dimm_s_size[i]; in igen6_get_dimm_config()
1012 imc->size += imc->dimm_l_size[i]; in igen6_get_dimm_config()
1018 if (j ^ imc->dimm_l_map[i]) { in igen6_get_dimm_config()
1020 dsize = imc->dimm_s_size[i]; in igen6_get_dimm_config()
1023 dsize = imc->dimm_l_size[i]; in igen6_get_dimm_config()
1048 edac_dbg(0, "MC %d, total size %llu MiB\n", mc, imc->size >> 20); in igen6_get_dimm_config()
1058 static void igen6_reg_dump(struct igen6_imc *imc) in igen6_reg_dump() argument
1063 readl(imc->window + CHANNEL_HASH_OFFSET)); in igen6_reg_dump()
1065 readl(imc->window + CHANNEL_EHASH_OFFSET)); in igen6_reg_dump()
1067 readl(imc->window + MAD_INTER_CHANNEL_OFFSET)); in igen6_reg_dump()
1069 readq(imc->window + ECC_ERROR_LOG_OFFSET)); in igen6_reg_dump()
1073 readl(imc->window + MAD_INTRA_CH0_OFFSET + i * 4)); in igen6_reg_dump()
1075 readl(imc->window + MAD_DIMM_CH0_OFFSET + i * 4)); in igen6_reg_dump()
1123 static void igen6_reg_dump(struct igen6_imc *imc) {} in igen6_reg_dump() argument
1183 struct igen6_imc *imc = mci->pvt_info; in igen6_check() local
1187 ecclog = ecclog_read_and_clear(imc); in igen6_check()
1191 if (!ecclog_gen_pool_add(imc->mc, ecclog)) in igen6_check()
1199 struct igen6_imc *imc; in igen6_register_mci() local
1238 mci->pvt_info = &igen6_pvt->imc[mc]; in igen6_register_mci()
1240 imc = mci->pvt_info; in igen6_register_mci()
1241 device_initialize(&imc->dev); in igen6_register_mci()
1252 mci->pdev = mc ? &imc->dev : &pdev->dev; in igen6_register_mci()
1253 imc->mc = mc; in igen6_register_mci()
1254 imc->pdev = pdev; in igen6_register_mci()
1255 imc->window = window; in igen6_register_mci()
1257 igen6_reg_dump(imc); in igen6_register_mci()
1269 imc->mci = mci; in igen6_register_mci()
1284 struct igen6_imc *imc; in igen6_unregister_mcis() local
1290 imc = &igen6_pvt->imc[i]; in igen6_unregister_mcis()
1291 mci = imc->mci; in igen6_unregister_mcis()
1299 iounmap(imc->window); in igen6_unregister_mcis()
1305 struct igen6_imc *imc = &igen6_pvt->imc[0]; in igen6_mem_slice_setup() local
1315 if (imc[0].size < imc[1].size) { in igen6_mem_slice_setup()
1316 ms_s_size = imc[0].size; in igen6_mem_slice_setup()
1319 ms_s_size = imc[1].size; in igen6_mem_slice_setup()