为什么需要更新呢?其实是为了更好的搭建自己的开发环境,同时熟悉altera对代码的更新和管理方式,便于进一步的熟悉和了解altera SoC开发过程。
1、下载linux代码:
- git clone git://git.rocketboards.org/linux-socfpga.git
2、进入代码路径:
- cd linux-socfpga
3、查看远程分支有哪些版本
- git branch -r
可以看到有很多的版本,我选择了socfpga-3.10
- [email protected]:~/altera/linux-src/linux-socfpga$ git branch -r
- origin/HEAD -> origin/master
- origin/master
- origin/socfpga-3.10
- origin/socfpga-3.10-ltsi
- origin/socfpga-3.10-ltsi-rt
- origin/socfpga-3.11
- origin/socfpga-3.12
- origin/socfpga-3.13
- origin/socfpga-3.13-rel14.0
- origin/socfpga-3.14
- origin/socfpga-3.15
- origin/socfpga-3.16
- origin/socfpga-3.17
- origin/socfpga-3.4-ltsi
- origin/socfpga-3.6
- origin/socfpga-3.7
- origin/socfpga-3.7-ghrd
- origin/socfpga-3.8
- origin/socfpga-3.9
- origin/socfpga-3.9-rel
- origin/socfpga-3.9-rel-amp
4、获取Linux3.10代码:
- git checkout -t -b socfpga-3.10 origin/socfpga-3.10
5、指定交叉编译环境路径
- export CROSS_COMPILE=/tool/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-
6、编译linux,生成zImage
- make ARCH=arm socfpga_defconfig
- make ARCH=arm zImage
编译完成以后,可以看到以下信息
- ......... ...........................................................
7、替换SD卡中的zImage文件
8、上电运行,可看到以下信息
Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Linux version 3.10.0-00208-gc29c849 ([email protected]) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #3 SMP Mon Feb 23 17:12:46 CST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Altera SOCFPGA Cyclone V
Truncating RAM at 0x00000000-0x40000000 to -0x2f800000
Memory policy: Data cache writealloc
PERCPU: Embedded 8 pages/cpu @ef1e4000 s11008 r8192 d13568 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 193040
Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait fbmode=VGA
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 763272K/778240K available (5567K kernel code, 267K rwdata, 1516K rodata, 390K init, 134K bss, 14968K reserved)
至此3.10系统已经可以顺利运行啦