Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35086 )
Change subject: devicetree: Remove weak declarations for ops ......................................................................
devicetree: Remove weak declarations for ops
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 kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35086 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Duncan Laurie dlaurie@chromium.org --- M util/sconfig/main.c 1 file changed, 10 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, but someone else must approve Nico Huber: Looks good to me, approved Felix Held: Looks good to me, approved Furquan Shaikh: Looks good to me, approved Angel Pons: Looks good to me, but someone else must approve
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 6752b61c..b0c32f6 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1170,9 +1170,16 @@
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");