Author: blueswirl Date: 2009-02-01 12:25:16 +0100 (Sun, 01 Feb 2009) New Revision: 437
Modified: openbios-devel/arch/ppc/qemu/init.c openbios-devel/arch/sparc64/openbios.c openbios-devel/drivers/pci_database.c openbios-devel/include/openbios/pci.h Log: Add #defines for PCI vendor and device IDs for all devices, taken from Linux and pciids.sourceforge.net.
Also fix a confusion between Sabre and Simba device IDs.
Modified: openbios-devel/arch/ppc/qemu/init.c =================================================================== --- openbios-devel/arch/ppc/qemu/init.c 2009-01-31 16:42:01 UTC (rev 436) +++ openbios-devel/arch/ppc/qemu/init.c 2009-02-01 11:25:16 UTC (rev 437) @@ -75,17 +75,23 @@ }
static const pci_arch_t known_arch[] = { - [ARCH_PREP] = { "PREP", 0x1057, 0x4801, 0x80800000, 0x800c0000, + [ARCH_PREP] = { "PREP", PCI_VENDOR_ID_MOTOROLA, + PCI_DEVICE_ID_MOTOROLA_RAVEN, + 0x80800000, 0x800c0000, 0x80000000, 0x00100000, 0xf0000000, 0x10000000, 0x80000000, 0x00010000, 0x00000000, 0x00400000, { 9, 11, 9, 11 } }, - [ARCH_MAC99] = { "MAC99", 0x106b, 0x001F, 0xf2800000, 0xf2c00000, + [ARCH_MAC99] = { "MAC99", PCI_VENDOR_ID_APPLE, + PCI_DEVICE_ID_APPLE_UNI_N_PCI, + 0xf2800000, 0xf2c00000, 0xf2000000, 0x02000000, 0x80000000, 0x10000000, 0xf2000000, 0x00800000, 0x00000000, 0x01000000, { 8, 9, 10, 11 } }, - [ARCH_HEATHROW] = { "HEATHROW", 0x1057, 0x0002, 0xfec00000, 0xfee00000, + [ARCH_HEATHROW] = { "HEATHROW", PCI_VENDOR_ID_MOTOROLA, + PCI_DEVICE_ID_MOTOROLA_MPC106, + 0xfec00000, 0xfee00000, 0x80000000, 0x7f000000, 0x80000000, 0x01000000, 0xfe000000, 0x00800000, 0xfd000000, 0x01000000, { 21, 22, 23, 24 }
Modified: openbios-devel/arch/sparc64/openbios.c =================================================================== --- openbios-devel/arch/sparc64/openbios.c 2009-01-31 16:42:01 UTC (rev 436) +++ openbios-devel/arch/sparc64/openbios.c 2009-02-01 11:25:16 UTC (rev 437) @@ -61,8 +61,8 @@ { .pci = { .name = "SUNW,sabre", - .vendor_id = 0x108e, - .device_id = 0x5000, + .vendor_id = PCI_VENDOR_ID_SUN, + .device_id = PCI_DEVICE_ID_SUN_SABRE, .cfg_addr = APB_SPECIAL_BASE + 0x1000000ULL, .cfg_data = APB_MEM_BASE, .cfg_base = 0x80000000ULL,
Modified: openbios-devel/drivers/pci_database.c =================================================================== --- openbios-devel/drivers/pci_database.c 2009-01-31 16:42:01 UTC (rev 436) +++ openbios-devel/drivers/pci_database.c 2009-02-01 11:25:16 UTC (rev 437) @@ -1,5 +1,6 @@ #include "openbios/config.h" #include "openbios/bindings.h" +#include "openbios/pci.h" #include "libc/vsprintf.h"
#include "pci_database.h" @@ -46,7 +47,7 @@
static const pci_dev_t ide_devices[] = { { - 0x1095, 0x0646, /* CMD646 IDE controller */ + PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, /* CMD646 IDE controller */ "pci-ide", "pci-ata", NULL, "pci1095,646\0pci1095,646\0pciclass,01018f\0", 0, 0, 0, @@ -96,10 +97,11 @@ };
static const pci_dev_t eth_devices[] = { - { 0x10EC, 0x8029, - NULL, "NE2000", "NE2000 PCI", NULL, - 0, 0, 0, - NULL, "ethernet", + { + PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_RTL8029, + NULL, "NE2000", "NE2000 PCI", NULL, + 0, 0, 0, + NULL, "ethernet", }, { 0xFFFF, 0xFFFF, @@ -150,13 +152,13 @@
static const pci_dev_t vga_devices[] = { { - 0x1002, 0x5046, + PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PF, NULL, "ATY", "ATY Rage128", "VGA\0", 0, 0, 0, NULL, NULL, }, { - 0x1234, 0x1111, + PCI_VENDOR_ID_QEMU, PCI_DEVICE_ID_QEMU_VGA, NULL, "QEMU,VGA", "Qemu VGA", "VGA\0", 0, 0, 0, NULL, NULL, @@ -248,38 +250,38 @@
static const pci_dev_t hbrg_devices[] = { { - 0x106B, 0x0020, NULL, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_AGP, NULL, "pci", "AAPL,UniNorth", "uni-north\0", 3, 2, 1, NULL, NULL }, { - 0x106B, 0x001F, NULL, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_PCI, NULL, "pci", "AAPL,UniNorth", "uni-north\0", 3, 2, 1, NULL, NULL }, { - 0x106B, 0x001E, NULL, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_I_PCI, NULL, "pci", "AAPL,UniNorth", "uni-north\0", 3, 2, 1, NULL, NULL }, { - 0x1057, 0x0002, "pci", + PCI_VENDOR_ID_MOTOROLA, PCI_DEVICE_ID_MOTOROLA_MPC106, "pci", "pci", "MOT,MPC106", "grackle\0", 3, 2, 1, host_config_cb, NULL }, { - 0x1057, 0x4801, NULL, + PCI_VENDOR_ID_MOTOROLA, PCI_DEVICE_ID_MOTOROLA_RAVEN, NULL, "pci-bridge", "PREP Host PCI Bridge - Motorola Raven", NULL, 3, 2, 1, NULL, NULL, }, { - 0x108e, 0xa000, NULL, - "pci", "SUNW,simba", "pci108e,a000\0pciclass,0\0", + PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SABRE, NULL, + "pci", "SUNW,sabre", "pci108e,a000\0pciclass,0\0", 3, 2, 1, host_config_cb, NULL, }, @@ -293,14 +295,14 @@
static const pci_dev_t PCIbrg_devices[] = { { - 0x1011, 0x0026, NULL, + PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21154, NULL, "pci-bridge", "DEV,21154", "DEV,21154\0pci-bridge\0", 3, 2, 1, bridge_config_cb, NULL, }, { - 0x108e, 0x5000, NULL, - "pci", "SUNW,sabre", "pci108e,5000\0pciclass,060400\0", + PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA, NULL, + "pci", "SUNW,simba", "pci108e,5000\0pciclass,060400\0", 3, 2, 1, bridge_config_cb, NULL, }, @@ -314,7 +316,7 @@
static const pci_dev_t miscbrg_devices[] = { { - 0x108e, 0x1000, NULL, + PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, NULL, "ebus", "ebus", "pci108e,1000\0pciclass,068000\0", 3, 2, 1, ebus_config_cb, NULL, @@ -589,14 +591,14 @@ static const pci_dev_t sys_devices[] = { /* IBM MPIC controller */ { - 0x1014, 0x0002, + PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OPENPIC, "open-pic", "MPIC", NULL, "chrp,open-pic\0", 0, 0, 2, NULL, NULL, }, /* IBM MPIC2 controller */ { - 0x1014, 0xFFFF, + PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OPENPIC2, "open-pic", "MPIC2", NULL, "chrp,open-pic\0", 0, 0, 2, NULL, NULL, @@ -956,21 +958,21 @@ static const pci_dev_t misc_pci[] = { /* Heathrow Mac I/O */ { - 0x106B, 0x0010, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_343S1201, "mac-io", "mac-io", "AAPL,343S1201", "heathrow\0", 1, 1, 1, &macio_config_cb, NULL, }, /* Paddington Mac I/O */ { - 0x106B, 0x0017, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_343S1211, "mac-io", "mac-io", "AAPL,343S1211", "paddington\0heathrow\0", 1, 1, 1, &macio_config_cb, NULL, }, /* KeyLargo Mac I/O */ { - 0x106B, 0x0022, + PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_KEYL, "mac-io", "mac-io", "AAPL,Keylargo", "Keylargo\0", 1, 1, 2, &macio_config_cb, NULL,
Modified: openbios-devel/include/openbios/pci.h =================================================================== --- openbios-devel/include/openbios/pci.h 2009-01-31 16:42:01 UTC (rev 436) +++ openbios-devel/include/openbios/pci.h 2009-02-01 11:25:16 UTC (rev 437) @@ -24,4 +24,44 @@
extern const pci_arch_t *arch;
+#define PCI_VENDOR_ID_ATI 0x1002 +#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046 + +#define PCI_VENDOR_ID_DEC 0x1011 +#define PCI_DEVICE_ID_DEC_21154 0x0026 + +#define PCI_VENDOR_ID_IBM 0x1014 +#define PCI_DEVICE_ID_IBM_OPENPIC 0x0002 +#define PCI_DEVICE_ID_IBM_OPENPIC2 0xffff + +#define PCI_VENDOR_ID_MOTOROLA 0x1057 +#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 +#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 + +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_DEVICE_ID_APPLE_343S1201 0x0010 +#define PCI_DEVICE_ID_APPLE_343S1211 0x0017 +#define PCI_DEVICE_ID_APPLE_UNI_N_I_PCI 0x001e +#define PCI_DEVICE_ID_APPLE_UNI_N_PCI 0x001f +#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 +#define PCI_DEVICE_ID_APPLE_UNI_N_KEYL 0x0022 + +#define PCI_VENDOR_ID_SUN 0x108e +#define PCI_DEVICE_ID_SUN_EBUS 0x1000 +#define PCI_DEVICE_ID_SUN_SIMBA 0x5000 +#define PCI_DEVICE_ID_SUN_PBM 0x8000 +#define PCI_DEVICE_ID_SUN_SABRE 0xa000 + +#define PCI_VENDOR_ID_CMD 0x1095 +#define PCI_DEVICE_ID_CMD_646 0x0646 + +#define PCI_VENDOR_ID_REALTEK 0x10ec +#define PCI_DEVICE_ID_REALTEK_RTL8029 0x8029 + +#define PCI_VENDOR_ID_QEMU 0x1234 +#define PCI_DEVICE_ID_QEMU_VGA 0x1111 + +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_DEVICE_ID_INTEL_82441 0x1237 + #endif /* _H_PCI */