方法四:编译kernel,pack,烧录工具不选择任何分区是最快的方法。
实验目的:dts内容如何最快导入到机器中
关键字:dts
实验平台:全志T7-android
步骤:试验各种已知方法,来导入dts到机器中
试验前准备:修改sun8iw17p1\configs\default\env.cfg文件:bootdelay=2以便能进入boot
试验工具:Uboot FDT,通过此工具来判断导入的内容是否奏效。
Uboot FDT用法:
# 查看当前dts中所有内容项
fdt list /aliases
#列出其中一项(nand0)中的内容
fdt list nand0
eg:
sunxi#fdt list /aliases
aliases {
serial0 = "/soc@01c00000/uart@01c28000";
..............
mmc0 = "/soc@01c00000/sdmmc@01c0f000";
mmc2 = "/soc@01c00000/sdmmc@01C11000";
nand0 = "/soc@01c00000/nand0@01c03000";
disp = "/soc@01c00000/disp@01000000";
lcd0 = "/soc@01c00000/lcd0@01c0c000";
hdmi = "/soc@01c00000/hdmi@01ee0000";
pwm = "/soc@01c00000/pwm@01c21400";
boot_disp = "/soc@01c00000/boot_disp";
};
sunxi#fdt list nand0
nand0@01c03000 {
compatible = "allwinner,sun50i-nand";
device_type = "nand0";
reg = <0x00000000 0x01c03000 0x00000000 0x00001000>;
..................
pinctrl-names = "default", "sleep";
pinctrl-1 = <0x00000081>;
};
注意:修改的文件是\lichee\linux-3.10\arch\arm\boot\dts\sun8iw17p1-carvout.dtsi
uart1: uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x0 0x05000400 0x0 0x400>;
interrupts = ;
clocks = <&clk_uart1>;
cshang = <3>; /*增加cshang项*/
pinctrl-names = "cshang", "sleep";/*修改名字*/
pinctrl-0 = <&uart1_pins_a>;
pinctrl-1 = <&uart1_pins_b>;
uart1_port = <1>;
uart1_type = <4>;
use_dma = <1>;
status = "disabled";
};
sunxi#fdt list serial1
uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x00000000 0x05000400 0x00000000 0x00000400>;
interrupts = <0x00000000 0x0000003d 0x00000004>;
clocks = <0x00000022>;
cshang = <0x00000003>;
pinctrl-names = "cshang", "sleep";
uart1_port = <0x00000001>;
uart1_type = <0x00000002>;
use_dma = <0x00000001>;
status = "disabled";
pinctrl-0 = <0x00000122>;
pinctrl-1 = <0x00000123>;
};
注意:pack不会影响kernel下的boot.img
uart1: uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x0 0x05000400 0x0 0x400>;
interrupts = ;
clocks = <&clk_uart1>;
cshang = <4>;/*数值改为4*/
pinctrl-names = "cshang4", "sleep";/*名字改为cshang4*/
pinctrl-0 = <&uart1_pins_a>;
pinctrl-1 = <&uart1_pins_b>;
uart1_port = <1>;
uart1_type = <4>;
use_dma = <1>;
status = "disabled";
};
E:\cmder_mini
λ adb spush Z:\t7\android-N\t7-p1\lichee\linux-3.10\output\boot.img /mnt/udisk/boot.img
* daemon started successfully
Z:\t7\android-N\t7-p1\lichee\linux-3.10\output\boot.img: 1 file pushed. 5.1 MB/s (16443392 bytes in 3.085s)
E:\cmder_mini
λ adb pshell dd if=/mnt/udisk/boot.img of=/dev/block/by-name/boot
32116+0 records in
32116+0 records out
16443392 bytes transferred in 2.233 secs (7363811 bytes/sec)
E:\cmder_mini
λ adb reboot
3. 进入uboot查看修改
sunxi#fdt list serial1
uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x00000000 0x05000400 0x00000000 0x00000400>;
interrupts = <0x00000000 0x0000003d 0x00000004>;
clocks = <0x00000022>;
cshang = <0x00000003>;
pinctrl-names = "cshang", "sleep";
uart1_port = <0x00000001>;
uart1_type = <0x00000002>;
use_dma = <0x00000001>;
status = "disabled";
pinctrl-0 = <0x00000122>;
pinctrl-1 = <0x00000123>;
};
注意:pack会重新生成u-boot.fex,编译kernel不会影响u-boot.fex
uart1: uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x0 0x05000400 0x0 0x400>;
interrupts = ;
clocks = <&clk_uart1>;
cshang = <5>;/*数值改为5*/
pinctrl-names = "cshang5", "sleep";/*名字改为cshang5*/
pinctrl-0 = <&uart1_pins_a>;
pinctrl-1 = <&uart1_pins_b>;
uart1_port = <1>;
uart1_type = <4>;
use_dma = <1>;
status = "disabled";
};
E:\cmder_mini
λ adb push Z:\t7\android-N\t7-p1\lichee\tools\pack\out\u-boot.fex /mnt/udisk/u-boot.fex
adb server version (31) doesn't match this client (41); killing...
* daemon started successfully
Z:\t7\android-N\t7-p1\lichee\tools\pack\out\u-boot.fex: 1 file pushed. 4.7 MB/s (950272 bytes in 0.194s)
E:\cmder_mini
λ adb shell
t7-p1:/ # echo '0' > "/sys/block/mmcblk0boot1/force_ro"
t7-p1:/ # dd if=/mnt/udisk/u-boot.fex of=/dev/block/mmcblk0 bs=512 count=64 seek=32800
64+0 records in
64+0 records out
32768 bytes transferred in 0.006 secs (5461333 bytes/sec)
t7-p1:/ # dd if=/mnt/udisk/u-boot.fex of=/dev/block/mmcblk0 bs=512 count=64 seek=24576
64+0 records in
64+0 records out
32768 bytes transferred in 0.004 secs (8192000 bytes/sec)
t7-p1:/ # reboot
uart1: uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x0 0x05000400 0x0 0x400>;
interrupts = ;
clocks = <&clk_uart1>;
cshang = <6>;/*修改数字为6*/
pinctrl-names = "cshang6", "sleep";/*修改名字为cshang6*/
pinctrl-0 = <&uart1_pins_a>;
pinctrl-1 = <&uart1_pins_b>;
uart1_port = <1>;
uart1_type = <4>;
use_dma = <1>;
status = "disabled";
};
sunxi#fdt list serial1
uart@05000400 {
compatible = "allwinner,sun8i-uart";
device_type = "uart1";
reg = <0x00000000 0x05000400 0x00000000 0x00000400>;
interrupts = <0x00000000 0x0000003d 0x00000004>;
clocks = <0x00000022>;
cshang = <0x00000006>;
pinctrl-names = "cshang6", "sleep";
uart1_port = <0x00000001>;
uart1_type = <0x00000002>;
use_dma = <0x00000001>;
status = "disabled";
pinctrl-0 = <0x00000122>;
pinctrl-1 = <0x00000123>;
};
省去其中编译kernel,extract-bsp再尝试:失败!
方法四:编译kernel,extract-bsp,pack,烧录工具不选择任何分区是最快的方法。