您尚未登录。

楼主 # 2023-02-11 00:23:03

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

请教buildroot-tiny200和run distro_bootcmd里的一些问题

我准备使用buildroot-tiny200 (F1C100/200s) 开发包近期更新内容 * 已支持DVP摄像头 *,支持SPI NAND 给我的F1C200S小板编译Linux固件,遇到一些问题,特开贴请教。
1,我编译的固件烧录到芯片,串口没有信息输出,不知道是不是与DTS文件中的 serial0 = &uart1 有关,为什么这里要把uart1给serial0;
   

/dts-v1/;
#include "suniv-f1c100s.dtsi"

#include <dt-bindings/gpio/gpio.h>

/ {
        model = "Allwinner F1C100s Generic Device";
        compatible = "allwinner,suniv-f1c100s",
                     "allwinner,suniv";
        aliases {
                serial0 = &uart1;
                spi0 = &spi0;
        };

        chosen {
                stdout-path = "serial0:115200n8";
        };
};

2,  在uboot.env中为什么这些值都那么大?
          sf_size=0x1000000
          sf_splash_offset=0x80000
          sf_kernel_offset=0x100000
          sf_kernel_length=0x500000

          splash_addr=0x80000000
          splash_length=0x80000

          kernel_addr_r=0x81000000

          bootm_size=0x1800000
按照下面这行,那bootcomv好像不适合SPI Flash ,也不知道自己的理解对不对。

nor_boot=echo "Booting from SPI-NOR..."; sf probe; sf read ${kernel_addr_r} ${sf_kernel_offset} ${sf_kernel_length};

为了方便我把/board/allwinner/generic/uboot.env文件的内容贴出来;

mmc_kernel=kernel.itb
mmc_splash=splash.bmp
mmc_ubootpart=1
mmc_bootpart=2
mmc_rootpart=3

nand_size=0x8000000
nand_splash_offset=0x80000
nand_kernel_offset=0x100000
nand_kernel_length=0x500000

sf_size=0x1000000
sf_splash_offset=0x80000
sf_kernel_offset=0x100000
sf_kernel_length=0x500000

splash_addr=0x80000000
splash_length=0x80000

kernel_addr_r=0x81000000

bootm_size=0x1800000

stderr=serial
stdin=serial
stdout=serial

boot_slot_0=empty
boot_slot_1=empty
scan_boot_slot_0=if mmc dev 0; then setenv boot_slot_0 mmc0; fi;
scan_boot_slot_1=if mmc dev 1; then setenv boot_slot_1 mmc1; else if sf probe; then setenv boot_slot_1 spi-nor; else if mtd list; then setenv boot_slot_1 spi-nand; fi; fi; fi;
scan_boot_slot=run scan_boot_slot_0; run scan_boot_slot_1; echo "========================="; echo "Boot Device: ${boot_device}"; echo "Boot Slot 0: ${boot_slot_0}"; echo "Boot Slot 1: ${boot_slot_1}"; echo "=========================";

dfu_wait_timeout=3
mmc_dfu_info=setenv dfu_alt_info "all raw 0x0 0x37000;u-boot raw 0x10 0x7f0;boot part ${dfu_mmc_dev} ${mmc_bootpart};rom part ${dfu_mmc_dev} ${mmc_rootpart};kernel fat ${dfu_mmc_dev} ${mmc_bootpart}"
nand_dfu_info=setenv dfu_alt_info "all raw 0x0 ${nand_size};u-boot raw 0x0 0x80000;kernel raw ${nand_kernel_offset} ${nand_kernel_length};rom raw 0x600000 0x2a00000;vendor raw 0x3000000 0x1000000"
nor_dfu_info=setenv dfu_alt_info "all raw 0x0 ${sf_size};u-boot raw 0x0 0x80000;kernel raw ${sf_kernel_offset} ${sf_kernel_length};rom raw 0x600000 0x700000"
dfu_mmc=mmc dev ${dfu_mmc_dev}; run mmc_dfu_info; dfu 0 mmc ${dfu_mmc_dev} ${dfu_wait_timeout};
dfu_nand=run nand_dfu_info; dfu 0 mtd spi-nand0 ${dfu_wait_timeout};
dfu_nor=run nor_dfu_info; dfu 0 sf 0:0 ${dfu_wait_timeout};
dfu_boot=if test "${boot_slot_1}" = "spi-nand"; then echo "DFU waiting on SPI-NAND..."; run dfu_nand; fi; if test "${boot_slot_1}" = "spi-nor"; then echo "DFU waiting on SPI-NOR..."; run dfu_nor; fi; if test "${boot_slot_1}" = "mmc1"; then echo "DFU waiting on MMC1..."; setenv dfu_mmc_dev 1; run dfu_mmc; fi; if test "${boot_slot_1}" = "empty" && test "${boot_slot_0}" = "mmc0"; then echo "DFU waiting on MMC0..."; setenv dfu_mmc_dev 0; run dfu_mmc; fi;

