Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 2 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 3 | #include <console/console.h> |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 4 | #include <arch/io.h> |
| 5 | #include <device/mmio.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 6 | #include <device/pci.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 7 | #include <soc/gpio.h> |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 8 | #include <soc/pm.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 9 | #include <soc/smm.h> |
| 10 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 11 | #define GPIO_DEBUG |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 12 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 13 | /* gpio map to pad number LUTs */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 14 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 15 | static const u8 gpncommunity_gpio_to_pad[GP_NORTH_COUNT] = { |
| 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 }; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 22 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 23 | static const u8 gpsecommunity_gpio_to_pad[GP_SOUTHEAST_COUNT] = { |
| 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, |
| 29 | 81, 82, 83, 84, 85 }; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 30 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 31 | static const u8 gpswcommunity_gpio_to_pad[GP_SOUTHWEST_COUNT] = { |
| 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 }; |
| 38 | |
| 39 | static const u8 gpecommunity_gpio_to_pad[GP_EAST_COUNT] = { |
| 40 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
| 41 | 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, |
| 42 | 23, 24, 25, 26 }; |
| 43 | |
| 44 | /* GPIO Community descriptions */ |
| 45 | static const struct gpio_bank gpnorth_community = { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 46 | .gpio_count = GP_NORTH_COUNT, |
Lee Leahy | 6598b91 | 2017-03-16 17:30:09 -0700 | [diff] [blame] | 47 | .gpio_to_pad = gpncommunity_gpio_to_pad, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 48 | .pad_base = COMMUNITY_GPNORTH_BASE, |
| 49 | .has_gpe_en = GPE_CAPABLE, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 50 | .has_wake_en = 1, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 53 | static const struct gpio_bank gpsoutheast_community = { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 54 | .gpio_count = GP_SOUTHEAST_COUNT, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 55 | .gpio_to_pad = gpsecommunity_gpio_to_pad, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 56 | .pad_base = COMMUNITY_GPSOUTHEAST_BASE, |
| 57 | .has_gpe_en = GPE_CAPABLE_NONE, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 58 | .has_wake_en = 1, |
| 59 | }; |
| 60 | |
| 61 | static const struct gpio_bank gpsouthwest_community = { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 62 | .gpio_count = GP_SOUTHWEST_COUNT, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 63 | .gpio_to_pad = gpswcommunity_gpio_to_pad, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 64 | .pad_base = COMMUNITY_GPSOUTHWEST_BASE, |
| 65 | .has_gpe_en = GPE_CAPABLE, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 66 | .has_wake_en = 1, |
| 67 | }; |
| 68 | |
| 69 | static const struct gpio_bank gpeast_community = { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 70 | .gpio_count = GP_EAST_COUNT, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 71 | .gpio_to_pad = gpecommunity_gpio_to_pad, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 72 | .pad_base = COMMUNITY_GPEAST_BASE, |
| 73 | .has_gpe_en = GPE_CAPABLE_NONE, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 74 | .has_wake_en = 1, |
| 75 | }; |
| 76 | |
| 77 | static void setup_gpio_route(const struct soc_gpio_map *sw_gpios, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 78 | const struct soc_gpio_map *n_gpios) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 79 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 80 | const struct soc_gpio_map *n_config; |
| 81 | const struct soc_gpio_map *sw_config; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 82 | uint32_t route_reg = 0; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 83 | uint32_t int_selection = 0; |
| 84 | uint32_t alt_gpio_smi = 0; |
| 85 | uint32_t gpe0a_en = 0; |
| 86 | int gpio = 0; |
| 87 | int north_done = 0; |
| 88 | int south_done = 0; |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 89 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 90 | for (sw_config = sw_gpios, n_config = n_gpios; |
| 91 | (!north_done || !south_done); sw_config++, n_config++, gpio++) { |
| 92 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 93 | /* When north config is done */ |
| 94 | if ((gpio > GP_NORTH_COUNT) || (n_config->pad_conf0 == GPIO_LIST_END)) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 95 | north_done = 1; |
| 96 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 97 | /* When southwest config is done */ |
| 98 | if ((gpio > GP_SOUTHWEST_COUNT) || (sw_config->pad_conf0 == GPIO_LIST_END)) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 99 | south_done = 1; |
| 100 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 101 | /* Route north gpios */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 102 | if (!north_done) { |
| 103 | /* Int select from 8 to 15 */ |
| 104 | int_selection = ((n_config->pad_conf0 >> 28) & 0xf); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 105 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 106 | if (n_config->gpe == SMI) { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 107 | /* Set the corresponding bits (01) as per the interrupt line */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 108 | route_reg |= (1 << ((int_selection - 8) * 2)); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 109 | |
| 110 | /* Reset the higher bit */ |
| 111 | route_reg &= ~(1 << ((int_selection - 8) * 2 + 1)); |
| 112 | alt_gpio_smi |= (1 << (int_selection + 8)); |
| 113 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 114 | } else if (n_config->gpe == SCI) { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 115 | /* Set the corresponding bits as per the interrupt line */ |
| 116 | route_reg |= (1 << (((int_selection - 8) * 2) + 1)); |
| 117 | |
| 118 | /* Reset the bit */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 119 | route_reg &= ~(1 << ((int_selection - 8) * 2)); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 120 | gpe0a_en |= (1 << (int_selection + 8)); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 121 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 122 | } |
| 123 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 124 | /* Route southwest gpios */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 125 | if (!south_done) { |
| 126 | /* Int select from 8 to 15 */ |
| 127 | int_selection = ((sw_config->pad_conf0 >> 28) & 0xf); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 128 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 129 | if (sw_config->gpe == SMI) { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 130 | /* Set the corresponding bits (10) as per the interrupt line */ |
| 131 | route_reg |= (1 << (int_selection * 2)); |
| 132 | route_reg &= ~(1 << (int_selection * 2 + 1)); |
| 133 | alt_gpio_smi |= (1 << (int_selection + 16)); |
| 134 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 135 | } else if (sw_config->gpe == SCI) { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 136 | /* Set the corresponding bits as per the interrupt line */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 137 | route_reg |= (1 << ((int_selection * 2) + 1)); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 138 | |
| 139 | /* Reset the bit */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 140 | route_reg &= ~(1 << (int_selection * 2)); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 141 | gpe0a_en |= (1 << (int_selection + 16)); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 142 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 143 | } |
| 144 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 145 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 146 | /* Enable gpe bits in GPE0A_EN_REG */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 147 | outl(gpe0a_en, ACPI_BASE_ADDRESS + GPE0A_EN_REG); |
| 148 | |
| 149 | #ifdef GPIO_DEBUG |
| 150 | printk(BIOS_DEBUG, "gpio_rout = %x alt_gpio_smi = %x gpe0a_en = %x\n", |
| 151 | route_reg, alt_gpio_smi, gpe0a_en); |
| 152 | #endif |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 153 | /* Save as an SMM param */ |
Kyösti Mälkki | faf20d3 | 2019-08-14 05:41:41 +0300 | [diff] [blame] | 154 | smm_southcluster_save_param(SMM_SAVE_PARAM_GPIO_ROUTE, route_reg); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 155 | } |
| 156 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 157 | static void setup_gpios(const struct soc_gpio_map *gpios, const struct gpio_bank *community) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 158 | { |
| 159 | const struct soc_gpio_map *config; |
| 160 | int gpio = 0; |
| 161 | u32 reg, family, internal_pad_num; |
| 162 | u32 mmio_addr, int_selection; |
| 163 | u32 gpio_wake0 = 0; |
| 164 | u32 gpio_wake1 = 0; |
| 165 | u32 gpio_int_mask = 0; |
| 166 | |
| 167 | if (!gpios) |
| 168 | return; |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 169 | |
| 170 | for (config = gpios; config->pad_conf0 != GPIO_LIST_END; config++, gpio++) { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 171 | if (gpio > community->gpio_count) |
| 172 | break; |
| 173 | |
| 174 | /* Pad configuration registers */ |
| 175 | family = community->gpio_to_pad[gpio] / MAX_FAMILY_PAD_GPIO_NO; |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 176 | internal_pad_num = community->gpio_to_pad[gpio] % MAX_FAMILY_PAD_GPIO_NO; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 177 | |
| 178 | /* |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 179 | * Calculate the MMIO Address for GPIO pin control register pointed by index. |
| 180 | * REG = IOBASE + COMMUNITY_BASE + 0x4400 + (0x400 * FAMILY_NUM) + (8 * PAD_NUM) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 181 | */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 182 | mmio_addr = FAMILY_PAD_REGS_OFF + (FAMILY_PAD_REGS_SIZE * family) + |
| 183 | (GPIO_REGS_SIZE * internal_pad_num); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 184 | |
| 185 | reg = community->pad_base + mmio_addr; |
| 186 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 187 | /* Get int selection value */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 188 | int_selection = ((config->pad_conf0 >> 28) & 0xf); |
| 189 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 190 | /* Get int mask register value */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 191 | gpio_int_mask |= (config->int_mask << int_selection); |
| 192 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 193 | /* Wake capable programming, some communities have 2 wake regs */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 194 | if (gpio > 31) |
| 195 | gpio_wake1 |= config->wake_mask << (gpio % 32); |
| 196 | else |
| 197 | gpio_wake0 |= config->wake_mask << gpio; |
| 198 | |
| 199 | if (!config->skip_config) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 200 | #ifdef GPIO_DEBUG |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 201 | printk(BIOS_DEBUG, |
| 202 | "Write Pad: Base(%x) - conf0 = %x conf1= %x gpio #- %d pad # = %d\n", |
| 203 | reg, config->pad_conf0, config->pad_conf1, |
| 204 | community->gpio_to_pad[gpio], gpio); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 205 | #endif |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 206 | /* Write pad configurations to conf0 and conf1 register */ |
| 207 | write32((void *)(reg + PAD_CONF0_REG), config->pad_conf0); |
| 208 | write32((void *)(reg + PAD_CONF1_REG), config->pad_conf1); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 209 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 210 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 211 | |
| 212 | #ifdef GPIO_DEBUG |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 213 | printk(BIOS_DEBUG, "gpio_wake_mask0 = %x gpio_wake_mask1 = %x gpio_int_mask = %x\n", |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 214 | gpio_wake0, gpio_wake1, gpio_int_mask); |
| 215 | #endif |
| 216 | |
| 217 | /* Wake */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 218 | write32((void *)(community->pad_base + GPIO_WAKE_MASK_REG0), gpio_wake0); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 219 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 220 | /* Wake mask config for communities with 2 regs */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 221 | if (community->gpio_count > 32) |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 222 | write32((void *)(community->pad_base + GPIO_WAKE_MASK_REG1), gpio_wake1); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 223 | |
| 224 | /* Interrupt */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 225 | write32((void *)(community->pad_base + GPIO_INTERRUPT_MASK), gpio_int_mask); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | void setup_soc_gpios(struct soc_gpio_config *config, u8 enable_xdp_tap) |
| 229 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 230 | if (config) { |
| 231 | |
| 232 | /* |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 233 | * Write the default value 0xffffff to the SW write_access_policy_interrupt_reg |
| 234 | * to allow the SW interrupt mask register to be set |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 235 | */ |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 236 | write32((void *)(COMMUNITY_GPSOUTHWEST_BASE + 0x108), 0xffffffff); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 237 | |
| 238 | printk(BIOS_DEBUG, "north\n"); |
| 239 | setup_gpios(config->north, &gpnorth_community); |
| 240 | |
| 241 | printk(BIOS_DEBUG, "southwest\n"); |
| 242 | setup_gpios(config->southwest, &gpsouthwest_community); |
| 243 | |
| 244 | printk(BIOS_DEBUG, "southeast\n"); |
| 245 | setup_gpios(config->southeast, &gpsoutheast_community); |
| 246 | |
| 247 | printk(BIOS_DEBUG, "east\n"); |
| 248 | setup_gpios(config->east, &gpeast_community); |
| 249 | |
| 250 | printk(BIOS_DEBUG, "Routing SW and N gpios\n"); |
| 251 | setup_gpio_route(config->southwest, config->north); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 254 | /* |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 255 | * Set on die termination feature with pull up value |
| 256 | * and drive the pad high for TAP_TDO and TAP_TMS |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 257 | */ |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 258 | if (!enable_xdp_tap) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 259 | printk(BIOS_DEBUG, "Tri-state TDO and TMS\n"); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 262 | __weak struct soc_gpio_config *mainboard_get_gpios(void) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 263 | { |
| 264 | printk(BIOS_DEBUG, "Default/empty GPIO config\n"); |
| 265 | return NULL; |
| 266 | } |