-----Original Message-----
From: Stephen Warren <swar...@wwwdotorg.org> 
Sent: Wednesday, March 18, 2020 4:30 PM
To: Tom Warren <twar...@nvidia.com>
Cc: u-boot@lists.denx.de; Stephen Warren <swar...@nvidia.com>; Thierry Reding 
<tred...@nvidia.com>; Jonathan Hunter <jonath...@nvidia.com>; 
tomcwarren3...@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


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

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

Reply via email to