qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 1 | #ifndef _ZAPPER_BOOT_H_ |
| 2 | #define _ZAPPER_BOOT_H_ |
| 3 | |
| 4 | #include <amlogic/zapper_boot_common.h> |
| 5 | |
| 6 | enum 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 | |
| 15 | enum 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.li | 958823a | 2024-04-08 16:55:43 +0800 | [diff] [blame] | 23 | enum 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.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 31 | |
linyang.li | 1304a39 | 2024-04-20 16:36:22 +0800 | [diff] [blame^] | 32 | typedef 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.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 42 | struct 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.li | 958823a | 2024-04-08 16:55:43 +0800 | [diff] [blame] | 48 | unsigned char download_mode; |
linyang.li | 1304a39 | 2024-04-20 16:36:22 +0800 | [diff] [blame^] | 49 | unsigned char standby_flag; |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 50 | |
| 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 | |
| 61 | int Zapper_get_usb_download_request(void); |
| 62 | int Zapper_read_usb_file_name(char *file_name, int num); |
| 63 | |
| 64 | int Zapper_get_nand_hwconfig_partition_address(unsigned long long hwconfig_s, unsigned long long hwconfig_e); |
| 65 | int Zapper_get_nand_ldflag_partition_address(unsigned long long ldflag_s, unsigned long long ldflag_e); |
| 66 | int Zapper_get_nand_ldsec_partition_address(unsigned long long ldsec_s, unsigned long long ldsec_e); |
| 67 | int Zapper_get_nand_kernel_partition_address(unsigned long long kernel_s, unsigned long long kernel_e); |
| 68 | |
| 69 | |
| 70 | int Zapper_get_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 71 | int Zapper_get_nand_hwconfig_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 72 | int Zapper_get_nand_ldsec_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 73 | int Zapper_get_nand_kernel_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
linyang.li | 1304a39 | 2024-04-20 16:36:22 +0800 | [diff] [blame^] | 74 | unsigned char Zapper_get_nand_standby_flag(void); |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 75 | |
| 76 | int Zapper_set_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 77 | |
| 78 | |
| 79 | int Zapper_get_key_info(unsigned char *key_index); |
linyang.li | 958823a | 2024-04-08 16:55:43 +0800 | [diff] [blame] | 80 | int Zapper_get_rcu_combination_type(unsigned char *type); |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 81 | |
| 82 | |
| 83 | int Zapper_get_jump_recovery_status(unsigned char* status); |
| 84 | int Zapper_set_jump_recovery_status(unsigned char status); |
| 85 | int Zapper_clear_jump_recovery_status(void); |
| 86 | |
linyang.li | 1304a39 | 2024-04-20 16:36:22 +0800 | [diff] [blame^] | 87 | /* set led display type */ |
| 88 | void Zapper_led_set(led_display_type type); |
| 89 | |
| 90 | /* Illuminate the LED through the LED type */ |
| 91 | void Zapper_led_show(void); |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 92 | |
| 93 | #endif |