Lines Matching full:dct
102 * Select DCT to which PCI cfg accesses are routed
104 static void f15h_select_dct(struct amd64_pvt *pvt, u8 dct) in f15h_select_dct() argument
110 reg |= dct; in f15h_select_dct()
116 * Depending on the family, F2 DCT reads need special handling:
118 * K8: has a single DCT only and no address offsets >= 0x100
120 * F10h: each DCT has its own set of regs
124 * F16h: has only 1 DCT
126 * F15h: we select which DCT we access using F1x10C[DctCfgSel]
128 static inline int amd64_read_dct_pci_cfg(struct amd64_pvt *pvt, u8 dct, in amd64_read_dct_pci_cfg() argument
133 if (dct || offset >= 0x100) in amd64_read_dct_pci_cfg()
138 if (dct) { in amd64_read_dct_pci_cfg()
154 * We should select which DCT we access using F1x10C[DctCfgSel] in amd64_read_dct_pci_cfg()
156 dct = (dct && pvt->model == 0x30) ? 3 : dct; in amd64_read_dct_pci_cfg()
157 f15h_select_dct(pvt, dct); in amd64_read_dct_pci_cfg()
161 if (dct) in amd64_read_dct_pci_cfg()
397 * compute the CS base address of the @csrow on the DRAM controller @dct.
400 static void get_cs_base_and_mask(struct amd64_pvt *pvt, int csrow, u8 dct, in get_cs_base_and_mask() argument
407 csbase = pvt->csels[dct].csbases[csrow]; in get_cs_base_and_mask()
408 csmask = pvt->csels[dct].csmasks[csrow]; in get_cs_base_and_mask()
419 csbase = pvt->csels[dct].csbases[csrow]; in get_cs_base_and_mask()
420 csmask = pvt->csels[dct].csmasks[csrow >> 1]; in get_cs_base_and_mask()
435 csbase = pvt->csels[dct].csbases[csrow]; in get_cs_base_and_mask()
436 csmask = pvt->csels[dct].csmasks[csrow >> 1]; in get_cs_base_and_mask()
456 #define for_each_chip_select(i, dct, pvt) \ argument
457 for (i = 0; i < pvt->csels[dct].b_cnt; i++)
459 #define chip_select_base(i, dct, pvt) \ argument
460 pvt->csels[dct].csbases[i]
462 #define for_each_chip_select_mask(i, dct, pvt) \ argument
463 for (i = 0; i < pvt->csels[dct].m_cnt; i++)
1329 * It's assumed all LRDIMMs in a DCT are going to be of in debug_dump_dramcfg_low()
1344 edac_dbg(1, " DCT 128bit mode width: %s\n", in debug_dump_dramcfg_low()
1704 * 'Rank' value on a DCT. But this is not the common case. So, in determine_memory_type()
1735 /* Get the number of DCT channels the memory controller is using. */
1957 static int k8_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct, in k8_dbam_to_chip_select() argument
1960 u32 dclr = dct ? pvt->dclr1 : pvt->dclr0; in k8_dbam_to_chip_select()
2005 * Get the number of DCT channels in use.
2124 static int f10_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct, in f10_dbam_to_chip_select() argument
2127 u32 dclr = dct ? pvt->dclr1 : pvt->dclr0; in f10_dbam_to_chip_select()
2138 * F15h supports only 64bit DCT interfaces
2140 static int f15_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct, in f15_dbam_to_chip_select() argument
2149 static int f15_m60h_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct, in f15_m60h_dbam_to_chip_select() argument
2153 u32 dcsm = pvt->csels[dct].csmasks[cs_mask_nr]; in f15_m60h_dbam_to_chip_select()
2182 static int f16_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct, in f16_dbam_to_chip_select() argument
2286 edac_dbg(0, " Address range split per DCT: %s\n", in read_dram_ctl_register()
2303 * Determine channel (DCT) based on the interleaving mode (see F15h M30h BKDG,
2334 * Determine channel (DCT) based on the interleaving mode: F10h BKDG, 2.8.9 Memory
2354 /* return DCT select function: 0=DCT0, 1=DCT1 */ in f1x_determine_channel()
2380 /* Convert the sys_addr to the normalized DCT address */
2395 * DRAM address space on this DCT is hoisted above 4Gb && in f1x_get_norm_dct_addr()
2417 * remove dram base to normalize to DCT address in f1x_get_norm_dct_addr()
2432 static int f10_process_possible_spare(struct amd64_pvt *pvt, u8 dct, int csrow) in f10_process_possible_spare() argument
2436 if (online_spare_swap_done(pvt, dct) && in f10_process_possible_spare()
2437 csrow == online_spare_bad_dramcs(pvt, dct)) { in f10_process_possible_spare()
2439 for_each_chip_select(tmp_cs, dct, pvt) { in f10_process_possible_spare()
2440 if (chip_select_base(tmp_cs, dct, pvt) & 0x2) { in f10_process_possible_spare()
2450 * Iterate over the DRAM DCT "base" and "mask" registers looking for a
2457 static int f1x_lookup_addr_in_dct(u64 in_addr, u8 nid, u8 dct) in f1x_lookup_addr_in_dct() argument
2471 edac_dbg(1, "input addr: 0x%llx, DCT: %d\n", in_addr, dct); in f1x_lookup_addr_in_dct()
2473 for_each_chip_select(csrow, dct, pvt) { in f1x_lookup_addr_in_dct()
2474 if (!csrow_enabled(csrow, dct, pvt)) in f1x_lookup_addr_in_dct()
2477 get_cs_base_and_mask(pvt, csrow, dct, &cs_base, &cs_mask); in f1x_lookup_addr_in_dct()
2492 cs_found = f10_process_possible_spare(pvt, dct, csrow); in f1x_lookup_addr_in_dct()
2606 edac_dbg(1, " Normalized DCT addr: 0x%llx\n", chan_addr); in f1x_match_to_this_node()
2652 /* Verify sys_addr is within DCT Range. */ in f15_m30h_match_to_this_node()
2661 /* Verify number of dct's that participate in channel interleaving. */ in f15_m30h_match_to_this_node()
2679 /* Get normalized DCT addr */ in f15_m30h_match_to_this_node()
2718 edac_dbg(1, " Normalized DCT addr: 0x%llx\n", chan_addr); in f15_m30h_match_to_this_node()
2723 * there is support for 4 DCT's, but only 2 are currently functional. in f15_m30h_match_to_this_node()
2767 * a @sys_addr to NodeID, DCT (channel) and chip select (CSROW).
2825 edac_printk(KERN_DEBUG, EDAC_MC, "DCT%d chip selects:\n", ctrl); in debug_display_dimm_sizes()
3318 * F1 (AddrMap) and F2 (Dct) devices. Return negative value on error.
3357 /* Reserve the DCT Device */ in reserve_mc_sibling_devs()
3561 static u32 get_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr_orig) in get_csrow_nr_pages() argument
3563 u32 dbam = dct ? pvt->dbam1 : pvt->dbam0; in get_csrow_nr_pages()
3571 cs_mode = f17_get_cs_mode(csrow_nr >> 1, dct, pvt); in get_csrow_nr_pages()
3574 nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode, csrow_nr); in get_csrow_nr_pages()
3578 csrow_nr_orig, dct, cs_mode); in get_csrow_nr_pages()
3677 /* K8 has only one DCT */ in init_csrows()
3705 /* get all cores on this DCT */
4181 int cs = 0, dct = 0; in instance_has_memory() local
4183 for (dct = 0; dct < fam_type->max_mcs; dct++) { in instance_has_memory()
4184 for_each_chip_select(cs, dct, pvt) in instance_has_memory()
4185 cs_enabled |= csrow_enabled(cs, dct, pvt); in instance_has_memory()