Forum Discussion
I have spent several days trying to solve this problem, but found none of them working.
But fortunately I solved this after pits and pits.
I was tying to build uboot 2017.11.
pit 1. no config
sudo apt-get install -y bison flex
make socfpga_de10_nano_defconfig
pit 2. no gcc
apt-get install crossbuild-essential-armhf
pit 3. cc1: error: bad value (‘generic-armv7-a’) for ‘-mtune=’ switch
export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
or
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
pit 4. tc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
nano scripts/dtc/dtc-lexer.lex.c
//YYLTYPE yylloc;
extern YYLTYPE yylloc;
pit 5. arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv5
this took me 2-days to solve, if did armv7 or armv5t it would give you something like this.
arch/arm/cpu/armv7/cache_v7.c
{standard input}:35: Error: selected processor does not support `mcr p15,0,r3,c7,c5,0' in Thumb mode
nano .\arch\arm\Makefile
# Replace
# arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, \
# $(call cc-option, -march=armv7, -march=armv5))
arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, \
$(call cc-option, -march=armv7-a, -march=armv7-a))
Through these pits, you should be able to compile the u-boot.
pit 6. You may follow this guide to plant uboot into SDCard
https://github.com/ikwzm/FPGA-SoC-U-Boot-DE10-Nano
The patch is not necessary.
Device Boot Start End Sectors Size Id Type
/dev/sdc1 18432 223231 204800 100M b W95 FAT32
/dev/sdc2 223232 61765631 61542400 29.4G 83 Linux
/dev/sdc3 2048 18431 16384 8M a2 unknown
$ dd if=u-boot-spl.sfp of=/dev/sdc3 bs=64k seek=0
$ dd if=u-boot.img of=/dev/sdc3 bs=64k seek=4