soc/amd: rename program_gpios to gpio_configure_pads

Use the same function name as in soc/intel for this functionality. This
also brings the function name more in line with the extended version of
this function gpio_configure_pads_with_override which additionally
supports passing a GPIO override configuration.

This might cause some pain for out-of-tree boards, but at some point
this should be made more consistent, so I don't see a too strong reason
not to do this.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I88852e040f79861ce7d190bf2203f9e0ce156690
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57837
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Felix Held 2021-09-22 16:36:12 +02:00 committed by Felix Held
parent 05df6ec844
commit 7011fa1135
33 changed files with 44 additions and 44 deletions

View File

@ -31,5 +31,5 @@ static const struct soc_amd_gpio gpio_set_stage_reset[] = {
void mainboard_program_early_gpios(void) void mainboard_program_early_gpios(void)
{ {
program_gpios(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset)); gpio_configure_pads(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset));
} }

View File

@ -23,5 +23,5 @@ static const struct soc_amd_gpio emmc_gpios[] = {
/* Don't call this if the board uses the LPC bus. */ /* Don't call this if the board uses the LPC bus. */
void mainboard_program_emmc_gpios(void) void mainboard_program_emmc_gpios(void)
{ {
program_gpios(emmc_gpios, ARRAY_SIZE(emmc_gpios)); gpio_configure_pads(emmc_gpios, ARRAY_SIZE(emmc_gpios));
} }

View File

@ -23,5 +23,5 @@ static const struct soc_amd_gpio gpio_set_stage_ram[] = {
void mainboard_program_gpios(void) void mainboard_program_gpios(void)
{ {
program_gpios(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram)); gpio_configure_pads(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram));
} }

View File

@ -10,5 +10,5 @@ void bootblock_mainboard_early_init(void)
size_t num_gpios; size_t num_gpios;
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = early_gpio_table(&num_gpios); gpios = early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }

View File

@ -69,7 +69,7 @@ static void mainboard_init(void *chip_info)
size_t num_gpios; size_t num_gpios;
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = gpio_table(&num_gpios); gpios = gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
/************************************************* /*************************************************

View File

@ -14,5 +14,5 @@ static const struct soc_amd_gpio gpio_set_stage_reset[] = {
void mainboard_program_early_gpios(void) void mainboard_program_early_gpios(void)
{ {
program_gpios(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset)); gpio_configure_pads(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset));
} }

View File

@ -23,5 +23,5 @@ static const struct soc_amd_gpio emmc_gpios[] = {
/* Don't call this if the board uses the LPC bus. */ /* Don't call this if the board uses the LPC bus. */
void mainboard_program_emmc_gpios(void) void mainboard_program_emmc_gpios(void)
{ {
program_gpios(emmc_gpios, ARRAY_SIZE(emmc_gpios)); gpio_configure_pads(emmc_gpios, ARRAY_SIZE(emmc_gpios));
} }

View File

@ -28,5 +28,5 @@ static const struct soc_amd_gpio gpio_set_stage_reset[] = {
void mainboard_program_early_gpios(void) void mainboard_program_early_gpios(void)
{ {
program_gpios(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset)); gpio_configure_pads(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset));
} }

View File

@ -29,5 +29,5 @@ static const struct soc_amd_gpio gpio_set_stage_ram[] = {
void mainboard_program_gpios(void) void mainboard_program_gpios(void)
{ {
program_gpios(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram)); gpio_configure_pads(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram));
} }

View File

@ -32,5 +32,5 @@ static const struct soc_amd_gpio gpio_set_stage_reset[] = {
void mainboard_program_early_gpios(void) void mainboard_program_early_gpios(void)
{ {
program_gpios(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset)); gpio_configure_pads(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset));
} }

View File

@ -34,5 +34,5 @@ static const struct soc_amd_gpio gpio_set_stage_ram[] = {
void mainboard_program_gpios(void) void mainboard_program_gpios(void)
{ {
program_gpios(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram)); gpio_configure_pads(gpio_set_stage_ram, ARRAY_SIZE(gpio_set_stage_ram));
} }

View File

@ -46,5 +46,5 @@ void bootblock_mainboard_init(void)
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = early_gpio_table(&num_gpios); gpios = early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }

View File

