微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > AM335x(TQ335x)学习笔记——使用dtb方式启动内核

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

时间:11-28 来源:互联网 点击:
老式的u-boot使用ATAGS的方式启动linux内核,本文使用新式的dtb方式启动内核。

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

(1) 解压内核

  1. tarjxflinux-3.17.2.tar.bz2

(2)配置linux内核,由于am335x在内核中都归为omap2系列,故可以使用如下命令:

  1. makeARCH=armomap2plus_defconfig

(3)编译内核:

  1. makeARCH=armCROSS_COMPILE=arm-linux-gnueabi--j8

我的linux工具链前缀是arm-linux-gnueabi-,这个需要根据自己的实际的工具链情况进行替换。

(4)编译dtb:

  1. makeARCH=armCROSS_COMPILE=arm-linux-gnueabi-am335x-evm.dtb

(5)制作启动盘:

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

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

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

  1. loadmmc00x88000000/boot/am335x-evm.dtb
  2. loadmmc00x82000000/boot/zImage
  3. bootz0x82000000-0x88000000

至此,Linux内核就能启动了,看到的Log信息如下:

  1. U-Boot#loadmmc0${fdtaddr}/boot/tq335x.dtb
  2. 34720bytesreadin9ms(3.7MiB/s)
  3. U-Boot#loadmmc0${loadaddr}/boot/zImage
  4. 4385928bytesreadin243ms(17.2MiB/s)
  5. U-Boot#bootz${loadaddr}-${fdtaddr}
  6. Kernelimage@0x82000000[0x000000-0x42ec88]
  7. ##FlattenedDeviceTreeblobat88000000
  8. Bootingusingthefdtblobat0x88000000
  9. LoadingDeviceTreeto8fff4000,end8ffff79f...OK
  10. Startingkernel...
  11. [0.000000]BootingLinuxonphysicalCPU0x0
  12. [0.000000]Linuxversion3.17.2(lilianrong@AY140721164813287e77Z)(gccversion4.7.3(Ubuntu/Linaro4.7.3-12ubuntu1))#1SMPMonNov1020:46:04CST2014
  13. [0.000000]CPU:ARMv7Processor[413fc082]revision2(ARMv7),cr=10c5387d
  14. [0.000000]CPU:PIPT/VIPTnonaliasingdatacache,VIPTaliasinginstructioncache
  15. [0.000000]Machinemodel:TIAM335xEVM
  16. [0.000000]cma:Reserved16MiBat9e800000
  17. [0.000000]Memorypolicy:Datacachewriteback
  18. [0.000000]HighMemzone:1048574pagesexceedsfreesize0
  19. [0.000000]CPU:AllCPU(s)startedinSVCmode.
  20. [0.000000]AM335XES2.1(sgxneon)
  21. [0.000000]PERCPU:Embedded9pages/cpu@dfa9a000s14336r8192d14336u36864
  22. [0.000000]Built1zonelistsinZoneorder,mobilitygroupingon.Totalpages:129792
  23. [0.000000]Kernelcommandline:console=ttyO0,115200n8root=ubi0:rootfsrwubi.mtd=9,2048rootfstype=ubifsrootwait=1
  24. [0.000000]PIDhashtableentries:2048(order:1,8192bytes)
  25. [0.000000]Dentrycachehashtableentries:65536(order:6,262144bytes)
  26. [0.000000]Inode-cachehashtableentries:32768(order:5,131072bytes)
  27. [0.000000]Memory:484792K/523264Kavailable(5668Kkernelcode,647Krwdata,2208Krodata,406Kinit,8210Kbss,38472Kreserved,0Khighmem)
  28. [0.000000]Virtualkernelmemorylayout:
  29. [0.000000]vector:0xffff0000-0xffff1000(4kB)
  30. [0.000000]fixmap:0xffc00000-0xffe00000(2048kB)
  31. [0.000000]vmalloc:0xe0800000-0xff000000(488MB)
  32. [0.000000]lowmem:0xc0000000-0xe0000000(512MB)
  33. [0.000000]pkmap:0xbfe00000-0xc0000000(2MB)
  34. [0.000000]modules:0xbf000000-0xbfe00000(14MB)
  35. [0.000000].text:0xc0008000-0xc07b9478(7878kB)
  36. [0.000000].init:0xc07ba000-0xc081f800(406kB)
  37. [0.000000].data:0xc0820000-0xc08c1d08(648kB)
  38. [0.000000].bss:0xc08c1d08-0xc10c68e0(8211kB)
  39. [0.000000]HierarchicalRCUimplementation.
  40. [0.000000]RCUrestrictingCPUsfromNR_CPUS=2tonr_cpu_ids=1.
  41. [0.000000]RCU:Adjustinggeometryforrcu_fanout_leaf=16,nr_cpu_ids=1
  42. [0.000000]NR_IRQS:16nr_irqs:1616
  43. [0.000000]IRQ:FoundanINTCat0xfa200000(revision5.0)with128interrupts
  44. [0.000000]Totalof128interruptson1activecontroller
  45. [0.000000]OMAPclockeventsource:timer2at24000000Hz
  46. [0.000016]sched_clock:32bitsat24MHz,resolution41ns,wrapsevery178956969942ns
  47. [0.000065]OMAPclocksource:timer1at24000000Hz
  48. [0.000805]Console:colourdummydevice80x30
  49. [0.000857]Lockdependencyvalidator:Copyright(c)2006RedHat,Inc.,IngoMolnar
  50. [0.000865]...MAX_LOCKDEP_SUBCLASSES:8
  51. [0.000873]...MAX_LOCK_DEPTH:48
  52. [0.000880]...MAX_LOCKDEP_KEYS:8191
  53. [0.000888]...CLASSHASH_SIZE:4096
  54. [0.000895]...MAX_LOCKDEP_ENTRIES:32768
  55. [0.000902]...MAX_LOCKDEP_CHAINS:65536
  56. [0.000909]...CHAINHASH_SIZE:32768
  57. [0.000916]memoryusedbylockdependenc

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top