diff options
author | Felix Singer <felixsinger@posteo.net> | 2020-11-21 13:55:28 +0000 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2020-11-23 12:02:20 +0000 |
commit | 8446935d3b81e37ba3590812d6f39b430f0d426e (patch) | |
tree | eb9f0f4f939d902aefd2c8e2ff032b2908887892 /src/mainboard/clevo/cml-u/variants | |
parent | 79c42635ae9f5be496ead2d760a63d0ab40a5f14 (diff) |
mb/clevo/cml-u: Get rid of gpio.h and use C files instead
Split up gpio.h into two seperate compilation units, gpio.c and
gpio_early.c, containing the complete configuration and a minimal
configuration used in early stages.
Tested on clevo/l140cu and it still boots.
Change-Id: I5b056e8faac0c426a37501dbc175373c22dde339
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47836
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Diffstat (limited to 'src/mainboard/clevo/cml-u/variants')
-rw-r--r-- | src/mainboard/clevo/cml-u/variants/l140cu/gpio.c (renamed from src/mainboard/clevo/cml-u/variants/l140cu/include/variant/gpio.h) | 23 | ||||
-rw-r--r-- | src/mainboard/clevo/cml-u/variants/l140cu/gpio_early.c | 17 |
2 files changed, 22 insertions, 18 deletions
diff --git a/src/mainboard/clevo/cml-u/variants/l140cu/include/variant/gpio.h b/src/mainboard/clevo/cml-u/variants/l140cu/gpio.c index 1f7d119947..475c2d56da 100644 --- a/src/mainboard/clevo/cml-u/variants/l140cu/include/variant/gpio.h +++ b/src/mainboard/clevo/cml-u/variants/l140cu/gpio.c @@ -1,24 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef MAINBOARD_GPIO_H -#define MAINBOARD_GPIO_H - +#include <mainboard/gpio.h> #include <soc/gpe.h> #include <soc/gpio.h> -#ifndef __ACPI__ - /* Name format: <pad name> / <net/pin name in schematics> */ - -/* Early pad configuration in romstage. */ -static const struct pad_config early_gpio_table[] = { - PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), /* UART2_RXD */ - PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), /* UART2_TXD */ - PAD_NC(GPP_C22, UP_20K), - PAD_NC(GPP_C23, UP_20K), -}; - -/* Pad configuration in ramstage. */ static const struct pad_config gpio_table[] = { /* ------- GPIO Group GPD ------- */ PAD_NC(GPD0, NONE), @@ -251,6 +237,7 @@ static const struct pad_config gpio_table[] = { PAD_NC(GPP_H23, UP_20K), }; -#endif - -#endif +void mainboard_configure_gpios(void) +{ + gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); +} diff --git a/src/mainboard/clevo/cml-u/variants/l140cu/gpio_early.c b/src/mainboard/clevo/cml-u/variants/l140cu/gpio_early.c new file mode 100644 index 0000000000..274efaf77f --- /dev/null +++ b/src/mainboard/clevo/cml-u/variants/l140cu/gpio_early.c @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <mainboard/gpio.h> +#include <soc/gpio.h> + +/* Name format: <pad name> / <net/pin name in schematics> */ +static const struct pad_config early_gpio_table[] = { + PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), /* UART2_RXD */ + PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), /* UART2_TXD */ + PAD_NC(GPP_C22, UP_20K), + PAD_NC(GPP_C23, UP_20K), +}; + +void mainboard_configure_early_gpios(void) +{ + gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); +} |