AM335x(TQ335x)学习笔记——使用dtb方式启动内核

简介: <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; font-family: Arial; font-size: 14px; line-height: 26px;">老式的u-boot使用ATAGS的方式启动linux内核,本文使用新式的dtb方式启动内核。</p><p s

老式的u-boot使用ATAGS的方式启动linux内核,本文使用新式的dtb方式启动内核。

我使用的内核是linux-3.17.2版本,下面开始编译内核。

(1) 解压内核

[php]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. tar jxf linux-3.17.2.tar.bz2  
(2)配置linux内核,由于am335x在内核中都归为omap2系列,故可以使用如下命令:

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. make ARCH=arm omap2plus_defconfig  

(3)编译内核:

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8  
我的linux工具链前缀是arm-linux-gnueabi-,这个需要根据自己的实际的工具链情况进行替换。

(4)编译dtb:

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x-evm.dtb  
(5)制作启动盘:

将SD格式化为FAT系统,将MLO、u-boot.img拷贝到根目录下。

在根目录下创建boot目录,将编译好的zImage和am335x-evm.dtb拷贝到该目录下。

(6)u-boot命令行启动Linux内核

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. load mmc 0 0x88000000 /boot/am335x-evm.dtb  
  2. load mmc 0 0x82000000 /boot/zImage  
  3. bootz 0x82000000 - 0x88000000  
