diff --git a/xbboot/target-common/jz4760.h b/xbboot/target-common/jz4760.h index d4e7d6c..63f8202 100644 --- a/xbboot/target-common/jz4760.h +++ b/xbboot/target-common/jz4760.h @@ -4,8 +4,22 @@ #ifndef __JZ4760_H__ #define __JZ4760_H__ -#ifndef __ASSEMBLY__ #if 0 /* if 0, for spl program */ +#define UCOS_CSP 0 + +#if UCOS_CSP +#define __KERNEL__ +#include +#include + +#include +#include +#define KSEG0 KSEG0BASE +#else +#include +#include +#endif + #define cache_unroll(base,op) \ __asm__ __volatile__(" \ .set noreorder; \ @@ -79,7 +93,6 @@ static inline u32 jz_readl(u32 address) return *((volatile u32 *)address); } #endif -#endif /* !ASSEMBLY */ //---------------------------------------------------------------------- // Boot ROM Specification diff --git a/xbboot/target-stage1/Makefile b/xbboot/target-stage1/Makefile index f11dc93..750ed44 100644 --- a/xbboot/target-stage1/Makefile +++ b/xbboot/target-stage1/Makefile @@ -17,7 +17,7 @@ CFLAGS = -O2 -fno-unit-at-a-time -fno-zero-initialized-in-bss -mips32 -fno-pic \ LDFLAGS = -nostdlib -EL -T target.ld VPATH = ../target-common -OBJS = head.o stage1.o serial.o board-jz4740.o #board-jz4760.o +OBJS = head.o stage1.o serial.o board-jz4740.o board-jz4760.o all: stage1.bin diff --git a/xbboot/target-stage1/board-jz4760.c b/xbboot/target-stage1/board-jz4760.c index 64bad83..8820682 100644 --- a/xbboot/target-stage1/board-jz4760.c +++ b/xbboot/target-stage1/board-jz4760.c @@ -6,9 +6,16 @@ * Copyright (C) 2006 Ingenic Semiconductor Inc. * */ +#include "common.h" #include "jz4760.h" -#include "configs.h" -#include "board_4760.h" +#include "board-jz4760.h" + +#define CONFIG_NR_DRAM_BANKS 1 /* SDRAM BANK Number: 1, 2*/ + +void cpm_start_all() +{ + __cpm_start_all(); +} /* * SD0 ~ SD7, SA0 ~ SA5, CS2#, RD#, WR#, WAIT# @@ -332,7 +339,7 @@ static int ddr_dma_test(int print_flag) { REG_DMAC_DMADCKE(1) = 0x3f; #ifndef CONFIG_DDRC - banks = (SDRAM_BANK4 ? 4 : 2) *(CONFIG_NR_DRAM_BANKS); + banks = (ARG_BANK_ADDR_2BIT ? 4 : 2) *(CONFIG_NR_DRAM_BANKS); #else banks = (DDR_BANK8 ? 8 : 4) *(DDR_CS0EN + DDR_CS1EN); #endif @@ -688,8 +695,6 @@ void testallmem() } -#define DMAC_BASE MDMAC_BASE - #define DDR_DMA_BASE (0xa0000000) /*un-cached*/ void dma_data_move(int dma_chan, int dma_src_addr, int dma_dst_addr, int size, int burst) @@ -749,7 +754,7 @@ static int dma_memcpy_test(int channle_0, int channle_1) { int channel; #ifndef CONFIG_DDRC - banks = (SDRAM_BANK4 ? 4 : 2) *(CONFIG_NR_DRAM_BANKS); + banks = (ARG_BANK_ADDR_2BIT ? 4 : 2) *(CONFIG_NR_DRAM_BANKS); #else banks = (DDR_BANK8 ? 8 : 4) *(DDR_CS0EN + DDR_CS1EN); #endif @@ -1190,7 +1195,7 @@ void sdram_init_4760(void) /* Basic DMCR value */ dmcr = ((SDRAM_ROW-11)<