本帖最后由 tfirst 于 2023-5-18 17:32 编辑 RK3588Q从外挂的SSD引导系统 硬件:AIO-3588Q+Samsung SSD(nvme,1TB) 软件:buildroot (sdk 版本:v1.0.6f.) 按照文档《Rockchip Developer Guide Dual StorageCN》(Rockchip_Developer_Guide_Dual_Storage_CN.pdf)中的步骤,在uboot及kernel中进行dts设置如下: 1、 在内核中修改rk3588-firefly-aio-3588q.dtsi文件中的宏M2_SATA_OR_PCIE为0。 2、 在uboot中: rk3588-u-boot.dtsi文件, chosen{ stdout-path= &uart2; //u-boot,spl-boot-order = &sdmmc, &sdhci, &spi_nand, &spi_nor; u-boot,spl-boot-order= &sdhci, &spi_nand, &spi_nor; }; 在根节点上添加如下: vcc12v_dcin:vcc12v_dcin { u-boot,dm-pre-reloc; compatible= "regulator-fixed"; regulator-name= "vcc12v_dcin"; regulator-always-on; regulator-boot-on; //status= "okay"; regulator-min-microvolt= <12000000>; regulator-max-microvolt= <12000000>; }; vcc_sata_pwr_en:vcc-sata-pwr-en-regulator { u-boot,dm-pre-reloc; compatible= "regulator-fixed"; regulator-name= "vcc_sata_pwr_en"; regulator-min-microvolt= <3300000>; regulator-max-microvolt= <3300000>; regulator-boot-on; regulator-always-on; enable-active-high; status= "okay"; gpio= <&pca9555 PCA_IO1_2 GPIO_ACTIVE_HIGH>; startup-delay-us= <5000>; vin-supply= <&vcc12v_dcin>; }; 并使能相应模块 &combphy0_ps { u-boot,dm-pre-reloc; status= "okay"; }; /* pca9555 */ /* &pca9555{ u-boot,dm-pre-reloc; status= "okay"; }; */ &pcie2x1l2 { u-boot,dm-pre-reloc; reset-gpios= <&pca9555 PCA_IO1_6GPIO_ACTIVE_HIGH>; vpcie3v3-supply= <&vcc_sata_pwr_en>; status= "okay"; }; &i2c6 { u-boot,dm-pre-reloc; clock-frequency= <400000>; status= "okay"; pinctrl-names= "default"; pinctrl-0= <&i2c6m0_xfer>; pca9555_1:gpio@20 { u-boot,dm-pre-reloc; compatible = "nxp,pca9555"; reg = <0x20>; gpio-controller; #gpio-cells = <2>; gpio-group-num = <300>; status = "okay"; }; pca9555:gpio@21 { u-boot,dm-pre-reloc; compatible= "nxp,pca9555"; reg= <0x21>; gpio-controller; #gpio-cells= <2>; gpio-group-num= <200>; status= "okay"; }; }; &pcfg_pull_none_smt { u-boot,dm-spl; bias-disable; input-schmitt-enable; }; 在pinctrl节点中,添加: i2c6{ u-boot,dm-spl; i2c6m0_xfer:i2c6m0-xfer { u-boot,dm-spl; rockchip,pins= /*i2c6_scl_m0 */ <0RK_PD0 9 &pcfg_pull_none_smt>, /*i2c6_sda_m0 */ <0RK_PC7 9 &pcfg_pull_none_smt>; }; }; 修改firefly-linux.config文件: CONFIG_OF_U_BOOT_REMOVE_PROPS="clock-namesinterrupt-parent assigned-clocks assigned-clock-ratesassigned-clock-parents" 并添加如下内容: CONFIG_CMD_I2C=y CONFIG_CMD_PCI=y CONFIG_NVME=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_DM_PCI_COMPAT=y CONFIG_PCIE_DW_ROCKCHIP=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_ROCKCHIP_BOOTDEV="nvme 0" CONFIG_EMBED_KERNEL_DTB_ALWAYS=y #CONFIG_EMBED_KERNEL_DTB_PATH="dts/kern.dtb" CONFIG_SPL_FIT_IMAGE_KB=2560 将编译内核时编译出来的dtb拷贝到u-boot/dts/kern.dtb中。 修改完成后,重新编译,可以在uboot中识别出ssd。信息如下: => pci scan Scanning PCI devices on bus 0 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x1d87 0x3588 Bridge device 0x04 => Scanning PCI devices on bus 0 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x1d87 0x3588 Bridge device 0x04 => pci 1 Scanning PCI devices on bus 1 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 01.00.00 0x144d 0xa809 Mass storage controller 0x08 => Scanning PCI devices on bus 1 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 01.00.00 0x144d 0xa809 Mass storage controller 0x08 => nvme scan => nvme details Blk device 0: Optional Admin CommandSupport: Namespace Management/Attachment: no Firmware Commit/Image download: yes Format NVM: yes Security Send/Receive: yes Blk device 0: Optional NVM Command Support: Reservation: yes Save/Select field in the Set/Get features: no Write Zeroes: yes Dataset Management: no Write Uncorrectable: yes Blk device 0: Format NVM Attributes: Support Cryptographic Erase: yes Support erase a particular namespace: Yes Support format a particular namespace: No Blk device 0: LBA Format Support: Blk device 0: End-to-End DataProtectCapabilities: As last eight bytes: No As first eight bytes: No Support Type3: No Support Type2: No Support Type1: No Blk device 0: Metadata capabilities: As part of a separate buffer: No As part of an extended data LBA: No => Blk device 0: Optional Admin CommandSupport: Namespace Management/Attachment: no Firmware Commit/Image download: yes Format NVM: yes Security Send/Receive: yes Blk device 0: Optional NVM Command Support: Reservation: yes Save/Select field in the Set/Get features: no Write Zeroes: yes Dataset Management: no Write Uncorrectable: yes Blk device 0: Format NVM Attributes: Support Cryptographic Erase: yes Support erase a particular namespace: Yes Support format a particular namespace: No Blk device 0: LBA Format Support: Blk device 0: End-to-End DataProtectCapabilities: As last eight bytes: No As first eight bytes: No Support Type3: No Support Type2: No Support Type1: No Blk device 0: Metadata capabilities: As part of a separate buffer: No As part of an extended data LBA: No => nvme info Device 0: Vendor: 0x144d Rev: 3B4QFXO7Prod: S649NL0W205605E Type: Hard Disk Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512) => 使用RKDevTool.exe(v2.96)烧录各个固件: 其中: parameter_emmc.txt文件的内容如下: FIRMWARE_VER: 1.0 MACHINE_MODEL: RK3588 MACHINE_ID: 007 MANUFACTURER: RK3588 MAGIC: 0x5041524B ATAG: 0x00200800 MACHINE: 0xffffffff CHECK_MASK: 0x80 PWR_HLD: 0,0,A,0,1 TYPE: GPT CMDLINE: mtdparts=rk29xxnand:0x00004000@0x00004000(uboot) parameter_nvme.txt文件的内容如下: FIRMWARE_VER: 1.0 MACHINE_MODEL: RK3588 MACHINE_ID: 007 MANUFACTURER: RK3588 MAGIC: 0x5041524B ATAG: 0x00200800 MACHINE: 0xffffffff CHECK_MASK: 0x80 PWR_HLD: 0,0,A,0,1 TYPE: GPT CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00008000(misc),0x00080000@0x0000a000(boot:bootable),0x00040000@0x0008a000(recovery),0x00010000@0x000ca000(backup),0x00c00000@0x000da000(rootfs),-@0x0cda000(userdata:grow) uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9 在进行分区配置时,会如下错误。 点击“执行”按钮后,软件会报错:”xxx” did not find matchpartition(xxx分别为:misc、boot、recovery、backup、rootfs、userdata) 不理会错误,重新进入maskrom模式后,选择“强制按地址写”,从软件的日志上看,似乎可以正确烧录。 烧录完成后,自动重启,串口打印如下信息: done Saving random seed: OK realpath: /dev/block/by-name: No such fileor directory Will now mount all partitions in /etc/fstab strings: : No such file or directory Note: Will skip fsck, remove /.skip_fsck toenable Log saved to /tmp/mountall.log Starting network: cmdline=storagemedia=nvmeandroidboot.storagemedia=nvme androidboot.mode=normal storagenode=/pcie@fe190000androidboot.verifiedbootstate=orange ro rootwaitearlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 irqchip.gicv3_pseudo_nmi=0root=PARTLABEL=rootfs rootfstype=ext4 overlayroot=device:dev=PARTLABEL=userdata,fstype=ext4,mkfs=1coherent_pool=1m systemd.gpt_auto=0 cgroup_enable=memory swapaccount=1 read console from cmdline is /dev/ttyFIQ0 Starting recovery on Thu May 18 09:00:192023 Recovery System have UI defined. failed to read font: res=-1, fall back tothe compiled-in font OK Debug: configfs_init rotate degree: 0 - none, 1 - right, 2 -down, 3 - left. current rotate degree is : 0 mkdir: can't create directory'/sys/kernel/config/usb_gadget/rockchip/functions/uac1.gs0': No such file ordirectory mkdir: can't create directory'/sys/kernel/config/usb_gadget/rockchip/functions/uac2.gs0': No such file ordirectory [ 7.857208] file system registered mkdir: can't create directory'/sys/kernel/config/usb_gadget/rockchip/functions/mtp.gs0': No such file ordirectory [ 7.864041] using random self ethernet address [ 7.864085] using random host ethernet address [ 7.868268] Mass Storage Function, version: 2009/09/11 [ 7.868334] LUN: removable file: (no medium) mkdir: can't create directory'/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0': No such file ordirectory [ 7.898766] read descriptors [ 7.898825] read strings [ 8.158843] rk_hdmirx fdee0000.hdmirx-controller:hdmirx_cancel_cpu_limit_freq freq qos nod add [ 8.171203] rk-pcie fe150000.pcie: PCIe Link Fail [ 8.171217] rk-pcie fe150000.pcie: failed to initialize host Starting input-event-daemon:input-event-daemon: Start parsing /etc/input-event-daemon.conf... input-event-daemon: Adding device:/dev/input/event0... input-event-daemon: Adding device:/dev/input/event1... input-event-daemon: Adding device:/dev/input/event2... input-event-daemon: Adding device:/dev/input/event3... input-event-daemon: Adding device:/dev/input/event4... input-event-daemon: Start listening on 5devices... done [root@RK3588:/]# [ 9.106625] dwc3 fc000000.usb: device reset [ 9.231491] android_work: sent uevent USB_STATE=CONNECTED [ 9.410018] dwc3 fc000000.usb: device reset recovery filesystem table ========================= 0(null) /tmp ramdisk (null) (null) (null) 1/dev/root / ext4 rw,noauto 0 1 2proc /proc proc defaults 0 0 3devpts /dev/pts devpts defaults,gid=5,mode=620 0 0 4tmpfs /dev/shm tmpfs mode=0777 0 0 5tmpfs /tmp tmpfs mode=1777 0 0 6tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 7sysfs /sys sysfs defaults 0 0 8/dev/block/by-name/misc /misc emmc defaults 0 0 9/dev/block/by-name/userdata /userdata ext4 defaults 0 0 10/dev/block/by-name/oem /oem ext2 defaults 0 0 11/dev/sda1 /mnt/usb_storage vfat defaults 0 0 12/dev/mmcblk1p1 /mnt/external_sd vfat defaults 0 0 13/dev/block/by-name/oem /oem ext2 defaults 0 2 14/dev/block/by-name/userdata /userdata ext4 defaults 0 2 executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 stat /dev/block/by-name/misc try 1: No suchfile or directory [ 9.494680] usb 4-1: new SuperSpeed Gen 1 USB device number 2 usingxhci-hcd [ 9.519634] usb 4-1: New USB device found, idVendor=05e3, idProduct=0620,bcdDevice=93.91 [ 9.519701] usb 4-1: New USB device strings: Mfr=1, Product=2,SerialNumber=0 [ 9.519716] usb 4-1: Product: USB3.2 Hub [ 9.519729] usb 4-1: Manufacturer: GenesysLogic [ 9.548335] hub 4-1:1.0: USB hub found [ 9.548757] hub 4-1:1.0: 4 ports detected [ 9.574729] android_work: sent uevent USB_STATE=CONFIGURED [ 9.638183] usb 3-1: new high-speed USB device number 2 using xhci-hcd [ 9.781305] usb 3-1: New USB device found, idVendor=05e3, idProduct=0610,bcdDevice=93.91 [ 9.781352] usb 3-1: New USB device strings: Mfr=1, Product=2,SerialNumber=0 [ 9.781365] usb 3-1: Product: USB2.1 Hub [ 9.781376] usb 3-1: Manufacturer: GenesysLogic [ 9.836774] hub 3-1:1.0: USB hub found [ 9.837194] hub 3-1:1.0: 4 ports detected stat /dev/block/by-name/misc try 2: No suchfile or directory stat /dev/block/by-name/misc try 3: No suchfile or directory stat /dev/block/by-name/misc try 4: No suchfile or directory stat /dev/block/by-name/misc try 5: No suchfile or directory stat /dev/block/by-name/misc try 6: No suchfile or directory stat /dev/block/by-name/misc try 7: No suchfile or directory stat /dev/block/by-name/misc try 8: No suchfile or directory stat /dev/block/by-name/misc try 9: No suchfile or directory stat /dev/block/by-name/misc try 10: Nosuch file or directory failed to stat /dev/block/by-name/misc emmc_point is /dev/mmcblk0 sd_point is (null) sd_point_2 is (null) Recovery start.................... read cmdline >>> Boot from non-SDcard executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [I/]RECOVERY devices is not MTD. stat /dev/block/by-name/misc try 1: No suchfile or directory stat /dev/block/by-name/misc try 2: No suchfile or directory stat /dev/block/by-name/misc try 3: No suchfile or directory stat /dev/block/by-name/misc try 4: No suchfile or directory stat /dev/block/by-name/misc try 5: No suchfile or directory stat /dev/block/by-name/misc try 6: No suchfile or directory stat /dev/block/by-name/misc try 7: No suchfile or directory stat /dev/block/by-name/misc try 8: No suchfile or directory stat /dev/block/by-name/misc try 9: No suchfile or directory stat /dev/block/by-name/misc try 10: Nosuch file or directory failed to stat /dev/block/by-name/misc [E/]RECOVERY Can't open/dev/block/by-name/misc (No such file or directory) executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [E/]RECOVERY failed to mount /userdata (Nosuch file or directory) [E/]RECOVERY Can't mount/userdata/recovery/command executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [I/]RECOVERY devices is not MTD. Command: "/usr/bin/recovery" finish_recovery Enter..... executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [E/]RECOVERY failed to mount /userdata (Nosuch file or directory) [E/]RECOVERY Can't mount/userdata/recovery/log [E/]RECOVERY Can't open/userdata/recovery/log executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [E/]RECOVERY failed to mount /userdata (Nosuch file or directory) [E/]RECOVERY Can't mount/userdata/recovery/last_log [E/]RECOVERY Can't open/userdata/recovery/last_log executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [I/]RECOVERY devices is not MTD. executing '/usr/bin/relink-block.sh' executed '/usr/bin/relink-block.sh' done executed '/usr/bin/relink-block.sh' return0 [E/]RECOVERY failed to mount /userdata (Nosuch file or directory) [W/]RECOVERY Can't unlink/userdata/recovery/command 发现没有进入weston桌面,也没有发现其他分区: [root@RK3588:/]# [root@RK3588:/]# ls /dev/block/ 179:0 179:64 253:0 7:0 7:2 7:4 7:6 by-name 179:32 1:0 259:0 7:1 7:3 7:5 7:7 [root@RK3588:/]# ls /dev/block/by-name/ misc [root@RK3588:/]# ls /dev/nvme0 nvme0 nvme0n1 [root@RK3588:/]# ls /dev/nvme* /dev/nvme0 /dev/nvme0n1 [root@RK3588:/]# 除了uboot.img外,其他同样的镜像文件,烧录到emmc上,使用emmc启动引导,可以正常进入weston桌面。 不知道是什么原因。开机启动日志见附件 |
-
91.2 KB, 下载次数: 0, 下载积分: 灯泡 -1 , 经验 -1