我正在开发 6.12.34 内核并修改内核设备树 imx8mp-evk.dts。
nxp-imx/imx-Manifest:i.MX 版本清单 (imx-linux-wal nascar)
当按如下方式在设备树中添加 hd3s3220 type-c 控制器时,WOL 失败了。
/{
connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hs_ep: endpoint {
remote-endpoint = <&usb3_hs_ep>;
};
};
port@1 {
reg = <1>;
ss_ep: endpoint {
remote-endpoint = <&hd3ss3220_in_ep>;
};
};
};
};
};
&iomux {
pinctrl_hd3ss3220: hd3ss3220grp {
fsl,pins = <
MX8MP_IOMUXC_ECSPI2_MISO__GPIO5_IO12 0x140
>;
};
};
&i2c2 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
hd3ss3220@67 {
compatible = "ti,hd3ss3220";
reg = <0x67>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hd3ss3220>;
interrupt-parent = <&gpio5>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hd3ss3220_in_ep: endpoint {
remote-endpoint = <&ss_ep>;
};
};
port@1 {
reg = <1>;
hd3ss3220_out_ep: endpoint {
remote-endpoint = <&usb3_role_switch>;
};
};
};
};
};
&usb_dwc3_1 {
dr_mode = "otg";
hnp-disable;
srp-disable;
adp-disable;
usb-role-switch;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usb3_hs_ep: endpoint {
remote-endpoint = <&hs_ep>;
};
};
port@1 {
reg = <1>;
usb3_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_out_ep>;
};
};
};
};调用挂起命令后,WOL 功能失败。
根据我的检查,唤醒功能是受支持的
root@imx8mpevk:~# ethtool -s eth0 wol g
root@imx8mpevk:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Full
100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Full
100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Auto-negotiation: on
master-slave cfg: preferred slave
master-slave status: slave
Port: Twisted Pair
PHYAD: 1
Transceiver: external
MDI-X: Unknown
Supports Wake-on: ug
Wake-on: g
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yesroot@imx8mpevk:~# dmesg | grep -i wake
[ 3.148381] imx-dwmac 30bf0000.ethernet: Wake-Up On Lan supported
[ 13.933830] stmmac: wakeup enable
root@imx8mpevk:~# cat /sys/class/net/eth0/device/power/wakeup
enabled但是 6.6.52 内核(imx-linux- scarthgap)上同样的设备树设置效果很好!!
谁能帮帮我?
你好,
请尝试在 dts 中使用IRQ_TYPE_EDGE_FALLING。
致敬,
Zhiming
虽然将中断信号改为"IRQ_TYPE_EDGE_FALLING" ,但唤醒功能仍然不起作用。
目前,通过以下设置,唤醒功能运行良好。
/ {
connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hs_ep: endpoint {
remote-endpoint = <&usb3_hs_ep>;
};
};
port@1 {
reg = <1>;
ss_ep: endpoint {
remote-endpoint = <&hd3ss3220_in_ep>;
};
};
};
};
};
&i2c2 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
hd3ss3220@67 {
compatible = "ti,hd3ss3220";
reg = <0x67>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hd3ss3220>;
interrupt-parent = <&gpio5>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hd3ss3220_in_ep: endpoint {
remote-endpoint = <&ss_ep>;
};
};
port@1 {
reg = <1>;
hd3ss3220_out_ep: endpoint {
remote-endpoint = <&usb3_role_switch>;
};
};
};
};
};
&iomux {
pinctrl_hd3ss3220: hd3ss3220grp {
fsl,pins = <
MX8MP_IOMUXC_ECSPI2_MISO__GPIO5_IO12 0x140 // USB_SW_INTn (AH20)
>;
};
};
&usb3_phy1 {
fsl,phy-tx-preemp-amp-tune-microamp = <1800>;
fsl,phy-tx-vref-tune-percent = <116>;
status = "okay";
};
&usb3_1 {
status = "okay";
};
&usb_dwc3_1 {
dr_mode = "otg";
hnp-disable;
srp-disable;
adp-disable;
usb-role-switch;
role-switch-default-mode = "host";
snps,dis-u1-entry-quirk;
snps,dis-u2-entry-quirk;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usb3_hs_ep: endpoint {
remote-endpoint = <&hs_ep>;
};
};
port@1 {
reg = <1>;
usb3_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_out_ep>;
};
};
};
};但如你所见,连接器的状态被设置为"disabled" ,这是为什么呢?
删除这一行后,唤醒功能就失效了。
嗨 @AlanWen
我个人认为,这个问题可能与内核通用元器件的升级有关,不应归因于 i.MX 相关的驱动程序。由于我没有相同的硬件平台,所以无法准确找出问题所在。
致敬,
Zhiming
但在 6.6.52 内核版本中,使用相同的设置,在没有连接器状态行的情况下,唤醒功能也能正常工作。
如下所示:
/ {
connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hs_ep: endpoint {
remote-endpoint = <&usb3_hs_ep>;
};
};
port@1 {
reg = <1>;
ss_ep: endpoint {
remote-endpoint = <&hd3ss3220_in_ep>;
};
};
};
};
};
&i2c2 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
hd3ss3220@67 {
compatible = "ti,hd3ss3220";
reg = <0x67>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hd3ss3220>;
interrupt-parent = <&gpio5>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
hd3ss3220_in_ep: endpoint {
remote-endpoint = <&ss_ep>;
};
};
port@1 {
reg = <1>;
hd3ss3220_out_ep: endpoint {
remote-endpoint = <&usb3_role_switch>;
};
};
};
};
};
&iomux {
pinctrl_hd3ss3220: hd3ss3220grp {
fsl,pins = <
MX8MP_IOMUXC_ECSPI2_MISO__GPIO5_IO12 0x140 // USB_SW_INTn (AH20)
>;
};
};
&usb3_phy1 {
fsl,phy-tx-preemp-amp-tune-microamp = <1800>;
fsl,phy-tx-vref-tune-percent = <116>;
status = "okay";
};
&usb3_1 {
status = "okay";
};
&usb_dwc3_1 {
dr_mode = "otg";
hnp-disable;
srp-disable;
adp-disable;
usb-role-switch;
role-switch-default-mode = "host";
snps,dis-u1-entry-quirk;
snps,dis-u2-entry-quirk;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usb3_hs_ep: endpoint {
remote-endpoint = <&hs_ep>;
};
};
port@1 {
reg = <1>;
usb3_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_out_ep>;
};
};
};
};