RK3588&RK3576实现 HW-ID DTB(动态加载不同的Kernel DTB)功能

RK平台的U-Boot⽀持检测硬件上的GPIO或者ADC状态动态加载不同的Kernel DTB,暂称为HW-ID DTB(
Hardware id DTB)功能。

设计原理

通常硬件设计会经常更新版本和⼀些元器件,⽐如:屏幕、wifi 模组等。如果每⼀个硬件版本都要对应⼀套软件,维护起来就⽐较⿇烦。所以需要 HW_ID 功能实现⼀套软件可以适配不同版本的硬件。针对不同硬件版本,软件上需要提供对应的dtb ⽂件,同时还要提供 ADC/GPIO 硬件唯⼀值⽤于表征当前硬件版本(⽐如:定的adc 值、固定的某 GPIO 电平)。⽤⼾把这些和硬件版本对应的dtb
⽂件全打包进同⼀个resource.img,U-Boot 引导 kernel 时会检测硬件唯⼀值,从 resource.img
⾥找出和当前硬件版本匹配的 dtb 传给 kernel。

硬件参考⽬前⽀持 ADC 和 GPIO 两种⽅式确定硬件版本。

ADC 参考设计

RK3326-EVB/PX30-EVB 主板上有预留分压电阻,不同的电阻分压有不同的ADC 值,这样可以确定不同
硬件版本:

### MfgTool DTB Usage and Configuration MfgTool, commonly used for programming and configuring embedded devices such as those based on NXP i.MX processors, supports Device Tree Binary (DTB) files during the boot process. A device tree binary file describes hardware components connected to a processor or SoC without requiring changes to the operating system source code. For mfgtool operations involving DTBs: A bootloader must place a device tree image (dtb) into system RAM at an address aligned to 64 bits and initialize this memory region with necessary boot parameters[^2]. This preparation ensures that when the kernel starts executing, it can locate the start marker `0xd00dfeed` within the provided dtb location to confirm presence of valid device tree information rather than expecting traditional tagged lists. Incorporating these principles into practical use cases through mfgtool involves specifying paths to appropriate .dtb files alongside other required binaries like u-boot images or Linux kernels via configuration scripts tailored specifically towards target platforms supported by mfgtool. To configure mfgTool correctly for using custom-built DTBs: Ensure the generated `.dtb` file matches exactly what was compiled from corresponding dts sources intended for your specific board setup. Place this file along with any additional resources needed during flashing processes inside designated directories referenced within project settings files utilized by mfgtool. Below demonstrates how one might structure commands related to loading both U-Boot SPL/UBOOT plus associated DTB while ensuring alignment requirements are met before handing control over to subsequent stages after power-on reset sequence completes successfully. ```bash # Example command line arguments passed to mfgtool mfgtool --fdt=my_custom_board.dtb \ --loadaddr=<physical_address_for_dtb> ``` This script snippet assumes existence of precompiled artifacts (`U_BOOT_SPL`, `uImage`) together with properly constructed device tree blob named `my_custom_board.dtb`. Adjust `<physical_address_for_dtb>` according to actual platform specifications regarding where in physical address space the dtb should reside upon being loaded into RAM prior to invocation of next stage loaders. --related questions-- 1. How does one compile DTS files into DTB format suitable for deployment? 2. What tools besides mfgtool offer similar functionality concerning firmware updates incorporating DTBs? 3. Can you provide examples demonstrating integration between Yocto Project builds and mfgtool workflows including handling of DTBs? 4. Are there best practices recommended when modifying existing device trees versus creating entirely new ones?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飘飘燃雪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值