summaryrefslogtreecommitdiffstats
path: root/include/driver.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-02-21 01:17:10 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-03-19 12:21:18 +0100
commit0b5a776c1e9cc6dec8d5fa6d2f97eb8f19d3d325 (patch)
tree55e998b87b5b4e1cc9b34ffffc02d7ea851239f6 /include/driver.h
parent36ae69a2dcb443bd3d55086f2f620e0057c9d6a6 (diff)
downloadbarebox-0b5a776c1e9cc6dec8d5fa6d2f97eb8f19d3d325.tar.gz
barebox-0b5a776c1e9cc6dec8d5fa6d2f97eb8f19d3d325.tar.xz
Shutdown U-Boot before starting an OS
Some devices, especially the ones doing DMA should be disabled before giving control to an OS. We take the simple approach here: Just shutdown the devices in the reverse order they were activated. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/driver.h b/include/driver.h
index 45097a3c05..fdb40eb8f0 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -103,6 +103,7 @@ struct device_d {
struct list_head list; /* The list of all devices */
struct list_head children; /* our children */
struct list_head sibling;
+ struct list_head active; /* The list of all devices which have a driver */
struct device_d *parent; /* our parent, NULL if not present */
@@ -128,7 +129,7 @@ struct driver_d {
int (*probe) (struct device_d *);
/*! Called if an instance of a device is gone. */
- int (*remove)(struct device_d *);
+ void (*remove)(struct device_d *);
/*! Called in response of reading from this device. Required */
ssize_t (*read) (struct device_d*, void* buf, size_t count, ulong offset, ulong flags);
@@ -245,6 +246,11 @@ int mem_memmap(struct device_d *dev, void **map, int flags);
/* Use this if you have nothing to do in your drivers probe function */
int dummy_probe(struct device_d *);
+/* Iterate over all activated devices (i.e. the ones with drivers and shut
+ * them down.
+ */
+void devices_shutdown(void);
+
int generic_memmap_ro(struct device_d *dev, void **map, int flags);
int generic_memmap_rw(struct device_d *dev, void **map, int flags);