summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2007-02-27 06:02:52 +0000
committerRonald G. Minnich <rminnich@gmail.com>2007-02-27 06:02:52 +0000
commit7513bfdb03d339625b521a383e415f8da7bb1385 (patch)
tree29e1f47be7e2770b79f87df19263c2e9fb424b97 /include
parent5274be0191ce4f22d9c8e99325f45d09ffd3a86b (diff)
downloadcoreboot-7513bfdb03d339625b521a383e415f8da7bb1385.tar.gz
coreboot-7513bfdb03d339625b521a383e415f8da7bb1385.tar.bz2
coreboot-7513bfdb03d339625b521a383e415f8da7bb1385.zip
Lots of changes here, build broken, but people need to see this.
renamed the phase3 etc. to stuff like phase3_scan, so you can get a rought idea what it is. The names mean more. adding pci_device and, at the same time, showing how we can get rid of the really ugly stuff that crept in. note you can specify ops in the dts, which avoids the need for hideous stuff like this: static void enable_dev(struct device *dev) { /* Set the operations if it is a special bus type */ if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) { dev->ops = &pci_domain_ops; pci_set_method(dev); } else if (dev->path.type == DEVICE_PATH_APIC_CLUSTER) { dev->ops = &cpu_bus_ops; } } So that foolishness is gone. added delay functions. Note that we have include/lib.h, and define all the functions in there, instead of in lots of fiddly includes. Brought back the enable op, once I understood it; renamed it to something that makes sense. I'll be on a plane soon, will continue to work, but at least you can see what's going on here. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@139 f3766cd6-281f-0410-b1cd-43a5c92072e9
Diffstat (limited to 'include')
-rw-r--r--include/device/device.h11
-rw-r--r--include/lib.h4
2 files changed, 11 insertions, 4 deletions
diff --git a/include/device/device.h b/include/device/device.h
index c8619c7fad2a..7300f2e12124 100644
--- a/include/device/device.h
+++ b/include/device/device.h
@@ -43,7 +43,6 @@ struct bus;
* The numbering is nice, the naming is nice, what to do?
*/
struct device_operations {
-// void (*enable)(struct device * dev);
/* for now, we leave these, since they seem generic */
void (*set_link)(struct device * dev, unsigned int link);
void (*reset_bus)(struct bus *bus);
@@ -55,18 +54,21 @@ struct device_operations {
void (*phase2)(struct device * dev);
/* phase 3 is for scanning the bus, if needed. */
- unsigned int (*phase3)(struct device * bus, unsigned int max);
+ unsigned int (*phase3_scan)(struct device * bus, unsigned int max);
/* typically used by phase4 */
/* again, if we never use this anywhere else, we may change the names */
void (*phase4_read_resources)(struct device * dev);
void (*phase4_set_resources)(struct device * dev);
+ /* some devices need to be enabled to scan, then disabled again. */
+ /* this function enables/disables according the value of 'enabled' in the device*/
+ void (*phase4_enable_disable)(struct device * dev);
/* phase 5: enable devices */
- void (*phase5)(struct device * dev);
+ void (*phase5_enable_resources)(struct device * dev);
/* phase 6: any post-setup device initialization that might be needed */
- void (*phase6)(struct device * dev);
+ void (*phase6_init)(struct device * dev);
const struct pci_operations *ops_pci;
const struct smbus_bus_operations *ops_smbus_bus;
@@ -182,6 +184,7 @@ void dev_init(void);
void dev_phase1(void);
void dev_phase2(void);
void dev_root_phase3(void);
+unsigned int dev_phase3_scan(struct device * busdevice, unsigned int max);
void dev_phase4(void);
void dev_root_phase5(void);
void dev_phase6(void);
diff --git a/include/lib.h b/include/lib.h
index cd69525609cd..7e4da0ed9bf1 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -22,4 +22,8 @@
unsigned long log2(unsigned long x);
+void udelay(unsigned usecs);
+void mdelay(unsigned msecs);
+void delay(unsigned secs);
+
#endif