- First pass through with with device tree enhancement merge. Most of the mechanisms should
be in place but don't expect anything to quite work yet.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1662 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/include/boot/tables.h b/src/include/boot/tables.h
index 618c32e..6c309b3 100644
--- a/src/include/boot/tables.h
+++ b/src/include/boot/tables.h
@@ -1,9 +1,8 @@
#ifndef BOOT_TABLES_H
#define BOOT_TABLES_H
-#include <mem.h>
#include <boot/linuxbios_tables.h>
-struct lb_memory *write_tables(struct mem_range *mem, unsigned long *processor_map);
+struct lb_memory *write_tables(void);
#endif /* BOOT_TABLES_H */
diff --git a/src/include/console/console.h b/src/include/console/console.h
index aeb5895..5d31dd1 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -10,7 +10,7 @@
unsigned char console_rx_byte(void);
int console_tst_byte(void);
void post_code(uint8_t value);
-void die(char *msg);
+void die(const char *msg);
struct console_driver {
void (*init)(void);
@@ -20,7 +20,7 @@
int (*tst_byte)(void);
};
-#define __console __attribute__((unused, __section__ (".rodata.console_drivers")))
+#define __console __attribute__((used, __section__ (".rodata.console_drivers")))
/* Defined by the linker... */
extern struct console_driver console_drivers[];
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 439fc60..6dade9e 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -42,8 +42,8 @@
device_t next; /* chain of all devices */
struct device_path path;
- unsigned short vendor;
- unsigned short device;
+ unsigned vendor;
+ unsigned device;
unsigned int class; /* 3 bytes: (base,sub,prog-if) */
unsigned int hdr_type; /* PCI header type */
unsigned int enabled : 1; /* set if we should enable the device */
diff --git a/src/include/device/path.h b/src/include/device/path.h
index 20d76d1..cd6be6a 100644
--- a/src/include/device/path.h
+++ b/src/include/device/path.h
@@ -4,9 +4,11 @@
enum device_path_type {
DEVICE_PATH_NONE = 0,
DEVICE_PATH_ROOT,
+ DEVICE_PATH_DEFAULT_CPU,
DEVICE_PATH_PCI,
DEVICE_PATH_PNP,
DEVICE_PATH_I2C,
+ DEVICE_PATH_APIC,
};
struct pci_path
@@ -26,12 +28,18 @@
unsigned device;
};
+struct apic_path
+{
+ unsigned apic_id;
+};
+
struct device_path {
enum device_path_type type;
union {
- struct pci_path pci;
- struct pnp_path pnp;
- struct i2c_path i2c;
+ struct pci_path pci;
+ struct pnp_path pnp;
+ struct i2c_path i2c;
+ struct apic_path apic;
} u;
};
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index ef18cb4..13414a7 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -21,13 +21,18 @@
#include <device/pci_ops.h>
+/* Common pci operations without a standard interface */
+struct pci_operations {
+ void (*set_subsystem)(device_t dev, unsigned vendor, unsigned device);
+};
+
struct pci_driver {
struct device_operations *ops;
unsigned short vendor;
unsigned short device;
};
-#define __pci_driver __attribute__ ((unused,__section__(".rodata.pci_driver")))
+#define __pci_driver __attribute__ ((used,__section__(".rodata.pci_driver")))
/** start of compile time generated pci driver array */
extern struct pci_driver pci_drivers[];
/** end of compile time generated pci driver array */
@@ -37,7 +42,6 @@
struct device_operations default_pci_ops_dev;
struct device_operations default_pci_ops_bus;
-
void pci_dev_read_resources(device_t dev);
void pci_bus_read_resources(device_t dev);
void pci_dev_set_resources(device_t dev);
@@ -45,8 +49,19 @@
void pci_bus_enable_resources(device_t dev);
unsigned int pci_scan_bridge(device_t bus, unsigned int max);
unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max);
+struct resource *pci_get_resource(struct device *dev, unsigned long index);
#define PCI_IO_BRIDGE_ALIGN 4096
#define PCI_MEM_BRIDGE_ALIGN (1024*1024)
+static inline struct pci_operations *ops_pci(device_t dev)
+{
+ struct pci_operations *pops;
+ pops = 0;
+ if (dev && dev->ops) {
+ pops = dev->ops->ops_pci;
+ }
+ return pops;
+}
+
#endif /* PCI_H */
diff --git a/src/include/device/pci_ids.h b/src/include/device/pci_ids.h
index df27c83..d840b38 100644
--- a/src/include/device/pci_ids.h
+++ b/src/include/device/pci_ids.h
@@ -1757,6 +1757,7 @@
#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
+#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
#define PCI_DEVICE_ID_INTEL_80310 0x530d
#define PCI_DEVICE_ID_INTEL_82810_MC1 0x7120
#define PCI_DEVICE_ID_INTEL_82810_IG1 0x7121
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h
index 508fac6..89c0a73 100644
--- a/src/include/device/pnp.h
+++ b/src/include/device/pnp.h
@@ -36,11 +36,13 @@
unsigned flags;
#define PNP_IO0 0x01
#define PNP_IO1 0x02
-#define PNP_IRQ0 0x04
-#define PNP_IRQ1 0x08
-#define PNP_DRQ0 0x10
-#define PNP_DRQ1 0x20
- struct io_info io0, io1;
+#define PNP_IO2 0x04
+#define PNP_IO3 0x08
+#define PNP_IRQ0 0x10
+#define PNP_IRQ1 0x20
+#define PNP_DRQ0 0x40
+#define PNP_DRQ1 0x80
+ struct io_info io0, io1, io2, io3;
};
struct resource *pnp_get_resource(device_t dev, unsigned index);
void pnp_enumerate(struct chip *chip, unsigned functions,
diff --git a/src/include/device/pnp_def.h b/src/include/device/pnp_def.h
index b077837..b17fde6 100644
--- a/src/include/device/pnp_def.h
+++ b/src/include/device/pnp_def.h
@@ -3,6 +3,8 @@
#define PNP_IDX_IO0 0x60
#define PNP_IDX_IO1 0x62
+#define PNP_IDX_IO2 0x64
+#define PNP_IDX_IO3 0x66
#define PNP_IDX_IRQ0 0x70
#define PNP_IDX_IRQ1 0x72
#define PNP_IDX_DRQ0 0x74