Lines Matching refs:mci
367 static int i5100_rank_to_slot(const struct mem_ctl_info *mci, in i5100_rank_to_slot() argument
370 const struct i5100_priv *priv = mci->pvt_info; in i5100_rank_to_slot()
421 static int i5100_csrow_to_rank(const struct mem_ctl_info *mci, int csrow) in i5100_csrow_to_rank() argument
423 const struct i5100_priv *priv = mci->pvt_info; in i5100_csrow_to_rank()
429 static int i5100_csrow_to_chan(const struct mem_ctl_info *mci, int csrow) in i5100_csrow_to_chan() argument
431 const struct i5100_priv *priv = mci->pvt_info; in i5100_csrow_to_chan()
436 static void i5100_handle_ce(struct mem_ctl_info *mci, in i5100_handle_ce() argument
452 edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, in i5100_handle_ce()
458 static void i5100_handle_ue(struct mem_ctl_info *mci, in i5100_handle_ue() argument
474 edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, in i5100_handle_ue()
480 static void i5100_read_log(struct mem_ctl_info *mci, int chan, in i5100_read_log() argument
483 struct i5100_priv *priv = mci->pvt_info; in i5100_read_log()
523 i5100_handle_ce(mci, chan, bank, rank, syndrome, cas, ras, msg); in i5100_read_log()
545 i5100_handle_ue(mci, chan, bank, rank, syndrome, cas, ras, msg); in i5100_read_log()
551 static void i5100_check_error(struct mem_ctl_info *mci) in i5100_check_error() argument
553 struct i5100_priv *priv = mci->pvt_info; in i5100_check_error()
561 i5100_read_log(mci, i5100_ferr_nf_mem_chan_indx(dw), in i5100_check_error()
603 static int i5100_set_scrub_rate(struct mem_ctl_info *mci, u32 bandwidth) in i5100_set_scrub_rate() argument
605 struct i5100_priv *priv = mci->pvt_info; in i5100_set_scrub_rate()
628 static int i5100_get_scrub_rate(struct mem_ctl_info *mci) in i5100_get_scrub_rate() argument
630 struct i5100_priv *priv = mci->pvt_info; in i5100_get_scrub_rate()
657 static unsigned long i5100_npages(struct mem_ctl_info *mci, int csrow) in i5100_npages() argument
659 struct i5100_priv *priv = mci->pvt_info; in i5100_npages()
660 const unsigned chan_rank = i5100_csrow_to_rank(mci, csrow); in i5100_npages()
661 const unsigned chan = i5100_csrow_to_chan(mci, csrow); in i5100_npages()
678 static void i5100_init_mtr(struct mem_ctl_info *mci) in i5100_init_mtr() argument
680 struct i5100_priv *priv = mci->pvt_info; in i5100_init_mtr()
710 static int i5100_read_spd_byte(const struct mem_ctl_info *mci, in i5100_read_spd_byte() argument
713 struct i5100_priv *priv = mci->pvt_info; in i5100_read_spd_byte()
750 static void i5100_init_dimm_csmap(struct mem_ctl_info *mci) in i5100_init_dimm_csmap() argument
752 struct i5100_priv *priv = mci->pvt_info; in i5100_init_dimm_csmap()
781 struct mem_ctl_info *mci) in i5100_init_dimm_layout() argument
783 struct i5100_priv *priv = mci->pvt_info; in i5100_init_dimm_layout()
792 if (i5100_read_spd_byte(mci, i, j, 5, &rank) < 0) in i5100_init_dimm_layout()
799 i5100_init_dimm_csmap(mci); in i5100_init_dimm_layout()
803 struct mem_ctl_info *mci) in i5100_init_interleaving() argument
807 struct i5100_priv *priv = mci->pvt_info; in i5100_init_interleaving()
845 i5100_init_mtr(mci); in i5100_init_interleaving()
848 static void i5100_init_csrows(struct mem_ctl_info *mci) in i5100_init_csrows() argument
851 struct i5100_priv *priv = mci->pvt_info; in i5100_init_csrows()
853 for (i = 0; i < mci->tot_dimms; i++) { in i5100_init_csrows()
855 const unsigned long npages = i5100_npages(mci, i); in i5100_init_csrows()
856 const unsigned chan = i5100_csrow_to_chan(mci, i); in i5100_init_csrows()
857 const unsigned rank = i5100_csrow_to_rank(mci, i); in i5100_init_csrows()
862 dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms, mci->n_layers, in i5100_init_csrows()
872 i5100_rank_to_slot(mci, chan, rank)); in i5100_init_csrows()
883 static void i5100_do_inject(struct mem_ctl_info *mci) in i5100_do_inject() argument
885 struct i5100_priv *priv = mci->pvt_info; in i5100_do_inject()
948 struct mem_ctl_info *mci = to_mci(dev); in inject_enable_write() local
950 i5100_do_inject(mci); in inject_enable_write()
961 static int i5100_setup_debugfs(struct mem_ctl_info *mci) in i5100_setup_debugfs() argument
963 struct i5100_priv *priv = mci->pvt_info; in i5100_setup_debugfs()
968 priv->debugfs = edac_debugfs_create_dir_at(mci->bus->name, i5100_debugfs); in i5100_setup_debugfs()
986 &mci->dev, &i5100_inject_enable_fops); in i5100_setup_debugfs()
995 struct mem_ctl_info *mci; in i5100_init_one() local
1063 mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, in i5100_init_one()
1065 if (!mci) { in i5100_init_one()
1086 mci->pdev = &pdev->dev; in i5100_init_one()
1088 priv = mci->pvt_info; in i5100_init_one()
1105 i5100_init_dimm_layout(pdev, mci); in i5100_init_one()
1106 i5100_init_interleaving(pdev, mci); in i5100_init_one()
1108 mci->mtype_cap = MEM_FLAG_FB_DDR2; in i5100_init_one()
1109 mci->edac_ctl_cap = EDAC_FLAG_SECDED; in i5100_init_one()
1110 mci->edac_cap = EDAC_FLAG_SECDED; in i5100_init_one()
1111 mci->mod_name = "i5100_edac.c"; in i5100_init_one()
1112 mci->mod_ver = "not versioned"; in i5100_init_one()
1113 mci->ctl_name = "i5100"; in i5100_init_one()
1114 mci->dev_name = pci_name(pdev); in i5100_init_one()
1115 mci->ctl_page_to_phys = NULL; in i5100_init_one()
1117 mci->edac_check = i5100_check_error; in i5100_init_one()
1118 mci->set_sdram_scrub_rate = i5100_set_scrub_rate; in i5100_init_one()
1119 mci->get_sdram_scrub_rate = i5100_get_scrub_rate; in i5100_init_one()
1128 i5100_init_csrows(mci); in i5100_init_one()
1140 if (edac_mc_add_mc(mci)) { in i5100_init_one()
1145 i5100_setup_debugfs(mci); in i5100_init_one()
1152 edac_mc_free(mci); in i5100_init_one()
1181 struct mem_ctl_info *mci; in i5100_remove_one() local
1184 mci = edac_mc_del_mc(&pdev->dev); in i5100_remove_one()
1186 if (!mci) in i5100_remove_one()
1189 priv = mci->pvt_info; in i5100_remove_one()
1204 edac_mc_free(mci); in i5100_remove_one()