1. 工具链
tar -xf buildroot-2016.02-glibc-gcc-4.7.x-mips32-nofpu.tar.bz2 -C /
编译前设置交叉工具链的路径
export PATH=/home/loongson/tools/buildroot/buildroot-2016.02-glibc-gcc-4.7.x-mips32-nofpu/output/host/usr/bin:$PATH
路径可能有所不同,按自己电脑使用的为准
使用buildroot制作工具链的方法参考:
龙芯loongson1:buildroot-2016.02制作龙芯1mips32交叉工具链_damifeng的专栏-CSDN博客
2. 编译u-boot
tar -xf u-boot-2013.10.tar.bz2
cd u-boot-2013.10
make ARCH=mips CROSS_COMPILE=mipsel-linux- distclean
make ARCH=mips CROSS_COMPILE=mipsel-linux- ls1b_config
make ARCH=mips CROSS_COMPILE=mipsel-linux-
编译后生成u-boot.bin
3. 烧录u-boot
通过tftp烧录到spi flash
tftpboot a0200000 u-boot.bin;sf probe 0;sf erase 0 80000;sf update 80200000 0 ${filesize}