int (*get_device_serial_number)(char *buffer, int len);
int (*get_device_revision)(int *revision);
int (*switch_partition)(int argc, char *argv[]);
+ int (*set_boot_success)(void);
+ int (*clear_boot_mode)(void);
+ int (*get_boot_mode)(int *mode);
+ int (*get_boot_reason)(int *reason);
} hal_backend_board_funcs;
#ifdef __cplusplus
return hal_board_funcs->switch_partition(argc, argv);
}
+
+int hal_device_board_set_boot_success(void)
+{
+ int ret;
+
+ if (!hal_board_funcs && !hal_initialized) {
+ if ((ret = hal_device_board_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_board_funcs ||
+ !hal_board_funcs->set_boot_success)
+ return -ENODEV;
+
+ return hal_board_funcs->set_boot_success();
+}
+
+
+int hal_device_board_clear_boot_mode(void)
+{
+ int ret;
+
+ if (!hal_board_funcs && !hal_initialized) {
+ if ((ret = hal_device_board_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_board_funcs ||
+ !hal_board_funcs->clear_boot_mode)
+ return -ENODEV;
+
+ return hal_board_funcs->clear_boot_mode();
+}
+
+int hal_device_board_get_boot_mode(int *mode)
+{
+ int ret;
+
+ if (!hal_board_funcs && !hal_initialized) {
+ if ((ret = hal_device_board_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_board_funcs ||
+ !hal_board_funcs->get_boot_mode)
+ return -ENODEV;
+
+ return hal_board_funcs->get_boot_mode(mode);
+}
+
+int hal_device_board_get_boot_reason(int *reason)
+{
+ int ret;
+
+ if (!hal_board_funcs && !hal_initialized) {
+ if ((ret = hal_device_board_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_board_funcs ||
+ !hal_board_funcs->get_boot_reason)
+ return -ENODEV;
+
+ return hal_board_funcs->get_boot_reason(reason);
+}