summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-09-19 15:20:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-24 09:21:40 +0200
commit14e8e0a421004ae6fc3d9351fb44eb402e5da77a (patch)
tree9e5078486d6f90c8f97dd570fb45520ca9cb5077
parent47974cac82a59427972373a6d0e6c23eda81ba3b (diff)
downloadbarebox-14e8e0a421004ae6fc3d9351fb44eb402e5da77a.tar.gz
barebox-14e8e0a421004ae6fc3d9351fb44eb402e5da77a.tar.xz
shutdown: add board call back
so if we need to do something switch in the board we can fill this function pointer (as example on Animeo IP shutdown some rs232 & rs485) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/startup.c4
-rw-r--r--include/common.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/common/startup.c b/common/startup.c
index 9b33a92c86..ece852cdd4 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -159,6 +159,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
@@ -169,4 +171,6 @@ void shutdown_barebox(void)
#ifdef ARCH_SHUTDOWN
arch_shutdown();
#endif
+ if (board_shutdown)
+ board_shutdown();
}
diff --git a/include/common.h b/include/common.h
index 066827fd7d..0f0ba08c44 100644
--- a/include/common.h
+++ b/include/common.h
@@ -152,6 +152,7 @@ extern int (*barebox_main)(void);
void __noreturn start_barebox(void);
void shutdown_barebox(void);
+extern void (*board_shutdown)(void);
/*
* architectures which have special calling conventions for