1.1 --- a/Makefile Fri Jun 05 00:07:00 2015 +0200
1.2 +++ b/Makefile Fri Jun 05 00:08:05 2015 +0200
1.3 @@ -23,17 +23,23 @@
1.4 OBJCOPY=$(ARCH)-objcopy
1.5 OBJDUMP=$(ARCH)-objdump
1.6
1.7 -CFLAGS = -Wall -fno-unit-at-a-time -fno-zero-initialized-in-bss \
1.8 - -march=mips32 -mno-abi-calls \
1.9 - -Iinclude
1.10 +# NOTE: -O2 is actually needed to prevent memcpy references, whereas probably
1.11 +# NOTE: one of the -f{freestanding, no-hosted, no-builtin} options should work.
1.12 +# NOTE: See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
1.13 +
1.14 +ASM_INC = /usr/src/linux-headers-4.0.0-1-common/arch/mips/include
1.15 +CFLAGS = -O2 -Wall -fno-pic -fno-unit-at-a-time -fno-zero-initialized-in-bss \
1.16 + -ffreestanding -fno-hosted -fno-builtin \
1.17 + -march=mips32 -mno-abicalls \
1.18 + -Iinclude -I$(ASM_INC) -I$(ASM_INC)/asm/mach-generic
1.19 LDFLAGS = -nostdlib -EL -T target.ld
1.20
1.21 PAYLOAD = stage1.bin
1.22 TARGET = $(PAYLOAD:.bin=.elf)
1.23 DUMP = $(PAYLOAD:.bin=.dump)
1.24 MAP = $(PAYLOAD:.bin=.map)
1.25 -SRC = head.S stage1.c board-jz4740.c
1.26 -OBJ = $(SRC:.c=.o)
1.27 +SRC = head.S stage1.c board-nanonote.c
1.28 +OBJ = $(filter %.o,$(SRC:.c=.o) $(SRC:.S=.o))
1.29
1.30 .PHONY: all clean distclean
1.31
1.32 @@ -45,10 +51,7 @@
1.33 distclean: clean
1.34 echo "Nothing else to clean."
1.35
1.36 -$(TARGET): $(OBJ)
1.37 - $(LD) $(LDFLAGS) $(OBJ) -o $@
1.38 -
1.39 -.bin.elf:
1.40 +$(PAYLOAD): $(TARGET)
1.41 $(OBJCOPY) -O binary $< $@+
1.42 $(OBJDUMP) -D $< > $(DUMP)
1.43 $(OBJDUMP) -h $< > $(MAP)
1.44 @@ -56,6 +59,9 @@
1.45 chmod -x $@+
1.46 mv -f $@+ $@
1.47
1.48 +$(TARGET): $(OBJ)
1.49 + $(LD) $(LDFLAGS) $(OBJ) -o $@
1.50 +
1.51 .c.o:
1.52 $(CC) -c $(CFLAGS) $< -o $@
1.53
2.1 --- a/board-nanonote.c Fri Jun 05 00:07:00 2015 +0200
2.2 +++ b/board-nanonote.c Fri Jun 05 00:08:05 2015 +0200
2.3 @@ -21,6 +21,7 @@
2.4
2.5 #include "jz4740.h"
2.6 #include "configs.h"
2.7 +#include "nanonote.h"
2.8
2.9 void gpio_init(void)
2.10 {
2.11 @@ -37,7 +38,7 @@
2.12 /*
2.13 * Initialize LCD pins
2.14 */
2.15 - __gpio_as_lcd_8bit();
2.16 + __gpio_as_slcd_8bit();
2.17
2.18 /*
2.19 * Initialize MSC pins
3.1 --- a/include/configs.h Fri Jun 05 00:07:00 2015 +0200
3.2 +++ b/include/configs.h Fri Jun 05 00:08:05 2015 +0200
3.3 @@ -24,7 +24,7 @@
3.4 /* Here are these common definitions */
3.5 /* Once your system configration change, just modify the file */
3.6
3.7 -#include "target/xburst_types.h"
3.8 +#include "xburst_types.h"
3.9
3.10 #define CONFIG_NR_DRAM_BANKS 1 /* SDRAM BANK Number: 1, 2*/
3.11 #define SDRAM_CASL 3 /* CAS latency: 2 or 3 */
4.1 --- a/stage1.c Fri Jun 05 00:07:00 2015 +0200
4.2 +++ b/stage1.c Fri Jun 05 00:08:05 2015 +0200
4.3 @@ -20,6 +20,7 @@
4.4
4.5 #include "jz4740.h"
4.6 #include "board-nanonote.h"
4.7 +#include "usb_boot_defines.h"
4.8
4.9 struct fw_args *fw_args;
4.10 volatile u32 CPU_ID;
4.11 @@ -62,5 +63,4 @@
4.12 gpio_init();
4.13 pll_init();
4.14 sdram_init();
4.15 - nand_init();
4.16 }