diff options
author | Aaron Durbin <adurbin@chromium.org> | 2018-04-21 14:45:32 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2018-04-24 14:37:59 +0000 |
commit | 6403167d290da235a732bd2d6157aa2124fb403a (patch) | |
tree | 9c4805af37a31830934f91098d299e967df930c6 /src/mainboard/google/reef/variants | |
parent | 38fd6685e9da61daadc96a8d537e6966dfe3b219 (diff) |
compiler.h: add __weak macro
Instead of writing out '__attribute__((weak))' use a shorter form.
Change-Id: If418a1d55052780077febd2d8f2089021f414b91
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/25767
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'src/mainboard/google/reef/variants')
-rw-r--r-- | src/mainboard/google/reef/variants/baseboard/gpio.c | 9 | ||||
-rw-r--r-- | src/mainboard/google/reef/variants/baseboard/memory.c | 5 | ||||
-rw-r--r-- | src/mainboard/google/reef/variants/baseboard/nhlt.c | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/mainboard/google/reef/variants/baseboard/gpio.c b/src/mainboard/google/reef/variants/baseboard/gpio.c index 7440cf8f2c..3cd765b359 100644 --- a/src/mainboard/google/reef/variants/baseboard/gpio.c +++ b/src/mainboard/google/reef/variants/baseboard/gpio.c @@ -16,6 +16,7 @@ #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <commonlib/helpers.h> +#include <compiler.h> /* * Pad configuration in ramstage. The order largely follows the 'GPIO Muxing' @@ -345,7 +346,7 @@ static const struct pad_config gpio_table[] = { PAD_CFG_GPI(GPIO_73, UP_20K, DEEP), /* GP_CAMERASB11 */ }; -const struct pad_config * __attribute__((weak)) variant_gpio_table(size_t *num) +const struct pad_config * __weak variant_gpio_table(size_t *num) { *num = ARRAY_SIZE(gpio_table); return gpio_table; @@ -362,7 +363,7 @@ static const struct pad_config early_gpio_table[] = { PAD_CFG_GPO(GPIO_122, 0, DEEP), /* SIO_SPI_2_RXD */ }; -const struct pad_config * __attribute__((weak)) +const struct pad_config * __weak variant_early_gpio_table(size_t *num) { *num = ARRAY_SIZE(early_gpio_table); @@ -375,7 +376,7 @@ static const struct pad_config sleep_gpio_table[] = { PAD_CFG_GPI_APIC_LOW(GPIO_20, NONE, DEEP), /* NFC_INT_L */ }; -const struct pad_config * __attribute__((weak)) +const struct pad_config * __weak variant_sleep_gpio_table(u8 slp_typ, size_t *num) { *num = ARRAY_SIZE(sleep_gpio_table); @@ -388,7 +389,7 @@ static const struct cros_gpio cros_gpios[] = { CROS_GPIO_PE_AH(PAD_N(GPIO_SHIP_MODE), GPIO_COMM_N_NAME), }; -const struct cros_gpio * __attribute__((weak)) variant_cros_gpios(size_t *num) +const struct cros_gpio * __weak variant_cros_gpios(size_t *num) { *num = ARRAY_SIZE(cros_gpios); return cros_gpios; diff --git a/src/mainboard/google/reef/variants/baseboard/memory.c b/src/mainboard/google/reef/variants/baseboard/memory.c index 50e93c7d19..364c0ee093 100644 --- a/src/mainboard/google/reef/variants/baseboard/memory.c +++ b/src/mainboard/google/reef/variants/baseboard/memory.c @@ -14,6 +14,7 @@ */ #include <baseboard/variants.h> +#include <compiler.h> #include <gpio.h> #include <soc/meminit.h> #include <variant/gpio.h> @@ -137,12 +138,12 @@ static const struct lpddr4_cfg lp4cfg = { .swizzle_config = &baseboard_lpddr4_swizzle, }; -const struct lpddr4_cfg * __attribute__((weak)) variant_lpddr4_config(void) +const struct lpddr4_cfg * __weak variant_lpddr4_config(void) { return &lp4cfg; } -size_t __attribute__((weak)) variant_memory_sku(void) +size_t __weak variant_memory_sku(void) { gpio_t pads[] = { [3] = MEM_CONFIG3, [2] = MEM_CONFIG2, diff --git a/src/mainboard/google/reef/variants/baseboard/nhlt.c b/src/mainboard/google/reef/variants/baseboard/nhlt.c index b9357962df..188766954e 100644 --- a/src/mainboard/google/reef/variants/baseboard/nhlt.c +++ b/src/mainboard/google/reef/variants/baseboard/nhlt.c @@ -14,13 +14,14 @@ */ #include <baseboard/variants.h> +#include <compiler.h> #include <console/console.h> #include <nhlt.h> #include <soc/nhlt.h> #include <gpio.h> #include <baseboard/gpio.h> -void __attribute__((weak)) variant_nhlt_init(struct nhlt *nhlt) +void __weak variant_nhlt_init(struct nhlt *nhlt) { /* 1-dmic configuration */ if (IS_ENABLED(CONFIG_NHLT_DMIC_1CH_16B) && |