diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
commit | 67e0a30e77c0dadfb225eef7e9bdcccdcae4d679 (patch) | |
tree | aa1887ec66dc1e48eaeacca93ac38b55a49a3f99 /include | |
parent | b7ab2081b1f1f13f0823bb6e8e33884510e105d7 (diff) | |
parent | ce36b4a05e275dcc12e74e96ddae99c21faad466 (diff) | |
download | barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.gz barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.xz |
Merge branch 'for-next/restart'
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 1 | ||||
-rw-r--r-- | include/reset_source.h | 14 | ||||
-rw-r--r-- | include/restart.h | 21 | ||||
-rw-r--r-- | include/watchdog.h | 8 |
4 files changed, 41 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h index 6b9dd4d799..553a7f4f44 100644 --- a/include/common.h +++ b/include/common.h @@ -67,7 +67,6 @@ int readline (const char *prompt, char *buf, int len); long get_ram_size (volatile long *, long); /* $(CPU)/cpu.c */ -void __noreturn reset_cpu(unsigned long addr); void __noreturn poweroff(void); /* lib_$(ARCH)/time.c */ diff --git a/include/reset_source.h b/include/reset_source.h index 367f93b2ad..d484836dff 100644 --- a/include/reset_source.h +++ b/include/reset_source.h @@ -25,10 +25,11 @@ enum reset_src_type { }; #ifdef CONFIG_RESET_SOURCE -void reset_source_set(enum reset_src_type); +void reset_source_set_priority(enum reset_src_type, unsigned int priority); enum reset_src_type reset_source_get(void); #else -static inline void reset_source_set(enum reset_src_type unused) +static inline void reset_source_set_priority(enum reset_src_type type, + unsigned int priority) { } @@ -38,4 +39,13 @@ static inline enum reset_src_type reset_source_get(void) } #endif +#define RESET_SOURCE_DEFAULT_PRIORITY 100 + +static inline void reset_source_set(enum reset_src_type type) +{ + reset_source_set_priority(type, RESET_SOURCE_DEFAULT_PRIORITY); +} + +unsigned int of_get_reset_source_priority(struct device_node *node); + #endif /* __INCLUDE_RESET_SOURCE_H */ diff --git a/include/restart.h b/include/restart.h new file mode 100644 index 0000000000..79b57c8e11 --- /dev/null +++ b/include/restart.h @@ -0,0 +1,21 @@ +#ifndef __INCLUDE_RESTART_H +#define __INCLUDE_RESTART_H + +void __noreturn restart_machine(void); + +struct restart_handler { + void (*restart)(struct restart_handler *); + int priority; + const char *name; + struct list_head list; +}; + +int restart_handler_register(struct restart_handler *); +int restart_handler_register_fn(void (*restart_fn)(struct restart_handler *)); + +#define RESTART_DEFAULT_PRIORITY 100 +#define RESTART_DEFAULT_NAME "default" + +unsigned int of_get_restart_priority(struct device_node *node); + +#endif /* __INCLUDE_RESTART_H */ diff --git a/include/watchdog.h b/include/watchdog.h index 7a98ae4434..6fd896734b 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -15,6 +15,10 @@ struct watchdog { int (*set_timeout)(struct watchdog *, unsigned); + const char *name; + struct device_d *dev; + unsigned int priority; + struct list_head list; }; #ifdef CONFIG_WATCHDOG @@ -38,4 +42,8 @@ static inline int watchdog_set_timeout(unsigned t) } #endif +#define WATCHDOG_DEFAULT_PRIORITY 100 + +unsigned int of_get_watchdog_priority(struct device_node *node); + #endif /* INCLUDE_WATCHDOG_H */ |