From b2a10f826431ef01e2377eaa4fdf874a990a8cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 17 Aug 2019 06:28:40 +0300 Subject: [PATCH] devicetree: Remove weak declarations for ops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it compulsory to build with all the drivers that are visible in the board devicetree.cb file. Change-Id: Ifb783e2f733d5c65c615e5c1879e3e4c7a83e049 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/35086 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held Reviewed-by: Furquan Shaikh Reviewed-by: Angel Pons Reviewed-by: Nico Huber Reviewed-by: Duncan Laurie --- util/sconfig/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 6752b61cbb..b0c32f677a 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1170,9 +1170,16 @@ static void emit_chip_headers(FILE *fil, struct chip *chip) chip = tmp; while (chip) { - fprintf(fil, - "__attribute__((weak)) struct chip_operations %s_ops = {};\n", - chip->name_underscore); + /* A lot of cpus do not define chip_operations at all, and the ones + that do only initialise .name. */ + if (strstr(chip->name_underscore, "cpu_") == chip->name_underscore) { + fprintf(fil, + "__attribute__((weak)) struct chip_operations %s_ops = {};\n", + chip->name_underscore); + } else { + fprintf(fil, "extern struct chip_operations %s_ops;\n", + chip->name_underscore); + } chip = chip->next; } fprintf(fil, "#endif\n");