Lines Matching refs:sys_addr
227 static bool amd64_base_limit_match(struct amd64_pvt *pvt, u64 sys_addr, in amd64_base_limit_match() argument
238 addr = sys_addr & 0x000000ffffffffffull; in amd64_base_limit_match()
251 u64 sys_addr) in find_mc_by_sys_addr() argument
272 if (amd64_base_limit_match(pvt, sys_addr, node_id)) in find_mc_by_sys_addr()
285 bits = (((u32) sys_addr) >> 12) & intlv_en; in find_mc_by_sys_addr()
296 if (unlikely(!amd64_base_limit_match(pvt, sys_addr, node_id))) { in find_mc_by_sys_addr()
299 __func__, sys_addr, node_id); in find_mc_by_sys_addr()
308 (unsigned long)sys_addr); in find_mc_by_sys_addr()
498 static u64 sys_addr_to_dram_addr(struct mem_ctl_info *mci, u64 sys_addr) in sys_addr_to_dram_addr() argument
509 if ((sys_addr >= (1ull << 32)) && in sys_addr_to_dram_addr()
510 (sys_addr < ((1ull << 32) + hole_size))) { in sys_addr_to_dram_addr()
512 dram_addr = sys_addr - hole_offset; in sys_addr_to_dram_addr()
516 (unsigned long)sys_addr, in sys_addr_to_dram_addr()
532 dram_addr = (sys_addr & GENMASK(0, 39)) - dram_base; in sys_addr_to_dram_addr()
535 "DramAddr 0x%lx\n", (unsigned long)sys_addr, in sys_addr_to_dram_addr()
583 static u64 sys_addr_to_input_addr(struct mem_ctl_info *mci, u64 sys_addr) in sys_addr_to_input_addr() argument
588 dram_addr_to_input_addr(mci, sys_addr_to_dram_addr(mci, sys_addr)); in sys_addr_to_input_addr()
591 (unsigned long)sys_addr, (unsigned long)input_addr); in sys_addr_to_input_addr()
649 u64 hole_base, hole_offset, hole_size, base, sys_addr; in dram_addr_to_sys_addr() local
657 sys_addr = dram_addr + hole_offset; in dram_addr_to_sys_addr()
661 (unsigned long)sys_addr); in dram_addr_to_sys_addr()
663 return sys_addr; in dram_addr_to_sys_addr()
668 sys_addr = dram_addr + base; in dram_addr_to_sys_addr()
681 sys_addr |= ~((sys_addr & (1ull << 39)) - 1); in dram_addr_to_sys_addr()
685 (unsigned long)sys_addr); in dram_addr_to_sys_addr()
687 return sys_addr; in dram_addr_to_sys_addr()
736 static int sys_addr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr) in sys_addr_to_csrow() argument
740 csrow = input_addr_to_csrow(mci, sys_addr_to_input_addr(mci, sys_addr)); in sys_addr_to_csrow()
744 "address 0x%lx\n", (unsigned long)sys_addr); in sys_addr_to_csrow()
1036 static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr, in k8_map_sysaddr_to_csrow() argument
1067 channel = ((sys_addr & BIT(3)) != 0); in k8_map_sysaddr_to_csrow()
1074 src_mci = find_mc_by_sys_addr(mci, sys_addr); in k8_map_sysaddr_to_csrow()
1077 (unsigned long)sys_addr); in k8_map_sysaddr_to_csrow()
1083 csrow = sys_addr_to_csrow(src_mci, sys_addr); in k8_map_sysaddr_to_csrow()
1087 error_address_to_page_and_offset(sys_addr, &page, &offset); in k8_map_sysaddr_to_csrow()
1262 static u8 f1x_determine_channel(struct amd64_pvt *pvt, u64 sys_addr, in f1x_determine_channel() argument
1281 return sys_addr >> 6 & 1; in f1x_determine_channel()
1285 u32 temp = hweight_long((u32) ((sys_addr >> 16) & 0x1F)) % 2; in f1x_determine_channel()
1287 return ((sys_addr >> shift) & 1) ^ temp; in f1x_determine_channel()
1290 return (sys_addr >> (12 + hweight8(intlv_en))) & 1; in f1x_determine_channel()
1301 u64 sys_addr, bool hi_rng, in f1x_get_norm_dct_addr() argument
1324 (sys_addr >= BIT_64(32))) in f1x_get_norm_dct_addr()
1338 if (dhar_valid(pvt) && (sys_addr >= BIT_64(32))) in f1x_get_norm_dct_addr()
1344 return (sys_addr & GENMASK(6,47)) - (chan_off & GENMASK(23,47)); in f1x_get_norm_dct_addr()
1422 static u64 f1x_swap_interleaved_region(struct amd64_pvt *pvt, u64 sys_addr) in f1x_swap_interleaved_region() argument
1431 return sys_addr; in f1x_swap_interleaved_region()
1437 return sys_addr; in f1x_swap_interleaved_region()
1442 tmp_addr = sys_addr >> 27; in f1x_swap_interleaved_region()
1444 if (!(sys_addr >> 34) && in f1x_swap_interleaved_region()
1448 return sys_addr ^ (u64)swap_base << 27; in f1x_swap_interleaved_region()
1450 return sys_addr; in f1x_swap_interleaved_region()
1455 u64 sys_addr, int *nid, int *chan_sel) in f1x_match_to_this_node() argument
1468 range, sys_addr, get_dram_limit(pvt, range)); in f1x_match_to_this_node()
1471 dhar_base(pvt) <= sys_addr && in f1x_match_to_this_node()
1472 sys_addr < BIT_64(32)) { in f1x_match_to_this_node()
1474 sys_addr); in f1x_match_to_this_node()
1478 if (intlv_en && (intlv_sel != ((sys_addr >> 12) & intlv_en))) in f1x_match_to_this_node()
1481 sys_addr = f1x_swap_interleaved_region(pvt, sys_addr); in f1x_match_to_this_node()
1491 ((sys_addr >> 27) >= (dct_sel_base >> 11))) in f1x_match_to_this_node()
1494 channel = f1x_determine_channel(pvt, sys_addr, high_range, intlv_en); in f1x_match_to_this_node()
1496 chan_addr = f1x_get_norm_dct_addr(pvt, range, sys_addr, in f1x_match_to_this_node()
1535 static int f1x_translate_sysaddr_to_cs(struct amd64_pvt *pvt, u64 sys_addr, in f1x_translate_sysaddr_to_cs() argument
1546 if ((get_dram_base(pvt, range) <= sys_addr) && in f1x_translate_sysaddr_to_cs()
1547 (get_dram_limit(pvt, range) >= sys_addr)) { in f1x_translate_sysaddr_to_cs()
1550 sys_addr, node, in f1x_translate_sysaddr_to_cs()
1566 static void f1x_map_sysaddr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr, in f1x_map_sysaddr_to_csrow() argument
1573 csrow = f1x_translate_sysaddr_to_cs(pvt, sys_addr, &nid, &chan); in f1x_map_sysaddr_to_csrow()
1580 error_address_to_page_and_offset(sys_addr, &page, &offset); in f1x_map_sysaddr_to_csrow()
1874 u64 sys_addr; in amd64_handle_ce() local
1884 sys_addr = get_error_address(m); in amd64_handle_ce()
1887 amd64_mc_err(mci, "CE ERROR_ADDRESS= 0x%llx\n", sys_addr); in amd64_handle_ce()
1889 pvt->ops->map_sysaddr_to_csrow(mci, sys_addr, syndrome); in amd64_handle_ce()
1897 u64 sys_addr; in amd64_handle_ue() local
1908 sys_addr = get_error_address(m); in amd64_handle_ue()
1914 src_mci = find_mc_by_sys_addr(mci, sys_addr); in amd64_handle_ue()
1917 (unsigned long)sys_addr); in amd64_handle_ue()
1924 csrow = sys_addr_to_csrow(log_mci, sys_addr); in amd64_handle_ue()
1927 (unsigned long)sys_addr); in amd64_handle_ue()
1930 error_address_to_page_and_offset(sys_addr, &page, &offset); in amd64_handle_ue()
2154 u64 input_addr_min, input_addr_max, sys_addr, base, mask; in init_csrows() local
2181 sys_addr = input_addr_to_sys_addr(mci, input_addr_min); in init_csrows()
2182 csrow->first_page = (u32) (sys_addr >> PAGE_SHIFT); in init_csrows()
2183 sys_addr = input_addr_to_sys_addr(mci, input_addr_max); in init_csrows()
2184 csrow->last_page = (u32) (sys_addr >> PAGE_SHIFT); in init_csrows()
2197 (unsigned long)sys_addr, csrow->page_mask); in init_csrows()