tizen 2.4 release
[kernel/u-boot-tm1.git] / include / boot_mode.h
1 #ifndef _BOOT_MODE_H_
2 #define _BOOT_MODE_H_
3 #include <asm/arch/sci_types.h>
4 #define CHECK_BOOTMODE_FUN_NUM 20
5
6 typedef enum{
7     CMD_NONE=0,
8     CMD_POWER_DOWN_DEVICE,
9     CMD_NORMAL_MODE,
10     CMD_RECOVERY_MODE,
11     CMD_FACTORYTEST_MODE,
12     CMD_FASTBOOT_MODE,
13     CMD_ALARM_MODE,
14     CMD_CHARGE_MODE,
15     CMD_ENGTEST_MODE,
16     CMD_WATCHDOG_REBOOT ,
17     CMD_SPECIAL_MODE,
18     CMD_UNKNOW_REBOOT_MODE,
19     CMD_PANIC_REBOOT,
20     CMD_CALIBRATION_MODE,
21     CMD_AUTOTEST_MODE,
22     CMD_AUTODLOADER_REBOOT,
23     CMD_EXT_RSTN_REBOOT_MODE,
24         CMD_THOR_MODE,
25     CMD_IQ_REBOOT_MODE,
26 }boot_mode_enum_type;
27
28 typedef boot_mode_enum_type (*CBOOT_FUNC) (void);
29 typedef void (*CBOOT_MODE_ENTRY) (void);
30
31 #define MODE_REGIST(index, fun) \
32     do{\
33             array[index]  = fun;\
34         }while(0)
35
36 boot_mode_enum_type get_mode_from_pctool(void);
37 #ifndef CONFIG_MACH_CORI
38 #if !defined(CONFIG_KANAS_W) && !defined(CONFIG_KANAS_TD)
39  boot_mode_enum_type get_mode_from_bat_low (void);
40 #endif
41 #endif
42 #ifdef CONFIG_SPRD_SYSDUMP
43  boot_mode_enum_type write_sysdump_before_boot_extend (void);
44 #endif
45  boot_mode_enum_type get_mode_from_file_extend (void);
46  boot_mode_enum_type get_mode_from_watchdog (void);
47  boot_mode_enum_type  get_mode_from_alarm_register(void);
48  boot_mode_enum_type  get_mode_from_charger(void);
49  boot_mode_enum_type  get_mode_from_keypad(void);
50  boot_mode_enum_type  get_mode_from_gpio_extend(void);
51
52 int get_mode_from_file(void);
53 void normal_mode(void);
54 void calibration_mode(void);
55 void autotest_mode(void);
56 void recovery_mode(void);
57 void charge_mode(void);
58 void fastboot_mode(void);
59 void thor_mode(void);
60 void factorytest_mode(void);
61 void alarm_mode(void);
62 BOOLEAN calibration_detect(int key);
63 void engtest_mode(void);
64 void watchdog_mode(void);
65 void unknow_reboot_mode(void);
66 void special_mode(void);
67 void panic_reboot_mode(void);
68 #ifdef CONFIG_AUTODLOADER
69 void autodloader_mode(void);
70 #else
71 #define autodloader_mode() do {} while (0)
72 #endif
73 void iq_mode(void);
74 int is_bat_low(void);
75 int alarm_flag_check(void);
76 int cali_file_check(void);
77 int read_adc_calibration_data(char *buffer,int size);
78 #define RECOVERY_MODE   0x77665502
79 #define FASTBOOT_MODE   0x77665500
80 #define NORMAL_MODE   0x77665503
81 #define ALARM_MODE   0x77665504
82 #define SLEEP_MODE   0x77665505
83 #define WATCHDOG_REBOOT 0x77665506
84 #define SPECIAL_MODE 0x77665507
85 #define UNKNOW_REBOOT_MODE 0x77665508
86 #define PANIC_REBOOT 0x77665509
87 #define CALIBRATION_MODE 0x7766550a
88 #define AUTODLOADER_REBOOT 0x77665510
89 #define EXT_RSTN_REBOOT_MODE 0x77665511
90 #define IQ_REBOOT_MODE 0x77665512
91 #define FACTORYTEST_MODE 0x77665513
92 #define THOR_MODE 0x77665514
93
94 #define BOOT_FASTBOOT FASTBOOT_MODE
95 #define BOOT_RECOVERY RECOVERY_MODE
96 #define BOOT_CALIBRATE CALIBRATION_MODE
97 #define BOOT_FACTORYTEST FACTORYTEST_MODE
98 #define BOOT_THOR_DOWNLOAD      THOR_MODE
99 #define BOOT_DLOADER 0xf5
100
101 #define BACKLIGHT_ON 1
102 #define BACKLIGHT_OFF 0
103
104 extern unsigned int check_key_boot(unsigned char key);
105 extern void vlx_nand_boot(char * kernel_pname, char * cmdline, int backlight_set);
106 #endif