Skip to content

Commit

Permalink
now you can use cygwin to compile the boot0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjiewen authored and zhengjiewen committed Feb 22, 2013
1 parent 1001eaa commit 4759a0c
Show file tree
Hide file tree
Showing 24 changed files with 173 additions and 17 deletions.
2 changes: 1 addition & 1 deletion boot0/Boot0_head.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ 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,
BOOT0_ALIGN_SIZE,
0x2000,
sizeof( boot_file_head_t ),
BOOT_PUB_HEAD_VERSION,
BOOT0_FILE_HEAD_VERSION,
Expand Down
Binary file removed boot0/drv/init_dram/dram_init.o
Binary file not shown.
Binary file removed boot0/load_Boot1_from_nand/load_Boot1_from_nand.o
Binary file not shown.
Binary file removed boot0/load_Boot1_from_nand/nand/adv_NF_read.o
Binary file not shown.
Binary file removed boot0/load_Boot1_from_nand/nand/basic_nf_read.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions boot0/load_boot1_from_sdmmc/bsp_mmc_for_boot/mmc_bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ static int mmc_clk_io_onoff(int sdc_no, int onoff)
{
struct sunxi_mmc_host* mmchost = &mmc_host[sdc_no];
u32 rval;
u32 pll5_clk;
u32 divider;
u32 n, k, m;
u32 gpioc_base = 0x01c20800 + 0x48;
u32 gpiof_base = 0x01c20800 + 0xb4;
// u32 pll5_base = CCMU_PLL5_CLK_BASE;
Expand Down Expand Up @@ -252,7 +249,6 @@ static int mmc_config_clock(struct mmc *mmc, unsigned clk)
{
struct sunxi_mmc_host* mmchost = (struct sunxi_mmc_host *)mmc->priv;
unsigned rval = readl(&mmchost->reg->clkcr);
unsigned int clkdiv = 0;

/*
* CLKCREG[7:0]: divider
Expand All @@ -265,7 +261,6 @@ static int mmc_config_clock(struct mmc *mmc, unsigned clk)
if(mmc_update_clk(mmc))
return -1;

clkdiv = mmchost->mclk/clk/2;
if (clk <=400000) {
mmchost->mclk = 400000;
writel(0x8012010f, mmchost->mclkbase);
Expand Down
11 changes: 7 additions & 4 deletions boot0/make.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SDKROOT = $(ROOT)/..


#导入交叉编译器通用配置
include $(SDKROOT)/config/CROSSTOOL.CFG
include $(SDKROOT)/config/ARMCC_CROSSTOOL.CFG


#头文件路径列表
Expand All @@ -41,7 +41,8 @@ ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_NAND)
#LIBS = $(SDKROOT)/boot1/driver/hardware_libs/bsp_nfc_boot0.lib
STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/nand
SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_nand -maxdepth 3 -type d)
TARGET = $(WORKSPACEPATH)/eGon/storage_media/nand/boot0_nand.bin
TARGET = $(WORKSPACEPATH)/eGon/boot0_nand.bin
TARGET1 = $(LICHEEPATH)/eGon/boot0_nand.bin
LOCALTARGET = __boot0_nand.axf
else

Expand All @@ -50,15 +51,17 @@ ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_SDMMC)
LIBS =
STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/sdcard
SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_sdmmc -maxdepth 3 -type d)
TARGET = $(WORKSPACEPATH)/eGon/storage_media/sdcard/boot0_sdcard.bin
TARGET = $(WORKSPACEPATH)/eGon/boot0_sdcard.bin
TARGET1 = $(LICHEEPATH)/eGon/boot0_sdcard.bin
LOCALTARGET = __boot0_sdmmc.axf
else

ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_SPINOR)
LIBS = $(ROOT)/storage_libs/spinor_boot0.a
STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/spinor
SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_spinor -maxdepth 3 -type d)
TARGET = $(WORKSPACEPATH)/eGon/storage_media/spinor/boot0_spinor.bin
TARGET = $(WORKSPACEPATH)/eGon/boot0_spinor.bin
TARGET1 = $(LICHEEPATH)/eGon/boot0_spinor.bin
LOCALTARGET = __boot0_spinor.axf
else
error:
Expand Down
1 change: 1 addition & 0 deletions boot0/make_nand
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ nand:$(LOCALTARGET)
$(LOAD) $(LDFLAGS) $(TMPTARGET) $(LOCALTARGET)
-$(WORKTOOLS)/gen_check_code.exe $(TMPTARGET) boot0.bin
cp boot0.bin $(TARGET)
cp boot0.bin $(TARGET1)
-rm $(OBJS) $(TMPTARGET) boot0.bin
@echo ----------------------------
@echo target make finish
Expand Down
1 change: 1 addition & 0 deletions boot0/make_sdmmc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sdmmc:$(LOCALTARGET)
$(LOAD) $(LDFLAGS) $(TMPTARGET) $(LOCALTARGET)
-$(WORKTOOLS)/gen_check_code.exe $(TMPTARGET) boot0.bin
cp boot0.bin $(TARGET)
cp boot0.bin $(TARGET1)
-rm $(OBJS) $(TMPTARGET) boot0.bin
@echo ----------------------------
@echo target make finish
Expand Down
1 change: 1 addition & 0 deletions boot0/make_spinor
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ nand:$(LOCALTARGET)
$(LOAD) $(LDFLAGS) $(TMPTARGET) $(LOCALTARGET)
-$(WORKTOOLS)/gen_check_code.exe $(TMPTARGET) boot0.bin
cp boot0.bin $(TARGET)
cp boot0.bin $(TARGET1)
-rm $(OBJS) $(TMPTARGET) boot0.bin
@echo ----------------------------
@echo target make finish
Expand Down
4 changes: 2 additions & 2 deletions boot1/apps/Card_Android/card_sprite/file_op/file_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ CSzFile *File_Open(Sector_t sector, __u32 size_low, __u32 size_high, __u32 write
p->SectorNr = sector;
p->CurSec = sector;
p->CurPos = 0;
p->Size = size_low | (((__int64)size_high) << 32);
p->Size = size_low | (((__s64)size_high) << 32);
p->writeMode = writeMode;
p->Buffer_t.Buffer = (__u8 *)sprite_malloc(512 * 1024);
// p->Buffer_t.Buffer = //DFB_Malloc(DEC_SECTOR_SIZE);
Expand Down Expand Up @@ -339,7 +339,7 @@ WRes File_Write(const void *data, __u32 size, __u32 size_cnt, CSzFile *p)
}


WRes File_Seek(CSzFile *p, __int64 pos, ESzSeek origin)
WRes File_Seek(CSzFile *p, __s64 pos, ESzSeek origin)
{
Int64 Offset;
Int64 SeekPos;
Expand Down
6 changes: 3 additions & 3 deletions boot1/apps/Card_Android/card_sprite/file_op/file_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ typedef struct __CSzFile
int writeMode; /* write open mode falg */
Sector_t SectorNr; /* begin sector number */
Sector_t CurSec; /* current sector number */
__int64 CurPos; /* file current postion */
__int64 Size; /* total size (just for read open) */
__s64 CurPos; /* file current postion */
__s64 Size; /* total size (just for read open) */
DecBuffer_t Buffer_t; /* data buffer */
} CSzFile;

Expand All @@ -65,6 +65,6 @@ extern WRes File_Close (CSzFile *p);

extern WRes File_Read (void *data, __u32 size, __u32 size_cnt, CSzFile *p);
extern WRes File_Write (const void *data, __u32 size, __u32 size_cnt, CSzFile *p);
extern WRes File_Seek (CSzFile *p, __int64 pos, ESzSeek origin);
extern WRes File_Seek (CSzFile *p, __s64 pos, ESzSeek origin);

#endif /* __FILE_OP_H__ */
36 changes: 36 additions & 0 deletions boot1/include/egon2.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
;/*
;**********************************************************************************************************************
;* eGon
;* the Embedded GO-ON Bootloader System
;* eGON boot sub-system
;*
;* Copyright(C), 2006-2010, SoftWinners Microelectronic Co., Ltd.
;* All Rights Reserved
;*
;* File : eGon2.h
;*
;* By : Jerry
;*
;* Version : V2.00
;*
;* Date :
;*
;* Descript:
;**********************************************************************************************************************
;*/


IF :LNOT::DEF:__EGON2_INC_
GBLA __EGON2_INC_

include cfgs\arm_a8.inc
include arch\ebios.inc




endif
end



18 changes: 17 additions & 1 deletion boot1/include/interinc/boot0_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@
//以下是提供给SDMMC卡使用,固定不可改变
#define BOOT0_SDMMC_START_ADDR 16


typedef struct standard_Boot_file_head
{
__u32 jump_instruction; // one intruction jumping to real code
__u8 magic[8]; // ="eGON.BT0" or "eGON.BT1", not C-style string.
__u32 check_sum; // generated by PC
__u32 length; // generated by PC
__u32 pub_head_size; // the size of boot_file_head_t
__u8 pub_head_vsn[4]; // the version of boot_file_head_t
__u8 file_head_vsn[4]; // the version of boot0_file_head_t or boot1_file_head_t
__u8 Boot_vsn[4]; // Boot version
__u8 eGON_vsn[4]; // eGON version
__u8 platform[8]; // platform information
}standard_boot_file_head_t;


/******************************************************************************/
/* file head of Boot0 */
/******************************************************************************/
Expand All @@ -79,7 +95,7 @@ typedef struct _boot0_private_head_t

typedef struct _boot0_file_head_t
{
boot_file_head_t boot_head;
standard_boot_file_head_t boot_head;
boot0_private_head_t prvt_head;
}boot0_file_head_t;

Expand Down
2 changes: 1 addition & 1 deletion boot1/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
typedef unsigned long long __u64;
typedef unsigned long long u64;

typedef long long __int64;
//typedef long long __int64;
typedef long long __s64;

typedef unsigned int __u32;
Expand Down
103 changes: 103 additions & 0 deletions config/ARMCC_CROSSTOOL.CFG
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#/*
#*********************************************************************************************************
#* MELIS
#* the Easy Portable/Player Develop Kits
#* Compiler Module
#*
#* (c) Copyright 2006-2010, kevin.z China
#* All Rights Reserved
#*
#* File : crosstool.cfg
#* By : kevin.z
#* Version : v1.0
#* Date : 2010-9-7 10:38
#* Descript: configuration script for RVDS compiler
#* Update : date auther ver notes
#*
#*********************************************************************************************************
#*/
#

#工具链配置
CROSSTOOL = ARMRVDS

LICHEEPATH = $(SDKROOT)/../tools/pack/chips/sun7i
LICHEE_TESTPATH = $(SDKROOT)/../tools-uboot/pack/chips/sun7i
WORKSPACEPATH = $(SDKROOT)/workspace
WORKTOOLS = $(SDKROOT)/workspace/pctools
LIBSPATH = $(SDKROOT)/boot1/libs

ifeq ($(CROSSTOOL), ARMRVDS)

#===============================================================
#RVDS编译器参数配置
#===============================================================

#编译器
CC = @armcc
#编译器参数
CFLAGS = --cpu=Cortex-A7

#C++编译器
CXX = @armcpp
CXXFLAGS = --cpu=Cortex-A7 --cpp --no_exceptions

#汇编器
AS = @armasm
#汇编器参数
ASFLAGS = --cpu=Cortex-A7

#链接器
LINK = armlink
#链接器参数
LKFLAGS = --noremove

#打包器
AR = armar
#链接器参数
ARFLAGS = -r

#加载器
LOAD = fromelf
#加载器参数
LDFLAGS =


else


ifeq ($(CROSSTOOL), ARMGCC)

#===============================================================
#GNU编译器参数配置
#===============================================================

#编译器
CC = @arm-elf-gcc
#编译器参数
CFLAGS =

#汇编器
AS = @arm-elf-as
#汇编器参数
ASFLAGS =

#链接器
LINK = @arm-elf-ld
#链接器参数
LKFLAGS =

#加载器
LOAD = @arm-elf-objdump
#加载器参数
LDFLAGS =

else

error:
$(error CROSSTOOL configuration is invalid!!!)

endif


endif
Binary file added workspace/pctools/gen_check_code.exe
Binary file not shown.
Binary file added workspace/wboot/bootfs/prvt.axf
Binary file not shown.
Binary file modified workspace/wboot/bootfs/sprite.axf
Binary file not shown.

0 comments on commit 4759a0c

Please sign in to comment.