- refactored
- made changes due to new GCC git-svn-id: http://moon:8086/svn/mips@145 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# environment vaiables read:
|
||||
# BOARD = {ml402, denano}
|
||||
# TLB = {no, yes}
|
||||
# ENDIANESS = {eb, el}
|
||||
# DEBUGGER = {gdb, mips, rom}
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
SPECNAME=specs_tlb
|
||||
else
|
||||
SPECNAME=specs
|
||||
endif
|
||||
|
||||
ifeq ($(ENDIANESS),eb)
|
||||
ENDIAN_FLAGS=-EB
|
||||
else
|
||||
ENDIAN_FLAGS=-EL
|
||||
endif
|
||||
|
||||
BUILD_DIR=build/$(BOARD)/$(ENDIANESS)
|
||||
LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS)
|
||||
|
||||
CFLAGS :=$(ENDIAN_FLAGS) -ffunction-sections -fdata-sections -Wl,--gc-sections -G 0 -Tlink/link_ram.ld -g -msoft-float -O2 -march=r3000 -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) -Wl,-M
|
||||
ifeq ($(TLB),yes)
|
||||
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
||||
else
|
||||
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
||||
endif
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
FLASHGEN=flashgen_tlb
|
||||
else
|
||||
FLASHGEN=flashgen
|
||||
endif
|
||||
PACKHEX=packhex
|
||||
|
||||
LIBS=-lm -lc -lsys -lc
|
||||
|
||||
AS=mips-elf-as
|
||||
AR=mips-elf-ar
|
||||
CC=mips-elf-gcc
|
||||
LD=mips-elf-ld
|
||||
OBJDUMP=mips-elf-objdump
|
||||
OBJCOPY=mips-elf-objcopy
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# environment vaiables read:
|
||||
# BOARD = {ml402, denano}
|
||||
# TLB = {no, yes}
|
||||
# ENDIANESS = {eb, el}
|
||||
# DEBUGGER = {gdb, mips, rom}
|
||||
|
||||
BOARD ?= ml402
|
||||
TLB ?= no
|
||||
ENDIANESS ?= eb
|
||||
DEBUGGER ?= mips
|
||||
|
||||
|
||||
ifeq ($(ENDIANESS),el)
|
||||
ENDIAN_FLAGS=-EL
|
||||
else
|
||||
ENDIAN_FLAGS=-EB
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUGGER),gdb)
|
||||
DBG_FLAGS := -DWITH_GDB_STUB
|
||||
DBG_OBJ := gdb_stub.o
|
||||
endif
|
||||
ifeq ($(DEBUGGER),mips)
|
||||
DBG_FLAGS :=
|
||||
DBG_OBJ := mips_dbg.o mips_dis.o
|
||||
endif
|
||||
ifeq ($(DEBUGGER),rom)
|
||||
DBG_FLAGS := -DWITH_ROM_DEBUGGER
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS=$(ENDIAN_FLAGS) -ffunction-sections -fdata-sections -g -msoft-float -O2 -march=r3000 -I. -Iboards/$(BOARD) -D$(BOARD) $(DBG_FLAGS)
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
||||
else
|
||||
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
||||
endif
|
||||
|
||||
BUILD_DIR=./build/$(BOARD)/$(ENDIANESS)
|
||||
|
||||
AS=mips-elf-as
|
||||
AR=mips-elf-ar
|
||||
CC=mips-elf-gcc
|
||||
LD=mips-elf-ld
|
||||
OBJDUMP=mips-elf-objdump
|
||||
OBJCOPY=mips-elf-objcopy
|
||||
FLASHGEN=flashgen
|
||||
|
||||
+2
-38
@@ -1,44 +1,8 @@
|
||||
ENDIANESS ?=eb
|
||||
BOARD ?=ml402
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
SPECNAME=specs_tlb
|
||||
else
|
||||
SPECNAME=specs
|
||||
endif
|
||||
|
||||
ifeq ($(ENDIANESS),eb)
|
||||
ENDIAN_FLAGS=-EB
|
||||
else
|
||||
ENDIAN_FLAGS=-EL
|
||||
endif
|
||||
|
||||
BUILD_DIR=build/$(BOARD)/$(ENDIANESS)
|
||||
LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS)
|
||||
|
||||
CFLAGS:=$(ENDIAN_FLAGS) -ffunction-sections -fdata-sections -Wl,--gc-sections -G 0 -Tlink/link.ld -g -msoft-float -O2 -march=r3000 -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) -Wl,-M
|
||||
ifeq ($(TLB),yes)
|
||||
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
||||
else
|
||||
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
||||
endif
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
FLASHGEN=$(MIPS_HOME)/tools/flashgen_tlb
|
||||
else
|
||||
FLASHGEN=$(MIPS_HOME)/tools/flashgen
|
||||
endif
|
||||
PACKHEX=$(MIPS_HOME)/tools/packhex
|
||||
|
||||
LIBS=-lm -lc -lsys -lc
|
||||
|
||||
AS=mips-elf-as
|
||||
AR=mips-elf-ar
|
||||
CC=mips-elf-gcc
|
||||
LD=mips-elf-ld
|
||||
OBJDUMP=mips-elf-objdump
|
||||
OBJCOPY=mips-elf-objcopy
|
||||
|
||||
include ../make/mips_app.mk
|
||||
|
||||
PROG-ml402 = $(addprefix $(BUILD_DIR)/, hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf test_fft.elf)
|
||||
PROG-denano = $(addprefix $(BUILD_DIR)/, hello.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf testbench_denano.elf)
|
||||
PROG-sim = $(addprefix $(BUILD_DIR)/, hello.elf ICacheTest.elf)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// MIPS delay.
|
||||
|
||||
__inline void delay(int loops)
|
||||
void delay(unsigned int loops)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ ri_var_t* VarListFindByName(var_list_t *pObj, uint8_t *name)
|
||||
while(pVarList)
|
||||
{
|
||||
pVar = (ri_var_t*)pVarList->pData;
|
||||
if (!stricmp(name, pVar->name))
|
||||
if (!strcasecmp(name, pVar->name))
|
||||
{
|
||||
return pVar;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ ri_var_t* VarListDeclare(var_list_t *pObj, uint8_t *name, uint8_t *cls, uint8_t
|
||||
pToken = VAR_CLASSES;
|
||||
while(*pToken)
|
||||
{
|
||||
if (!stricmp(cls, *pToken))
|
||||
if (!strcasecmp(cls, *pToken))
|
||||
{
|
||||
var.cls = *pToken;
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ ri_var_t* VarListDeclare(var_list_t *pObj, uint8_t *name, uint8_t *cls, uint8_t
|
||||
pEclasses = VAR_ECLASSES;
|
||||
while(*pToken)
|
||||
{
|
||||
if (!stricmp(type, *pToken))
|
||||
if (!strcasecmp(type, *pToken))
|
||||
{
|
||||
var.type = *pToken;
|
||||
var.value_size = *pSize;
|
||||
|
||||
+1
-37
@@ -9,43 +9,7 @@ TLB ?= no
|
||||
ENDIANESS ?= eb
|
||||
DEBUGGER ?= mips
|
||||
|
||||
|
||||
ifeq ($(ENDIANESS),el)
|
||||
ENDIAN_FLAGS=-EL
|
||||
else
|
||||
ENDIAN_FLAGS=-EB
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUGGER),gdb)
|
||||
DBG_FLAGS := -DWITH_GDB_STUB
|
||||
DBG_OBJ := gdb_stub.o
|
||||
endif
|
||||
ifeq ($(DEBUGGER),mips)
|
||||
DBG_FLAGS :=
|
||||
DBG_OBJ := mips_dbg.o mips_dis.o
|
||||
endif
|
||||
ifeq ($(DEBUGGER),rom)
|
||||
DBG_FLAGS := -DWITH_ROM_DEBUGGER
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS=$(ENDIAN_FLAGS) -ffunction-sections -fdata-sections -g -msoft-float -O2 -march=r3000 -I. -Iboards/$(BOARD) -D$(BOARD) $(DBG_FLAGS)
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
||||
else
|
||||
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
||||
endif
|
||||
|
||||
BUILD_DIR=./build/$(BOARD)/$(ENDIANESS)
|
||||
|
||||
AS=mips-elf-as
|
||||
AR=mips-elf-ar
|
||||
CC=mips-elf-gcc
|
||||
LD=mips-elf-ld
|
||||
OBJDUMP=mips-elf-objdump
|
||||
OBJCOPY=mips-elf-objcopy
|
||||
FLASHGEN=flashgen
|
||||
include ../make/mips_lib.mk
|
||||
|
||||
OBJS-ml402=$(addprefix $(BUILD_DIR)/, libsys.o xcpt.o syscalls.o cop0.o irq.o $(DBG_OBJ) console.o uart.o board.o gpio.o mips_ps2.o mips_gfx.o screen.o)
|
||||
OBJS-denano=$(addprefix $(BUILD_DIR)/, libsys.o xcpt.o syscalls.o cop0.o irq.o $(DBG_OBJ) console.o uart.o board.o gpio.o)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
MEMORY
|
||||
{
|
||||
rom : ORIGIN = 0xBFC00000, LENGTH = 0x00002000 /* 8K */
|
||||
ram : ORIGIN = 0x40000000, LENGTH = 0x04000000 /* 64M */
|
||||
flash : ORIGIN = 0xA4000000, LENGTH = 0x00800000 /* 8M */
|
||||
io : ORIGIN = 0xA0000000, LENGTH = 0x00800000 /* 8M */
|
||||
}
|
||||
|
||||
stack_ptr = 0x7FFFEFF0;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
ROM :
|
||||
{
|
||||
start = ALIGN(4);
|
||||
entry = ALIGN(4);
|
||||
_entry = ALIGN(4);
|
||||
__entry = ALIGN(4);
|
||||
*(.init)
|
||||
. = ORIGIN(rom) + 0x180;
|
||||
*(.ktext)
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
. = ORIGIN(rom) + LENGTH(rom) - 0x40;
|
||||
*(.dbg_stub*)
|
||||
} > rom
|
||||
|
||||
.data ORIGIN(ram) :
|
||||
{
|
||||
_ram_start = ALIGN(4);
|
||||
__bss_start = ALIGN(4);
|
||||
*(.*bss)
|
||||
_end = ALIGN(4);
|
||||
} > ram
|
||||
|
||||
.flash ORIGIN(flash) :
|
||||
{
|
||||
_flash_start = ALIGN(4);
|
||||
} > flash
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
MEMORY
|
||||
{
|
||||
rom : ORIGIN = 0x9FC00000, LENGTH = 0x00002000 /* 8K */
|
||||
ram : ORIGIN = 0x80000000, LENGTH = 0x04000000 /* 64M */
|
||||
flash_u : ORIGIN = 0xA4000000, LENGTH = 0x00800000 /* 8M */
|
||||
flash_c : ORIGIN = 0x88000000, LENGTH = 0x00800000 /* 8M */
|
||||
io : ORIGIN = 0xAC000000, LENGTH = 0x00800000 /* 8M */
|
||||
}
|
||||
|
||||
stack_ptr = 0x83FFEFF0;
|
||||
baudrate = 0x0D;
|
||||
sys_led_port = 0xAC000000;
|
||||
sys_uart_data = 0xAC010000;
|
||||
sys_uart_stat = 0xAC010004;
|
||||
sys_uart_baud = 0xAC010008;
|
||||
sys_timer_usec = 0xAC00008;
|
||||
sys_timer_sec = 0xAC00000C;
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.init ORIGIN(rom) :
|
||||
{
|
||||
start = ALIGN(4);
|
||||
entry = ALIGN(4);
|
||||
_entry = ALIGN(4);
|
||||
__entry = ALIGN(4);
|
||||
*(.stext)
|
||||
} > rom
|
||||
|
||||
.ktext ORIGIN(rom) + 0x180 :
|
||||
{
|
||||
*(.ktext)
|
||||
} > rom
|
||||
|
||||
.text . :
|
||||
{
|
||||
*(.text)
|
||||
} > rom
|
||||
|
||||
.rodata . :
|
||||
{
|
||||
*(.rodata*)
|
||||
} > rom
|
||||
|
||||
.data ORIGIN(ram) :
|
||||
{
|
||||
_ram_start = ALIGN(4);
|
||||
*(.*data) *(.*bss) *(.*common)
|
||||
} > ram
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user