fel_boot=echo "Booting from FEL..."; bootm ${kernel_addr_r};
mmc_boot=mmc dev ${devnum}; echo "Booting from MMC${devnum}..."; load mmc ${devnum}:${mmc_bootpart} $kernel_addr_r ${mmc_kernel}; bootm ${kernel_addr_r};
nor_nand_boot=if test "${boot_slot_1}" = "spi-nor"; then run nor_boot; fi; if test "${boot_slot_1}" = "spi-nand"; then run nand_boot; fi;
nor_boot=echo "Booting from SPI-NOR..."; sf probe; sf read ${kernel_addr_r} ${sf_kernel_offset} ${sf_kernel_length}; bootm ${kernel_addr_r};
nand_boot=echo "Booting from SPI-NAND..."; mtd read spi-nand0 ${kernel_addr_r} ${nand_kernel_offset} ${nand_kernel_length}; bootm ${kernel_addr_r};

bootcmd_fel=if test "${boot_device}" = "fel"; then run fel_boot; fi;
bootcmd_dfu=if test "${boot_device}" != "mmc0" || test "${boot_slot_1}" = "empty"; then run dfu_boot; fi;
bootcmd_mmc0=if test "${boot_device}" = "mmc0"; then devnum=0; run mmc_boot; fi;
bootcmd_mmc1=if test "${boot_device}" = "mmc1"; then devnum=1; run mmc_boot; fi;
bootcmd_spi=if test "${boot_device}" = "spi"; then run nor_nand_boot; fi;


boot_targets=fel dfu mmc0 mmc1 spi loopdfu

splash_nor=sf probe; sf read ${splash_addr} ${sf_splash_offset} ${splash_length};
splash_nand=mtd read spi-nand0 ${splash_addr} ${nand_splash_offset} ${splash_length};
splash_spi=if test "${boot_slot_1}" = "spi-nor"; then run splash_nor; fi; if test "${boot_slot_1}" = "spi-nand"; then run splash_nand; fi;
splash_mmc=load mmc ${devnum}:${mmc_bootpart} ${splash_addr} ${mmc_splash};
show_splash=run splash_${boot_device}; bmp display ${splash_addr}; gpio set ${lcd_bl_pin};

distro_bootcmd=run scan_boot_slot; run show_splash; for target in ${boot_targets}; do run bootcmd_${target}; done

离线

#1 2023-02-11 12:53:55

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

1. 可能是把 uart1 连接到 /dev/ttyS0 这个设备,纯属猜测。

2. 遍历所有启动介质,哪个正常就从那个介质启动





离线

楼主 #2 2023-02-11 14:08:18

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

1. 可能是把 uart1 连接到 /dev/ttyS0 这个设备,纯属猜测。

2. 遍历所有启动介质,哪个正常就从那个介质启动

2,这项感觉用这几个参数,超出了16Mspiflash的空间了。是参数错了吗

离线

#3 2023-02-11 14:54:58

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

没有超过,_addr 是内存地址, 起始地址是 0x8000,0000


offset 是flash 偏移地址,取值范围 0 - 16M





离线

楼主 #4 2023-02-11 21:19:55

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

没有超过,_addr 是内存地址, 起始地址是 0x8000,0000


offset 是flash 偏移地址,取值范围 0 - 16M

在buildroot-tiny200\board\widora\mangopi\r3\devicetree\linux\devicetree.dts文件里spi-nor、spi-nand的分区配置是不一样的,而uboot.env的这个文件里只有一套分区地址设置,不知道是不是这块有问题。我按照spi-nand的参数配置了spi-nor 的分区,一样没启动,不知道为什么。

&spi0 {
	status = "okay";

	spi-nor@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q128", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;
		status = "disabled";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x70000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x70000 0x590000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x700000>;
				read-only;
			};

			partition@3 {
				label = "overlay";
				reg = <0xd00000 0x300000>;
			};
		};
	};

	spi-nand@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x100000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x100000 0x500000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x2a00000>;
				read-only;
			};

			partition@3 {
				label = "vendor";
				reg = <0x3000000 0x1000000>;
			};

			partition@4 {
				label = "overlay";
				reg = <0x4000000 0x3000000>;
			};
		};
	};
};

离线

#5 2023-02-11 23:07:38

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

uboot.env 主要负责引导部分的配置,

flash的分区配置在这个sdk可能还是以 devicetree.dts 为准。





离线

楼主 #6 2023-02-11 23:18:19

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@哇酷小二
再问下,这个SDK里,uboot.defconfig、linux.defconfig是什么时候写到对应的.config文件中的?
执行 make widora_mangopi_r3_defconfig 的时候,并没有把uboot.defconfig、linux.defconfig连带着写了。

离线

#7 2023-02-11 23:21:52

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

都在这个文件里面:widora_mangopi_r3_defconfig

当执行 make widora_mangopi_r3_defconfig,就把这个文件复制到 .config





离线

楼主 #8 2023-02-11 23:30:54

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

都在这个文件里面:widora_mangopi_r3_defconfig

当执行 make widora_mangopi_r3_defconfig,就把这个文件复制到 .config

