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/poppy | |
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/poppy')
4 files changed, 13 insertions, 9 deletions
diff --git a/src/mainboard/google/poppy/ramstage.c b/src/mainboard/google/poppy/ramstage.c index c038b4186e..ea15aea988 100644 --- a/src/mainboard/google/poppy/ramstage.c +++ b/src/mainboard/google/poppy/ramstage.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include <compiler.h> #include <baseboard/variants.h> #include <soc/ramstage.h> @@ -29,7 +30,7 @@ void mainboard_silicon_init_params(FSP_SIL_UPD *params) gpio_configure_pads(pads, num); } -void __attribute__((weak)) variant_devtree_update(void) +void __weak variant_devtree_update(void) { /* Override dev tree settings per board */ } diff --git a/src/mainboard/google/poppy/variants/baseboard/gpio.c b/src/mainboard/google/poppy/variants/baseboard/gpio.c index 2fea253624..25202e6139 100644 --- a/src/mainboard/google/poppy/variants/baseboard/gpio.c +++ b/src/mainboard/google/poppy/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 */ /* Leave eSPI pins untouched from default settings */ @@ -371,13 +372,13 @@ static const struct pad_config early_gpio_table[] = { PAD_CFG_GPI_APIC_INVERT(GPP_E0, NONE, PLTRST), }; -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; } -const struct pad_config * __attribute__((weak)) +const struct pad_config * __weak variant_early_gpio_table(size_t *num) { *num = ARRAY_SIZE(early_gpio_table); @@ -385,7 +386,7 @@ const struct pad_config * __attribute__((weak)) } /* override specific gpio by sku id */ -const struct pad_config * __attribute__((weak)) +const struct pad_config * __weak variant_sku_gpio_table(size_t *num) { *num = 0; @@ -397,7 +398,7 @@ static const struct cros_gpio cros_gpios[] = { CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_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/poppy/variants/baseboard/memory.c b/src/mainboard/google/poppy/variants/baseboard/memory.c index 8134f1a36e..95f2b9567c 100644 --- a/src/mainboard/google/poppy/variants/baseboard/memory.c +++ b/src/mainboard/google/poppy/variants/baseboard/memory.c @@ -14,6 +14,7 @@ */ #include <baseboard/variants.h> +#include <compiler.h> #include <gpio.h> #include <variant/gpio.h> @@ -37,7 +38,7 @@ static const u16 rcomp_resistor[] = { 200, 81, 162 }; /* Rcomp target */ static const u16 rcomp_target[] = { 100, 40, 40, 23, 40 }; -void __attribute__((weak)) variant_memory_params(struct memory_params *p) +void __weak variant_memory_params(struct memory_params *p) { p->type = MEMORY_LPDDR3; p->dq_map = dq_map; @@ -50,7 +51,7 @@ void __attribute__((weak)) variant_memory_params(struct memory_params *p) p->rcomp_target_size = sizeof(rcomp_target); } -int __attribute__((weak)) variant_memory_sku(void) +int __weak variant_memory_sku(void) { gpio_t spd_gpios[] = { GPIO_MEM_CONFIG_0, diff --git a/src/mainboard/google/poppy/variants/baseboard/nhlt.c b/src/mainboard/google/poppy/variants/baseboard/nhlt.c index 81557e41ea..927cb242da 100644 --- a/src/mainboard/google/poppy/variants/baseboard/nhlt.c +++ b/src/mainboard/google/poppy/variants/baseboard/nhlt.c @@ -14,11 +14,12 @@ */ #include <baseboard/variants.h> +#include <compiler.h> #include <console/console.h> #include <nhlt.h> #include <soc/nhlt.h> -void __attribute__((weak)) variant_nhlt_init(struct nhlt *nhlt) +void __weak variant_nhlt_init(struct nhlt *nhlt) { /* 2 Channel DMIC array. */ if (nhlt_soc_add_dmic_array(nhlt, 2)) @@ -37,7 +38,7 @@ void __attribute__((weak)) variant_nhlt_init(struct nhlt *nhlt) printk(BIOS_ERR, "Couldn't add Realtek RT5663.\n"); } -void __attribute__((weak)) variant_nhlt_oem_overrides(const char **oem_id, +void __weak variant_nhlt_oem_overrides(const char **oem_id, const char **oem_table_id, uint32_t *oem_revision) { |