103 lines
4.5 KiB
C
Executable File
103 lines
4.5 KiB
C
Executable File
/*
|
|
* =====================================================================================
|
|
*
|
|
* Filename: boot.h
|
|
*
|
|
* Description: type definition for bootloader. pass parameters to kernel.
|
|
*
|
|
* Version: 2.0
|
|
* Create: 2017-11-03 11:40:16
|
|
* Revision: none
|
|
* Compiler: gcc version 6.3.0 (crosstool-NG crosstool-ng-1.23.0)
|
|
*
|
|
* Author: caozilong@allwinnertech.com
|
|
* Organization: BU1-PSW
|
|
* Last Modified: 2020-05-21 09:04:08
|
|
*
|
|
* =====================================================================================
|
|
*/
|
|
|
|
#ifndef BOOT_H
|
|
#define BOOT_H
|
|
#include <typedef.h>
|
|
|
|
#define MAGIC_SIZE 8
|
|
#define MELIS_VERSION "4.0.0"
|
|
#define MELIS_PLATFORM "1.0.0"
|
|
|
|
typedef struct _normal_gpio_cfg
|
|
{
|
|
char port; /* port : PA/PB/PC ... */
|
|
char port_num; /* internal port num: PA00/PA01 ... */
|
|
char mul_sel; /* function num: input/output/io-disalbe ...*/
|
|
char pull; /* pull-up/pull-down/no-pull */
|
|
char drv_level; /* driver level: level0-3*/
|
|
char data; /* pin state when the port is configured as input or output*/
|
|
char reserved[2];
|
|
} 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]; /* ='EPOS-IMG' */
|
|
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 ctrl num */
|
|
normal_gpio_cfg uart_gpio[2]; /* UART GPIO info */
|
|
int twi_port; /* TWI ctrl num */
|
|
normal_gpio_cfg twi_gpio[2]; /* TWI GPIO info */
|
|
int work_mode; /* boot,usb-burn, card-burn */
|
|
int storage_type; /* 0:nand 1:sdcard 2:spinor */
|
|
normal_gpio_cfg nand_gpio[32]; /* nand GPIO info */
|
|
char nand_spare_data[256]; /* nand info */
|
|
normal_gpio_cfg sdcard_gpio[32]; /* sdcard GPIO info */
|
|
char sdcard_spare_data[256]; /* sdcard info */
|
|
unsigned char secureos_exist;
|
|
unsigned char monitor_exist;
|
|
unsigned char func_mask; /* see enum UBOOT_FUNC_MASK_EN */
|
|
unsigned char res[1];
|
|
unsigned int uboot_start_sector_in_mmc; /*use in OTA update */
|
|
int dtb_offset; /*device tree in uboot */
|
|
int boot_package_size; /*boot package size, boot0 pass this value */
|
|
unsigned int dram_scan_size; /*dram real size */
|
|
int reserved[1]; /*reseved,256bytes align */
|
|
/*expend boot_ext[0](int[4]) in uboot 2014*/
|
|
uint16_t pmu_type;
|
|
uint16_t uart_input;
|
|
uint16_t key_input;
|
|
uint8_t secure_mode; /*update by update_uboot*/
|
|
uint8_t debug_mode; /*update by update_uboot*/
|
|
int reserved2[2];
|
|
};
|
|
|
|
struct spare_boot_ext_head
|
|
{
|
|
int data[4];
|
|
};
|
|
|
|
typedef struct spare_boot_head_t
|
|
{
|
|
struct spare_boot_ctrl_head boot_head;
|
|
struct spare_boot_data_head boot_data;
|
|
struct spare_boot_ext_head boot_ext[15];
|
|
}boot_head_t;
|
|
|
|
#endif /*BOOT_H*/
|