Lines Matching refs:mci
156 static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 bandwidth)
158 struct amd64_pvt *pvt = mci->pvt_info;
180 static int amd64_get_scrub_rate(struct mem_ctl_info *mci, u32 *bw)
182 struct amd64_pvt *pvt = mci->pvt_info;
279 static struct mem_ctl_info *find_mc_by_sys_addr(struct mem_ctl_info *mci,
290 pvt = mci->pvt_info;
379 * @input_addr is an InputAddr associated with the node given by mci. Return the
382 static int input_addr_to_csrow(struct mem_ctl_info *mci, u64 input_addr)
388 pvt = mci->pvt_info;
421 * represented by mci. This function returns the full 40-bit value despite the
425 static inline u64 get_dram_base(struct mem_ctl_info *mci)
427 struct amd64_pvt *pvt = mci->pvt_info;
434 * for the node represented by mci. Info is passed back in *hole_base,
448 int amd64_get_dram_hole_info(struct mem_ctl_info *mci, u64 *hole_base,
451 struct amd64_pvt *pvt = mci->pvt_info;
512 * assumed that sys_addr maps to the node given by mci.
539 static u64 sys_addr_to_dram_addr(struct mem_ctl_info *mci, u64 sys_addr)
544 dram_base = get_dram_base(mci);
546 ret = amd64_get_dram_hole_info(mci, &hole_base, &hole_offset,
596 static u64 dram_addr_to_input_addr(struct mem_ctl_info *mci, u64 dram_addr)
602 pvt = mci->pvt_info;
621 * assumed that @sys_addr maps to the node given by mci.
623 static u64 sys_addr_to_input_addr(struct mem_ctl_info *mci, u64 sys_addr)
628 dram_addr_to_input_addr(mci, sys_addr_to_dram_addr(mci, sys_addr));
638 * @input_addr is an InputAddr associated with the node represented by mci.
641 static u64 input_addr_to_dram_addr(struct mem_ctl_info *mci, u64 input_addr)
656 pvt = mci->pvt_info;
683 * @dram_addr is a DramAddr that maps to the node represented by mci. Convert
686 static u64 dram_addr_to_sys_addr(struct mem_ctl_info *mci, u64 dram_addr)
688 struct amd64_pvt *pvt = mci->pvt_info;
692 ret = amd64_get_dram_hole_info(mci, &hole_base, &hole_offset,
731 * @input_addr is an InputAddr associated with the node given by mci. Translate
734 static inline u64 input_addr_to_sys_addr(struct mem_ctl_info *mci,
737 return dram_addr_to_sys_addr(mci,
738 input_addr_to_dram_addr(mci, input_addr));
745 static void find_csrow_limits(struct mem_ctl_info *mci, int csrow,
751 pvt = mci->pvt_info;
772 * of a node that detected an ECC memory error. mci represents the node that
777 static int sys_addr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr)
781 csrow = input_addr_to_csrow(mci, sys_addr_to_input_addr(mci, sys_addr));
784 amd64_mc_printk(mci, KERN_ERR,
1068 static u64 k8_get_error_address(struct mem_ctl_info *mci,
1104 static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci,
1116 channel = get_channel_from_ecc_syndrome(mci, syndrome);
1123 amd64_mc_printk(mci, KERN_WARNING,
1126 edac_mc_handle_ce_no_info(mci, EDAC_MOD_STR);
1145 src_mci = find_mc_by_sys_addr(mci, sys_addr);
1147 amd64_mc_printk(mci, KERN_ERR,
1150 edac_mc_handle_ce_no_info(mci, EDAC_MOD_STR);
1276 static u64 f10_get_error_address(struct mem_ctl_info *mci,
1486 struct mem_ctl_info *mci;
1492 mci = mci_lookup[nid];
1493 if (!mci)
1496 pvt = mci->pvt_info;
1654 static void f10_map_sysaddr_to_csrow(struct mem_ctl_info *mci,
1658 struct amd64_pvt *pvt = mci->pvt_info;
1666 edac_mc_handle_ce_no_info(mci, EDAC_MOD_STR);
1680 chan = get_channel_from_ecc_syndrome(mci, syndrome);
1683 edac_mc_handle_ce(mci, page, offset, syndrome, csrow, chan,
1689 for (chan = 0; chan < mci->csrows[csrow].nr_channels; chan++)
1690 edac_mc_handle_ce(mci, page, offset, syndrome,
1952 static int get_channel_from_ecc_syndrome(struct mem_ctl_info *mci, u16 syndrome)
1954 struct amd64_pvt *pvt = mci->pvt_info;
1978 static void amd64_handle_ce(struct mem_ctl_info *mci,
1981 struct amd64_pvt *pvt = mci->pvt_info;
1986 amd64_mc_printk(mci, KERN_ERR,
1988 edac_mc_handle_ce_no_info(mci, EDAC_MOD_STR);
1992 sys_addr = pvt->ops->get_error_address(mci, info);
1994 amd64_mc_printk(mci, KERN_ERR,
1997 pvt->ops->map_sysaddr_to_csrow(mci, info, sys_addr);
2001 static void amd64_handle_ue(struct mem_ctl_info *mci,
2004 struct amd64_pvt *pvt = mci->pvt_info;
2010 log_mci = mci;
2013 amd64_mc_printk(mci, KERN_CRIT,
2019 sys_addr = pvt->ops->get_error_address(mci, info);
2025 src_mci = find_mc_by_sys_addr(mci, sys_addr);
2027 amd64_mc_printk(mci, KERN_CRIT,
2038 amd64_mc_printk(mci, KERN_CRIT,
2048 static inline void __amd64_decode_bus_error(struct mem_ctl_info *mci,
2064 amd64_handle_ce(mci, info);
2066 amd64_handle_ue(mci, info);
2071 struct mem_ctl_info *mci = mci_lookup[node_id];
2073 __amd64_decode_bus_error(mci, regs);
2076 edac_mc_handle_ue_no_info(mci, "UE bit is set");
2303 static int amd64_init_csrows(struct mem_ctl_info *mci)
2310 pvt = mci->pvt_info;
2320 csrow = &mci->csrows[i];
2333 find_csrow_limits(mci, i, &input_addr_min, &input_addr_max);
2334 sys_addr = input_addr_to_sys_addr(mci, input_addr_min);
2336 sys_addr = input_addr_to_sys_addr(mci, input_addr_max);
2452 static void amd64_enable_ecc_error_reporting(struct mem_ctl_info *mci)
2454 struct amd64_pvt *pvt = mci->pvt_info;
2585 static void amd64_set_mc_sysfs_attributes(struct mem_ctl_info *mci)
2597 mci->mc_driver_sysfs_attributes = sysfs_attrs;
2600 static void amd64_setup_mci_misc_attributes(struct mem_ctl_info *mci)
2602 struct amd64_pvt *pvt = mci->pvt_info;
2604 mci->mtype_cap = MEM_FLAG_DDR2 | MEM_FLAG_RDDR2;
2605 mci->edac_ctl_cap = EDAC_FLAG_NONE;
2608 mci->edac_ctl_cap |= EDAC_FLAG_SECDED;
2611 mci->edac_ctl_cap |= EDAC_FLAG_S4ECD4ED;
2613 mci->edac_cap = amd64_determine_edac_cap(pvt);
2614 mci->mod_name = EDAC_MOD_STR;
2615 mci->mod_ver = EDAC_AMD64_VERSION;
2616 mci->ctl_name = get_amd_family_name(pvt->mc_type_index);
2617 mci->dev_name = pci_name(pvt->dram_f2_ctl);
2618 mci->ctl_page_to_phys = NULL;
2621 mci->set_sdram_scrub_rate = amd64_set_scrub_rate;
2622 mci->get_sdram_scrub_rate = amd64_get_scrub_rate;
2702 struct mem_ctl_info *mci;
2710 * tables in the 'mci' structure
2717 mci = edac_mc_alloc(0, pvt->cs_count, pvt->channel_count, node_id);
2718 if (!mci)
2721 mci->pvt_info = pvt;
2723 mci->dev = &pvt->dram_f2_ctl->dev;
2724 amd64_setup_mci_misc_attributes(mci);
2726 if (amd64_init_csrows(mci))
2727 mci->edac_cap = EDAC_FLAG_NONE;
2729 amd64_enable_ecc_error_reporting(mci);
2730 amd64_set_mc_sysfs_attributes(mci);
2733 if (edac_mc_add_mc(mci)) {
2738 mci_lookup[node_id] = mci;
2750 edac_mc_free(mci);
2791 struct mem_ctl_info *mci;
2795 mci = edac_mc_del_mc(&pdev->dev);
2796 if (!mci)
2799 pvt = mci->pvt_info;
2813 mci->pvt_info = NULL;
2817 edac_mc_free(mci);
2866 struct mem_ctl_info *mci;
2872 mci = mci_lookup[0];
2873 if (mci) {
2875 pvt = mci->pvt_info;