summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/console_common.c13
-rw-r--r--common/startup.c4
2 files changed, 17 insertions, 0 deletions
diff --git a/common/console_common.c b/common/console_common.c
index 5d2ccdb6e7..cc184dfaef 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -169,6 +169,19 @@ int fputc(int fd, char c)
}
EXPORT_SYMBOL(fputc);
+struct console_device *console_get_by_dev(struct device_d *dev)
+{
+ struct console_device *cdev;
+
+ for_each_console(cdev) {
+ if (cdev->dev == dev)
+ return cdev;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(console_get_by_dev);
+
/*
* @brief returns current used console device
*
diff --git a/common/startup.c b/common/startup.c
index 0a36c07aae..2e0a4ba3dc 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -161,6 +161,8 @@ void __noreturn hang (void)
for (;;);
}
+void (*board_shutdown)(void);
+
/* Everything needed to cleanly shutdown barebox.
* Should be called before starting an OS to get
* the devices into a clean state
@@ -171,4 +173,6 @@ void shutdown_barebox(void)
#ifdef ARCH_SHUTDOWN
arch_shutdown();
#endif
+ if (board_shutdown)
+ board_shutdown();
}