Skip to content
Permalink
Browse files

Add support for Sunsetrise Point LP to inteltool

  • Loading branch information...
mjg59 committed Jul 24, 2018
1 parent 4e71436 commit 16a068ba288740ce20c5af2adbee6924278df9ad
@@ -67,7 +67,8 @@ int print_ahci(struct pci_dev *ahci)
}
printf("\n============= AHCI Registers ==============\n\n");

if (ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA)
if (ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA ||
ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SATA)
mmio_size = 0x800;
else
mmio_size = 0x400;
@@ -96,7 +97,8 @@ int print_ahci(struct pci_dev *ahci)
print_port(mmio, i);
}

if (ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA) {
if (ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA ||
ahci->device_id == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SATA) {
puts("\nOther registers:");
for (i = 0x500; i < mmio_size; i += 4) {
if (MMIO(i))
@@ -1027,6 +1027,7 @@ int print_gpios(struct pci_dev *sb, int show_all, int show_diffs)
break;
case PCI_DEVICE_ID_INTEL_B150:
case PCI_DEVICE_ID_INTEL_CM236:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
print_gpio_groups(sb);
return 0;
case PCI_DEVICE_ID_INTEL_82371XX:
@@ -202,13 +202,47 @@ static const char *const sunrise_group_e_names[] = {
"GPP_E12", "USB_OC3#", "n/a", "n/a",
};

static const char *const sunrise_lp_group_e_names[] = {
"GPP_E0", "SATAXPCIE0", "SATAGP0", "n/a",
"GPP_E1", "SATAXPCIE1", "SATAGP1", "n/a",
"GPP_E2", "SATAXPCIE2", "SATAGP2", "n/a",
"GPP_E3", "CPU_GP0", "n/a", "n/a",
"GPP_E4", "SATA_DEVSLP0", "n/a", "n/a",
"GPP_E5", "SATA_DEVSLP1", "n/a", "n/a",
"GPP_E6", "SATA_DEVSLP2", "n/a", "n/a",
"GPP_E7", "CPU_GP1", "n/a", "n/a",
"GPP_E8", "SATA_LED#", "n/a", "n/a",
"GPP_E9", "USB_OC0#", "n/a", "n/a",
"GPP_E10", "USB_OC1#", "n/a", "n/a",
"GPP_E11", "USB_OC2#", "n/a", "n/a",
"GPP_E12", "USB_OC3#", "n/a", "n/a",
"GPP_E13", "n/a", "n/a", "n/a",
"GPP_E14", "n/a", "n/a", "n/a",
"GPP_E15", "n/a", "n/a", "n/a",
"GPP_E16", "n/a", "n/a", "n/a",
"GPP_E17", "n/a", "n/a", "n/a",
"GPP_E18", "n/a", "n/a", "n/a",
"GPP_E19", "n/a", "n/a", "n/a",
"GPP_E20", "n/a", "n/a", "n/a",
"GPP_E21", "n/a", "n/a", "n/a",
"GPP_E22", "n/a", "n/a", "n/a",
"GPP_E23", "n/a", "n/a", "n/a",
};

static const struct gpio_group sunrise_group_e = {
.display = "------- GPIO Group GPP_E -------",
.pad_count = ARRAY_SIZE(sunrise_group_e_names) / 4,
.func_count = 4,
.pad_names = sunrise_group_e_names,
};

static const struct gpio_group sunrise_lp_group_e = {
.display = "------- GPIO Group GPP_E -------",
.pad_count = ARRAY_SIZE(sunrise_lp_group_e_names) / 4,
.func_count = 4,
.pad_names = sunrise_lp_group_e_names,
};

static const char *const sunrise_group_f_names[] = {
"GPP_F0", "SATAXPCIE3", "SATAGP3", "n/a",
"GPP_F1", "SATAXPCIE4", "SATAGP4", "n/a",
@@ -270,13 +304,31 @@ static const char *const sunrise_group_g_names[] = {
"GPP_G23", "n/a", "n/a", "n/a",
};

static const char *const sunrise_lp_group_g_names[] = {
"GPP_G0", "FAN_TACH_0", "n/a", "n/a",
"GPP_G1", "FAN_TACH_1", "n/a", "n/a",
"GPP_G2", "FAN_TACH_2", "n/a", "n/a",
"GPP_G3", "FAN_TACH_3", "n/a", "n/a",
"GPP_G4", "FAN_TACH_4", "n/a", "n/a",
"GPP_G5", "FAN_TACH_5", "n/a", "n/a",
"GPP_G6", "FAN_TACH_6", "n/a", "n/a",
"GPP_G7", "FAN_TACH_7", "n/a", "n/a",
};

static const struct gpio_group sunrise_group_g = {
.display = "------- GPIO Group GPP_G -------",
.pad_count = ARRAY_SIZE(sunrise_group_g_names) / 4,
.func_count = 4,
.pad_names = sunrise_group_g_names,
};

static const struct gpio_group sunrise_lp_group_g = {
.display = "------- GPIO Group GPP_G -------",
.pad_count = ARRAY_SIZE(sunrise_lp_group_g_names) / 4,
.func_count = 4,
.pad_names = sunrise_lp_group_g_names,
};

static const char *const sunrise_group_h_names[] = {
"GPP_H0", "SRCCLKREQ6#", "n/a", "n/a",
"GPP_H1", "SRCCLKREQ7#", "n/a", "n/a",
@@ -316,13 +368,24 @@ static const struct gpio_group *const sunrise_community_cdefgh_groups[] = {
&sunrise_group_f, &sunrise_group_g, &sunrise_group_h,
};

static const struct gpio_group *const sunrise_lp_community_cde_groups[] = {
&sunrise_group_c, &sunrise_group_d, &sunrise_lp_group_e,
};

static const struct gpio_community sunrise_community_cdefgh = {
.name = "------- GPIO Community 1 -------",
.pcr_port_id = 0xae,
.group_count = ARRAY_SIZE(sunrise_community_cdefgh_groups),
.groups = sunrise_community_cdefgh_groups,
};

static const struct gpio_community sunrise_lp_community_cde = {
.name = "------- GPIO Community 1 -------",
.pcr_port_id = 0xae,
.group_count = ARRAY_SIZE(sunrise_lp_community_cde_groups),
.groups = sunrise_lp_community_cde_groups,
};

static const char *const sunrise_group_gpd_names[] = {
"GPD0", "BATLOW#", "n/a", "n/a",
"GPD1", "ACPRESENT", "n/a", "n/a",
@@ -381,18 +444,35 @@ static const struct gpio_group *const sunrise_community_i_groups[] = {
&sunrise_group_i,
};

static const struct gpio_group *const sunrise_lp_community_fg_groups[] = {
&sunrise_group_f, &sunrise_lp_group_g,
};

static const struct gpio_community sunrise_community_i = {
.name = "------- GPIO Community 3 -------",
.pcr_port_id = 0xac,
.group_count = ARRAY_SIZE(sunrise_community_i_groups),
.groups = sunrise_community_i_groups,
};

static const struct gpio_community sunrise_lp_community_fg = {
.name = "------- GPIO Community 3 -------",
.pcr_port_id = 0xac,
.group_count = ARRAY_SIZE(sunrise_lp_community_fg_groups),
.groups = sunrise_lp_community_fg_groups,
};

static const struct gpio_community *const sunrise_communities[] = {
&sunrise_community_ab, &sunrise_community_cdefgh,
&sunrise_community_gpd, &sunrise_community_i,
};

static const struct gpio_community *const sunrise_lp_communities[] = {
&sunrise_community_ab, &sunrise_lp_community_cde,
&sunrise_community_gpd, &sunrise_lp_community_fg,
};


static const char *decode_pad_mode(const struct gpio_group *const group,
const size_t pad, const uint32_t dw0)
{
@@ -460,6 +540,11 @@ void print_gpio_groups(struct pci_dev *const sb)
communities = sunrise_communities;
pcr_init(sb);
break;
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
community_count = ARRAY_SIZE(sunrise_lp_communities);
communities = sunrise_lp_communities;
pcr_init(sb);
break;
default:
return;
}
@@ -218,6 +218,8 @@ static const struct {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC, "Bay Trail" },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_PRE,
"Sunrise Point Desktop Engineering Sample" },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP,
"Sunrise Point Low Power" },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H110, "H110" },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_H170, "H170" },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_Z170, "Z170" },
@@ -144,6 +144,8 @@ static inline uint32_t inl(unsigned port)
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_SATA 0xa102
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_P2SB 0xa120
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_PRE 0xa141
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SATA 0x9d03
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP 0x9d4e
#define PCI_DEVICE_ID_INTEL_H110 0xa143
#define PCI_DEVICE_ID_INTEL_H170 0xa144
#define PCI_DEVICE_ID_INTEL_Z170 0xa145
@@ -246,6 +248,7 @@ static inline uint32_t inl(unsigned port)
#define PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M 0x1910 /* Skylake (Mobile) */
#define PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST 0x1918 /* Skylake (Workstation) */
#define PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D 0x191f /* Skylake (Desktop) */
#define PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_M 0x5914 /* Kabylake (Mobile) */

/* Intel GPUs */
#define PCI_DEVICE_ID_INTEL_G35_EXPRESS 0x2982
@@ -222,6 +222,7 @@ int print_mchbar(struct pci_dev *nb, struct pci_access *pacc, const char *dump_s
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_M:
mchbar_phys = pci_read_long(nb, 0x48);
mchbar_phys |= ((uint64_t)pci_read_long(nb, 0x4c)) << 32;
mchbar_phys &= 0x0000007fffff8000UL; /* 38:15 */
@@ -267,6 +267,7 @@ int print_epbar(struct pci_dev *nb)
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_M:
epbar_phys = pci_read_long(nb, 0x40) & 0xfffffffe;
epbar_phys |= ((uint64_t)pci_read_long(nb, 0x44)) << 32;
break;
@@ -389,6 +390,7 @@ int print_dmibar(struct pci_dev *nb)
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_M:
dmi_registers = skylake_dmi_registers;
size = ARRAY_SIZE(skylake_dmi_registers);
dmibar_phys = pci_read_long(nb, 0x68);
@@ -495,6 +497,7 @@ int print_pciexbar(struct pci_dev *nb)
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_M:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_WST:
case PCI_DEVICE_ID_INTEL_CORE_6TH_GEN_D:
case PCI_DEVICE_ID_INTEL_CORE_7TH_GEN_M:
pciexbar_reg = pci_read_long(nb, 0x60);
pciexbar_reg |= ((uint64_t)pci_read_long(nb, 0x64)) << 32;
break;
@@ -745,6 +745,7 @@ int print_pmbase(struct pci_dev *sb, struct pci_access *pacc)
case PCI_DEVICE_ID_INTEL_C224:
case PCI_DEVICE_ID_INTEL_C226:
case PCI_DEVICE_ID_INTEL_H81:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
pmbase = pci_read_word(sb, 0x40) & 0xff80;
pm_registers = pch_pm_registers;
size = ARRAY_SIZE(pch_pm_registers);
@@ -112,6 +112,7 @@ int print_rcba(struct pci_dev *sb)
case PCI_DEVICE_ID_INTEL_C224:
case PCI_DEVICE_ID_INTEL_C226:
case PCI_DEVICE_ID_INTEL_H81:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
break;
case PCI_DEVICE_ID_INTEL_ICH:
@@ -175,6 +175,7 @@ int print_bioscntl(struct pci_dev *sb)
case PCI_DEVICE_ID_INTEL_C224:
case PCI_DEVICE_ID_INTEL_C226:
case PCI_DEVICE_ID_INTEL_H81:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
bios_cntl = pci_read_byte(sb, 0xdc);
bios_cntl_register = pch_bios_cntl_registers;
size = ARRAY_SIZE(pch_bios_cntl_registers);
@@ -303,6 +304,7 @@ int print_spibar(struct pci_dev *sb) {
case PCI_DEVICE_ID_INTEL_C224:
case PCI_DEVICE_ID_INTEL_C226:
case PCI_DEVICE_ID_INTEL_H81:
case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP:
spibaroffset = ICH9_SPIBAR;
rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
size = ARRAY_SIZE(spi_bar_registers);

0 comments on commit 16a068b

Please sign in to comment.
You can’t perform that action at this time.