我之前测试好像是没有写,而且报出来的Log里也没有提到。

make widora_mangopi_r3_defconfig

mkdir -p /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
    obj=/home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config -C support/kconfig -f Makefile.br conf
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE  -I/home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/.depend 2>/dev/null || :
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE  -I/home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/conf.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE  -I/home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config -DCONFIG_=\"\"  -I. -c /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/zconf.tab.c -o /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/zconf.tab.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE  -I/home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config -DCONFIG_=\"\"   /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/conf.o /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/zconf.tab.o  -o /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/conf
rm /home/zl/f1c200s/buildroot-tiny200/output/build/buildroot-config/zconf.tab.c
#
# configuration written to /home/zl/f1c200s/buildroot-tiny200/.config
#

离线

楼主 #9 2023-02-12 00:16:22

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

我在mangopi 的官网下载了一个sysimage-nor的镜像,烧到我的板上,也是没有跑起来系统,串口没有Log,液晶有显示uboot的log,进入了Linux系统,不知道为什么液晶没有显示。
不过可以确认的是,他的log不是从uart0输出的。
所以如果再搞两天还是搞不定这个的话,只能去试试mangopi R3的那版buildroot

改正一下:
看到了,原来mangopi R1的串口是uart0,R3的就默认是uart1了。

最近编辑记录 pldjn_V3S (2023-02-12 00:23:31)

离线

楼主 #10 2023-02-12 15:38:54

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@哇酷小二

修改F1C200S的uboot,console接口,都要改哪些 地方,我按照坛里的帖子修改了几个地,还是没有输出到uart0上。第3项我没找到声明的地方,不知道是什么原因;

1, board\widora\mangopi\r3\devicetree\uboot\suniv-f1c100s-generic.dts

	aliases {
		serial0 = &uart0;
		spi0 = &spi0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};
&uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
};

&uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart1_pins_a>;
        status = "okay";
};

2,board\allwinner\suniv-f1c100s\devicetree\uboot\suniv-f1c100s.dtsi

                        uart0_pins_a: uart-pins-pe {
                                pins = "PE0", "PE1";
                                function = "uart0";
                        };

                        uart1_pins_a: uart1-pins-pa {
                                pins = "PA2", "PA3";
                                function = "uart1";
                        };
                uart0: serial@1c25000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c25000 0x400>;
                        interrupts = <1>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&ccu CLK_BUS_UART0>;
                        resets = <&ccu RST_BUS_UART0>;
                        status = "disabled";
                };

                uart1: serial@1c25400 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c25400 0x400>;
                        interrupts = <2>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&ccu CLK_BUS_UART1>;
                        resets = <&ccu RST_BUS_UART1>;
                        status = "disabled";
                };

3, 这块未找到,在文件/output/build/uboot-2020.07/include/configs/sunxi-common.h中没有找到CONFIG_CONS_INDEX这块的定义。

#define CONFIG_CONS_INDEX              1       /* UART0 */

4,uboot的.config中添加

CONFIG_BOOTARGS="console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3"

最近编辑记录 pldjn_V3S (2023-02-12 15:42:04)

离线

#11 2023-02-13 12:58:52

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@pldjn_V3S

uboot 串口

改这个:
board/widora/mangopi/r3/uboot.defconfig

CONFIG_CONS_INDEX=2



然后删除uboot的编译目录:
rm output/build/uboot-2020.07/ -rf

重新make即可。





离线

楼主 #12 2023-02-13 13:35:44

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

研究了2天时间,不如你一句话,唉,要学的太多。

离线

楼主 #13 2023-02-13 15:59:10

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

@pldjn_V3S

uboot 串口

改这个:
board/widora/mangopi/r3/uboot.defconfig

CONFIG_CONS_INDEX=2



然后删除uboot的编译目录:
rm output/build/uboot-2020.07/ -rf

重新make即可。

这样改过以后,确实有了log输出,uboot的前一半有了,后一半没出来。后一半是不是需要修改设备树;一会再去修改了试试先。

[15:46:31:768] ␍␊
[15:46:31:768] U-Boot SPL 2020.07 (Feb 13 2023 - 14:44:13 +0800)␍␊
[15:46:31:803] DRAM: 64 MiB␍␊
[15:46:31:803] Trying to boot from MMC1␍␊
[15:46:31:803] Card did not respond to voltage select!␍␊
[15:46:31:803] spl: mmc init failed with error: -95␍␊
[15:46:31:804] Trying to boot from MMC2␍␊
[15:46:31:818] Card did not respond to voltage select!␍␊
[15:46:31:820] spl: mmc init failed with error: -95␍␊
[15:46:31:823] Trying to boot from sunxi SPI␍␊

离线

#14 2023-02-13 16:08:23

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@pldjn_V3S
对,改设备树。


改完设备树, 有一个快速编译的方法:

rm output/build/linux-5.4.66/.stamp_built -rf && make

这样就能重新生成linux 设备树二进制文件了.


uboot亦然.





离线

楼主 #15 2023-02-13 16:38:21

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

@pldjn_V3S
对,改设备树。


