【全志平台】dts内容如何最快导入到机器中

【全志平台】dts内容如何最快导入到机器中


方法四:编译kernel,pack,烧录工具不选择任何分区是最快的方法。


文章目录

  • 【全志平台】dts内容如何最快导入到机器中
    • 方法一:全编译整包烧录
    • 方法二:编译kernel ,dd导入boot.img
    • 方法三:pack, dd导入u-boot.fex
    • 方法四:编译kernel,extract-bsp,pack,烧录工具不选择任何分区
    • 试验结论


  • 实验目的:dts内容如何最快导入到机器中

  • 关键字:dts

  • 实验平台:全志T7-android

  • 步骤:试验各种已知方法,来导入dts到机器中

    1. 修改dts后编译kernel 和 android 通过刷机软件烧录整包内容
    2. 修改dts后编译kernel ,dd导入boot.img到boot分区
    3. 修改dts后pack, dd导入u-boot.fex到mmcblk0分区
      步骤2/3,来确认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

方法一:全编译整包烧录

  • 修改sun8iw17p1-carvout.dtsi文件中uart1
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>;
};
  • 结论:全编译整包烧录方法试验成功,可以把修改的dts内容导入到机器中。

方法二:编译kernel ,dd导入boot.img

注意: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";
};
  • 测试流程:
    1. 编译kernel
    2. 把编译出来的boot.img导入到boot分区
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>;
};
  • 结果:数值和名字没有发生改变。
  • 结论:此方法失败,编译kernel ,dd导入boot.img不能改变机器中的dts内容。

方法三:pack, dd导入u-boot.fex

注意: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";
};
  • 测试流程:
    1. pack
    2. 把pack出来的u-boot.fex导入到机器
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
  • 结果:机器重启后直接进入强制刷机模式。
  • 结论:此方法失败,pack, dd导入u-boot.fex此方法无效。

方法四:编译kernel,extract-bsp,pack,烧录工具不选择任何分区

  • 修改内容
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";
};
  • 试验流程
    1. 编译kernel
    2. extract-bsp
    3. pack
    4. 烧录工具不选择任何分区,至烧录boot0、boot1。
    5. 进入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 = <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,烧录工具不选择任何分区是最快的方法。

你可能感兴趣的:(安卓,dts)