Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/51661 )
Change subject: lynxpoint/broadwell: Rename LP GPIO config global ......................................................................
lynxpoint/broadwell: Rename LP GPIO config global
Do not use the same name as the non-LP GPIO config. This allows checking at build-time that a mainboard uses the correct GPIO config format.
Without this commit, there are no build-time errors when using the wrong format of GPIO config, but there would be undefined behavior at runtime.
Tested by trying to build asrock/b85m_pro4 and hp/folio_9480m after toggling the `INTEL_LYNXPOINT_LP` Kconfig option (and trimming down the USB config arrays for asrock/b85m_pro4). In both cases, building failed because the necessary GPIO config global is not defined, as expected.
Change-Id: Ib06507ef8179da22bdb27593daf972e788051f3a Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/51661 Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/auron/variants/auron_paine/gpio.c M src/mainboard/google/auron/variants/auron_yuna/gpio.c M src/mainboard/google/auron/variants/buddy/gpio.c M src/mainboard/google/auron/variants/gandof/gpio.c M src/mainboard/google/auron/variants/lulu/gpio.c M src/mainboard/google/auron/variants/samus/gpio.c M src/mainboard/google/beltino/variants/mccloud/gpio.c M src/mainboard/google/beltino/variants/monroe/gpio.c M src/mainboard/google/beltino/variants/panther/gpio.c M src/mainboard/google/beltino/variants/tricky/gpio.c M src/mainboard/google/beltino/variants/zako/gpio.c M src/mainboard/google/jecht/variants/guado/gpio.c M src/mainboard/google/jecht/variants/jecht/gpio.c M src/mainboard/google/jecht/variants/rikku/gpio.c M src/mainboard/google/jecht/variants/tidus/gpio.c M src/mainboard/google/slippy/variants/falco/gpio.c M src/mainboard/google/slippy/variants/leon/gpio.c M src/mainboard/google/slippy/variants/peppy/gpio.c M src/mainboard/google/slippy/variants/wolf/gpio.c M src/mainboard/hp/folio_9480m/gpio.c M src/mainboard/intel/wtm2/gpio.c M src/mainboard/purism/librem_bdw/gpio.c M src/soc/intel/broadwell/romstage.c M src/southbridge/intel/lynxpoint/early_pch.c M src/southbridge/intel/lynxpoint/lp_gpio.h 25 files changed, 25 insertions(+), 25 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/src/mainboard/google/auron/variants/auron_paine/gpio.c b/src/mainboard/google/auron/variants/auron_paine/gpio.c index fb9ab95..2ed92cd 100644 --- a/src/mainboard/google/auron/variants/auron_paine/gpio.c +++ b/src/mainboard/google/auron/variants/auron_paine/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/auron/variants/auron_yuna/gpio.c b/src/mainboard/google/auron/variants/auron_yuna/gpio.c index fb9ab95..2ed92cd 100644 --- a/src/mainboard/google/auron/variants/auron_yuna/gpio.c +++ b/src/mainboard/google/auron/variants/auron_yuna/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/auron/variants/buddy/gpio.c b/src/mainboard/google/auron/variants/buddy/gpio.c index 826b1bd..0e27f97 100644 --- a/src/mainboard/google/auron/variants/buddy/gpio.c +++ b/src/mainboard/google/auron/variants/buddy/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/auron/variants/gandof/gpio.c b/src/mainboard/google/auron/variants/gandof/gpio.c index 0333d80..4d6592b 100644 --- a/src/mainboard/google/auron/variants/gandof/gpio.c +++ b/src/mainboard/google/auron/variants/gandof/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/auron/variants/lulu/gpio.c b/src/mainboard/google/auron/variants/lulu/gpio.c index a8378a1..eccf34b 100644 --- a/src/mainboard/google/auron/variants/lulu/gpio.c +++ b/src/mainboard/google/auron/variants/lulu/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/auron/variants/samus/gpio.c b/src/mainboard/google/auron/variants/samus/gpio.c index 3c1f4c5..f1b5510 100644 --- a/src/mainboard/google/auron/variants/samus/gpio.c +++ b/src/mainboard/google/auron/variants/samus/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/beltino/variants/mccloud/gpio.c b/src/mainboard/google/beltino/variants/mccloud/gpio.c index 91e808d..0f377ac 100644 --- a/src/mainboard/google/beltino/variants/mccloud/gpio.c +++ b/src/mainboard/google/beltino/variants/mccloud/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/beltino/variants/monroe/gpio.c b/src/mainboard/google/beltino/variants/monroe/gpio.c index 4aead21..b2af4cd 100644 --- a/src/mainboard/google/beltino/variants/monroe/gpio.c +++ b/src/mainboard/google/beltino/variants/monroe/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/beltino/variants/panther/gpio.c b/src/mainboard/google/beltino/variants/panther/gpio.c index 19e44e2..438b771 100644 --- a/src/mainboard/google/beltino/variants/panther/gpio.c +++ b/src/mainboard/google/beltino/variants/panther/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/beltino/variants/tricky/gpio.c b/src/mainboard/google/beltino/variants/tricky/gpio.c index 809a448..05394cd 100644 --- a/src/mainboard/google/beltino/variants/tricky/gpio.c +++ b/src/mainboard/google/beltino/variants/tricky/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/beltino/variants/zako/gpio.c b/src/mainboard/google/beltino/variants/zako/gpio.c index 15cb0c0..8f2e372 100644 --- a/src/mainboard/google/beltino/variants/zako/gpio.c +++ b/src/mainboard/google/beltino/variants/zako/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/jecht/variants/guado/gpio.c b/src/mainboard/google/jecht/variants/guado/gpio.c index 91e808d..0f377ac 100644 --- a/src/mainboard/google/jecht/variants/guado/gpio.c +++ b/src/mainboard/google/jecht/variants/guado/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/jecht/variants/jecht/gpio.c b/src/mainboard/google/jecht/variants/jecht/gpio.c index 19e44e2..438b771 100644 --- a/src/mainboard/google/jecht/variants/jecht/gpio.c +++ b/src/mainboard/google/jecht/variants/jecht/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/jecht/variants/rikku/gpio.c b/src/mainboard/google/jecht/variants/rikku/gpio.c index 91e808d..0f377ac 100644 --- a/src/mainboard/google/jecht/variants/rikku/gpio.c +++ b/src/mainboard/google/jecht/variants/rikku/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/jecht/variants/tidus/gpio.c b/src/mainboard/google/jecht/variants/tidus/gpio.c index a53b97a..abba4d9 100644 --- a/src/mainboard/google/jecht/variants/tidus/gpio.c +++ b/src/mainboard/google/jecht/variants/tidus/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/slippy/variants/falco/gpio.c b/src/mainboard/google/slippy/variants/falco/gpio.c index 86efbb8..b0d50a2 100644 --- a/src/mainboard/google/slippy/variants/falco/gpio.c +++ b/src/mainboard/google/slippy/variants/falco/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/slippy/variants/leon/gpio.c b/src/mainboard/google/slippy/variants/leon/gpio.c index 63babd6..7964ef3 100644 --- a/src/mainboard/google/slippy/variants/leon/gpio.c +++ b/src/mainboard/google/slippy/variants/leon/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/slippy/variants/peppy/gpio.c b/src/mainboard/google/slippy/variants/peppy/gpio.c index fb9ab95..2ed92cd 100644 --- a/src/mainboard/google/slippy/variants/peppy/gpio.c +++ b/src/mainboard/google/slippy/variants/peppy/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/google/slippy/variants/wolf/gpio.c b/src/mainboard/google/slippy/variants/wolf/gpio.c index 9be9077..0031f585 100644 --- a/src/mainboard/google/slippy/variants/wolf/gpio.c +++ b/src/mainboard/google/slippy/variants/wolf/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_UNUSED, /* 0: UNUSED */ LP_GPIO_UNUSED, /* 1: UNUSED */ LP_GPIO_UNUSED, /* 2: UNUSED */ diff --git a/src/mainboard/hp/folio_9480m/gpio.c b/src/mainboard/hp/folio_9480m/gpio.c index cb32f4f..016ac76 100644 --- a/src/mainboard/hp/folio_9480m/gpio.c +++ b/src/mainboard/hp/folio_9480m/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { [0] = { .conf0 = GPIO_MODE_GPIO | GPIO_DIR_INPUT | GPIO_IRQ_LEVEL }, [1] = { .conf0 = GPIO_MODE_GPIO | GPIO_DIR_INPUT | GPIO_INVERT | GPIO_IRQ_LEVEL }, [2] = LP_GPIO_OUT_LOW, diff --git a/src/mainboard/intel/wtm2/gpio.c b/src/mainboard/intel/wtm2/gpio.c index 9b087a1..ce8a5da 100644 --- a/src/mainboard/intel/wtm2/gpio.c +++ b/src/mainboard/intel/wtm2/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { LP_GPIO_NATIVE, /* 0: LPSS_UART1_RXD */ LP_GPIO_NATIVE, /* 1: LPSS_UART1_TXD */ LP_GPIO_NATIVE, /* 2: LPSS_UART1_RTS_N_R */ diff --git a/src/mainboard/purism/librem_bdw/gpio.c b/src/mainboard/purism/librem_bdw/gpio.c index d2994ae..dcb6cc6 100644 --- a/src/mainboard/purism/librem_bdw/gpio.c +++ b/src/mainboard/purism/librem_bdw/gpio.c @@ -2,7 +2,7 @@
#include <southbridge/intel/lynxpoint/lp_gpio.h>
-const struct pch_lp_gpio_map mainboard_gpio_map[] = { +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { [0] = LP_GPIO_INPUT, [1] = LP_GPIO_INPUT, [2] = LP_GPIO_INPUT, diff --git a/src/soc/intel/broadwell/romstage.c b/src/soc/intel/broadwell/romstage.c index 82ee73d..0ba6258 100644 --- a/src/soc/intel/broadwell/romstage.c +++ b/src/soc/intel/broadwell/romstage.c @@ -52,7 +52,7 @@ set_max_freq();
/* Initialize GPIOs */ - setup_pch_lp_gpios(mainboard_gpio_map); + setup_pch_lp_gpios(mainboard_lp_gpio_map);
mainboard_fill_pei_data(&pei_data); mainboard_fill_spd_data(&pei_data); diff --git a/src/southbridge/intel/lynxpoint/early_pch.c b/src/southbridge/intel/lynxpoint/early_pch.c index 66a3205..03823ff 100644 --- a/src/southbridge/intel/lynxpoint/early_pch.c +++ b/src/southbridge/intel/lynxpoint/early_pch.c @@ -90,7 +90,7 @@ pch_enable_bars();
#if CONFIG(INTEL_LYNXPOINT_LP) - setup_pch_lp_gpios(mainboard_gpio_map); + setup_pch_lp_gpios(mainboard_lp_gpio_map); #else setup_pch_gpios(&mainboard_gpio_map); #endif diff --git a/src/southbridge/intel/lynxpoint/lp_gpio.h b/src/southbridge/intel/lynxpoint/lp_gpio.h index e7f692d..fc40c3d 100644 --- a/src/southbridge/intel/lynxpoint/lp_gpio.h +++ b/src/southbridge/intel/lynxpoint/lp_gpio.h @@ -172,6 +172,6 @@ */ unsigned int get_gpios(const int *gpio_num_array);
-extern const struct pch_lp_gpio_map mainboard_gpio_map[]; +extern const struct pch_lp_gpio_map mainboard_lp_gpio_map[];
#endif