改完设备树, 有一个快速编译的方法:

rm output/build/linux-5.4.66/.stamp_built -rf && make

这样就能重新生成linux 设备树二进制文件了.


uboot亦然.

试了,修改 board\widora\mangopi\r3\devicetree\uboot\suniv-f1c100s-generic.dts的下面这块,改成serial0 = &uart0;就有了;Linux的还是没有,到了Starting kernel ...␍␊就停了。

	aliases {
		serial0 = &uart0;
		spi0 = &spi0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

Linux 需要修改 ./board/widora/mangopi/r3/devicetree/linux/devicetree.dts ,增加下面这块,才会有log输出。

&uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pe_pins>;
        status = "okay";
};

最近编辑记录 pldjn_V3S (2023-02-13 17:12:44)

离线

楼主 #16 2023-02-13 17:16:32

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@哇酷小二
修改完,linux没有进shell,不知道是哪个设备出问题了;

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.99 (zl@ubuntu) (gcc version 8.4.0 (Buildroot -g4a14fb0-dirty)) #1 Mon Feb 13 14:46:20 CST 2023
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Widora MangoPi R3
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x82c00000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3 net.ifnames=0 vt.global_cursor_default=0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 37232K/64036K available (6144K kernel code, 248K rwdata, 1676K rodata, 1024K init, 225K bss, 10420K reserved, 16384K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[    0.000049] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000143] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000901] Console: colour dummy device 80x30
[    0.001007] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070265] pid_max: default: 32768 minimum: 301
[    0.070778] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070821] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072678] CPU: Testing write buffer coherency: ok
[    0.074829] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076136] devtmpfs: initialized
[    0.087867] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.087933] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.092160] pinctrl core: initialized pinctrl subsystem
[    0.094857] NET: Registered protocol family 16
[    0.098552] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.100885] cpuidle: using governor menu
[    0.142142] SCSI subsystem initialized
[    0.142527] usbcore: registered new interface driver usbfs
[    0.142688] usbcore: registered new interface driver hub
[    0.142851] usbcore: registered new device driver usb
[    0.143347] mc: Linux media interface: v0.10
[    0.143478] videodev: Linux video capture interface: v2.00
[    0.143595] pps_core: LinuxPPS API ver. 1 registered
[    0.143614] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.143676] PTP clock support registered
[    0.144725] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.145608] Advanced Linux Sound Architecture Driver Initialized.
[    0.147947] clocksource: Switched to clocksource timer
[    0.149770] simple-framebuffer 83e89000.framebuffer: framebuffer at 0x83e89000, 0x177000 bytes, mapped to 0x(ptrval)
[    0.149830] simple-framebuffer 83e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    0.176789] Console: switching to colour frame buffer device 100x30
[    0.202033] simple-framebuffer 83e89000.framebuffer: fb0: simplefb registered!
[    0.232698] thermal_sys: Registered thermal governor 'step_wise'
[    0.233466] NET: Registered protocol family 2
[    0.235049] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.235132] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.235195] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.235246] TCP: Hash tables configured (established 1024 bind 1024)
[    0.235575] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.235655] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.236210] NET: Registered protocol family 1
[    0.238850] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.240708] Initialise system trusted keyrings
[    0.241361] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.263449] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.264071] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.375350] Key type asymmetric registered
[    0.375393] Asymmetric key parser 'x509' registered
[    0.375582] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.375609] io scheduler mq-deadline registered
[    0.375626] io scheduler kyber registered
[    0.391076] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.414967] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.421314] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.422577] printk: console [ttyS0] disabled
[    0.442902] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 26, base_baud = 6250000) is a 16550A
[    0.906327] printk: console [ttyS0] enabled
[    0.911715] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.943705] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 27, base_baud = 6250000) is a 16550A
[    0.963598] SCSI Media Changer driver v0.25 
[    0.969686] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.988383] random: fast init done
[    1.378267] spi-nand: probe of spi0.0 failed with error -110
[    1.384516] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.391166] ehci-platform: EHCI generic platform driver
[    1.396784] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.403168] ohci-platform: OHCI generic platform driver
[    1.408984] usbcore: registered new interface driver usb-storage
[    1.415990] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.429918] i2c /dev entries driver
[    1.434062] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    1.447880] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin PE0 already requested by 1c25000.serial; cannot claim for 1cb0000.csi
[    1.459240] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin-128 (1cb0000.csi) status -22
[    1.466901] suniv-f1c100s-pinctrl 1c20800.pinctrl: could not request pin 128 (PE0) from group PE0  on device 1c20800.pinctrl
[    1.478150] sun4i-csi 1cb0000.csi: Error applying setting, reverse things back
[    1.485418] sun4i-csi: probe of 1cb0000.csi failed with error -22
[    1.493059] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.503132] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.541507] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.550975] usbcore: registered new interface driver usbhid
[    1.556556] usbhid: USB HID core driver
[    1.560838] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.568222] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 19
[    1.580324] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[    1.595518] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[    1.612276] NET: Registered protocol family 17
[    1.616838] Key type dns_resolver registered
[    1.622332] Loading compiled-in X.509 certificates
[    1.640501] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.658588] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.665370] ALSA device list:
[    1.668472]   #0: F1C100s Audio Codec
[    1.672724] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.681477] cfg80211: failed to load regulatory.db
[    1.687384] Waiting for root device /dev/mmcblk0p3...
[   26.798104] random: crng init done
[   31.848004] vcc3v0: disabling
[   31.851004] vcc3v3: disabling
[   31.853970] vcc5v0: disabling