@ -98,7 +98,7 @@ static void mainboard_init(void *chip_info)
size_t num_gpios; size_t num_gpios;
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = gpio_table(&num_gpios); gpios = gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
/************************************************* /*************************************************

View File

@ -22,7 +22,7 @@ void mainboard_smi_sleep(u8 slp_typ)
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS);
gpios = variant_sleep_gpio_table(&num_gpios); gpios = variant_sleep_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
int mainboard_smi_apmc(u8 apmc) int mainboard_smi_apmc(u8 apmc)

View File

@ -362,7 +362,7 @@ __weak void variant_fpmcu_reset(void)
/* EN_PWR_FP */ /* EN_PWR_FP */
PAD_GPO(GPIO_32, LOW), PAD_GPO(GPIO_32, LOW),
}; };
program_gpios(fpmcu_bootblock_table, ARRAY_SIZE(fpmcu_bootblock_table)); gpio_configure_pads(fpmcu_bootblock_table, ARRAY_SIZE(fpmcu_bootblock_table));
} }
__weak void variant_finalize_gpios(void) __weak void variant_finalize_gpios(void)
@ -380,6 +380,6 @@ __weak void variant_finalize_gpios(void)
/* Deassert the FPMCU reset to enable the FPMCU */ /* Deassert the FPMCU reset to enable the FPMCU */
gpio_set(GPIO_11, 1); /* FPMCU_RST_L */ gpio_set(GPIO_11, 1); /* FPMCU_RST_L */
} else { } else {
program_gpios(disable_fpmcu_table, ARRAY_SIZE(disable_fpmcu_table)); gpio_configure_pads(disable_fpmcu_table, ARRAY_SIZE(disable_fpmcu_table));
} }
} }

View File

@ -13,7 +13,7 @@ static void setup_gpio(void)
if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) { if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
gpios = variant_early_gpio_table(&num_gpios); gpios = variant_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
} }

View File

@ -17,10 +17,10 @@ void bootblock_mainboard_early_init(void)
mainboard_ec_init(); mainboard_ec_init();
gpios = variant_wlan_rst_early_gpio_table(&num_gpios); gpios = variant_wlan_rst_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
gpios = variant_early_gpio_table(&num_gpios); gpios = variant_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
void bootblock_mainboard_init(void) void bootblock_mainboard_init(void)

View File

@ -115,7 +115,7 @@ static void mainboard_init(void *chip_info)
mainboard_ec_init(); mainboard_ec_init();
gpios = variant_gpio_table(&num_gpios); gpios = variant_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
/* Initialize i2c busses that were not initialized in bootblock */ /* Initialize i2c busses that were not initialized in bootblock */
i2c_soc_init(); i2c_soc_init();

View File

@ -21,7 +21,7 @@ void mainboard_romstage_entry(void)
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = variant_romstage_gpio_table(&num_gpios); gpios = variant_romstage_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
variant_romstage_entry(); variant_romstage_entry();
} }

View File

@ -15,7 +15,7 @@ void bootblock_mainboard_early_init(void)
if (!CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) { if (!CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
gpios = variant_early_gpio_table(&num_gpios); gpios = variant_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
printk(BIOS_DEBUG, "Bootblock configure eSPI\n"); printk(BIOS_DEBUG, "Bootblock configure eSPI\n");

View File

@ -22,7 +22,7 @@ void mainboard_smi_sleep(u8 slp_typ)
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS);
gpios = variant_sleep_gpio_table(&num_gpios); gpios = variant_sleep_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
int mainboard_smi_apmc(u8 apmc) int mainboard_smi_apmc(u8 apmc)

View File

@ -10,7 +10,7 @@ static void setup_gpio(void)
size_t num_gpios; size_t num_gpios;
if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) { if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
gpios = variant_early_gpio_table(&num_gpios); gpios = variant_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
} }

View File

@ -10,7 +10,7 @@ void bootblock_mainboard_early_init(void)
const struct soc_amd_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = variant_bootblock_gpio_table(&num_gpios, acpi_get_sleep_type()); gpios = variant_bootblock_gpio_table(&num_gpios, acpi_get_sleep_type());
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
variant_pcie_gpio_configure(); variant_pcie_gpio_configure();
} }

View File

@ -26,7 +26,7 @@ void mainboard_smi_sleep(u8 slp_typ)
MAINBOARD_EC_S5_WAKE_EVENTS); MAINBOARD_EC_S5_WAKE_EVENTS);
gpios = variant_sleep_gpio_table(&num_gpios, slp_typ); gpios = variant_sleep_gpio_table(&num_gpios, slp_typ);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
} }
int mainboard_smi_apmc(u8 apmc) int mainboard_smi_apmc(u8 apmc)

View File

