使用设备树启动内核

1、使uboot支持设备树,配置CONFIG_OF_LIBFDT,编译。编译出错,问题:boot_relocate_fdt未定义
错误解决:配置CONFIG_SYS_BOOTMAPSZ,重新编译即可
--------------------------------------------------------------------------
2、启动uboot,把生成的dtb下载到开发板的内存中
smdk4412 # fatload mmc 0 0x41000000 image/exynos4412-smdk4412.dtb
smdk4412 # fdt addr 0x41000000
smdk4412 # fdt header
magic:                  0xd00dfeed
totalsize:              0x25d5 (9685)
off_dt_struct:          0x38
off_dt_strings:         0x2474
off_mem_rsvmap:         0x28
version:                17
last_comp_version:      16
boot_cpuid_phys:        0x0
size_dt_strings:        0x161
size_dt_struct:         0x243c
number mem_rsv:         0x0


3、使用设备树启动内核
smdk4412 # fatload mmc 0 0x41000000 image/exynos4412-smdk4412.dtb
smdk4412 # fdt addr 0x41000000
smdk4412 # movi r k 0 40000000
smdk4412 # bootm 40000000 - 41000000  //bootm 内核地址 根文件系统地址 设备树地址


出现下面问题:
ERROR: Failed to allocate 0x55d5 bytes below 0x40000000.
device tree - allocation error


解决:去掉CONFIG_SYS_BOOTMAPSZ配置,屏蔽fdt重定位代码
参考:http://lists.denx.de/pipermail/u-boot/2014-February/174027.html
--------------------------------------------------------------------------




## Booting kernel from Legacy Image at 40007fc0 ...
   Image Name:   Linux-3.8.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2105832 Bytes = 2056 KiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 41000000
   Booting using the fdt blob at 0x41000000
   Loading Kernel Image ... OK
OK
WARNING: could not set bootargs FDT_ERR_NOSPACE.
WARNING: could not set reg FDT_ERR_NOSPACE.


Starting kernel ...


Uncompressing Linux... done, booting the kernel.


Error: unrecognized/unsupported device tree compatible list:
[ 'samsung,smdk4412' 'samsung,exynos4412' ]


Available machine support:


ID (hex)        NAME
0000133b        SMDK4412
00000e36        SMDK4212


Please check your kernel config and/or bootloader.


解决:配置支持exynos4支持设备树即可
System Type  --->
SAMSUNG EXYNOS SoCs Support  ---> 
[*] Samsung Exynos4 Machine using device tree 
--------------------------------------------------------------------------
@@再次启动,加载设备树启动成功
## Booting kernel from Legacy Image at 40007fc0 ...
   Image Name:   Linux-3.8.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2128968 Bytes = 2079 KiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 41000000
   Booting using the fdt blob at 0x41000000
   Loading Kernel Image ... OK
OK
WARNING: could not set bootargs FDT_ERR_NOSPACE.
WARNING: could not set reg FDT_ERR_NOSPACE.


