设备树,更改固定链接以太网物理速度运行时 [英] device tree, change fixed link ethernet phy speed runtime

查看:48
本文介绍了设备树,更改固定链接以太网物理速度运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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.

为了实现这一点,我必须使用固定链接属性将其绑定到设备树中,如下所示.

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:

  1. 创建另一个包含主要 dts 的 dts(例如:new-phy.dts)并在那里添加您的覆盖节点

  1. 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>saveenv

u-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.

这篇关于设备树,更改固定链接以太网物理速度运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