追加:
  分析可能是Waiting for root device /dev/mmcblk0p3...有问题,这里怎么是mmcblk0p3,
 
这块需要修改:./board/widora/mangopi/r3/devicetree/linux/devicetree.dts

  //for NAND or Nor
  bootargs = "console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
  //for sd-card
  //bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";

修改完了还是不行,不知道啥原因。还是卡在这块。

[    1.674673] ALSA device list:
[    1.677662]   #0: F1C100s Audio Codec
[    1.682097] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.690867] cfg80211: failed to load regulatory.db
[    1.696482] Waiting for root device /dev/mtdblock2...
[   23.388435] random: crng init done
[   31.848374] vcc3v0: disabling
[   31.851375] vcc3v3: disabling
[   31.854343] vcc5v0: disabling

最近编辑记录 pldjn_V3S (2023-02-13 18:13:04)

离线

#17 2023-02-13 18:27:44

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

改完 uboot.env 要重新编译uboot :

rm output/build/uboot-2020.07/ -rf && make





离线

楼主 #18 2023-02-13 20:31:43

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

改完 uboot.env 要重新编译uboot :

rm output/build/uboot-2020.07/ -rf && make

这个不是从uboot.env文件获取的参数,是直接写死到Linux的设备树文件里的。在这个文件里./board/widora/mangopi/r3/devicetree/linux/devicetree.dts,这里为什么nor是root=/dev/mtdblock2,而sd卡是root=/dev/mmcblk0p3。

  //for NAND or Nor
  bootargs = "console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
  //for sd-card
  //bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";

离线

楼主 #19 2023-02-13 21:01:39

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

找到问题原因了,还是Linux的设备树board\widora\mangopi\r3\devicetree\linux\devicetree.dts里 spi-nor@0 要把 status = "disabled"  注掉;

&spi0 {
	status = "okay";

	spi-nor@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q128", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;
		status = "disabled";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x70000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x70000 0x590000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x700000>;
				read-only;
			};

			partition@3 {
				label = "overlay";
				reg = <0xd00000 0x300000>;
			};
		};
	};

	spi-nand@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x100000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x100000 0x500000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x2a00000>;
				read-only;
			};

			partition@3 {
				label = "vendor";
				reg = <0x3000000 0x1000000>;
			};

			partition@4 {
				label = "overlay";
				reg = <0x4000000 0x3000000>;
			};
		};
	};
};
在线

全部的log,现在可以进shell了。

