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

Stephen Warren swarren at wwwdotorg.org
Thu Mar 19 00:29:45 CET 2020

On 3/17/20 2:07 PM, twarren at nvidia.com wrote:
> From: Tom Warren <twarren at nvidia.com>
> 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.

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.

> @@ -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?

More information about the U-Boot mailing list