diff --git a/include/platform.h b/include/platform.h index 553cfb63..27a952fa 100644 --- a/include/platform.h +++ b/include/platform.h @@ -79,4 +79,7 @@ platform_halt_reason platform_get_reboot_reason(void); void platform_halt(platform_halt_action suggested_action, platform_halt_reason reason) __NO_RETURN; +/* called during chain loading to make sure drivers and platform is put into a stopped state */ +void platform_quiesce(void); + #endif diff --git a/include/target.h b/include/target.h index 505381e4..7d0496c8 100644 --- a/include/target.h +++ b/include/target.h @@ -31,6 +31,9 @@ void target_early_init(void); /* later init, after the kernel has come up */ void target_init(void); +/* called during chain loading to make sure target specific bits are put into a stopped state */ +void target_quiesce(void); + /* a target can optionally define a set of debug leds that can be used * in various locations in the system. */ diff --git a/platform/init.c b/platform/init.c index 63a14ded..65bf9eb1 100644 --- a/platform/init.c +++ b/platform/init.c @@ -41,3 +41,7 @@ __WEAK void platform_init(void) { } +__WEAK void platform_quiesce(void) +{ +} + diff --git a/platform/zynq/platform.c b/platform/zynq/platform.c index 4aea0c67..6cc652b5 100644 --- a/platform/zynq/platform.c +++ b/platform/zynq/platform.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "platform_p.h" /* target can specify this as the initial jam table to set up the soc */ @@ -173,3 +174,10 @@ void platform_init(void) } } +void platform_quiesce(void) +{ + gem_disable(); + + platform_stop_timer(); +} + diff --git a/target/init.c b/target/init.c index 1873a9c7..80470b63 100644 --- a/target/init.c +++ b/target/init.c @@ -42,3 +42,7 @@ __WEAK void target_set_led(unsigned int led, bool on) { } +__WEAK void target_quiesce(void) +{ +} +