Skip to contentSkip to conversation

net: tegra: Misc network fixes

PATCH New tomcwarren3959 at gmail.com 2 participants 4 messages Mar 26, 2020 – Jun 12, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

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.
-----------------------------------------------------------------------------------
#1 lore raw

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
index 5ccdfdd..ff89e28 100644
@@ -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.
-----------------------------------------------------------------------------------
#2 lore raw

PATCH 1/2 net: rt8169: WAR for DHCP not getting IP after kernel boot/reboot

Quoted 10 lines · On Thu, Mar 26, 2020 at 03:59:13PM -0700, tomcwarren3959 at gmail.com wrote:

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.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200612/9a96f6fb/attachment.sig>
#3 lore raw

PATCH 2/2 tegra: Enable CONFIG_BOOTP_PREFER_SERVERIP for all Jetson boards

In reply to tomcwarren3959 at gmail.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.

---
 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
index 1639040..951ed1d 100644
@@ -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
index 2070199..7081719 100644
@@ -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
index 8c808ae..c70217c 100644
@@ -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
index 721c5c5..43c24b8 100644
@@ -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
index e347a77..8bf8419 100644
@@ -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
index 0803b26..1f40333 100644
@@ -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.
-----------------------------------------------------------------------------------