OSHW-DEIMOS/SOFTWARE/A64-TERES/sunxi-pack-tools/update_uboot_fdt/uboot_head.h
Dimitar Gamishev d867a2260d more stuff
2017-10-13 14:08:52 +03:00

66 lines
2.9 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __spare_head_h__
#define __spare_head_h__
#define UBOOT_MAGIC "uboot"
#define MAGIC_SIZE 8
typedef struct _normal_gpio_cfg
{
char port; //<2F>˿ں<CBBF>
char port_num; //<2F>˿<EFBFBD><CBBF>ڱ<EFBFBD><DAB1>
char mul_sel; //<2F><><EFBFBD>ܱ<EFBFBD><DCB1>
char pull; //<2F><><EFBFBD><EFBFBD>״̬
char drv_level; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char data; //<2F><><EFBFBD><EFBFBD><EFBFBD>ƽ
char reserved[2]; //<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>
}
normal_gpio_cfg;
/******************************************************************************/
/* the control information stored in file head */
/******************************************************************************/
struct spare_boot_ctrl_head
{
unsigned int jump_instruction; // one intruction jumping to real code
unsigned char magic[MAGIC_SIZE]; // ="u-boot"
unsigned int check_sum; // generated by PC
unsigned int align_size; // align size in byte
unsigned int length; // the size of all file
unsigned int uboot_length; // the size of uboot
unsigned char version[8]; // uboot version
unsigned char platform[8]; // platform information
int reserved[1]; //stamp space, 16bytes align
};
/******************************************************************************/
/* the data stored in file head */
/******************************************************************************/
struct spare_boot_data_head
{
unsigned int dram_para[32];
int run_clock; // Mhz
int run_core_vol; // mV
int uart_port; // UART<52><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
normal_gpio_cfg uart_gpio[2]; // UART<52><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>Դ<EFBFBD>ӡ<EFBFBD><D3A1>)GPIO<49><4F>Ϣ
int twi_port; // TWI<57><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
normal_gpio_cfg twi_gpio[2]; // TWI<57><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO<49><4F>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD>TWI
int work_mode; // <20><><EFBFBD><EFBFBD>ģʽ
int storage_type; // <20><EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<><30>nand 1<><31>sdcard 2: spinor
normal_gpio_cfg nand_gpio[32]; // nand GPIO<49><4F>Ϣ
char nand_spare_data[256]; // nand <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
normal_gpio_cfg sdcard_gpio[32]; // sdcard GPIO<49><4F>Ϣ
char sdcard_spare_data[256]; // sdcard <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
int secureos_exist;
int dtb_offset;
int reserved[4]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ, 256bytes align
};
struct spare_boot_head_t
{
struct spare_boot_ctrl_head boot_head;
struct spare_boot_data_head boot_data;
};
#endif