summaryrefslogtreecommitdiffstats
path: root/common
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 /common
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 'common')
-rw-r--r--common/startup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/startup.c b/common/startup.c
index 3a37eed293..7179f81203 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -156,3 +156,13 @@ void hang (void)
puts ("### ERROR ### Please RESET the board ###\n");
for (;;);
}
+
+/* Everything needed to cleanly shutdown U-Boot.
+ * Should be called before starting an OS to get
+ * the devices into a clean state
+ */
+void shutdown_uboot(void)
+{
+ devices_shutdown();
+}
+