让u-boot支持内核设备树dts

最近在学习内核设备树,打算在2440上面移植dts,期间发现网上关于u-boot如何加载dts描述比较少,做个笔记。

优先要在对应板卡配置文件里面定义:

#define CONFIG_OF_LIBFDT

重新编译u-boot即可让u-boot支持内核设备树dts,加载命令如下:

bootm + uImage地址 + ramdisk地址 + 设备树镜像地址

实例:

U-Boot 2016.03 (Mar 05 2018 - 14:56:38 +0800)



DRAM:  64 MiB
Flash: 0 Bytes
NAND:  256 MiB
Net:   dm9000
Hit any key to stop autoboot:  0 
SMDK2440 # 
SMDK2440 # 
SMDK2440 #  tftp 0x30007FC0 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 00:c0:de:00:00:01
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.6.140; our IP address is 192.168.6.155
Filename 'uImage'.
Load address: 0x30007fc0
Loading: #################################################################
         #################################################################
         #################################################################
         ############################################
         463.9 KiB/s
done
Bytes transferred = 3502968 (357378 hex)
SMDK2440 #  tftp 0x30001000 s3c2440-smdk2440.dtb
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 00:c0:de:00:00:01
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.6.140; our IP address is 192.168.6.155
Filename 's3c2440-smdk2440.dtb'.
Load address: 0x30001000
Loading: #
         1000 Bytes/s
done
Bytes transferred = 7879 (1ec7 hex)
SMDK2440 #  bootm 0x30007FC0 - 0x30001000 (- 表示不使用ramdisk加载,如果使用ramdisk则提供其加载地址)
## Booting kernel from Legacy Image at 30007fc0 ...
   Image Name:   Linux-4.13.9
   Created:      2018-03-02   6:25:06 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3502904 Bytes = 3.3 MiB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 30001000
   Booting using the fdt blob at 0x30001000
   XIP Kernel Image ... OK
   Loading Device Tree to 33b7e000, end 33b82ec6 ... OK


Starting kernel ...


Uncompressing Linux... done, booting the kernel.
  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值