U-Boot SPL 2020.07 (Feb 13 2023 - 16:11:47 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI


U-Boot 2020.07 (Feb 13 2023 - 16:11:47 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM:  64 MiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
Card did not respond to voltage select!
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
=========================
Boot Device: spi
Boot Slot 0: empty
Boot Slot 1: spi-nor
=========================
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x80000, size 0x80000
SF: 524288 bytes @ 0x80000 Read: OK
Unknown command 'bmp' - try 'help'
gpio - query and control gpio pins

Usage:
gpio <input|set|clear|toggle> <pin>
    - input/set/clear/toggle the specified pin
gpio status [-a] [<bank> | <pin>]  - show [all/claimed] GPIOs
DFU waiting on SPI-NOR...
musb-hdrc: peripheral reset irq lost!
Booting from SPI-NOR...
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x500000
SF: 5242880 bytes @ 0x100000 Read: OK
## Loading kernel from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'kernel@0' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x810000cc
     Data Size:    4309768 Bytes = 4.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80000000
     Entry Point:  0x80000000
     Hash algo:    crc32
     Hash value:   4bfebdc8
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81000000 ...
   Using 'conf@0' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x8141c4b8
     Data Size:    15714 Bytes = 15.3 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   9ff3b1b8
   Verifying Hash Integrity ... crc32+ OK
   Booting using the fdt blob at 0x8141c4b8
   Loading Kernel Image
   Loading Device Tree to 817f9000, end 817ffd61 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.99 (zl@ubuntu) (gcc version 8.4.0 (Buildroot -g4a14fb0-dirty)) #1 Mon Feb 13 17:40:57 CST 2023
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Widora MangoPi R3
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x82c00000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line: console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3 net.ifnames=0 vt.global_cursor_default=0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 37232K/64036K available (6144K kernel code, 248K rwdata, 1676K rodata, 1024K init, 225K bss, 10420K reserved, 16384K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[    0.000051] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000142] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000899] Console: colour dummy device 80x30
[    0.001004] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070267] pid_max: default: 32768 minimum: 301
[    0.070803] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070855] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072831] CPU: Testing write buffer coherency: ok
[    0.074972] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076286] devtmpfs: initialized
[    0.088117] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.088185] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.092488] pinctrl core: initialized pinctrl subsystem
[    0.095188] NET: Registered protocol family 16
[    0.098948] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.101308] cpuidle: using governor menu
[    0.142663] SCSI subsystem initialized
[    0.143037] usbcore: registered new interface driver usbfs
[    0.143195] usbcore: registered new interface driver hub
[    0.143354] usbcore: registered new device driver usb
[    0.143839] mc: Linux media interface: v0.10
[    0.143964] videodev: Linux video capture interface: v2.00
[    0.144081] pps_core: LinuxPPS API ver. 1 registered
[    0.144100] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.144157] PTP clock support registered
[    0.145261] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[    0.146215] Advanced Linux Sound Architecture Driver Initialized.
[    0.148647] clocksource: Switched to clocksource timer
[    0.150609] simple-framebuffer 83e89000.framebuffer: framebuffer at 0x83e89000, 0x177000 bytes, mapped to 0x(ptrval)
[    0.150669] simple-framebuffer 83e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    0.177459] Console: switching to colour frame buffer device 100x30
[    0.202721] simple-framebuffer 83e89000.framebuffer: fb0: simplefb registered!
[    0.233211] thermal_sys: Registered thermal governor 'step_wise'
[    0.233945] NET: Registered protocol family 2
[    0.235541] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.235629] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.235686] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.235737] TCP: Hash tables configured (established 1024 bind 1024)
[    0.236052] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.236117] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.236669] NET: Registered protocol family 1
[    0.239606] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.241436] Initialise system trusted keyrings
[    0.242048] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.264106] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.264738] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.382897] Key type asymmetric registered
[    0.382940] Asymmetric key parser 'x509' registered
[    0.383117] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.383146] io scheduler mq-deadline registered
[    0.383164] io scheduler kyber registered
[    0.398379] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.422283] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.428416] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[    0.429915] printk: console [ttyS0] disabled
[    0.450248] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 26, base_baud = 6250000) is a 16550A
[    0.916781] printk: console [ttyS0] enabled
[    0.922184] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[    0.954121] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 27, base_baud = 6250000) is a 16550A
[    0.974026] SCSI Media Changer driver v0.25 
[    0.980097] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.993446] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.999616] 4 fixed-partitions partitions found on MTD device spi0.0
[    1.005979] Creating 4 MTD partitions on "spi0.0":
[    1.010939] 0x000000000000-0x000000070000 : "u-boot"
[    1.019746] 0x000000070000-0x000000600000 : "kernel"
[    1.028301] 0x000000600000-0x000000d00000 : "rom"
[    1.036923] 0x000000d00000-0x000001000000 : "overlay"
[    1.046241] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.052912] ehci-platform: EHCI generic platform driver
[    1.058542] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.064875] ohci-platform: OHCI generic platform driver
[    1.070683] usbcore: registered new interface driver usb-storage
[    1.077734] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.091612] i2c /dev entries driver
[    1.095769] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    1.109770] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin PE0 already requested by 1c25000.serial; cannot claim for 1cb0000.csi
[    1.121100] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin-128 (1cb0000.csi) status -22
[    1.128818] suniv-f1c100s-pinctrl 1c20800.pinctrl: could not request pin 128 (PE0) from group PE0  on device 1c20800.pinctrl
[    1.140050] sun4i-csi 1cb0000.csi: Error applying setting, reverse things back
[    1.147316] sun4i-csi: probe of 1cb0000.csi failed with error -22
[    1.155033] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.165148] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.203560] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.212947] usbcore: registered new interface driver usbhid
[    1.218525] usbhid: USB HID core driver
[    1.222835] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[    1.230153] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 19
[    1.242273] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[    1.257496] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[    1.273803] NET: Registered protocol family 17
[    1.278367] Key type dns_resolver registered
[    1.284033] Loading compiled-in X.509 certificates
[    1.302234] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.320389] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.327171] ALSA device list:
[    1.330279]   #0: F1C100s Audio Codec
[    1.334557] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.343320] cfg80211: failed to load regulatory.db
[    1.353259] random: fast init done
[    1.359101] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.372413] devtmpfs: mounted
[    1.380847] Freeing unused kernel memory: 1024K
[    1.385502] Run /preinit as init process
[    1.632357] random: crng init done
[    2.406852] overlayfs: upper fs does not support tmpfile.
[    2.412419] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [    3.253577] udevd[90]: starting version 3.2.9
[    3.466169] udevd[91]: starting eudev-3.2.9
[    5.398168] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, using dummy regulator
[    5.406217] Goodix-TS 0-005d: 0-005d supply VDDIO not found, using dummy regulator
[    7.448769] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[    9.528765] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[    9.535441] Goodix-TS 0-005d: i2c test failed attempt 1: -110
[   11.608849] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   13.688786] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   13.695393] Goodix-TS 0-005d: i2c test failed attempt 2: -110
[   13.738803] Goodix-TS 0-005d: I2C communication failure: -110
[   13.744968] Goodix-TS: probe of 0-005d failed with error -110
[   15.768785] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   17.848774] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   19.928764] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[   19.935332] ov2640 0-0030: Product ID error 92:92
done
Initializing random number generator: OK
Saving random seed: OK
Starting haveged: haveged: listening socket at 3
OK
Starting network: OK
Starting uMTPrd: [   21.621279] file system registered
[   21.975004] read descriptors
[   21.977964] read strings
OK

