blob: 28e7df86473669a2e436fb9350a9a894fdf7d234 [file] [log] [blame]
qi.wang720127e2023-11-15 21:40:13 +08001#ifndef _ZAPPER_BOOT_H_
2#define _ZAPPER_BOOT_H_
3
4#include <amlogic/zapper_boot_common.h>
5
6enum ADC_KEY_TYPE {
7 NO_ADC_KEY_PRESS = 0,
8 ADC_KEY_A_PRESS,
9 ADC_KEY_B_PRESS,
10 ADC_KEY_C_PRESS,
11 UNKNOWN_KEY_PRESS,
12 ADC_DEVICE_ERROR,
13};
14
15enum JUMP_RECOVERY_TYPE {
16 NO_NEED_JUMP = 0,
17 USB_DETECT_JUMP,
18 OTA_DETECT_JUMP,
19 BOOT_CHECK_JUMP,
20 UNKNOWN_JUMP,
21};
22
linyang.li958823a2024-04-08 16:55:43 +080023enum RCU_COMBINATION_TYPE {
24 RCU_COMBINATION_ADVANCED_TUNING_CODE_SCREEN = 0,
25 RCU_COMBINATION_ADVANCED_SETUP_SCREEN = 1,
26 RCU_COMBINATION_USB_UPGRADE = 2,
27 RCU_COMBINATION_MANUAL_FORCED_DOWNLOAD = 3,
28 RCU_COMBINATION_FACTORY_RESET = 4,
29 RCU_COMBINATION_MAX = 5,
30};
qi.wang720127e2023-11-15 21:40:13 +080031
linyang.li1304a392024-04-20 16:36:22 +080032typedef enum {
33 LED_POWER_RED, /* The macro corresponds to the "Red" description of the Standby LED in the LDRS table */
34 LED_POWER_GREEN, /* The macro corresponds to the "Green" description of the Standby LED in the LDRS table */
35 LED_POWER_OFF, /* The macro corresponds to the "Off" description of the Standby LED in the LDRS table */
36 LED_REMOTE_RED, /* The macro corresponds to the "Red" description of the Remote LED in the LDRS table */
37 LED_REMOTE_OFF, /* The macro corresponds to the "Off" description of the Remote LED in the LDRS table */
38 LED_ALERT_YELLOW, /* The macro corresponds to the "Yellow" description of the Alert LED in the LDRS table */
39 LED_ALERT_OFF, /* The macro corresponds to the "Off" description of the Alert LED in the LDRS table */
40} led_display_type;
41
qi.wang720127e2023-11-15 21:40:13 +080042struct Zapper_boot_info {
43 unsigned char loader_partition_header[LD_HEADER_LENGTH];
44 unsigned char loader_partition[LD_LENGTH];
45 unsigned char error_code[EC_LENGTH];
46 unsigned char modify_flag;
47 unsigned char reboot_flag;
linyang.li958823a2024-04-08 16:55:43 +080048 unsigned char download_mode;
linyang.li1304a392024-04-20 16:36:22 +080049 unsigned char standby_flag;
qi.wang720127e2023-11-15 21:40:13 +080050
51 unsigned char bbcb_header[BBCB_HEADER_LENGTH];
52 unsigned char bbcb[BBCB_LENGTH];
53
54 unsigned char uk_header[UK_HEADER_LENGTH];
55 unsigned char uk[UK_LENGTH];
56
57 unsigned char kernel_header[KERNEL_HEADER_LENGTH];
58 unsigned char kernel[KERNEL_LENGTH];
59};
60
61int Zapper_get_usb_download_request(void);
62int Zapper_read_usb_file_name(char *file_name, int num);
63
64int Zapper_get_nand_hwconfig_partition_address(unsigned long long hwconfig_s, unsigned long long hwconfig_e);
65int Zapper_get_nand_ldflag_partition_address(unsigned long long ldflag_s, unsigned long long ldflag_e);
66int Zapper_get_nand_ldsec_partition_address(unsigned long long ldsec_s, unsigned long long ldsec_e);
67int Zapper_get_nand_kernel_partition_address(unsigned long long kernel_s, unsigned long long kernel_e);
68
69
70int Zapper_get_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info);
71int Zapper_get_nand_hwconfig_partition_info(struct Zapper_boot_info *p_s_e_boot_info);
72int Zapper_get_nand_ldsec_partition_info(struct Zapper_boot_info *p_s_e_boot_info);
73int Zapper_get_nand_kernel_partition_info(struct Zapper_boot_info *p_s_e_boot_info);
linyang.li1304a392024-04-20 16:36:22 +080074unsigned char Zapper_get_nand_standby_flag(void);
qi.wang720127e2023-11-15 21:40:13 +080075
76int Zapper_set_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info);
77
78
79int Zapper_get_key_info(unsigned char *key_index);
linyang.li958823a2024-04-08 16:55:43 +080080int Zapper_get_rcu_combination_type(unsigned char *type);
qi.wang720127e2023-11-15 21:40:13 +080081
82
83int Zapper_get_jump_recovery_status(unsigned char* status);
84int Zapper_set_jump_recovery_status(unsigned char status);
85int Zapper_clear_jump_recovery_status(void);
86
linyang.li1304a392024-04-20 16:36:22 +080087/* set led display type */
88void Zapper_led_set(led_display_type type);
89
90/* Illuminate the LED through the LED type */
91void Zapper_led_show(void);
qi.wang720127e2023-11-15 21:40:13 +080092
93#endif