have now cleaned my r64-branch a bit and it compiles also with mt7531-driver
just make a clone and then
./build.sh config #change switch to mt7531
currently i try to figure out how to use SD as flash type…emmc compiles fine while SD is broken
/media/data_fast/bpi/uboot/u-boot/include/configs/mt7622_evb.h:412:45: error: 'NFI_BASE' undeclared here (not in a function)
#define CONFIG_SYS_NAND_BASE NFI_BASE
it looks like there is a missing condition…or include order is wrong (board before nand)
imho nand != sd-card or is nand-driver needed for sdcard? tried to add include which defines NFI_base (e.g. asm/arch-mt7622/mt6735.h) but this leads to other errors…any idea about that? @jackzeng@sinovoip@moore
I am not familiar with build.sh build flow. I guess uboot source in bpi github has something different from original one (at least config.in in home directory) . I don’t see such problem if use original uboot source with buildroot-gcc492 toolchain (type make menuconfig; make to build uboot image) and uboot partition in below image was also built by this way.
i wonder why different toolchain does not show this error…maybe nand-include is missing for SD? these includes are not used or after the mt7622.h
as far as i see the only include of mt7622_evb.h is in ./arch/arm/lib/bootm.c and here is no include to the nand (i guess it’s later in storage-commands)…isn’t it better to define IO_PHYS / NFI_BASE in board-header (to use it there) or some “global” header-file instead of the NAND-driver?
i wonder why it happens because the call to this value comes from the universal-nand-driver…shouldn’t it not include the nand-headers first? havn’t found out the order yet
if i add the 2 defines to the board-header, i don’t get the expected duplicate definition…instead i got an undefined reference for board_nand_init in drivers/mtd/nand/nand.c:180
BPI do have original/up-to-date uboot source code, but they missed some changes in above github. I guess they just extracted related patch/files from up-to-date uboot to current uboot codebase. I’ll suggest they can put original code to github as reference, thanks.
just a small update on gcc-issue (does not boot if compiled with linaro gcc 5.5+)
if i enable debug in mt7622_evb.h i see this:
U-Boot code: FFFFFFFF -> FFFFFFFF BSS: -> FFFFFFFF
monitor len: 00000000
TLB table from 7eff0000 to 7eff4000
Top of RAM usable for U-Boot at: 7eff0000
Reserving 0k for U-Boot at: 7eff0000 <<<<<<<<<<<<<<< 0k is a little bit, right? :)
Reserving 32772k for malloc() at: 7cfef000
Reserving 32 Bytes for Board Info at: 7cfeefe0
Reserving 160 Bytes for Global Data at: 7cfeef40
New Stack Pointer is: 7cfeef30
Bank #0: 40000000 1008 MiB
relocation Offset is: 7eff0001 <<<<<<<<<<<<<< not aligned, last 1 is strange
basicly it hangs after the dram-information, not showing uboot-version (like it does if compiled with gcc4.8)
with the great help of @ray we have fixed the gcc5.5±issue (compile but not boot) by removing object-copy filtering:
so uboot is now compilable with ubuntu 18.4 (gcc6.5) and boots up correctly
for gcc7+ we need to fix some compile-errors
common/main.c:31:6: error: 'show_boot_progress' aliased to external symbol '__show_boot_progress'
void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
make: *** [common/main.o] Error 1
make: *** [common] Error 2
make: *** Waiting for unfinished jobs....
arch/arm/lib/board.c:73:6: error: 'coloured_LED_init' aliased to external symbol '__coloured_LED_init'
arch/arm/lib/board.c:90:6: error: 'blue_led_off' aliased to external symbol '__blue_led_off'
void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
arch/arm/lib/board.c:88:6: error: 'blue_led_on' aliased to external symbol '__blue_led_on'
void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
arch/arm/lib/board.c:86:6: error: 'yellow_led_off' aliased to external symbol '__yellow_led_off'
void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
arch/arm/lib/board.c:84:6: error: 'yellow_led_on' aliased to external symbol '__yellow_led_on'
void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
arch/arm/lib/board.c:82:6: error: 'green_led_off' aliased to external symbol '__green_led_off'
void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
arch/arm/lib/board.c:80:6: error: 'green_led_on' aliased to external symbol '__green_led_on'
void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
arch/arm/lib/board.c:78:6: error: 'red_led_off' aliased to external symbol '__red_led_off'
void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
arch/arm/lib/board.c:76:6: error: 'red_led_on' aliased to external symbol '__red_led_on'
void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
i tried to fix them like here by disabling the weak-option (not the best way,right? maybe weak is needed to overwrite these functions…)
but now i get these:
lib/time.o: In function `__raw_writesb':
/media/data_fast/bpi/uboot/u-boot/arch/arm/include/asm/io.h:80: multiple definition of `__raw_writesb'
lib/display_options.o:/media/data_fast/bpi/uboot/u-boot/arch/arm/include/asm/io.h:80: first defined here
lib/time.o: In function `__raw_writesw':
/media/data_fast/bpi/uboot/u-boot/arch/arm/include/asm/io.h:88: multiple definition of `__raw_writesw'