summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-07-18 18:21:25 -0700
committerMartin Roth <martinroth@google.com>2016-07-25 18:57:32 +0200
commitde110ee07d3e3c4bd0e7d65093cf58beaa5a3748 (patch)
tree104ddd03f62a0f86a2e369af90db9a1cfa63a951 /src/mainboard
parent85aa1353264e34b9060e6c35a09eff3def47cc70 (diff)
downloadcoreboot-de110ee07d3e3c4bd0e7d65093cf58beaa5a3748.tar.xz
google/gru: Change UART _Static_assert() condition to #if
_Static_assert() gets evaluated even when the code path it's in is unreachable (e.g. inside an if (0) block). Unfortunately, Kconfigs that depend on a disabled Kconfig are always 0, meaning that CONFIG_CONSOLE_SERIAL_UART_ADDRESS on Gru cannot evaluate to UART2 when CONFIG_CONSOLE_SERIAL (which it depends on) is disabled. Switch the condition it is wrapped in to a preprocessor #if so that the _Static_assert() is not evaluated when building without serial support. BRANCH=None BUG=None TEST=Built and booted Kevin without serial Change-Id: I391325fcc4b7d64b4866a7fce4444e2f28365b7d Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: f5e5cf0644154eca5b347ea381df3f6b28287524 Original-Change-Id: I33d51d4ef09b218c14173d39a12795f0cef6bb40 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/361581 Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://review.coreboot.org/15810 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/gru/bootblock.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mainboard/google/gru/bootblock.c b/src/mainboard/google/gru/bootblock.c
index 0e485cf821..20334953a1 100644
--- a/src/mainboard/google/gru/bootblock.c
+++ b/src/mainboard/google/gru/bootblock.c
@@ -45,16 +45,16 @@ void bootblock_mainboard_early_init(void)
gpio_output(GPIO(0, B, 2), 1); /* PP1500_EN */
gpio_output(GPIO(0, B, 4), 1); /* PP3000_EN */
- if (IS_ENABLED(CONFIG_DRIVERS_UART)) {
- _Static_assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE,
- "CONSOLE_SERIAL_UART should be UART2");
+#if IS_ENABLED(CONFIG_DRIVERS_UART)
+ _Static_assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE,
+ "CONSOLE_SERIAL_UART should be UART2");
- /* iomux: select gpio4c[4:3] as uart2 dbg port */
- write32(&rk3399_grf->iomux_uart2c, IOMUX_UART2C);
+ /* iomux: select gpio4c[4:3] as uart2 dbg port */
+ write32(&rk3399_grf->iomux_uart2c, IOMUX_UART2C);
- /* grf soc_con7[11:10] use for uart2 select */
- write32(&rk3399_grf->soc_con7, UART2C_SEL);
- }
+ /* grf soc_con7[11:10] use for uart2 select */
+ write32(&rk3399_grf->soc_con7, UART2C_SEL);
+#endif
}
void bootblock_mainboard_init(void)