16 0, 1, 2, 3, 4, 5, 6, 7, 8, 15,
17 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
18 26, 27, 30, 31, 32, 33, 34, 35, 36, 37,
19 38, 39, 40, 41, 45, 46, 47, 48, 49, 50,
20 51, 52, 53, 54, 55, 56, 60, 61, 62, 63,
21 64, 65, 66, 67, 68, 69, 70, 71, 72 };
24 0, 1, 2, 3, 4, 5, 6, 7, 15, 16,
25 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
26 30, 31, 32, 33, 34, 35, 45, 46, 47, 48,
27 49, 50, 51, 52, 60, 61, 62, 63, 64, 65,
28 66, 67, 68, 69, 75, 76, 77, 78, 79, 80,
32 0, 1, 2, 3, 4, 5, 6, 7, 15, 16,
33 17, 18, 19, 20, 21, 22, 30, 31, 32, 33,
34 34, 35, 36, 37, 45, 46, 47, 48, 49, 50,
35 51, 52, 60, 61, 62, 63, 64, 65, 66, 67,
36 75, 76, 77, 78, 79, 80, 81, 82, 90, 91,
37 92, 93, 94, 95, 96, 97 };
40 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
41 10, 11, 15, 16, 17, 18, 19, 20, 21, 22,
90 for (sw_config = sw_gpios, n_config = n_gpios;
91 (!north_done || !south_done); sw_config++, n_config++,
gpio++) {
104 int_selection = ((n_config->
pad_conf0 >> 28) & 0xf);
106 if (n_config->
gpe ==
SMI) {
108 route_reg |= (1 << ((int_selection - 8) * 2));
111 route_reg &= ~(1 << ((int_selection - 8) * 2 + 1));
112 alt_gpio_smi |= (1 << (int_selection + 8));
114 }
else if (n_config->
gpe ==
SCI) {
116 route_reg |= (1 << (((int_selection - 8) * 2) + 1));
119 route_reg &= ~(1 << ((int_selection - 8) * 2));
120 gpe0a_en |= (1 << (int_selection + 8));
127 int_selection = ((sw_config->
pad_conf0 >> 28) & 0xf);
129 if (sw_config->
gpe ==
SMI) {
131 route_reg |= (1 << (int_selection * 2));
132 route_reg &= ~(1 << (int_selection * 2 + 1));
133 alt_gpio_smi |= (1 << (int_selection + 16));
135 }
else if (sw_config->
gpe ==
SCI) {
137 route_reg |= (1 << ((int_selection * 2) + 1));
140 route_reg &= ~(1 << (int_selection * 2));
141 gpe0a_en |= (1 << (int_selection + 16));
151 route_reg, alt_gpio_smi, gpe0a_en);
161 u32 reg, family, internal_pad_num;
162 u32 mmio_addr, int_selection;
165 u32 gpio_int_mask = 0;
185 reg = community->
pad_base + mmio_addr;
188 int_selection = ((
config->pad_conf0 >> 28) & 0xf);
191 gpio_int_mask |= (
config->int_mask << int_selection);
195 gpio_wake1 |=
config->wake_mask << (
gpio % 32);
199 if (!
config->skip_config) {
202 "Write Pad: Base(%x) - conf0 = %x conf1= %x gpio #- %d pad # = %d\n",
213 printk(
BIOS_DEBUG,
"gpio_wake_mask0 = %x gpio_wake_mask1 = %x gpio_int_mask = %x\n",
214 gpio_wake0, gpio_wake1, gpio_int_mask);
static void write32(void *addr, uint32_t val)
#define printk(level,...)
void outl(u32 val, u16 port)
#define ACPI_BASE_ADDRESS
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
struct soc_gpio_config * mainboard_get_gpios(void)
const struct smm_save_state_ops *legacy_ops __weak
void setup_soc_gpios(struct soc_gpio_config *config, u8 enable_xdp_tap)
void smm_southcluster_save_param(int param, uint32_t data)
@ SMM_SAVE_PARAM_GPIO_ROUTE
static const struct gpio_bank gpeast_community
static const u8 gpecommunity_gpio_to_pad[GP_EAST_COUNT]
static void setup_gpio_route(const struct soc_gpio_map *sw_gpios, const struct soc_gpio_map *n_gpios)
static const u8 gpswcommunity_gpio_to_pad[GP_SOUTHWEST_COUNT]
static const u8 gpncommunity_gpio_to_pad[GP_NORTH_COUNT]
static void setup_gpios(const struct soc_gpio_map *gpios, const struct gpio_bank *community)
static const struct gpio_bank gpsoutheast_community
static const u8 gpsecommunity_gpio_to_pad[GP_SOUTHEAST_COUNT]
static const struct gpio_bank gpnorth_community
static const struct gpio_bank gpsouthwest_community
#define GP_SOUTHEAST_COUNT
#define FAMILY_PAD_REGS_OFF
#define COMMUNITY_GPSOUTHEAST_BASE
#define GPIO_WAKE_MASK_REG1
#define COMMUNITY_GPNORTH_BASE
#define GPIO_WAKE_MASK_REG0
#define MAX_FAMILY_PAD_GPIO_NO
#define FAMILY_PAD_REGS_SIZE
#define COMMUNITY_GPEAST_BASE
#define GPIO_INTERRUPT_MASK
#define COMMUNITY_GPSOUTHWEST_BASE
#define GP_SOUTHWEST_COUNT
const unsigned long pad_base