@ -183,7 +183,7 @@ static void wifi_power_reset_configure_active_low_power(void)
/* EN_PWR_WIFI_L */ /* EN_PWR_WIFI_L */
PAD_GPO(GPIO_42, LOW), PAD_GPO(GPIO_42, LOW),
}; };
program_gpios(v3_wifi_table, ARRAY_SIZE(v3_wifi_table)); gpio_configure_pads(v3_wifi_table, ARRAY_SIZE(v3_wifi_table));
mdelay(50); mdelay(50);
gpio_set(GPIO_29, 0); gpio_set(GPIO_29, 0);
@ -208,7 +208,7 @@ static void wifi_power_reset_configure_active_high_power(void)
/* EN_PWR_WIFI */ /* EN_PWR_WIFI */
PAD_GPO(GPIO_42, LOW), PAD_GPO(GPIO_42, LOW),
}; };
program_gpios(v3_wifi_table, ARRAY_SIZE(v3_wifi_table)); gpio_configure_pads(v3_wifi_table, ARRAY_SIZE(v3_wifi_table));
mdelay(10); mdelay(10);
gpio_set(GPIO_42, 1); gpio_set(GPIO_42, 1);
@ -242,7 +242,7 @@ static void wifi_power_reset_configure_pre_v3(void)
/* EN_PWR_WIFI */ /* EN_PWR_WIFI */
PAD_GPO(GPIO_29, LOW), PAD_GPO(GPIO_29, LOW),
}; };
program_gpios(pre_v3_wifi_table, ARRAY_SIZE(pre_v3_wifi_table)); gpio_configure_pads(pre_v3_wifi_table, ARRAY_SIZE(pre_v3_wifi_table));
mdelay(10); mdelay(10);
gpio_set(GPIO_29, 1); gpio_set(GPIO_29, 1);
@ -267,7 +267,7 @@ __weak void variant_pcie_gpio_configure(void)
PAD_GPO(GPIO_142, HIGH), PAD_GPO(GPIO_142, HIGH),
}; };
program_gpios(pcie_gpio_table, ARRAY_SIZE(pcie_gpio_table)); gpio_configure_pads(pcie_gpio_table, ARRAY_SIZE(pcie_gpio_table));
/* Deassert PCIE_RST1_L */ /* Deassert PCIE_RST1_L */
gpio_set(GPIO_27, 1); gpio_set(GPIO_27, 1);

View File

@ -195,7 +195,7 @@ static void wifi_power_reset_configure_active_low_power(void)
/* EN_PWR_WIFI_L */ /* EN_PWR_WIFI_L */
PAD_GPO(GPIO_42, LOW), PAD_GPO(GPIO_42, LOW),
}; };
program_gpios(v3_wifi_table, ARRAY_SIZE(v3_wifi_table)); gpio_configure_pads(v3_wifi_table, ARRAY_SIZE(v3_wifi_table));
} }
@ -218,7 +218,7 @@ static void wifi_power_reset_configure_active_high_power(void)
/* EN_PWR_WIFI */ /* EN_PWR_WIFI */
PAD_GPO(GPIO_42, LOW), PAD_GPO(GPIO_42, LOW),
}; };
program_gpios(v3_wifi_table, ARRAY_SIZE(v3_wifi_table)); gpio_configure_pads(v3_wifi_table, ARRAY_SIZE(v3_wifi_table));
mdelay(10); mdelay(10);
gpio_set(GPIO_42, 1); gpio_set(GPIO_42, 1);
@ -252,7 +252,7 @@ static void wifi_power_reset_configure_pre_v3(void)
/* EN_PWR_WIFI */ /* EN_PWR_WIFI */
PAD_GPO(GPIO_29, LOW), PAD_GPO(GPIO_29, LOW),
}; };
program_gpios(pre_v3_wifi_table, ARRAY_SIZE(pre_v3_wifi_table)); gpio_configure_pads(pre_v3_wifi_table, ARRAY_SIZE(pre_v3_wifi_table));
mdelay(10); mdelay(10);
gpio_set(GPIO_29, 1); gpio_set(GPIO_29, 1);
@ -275,7 +275,7 @@ __weak void variant_pcie_gpio_configure(void)
PAD_GPO(GPIO_142, HIGH), PAD_GPO(GPIO_142, HIGH),
}; };
program_gpios(pcie_gpio_table, ARRAY_SIZE(pcie_gpio_table)); gpio_configure_pads(pcie_gpio_table, ARRAY_SIZE(pcie_gpio_table));
if (variant_uses_v3_schematics()) if (variant_uses_v3_schematics())
wifi_power_reset_configure_v3(); wifi_power_reset_configure_v3();