Welcome to Widora MangoPi R3
mangopi-r3 login: [   23.244353] configfs-gadget gadget: high-speed config #1: c
[   31.848736] vcc3v0: disabling
[   31.851739] vcc3v3: disabling
[   31.854708] vcc5v0: disabling

Welcome to Widora MangoPi R3
mangopi-r3 login: 
Welcome to Widora MangoPi R3
mangopi-r3 login: root
# ls
# ls
# 

离线

楼主 #20 2023-02-13 22:44:03

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

整理总结一下;

代码默认使用的是Uart1做为log输出,若要修改成Uart0输出需要修改以下几个部分:

1,board/widora/mangopi/r3/uboot.defconfig

    CONFIG_CONS_INDEX=2

2,修改 board\widora\mangopi\r3\devicetree\uboot\suniv-f1c100s-generic.dts的下面这块,改成serial0 = &uart0;就有log输出了;

	aliases {
		serial0 = &uart0;
		spi0 = &spi0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

3, Linux 需要修改 ./board/widora/mangopi/r3/devicetree/linux/devicetree.dts ,增加下面这块,才会有log输出。

&uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pe_pins>;
        status = "okay";
};

 
代码修改成 16M nor spi flash ,需要修改以下几点:
1,需要修改:./board/widora/mangopi/r3/devicetree/linux/devicetree.dts

//for NAND or Nor
  bootargs = "console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs 
  overlayfsdev=/dev/mtdblock3";
//for sd-card
//bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";

2,Linux的设备树board\widora\mangopi\r3\devicetree\linux\devicetree.dts里 spi-nor@0 部分要把 status = "disabled"  注掉,spi-nand@0 部分要把status = "disabled"加上。

&spi0 {
	status = "okay";

	spi-nor@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q128", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;
	//	status = "disabled";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x70000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x70000 0x590000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x700000>;
				read-only;
			};

			partition@3 {
				label = "overlay";
				reg = <0xd00000 0x300000>;
			};
		};
	};

	spi-nand@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <50000000>;
                status = "disabled";
		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x100000>;
				read-only;
			};

			partition@1 {
				label = "kernel";
				reg = <0x100000 0x500000>;
				read-only;
			};

			partition@2 {
				label = "rom";
				reg = <0x600000 0x2a00000>;
				read-only;
			};

			partition@3 {
				label = "vendor";
				reg = <0x3000000 0x1000000>;
			};

			partition@4 {
				label = "overlay";
				reg = <0x4000000 0x3000000>;
			};
		};
	};
};

离线

楼主 #21 2023-02-15 16:20:50

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@哇酷小二
问一下,uboot那段时间LCD没有显示,直到Starting kernel ...以后LCD上才会有显示,小企鹅也没显示不知道哪里有问题。下面是uboot 的.config文件里的一些配置,看着LCD的部分都选上了,但就是不显示。有没有需要在uboot.defconfig里添加的参数。

......
CONFIG_VIDEO_SUNXI=y
CONFIG_VIDEO_LCD_MODE="x:480,y:272,depth:18,pclk_khz:20000,le:42,ri:8,up:11,lo:4,hs:1,vs:1,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=1
CONFIG_VIDEO_LCD_POWER=""
CONFIG_VIDEO_LCD_RESET=""
CONFIG_VIDEO_LCD_BL_EN=""
CONFIG_VIDEO_LCD_BL_PWM=""
CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW=y
# CONFIG_VIDEO_LCD_PANEL_I2C is not set
CONFIG_VIDEO_LCD_IF_PARALLEL=y
CONFIG_VIDEO_LCD_PANEL_PARALLEL=y
# CONFIG_VIDEO_LCD_PANEL_LVDS is not set
# CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828 is not set
# CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804 is not set
# CONFIG_VIDEO_LCD_PANEL_HITACHI_TX18D42VM is not set
# CONFIG_VIDEO_LCD_TL059WV5C0 is not set
......
#
# TrueType Fonts
#
# CONFIG_VIDEO_VESA is not set
# CONFIG_VIDEO_LCD_ANX9804 is not set
# CONFIG_VIDEO_LCD_SSD2828 is not set
# CONFIG_VIDEO_LCD_HITACHI_TX18D42VM is not set
# CONFIG_VIDEO_MVEBU is not set
# CONFIG_I2C_EDID is not set
# CONFIG_DISPLAY is not set
# CONFIG_VIDEO_FSL_DCU_FB is not set
# CONFIG_VIDEO_TEGRA20 is not set
# CONFIG_VIDEO_BRIDGE is not set
CONFIG_VIDEO=y
CONFIG_CFB_CONSOLE=y
# CONFIG_CFB_CONSOLE_ANSI is not set
CONFIG_VGA_AS_SINGLE_DEVICE=y
CONFIG_VIDEO_SW_CURSOR=y
# CONFIG_CONSOLE_EXTRA_INFO is not set
CONFIG_CONSOLE_SCROLL_LINES=1
CONFIG_SYS_CONSOLE_BG_COL=0x00
CONFIG_SYS_CONSOLE_FG_COL=0xa0
# CONFIG_LCD is not set
# CONFIG_VIDEO_SIMPLE is not set
CONFIG_VIDEO_DT_SIMPLEFB=y
# CONFIG_OSD is not set
......