Starting kernel ...


Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0xa00
Linux version 3.8.0 (root@ubuntu) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #4 SMP PREEMPT Mon Nov 30 16:55:52 CST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Samsung Exynos4 (Flattened Device Tree), model: Samsung SMDK evaluation board based on Exynos4412
Memory policy: ECC disabled, Data cache writealloc
CPU EXYNOS4412 (id 0xe4412011)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
s3c_register_clksrc: clock armclk has no registers set
EXYNOS4: PLL settings, A=1400000000, M=800000000, E=96000000 V=108000000
EXYNOS4: ARMCLK=1400000000, DMC=400000000, ACLK200=160000000
ACLK100=100000000, ACLK160=160000000, ACLK133=133333333
sclk_pwm: source is ext_xtal (0), rate is 24000000
sclk_csis: source is xusbxti (1), rate is 1500000
sclk_csis: source is xusbxti (1), rate is 1500000
sclk_cam0: source is xusbxti (1), rate is 1500000
sclk_cam1: source is xusbxti (1), rate is 1500000
sclk_fimc: source is xusbxti (1), rate is 1500000
sclk_fimc: source is xusbxti (1), rate is 1500000
sclk_fimc: source is xusbxti (1), rate is 1500000
sclk_fimc: source is xusbxti (1), rate is 1500000
sclk_fimd: source is xusbxti (1), rate is 1500000
sclk_mfc: source is mout_mfc0 (0), rate is 50000000
PERCPU: Embedded 7 pages/cpu @c0c62000 s7488 r8192 d12992 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: noinitrd root=/dev/nfs nfsroot=192.168.1.108:/work/system/zxl4412_root ip=192.168.1.123:192.168.1.108:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0,115200
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)
__ex_table already sorted, skipping sort
Memory: 1024MB = 1024MB total
Memory: 1034916k/1034916k available, 13660k reserved, 270336K highmem
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 - 0xc039b6f8   (3662 kB)
      .init : 0xc039c000 - 0xc03c6d40   ( 172 kB)
      .data : 0xc03c8000 - 0xc04145c0   ( 306 kB)
       .bss : 0xc04145c0 - 0xc044c9d0   ( 226 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:549
combiner_init: number of combiners not specified, setting default as 16.
sched_clock: 32 bits at 200 Hz, resolution 5000000ns, wraps every 4294967291ms
Console: colour dummy device 80x30
Calibrating delay loop... 2795.11 BogoMIPS (lpj=6987776)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
Setting up static identity map for 0x402ad238 - 0x402ad290
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x000000c0, AUX_CTRL 0x7e470001, Cache size: 1048576 B
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 10, mpidr 80000a01
CPU2: Booted secondary processor
CPU2: thread -1, cpu 2, socket 10, mpidr 80000a02
CPU3: Booted secondary processor
CPU3: thread -1, cpu 3, socket 10, mpidr 80000a03
Brought up 4 CPUs
SMP: Total of 4 processors activated (11180.44 BogoMIPS).
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
S3C Power Management, Copyright 2004 Simtec Electronics
EXYNOS4x12 PMU Initialize
EXYNOS: Initializing architecture
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource mct-frc
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 24576 bytes)
UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
bounce pool size: 64 pages
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 dma-pl330.0: Loaded driver for PL330 DMAC-1315632
dma-pl330 dma-pl330.0:  DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
dma-pl330 dma-pl330.1: Loaded driver for PL330 DMAC-1315632
dma-pl330 dma-pl330.1:  DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
dma-pl330 dma-pl330.2: Loaded driver for PL330 DMAC-1315632
dma-pl330 dma-pl330.2:  DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
exynos4210-uart.0: ttySAC0 at MMIO 0x13800000 (irq = 84) is a S3C6400/10
console [ttySAC0] enabled
exynos4210-uart.1: ttySAC1 at MMIO 0x13810000 (irq = 85) is a S3C6400/10
exynos4210-uart.2: ttySAC2 at MMIO 0x13820000 (irq = 86) is a S3C6400/10
exynos4210-uart.3: ttySAC3 at MMIO 0x13830000 (irq = 87) is a S3C6400/10
brd: module loaded
loop: module loaded
pegasus: v0.6.14 (2006/09/27), Pegasus/Pegasus II USB Ethernet driver
usbcore: registered new interface driver pegasus
usbcore: registered new interface driver asix
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mousedev: PS/2 mouse device common for all mice
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
Synopsys Designware Multimedia Card Interface Driver
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 15
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
Registering SWP/SWPB emulation handler
VFS: Cannot open root device "nfs" or unknown-block(0,255): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
[<c0014934>] (unwind_backtrace+0x0/0xf0) from [<c02a9b88>] (panic+0x8c/0x1ec)
[<c02a9b88>] (panic+0x8c/0x1ec) from [<c039cd18>] (mount_block_root+0x1e8/0x2a4)
[<c039cd18>] (mount_block_root+0x1e8/0x2a4) from [<c039d084>] (prepare_namespace+0x160/0x1b8)
[<c039d084>] (prepare_namespace+0x160/0x1b8) from [<c02a5e6c>] (kernel_init+0x8/0xe4)
[<c02a5e6c>] (kernel_init+0x8/0xe4) from [<c000e498>] (ret_from_fork+0x14/0x3c)
CPU2: stopping
[<c0014934>] (unwind_backtrace+0x0/0xf0) from [<c00132bc>] (handle_IPI+0x128/0x154)
[<c00132bc>] (handle_IPI+0x128/0x154) from [<c0008584>] (gic_handle_irq+0x60/0x68)
[<c0008584>] (gic_handle_irq+0x60/0x68) from [<c000e000>] (__irq_svc+0x40/0x70)
Exception stack(0xef06ff50 to 0xef06ff98)
ff40:                                     ef06ff98 3b9aca00 00066216 00000003
ff60: 0001b579 00000003 c0c72258 ef06ff98 00000000 c03f1fc0 00000001 00000000
ff80: 00000018 ef06ff98 c00558b8 c01ec4f4 60000113 ffffffff
[<c000e000>] (__irq_svc+0x40/0x70) from [<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0)
[<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0) from [<c01ec2a0>] (cpuidle_idle_call+0xac/0x158)
[<c01ec2a0>] (cpuidle_idle_call+0xac/0x158) from [<c000f6e8>] (cpu_idle+0xa0/0xf0)
[<c000f6e8>] (cpu_idle+0xa0/0xf0) from [<402a69c8>] (0x402a69c8)
CPU3: stopping
[<c0014934>] (unwind_backtrace+0x0/0xf0) from [<c00132bc>] (handle_IPI+0x128/0x154)
[<c00132bc>] (handle_IPI+0x128/0x154) from [<c0008584>] (gic_handle_irq+0x60/0x68)
[<c0008584>] (gic_handle_irq+0x60/0x68) from [<c000e000>] (__irq_svc+0x40/0x70)
Exception stack(0xef071f50 to 0xef071f98)
1f40:                                     ef071f98 3b9aca00 00066310 00000003
1f60: 2e9dcaf1 00000000 c0c7a258 ef071f98 00000000 c03f1fc0 00000001 00000000
1f80: 00000018 ef071f98 c00558b8 c01ec4f4 60000113 ffffffff
[<c000e000>] (__irq_svc+0x40/0x70) from [<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0)
[<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0) from [<c01ec2a0>] (cpuidle_idle_call+0xac/0x158)
[<c01ec2a0>] (cpuidle_idle_call+0xac/0x158) from [<c000f6e8>] (cpu_idle+0xa0/0xf0)
[<c000f6e8>] (cpu_idle+0xa0/0xf0) from [<402a69c8>] (0x402a69c8)
CPU1: stopping
[<c0014934>] (unwind_backtrace+0x0/0xf0) from [<c00132bc>] (handle_IPI+0x128/0x154)
[<c00132bc>] (handle_IPI+0x128/0x154) from [<c0008584>] (gic_handle_irq+0x60/0x68)
[<c0008584>] (gic_handle_irq+0x60/0x68) from [<c000e000>] (__irq_svc+0x40/0x70)
Exception stack(0xef06df50 to 0xef06df98)
df40:                                     ef06df98 3b9aca00 00066293 00000003
df60: 0001b8e4 00000003 c0c6a258 ef06df98 00000000 c03f1fc0 00000000 00000000
df80: 00000018 ef06df98 c00558b8 c01ec4f4 60000113 ffffffff
[<c000e000>] (__irq_svc+0x40/0x70) from [<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0)
[<c01ec4f4>] (cpuidle_wrap_enter+0x4c/0xa0) from [<c01ec2a0>] (cpuidle_idle_call+0xac/0x158)
[<c01ec2a0>] (cpuidle_idle_call+0xac/0x158) from [<c000f6e8>] (cpu_idle+0xa0/0xf0)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值