151 lines
5.1 KiB
C
Executable File
151 lines
5.1 KiB
C
Executable File
/*
|
||
************************************************************************************************************************
|
||
* eGON
|
||
* the Embedded GO-ON Bootloader System
|
||
*
|
||
* Copyright(C), 2006-2008, SoftWinners Microelectronic Co., Ltd.
|
||
* All Rights Reserved
|
||
*
|
||
* File Name : Boot0_head.c
|
||
*
|
||
* Author : Gary.Wang
|
||
*
|
||
* Version : 1.1.0
|
||
*
|
||
* Date : 2007.11.06
|
||
*
|
||
* Description : This file defines the file head part of Boot0, which contains some important
|
||
* infomations such as magic, platform infomation and so on, and MUST be allocted in the
|
||
* head of Boot0.
|
||
*
|
||
* Others : None at present.
|
||
*
|
||
*
|
||
* History :
|
||
*
|
||
* <Author> <time> <version> <description>
|
||
*
|
||
* Gary.Wang 2007.11.06 1.1.0 build the file
|
||
*
|
||
************************************************************************************************************************
|
||
*/
|
||
#include "boot0_i.h"
|
||
|
||
#pragma arm section rodata="bt0_head"
|
||
|
||
#define DDR3_USED
|
||
|
||
const boot0_file_head_t BT0_head = {
|
||
{
|
||
/* jump_instruction */ ( 0xEA000000 | ( ( ( sizeof( boot0_file_head_t ) + sizeof( int ) - 1 ) / sizeof( int ) - 2 ) & 0x00FFFFFF ) ),
|
||
BOOT0_MAGIC,
|
||
STAMP_VALUE,
|
||
#ifdef ALIGN_SIZE_8K
|
||
0x2000,
|
||
#else
|
||
0x4000,
|
||
#endif
|
||
sizeof( boot_file_head_t ),
|
||
BOOT_PUB_HEAD_VERSION,
|
||
0,
|
||
0,
|
||
EGON_VERSION,
|
||
{
|
||
0, 0, '3','.','1','.','0',0
|
||
},
|
||
},
|
||
#ifdef DDR3_USED
|
||
{
|
||
sizeof( boot0_private_head_t ),
|
||
BOOT0_PRVT_HEAD_VERSION,
|
||
{ 0 },
|
||
0,
|
||
{
|
||
{ 2, 0, 3, 1, 1, 0, 0, 0},
|
||
{ 2, 1, 3, 1, 1, 0, 0, 0}
|
||
},
|
||
0,
|
||
{ 0 },
|
||
{
|
||
{ 6, 0, 2, 1, 2, 0, 0, 0},
|
||
{ 6, 1, 2, 1, 2, 0, 0, 0},
|
||
{ 6, 2, 2, 1, 2, 0, 0, 0},
|
||
{ 6, 3, 2, 1, 2, 0, 0, 0},
|
||
{ 6, 4, 2, 1, 2, 0, 0, 0},
|
||
{ 6, 5, 2, 1, 2, 0, 0, 0},
|
||
},
|
||
{ 0 }
|
||
}
|
||
#else
|
||
{
|
||
sizeof( boot0_private_head_t ),
|
||
BOOT0_PRVT_HEAD_VERSION,
|
||
{ 0x40000000,
|
||
1024,
|
||
180,
|
||
1,
|
||
1,
|
||
0,
|
||
(__dram_type_e)1,
|
||
16,
|
||
10,
|
||
14,
|
||
4,
|
||
3,
|
||
0,
|
||
16,
|
||
1024
|
||
},
|
||
0,
|
||
{
|
||
{ 2, 22, 4, 1, 1, 0, 0, 0},
|
||
{ 2, 23, 4, 1, 1, 0, 0, 0}
|
||
},
|
||
0,
|
||
{ 0 },
|
||
{ 0 },
|
||
{ 0 }
|
||
}
|
||
#endif
|
||
};
|
||
|
||
|
||
|
||
/*******************************************************************************
|
||
*
|
||
* <20><><EFBFBD><EFBFBD>Boot_file_head<61>е<EFBFBD>jump_instruction<6F>ֶ<EFBFBD>
|
||
*
|
||
* jump_instruction<6F>ֶδ<D6B6><CEB4>ŵ<EFBFBD><C5B5><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>תָ<D7AA>( B BACK_OF_Boot_file_head )<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
*תָ<D7AA>ִ<EEB1BB>к<D0BA><F3A3ACB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Boot_file_head<61><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ָ<EFBFBD>
|
||
*
|
||
* ARMָ<4D><D6B8><EFBFBD>е<EFBFBD>Bָ<42><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
||
* +--------+---------+------------------------------+
|
||
* | 31--28 | 27--24 | 23--0 |
|
||
* +--------+---------+------------------------------+
|
||
* | cond | 1 0 1 0 | signed_immed_24 |
|
||
* +--------+---------+------------------------------+
|
||
* <20><>ARM Architecture Reference Manual<61><6C><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD>ͣ<EFBFBD>
|
||
* Syntax :
|
||
* B{<cond>} <target_address>
|
||
* <cond> Is the condition under which the instruction is executed. If the
|
||
* <cond> is ommitted, the AL(always,its code is 0b1110 )is used.
|
||
* <target_address>
|
||
* Specified the address to branch to. The branch target address is
|
||
* calculated by:
|
||
* 1. Sign-extending the 24-bit signed(wro's complement)immediate
|
||
* to 32 bits.
|
||
* 2. Shifting the result left two bits.
|
||
* 3. Adding to the contents of the PC, which contains the address
|
||
* of the branch instruction plus 8.
|
||
*
|
||
* <20>ɴ˿<C9B4>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λΪ<CEBB><CEAA>0b11101010<31><30><EFBFBD><EFBFBD>24λ<34><CEBB><EFBFBD><EFBFBD>Boot_file_head<61>Ĵ<EFBFBD>С<EFBFBD><D0A1>
|
||
*̬<><CCAC><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
||
* ( sizeof( boot_file_head_t ) + sizeof( int ) - 1 ) / sizeof( int )
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ͷռ<CDB7>õġ<C3B5><C4A1>֡<EFBFBD><D6A1>ĸ<EFBFBD><C4B8><EFBFBD>
|
||
* - 2 <20><>ȥPCԤȡ<D4A4><C8A1>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
* & 0x00FFFFFF <20><><EFBFBD><EFBFBD>signed-immed-24
|
||
* | 0xEA000000 <20><>װ<EFBFBD><D7B0>Bָ<42><D6B8>
|
||
*
|
||
*******************************************************************************/
|
||
|