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 | |
| 23 | |
| 24 | |
| 25 | struct Zapper_boot_info { |
| 26 | unsigned char loader_partition_header[LD_HEADER_LENGTH]; |
| 27 | unsigned char loader_partition[LD_LENGTH]; |
| 28 | unsigned char error_code[EC_LENGTH]; |
| 29 | unsigned char modify_flag; |
| 30 | unsigned char reboot_flag; |
| 31 | |
| 32 | unsigned char bbcb_header[BBCB_HEADER_LENGTH]; |
| 33 | unsigned char bbcb[BBCB_LENGTH]; |
| 34 | |
| 35 | unsigned char uk_header[UK_HEADER_LENGTH]; |
| 36 | unsigned char uk[UK_LENGTH]; |
| 37 | |
| 38 | unsigned char kernel_header[KERNEL_HEADER_LENGTH]; |
| 39 | unsigned char kernel[KERNEL_LENGTH]; |
| 40 | }; |
| 41 | |
| 42 | int Zapper_get_usb_download_request(void); |
| 43 | int Zapper_read_usb_file_name(char *file_name, int num); |
| 44 | |
| 45 | int Zapper_get_nand_hwconfig_partition_address(unsigned long long hwconfig_s, unsigned long long hwconfig_e); |
| 46 | int Zapper_get_nand_ldflag_partition_address(unsigned long long ldflag_s, unsigned long long ldflag_e); |
| 47 | int Zapper_get_nand_ldsec_partition_address(unsigned long long ldsec_s, unsigned long long ldsec_e); |
| 48 | int Zapper_get_nand_kernel_partition_address(unsigned long long kernel_s, unsigned long long kernel_e); |
| 49 | |
| 50 | |
| 51 | int Zapper_get_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 52 | int Zapper_get_nand_hwconfig_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 53 | int Zapper_get_nand_ldsec_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 54 | int Zapper_get_nand_kernel_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 55 | |
| 56 | int Zapper_set_nand_ldflag_partition_info(struct Zapper_boot_info *p_s_e_boot_info); |
| 57 | |
| 58 | |
| 59 | int Zapper_get_key_info(unsigned char *key_index); |
| 60 | |
| 61 | |
| 62 | int Zapper_get_jump_recovery_status(unsigned char* status); |
| 63 | int Zapper_set_jump_recovery_status(unsigned char status); |
| 64 | int Zapper_clear_jump_recovery_status(void); |
| 65 | |
| 66 | |
| 67 | #endif |