| 1 |
|
| 2 |
|
| 3 |
#include <intelblocks/gpio.h> |
| 4 |
#include <intelblocks/pcr.h> |
| 5 |
#include <soc/pcr_ids.h> |
| 6 |
#include <soc/pmc.h> |
| 7 |
|
| 8 |
static const struct reset_mapping rst_map[] = { |
| 9 |
{ .logical = PAD_RESET(PWROK), .chipset = 0U << 30 }, |
| 10 |
{ .logical = PAD_RESET(DEEP), .chipset = 1U << 30 }, |
| 11 |
{ .logical = PAD_RESET(PLTRST), .chipset = 2U << 30 }, |
| 12 |
{ .logical = PAD_RESET(GLBRST), .chipset = 3U << 30 }, |
| 13 |
}; |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
static const struct pad_group ptl_community0_groups[] = { |
| 26 |
INTEL_GPP_BASE(GPP_V00, GPP_V00, GPP_RST_B, 0), |
| 27 |
INTEL_GPP_BASE(GPP_V00, GPP_C00, GPP_C23, 32), |
| 28 |
}; |
| 29 |
|
| 30 |
static const struct pad_group ptl_community1_groups[] = { |
| 31 |
INTEL_GPP_BASE(GPP_F00, GPP_F00, GPP_GSPI0_CLK_LOOPBK, 0), |
| 32 |
INTEL_GPP_BASE(GPP_F00, GPP_E00, GPP_THC0_GSPI_CLK_LPBK, 32), |
| 33 |
}; |
| 34 |
|
| 35 |
#if CONFIG(SOC_INTEL_WILDCATLAKE) |
| 36 |
static const struct pad_group ptl_community3_groups[] = { |
| 37 |
INTEL_GPP_BASE(GPP_H00, GPP_H00, GPP_SHD3C_CLK_LPBK, 0), |
| 38 |
INTEL_GPP_BASE(GPP_H00, GPP_A00, GPP_SPI0_CLK_LOOPBK, 32), |
| 39 |
INTEL_GPP(GPP_H00, GPP_VGPIO3_USB0, GPP_VGPIO3_THC3), |
| 40 |
}; |
| 41 |
|
| 42 |
static const struct pad_group ptl_community4_groups[] = { |
| 43 |
INTEL_GPP_BASE(GPP_S00, GPP_S00, GPP_S07, 0), |
| 44 |
INTEL_GPP(GPP_S00, GPP_EPD_ON, GPP_DDSP_HPDALV), |
| 45 |
}; |
| 46 |
#else |
| 47 |
static const struct pad_group ptl_community3_groups[] = { |
| 48 |
INTEL_GPP(GPP_EPD_ON, GPP_EPD_ON, GPP_DDSP_HPDALV), |
| 49 |
INTEL_GPP_BASE(GPP_EPD_ON, GPP_H00, GPP_ISHI3C1_CLK_LPBK, 32), |
| 50 |
INTEL_GPP_BASE(GPP_EPD_ON, GPP_A00, GPP_SPI0_CLK_LOOPBK, 64), |
| 51 |
INTEL_GPP(GPP_EPD_ON, GPP_VGPIO3_USB0, GPP_VGPIO3_THC3), |
| 52 |
}; |
| 53 |
|
| 54 |
static const struct pad_group ptl_community4_groups[] = { |
| 55 |
INTEL_GPP_BASE(GPP_S00, GPP_S00, GPP_S07, 0), |
| 56 |
}; |
| 57 |
#endif |
| 58 |
|
| 59 |
static const struct pad_group ptl_community5_groups[] = { |
| 60 |
INTEL_GPP_BASE(GPP_B00, GPP_B00, GPP_ISHI3C0_CLK_LPBK, 0), |
| 61 |
INTEL_GPP_BASE(GPP_B00, GPP_D00, GPP_D25, 32), |
| 62 |
INTEL_GPP(GPP_B00, GPP_VGPIO0, GPP_VGPIO47), |
| 63 |
}; |
| 64 |
|
| 65 |
static const struct pad_community ptl_communities[] = { |
| 66 |
[COMM_0] = { |
| 67 |
.port = PID_GPIOCOM0, |
| 68 |
.first_pad = COM0_GRP_PAD_START, |
| 69 |
.last_pad = COM0_GRP_PAD_END, |
| 70 |
.num_gpi_regs = NUM_GPIO_COM0_GPI_REGS, |
| 71 |
.pad_cfg_base = PAD_CFG_BASE, |
| 72 |
.pad_cfg_lock_offset = PAD_CFG_LOCK_REG_0, |
| 73 |
.host_own_reg_0 = HOSTSW_OWN_REG_0, |
| 74 |
.gpi_int_sts_reg_0 = GPI_INT_STS_0, |
| 75 |
.gpi_int_en_reg_0 = GPI_INT_EN_0, |
| 76 |
.gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, |
| 77 |
.gpi_gpe_en_reg_0 = GPI_GPE_EN_0, |
| 78 |
.gpi_smi_sts_reg_0 = GPI_SMI_STS_0, |
| 79 |
.gpi_smi_en_reg_0 = GPI_SMI_EN_0, |
| 80 |
.max_pads_per_group = GPIO_MAX_NUM_PER_GROUP, |
| 81 |
.name = "GPP_V_C", |
| 82 |
.acpi_path = "\\_SB.PCI0.GPI0", |
| 83 |
.reset_map = rst_map, |
| 84 |
.num_reset_vals = ARRAY_SIZE(rst_map), |
| 85 |
.groups = ptl_community0_groups, |
| 86 |
.num_groups = ARRAY_SIZE(ptl_community0_groups), |
| 87 |
}, |
| 88 |
[COMM_1] = { |
| 89 |
.port = PID_GPIOCOM1, |
| 90 |
.first_pad = COM1_GRP_PAD_START, |
| 91 |
.last_pad = COM1_GRP_PAD_END, |
| 92 |
.num_gpi_regs = NUM_GPIO_COM1_GPI_REGS, |
| 93 |
.pad_cfg_base = PAD_CFG_BASE, |
| 94 |
.pad_cfg_lock_offset = PAD_CFG_LOCK_REG_0, |
| 95 |
.host_own_reg_0 = HOSTSW_OWN_REG_0, |
| 96 |
.gpi_int_sts_reg_0 = GPI_INT_STS_0, |
| 97 |
.gpi_int_en_reg_0 = GPI_INT_EN_0, |
| 98 |
.gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, |
| 99 |
.gpi_gpe_en_reg_0 = GPI_GPE_EN_0, |
| 100 |
.gpi_smi_sts_reg_0 = GPI_SMI_STS_0, |
| 101 |
.gpi_smi_en_reg_0 = GPI_SMI_EN_0, |
| 102 |
.max_pads_per_group = GPIO_MAX_NUM_PER_GROUP, |
| 103 |
.name = "GPP_F_E", |
| 104 |
.acpi_path = "\\_SB.PCI0.GPI1", |
| 105 |
.reset_map = rst_map, |
| 106 |
.num_reset_vals = ARRAY_SIZE(rst_map), |
| 107 |
.groups = ptl_community1_groups, |
| 108 |
.num_groups = ARRAY_SIZE(ptl_community1_groups), |
| 109 |
}, |
| 110 |
[COMM_3] = { |
| 111 |
|
| 112 |
.port = PID_GPIOCOM3, |
| 113 |
.first_pad = COM3_GRP_PAD_START, |
| 114 |
.last_pad = COM3_GRP_PAD_END, |
| 115 |
.num_gpi_regs = NUM_GPIO_COM3_GPI_REGS, |
| 116 |
.pad_cfg_base = PAD_CFG_BASE, |
| 117 |
.pad_cfg_lock_offset = PAD_CFG_LOCK_REG_0, |
| 118 |
.host_own_reg_0 = HOSTSW_OWN_REG_0, |
| 119 |
.gpi_int_sts_reg_0 = GPI_INT_STS_0, |
| 120 |
.gpi_int_en_reg_0 = GPI_INT_EN_0, |
| 121 |
.gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, |
| 122 |
.gpi_gpe_en_reg_0 = GPI_GPE_EN_0, |
| 123 |
.gpi_smi_sts_reg_0 = GPI_SMI_STS_0, |
| 124 |
.gpi_smi_en_reg_0 = GPI_SMI_EN_0, |
| 125 |
.max_pads_per_group = GPIO_MAX_NUM_PER_GROUP, |
| 126 |
#if CONFIG(SOC_INTEL_WILDCATLAKE) |
| 127 |
.name = "GPP_H_A_VGPIO3", |
| 128 |
#else |
| 129 |
.name = "GPP_CPUJTAG_H_A_VGPIO3", |
| 130 |
#endif |
| 131 |
.acpi_path = "\\_SB.PCI0.GPI3", |
| 132 |
.reset_map = rst_map, |
| 133 |
.num_reset_vals = ARRAY_SIZE(rst_map), |
| 134 |
.groups = ptl_community3_groups, |
| 135 |
.num_groups = ARRAY_SIZE(ptl_community3_groups), |
| 136 |
}, |
| 137 |
[COMM_4] = { |
| 138 |
|
| 139 |
.port = PID_GPIOCOM4, |
| 140 |
.first_pad = COM4_GRP_PAD_START, |
| 141 |
.last_pad = COM4_GRP_PAD_END, |
| 142 |
.num_gpi_regs = NUM_GPIO_COM4_GPI_REGS, |
| 143 |
.pad_cfg_base = PAD_CFG_BASE, |
| 144 |
.pad_cfg_lock_offset = PAD_CFG_LOCK_REG_0, |
| 145 |
.host_own_reg_0 = HOSTSW_OWN_REG_0, |
| 146 |
.gpi_int_sts_reg_0 = GPI_INT_STS_0, |
| 147 |
.gpi_int_en_reg_0 = GPI_INT_EN_0, |
| 148 |
.gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, |
| 149 |
.gpi_gpe_en_reg_0 = GPI_GPE_EN_0, |
| 150 |
.gpi_smi_sts_reg_0 = GPI_SMI_STS_0, |
| 151 |
.gpi_smi_en_reg_0 = GPI_SMI_EN_0, |
| 152 |
.max_pads_per_group = GPIO_MAX_NUM_PER_GROUP, |
| 153 |
#if CONFIG(SOC_INTEL_WILDCATLAKE) |
| 154 |
.name = "GPP_S_CPUJTAG", |
| 155 |
#else |
| 156 |
.name = "GPP_S", |
| 157 |
#endif |
| 158 |
.acpi_path = "\\_SB.PCI0.GPI4", |
| 159 |
.reset_map = rst_map, |
| 160 |
.num_reset_vals = ARRAY_SIZE(rst_map), |
| 161 |
.groups = ptl_community4_groups, |
| 162 |
.num_groups = ARRAY_SIZE(ptl_community4_groups), |
| 163 |
}, |
| 164 |
[COMM_5] = { |
| 165 |
.port = PID_GPIOCOM5, |
| 166 |
.first_pad = COM5_GRP_PAD_START, |
| 167 |
.last_pad = COM5_GRP_PAD_END, |
| 168 |
.num_gpi_regs = NUM_GPIO_COM5_GPI_REGS, |
| 169 |
.pad_cfg_base = PAD_CFG_BASE, |
| 170 |
.pad_cfg_lock_offset = PAD_CFG_LOCK_REG_0, |
| 171 |
.host_own_reg_0 = HOSTSW_OWN_REG_0, |
| 172 |
.gpi_int_sts_reg_0 = GPI_INT_STS_0, |
| 173 |
.gpi_int_en_reg_0 = GPI_INT_EN_0, |
| 174 |
.gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, |
| 175 |
.gpi_gpe_en_reg_0 = GPI_GPE_EN_0, |
| 176 |
.gpi_smi_sts_reg_0 = GPI_SMI_STS_0, |
| 177 |
.gpi_smi_en_reg_0 = GPI_SMI_EN_0, |
| 178 |
.max_pads_per_group = GPIO_MAX_NUM_PER_GROUP, |
| 179 |
.name = "GPP_B_D_VGPIO", |
| 180 |
.acpi_path = "\\_SB.PCI0.GPI5", |
| 181 |
.reset_map = rst_map, |
| 182 |
.num_reset_vals = ARRAY_SIZE(rst_map), |
| 183 |
.groups = ptl_community5_groups, |
| 184 |
.num_groups = ARRAY_SIZE(ptl_community5_groups), |
| 185 |
} |
| 186 |
}; |
| 187 |
|
| 188 |
const struct pad_community *soc_gpio_get_community(size_t *num_communities) |
| 189 |
{ |
| 190 |
*num_communities = ARRAY_SIZE(ptl_communities); |
| 191 |
return ptl_communities; |
| 192 |
} |
| 193 |
|
| 194 |
const struct pmc_to_gpio_route *soc_pmc_gpio_routes(size_t *num) |
| 195 |
{ |
| 196 |
static const struct pmc_to_gpio_route routes[] = { |
| 197 |
{ PMC_GPP_V, GPP_V }, |
| 198 |
{ PMC_GPP_C, GPP_C }, |
| 199 |
{ PMC_GPP_F, GPP_F }, |
| 200 |
{ PMC_GPP_E, GPP_E }, |
| 201 |
{ PMC_GPP_A, GPP_A }, |
| 202 |
{ PMC_GPP_H, GPP_H }, |
| 203 |
{ PMC_GPP_VGPIO, GPP_VGPIO }, |
| 204 |
{ PMC_GPP_B, GPP_B }, |
| 205 |
{ PMC_GPP_D, GPP_D }, |
| 206 |
{ PMC_GPP_S, GPP_S }, |
| 207 |
}; |
| 208 |
*num = ARRAY_SIZE(routes); |
| 209 |
return routes; |
| 210 |
} |