AM625 Verdin board, yocto support to have Documentation/devicetree/bindings/hwmon/INA2XX device INA260

Hi ,

I am using AM625 with verdin board , and builiding image using yocto Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center But I cant see the INA260 module in my device tree binding document properties:
compatible:
enum:
- ti,ina209
- ti,ina219
- ti,ina220
- ti,ina226
- ti,ina230
- ti,ina231
- ti,ina238

But when I refer the kernel.org/doc/Documentation/devicetree/bindings/hwmon/ti%2Cina2xx.yaml I see the compatible:
enum:
- ti,ina209
- ti,ina219
- ti,ina220
- ti,ina226
- ti,ina230
- ti,ina231
- ti,ina237
- ti,ina238
- ti,ina260
I understand the version given in yocto recipe is as below -
inherit kernel-yocto kernel toradex-kernel-deploy-config toradex-kernel-localversion ti-secdev
LINUX_VERSION = “6.1.46”

skip, as with use-head-next LINUX_VERSION might be set wrongly

KERNEL_VERSION_SANITY_SKIP = “1”

SCMVERSION ?= “y”
SRCBRANCH = “toradex_ti-linux-6.1.y”
SRCREV_machine = “1121e06acc198cec858053b136d1700830ca11cd”
SRCREV_machine:use-head-next = “${AUTOREV}”

Any help on how to update this to support INA260 module ? because I see the version is by Toradex.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To add support for the INA260 module in your device tree when using a Toradex Verdin board with an AM625 SoC and building an image with Yocto, you will need to manually update the device tree. The discrepancy you’ve noticed between the device tree bindings documented in your Yocto build and those available on kernel.org is likely due to the version of the Linux kernel being used in your Yocto project. The Toradex Linux kernel version you’re working with might not include the latest updates or support for the INA260 as seen in the mainline Linux kernel.

To update your device tree to support the INA260 module, follow these steps:

  1. Update the Device Tree Source (DTS) File: Locate the DTS file for your specific board configuration within your Yocto project’s kernel source directory. This file will be under arch/arm/boot/dts/ in the Linux kernel source tree. You will need to add a node for the INA260 device under the appropriate I2C bus node. For example:

    &i2c1 {
        ina260@40 {
            compatible = "ti,ina260";
            reg = <0x40>;
            // Additional properties as required
        };
    };
    

    Ensure the I2C address (0x40 in the example) matches the actual hardware configuration.

  2. Rebuild the Device Tree Blob (DTB): After updating the DTS file, you’ll need to rebuild the DTB file as part of your Yocto project build process. This typically involves invoking a bitbake command to rebuild the kernel or the entire image if necessary.

  3. Update the Yocto Recipe: Ensure your Yocto recipe for the kernel includes the updated DTS file. You might need to modify the recipe to ensure it uses the modified version of the DTS file when building the kernel.

  4. Verify Kernel Configuration: Ensure the Linux kernel configuration (CONFIG_SENSORS_INA260) is enabled. This might require modifying the kernel configuration within your Yocto project to ensure the INA260 driver is built into the kernel or available as a module.

  5. Testing: After rebuilding your image and deploying it to your Verdin board, verify the INA260 module is correctly detected and accessible through the sysfs interface at /sys/class/hwmon/hwmonX/, where X is the appropriate instance number.

If the INA

Please, also check if these links can help you solve your problem:

Verdin iMX8M Plus Power Consumption | Toradex Developer Center.

Hi @vtjp,

Thanks for writing to Toradex community.

Regarding your question, as suggested by Toradex AI since the kernel version do not have required support for ina260 chip, you will need to modify or include the changes by yourself and test.

Please check below patch which add support for INA260
https://lore.kernel.org/lkml/ZOILXb-1ObJRB1ck@lguegan-thinkpad/

Best regards
Ritesh Kumar

Please share the steps

Hi @vtjp,

Steps really depend on how to want to test. If you are building yocto image then you will need to navigate to driver source code and add the changes and build image.

If you are building kernel outside yocto then you can follow below article, here also you will need to modify the driver as per the changes and test.

Best regards
Ritesh Kumar

Hi, I am using Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center to build for AM62 verdin board

Hi @vtjp,

We will recommend to first verify driver with the modification. Once verified then include and build with yocto.
Please check below link

Best regards
Ritesh Kumar