Author: hailfinger Date: 2008-07-09 23:21:39 +0200 (Wed, 09 Jul 2008) New Revision: 693
Modified: coreboot-v3/device/pci_device.c coreboot-v3/mainboard/adl/msm800sev/Kconfig coreboot-v3/mainboard/adl/msm800sev/dts coreboot-v3/mainboard/amd/db800/Kconfig coreboot-v3/mainboard/amd/db800/dts coreboot-v3/mainboard/amd/norwich/Kconfig coreboot-v3/mainboard/amd/norwich/dts coreboot-v3/mainboard/artecgroup/dbe61/Kconfig coreboot-v3/mainboard/artecgroup/dbe61/dts coreboot-v3/mainboard/emulation/qemu-x86/Kconfig coreboot-v3/mainboard/emulation/qemu-x86/defconfig coreboot-v3/mainboard/emulation/qemu-x86/dts coreboot-v3/util/dtc/flattree.c Log: Move default mainboard vendor/subsystem from Kconfig to dts. Compile tested including boundary cases. Runtime tested on dbe62 by Ron. Works fine.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Ronald G. Minnich rminnich@gmail.com
Modified: coreboot-v3/device/pci_device.c =================================================================== --- coreboot-v3/device/pci_device.c 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/device/pci_device.c 2008-07-09 21:21:39 UTC (rev 693) @@ -50,6 +50,7 @@ #if CONFIG_CARDBUS_PLUGIN_SUPPORT == 1 #include <device/cardbus.h> #endif +#include <statictree.h>
u8 pci_moving_config8(struct device *dev, unsigned int reg) { @@ -627,19 +628,18 @@ /* Set the subsystem vendor and device ID for mainboard devices. */ ops = ops_pci(dev);
-#if defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID) && \ - defined(CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID) +#ifdef HAVE_MAINBOARD_PCI_SUBSYSTEM_ID if (dev->on_mainboard && ops && ops->set_subsystem) { printk(BIOS_DEBUG, "%s: Setting subsystem VID/DID to %02x/%02x\n", - dev_path(dev), CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + dev_path(dev), mainboard_pci_subsystem_vendor, + mainboard_pci_subsystem_device);
- ops->set_subsystem(dev, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + ops->set_subsystem(dev, mainboard_pci_subsystem_vendor, + mainboard_pci_subsystem_device); } #endif + command = pci_read_config16(dev, PCI_COMMAND); command |= dev->command; command |= (PCI_COMMAND_PARITY + PCI_COMMAND_SERR); // Error check.
Modified: coreboot-v3/mainboard/adl/msm800sev/Kconfig =================================================================== --- coreboot-v3/mainboard/adl/msm800sev/Kconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/adl/msm800sev/Kconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -26,19 +26,3 @@ help This is the name for the Advanced Digital Logic MSM800SEV mainboard.
-config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix the PCI ID. - default 0x1022 - depends BOARD_ADL_MSM800SEV - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix the PCI ID. - default 0x2323 - depends BOARD_ADL_MSM800SEV - help - Mainboard specific PCI subsystem vendor ID. -
Modified: coreboot-v3/mainboard/adl/msm800sev/dts =================================================================== --- coreboot-v3/mainboard/adl/msm800sev/dts 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/adl/msm800sev/dts 2008-07-09 21:21:39 UTC (rev 693) @@ -23,6 +23,8 @@ /{ mainboard-vendor = "Advanced Digital Logic"; mainboard-name = "MSM800SEV"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic@0 { /config/("northbridge/amd/geodelx/apic");
Modified: coreboot-v3/mainboard/amd/db800/Kconfig =================================================================== --- coreboot-v3/mainboard/amd/db800/Kconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/amd/db800/Kconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -26,19 +26,3 @@ help This is the default mainboard name.
-config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix PCI ID. - default 0x1022 - depends BOARD_AMD_DB800 - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix PCI ID. - default 0x2323 - depends BOARD_AMD_DB800 - help - Mainboard specific PCI subsystem device ID. -
Modified: coreboot-v3/mainboard/amd/db800/dts =================================================================== --- coreboot-v3/mainboard/amd/db800/dts 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/amd/db800/dts 2008-07-09 21:21:39 UTC (rev 693) @@ -21,6 +21,8 @@ /{ mainboard-vendor = "AMD"; mainboard-name = "DB800"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic@0 { /config/("northbridge/amd/geodelx/apic");
Modified: coreboot-v3/mainboard/amd/norwich/Kconfig =================================================================== --- coreboot-v3/mainboard/amd/norwich/Kconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/amd/norwich/Kconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -26,19 +26,3 @@ help This is the default mainboard name.
-config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix PCI ID. - default 0x1022 - depends BOARD_AMD_NORWICH - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix PCI ID. - default 0x2323 - depends BOARD_AMD_NORWICH - help - Mainboard specific PCI subsystem device ID. -
Modified: coreboot-v3/mainboard/amd/norwich/dts =================================================================== --- coreboot-v3/mainboard/amd/norwich/dts 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/amd/norwich/dts 2008-07-09 21:21:39 UTC (rev 693) @@ -21,6 +21,8 @@ /{ mainboard-vendor = "AMD"; mainboard-name = "NORWICH"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic@0 { /config/("northbridge/amd/geodelx/apic"); @@ -28,7 +30,7 @@ domain@0 { /config/("northbridge/amd/geodelx/domain"); /* Video RAM has to be in 2MB chunks. */ - geode_video_mb = "8"; + geode_video_mb = "8"; pci@1,0 { /config/("northbridge/amd/geodelx/pci"); };
Modified: coreboot-v3/mainboard/artecgroup/dbe61/Kconfig =================================================================== --- coreboot-v3/mainboard/artecgroup/dbe61/Kconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/artecgroup/dbe61/Kconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -26,19 +26,3 @@ help This is the default mainboard name.
-config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - # TODO: Fix PCI ID. - default 0x1022 - depends BOARD_ARTECGROUP_DBE61 - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - # TODO: Fix PCI ID. - default 0x2323 - depends BOARD_ARTECGROUP_DBE61 - help - Mainboard specific PCI subsystem device ID. -
Modified: coreboot-v3/mainboard/artecgroup/dbe61/dts =================================================================== --- coreboot-v3/mainboard/artecgroup/dbe61/dts 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/artecgroup/dbe61/dts 2008-07-09 21:21:39 UTC (rev 693) @@ -75,6 +75,8 @@ /{ mainboard-vendor = "Artec Group"; mainboard-name = "DBE61"; + mainboard_pci_subsystem_vendor = "0x1022"; + mainboard_pci_subsystem_device = "0x2323"; cpus { }; apic@0 { /config/("northbridge/amd/geodelx/apic");
Modified: coreboot-v3/mainboard/emulation/qemu-x86/Kconfig =================================================================== --- coreboot-v3/mainboard/emulation/qemu-x86/Kconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/emulation/qemu-x86/Kconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -27,17 +27,3 @@ help This is the default mainboard name.
-config MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID - hex - default 0x15ad - depends BOARD_EMULATION_QEMU_X86 - help - Mainboard specific PCI subsystem vendor ID. - -config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID - hex - default 0x1976 - depends BOARD_EMULATION_QEMU_X86 - help - Mainboard specific PCI subsystem device ID. -
Modified: coreboot-v3/mainboard/emulation/qemu-x86/defconfig =================================================================== --- coreboot-v3/mainboard/emulation/qemu-x86/defconfig 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/emulation/qemu-x86/defconfig 2008-07-09 21:21:39 UTC (rev 693) @@ -20,8 +20,6 @@ CONFIG_VENDOR_EMULATION=y # CONFIG_VENDOR_PCENGINES is not set CONFIG_MAINBOARD_NAME="emulation/qemu-x86" -CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID=0x15ad -CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID=0x1976 CONFIG_BOARD_EMULATION_QEMU_X86=y # CONFIG_COREBOOT_ROMSIZE_KB_128 is not set CONFIG_COREBOOT_ROMSIZE_KB_256=y
Modified: coreboot-v3/mainboard/emulation/qemu-x86/dts =================================================================== --- coreboot-v3/mainboard/emulation/qemu-x86/dts 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/mainboard/emulation/qemu-x86/dts 2008-07-09 21:21:39 UTC (rev 693) @@ -21,6 +21,8 @@ /{ mainboard-vendor = "Emulation"; mainboard-name = "QEMU x86"; + mainboard_pci_subsystem_vendor = "0x15ad"; + mainboard_pci_subsystem_device = "0x1976"; device_operations = "qemuvga_pci_ops_dev"; cpus {}; domain@0 {
Modified: coreboot-v3/util/dtc/flattree.c =================================================================== --- coreboot-v3/util/dtc/flattree.c 2008-07-03 19:42:05 UTC (rev 692) +++ coreboot-v3/util/dtc/flattree.c 2008-07-09 21:21:39 UTC (rev 693) @@ -1328,7 +1328,7 @@ extern char *code; struct node *next; extern struct node *first_node; - int found_mainboard_vendor = 0, found_mainboard_partnumber = 0; + int found_mainboard_vendor = 0, found_mainboard_partnumber = 0, found_mainboard_subsys = 0;
labeltree(bi->dt);
@@ -1361,6 +1361,14 @@ found_mainboard_partnumber = 1; fprintf(f, "const char *mainboard_part_number = "%s";\n", prop->val.val); } + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ + found_mainboard_subsys++; + fprintf(f, "const u16 mainboard_pci_subsystem_vendor = %s;\n", prop->val.val); + } + if (streq(prop->name, "mainboard_pci_subsystem_device")){ + found_mainboard_subsys++; + fprintf(f, "const u16 mainboard_pci_subsystem_device = %s;\n", prop->val.val); + } }
if (! found_mainboard_vendor){ @@ -1374,6 +1382,17 @@ "(and make sure there is a mainboard-vendor property too"); }
+ switch (found_mainboard_subsys) { + case 0: + break; + case 1: + die("There is only one of mainboard_pci_subsystem_vendor and " + "mainboard_pci_subsystem_device properties in the root. " + "Please add the other one or remove the existing one."); + break; + case 2: + break; + }
/* emit the code, if any */ if (code) @@ -1395,6 +1414,8 @@ char *symprefix = "dt"; extern char *code; struct node *next; + struct property *prop; + int found_mainboard_subsys = 0; extern struct node *first_node;
labeltree(bi->dt); @@ -1416,6 +1437,31 @@ /* emit any includes that we need -- TODO: ONLY ONCE PER TYPE*/ fprintf(f, "#include <device/device.h>\n#include <device/pci.h>\n"); fprintf(f, "extern const char *mainboard_vendor, *mainboard_part_number;\n"); + + for_each_property(bi->dt, prop) { + if (streq(prop->name, "mainboard_pci_subsystem_vendor")){ + found_mainboard_subsys++; + } + if (streq(prop->name, "mainboard_pci_subsystem_device")){ + found_mainboard_subsys++; + } + } + + switch (found_mainboard_subsys) { + case 0: + break; + case 1: + die("There is only one of mainboard_pci_subsystem_vendor and " + "mainboard_pci_subsystem_device properties in the root. " + "Please add the other one or remove the existing one."); + break; + case 2: + fprintf(f, "#define HAVE_MAINBOARD_PCI_SUBSYSTEM_ID\n"); + fprintf(f, "extern const u16 mainboard_pci_subsystem_vendor;\n"); + fprintf(f, "extern const u16 mainboard_pci_subsystem_device;\n"); + break; + } + flatten_tree_emit_includes(bi->dt, &coreboot_emitter, f, &strbuf, vi);
flatten_tree_emit_structdecls(bi->dt, &coreboot_emitter, f, &strbuf, vi);