1*2025cf9eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 25c71ad17STony Luck /* 35c71ad17STony Luck * Register bitfield descriptions for Pondicherry2 memory controller. 45c71ad17STony Luck * 55c71ad17STony Luck * Copyright (c) 2016, Intel Corporation. 65c71ad17STony Luck */ 75c71ad17STony Luck 85c71ad17STony Luck #ifndef _PND2_REGS_H 95c71ad17STony Luck #define _PND2_REGS_H 105c71ad17STony Luck 115c71ad17STony Luck struct b_cr_touud_lo_pci { 125c71ad17STony Luck u32 lock : 1; 135c71ad17STony Luck u32 reserved_1 : 19; 145c71ad17STony Luck u32 touud : 12; 155c71ad17STony Luck }; 165c71ad17STony Luck 175c71ad17STony Luck #define b_cr_touud_lo_pci_port 0x4c 185c71ad17STony Luck #define b_cr_touud_lo_pci_offset 0xa8 195c71ad17STony Luck #define b_cr_touud_lo_pci_r_opcode 0x04 205c71ad17STony Luck 215c71ad17STony Luck struct b_cr_touud_hi_pci { 225c71ad17STony Luck u32 touud : 7; 235c71ad17STony Luck u32 reserved_0 : 25; 245c71ad17STony Luck }; 255c71ad17STony Luck 265c71ad17STony Luck #define b_cr_touud_hi_pci_port 0x4c 275c71ad17STony Luck #define b_cr_touud_hi_pci_offset 0xac 285c71ad17STony Luck #define b_cr_touud_hi_pci_r_opcode 0x04 295c71ad17STony Luck 305c71ad17STony Luck struct b_cr_tolud_pci { 315c71ad17STony Luck u32 lock : 1; 325c71ad17STony Luck u32 reserved_0 : 19; 335c71ad17STony Luck u32 tolud : 12; 345c71ad17STony Luck }; 355c71ad17STony Luck 365c71ad17STony Luck #define b_cr_tolud_pci_port 0x4c 375c71ad17STony Luck #define b_cr_tolud_pci_offset 0xbc 385c71ad17STony Luck #define b_cr_tolud_pci_r_opcode 0x04 395c71ad17STony Luck 405c71ad17STony Luck struct b_cr_mchbar_lo_pci { 415c71ad17STony Luck u32 enable : 1; 425c71ad17STony Luck u32 pad_3_1 : 3; 435c71ad17STony Luck u32 pad_14_4: 11; 445c71ad17STony Luck u32 base: 17; 455c71ad17STony Luck }; 465c71ad17STony Luck 475c71ad17STony Luck struct b_cr_mchbar_hi_pci { 485c71ad17STony Luck u32 base : 7; 495c71ad17STony Luck u32 pad_31_7 : 25; 505c71ad17STony Luck }; 515c71ad17STony Luck 525c71ad17STony Luck /* Symmetric region */ 535c71ad17STony Luck struct b_cr_slice_channel_hash { 545c71ad17STony Luck u64 slice_1_disabled : 1; 555c71ad17STony Luck u64 hvm_mode : 1; 565c71ad17STony Luck u64 interleave_mode : 2; 575c71ad17STony Luck u64 slice_0_mem_disabled : 1; 585c71ad17STony Luck u64 reserved_0 : 1; 595c71ad17STony Luck u64 slice_hash_mask : 14; 605c71ad17STony Luck u64 reserved_1 : 11; 615c71ad17STony Luck u64 enable_pmi_dual_data_mode : 1; 625c71ad17STony Luck u64 ch_1_disabled : 1; 635c71ad17STony Luck u64 reserved_2 : 1; 645c71ad17STony Luck u64 sym_slice0_channel_enabled : 2; 655c71ad17STony Luck u64 sym_slice1_channel_enabled : 2; 665c71ad17STony Luck u64 ch_hash_mask : 14; 675c71ad17STony Luck u64 reserved_3 : 11; 685c71ad17STony Luck u64 lock : 1; 695c71ad17STony Luck }; 705c71ad17STony Luck 715c71ad17STony Luck #define b_cr_slice_channel_hash_port 0x4c 725c71ad17STony Luck #define b_cr_slice_channel_hash_offset 0x4c58 735c71ad17STony Luck #define b_cr_slice_channel_hash_r_opcode 0x06 745c71ad17STony Luck 755c71ad17STony Luck struct b_cr_mot_out_base_mchbar { 765c71ad17STony Luck u32 reserved_0 : 14; 775c71ad17STony Luck u32 mot_out_base : 15; 785c71ad17STony Luck u32 reserved_1 : 1; 795c71ad17STony Luck u32 tr_en : 1; 805c71ad17STony Luck u32 imr_en : 1; 815c71ad17STony Luck }; 825c71ad17STony Luck 835c71ad17STony Luck #define b_cr_mot_out_base_mchbar_port 0x4c 845c71ad17STony Luck #define b_cr_mot_out_base_mchbar_offset 0x6af0 855c71ad17STony Luck #define b_cr_mot_out_base_mchbar_r_opcode 0x00 865c71ad17STony Luck 875c71ad17STony Luck struct b_cr_mot_out_mask_mchbar { 885c71ad17STony Luck u32 reserved_0 : 14; 895c71ad17STony Luck u32 mot_out_mask : 15; 905c71ad17STony Luck u32 reserved_1 : 1; 915c71ad17STony Luck u32 ia_iwb_en : 1; 925c71ad17STony Luck u32 gt_iwb_en : 1; 935c71ad17STony Luck }; 945c71ad17STony Luck 955c71ad17STony Luck #define b_cr_mot_out_mask_mchbar_port 0x4c 965c71ad17STony Luck #define b_cr_mot_out_mask_mchbar_offset 0x6af4 975c71ad17STony Luck #define b_cr_mot_out_mask_mchbar_r_opcode 0x00 985c71ad17STony Luck 995c71ad17STony Luck struct b_cr_asym_mem_region0_mchbar { 1005c71ad17STony Luck u32 pad : 4; 1015c71ad17STony Luck u32 slice0_asym_base : 11; 1025c71ad17STony Luck u32 pad_18_15 : 4; 1035c71ad17STony Luck u32 slice0_asym_limit : 11; 1045c71ad17STony Luck u32 slice0_asym_channel_select : 1; 1055c71ad17STony Luck u32 slice0_asym_enable : 1; 1065c71ad17STony Luck }; 1075c71ad17STony Luck 1085c71ad17STony Luck #define b_cr_asym_mem_region0_mchbar_port 0x4c 1095c71ad17STony Luck #define b_cr_asym_mem_region0_mchbar_offset 0x6e40 1105c71ad17STony Luck #define b_cr_asym_mem_region0_mchbar_r_opcode 0x00 1115c71ad17STony Luck 1125c71ad17STony Luck struct b_cr_asym_mem_region1_mchbar { 1135c71ad17STony Luck u32 pad : 4; 1145c71ad17STony Luck u32 slice1_asym_base : 11; 1155c71ad17STony Luck u32 pad_18_15 : 4; 1165c71ad17STony Luck u32 slice1_asym_limit : 11; 1175c71ad17STony Luck u32 slice1_asym_channel_select : 1; 1185c71ad17STony Luck u32 slice1_asym_enable : 1; 1195c71ad17STony Luck }; 1205c71ad17STony Luck 1215c71ad17STony Luck #define b_cr_asym_mem_region1_mchbar_port 0x4c 1225c71ad17STony Luck #define b_cr_asym_mem_region1_mchbar_offset 0x6e44 1235c71ad17STony Luck #define b_cr_asym_mem_region1_mchbar_r_opcode 0x00 1245c71ad17STony Luck 1255c71ad17STony Luck /* Some bit fields moved in above two structs on Denverton */ 1265c71ad17STony Luck struct b_cr_asym_mem_region_denverton { 1275c71ad17STony Luck u32 pad : 4; 1285c71ad17STony Luck u32 slice_asym_base : 8; 1295c71ad17STony Luck u32 pad_19_12 : 8; 1305c71ad17STony Luck u32 slice_asym_limit : 8; 1315c71ad17STony Luck u32 pad_28_30 : 3; 1325c71ad17STony Luck u32 slice_asym_enable : 1; 1335c71ad17STony Luck }; 1345c71ad17STony Luck 1355c71ad17STony Luck struct b_cr_asym_2way_mem_region_mchbar { 1365c71ad17STony Luck u32 pad : 2; 1375c71ad17STony Luck u32 asym_2way_intlv_mode : 2; 1385c71ad17STony Luck u32 asym_2way_base : 11; 1395c71ad17STony Luck u32 pad_16_15 : 2; 1405c71ad17STony Luck u32 asym_2way_limit : 11; 1415c71ad17STony Luck u32 pad_30_28 : 3; 1425c71ad17STony Luck u32 asym_2way_interleave_enable : 1; 1435c71ad17STony Luck }; 1445c71ad17STony Luck 1455c71ad17STony Luck #define b_cr_asym_2way_mem_region_mchbar_port 0x4c 1465c71ad17STony Luck #define b_cr_asym_2way_mem_region_mchbar_offset 0x6e50 1475c71ad17STony Luck #define b_cr_asym_2way_mem_region_mchbar_r_opcode 0x00 1485c71ad17STony Luck 1495c71ad17STony Luck /* Apollo Lake d-unit */ 1505c71ad17STony Luck 1515c71ad17STony Luck struct d_cr_drp0 { 1525c71ad17STony Luck u32 rken0 : 1; 1535c71ad17STony Luck u32 rken1 : 1; 1545c71ad17STony Luck u32 ddmen : 1; 1555c71ad17STony Luck u32 rsvd3 : 1; 1565c71ad17STony Luck u32 dwid : 2; 1575c71ad17STony Luck u32 dden : 3; 1585c71ad17STony Luck u32 rsvd13_9 : 5; 1595c71ad17STony Luck u32 rsien : 1; 1605c71ad17STony Luck u32 bahen : 1; 1615c71ad17STony Luck u32 rsvd18_16 : 3; 1625c71ad17STony Luck u32 caswizzle : 2; 1635c71ad17STony Luck u32 eccen : 1; 1645c71ad17STony Luck u32 dramtype : 3; 1655c71ad17STony Luck u32 blmode : 3; 1665c71ad17STony Luck u32 addrdec : 2; 1675c71ad17STony Luck u32 dramdevice_pr : 2; 1685c71ad17STony Luck }; 1695c71ad17STony Luck 1705c71ad17STony Luck #define d_cr_drp0_offset 0x1400 1715c71ad17STony Luck #define d_cr_drp0_r_opcode 0x00 1725c71ad17STony Luck 1735c71ad17STony Luck /* Denverton d-unit */ 1745c71ad17STony Luck 1755c71ad17STony Luck struct d_cr_dsch { 1765c71ad17STony Luck u32 ch0en : 1; 1775c71ad17STony Luck u32 ch1en : 1; 1785c71ad17STony Luck u32 ddr4en : 1; 1795c71ad17STony Luck u32 coldwake : 1; 1805c71ad17STony Luck u32 newbypdis : 1; 1815c71ad17STony Luck u32 chan_width : 1; 1825c71ad17STony Luck u32 rsvd6_6 : 1; 1835c71ad17STony Luck u32 ooodis : 1; 1845c71ad17STony Luck u32 rsvd18_8 : 11; 1855c71ad17STony Luck u32 ic : 1; 1865c71ad17STony Luck u32 rsvd31_20 : 12; 1875c71ad17STony Luck }; 1885c71ad17STony Luck 1895c71ad17STony Luck #define d_cr_dsch_port 0x16 1905c71ad17STony Luck #define d_cr_dsch_offset 0x0 1915c71ad17STony Luck #define d_cr_dsch_r_opcode 0x0 1925c71ad17STony Luck 1935c71ad17STony Luck struct d_cr_ecc_ctrl { 1945c71ad17STony Luck u32 eccen : 1; 1955c71ad17STony Luck u32 rsvd31_1 : 31; 1965c71ad17STony Luck }; 1975c71ad17STony Luck 1985c71ad17STony Luck #define d_cr_ecc_ctrl_offset 0x180 1995c71ad17STony Luck #define d_cr_ecc_ctrl_r_opcode 0x0 2005c71ad17STony Luck 2015c71ad17STony Luck struct d_cr_drp { 2025c71ad17STony Luck u32 rken0 : 1; 2035c71ad17STony Luck u32 rken1 : 1; 2045c71ad17STony Luck u32 rken2 : 1; 2055c71ad17STony Luck u32 rken3 : 1; 2065c71ad17STony Luck u32 dimmdwid0 : 2; 2075c71ad17STony Luck u32 dimmdden0 : 2; 2085c71ad17STony Luck u32 dimmdwid1 : 2; 2095c71ad17STony Luck u32 dimmdden1 : 2; 2105c71ad17STony Luck u32 rsvd15_12 : 4; 2115c71ad17STony Luck u32 dimmflip : 1; 2125c71ad17STony Luck u32 rsvd31_17 : 15; 2135c71ad17STony Luck }; 2145c71ad17STony Luck 2155c71ad17STony Luck #define d_cr_drp_offset 0x158 2165c71ad17STony Luck #define d_cr_drp_r_opcode 0x0 2175c71ad17STony Luck 2185c71ad17STony Luck struct d_cr_dmap { 2195c71ad17STony Luck u32 ba0 : 5; 2205c71ad17STony Luck u32 ba1 : 5; 2215c71ad17STony Luck u32 bg0 : 5; /* if ddr3, ba2 = bg0 */ 2225c71ad17STony Luck u32 bg1 : 5; /* if ddr3, ba3 = bg1 */ 2235c71ad17STony Luck u32 rs0 : 5; 2245c71ad17STony Luck u32 rs1 : 5; 2255c71ad17STony Luck u32 rsvd : 2; 2265c71ad17STony Luck }; 2275c71ad17STony Luck 2285c71ad17STony Luck #define d_cr_dmap_offset 0x174 2295c71ad17STony Luck #define d_cr_dmap_r_opcode 0x0 2305c71ad17STony Luck 2315c71ad17STony Luck struct d_cr_dmap1 { 2325c71ad17STony Luck u32 ca11 : 6; 2335c71ad17STony Luck u32 bxor : 1; 2345c71ad17STony Luck u32 rsvd : 25; 2355c71ad17STony Luck }; 2365c71ad17STony Luck 2375c71ad17STony Luck #define d_cr_dmap1_offset 0xb4 2385c71ad17STony Luck #define d_cr_dmap1_r_opcode 0x0 2395c71ad17STony Luck 2405c71ad17STony Luck struct d_cr_dmap2 { 2415c71ad17STony Luck u32 row0 : 5; 2425c71ad17STony Luck u32 row1 : 5; 2435c71ad17STony Luck u32 row2 : 5; 2445c71ad17STony Luck u32 row3 : 5; 2455c71ad17STony Luck u32 row4 : 5; 2465c71ad17STony Luck u32 row5 : 5; 2475c71ad17STony Luck u32 rsvd : 2; 2485c71ad17STony Luck }; 2495c71ad17STony Luck 2505c71ad17STony Luck #define d_cr_dmap2_offset 0x148 2515c71ad17STony Luck #define d_cr_dmap2_r_opcode 0x0 2525c71ad17STony Luck 2535c71ad17STony Luck struct d_cr_dmap3 { 2545c71ad17STony Luck u32 row6 : 5; 2555c71ad17STony Luck u32 row7 : 5; 2565c71ad17STony Luck u32 row8 : 5; 2575c71ad17STony Luck u32 row9 : 5; 2585c71ad17STony Luck u32 row10 : 5; 2595c71ad17STony Luck u32 row11 : 5; 2605c71ad17STony Luck u32 rsvd : 2; 2615c71ad17STony Luck }; 2625c71ad17STony Luck 2635c71ad17STony Luck #define d_cr_dmap3_offset 0x14c 2645c71ad17STony Luck #define d_cr_dmap3_r_opcode 0x0 2655c71ad17STony Luck 2665c71ad17STony Luck struct d_cr_dmap4 { 2675c71ad17STony Luck u32 row12 : 5; 2685c71ad17STony Luck u32 row13 : 5; 2695c71ad17STony Luck u32 row14 : 5; 2705c71ad17STony Luck u32 row15 : 5; 2715c71ad17STony Luck u32 row16 : 5; 2725c71ad17STony Luck u32 row17 : 5; 2735c71ad17STony Luck u32 rsvd : 2; 2745c71ad17STony Luck }; 2755c71ad17STony Luck 2765c71ad17STony Luck #define d_cr_dmap4_offset 0x150 2775c71ad17STony Luck #define d_cr_dmap4_r_opcode 0x0 2785c71ad17STony Luck 2795c71ad17STony Luck struct d_cr_dmap5 { 2805c71ad17STony Luck u32 ca3 : 4; 2815c71ad17STony Luck u32 ca4 : 4; 2825c71ad17STony Luck u32 ca5 : 4; 2835c71ad17STony Luck u32 ca6 : 4; 2845c71ad17STony Luck u32 ca7 : 4; 2855c71ad17STony Luck u32 ca8 : 4; 2865c71ad17STony Luck u32 ca9 : 4; 2875c71ad17STony Luck u32 rsvd : 4; 2885c71ad17STony Luck }; 2895c71ad17STony Luck 2905c71ad17STony Luck #define d_cr_dmap5_offset 0x154 2915c71ad17STony Luck #define d_cr_dmap5_r_opcode 0x0 2925c71ad17STony Luck 2935c71ad17STony Luck #endif /* _PND2_REGS_H */ 294