122 lines
4.1 KiB
C
122 lines
4.1 KiB
C
|
/*
|
|||
|
* (C) Copyright 2007-2013
|
|||
|
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|||
|
* Jerry Wang <wangflord@allwinnertech.com>
|
|||
|
*
|
|||
|
* See file CREDITS for list of people who contributed to this
|
|||
|
* project.
|
|||
|
*
|
|||
|
* This program is free software; you can redistribute it and/or
|
|||
|
* modify it under the terms of the GNU General Public License as
|
|||
|
* published by the Free Software Foundation; either version 2 of
|
|||
|
* the License, or (at your option) any later version.
|
|||
|
*
|
|||
|
* This program is distributed in the hope that it will be useful,
|
|||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
|
* GNU General Public License for more details.
|
|||
|
*
|
|||
|
* You should have received a copy of the GNU General Public License
|
|||
|
* along with this program; if not, write to the Free Software
|
|||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|||
|
* MA 02111-1307 USA
|
|||
|
*/
|
|||
|
|
|||
|
#ifndef __toc_v2_h
|
|||
|
#define __toc_v2_h
|
|||
|
|
|||
|
|
|||
|
#include "spare_head.h"
|
|||
|
|
|||
|
#define TOC0_MAGIC "TOC0.GLH"
|
|||
|
#define TOC_MAIN_INFO_MAGIC 0x89119800
|
|||
|
|
|||
|
|
|||
|
#define SECURE_SWITCH_OTHER 0
|
|||
|
#define SECURE_SWITCH_NORMAL 1
|
|||
|
#define SECURE_NON_SECUREOS 2
|
|||
|
|
|||
|
//<2F><><EFBFBD>Ӱ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>toc0<63><30>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>ݽṹ
|
|||
|
typedef struct
|
|||
|
{
|
|||
|
u8 name[8]; //<2F>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8>ģ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
u32 magic; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0x89119800
|
|||
|
u32 check_sum; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>У<EFBFBD><D0A3><EFBFBD>ͣ<EFBFBD><CDA3>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD>boot0<74><30><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
u32 serial_num; //<2F><><EFBFBD>кţ<D0BA><C5A3><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8>ģ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
u32 status; //<2F><><EFBFBD>Ը<EFBFBD><D4B8>ģ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
u32 items_nr; //<2F>ܵ<EFBFBD><DCB5><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TOC0<43><30>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
|||
|
u32 length; //TOC0<43>ij<EFBFBD><C4B3><EFBFBD>
|
|||
|
u8 platform[4]; //toc_platform[0]<5D><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//0<><30>nand<6E><64>1<EFBFBD><31><EFBFBD><EFBFBD>0<EFBFBD><30>2<EFBFBD><32><EFBFBD><EFBFBD>2<EFBFBD><32>3<EFBFBD><33>spinor
|
|||
|
u32 reserved[2]; //<2F><><EFBFBD><EFBFBD>λ
|
|||
|
u32 end; //<2F><>ʾͷ<CABE><CDB7><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0x3b45494d
|
|||
|
|
|||
|
}
|
|||
|
toc0_private_head_t;
|
|||
|
|
|||
|
//<2F><><EFBFBD>Ӱ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>toc1<63><31>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>ݽṹ
|
|||
|
typedef struct sbrom_toc1_head_info
|
|||
|
{
|
|||
|
char name[16] ; //user can modify
|
|||
|
u32 magic ; //must equal TOC_U32_MAGIC
|
|||
|
u32 add_sum ;
|
|||
|
|
|||
|
u32 serial_num ; //user can modify
|
|||
|
u32 status ; //user can modify,such as TOC_MAIN_INFO_STATUS_ENCRYP_NOT_USED
|
|||
|
|
|||
|
u32 items_nr; //total entry number
|
|||
|
u32 valid_len;
|
|||
|
u32 reserved[5]; //reserved for future
|
|||
|
u32 end;
|
|||
|
}
|
|||
|
sbrom_toc1_head_info_t;
|
|||
|
|
|||
|
|
|||
|
typedef struct sbrom_toc1_item_info
|
|||
|
{
|
|||
|
char name[64]; //such as ITEM_NAME_SBROMSW_CERTIF
|
|||
|
u32 data_offset;
|
|||
|
u32 data_len;
|
|||
|
u32 encrypt; //0: no aes //1: aes
|
|||
|
u32 type; //0: normal file, dont care 1: key certif 2: sign certif 3: bin file
|
|||
|
u32 run_addr; //if it is a bin file, then run on this address; if not, it should be 0
|
|||
|
u32 index; //if it is a bin file, this value shows the index to run; if not
|
|||
|
//if it is a certif file, it should equal to the bin file index
|
|||
|
//that they are in the same group
|
|||
|
//it should be 0 when it anyother data type
|
|||
|
u32 reserved[69]; //reserved for future;
|
|||
|
u32 end;
|
|||
|
}sbrom_toc1_item_info_t;
|
|||
|
|
|||
|
|
|||
|
typedef struct sbrom_toc0_config
|
|||
|
{
|
|||
|
unsigned char config_vsn[4];
|
|||
|
unsigned int dram_para[32]; // dram<61><6D><EFBFBD><EFBFBD>
|
|||
|
int uart_port; // UART<52><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
normal_gpio_cfg uart_ctrl[2]; // UART<52><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO
|
|||
|
int enable_jtag; // JTAGʹ<47><CAB9>
|
|||
|
normal_gpio_cfg jtag_gpio[5]; // JTAG<41><47><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPIO
|
|||
|
normal_gpio_cfg storage_gpio[50]; // <20>洢<EFBFBD>豸 GPIO<49><4F>Ϣ
|
|||
|
// 0-23<32><33>nand<6E><64>24-31<33><31><EFBFBD>ſ<EFBFBD>0<EFBFBD><30>32-39<33>ſ<EFBFBD>2
|
|||
|
// 40-49<34><39><EFBFBD><EFBFBD>spi
|
|||
|
char storage_data[384]; // 0-159,<2C>洢nand<6E><64>Ϣ<EFBFBD><CFA2>160-255,<2C><><EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>Ϣ
|
|||
|
unsigned int secure_dram_mbytes; //
|
|||
|
unsigned int drm_start_mbytes; //
|
|||
|
unsigned int drm_size_mbytes; //
|
|||
|
unsigned int boot_cpu; //
|
|||
|
special_gpio_cfg a15_power_gpio; //the gpio config is to a15 extern power enable gpio
|
|||
|
unsigned int next_exe_pa;
|
|||
|
unsigned int secure_without_OS; //secure boot without semelis
|
|||
|
unsigned int debug_mode; //1:turn on printf; 0 :turn off printf
|
|||
|
unsigned int card_work_mode;
|
|||
|
unsigned int res[2]; // <20>ܹ<EFBFBD>1024<32>ֽ<EFBFBD>
|
|||
|
}
|
|||
|
sbrom_toc0_config_t;
|
|||
|
|
|||
|
#endif // ifndef __toc_h
|
|||
|
|
|||
|
/* end of toc.h */
|