公司即将开始使用新的平台基于cortex-A9架构四核的exynos4412Soc,开发板是友善之臂公司的tiny4412,接下来记录下移植调试内核中的一些问题:
首先,从SD卡读取内核镜像引导后如下:
## Booting kernel from Legacy Image at 40007fc0 ...
Image Name: Linux-3.5.0-FriendlyARM
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4783920 Bytes = 4671 KiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
就卡住了不再往下执行,猜测是机器码的原因,查看下果然是xyd4412中使用的是自己定义的数值,与内核bsp文件中宏machine start指定的TINY4412不同,于是修改XYDboot中的机器码与内核保持一致,再次编译XYDboot,烧写到SD卡,引导内核,发现还是卡在那个地方,网上查到可以修改内核配置来解决,于是更改了内核配置的kernel hacking选项下的菜单:
│ -> Kernel hacking │ -----> Kernel low-level debugging functions (read help!) │
│ -> Device Drivers -------> Character devices------> Serial drivers ----> samsung SoC serial support
重新编译引导,可以启动了,能显示启动信息,把内核中那个菜单选下来后,又是到boot kernel卡住,猜测原因是:并不是没有启动,而是启动的打印信息没有输出。选择的这个菜单负责的是内核打印调试信息。
接下来内核能够引导,但是执行中会挂掉,串口输出如下:
<6>Booting Linux on physical CPU 0
<6>Initializing cgroup subsys cpu
<5>Linux version 3.5.0-FriendlyARM ([email protected]) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #5 SMP PREEMPT Fri Jan 2 21:23:13 CST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: TINY4412
<6>cma: CMA: reserved 32 MiB at 6d800000
Memory policy: ECC disabled, Data cache writealloc
CPU EXYNOS4412 (id 0xe4412011)
<7>exynos4_init_clocks: initializing clocks
<6>S3C24XX Clocks, Copyright 2004 Simtec Electronics
<3>s3c_register_clksrc: clock armclk has no registers set
<3>s3c_register_clksrc: clock audiocdclk has no registers set
<3>audiocdclk: no parent clock specified
<7>exynos4_setup_clocks: registering clocks
<7>exynos4_setup_clocks: xtal is 24000000
<6>EXYNOS4: PLL settings, A=1400000000, M=800000000, E=96000000 V=108000000<6>EXYNOS4: ARMCLK=1400000000, DMC=400000000, ACLK200=160000000
ACLK100=100000000, ACLK160=160000000, ACLK133=133333333
<6>sclk_pwm: source is ext_xtal (0), rate is 24000000
<6>sclk_csis: source is xusbxti (1), rate is 1500000
<6>sclk_csis: source is xusbxti (1), rate is 1500000
<6>sclk_cam0: source is xusbxti (1), rate is 1500000
<6>sclk_cam1: source is xusbxti (1), rate is 1500000
<6>sclk_fimc: source is xusbxti (1), rate is 1500000
<6>sclk_fimc: source is xusbxti (1), rate is 1500000
<6>sclk_fimc: source is xusbxti (1), rate is 1500000
<6>sclk_fimc: source is xusbxti (1), rate is 1500000
<6>sclk_fimd: source is xusbxti (1), rate is 1500000
<6>sclk_jpeg: source is mout_jpeg0 (0), rate is 50000000
<6>sclk_fimg2d: source is mout_g2d0 (0), rate is 200000000
<6>sclk_g3d: source is mout_g3d0 (0), rate is 50000000
<6>sclk_mfc: source is mout_mfc0 (0), rate is 50000000
<7>On node 0 totalpages: 253696
<7>free_area_init_node: node 0, pgdat c09550c0, node_mem_map c09fa000
<7> Normal zone: 1710 pages used for memmap
<7> Normal zone: 0 pages reserved
<7> Normal zone: 184658 pages, LIFO batch:31
<7> HighMem zone: 592 pages used for memmap
<7> HighMem zone: 66736 pages, LIFO batch:15
<6>PERCPU: Embedded 8 pages/cpu @c1303000 s11712 r8192 d12864 u32768
<7>pcpu-alloc: s11712 r8192 d12864 u32768 alloc=8*4096
<7>pcpu-alloc:
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 251394
<5>Kernel command line: noinitrd root=/dev/nfs nfsroot=192.168.6.101:/work_4412/root_nfs ip=192.168.6.101:192.168.6.99:192.168.6.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0
<6>PID hash table entries: 4096 (order: 2, 16384 bytes)
<6>Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
<6>Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
<6>Memory: 384MB 607MB = 991MB total
<5>Memory: 961524k/961524k available, 86028k reserved, 269312K highmem
<5>Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc089e168 (8793 kB)
.init : 0xc089f000 - 0xc08d4dc0 ( 216 kB)
.data : 0xc08d6000 - 0xc0988cd0 ( 716 kB)
.bss : 0xc0988cf4 - 0xc09f99b0 ( 452 kB)
<6>SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
<6>Preemptible hierarchical RCU implementation.
<6>NR_IRQS:549
<6>sched_clock: 32 bits at 200 Hz, resolution 5000000ns, wraps every 4294967291ms
<6>Console: colour dummy device 80x30
<6>Calibrating delay loop...
<6>pid_max: default: 32768 minimum: 301
<6>Mount-cache hash table entries: 512
<6>Initializing cgroup subsys debug
<6>Initializing cgroup subsys cpuacct
<6>Initializing cgroup subsys freezer
<6>CPU: Testing write buffer coherency: ok
<6>CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
<6>hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
<6>Setting up static identity map for 0x40617f88 - 0x40617fe0
<2>Bad mode in prefetch abort handler detected
<0>Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP ARM
CPU: 0 Not tainted (3.5.0-FriendlyARM #5)
PC is at 0x82008
LR is at exynos4_l2x0_cache_init+0x9c/0x13c
pc : [<00082008>] lr : [
sp : ed043f34 ip : 409891f8 fp : 00000000
r10: 00000000 r9 : 00000000 r8 : c08a634c
r7 : 00000000 r6 : ed042000 r5 : c0913768 r4 : c09891f8
r3 : 30000007 r2 : 00000120 r1 : 00000110 r0 : ffffffea
Flags: nZCv IRQs off FIQs off Mode UK6_32 ISA ARM Segment kernel
Control: 10c5387d Table: 4000404a DAC: 00000015
LR: 0xc08a6368:
6368 e3a00000 e5933000 e59f2100 e1a038a3 e3a01a02 e1a03883 e3440322 e3411050
6388 e3a0ce11 e1530000 e5821000 e582c008 0a000002 e373056f 1582c00c 1a000002
63a8 e59f30c8 e3a02e12 e583200c e59f40bc e3a0c273 e59f50b8 e1a0300c e3a01e11
63c8 e594200c e584c018 e3e00015 e3a0c003 e584c01c e284c480 e585c000 ebddfeff
63e8 e3a02001 e30f3fff e594101c e3472c47 e34c3200 e3e00016 ebddfef8 e3a01000
6408 e1a02001 e1a03001 e3e00017 ebddfef3 e3a02000 e3a01001 e1a03002 e3e00014
6428 ebddfeee e1a00005 e3a01004 ebddf464 e1a00004 e3a01020 ebddf461 e3a00000
6448 e3a01001 e30f2fff e34f0860 e3471c47 e34c2200 ebfffe5b e59f2018 e59f3018
SP: 0xed043eb4:
3eb4 44202061 203a4341 30303030 35313030 c081b200 ed043ee0 c07bdca4 ed043ee0
3ed4 ed048000 c0083b38 c081b2c0 c09aee34 00000001 ed043f34 00000000 ed042000
3ef4 ed048000 00000000 00000000 00000000 00000000 c0017e2c 00000000 0000000b
3f14 ed043f34 00082008 600001d6 ffffffff c08a634c c0018180 ffffffea c08a63e8
3f34 ffffffea 00000110 00000120 30000007 c09891f8 c0913768 ed042000 00000000
3f54 c08a634c 00000000 00000000 00000000 409891f8 ed043f34 c08a63e8 00082008
3f74 600001d6 ffffffff c08a63e8 00000000 c08d1370 c0988d00 c00086e4 ed043fc4
3f94 00000004 c08d138c 00000013 00000000 00000000 00000000 c08d1370 c08d138c
R4: 0xc0989178:
9178 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ed054000
9198 0000041f 0000045f c0007ff8 c105fba4 00000000 00000000 00000000 00000000
91b8 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
91d8 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
91f8 10502000 00000000 00000110 00000120 00000000 00000000 30000007 00000003
9218 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9238 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9258 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
查找原因,参考这里的解决办法:tiny4412的内核引导问题,友善之臂从2014-03-17 更新说明:
================================
Superboot4412更新如下:
1)修正了eMMC大小显示不正确的问题;
2)实现了根据eMMC大小进行智能分区,以使Android下的Data分区得到更大的可用空间;
3)开启了三星推荐的TrustZone安全模式,注意内核必须也要启动 TrustZone 模式,才能配合此版本的 Superboot使用,否则将无法启动;
所以,uboot不支持trustzone,内核必须禁止trustzone后编译才能启动;如果是superboot,此日期前的应该能启动,此日期后的则必须是启用trustzone后编译的内核才能启动。
依照上面办法重新配置内核解决了该问题,内核能够正常启动了,但是现在又出现问题挂在了:
<6>IP-Config: Complete:
[ 7.110000] IP-Config: Complete:
<6> device=eth0, addr=192.168.6.101, mask=255.255.255.0, gw=192.168.6.1
[ 7.115000] device=eth0, addr=192.168.6.101, mask=255.255.255.0, gw=192.168.6.1
<6> host=192.168.6.101, domain=, nis-domain=(none)
[ 7.125000] host=192.168.6.101, domain=, nis-domain=(none)
<6> bootserver=192.168.6.99, rootserver=192.168.6.101, rootpath=link_reset() speed: 10 duplex: 0
[ 7.140000] bootserver=192.168.6.99, rootserver=192.168.6.101, rootpath=[ 7.140000] link_reset() speed: 10 duplex: 0
<6>hotplug_policy_init: intialised with policy : DVFS_NR_BASED_HOTPLUG[ 7.165000] hotplug_policy_init: intialised with policy : DVFS_NR_BASED_HOTPLUG<6>ALSA device list:
[ 7.175000] ALSA device list:
<6> No soundcards found.
[ 7.180000] No soundcards found.
<6>nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
[ 10.835000] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
猜测是给uboot给内核传递启动参数的问题,现在是网络不能挂接,并且声卡也有问题的