View File

@ -11,7 +11,7 @@ static void setup_gpio(void)
printk(BIOS_DEBUG, "Setting GPIOs\n"); printk(BIOS_DEBUG, "Setting GPIOs\n");
gpios = variant_early_gpio_table(&num_gpios); gpios = variant_early_gpio_table(&num_gpios);
program_gpios(gpios, num_gpios); gpio_configure_pads(gpios, num_gpios);
printk(BIOS_DEBUG, "GPIOs setup\n"); printk(BIOS_DEBUG, "GPIOs setup\n");
} }

View File

@ -60,14 +60,14 @@ const struct soc_amd_gpio gpio_apu5[] = {
static void early_lpc_init(void) static void early_lpc_init(void)
{ {
program_gpios(gpio_common, ARRAY_SIZE(gpio_common)); gpio_configure_pads(gpio_common, ARRAY_SIZE(gpio_common));
if (CONFIG(BOARD_PCENGINES_APU2)) if (CONFIG(BOARD_PCENGINES_APU2))
program_gpios(gpio_apu2, ARRAY_SIZE(gpio_apu2)); gpio_configure_pads(gpio_apu2, ARRAY_SIZE(gpio_apu2));
if (CONFIG(BOARD_PCENGINES_APU3) || CONFIG(BOARD_PCENGINES_APU4)) if (CONFIG(BOARD_PCENGINES_APU3) || CONFIG(BOARD_PCENGINES_APU4))
program_gpios(gpio_apu34, ARRAY_SIZE(gpio_apu34)); gpio_configure_pads(gpio_apu34, ARRAY_SIZE(gpio_apu34));
if (CONFIG(BOARD_PCENGINES_APU5)) if (CONFIG(BOARD_PCENGINES_APU5))
program_gpios(gpio_apu5, ARRAY_SIZE(gpio_apu5)); gpio_configure_pads(gpio_apu5, ARRAY_SIZE(gpio_apu5));
} }

View File

@ -45,7 +45,7 @@ void set_uart_config(unsigned int idx)
if (idx >= ARRAY_SIZE(uart_info)) if (idx >= ARRAY_SIZE(uart_info))
return; return;
program_gpios(uart_info[idx].mux, 2); gpio_configure_pads(uart_info[idx].mux, 2);
} }
static const char *uart_acpi_name(const struct device *dev) static const char *uart_acpi_name(const struct device *dev)

View File

@ -309,7 +309,7 @@ void gpio_configure_pads_with_override(const struct soc_amd_gpio *base_cfg,
master_switch_set(GPIO_INTERRUPT_EN); master_switch_set(GPIO_INTERRUPT_EN);
} }
void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size) void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
{ {
gpio_configure_pads_with_override(gpio_list_ptr, size, NULL, 0); gpio_configure_pads_with_override(gpio_list_ptr, size, NULL, 0);
} }

View File

@ -164,7 +164,7 @@ void sb_reset_i2c_peripherals(const struct soc_i2c_peripheral_reset_info *reset_
that will be changed need to be saved first */ that will be changed need to be saved first */
gpio_save_pin_registers(reset_info->i2c_scl[i].pin.gpio, &save_table[i]); gpio_save_pin_registers(reset_info->i2c_scl[i].pin.gpio, &save_table[i]);
/* Program SCL GPIO as output driven high */ /* Program SCL GPIO as output driven high */
program_gpios(&reset_info->i2c_scl[i].pin, 1); gpio_configure_pads(&reset_info->i2c_scl[i].pin, 1);
} }
/* /*

View File

@ -86,7 +86,7 @@ uintptr_t gpio_get_address(gpio_t gpio_num);
* *
* @return none * @return none
*/ */
void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size); void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size);
/* Return the interrupt status and clear if set. */ /* Return the interrupt status and clear if set. */
int gpio_interrupt_status(gpio_t gpio); int gpio_interrupt_status(gpio_t gpio);
/* Implemented by soc, provides table of available GPIO mapping to Gevents */ /* Implemented by soc, provides table of available GPIO mapping to Gevents */

View File

@ -53,7 +53,7 @@ void set_uart_config(unsigned int idx)
if (idx >= ARRAY_SIZE(uart_info)) if (idx >= ARRAY_SIZE(uart_info))
return; return;
program_gpios(uart_info[idx].mux, 2); gpio_configure_pads(uart_info[idx].mux, 2);
} }
static const char *uart_acpi_name(const struct device *dev) static const char *uart_acpi_name(const struct device *dev)