至此,Linux内核就能启动了,看到的Log信息如下:

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. U-Boot# load mmc 0 ${fdtaddr} /boot/tq335x.dtb  
  2. 34720 bytes read in 9 ms (3.7 MiB/s)  
  3. U-Boot# load mmc 0 ${loadaddr} /boot/zImage  
  4. 4385928 bytes read in 243 ms (17.2 MiB/s)  
  5. U-Boot# bootz ${loadaddr} - ${fdtaddr}  
  6. Kernel image @ 0x82000000 [ 0x000000 - 0x42ec88 ]  
  7. ## Flattened Device Tree blob at 88000000  
  8.    Booting using the fdt blob at 0x88000000  
  9.    Loading Device Tree to 8fff4000, end 8ffff79f ... OK  
  10.   
  11. Starting kernel ...  
  12.   
  13. [    0.000000] Booting Linux on physical CPU 0x0  
  14. [    0.000000] Linux version 3.17.2 (lilianrong@AY140721164813287e77Z) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #1 SMP Mon Nov 10 20:46:04 CST 2014  
  15. [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d  
  16. [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache  
  17. [    0.000000] Machine model: TI AM335x EVM  
  18. [    0.000000] cma: Reserved 16 MiB at 9e800000  
  19. [    0.000000] Memory policy: Data cache writeback  
  20. [    0.000000]   HighMem zone: 1048574 pages exceeds freesize 0  
  21. [    0.000000] CPU: All CPU(s) started in SVC mode.  
  22. [    0.000000] AM335X ES2.1 (sgx neon )  
  23. [    0.000000] PERCPU: Embedded 9 pages/cpu @dfa9a000 s14336 r8192 d14336 u36864  
  24. [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129792  
  25. [    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=9,2048 rootfstype=ubifs rootwait=1  
  26. [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)  
  27. [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)  
  28. [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)  
  29. [    0.000000] Memory: 484792K/523264K available (5668K kernel code, 647K rwdata, 2208K rodata, 406K init, 8210K bss, 38472K reserved, 0K highmem)  
  30. [    0.000000] Virtual kernel memory layout:  
  31. [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)  
  32. [    0.000000]     fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)  
  33. [    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)  
  34. [    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)  
  35. [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)  
  36. [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)  
  37. [    0.000000]       .text : 0xc0008000 - 0xc07b9478   (7878 kB)  
  38. [    0.000000]       .init : 0xc07ba000 - 0xc081f800   ( 406 kB)  
  39. [    0.000000]       .data : 0xc0820000 - 0xc08c1d08   ( 648 kB)  
  40. [    0.000000]        .bss : 0xc08c1d08 - 0xc10c68e0   (8211 kB)  
  41. [    0.000000] Hierarchical RCU implementation.  
  42. [    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.  
  43. [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1  
  44. [    0.000000] NR_IRQS:16 nr_irqs:16 16  
  45. [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts  
  46. [    0.000000] Total of 128 interrupts on 1 active controller  
  47. [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz  
  48. [    0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns  
  49. [    0.000065] OMAP clocksource: timer1 at 24000000 Hz  
  50. [    0.000805] Console: colour dummy device 80x30  
  51. [    0.000857] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar  
  52. [    0.000865] ... MAX_LOCKDEP_SUBCLASSES:  8  
  53. [    0.000873] ... MAX_LOCK_DEPTH:          48  
  54. [    0.000880] ... MAX_LOCKDEP_KEYS:        8191  
  55. [    0.000888] ... CLASSHASH_SIZE:          4096  
  56. [    0.000895] ... MAX_LOCKDEP_ENTRIES:     32768  
  57. [    0.000902] ... MAX_LOCKDEP_CHAINS:      65536  
  58. [    0.000909] ... CHAINHASH_SIZE:          32768  
  59. [    0.000916]  memory used by lock dependency info: 5167 kB  
  60. [    0.000924]  per task-struct memory footprint: 1152 bytes  
  61. [    0.000966] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)  
  62. [    0.079040] pid_max: default: 32768 minimum: 301  
  63. [    0.079436] Security Framework initialized  
  64. [    0.079561] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)  
  65. [    0.079574] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)  
  66. [    0.081771] CPU: Testing write buffer coherency: ok  
  67. [    0.082962] CPU0: thread -1, cpu 0, socket -1, mpidr 0  
  68. [    0.083083] Setting up static identity map for 0x8055f030 - 0x8055f0a0  
  69. [    0.086327] Brought up 1 CPUs  
  70. [    0.086346] SMP: Total of 1 processors activated.  
  71. [    0.086356] CPU: All CPU(s) started in SVC mode.  
  72. [    0.088958] devtmpfs: initialized  
  73. [    0.097809] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3  
  74. [    0.134392] omap_hwmod: tptc0 using broken dt data from edma  
  75. [    0.134758] omap_hwmod: tptc1 using broken dt data from edma  
  76. [    0.135103] omap_hwmod: tptc2 using broken dt data from edma  
  77. [    0.143122] omap_hwmod: debugss: _wait_target_disable failed  
  78. [    0.201002] pinctrl core: initialized pinctrl subsystem  
  79. [    0.203537] regulator-dummy: no parameters  
  80. [    0.233163] NET: Registered protocol family 16  
  81. [    0.241735] DMA: preallocated 256 KiB pool for atomic coherent allocations  
  82. [    0.243918] cpuidle: using governor ladder  
  83. [    0.243946] cpuidle: using governor menu  
  84. [    0.255876] OMAP GPIO hardware version 0.1  
  85. [    0.271254] omap-gpmc 50000000.gpmc: could not find pctldev for node /pinmux@44e10800/nandflash_pins_s0, deferring probe  
  86. [    0.271303] platform 50000000.gpmc: Driver omap-gpmc requests probe deferral  
  87. [    0.275826] No ATAGs?  
  88. [    0.275857] hw-breakpoint: debug architecture 0x4 unsupported.  
  89. [    0.319359] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver  
  90. [    0.320718] vbat: 5000 mV   
  91. [    0.321481] lis3_reg: no parameters  
  92. [    0.324766] SCSI subsystem initialized  
  93. [    0.325577] usbcore: registered new interface driver usbfs  
  94. [    0.325755] usbcore: registered new interface driver hub  
  95. [    0.329802] usbcore: registered new device driver usb  
  96. [    0.330683] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe  
  97. [    0.330726] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral  
  98. [    0.330784] omap_i2c 4802a000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c1_pins, deferring probe  
  99. [    0.330808] platform 4802a000.i2c: Driver omap_i2c requests probe deferral  
  100. [    0.335082] Switched to clocksource timer1  
  101. [    0.480572] NET: Registered protocol family 2  
  102. [    0.482404] TCP established hash table entries: 4096 (order: 2, 16384 bytes)  
  103. [    0.482587] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)  
  104. [    0.483951] TCP: Hash tables configured (established 4096 bind 4096)  
  105. [    0.484145] TCP: reno registered  
  106. [    0.484169] UDP hash table entries: 256 (order: 2, 20480 bytes)  
  107. [    0.484359] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)  
  108. [    0.485643] NET: Registered protocol family 1  
  109. [    0.487595] RPC: Registered named UNIX socket transport module.  
  110. [    0.487618] RPC: Registered udp transport module.  
  111. [    0.487628] RPC: Registered tcp transport module.  
  112. [    0.487637] RPC: Registered tcp NFSv4.1 backchannel transport module.  
  113. [    0.488910] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available  
  114. [    0.493146] futex hash table entries: 256 (order: 2, 16384 bytes)  
  115. [    0.498771] VFS: Disk quotas dquot_6.5.2  
  116. [    0.498919] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)  
  117. [    0.500956] NFS: Registering the id_resolver key type  
  118. [    0.501307] Key type id_resolver registered  
  119. [    0.501322] Key type id_legacy registered  
  120. [    0.501464] jffs2: version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.  
  121. [    0.501877] msgmni has been set to 978  
  122. [    0.507196] io scheduler noop registered  
  123. [    0.507232] io scheduler deadline registered  
  124. [    0.507301] io scheduler cfq registered (default)  
  125. [    0.509624] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568  
  126. [    0.513086] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled  
  127. [    0.519109] omap_uart 44e09000.serial: no wakeirq for uart0  
  128. [    0.519691] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0  
  129. [    1.212068] console [ttyO0] enabled  
  130. [    1.221114] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20  
  131. [    1.253833] brd: module loaded  
  132. [    1.273197] loop: module loaded  
  133. [    1.279721] mtdoops: mtd device (mtddev=name/number) must be supplied  
  134. [    1.289621] usbcore: registered new interface driver asix  
  135. [    1.295487] usbcore: registered new interface driver ax88179_178a  
  136. [    1.301980] usbcore: registered new interface driver cdc_ether  
  137. [    1.308269] usbcore: registered new interface driver smsc95xx  
  138. [    1.314388] usbcore: registered new interface driver net1080  
  139. [    1.320444] usbcore: registered new interface driver cdc_subset  
  140. [    1.326767] usbcore: registered new interface driver zaurus  
  141. [    1.332806] usbcore: registered new interface driver cdc_ncm  
  142. [    1.340919] usbcore: registered new interface driver cdc_wdm  
  143. [    1.347170] usbcore: registered new interface driver usb-storage  
  144. [    1.353622] usbcore: registered new interface driver usbtest  
  145. [    1.364045] mousedev: PS/2 mouse device common for all mice  
  146. [    1.374760] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0  
  147. [    1.382981] i2c /dev entries driver  
  148. [    1.386769] Driver for 1-wire Dallas network protocol.  
  149. [    1.398911] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec  
  150. [    1.408869] omap_hsmmc 48060000.mmc: unable to get vmmc regulator -517  
  151. [    1.416459] platform 48060000.mmc: Driver omap_hsmmc requests probe deferral  
  152. [    1.424503] ledtrig-cpu: registered to indicate activity on CPUs  
  153. [    1.431429] usbcore: registered new interface driver usbhid  
  154. [    1.437293] usbhid: USB HID core driver  
  155. [    1.442582] oprofile: using arm/armv7  
  156. [    1.447131] TCP: cubic registered  
  157. [    1.450611] Initializing XFRM netlink socket  
  158. [    1.455238] NET: Registered protocol family 17  
  159. [    1.459968] NET: Registered protocol family 15  
  160. [    1.465016] Key type dns_resolver registered  
  161. [    1.469680] omap_voltage_late_init: Voltage driver support not added  
  162. [    1.476366] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize  
  163. [    1.484816] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize  
  164. [    1.494347] ThumbEE CPU extension supported.  
  165. [    1.498923] Registering SWP/SWPB emulation handler  
  166. [    1.503942] SmartReflex Class3 initialized  
  167. [    1.517159] omap-gpmc 50000000.gpmc: GPMC revision 6.0  
  168. [    1.524094] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xd3  
  169. [    1.530939] nand: Samsung NAND 1GiB 3,3V 8-bit  
  170. [    1.535638] nand: 1024MiB, SLC, page size: 2048, OOB size: 64  
  171. [    1.541640] nand: error: CONFIG_MTD_NAND_OMAP_BCH not enabled  
  172. [    1.547760] omap2-nand: probe of omap2-nand.0 failed with error -22  
  173. [    1.663619] tps65910 0-002d: No interrupt support, no core IRQ  
  174. [    1.680749] vrtc: 1800 mV   
  175. [    1.684124] vrtc: supplied by vbat  
  176. [    1.691498] vio: at 1500 mV   
  177. [    1.694737] vio: supplied by vbat  
  178. [    1.701644] vdd_mpu: 912 <--> 1312 mV at 1325 mV   
  179. [    1.706882] vdd_mpu: supplied by vbat  
  180. [    1.713875] vdd_core: 912 <--> 1150 mV at 1137 mV   
  181. [    1.719187] vdd_core: supplied by vbat  
  182. [    1.725964] vdd3: 5000 mV   
  183. [    1.731302] vdig1: at 1800 mV   
  184. [    1.734706] vdig1: supplied by vbat  
  185. [    1.741264] vdig2: at 1800 mV   
  186. [    1.744671] vdig2: supplied by vbat  
  187. [    1.751054] vpll: at 1800 mV   
  188. [    1.754365] vpll: supplied by vbat  
  189. [    1.760730] vdac: at 1800 mV   
  190. [    1.764036] vdac: supplied by vbat  
  191. [    1.770317] vaux1: at 1800 mV   
  192. [    1.773717] vaux1: supplied by vbat  
  193. [    1.780114] vaux2: at 3300 mV   
  194. [    1.783514] vaux2: supplied by vbat  
  195. [    1.789893] vaux33: at 3300 mV   
  196. [    1.793397] vaux33: supplied by vbat  
  197. [    1.799920] vmmc: 1800 <--> 3300 mV at 3300 mV   
  198. [    1.804999] vmmc: supplied by vbat  
  199. [    1.810938] vbb: at 3000 mV   
  200. [    1.814411] vbb: supplied by vbat  
  201. [    1.819729] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz  
  202. [    1.833220] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz  
  203. [    1.877209] UBI error: ubi_init: cannot open mtd 9, error -19  
  204. [    1.944943] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6  
  205. [    1.951329] davinci_mdio 4a101000.mdio: detected phy mask ffffffde  
  206. [    1.961340] libphy: 4a101000.mdio: probed  
  207. [    1.965645] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown  
  208. [    1.974006] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver unknown  
  209. [    1.983572] cpsw 4a100000.ethernet: Detected MACID = c4:ed:ba:88:b5:e4  
  210. [    1.994560] input: volume_keys@0 as /devices/volume_keys@0/input/input0  
  211. [    2.005474] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)  
  212. [    2.014497] sr_init: No PMIC hook to init smartreflex  
  213. [    2.020120] sr_init: platform driver register failed for SR  
  214. [    2.043081] lis3_reg: disabling  
  215. [    2.049937] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19  
  216. [    2.058011] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19  
  217. [    2.066393] Please append a correct "root=" boot option; here are the available partitions:  
  218. [    2.075257] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)  
  219. [    2.083990] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)  
