升级Yocto至Scarthgap时U-Boot TPL启动失败,疑为设备树问题
Yocto Scarthgap升级后U-Boot TPL阶段启动卡壳问题
问题背景
正在将Yocto构建从Kirkstone版本升级到Scarthgap版本,此前Kirkstone可正常生成可启动镜像。升级过程中遇到U-Boot相关问题:默认的2024.10版本Makefile已移除RK3399支持,因此改用2023.07.02版本。使用该版本启动时,设备卡在U-Boot TPL阶段,调试输出显示多个设备树节点匹配失败。推测可能是完整设备树而非精简(扁平化)版本进入了TPL,尽管defconfig中已配置CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents",但问题仍未解决。
调试输出
U-Boot TPL 2023.07.02 (Oct 24 2024 - 14:13:42) ofnode_read_prop: assigned-clock-rates: <not found> bind node aliases Device 'aliases' has no compatible string bind node mmc@fe320000 - attempt to match compatible string 'rockchip,rk3399-dw-mshc' - attempt to match compatible string 'rockchip,rk3288-dw-mshc' No match for node 'mmc@fe320000' bind node mmc@fe330000 - attempt to match compatible string 'rockchip,rk3399-sdhci-5.1' - attempt to match compatible string 'arasan,sdhci-5.1' No match for node 'mmc@fe330000' bind node serial@ff180000 - attempt to match compatible string 'rockchip,rk3399-uart' - attempt to match compatible string 'snps,dw-apb-uart' - found match at 'ns16550_serial': 'ns16550' matches 'snps,dw-apb-uart' bind node serial@ff1a0000 - attempt to match compatible string 'rockchip,rk3399-uart' - attempt to match compatible string 'snps,dw-apb-uart' - found match at 'ns16550_serial': 'ns16550' matches 'snps,dw-apb-uart' bind node power-management@ff310000 - attempt to match compatible string 'rockchip,rk3399-pmu' - found match at 'rk3399_syscon': 'rockchip,rk3399-grf' matches 'rockchip,rk3399-pmu' bind node syscon@ff320000 - attempt to match compatible string 'rockchip,rk3399-pmugrf' - found match at 'rk3399_syscon': 'rockchip,rk3399-grf' matches 'rockchip,rk3399-pmugrf' bind node pmu-clock-controller@ff750000 - attempt to match compatible string 'rockchip,rk3399-pmucru' - found match at 'rockchip_rk3399_pmucru': 'rockchip,rk3399-pmucru' matches 'rockchip,rk3399-pmucru' bind node clock-controller@ff760000 - attempt to match compatible string 'rockchip,rk3399-cru' - found match at 'rockchip_rk3399_cru': 'rockchip,rk3399-cru' matches 'rockchip,rk3399-cru' bind node syscon@ff770000 - attempt to match compatible string 'rockchip,rk3399-grf' - found match at 'rk3399_syscon': 'rockchip,rk3399-grf' matches 'rockchip,rk3399-grf' bind node phy@f780 - attempt to match compatible string 'rockchip,rk3399-emmc-phy' No match for node 'phy@f780' bind node vop@ff8f0000 - attempt to match compatible string 'rockchip,rk3399-vop-lit' No match for node 'vop@ff8f0000' bind node vop@ff900000 - attempt to match compatible string 'rockchip,rk3399-vop-big' No match for node 'vop@ff900000' bind node pinctrl - attempt to match compatible string 'rockchip,rk3399-pinctrl' No match for node 'pinctrl' bind node chosen Device 'chosen' has no compatible string bind node syscon@ff620000 - attempt to match compatible string 'rockchip,rk3399-cic' - found match at 'rk3399_syscon': 'rockchip,rk3399-grf' matches 'rockchip,rk3399-cic' bind node dfi@ff630000 - attempt to match compatible string 'rockchip,rk3399-dfi' No match for node 'dfi@ff630000' bind node dmc - attempt to match compatible string 'rockchip,rk3399-dmc' - found match at 'rockchip_rk3399_dmc': 'rockchip,rk3399-dmc' matches 'rockchip,rk3399-dmc' bind node syscon@ff330000 - attempt to match compatible string 'rockchip,rk3399-pmusgrf' - found match at 'rk3399_syscon': 'rockchip,rk3399-grf' matches 'rockchip,rk3399-pmusgrf' ofnode_read_u32_array: rockchip,sdram-params: ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: reg: ofnode_read_bool: little-endian: false ofnode_read_bool: big-endian: false ofnode_read_bool: native-endian: false ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: assigned-clock-rates: <not found> ofnode_read_prop: assigned-clock-rates: <not found> Looking for clock-controller@ff760000 Looking for clock-controller@ff760000 - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0) - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
排查建议
- 检查SPL/TPL设备树生成逻辑:在Yocto的
devicetree.bbappend中添加TPL专属的设备树裁剪规则,比如通过DTC_FLAGS移除TPL不需要的节点,确保传递给TPL的是精简后的设备树 - 验证CONFIG_OF_SPL_REMOVE_PROPS配置:编译U-Boot后查看最终生成的
.config文件,确认该配置是否被正确保留,避免被其他配置项覆盖 - 确认U-Boot 2023.07.02对RK3399的TPL支持:该版本可能要求使用单独的
tpl.dtsi设备树片段,而非直接复用主设备树,需检查RK3399的U-Boot源码是否有相关要求 - 启用扁平化设备树配置:确保U-Boot defconfig中开启
CONFIG_OF_FLAT_TREE,避免未扁平化的设备树进入TPL阶段 - 对比Kirkstone版本的U-Boot配置:找出两个版本中TPL相关配置的差异,比如是否有额外的设备树裁剪脚本、专属配置项等
内容的提问来源于stack exchange,提问作者Citrullin
相关产品推荐
相关产品推荐

