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 | |
| 32 | struct Zapper_boot_info { |
| 33 | unsigned char loader_partition_header[LD_HEADER_LENGTH]; |
| 34 | unsigned char loader_partition[LD_LENGTH]; |
| 35 | unsigned char error_code[EC_LENGTH]; |
| 36 | unsigned char modify_flag; |
| 37 | unsigned char reboot_flag; |
linyang.li | 958823a | 2024-04-08 16:55:43 +0800 | [diff] [blame^] | 38 | unsigned char download_mode; |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 39 | |
| 40 | unsigned char bbcb_header[BBCB_HEADER_LENGTH]; |
| 41 | unsigned char bbcb[BBCB_LENGTH]; |
| 42 | |
| 43 | unsigned char uk_header[UK_HEADER_LENGTH]; |
| 44 | unsigned char uk[UK_LENGTH]; |
| 45 | |
| 46 | unsigned char kernel_header[KERNEL_HEADER_LENGTH]; |
| 47 | unsigned char kernel[KERNEL_LENGTH]; |
| 48 | }; |
| 49 | |
| 50 | int Zapper_get_usb_download_request(void); |
| 51 | int Zapper_read_usb_file_name(char *file_name, int num); |
| 52 | |
| 53 | int Zapper_get_nand_hwconfig_partition_address(unsigned long long hwconfig_s, unsigned long long hwconfig_e); |
| 54 | int Zapper_get_nand_ldflag_partition_address(unsigned long long ldflag_s, unsigned long long ldflag_e); |
| 55 | int Zapper_get_nand_ldsec_partition_address(unsigned long long ldsec_s, unsigned long long ldsec_e); |
| 56 | int Zapper_get_nand_kernel_partition_address(unsigned long long kernel_s, unsigned long long kernel_e); |
| 57 | |
| 58 | |
| 59 | int Zapper_get_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 60 | int Zapper_get_nand_hwconfig_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 61 | int Zapper_get_nand_ldsec_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 62 | int Zapper_get_nand_kernel_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 63 | |
| 64 | int Zapper_set_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 65 | |
| 66 | |
| 67 | int Zapper_get_key_info(unsigned char *key_index); |
linyang.li | 958823a | 2024-04-08 16:55:43 +0800 | [diff] [blame^] | 68 | int Zapper_get_rcu_combination_type(unsigned char *type); |
qi.wang | 720127e | 2023-11-15 21:40:13 +0800 | [diff] [blame] | 69 | |
| 70 | |
| 71 | int Zapper_get_jump_recovery_status(unsigned char* status); |
| 72 | int Zapper_set_jump_recovery_status(unsigned char status); |
| 73 | int Zapper_clear_jump_recovery_status(void); |
| 74 | |
| 75 | |
| 76 | #endif |