soc/amd/stoneyridge/include/soc/southbridge.c: Rename gpio structure

The GPIO definition structure has evolved to a point where it's no longer
specific to stoneyridge, though probably still specific to AMD. Therefore,
rename the GPIO declaration structure removing stoneyridge from it.

BUG=b:72875858
TEST=Build kahlee, grunt, gardenia.

Change-Id: Ib034d3f7840c36ee8f5c5384241d7326d3fe5543
Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-on: https://review.coreboot.org/25726
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Richard Spiegel
2018-04-18 08:06:33 -07:00
committed by Patrick Georgi
parent e6db189561
commit 6fcb9b00c8
11 changed files with 25 additions and 27 deletions

View File

@@ -21,7 +21,7 @@
void bootblock_mainboard_early_init(void) void bootblock_mainboard_early_init(void)
{ {
size_t num_gpios; size_t num_gpios;
const struct soc_amd_stoneyridge_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = early_gpio_table(&num_gpios); gpios = early_gpio_table(&num_gpios);
sb_program_gpios(gpios, num_gpios); sb_program_gpios(gpios, num_gpios);
} }

View File

@@ -24,7 +24,7 @@
* bootblock while GPIO pins used only by the OS should be initialized at * bootblock while GPIO pins used only by the OS should be initialized at
* ramstage. * ramstage.
*/ */
const struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = { static const struct soc_amd_gpio gpio_set_stage_reset[] = {
/* NFC PU */ /* NFC PU */
PAD_GPO(GPIO_64, HIGH), PAD_GPO(GPIO_64, HIGH),
/* PCIe presence detect */ /* PCIe presence detect */
@@ -45,7 +45,7 @@ const struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = {
PAD_NF(GPIO_143, UART1_TXD, PULL_NONE), PAD_NF(GPIO_143, UART1_TXD, PULL_NONE),
}; };
const struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = { static const struct soc_amd_gpio gpio_set_stage_ram[] = {
/* BT radio disable */ /* BT radio disable */
PAD_GPO(GPIO_14, HIGH), PAD_GPO(GPIO_14, HIGH),
/* NFC wake */ /* NFC wake */
@@ -56,13 +56,13 @@ const struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = {
PAD_GPO(GPIO_70, HIGH), PAD_GPO(GPIO_70, HIGH),
}; };
const struct soc_amd_stoneyridge_gpio *early_gpio_table(size_t *size) const struct soc_amd_gpio *early_gpio_table(size_t *size)
{ {
*size = ARRAY_SIZE(gpio_set_stage_reset); *size = ARRAY_SIZE(gpio_set_stage_reset);
return gpio_set_stage_reset; return gpio_set_stage_reset;
} }
const struct soc_amd_stoneyridge_gpio *gpio_table(size_t *size) const struct soc_amd_gpio *gpio_table(size_t *size)
{ {
*size = ARRAY_SIZE(gpio_set_stage_ram); *size = ARRAY_SIZE(gpio_set_stage_ram);
return gpio_set_stage_ram; return gpio_set_stage_ram;

View File

@@ -16,7 +16,7 @@
#ifndef MAINBOARD_GPIO_H #ifndef MAINBOARD_GPIO_H
#define MAINBOARD_GPIO_H #define MAINBOARD_GPIO_H
const struct soc_amd_stoneyridge_gpio *early_gpio_table(size_t *size); const struct soc_amd_gpio *early_gpio_table(size_t *size);
const struct soc_amd_stoneyridge_gpio *gpio_table(size_t *size); const struct soc_amd_gpio *gpio_table(size_t *size);
#endif /* MAINBOARD_GPIO_H */ #endif /* MAINBOARD_GPIO_H */

View File

@@ -81,7 +81,7 @@ static void pirq_setup(void)
static void mainboard_init(void *chip_info) static void mainboard_init(void *chip_info)
{ {
size_t num_gpios; size_t num_gpios;
const struct soc_amd_stoneyridge_gpio *gpios; const struct soc_amd_gpio *gpios;
gpios = gpio_table(&num_gpios); gpios = gpio_table(&num_gpios);
sb_program_gpios(gpios, num_gpios); sb_program_gpios(gpios, num_gpios);
} }

View File

@@ -23,7 +23,7 @@
void bootblock_mainboard_early_init(void) void bootblock_mainboard_early_init(void)
{ {
size_t num_gpios; size_t num_gpios;
const struct soc_amd_stoneyridge_gpio *gpios; const struct soc_amd_gpio *gpios;
/* Enable the EC as soon as we have visibility */ /* Enable the EC as soon as we have visibility */
mainboard_ec_init(); mainboard_ec_init();

View File

@@ -159,7 +159,7 @@ static void mainboard_init(void *chip_info)
size_t num; size_t num;
int boardid = board_id(); int boardid = board_id();
size_t num_gpios; size_t num_gpios;
const struct soc_amd_stoneyridge_gpio *gpios; const struct soc_amd_gpio *gpios;
printk(BIOS_INFO, "Board ID: %d\n", boardid); printk(BIOS_INFO, "Board ID: %d\n", boardid);

View File

@@ -25,7 +25,7 @@
* bootblock while GPIO pins used only by the OS should be initialized at * bootblock while GPIO pins used only by the OS should be initialized at
* ramstage. * ramstage.
*/ */
const static struct soc_amd_stoneyridge_gpio gpio_set_stage_reset_old[] = { static const struct soc_amd_gpio gpio_set_stage_reset_old[] = {
/* GPIO_0 - EC_PCH_PWR_BTN_ODL */ /* GPIO_0 - EC_PCH_PWR_BTN_ODL */
PAD_NF(GPIO_0, PWR_BTN_L, PULL_UP), PAD_NF(GPIO_0, PWR_BTN_L, PULL_UP),
@@ -196,7 +196,7 @@ const static struct soc_amd_stoneyridge_gpio gpio_set_stage_reset_old[] = {
PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE), PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE),
}; };
const static struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = { static const struct soc_amd_gpio gpio_set_stage_reset[] = {
/* GPIO_0 - EC_PCH_PWR_BTN_ODL */ /* GPIO_0 - EC_PCH_PWR_BTN_ODL */
PAD_NF(GPIO_0, PWR_BTN_L, PULL_UP), PAD_NF(GPIO_0, PWR_BTN_L, PULL_UP),
@@ -370,7 +370,7 @@ const static struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = {
PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE), PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE),
}; };
const static struct soc_amd_stoneyridge_gpio gpio_set_stage_ram_old[] = { static const struct soc_amd_gpio gpio_set_stage_ram_old[] = {
/* GPIO_2 - WLAN_PCIE_WAKE_3V3_ODL */ /* GPIO_2 - WLAN_PCIE_WAKE_3V3_ODL */
PAD_NF(GPIO_2, WAKE_L, PULL_UP), PAD_NF(GPIO_2, WAKE_L, PULL_UP),
@@ -429,7 +429,7 @@ const static struct soc_amd_stoneyridge_gpio gpio_set_stage_ram_old[] = {
PAD_GPI(GPIO_135, PULL_UP), PAD_GPI(GPIO_135, PULL_UP),
}; };
const static struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = { static const struct soc_amd_gpio gpio_set_stage_ram[] = {
/* GPIO_2 - WLAN_PCIE_WAKE_3V3_ODL */ /* GPIO_2 - WLAN_PCIE_WAKE_3V3_ODL */
PAD_NF(GPIO_2, WAKE_L, PULL_UP), PAD_NF(GPIO_2, WAKE_L, PULL_UP),
@@ -486,7 +486,7 @@ const static struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = {
}; };
const __attribute__((weak)) const __attribute__((weak))
struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size) struct soc_amd_gpio *variant_early_gpio_table(size_t *size)
{ {
if (board_id() < 2) { if (board_id() < 2) {
*size = ARRAY_SIZE(gpio_set_stage_reset_old); *size = ARRAY_SIZE(gpio_set_stage_reset_old);
@@ -498,7 +498,7 @@ struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size)
} }
const __attribute__((weak)) const __attribute__((weak))
struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size) struct soc_amd_gpio *variant_gpio_table(size_t *size)
{ {
if (board_id() < 2) { if (board_id() < 2) {
*size = ARRAY_SIZE(gpio_set_stage_ram_old); *size = ARRAY_SIZE(gpio_set_stage_ram_old);

View File

@@ -28,8 +28,8 @@ uint8_t variant_board_sku(void);
int variant_mainboard_read_spd(uint8_t spdAddress, char *buf, size_t len); int variant_mainboard_read_spd(uint8_t spdAddress, char *buf, size_t len);
int variant_get_xhci_oc_map(uint16_t *usb_oc_map); int variant_get_xhci_oc_map(uint16_t *usb_oc_map);
int variant_get_ehci_oc_map(uint16_t *usb_oc_map); int variant_get_ehci_oc_map(uint16_t *usb_oc_map);
const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size); const struct soc_amd_gpio *variant_early_gpio_table(size_t *size);
const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size); const struct soc_amd_gpio *variant_gpio_table(size_t *size);
void variant_romstage_entry(int s3_resume); void variant_romstage_entry(int s3_resume);
#endif /* __BASEBOARD_VARIANTS_H__ */ #endif /* __BASEBOARD_VARIANTS_H__ */

View File

@@ -24,7 +24,7 @@
* bootblock while GPIO pins used only by the OS should be initialized at * bootblock while GPIO pins used only by the OS should be initialized at
* ramstage. * ramstage.
*/ */
const struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = { static const struct soc_amd_gpio gpio_set_stage_reset[] = {
/* AGPIO2, to become event generator */ /* AGPIO2, to become event generator */
PAD_GPI(GPIO_2, PULL_UP), PAD_GPI(GPIO_2, PULL_UP),
@@ -71,7 +71,7 @@ const struct soc_amd_stoneyridge_gpio gpio_set_stage_reset[] = {
PAD_GPI(GPIO_144, PULL_NONE), PAD_GPI(GPIO_144, PULL_NONE),
}; };
const struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = { static const struct soc_amd_gpio gpio_set_stage_ram[] = {
/* AGPIO 12 */ /* AGPIO 12 */
PAD_GPI(GPIO_12, PULL_UP), PAD_GPI(GPIO_12, PULL_UP),
@@ -102,13 +102,13 @@ const struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = {
PAD_GPO(GPIO_119, HIGH), PAD_GPO(GPIO_119, HIGH),
}; };
const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size) const struct soc_amd_gpio *variant_early_gpio_table(size_t *size)
{ {
*size = ARRAY_SIZE(gpio_set_stage_reset); *size = ARRAY_SIZE(gpio_set_stage_reset);
return gpio_set_stage_reset; return gpio_set_stage_reset;
} }
const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size) const struct soc_amd_gpio *variant_gpio_table(size_t *size)
{ {
*size = ARRAY_SIZE(gpio_set_stage_ram); *size = ARRAY_SIZE(gpio_set_stage_ram);
return gpio_set_stage_ram; return gpio_set_stage_ram;

View File

@@ -352,7 +352,7 @@
#define FCH_AOAC_STAT0 BIT(6) #define FCH_AOAC_STAT0 BIT(6)
#define FCH_AOAC_STAT1 BIT(7) #define FCH_AOAC_STAT1 BIT(7)
struct soc_amd_stoneyridge_gpio { struct soc_amd_gpio {
uint8_t gpio; uint8_t gpio;
uint8_t function; uint8_t function;
uint8_t control; uint8_t control;
@@ -449,8 +449,7 @@ uint64_t get_uma_base(void);
* *
* @return none * @return none
*/ */
void sb_program_gpios(const struct soc_amd_stoneyridge_gpio *gpio_ptr, void sb_program_gpios(const struct soc_amd_gpio *gpio_ptr, size_t size);
size_t size);
/** /**
* @brief Find the size of a particular wide IO * @brief Find the size of a particular wide IO
* *

View File

@@ -172,8 +172,7 @@ const struct irq_idx_name *sb_get_apic_reg_association(size_t *size)
return irq_association; return irq_association;
} }
void sb_program_gpios(const struct soc_amd_stoneyridge_gpio *gpio_ptr, void sb_program_gpios(const struct soc_amd_gpio *gpio_ptr, size_t size)
size_t size)
{ {
void *tmp_ptr; void *tmp_ptr;
uint8_t control, mux, index; uint8_t control, mux, index;