Hi ,
i am using verdin am62 and trying to add LAN937x device. how to add this to the device tree and to enable it.
Hi ,
i am using verdin am62 and trying to add LAN937x device. how to add this to the device tree and to enable it.
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?
Hello,
To add the LAN937x device to your Verdin AM62 module, you will need to modify the device tree. The LAN937x is a managed Ethernet switch, which typically interfaces with the system via SPI or SMI. Assuming you’re interfacing via SPI, here’s a general approach to add it to the device tree:
Identify the SPI bus on your Verdin AM62 where the LAN937x is connected. The Verdin AM62 datasheet or the carrier board schematics will help you identify the correct SPI bus.
Modify the Device Tree: You’ll need to edit the device tree source file (DTS) for your specific configuration. This involves adding a node for the LAN937x under the SPI bus node.
Here is a simplified example of what the device tree entry might look like:
&spiX { /* Replace X with the correct SPI bus number */
lan937x: ethernet-switch@0 {
compatible = "microchip,lan937x";
reg = <0>; /* SPI chip select */
spi-max-frequency = <10000000>; /* Adjust based on your setup */
/* Additional properties depending on your configuration */
};
};
Enable SPI Driver: Ensure the SPI driver is enabled in your kernel configuration. This can typically be done through menuconfig
:
make menuconfig
Navigate to “Device Drivers” > “SPI support” and ensure the SPI master controller driver for your SoC and the Microchip Ethernet switch driver (if available) are enabled.
Recompile the Device Tree and Kernel: After making the necessary changes, recompile the device tree and the kernel. Deploy them to your Verdin AM62 module.
Driver Support: As of my last update, there might not be a direct driver for LAN937x in the mainline Linux kernel. You might need to check if Microchip provides a driver or if there’s a compatible driver that can be adapted. If a driver is provided, ensure it’s included in your kernel or as a module.
Testing: After booting with the new device tree and kernel, verify the device is recognized correctly. You can use tools like dmesg
to check for any initialization messages from the driver.
Remember, this is a simplified guide. The exact steps can vary based on your specific hardware setup, the Linux kernel version you’re using, and the driver availability
Please, also check if these links can help you solve your problem:
Thanks for writing to Toradex Community.
As suggested by Toradex AI, you will need to ensure suitable driver for chip is enable before you modify and add device tree for this chip.
Please confirm were you able to build kernel with driver. Please check drivers/net/dsa/microchip/Kconfig to understand all the configs you need to enable to get the driver building.
Next step if to update module with modified kernel and modules. Please check below link for same
Finally add device either to device tree overlay or make changes to device tree itself. Please refer below documentation for same.
for LAN937x device node check below
Best regards
Ritesh Kumar