diff --git a/link/bootloader.ld b/link/bootloader.ld index b01efd7..d7c0ed7 100644 --- a/link/bootloader.ld +++ b/link/bootloader.ld @@ -17,12 +17,10 @@ SECTIONS _entry = ALIGN(4); __entry = ALIGN(4); *(.init) - . = ORIGIN(rom) + 0x180; + . = ORIGIN(rom) + 0x080; *(.ktext) *(.text*) *(.rodata*) - . = ORIGIN(rom) + LENGTH(rom) - 0x40; - *(.dbg_stub*) } > rom .data ORIGIN(ram) : @@ -33,9 +31,6 @@ SECTIONS _end = ALIGN(4); } > ram - .flash ORIGIN(flash) : - { - _flash_start = ALIGN(4); - } > flash + _flash_start = ORIGIN(flash); } diff --git a/make/mips_boot.mk b/make/mips_boot.mk index e573148..95ea54a 100644 --- a/make/mips_boot.mk +++ b/make/mips_boot.mk @@ -3,9 +3,9 @@ # TLB = {no, yes} # ENDIANESS = {eb, el} BOARD ?= ml402 -TLB ?= no +WITH_TLB ?= n ENDIANESS ?= eb -DEBUGGER ?= gdb +DEBUGGER ?= n ifeq ($(ENDIANESS),el) ENDIAN_FLAGS=-EL @@ -13,18 +13,9 @@ else ENDIAN_FLAGS=-EB endif -ifeq ($(DEBUGGER),gdb) - DBG_FLAGS := -DWITH_DEBUGGER -DWITH_GDB_STUB - DBG_OBJ := gdb_stub.o -endif -ifeq ($(DEBUGGER),mips) - DBG_FLAGS := -DWITH_DEBUGGER - DBG_OBJ := mips_dbg.o mips_dis.o -endif - - -CFLAGS=$(ENDIAN_FLAGS) -Os -ffunction-sections -fdata-sections -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD) $(DBG_FLAGS) -LFLAGS=$(ENDIAN_FLAGS) -Os -nostartfiles -nodefaultlibs -nostdlib -Wl,--gc-sections -Wl,-M +FLAGS := -fno-exceptions -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostartfiles -nodefaultlibs -nostdlib +CFLAGS=$(ENDIAN_FLAGS) $(FLAGS) -Os -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD) +LFLAGS=$(ENDIAN_FLAGS) $(FLAGS) -Os ifeq ($(TLB),yes) CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000 @@ -36,7 +27,7 @@ endif BUILD_DIR=./build/$(BOARD)/$(ENDIANESS) -LIBS=-lc -lgcc +LIBS=-lc CFLAGS += -DXCP_SIZE=4096 CC=mips-elf-gcc diff --git a/src/bootloader/boards/ml402/board.c b/src/bootloader/boards/ml402/board.c index 63bebd4..b49c845 100644 --- a/src/bootloader/boards/ml402/board.c +++ b/src/bootloader/boards/ml402/board.c @@ -12,20 +12,12 @@ extern uart_if_t uart_if[]; -int gdb_stub(struct xcptcontext * xcp) __attribute__ ((section (".gdb"))); - -int gdb_stub(struct xcptcontext * xcp) -{ - handle_exception((unsigned long *)xcp); - return 0; -} - -inline void _dbg_writechar(uart_if_t const *pUart, char c) +void _dbg_writechar(uart_if_t const *pUart, char c) { UART_writechar(pUart, c); } -inline char _dbg_readchar(uart_if_t const *pUart) +char _dbg_readchar(uart_if_t const *pUart) { int c;