SmartAudio/lichee/brandy/basic_loader/fes1/fes1_head.c

141 lines
4.8 KiB
C
Raw Permalink Normal View History

2018-07-13 01:31:50 +00:00
/*
************************************************************************************************************************
* 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 "types.h"
#include "boot0_v2.h"
#pragma arm section rodata="fes1_head"
#define DDR3_USED
const boot0_file_head_t fes1_head = {
{
/* jump_instruction */ ( 0xEA000000 | ( ( ( sizeof( boot0_file_head_t ) + sizeof( int ) - 1 ) / sizeof( int ) - 2 ) & 0x00FFFFFF ) ),
BOOT0_MAGIC,
STAMP_VALUE,
32,
sizeof( boot_file_head_t ),
BOOT_PUB_HEAD_VERSION,
FES1_DRAM_RET_ADDR,
FES1_RUN_ADDR,
EGON_VERSION,
{
0, 0, '2','.','0','.','0',0
},
},
#ifdef DDR3_USED
{
sizeof( boot0_private_head_t ),
{ 0 },
{ 0 },
0,
{
{ 2, 22, 4, 1, 1, 0, 0, 0},
{ 2, 23, 4, 1, 1, 0, 0, 0}
},
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
};
/*******************************************************************************
*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Boot_file_head<EFBFBD>е<EFBFBD>jump_instruction<EFBFBD>ֶ<EFBFBD>
*
* jump_instruction<EFBFBD>ֶδ<EFBFBD><EFBFBD>ŵ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>תָ<EFBFBD>( B BACK_OF_Boot_file_head )<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*תָ<EFBFBD>ִ<EFBFBD>к󣬳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Boot_file_head<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ָ<EFBFBD>
*
* ARMָ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
* +--------+---------+------------------------------+
* | 31--28 | 27--24 | 23--0 |
* +--------+---------+------------------------------+
* | cond | 1 0 1 0 | signed_immed_24 |
* +--------+---------+------------------------------+
* <EFBFBD><EFBFBD>ARM Architecture Reference Manual<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>ͣ<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.
*
* <EFBFBD>ɴ˿<EFBFBD>֪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λΪ<EFBFBD><EFBFBD>0b11101010<EFBFBD><EFBFBD><EFBFBD><EFBFBD>24λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Boot_file_head<EFBFBD>Ĵ<EFBFBD>С<EFBFBD><EFBFBD>
*̬<EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
* ( sizeof( boot_file_head_t ) + sizeof( int ) - 1 ) / sizeof( int )
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ͷռ<EFBFBD>õġ<EFBFBD><EFBFBD>֡<EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD>
* - 2 <EFBFBD><EFBFBD>ȥPCԤȡ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* & 0x00FFFFFF <EFBFBD><EFBFBD><EFBFBD><EFBFBD>signed-immed-24
* | 0xEA000000 <EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
*******************************************************************************/