(7)小结

从启动Log上很容易看出,现在内核无法挂在根文件系统,在下一篇文章中,我会制作根文件系统。

相关文章
|
9月前
启动内核,能启动内核但是无法进入内核,始终卡在某一地方,比如 No soundcards found.
启动内核,能启动内核但是无法进入内核,始终卡在某一地方,比如 No soundcards found.
95 0
|
11月前
|
Linux Shell 网络安全
Linux 让进程在后台可靠运行的几种方法
Linux 让进程在后台可靠运行的几种方法
103 0
|
11月前
|
网络安全
服务器初始化及内核调优脚本
服务器初始化及内核调优脚本
|
Web App开发 存储 Unix
【Linux】【操作】Linux操作集锦系列之三——进程管理系列之(五)进程与控制终端(shell)去绑定(解耦)的操作
【Linux】【操作】Linux操作集锦系列之三——进程管理系列之(五)进程与控制终端(shell)去绑定(解耦)的操作
130 0
【Linux】【操作】Linux操作集锦系列之三——进程管理系列之(五)进程与控制终端(shell)去绑定(解耦)的操作
|
编解码 运维 Linux
Linux 系统使用和初始化配置| 学习笔记
快速学习Linux 系统使用和初始化配置
149 0
Linux 系统使用和初始化配置| 学习笔记
|
Linux Shell 调度
12.2 Linux进程启动的方式有几种?
在 Linux 系统中,每个进程都有一个唯一的进程号(PID),方便系统识别和调度进程。通过简单地输出运行程序的程序名,就可以运行该程序,其实也就是启动了一个进程。
353 0
12.2 Linux进程启动的方式有几种?
|
Linux 存储
u-boot向linux内核传递启动参数(详细)
U-BOOT 在启动内核时,会向内核传递一些参数.BootLoader 可以通过两种方法传递参数给内核,一种是旧的参数结构方式(parameter_struct),主要是 2.6 之前的内核使用的方式。
1628 0
|
Linux Perl
一条命令完成Linux下批量杀死某应用程序相关的进程
一、背景 很多时候我们需要迅速杀死某运用程序相关的全部进程,但是又不能杀死某个与该应用程序的特定进程,怎么办呢?结合前一段时间学习的awk及grep,让我们来实践一下吧! 二、实际操作 目前我需要杀死sftp相关的进程,但是不能杀死与grep相关的进程,命令写法如下: kill -9 $(ps -.
1467 0

相关实验场景

更多