设备树,更改固定链接以太网phy速度运行时 [英] device tree, change fixed link ethernet phy speed runtime
问题描述
我正在使用具有Linux内核不支持的phy的自定义IMX8板(这是第45条汽车oabr收发器).
I'm working with a custom IMX8 board with a phy that is not supported by the Linux kernel (it's a clause 45 automotive oabr transceiver).
该phy实际上正在运行,其mdio总线和数字IO由一个用户空间应用程序控制.
The phy is actually working, and its mdio bus and digital IO's are controlled with an userspace application.
要达到这个目的,我必须将它与设备树绑定在一起,如下所示具有fixed-link属性.
To acheive this i had to bind it in the device tree with the fixed-link property as below.
...
port@0 {
reg = <0x00>;
label = "oabr";
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
pause;
asym-pause;
};
};
...
现在...问题是,我想将phy的速度从1000更改为100,如果能够配置phy并更改设备树,则可以执行此操作,但这意味着需要重新启动设备来加载新的dts文件.
Now... the question is, i would like to change the speed of the phy from 1000 to 100, i'm able to do it if configure the phy AND change the device tree, but this implies a reboot of the device to load a new dts file.
有没有一种方法可以使其在运行时正常运行?
Is there a way to get it working runtime?
非常感谢
马可
推荐答案
为了在运行时添加或加载设备树blob,唯一的方法是使用Linux
In order to add or load a device tree blob in runtime, the only way is to use Linux overlay.
但是问题是NXP在其linux-imx内核中不支持它,您可以在
But the problem is that NXP does not support it in its linux-imx kernel , you can see their post about it here.
如果您没有永久更改用于映像的主设备树文件,我可以建议您这样做:
If you don't make the change permanently to your main device tree file used for the image, I can advise you of doing this:
-
创建另一个包含主要dts的dts(例如:new-phy.dts),并在其中添加您的替代节点
Create another dts (Ex: new-phy.dts) that includes the main dts and add your override node there
将新的dtb名称添加到您的 $ {MACHINE} .conf KERNEL_DEVICETREE 变量:
Add the new dtb name to your ${MACHINE}.conf KERNEL_DEVICETREE variable:
KERNEL_DEVICETREE + ="freescale/new-phy.dtb"
现在,从u-boot CLI引导后,您需要选择它,例如:
Now you need to choose it once you boot from u-boot CLI, like:
u-boot> setenv fdt_file new-phy.dtb
u-boot> setenv fdt_file new-phy.dtb
u-boot> saveenv
u-boot> saveenv
u-boot>启动
u-boot> boot
或者,您可以在u-boot/configs/$ {MACHINE} _defconfig中进行设置:
Or, you can set it in your u-boot/configs/${MACHINE}_defconfig:
CONFIG_DEFAULT_FDT_FILE ="new-phy.dtb"
否则,您可以尝试为正在使用的内核添加对覆盖的支持.
Otherwise, you can try to add the overlay support for the kernel you are using.
Toradex具有基于IMX8M的SOM和EVK,它们正在使用叠加层,您可以看一下此处,并尝试了解他们为支持该网站所做的工作.
Toradex has SOMs and EVKs based on IMX8M and they are working with overlays, you can take a look here and try to understand what they did to support it.
这篇关于设备树,更改固定链接以太网phy速度运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!