net: tegra: Misc network fixes
cover net: tegra: Misc network fixes
From: Tom Warren <[email protected]>
These two patches are from downstream Tegra L4T U-Boot.
Tom Warren (2):
net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all Jetson boards
configs/e2220-1170_defconfig | 1 + configs/p2371-0000_defconfig | 1 + configs/p2371-2180_defconfig | 1 + configs/p2571_defconfig | 1 + configs/p2771-0000-000_defconfig | 1 + configs/p2771-0000-500_defconfig | 1 + drivers/net/rtl8169.c | 16 ++++++++++++++++ 7 files changed, 22 insertions(+)
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
From: Tom Warren <[email protected]>
This is a WAR for DHCP failure after rebooting from the L4T kernel. The r8169.c kernel driver is setting bit 19 of the rt816x HW register 0xF0, which goes by FuncEvent and MISC in various driver source/datasheets. That bit is called RxDv_Gated_En in the r8169.c kernel driver. Clear it here at the end of probe to ensure that U-Boot can get an IP assigned via DHCP.
--- drivers/net/rtl8169.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/rtl8169.c +16 -0
@@ -237,6 +237,9 @@ enum RTL8169_register_content {/*_TBICSRBit*/ TBILinkOK =0x02000000 , + +/* FuncEvent/Misc */ + RxDv_Gated_En = 0x80000, }; static struct {
@@ -1207,6 +1210,19 @@ static int rtl8169_eth_probe(struct udevice *dev)return ret; } +/* +* WAR for DHCP failure after rebooting from kernel. +* Clear RxDv_Gated_En bit which was set by kernel driver. +* Without this, U-Boot can't get an IP via DHCP. +* Register (FuncEvent, aka MISC) and RXDV_GATED_EN bit are from +* the r8169.c kernel driver. +*/ + +u32 val =RTL_R32 (FuncEvent); +debug ("%s: FuncEvent/Misc (0xF0) = 0x%08X\n" , __func__, val); + val &= ~RxDv_Gated_En; +RTL_W32 (FuncEvent, val); +return 0 ; }
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
Quoted 8 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This is a WAR for DHCP failure after rebooting from the L4T kernel. The
r8169.ckernel driver is setting bit 19 of the rt816x HW register0xF0, which goes by FuncEvent and MISC in various driver source/datasheets. That bit is calledRxDv_Gated_Enin ther8169.ckernel driver. Clear it here at the end of probe to ensure that U-Boot can get an IP assigned via DHCP.
Is there a way to reset the entire chip back to power-on state instead, just to make sure there aren't any other register bits that might cause issues in the future?
Does this bit exist in all the different chips that the driver supports? IIRC at least the Linux r8169 driver supports many different similar chips; I'm not sure if the U-Boot driver does too. Since this driver is shared between many boards in U-Boot, we need to make sure this change doesn't break anyone using a different Realtek chip to the exact one we use on Jetson.
We need to send this patch to the network maintainers so they're aware of it, and they'll probably want to apply it.
drivers/net/rtl8169.c static int rtl8169_eth_probe(struct udevice *dev) · line 1214
Quoted 6 lines
drivers/net/rtl8169.c +4
-0@@ -1207,6 +1210,19 @@ static int rtl8169_eth_probe(struct udevice *dev) +u32 val =RTL_R32 (FuncEvent); +debug ("%s: FuncEvent/Misc (0xF0) = 0x%08X\n" , __func__, val); + val &= ~RxDv_Gated_En; +RTL_W32 (FuncEvent, val);
I vagueley recall that U-Boot coding style wants variables declared at the start of the block, but perhaps that's no longer true. What does scripts/checkpatch.pl say?
PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
-----Original Message-----
From: Stephen Warren <[email protected]>
Sent: Wednesday, March 18, 2020 4:30 PM
To: Tom Warren <[email protected]>
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; tomcwarren3959 at gmail.com
Subject: Re: [PATCH 1/2] net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
External email: Use caution opening links or attachments
Quoted 8 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This is a WAR for DHCP failure after rebooting from the L4T kernel. The
r8169.ckernel driver is setting bit 19 of the rt816x HW register0xF0, which goes by FuncEvent and MISC in various driver source/datasheets. That bit is calledRxDv_Gated_Enin ther8169.ckernel driver. Clear it here at the end of probe to ensure that U-Boot can get an IP assigned via DHCP.
Is there a way to reset the entire chip back to power-on state instead, just to make sure there aren't any other register bits that might cause issues in the future? [Tom] Maybe, I'll have to look at the RTL spec, it's been awhile since I came up with this WAR.
Does this bit exist in all the different chips that the driver supports?
IIRC at least the Linux r8169 driver supports many different similar chips; I'm not sure if the U-Boot driver does too. Since this driver is shared between many boards in U-Boot, we need to make sure this change doesn't break anyone using a different Realtek chip to the exact one we use on Jetson. [Tom] I'll look into it after I get Nano patches all in place upstream. If anyone runs into the problem described here w/no IP on net boot, they can use this as a WAR until I try for a more robust fix.
We need to send this patch to the network maintainers so they're aware of it, and they'll probably want to apply it. [Tom] Will do.
drivers/net/rtl8169.c static int rtl8169_eth_probe(struct udevice · line 1215
Quoted 7 lines
drivers/net/rtl8169.c +4
-0@@ -1207,6 +1210,19 @@ static int rtl8169_eth_probe(struct udevice *dev) +u32 val =RTL_R32 (FuncEvent); +debug ("%s: FuncEvent/Misc (0xF0) = 0x%08X\n" , __func__, val); + val &= ~RxDv_Gated_En; +RTL_W32 (FuncEvent, val);
I vagueley recall that U-Boot coding style wants variables declared at the start of the block, but perhaps that's no longer true. What does scripts/checkpatch.pl say? [Tom] I don't recall, I'll run it again and see.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
In reply to twarren at nvidia.comQuoted 9 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This is a WAR for DHCP failure after rebooting from the L4T kernel. The
r8169.ckernel driver is setting bit 19 of the rt816x HW register0xF0, which goes by FuncEvent and MISC in various driver source/datasheets. That bit is calledRxDv_Gated_Enin ther8169.ckernel driver. Clear it here at the end of probe to ensure that U-Boot can get an IP assigned via DHCP.
Quoted 4 lines
Signed-off-by Tom Warren <[email protected]>--- drivers/net/rtl8169.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Is this still needed? In my old p3450 branch that I worked on to get Porg up and running I don't have this patch. It's also not in my local development tree that I typically use to boot Tegra186 and earlier boards. That branch works fine on the Jetson Nano, so I don't think this is needed anymore. I vaguely recall that I determined that this was fixed some other way, but unfortunately I don't remember the exact details.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200319/f36936dc/attachment.sig>
PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
-----Original Message-----
From: Thierry Reding <[email protected]>
Sent: Thursday, March 19, 2020 1:04 AM
To: Tom Warren <[email protected]>
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Jonathan Hunter <[email protected]>; tomcwarren3959 at gmail.com
Subject: Re: [PATCH 1/2] net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot
Quoted 9 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This is a WAR for DHCP failure after rebooting from the L4T kernel. The
r8169.ckernel driver is setting bit 19 of the rt816x HW register0xF0, which goes by FuncEvent and MISC in various driver source/datasheets. That bit is calledRxDv_Gated_Enin ther8169.ckernel driver. Clear it here at the end of probe to ensure that U-Boot can get an IP assigned via DHCP.
Quoted 4 lines
Signed-off-by Tom Warren <[email protected]>--- drivers/net/rtl8169.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Is this still needed? In my old p3450 branch that I worked on to get Porg up and running I don't have this patch. It's also not in my local development tree that I typically use to boot Tegra186 and earlier boards. That branch works fine on the Jetson Nano, so I don't think this is needed anymore. I vaguely recall that I determined that this was fixed some other way, but unfortunately I don't remember the exact details.
Thierry
[Tom] I'll retest as part of my Nano rework of your original patch, Thierry. So you've done network boot, then rebooted from the kernel (sudo reboot), and attempted net boot again and seen it work OK, w/an IP assigned by DHCP, etc.? (not static IP). It's also possible that something in the kernel RT8169 driver has changed, and it's not setting the bit anymore.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 2/2 tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all boards
In reply to twarren at nvidia.comFrom: Tom Warren <[email protected]>
This allows the user to set $serverip in the environment before executing a DHCP request. If they do, U-Boot will use that IP rather than using the IP in the DHCP response.
--- configs/e2220-1170_defconfig | 1 + configs/p2371-0000_defconfig | 1 + configs/p2371-2180_defconfig | 1 + configs/p2571_defconfig | 1 + configs/p2771-0000-000_defconfig | 1 + configs/p2771-0000-500_defconfig | 1 + 6 files changed, 6 insertions(+)
configs/e2220-1170_defconfig +1 -0
@@ -43,3 +43,4 @@ CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y +CONFIG_BOOTP_PREFER_SERVERIP=y
configs/p2371-0000_defconfig +1 -0
@@ -44,3 +44,4 @@ CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y +CONFIG_BOOTP_PREFER_SERVERIP=y
configs/p2371-2180_defconfig +1 -0
@@ -52,3 +52,4 @@ CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y +CONFIG_BOOTP_PREFER_SERVERIP=y
configs/p2571_defconfig +1 -0
@@ -44,3 +44,4 @@ CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y +CONFIG_BOOTP_PREFER_SERVERIP=y
configs/p2771-0000-000_defconfig +1 -0
@@ -37,3 +37,4 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_POSITION_INDEPENDENT=y +CONFIG_BOOTP_PREFER_SERVERIP=y
configs/p2771-0000-500_defconfig +1 -0
@@ -37,3 +37,4 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_POSITION_INDEPENDENT=y +CONFIG_BOOTP_PREFER_SERVERIP=y
Signature · 9 lines
1.8.2.1.610.g562af5b ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
PATCH 2/2 tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all boards
Quoted 5 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This allows the user to set $serverip in the environment before executing a DHCP request. If they do, U-Boot will use that IP rather than using the IP in the DHCP response.
I wonder if this should be applied to more Tegra boards, so they all work consistently? E.g. T20/30/114/124 boards.
PATCH 2/2 tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all boards
-----Original Message-----
From: Stephen Warren <[email protected]>
Sent: Wednesday, March 18, 2020 4:31 PM
To: Tom Warren <[email protected]>
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; tomcwarren3959 at gmail.com
Subject: Re: [PATCH 2/2] tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all boards
External email: Use caution opening links or attachments
Quoted 5 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
This allows the user to set $serverip in the environment before executing a DHCP request. If they do, U-Boot will use that IP rather than using the IP in the DHCP response.
I wonder if this should be applied to more Tegra boards, so they all work consistently? E.g. T20/30/114/124 boards.
[Tom] I can certainly do that, but I don't really test on anything <T210 anymore, especially not net boot. Do you test for that in your Jenkins test harness?
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 2/2 tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all boards
Quoted 13 lines · Tom Warren
-----Original Message-----
From: Stephen Warren <[email protected]>
Sent: Wednesday, March 18, 2020 4:31 PM
To: Tom Warren <[email protected]>
Cc: u-boot at lists.denx.de; Stephen Warren <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; tomcwarren3959 at gmail.com
Subject: Re: [PATCH 2/2] tegra: EnableCONFIG_BOOTP_PREFER_SERVERIPfor all boardsExternal email: Use caution opening links or attachments
Quoted 2 lines · twarren at nvidia.com
From: Tom Warren <[email protected]>
Quoted 8 lines
Quoted 3 lines
This allows the user to set $serverip in the environment before executing a DHCP request. If they do, U-Boot will use that IP rather than using the IP in the DHCP response.
Acked-by Stephen Warren <[email protected]>I wonder if this should be applied to more Tegra boards, so they all work consistently? E.g. T20/30/114/124 boards.
[Tom] I can certainly do that, but I don't really test on anything <T210 anymore, especially not net boot. Do you test for that in your Jenkins test harness?
The oldest hardware that's tested in Jenkins is Jetson TK1. In total I have TK1, TX1, TX2 automated.