[coreboot] New patch to review for coreboot: 02d3cf7 Provide weak empty declarations of all chip_ops used on a board

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Sun Oct 7 22:20:35 CEST 2012


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1567

-gerrit

commit 02d3cf7d5c47827d80b08f06b3d35b259d66c664
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Sun Oct 7 22:04:52 2012 +0200

    Provide weak empty declarations of all chip_ops used on a board
    
    sconfig creates empty defaults for all chip_ops, which can be overridden
    by drivers simply by providing a concrete implementation.
    
    Change-Id: Ib37515f0b0747bdbf4da780d28690a1e719944b2
    Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
---
 src/devices/Makefile.inc     |  3 ---
 src/devices/dummy_chip_ops.c | 30 ------------------------------
 util/sconfig/main.c          |  2 +-
 3 files changed, 1 insertion(+), 34 deletions(-)

diff --git a/src/devices/Makefile.inc b/src/devices/Makefile.inc
index 185ccc1..9d4b391 100644
--- a/src/devices/Makefile.inc
+++ b/src/devices/Makefile.inc
@@ -12,9 +12,6 @@ ramstage-y += pnp_device.c
 ramstage-y += pci_ops.c
 ramstage-y += smbus_ops.c
 
-# Work-around for chip.h removal
-ramstage-y += dummy_chip_ops.c
-
 romstage-y+= device_romstage.c
 
 subdirs-y += oprom
diff --git a/src/devices/dummy_chip_ops.c b/src/devices/dummy_chip_ops.c
deleted file mode 100644
index a2fc999..0000000
--- a/src/devices/dummy_chip_ops.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <device/device.h>
-
-/* Dummy chip_operations, so every chip has one for sure.
- * Temporary work-around before total chip.h removal.
- */
-
-struct chip_operations cpu_via_c3_ops = {};
-struct chip_operations cpu_via_c7_ops = {};
-struct chip_operations cpu_amd_geode_lx_ops = {};
-struct chip_operations cpu_amd_geode_gx1_ops = {};
-struct chip_operations cpu_amd_geode_gx2_ops = {};
-struct chip_operations drivers_ati_ragexl_ops = {};
-struct chip_operations drivers_dec_21143_ops = {};
-struct chip_operations drivers_generic_generic_ops = {};
-struct chip_operations drivers_oxford_oxpcie_ops = {};
-struct chip_operations drivers_realtek_ops = {};
-struct chip_operations drivers_sil_3114_ops = {};
-struct chip_operations drivers_trident_blade3d_ops = {};
-struct chip_operations southbridge_amd_amd8131_ops = {};
-struct chip_operations southbridge_amd_amd8132_ops = {};
-struct chip_operations southbridge_amd_amd8151_ops = {};
-struct chip_operations southbridge_broadcom_bcm21000_ops = {};
-struct chip_operations southbridge_broadcom_bcm5780_ops = {};
-struct chip_operations southbridge_intel_i82870_ops = {};
-struct chip_operations southbridge_rdc_r8610_ops = {};
-struct chip_operations southbridge_via_k8t890_ops = {};
-struct chip_operations superio_serverengines_pilot_ops = {};
-struct chip_operations superio_smsc_lpc47n207_ops = {};
-struct chip_operations superio_smsc_sio1007_ops = {};
-
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index f066d7b..1b0968f 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -625,7 +625,7 @@ int main(int argc, char** argv) {
 			h = h->next;
 			char *name_underscore = strdup(h->name);
 			translate_name(name_underscore, 0);
-			fprintf(autogen, "extern struct chip_operations %s_ops;\n", name_underscore);
+			fprintf(autogen, "__attribute__((weak)) struct chip_operations %s_ops = {};\n", name_underscore);
 			free(name_underscore);
 		}
 		fprintf(autogen, "#endif\n");




More information about the coreboot mailing list