这是现在的config文件
config-bak.txt

最近编辑记录 pldjn_V3S (2023-02-15 16:27:35)

离线

楼主 #22 2023-02-15 20:46:07

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@哇酷小二

再问一下怎么修改buildroot,把RGB改成BGR;尝试了2个方法都没成功。
1,参考https://whycan.com/t_6781.html,在文件 linux/drivers/gpu/drm/sun4i/sun4i_tcon.c添加 "regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,BIT(23),BIT(23));//SWAP R、B引脚" 删除.stamp_built重新编译,没有效果;

2,参考https://gitee.com/IOTTS/f1c100s_buildroot,在文件./board/allwinner/suniv-f1c100s/devicetree/linux/suniv-f1c100s.dtsi中添加 rgb-channel-swap = <1>; /* 设置为1为BGR格式 */ ,重新编译,没有效果;

用busybox修改寄存器的值可以切换BGR,正确显示图片;

busybox devmem 0x01c0c040
busybox devmem 0x01c0c040 w 0x80800100

最近编辑记录 pldjn_V3S (2023-02-15 20:46:39)

离线

#23 2023-02-15 21:22:00

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

@pldjn_V3S
我记得这个SDK里面的uboot没有支持lcd,如果确实要支持lcd得试一试荔枝派仓库里面的sdk了。




regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,BIT(23),BIT(23));//SWAP R、B引脚

在这前后把寄存器值都打印出来看看。





离线

楼主 #24 2023-02-15 21:32:20

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

uboot的LCD那个先跳过去了,现在是想把RGB改成GBR,试了2种方法都没有成功。

离线

楼主 #25 2023-02-16 00:51:45

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

哇酷小二 说:

@pldjn_V3S
我记得这个SDK里面的uboot没有支持lcd,如果确实要支持lcd得试一试荔枝派仓库里面的sdk了。




regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,BIT(23),BIT(23));//SWAP R、B引脚

在这前后把寄存器值都打印出来看看。

linux/drivers/gpu/drm/sun4i/sun4i_tcon.c这个文件不知道是没有调用到其中的函数 ,还是我加的调试信息不对,我增加了条printk,然后sh rebuild-kernel.sh ,没有在串口上看到信息。

printk("sun4i_tcon.c printk test\n");

离线

楼主 #26 2023-02-16 17:25:46

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

在这个文件里board/widora/mangopi/r3/devicetree/linux/devicetree.dts 好像是没有使用内核的设备树里驱动LCD。
查了下chosen是从uboot传来的参数。

       chosen {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
                //for NAND or Nor
                bootargs = "console=tty0 console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
                //for sd-card
//              bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";
                simplefb_lcd: framebuffer-lcd0 {
                        compatible = "allwinner,simple-framebuffer",
                                     "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0";
                        clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
                                 <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_LCD>,
                                 <&ccu CLK_TCON>;
                        status = "disabled";
                };

离线

楼主 #27 2023-02-17 19:35:33

pldjn_V3S
会员
注册时间: 2021-04-09
已发帖子: 108
积分: 116

Re: 请教buildroot-tiny200和run distro_bootcmd里的一些问题

在这里再记录一下,临时解决液晶颜色问题,第3种修改RGB到BGR的方法;

由于使用的是buildroot-tiny200,他的液晶驱动还是在uboot里通过参数传到内核的(见下面的代码,chosen)

       chosen {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
                //for NAND or Nor
                bootargs = "console=tty0 console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
                //for sd-card
//              bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";
                simplefb_lcd: framebuffer-lcd0 {
                        compatible = "allwinner,simple-framebuffer",
                                     "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0";
                        clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
                                 <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_LCD>,
                                 <&ccu CLK_TCON>;
                        status = "disabled";
                };

我现在还不懂设备树的原理,试过的前两种方法也都没有解决问题,所以就想通过uboot的液晶驱动来改,最终经过分析找到了文件./output/build/uboot-2020.07/arch/arm/include/asm/arch-sunxi/lcdc.h,把文件的第79行,修改成下面这样。临时解决了液晶的颜色问题。

#define SUNXI_LCDC_TCON0_CTRL_ENABLE            ((1 << 31) | (1 << 23))
//#define SUNXI_LCDC_TCON0_CTRL_ENABLE          (1 << 31)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn