diff mbox series

[2/2] rpi: Copy eth PHY address from fw DT to loaded DT

Message ID 20220810123927.2567677-3-antoine@karthanis.net
State Superseded
Delegated to: Matthias Brugger
Headers show
Series rpi: Copy properties from firmware DT to loaded DT | expand

Commit Message

Antoine Mazeas Aug. 10, 2022, 12:39 p.m. UTC
Some Raspberry Pi 400 boards, specifically rev 1.1, have a different address for the ethernet PHY device than what is provided by the kernel DTB. The correct address is provided by the firmware, so we should carry it over into the loaded device tree so that ethernet works on such boards.

Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
---
 board/raspberrypi/rpi/rpi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Peter Robinson Sept. 5, 2022, 1:19 p.m. UTC | #1
On Wed, Aug 10, 2022 at 1:58 PM Antoine Mazeas <antoine@karthanis.net> wrote:
>
> Some Raspberry Pi 400 boards, specifically rev 1.1, have a different address for the ethernet PHY device than what is provided by the kernel DTB. The correct address is provided by the firmware, so we should carry it over into the loaded device tree so that ethernet works on such boards.

Minor nit: this should be properly wrapped.

> Signed-off-by: Antoine Mazeas <antoine@karthanis.net>

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>

Tested on the RPi400 and a couple of different RPi4s

> ---
>  board/raspberrypi/rpi/rpi.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index 28b6f52506..793fd1aa30 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
> @@ -548,6 +548,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
>
>         /* kernel address randomisation seed as provided by the firmware */
>         copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");
> +
> +       /* address of the PHY device as provided by the firmware  */
> +       copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
>  }
>
>  int ft_board_setup(void *blob, struct bd_info *bd)
> --
> 2.37.1
>
Antoine Mazeas Sept. 5, 2022, 7:16 p.m. UTC | #2
Le 05/09/2022 à 15:19, Peter Robinson a écrit :
> On Wed, Aug 10, 2022 at 1:58 PM Antoine Mazeas <antoine@karthanis.net> wrote:
>>
>> Some Raspberry Pi 400 boards, specifically rev 1.1, have a different address for the ethernet PHY device than what is provided by the kernel DTB. The correct address is provided by the firmware, so we should carry it over into the loaded device tree so that ethernet works on such boards.
> 
> Minor nit: this should be properly wrapped.

Yes, I did end up resending the patch a few days later with proper 
formatting and superseding this series. I'm very sorry for the confusion.

Resent on the 19th Aug.: 
https://patchwork.ozlabs.org/project/uboot/list/?series=314524

No change apart from the formatting of the commit messages.

>> Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
> 
> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
> Tested-by: Peter Robinson <pbrobinson@gmail.com>
> 
> Tested on the RPi400 and a couple of different RPi4s
> 
>> ---
>>   board/raspberrypi/rpi/rpi.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
>> index 28b6f52506..793fd1aa30 100644
>> --- a/board/raspberrypi/rpi/rpi.c
>> +++ b/board/raspberrypi/rpi/rpi.c
>> @@ -548,6 +548,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
>>
>>          /* kernel address randomisation seed as provided by the firmware */
>>          copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");
>> +
>> +       /* address of the PHY device as provided by the firmware  */
>> +       copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
>>   }
>>
>>   int ft_board_setup(void *blob, struct bd_info *bd)
>> --
>> 2.37.1
>>
Peter Robinson Sept. 9, 2022, 12:43 p.m. UTC | #3
On Mon, Sep 5, 2022 at 8:16 PM Antoine Mazeas <antoine@karthanis.net> wrote:
>
> Le 05/09/2022 à 15:19, Peter Robinson a écrit :
> > On Wed, Aug 10, 2022 at 1:58 PM Antoine Mazeas <antoine@karthanis.net> wrote:
> >>
> >> Some Raspberry Pi 400 boards, specifically rev 1.1, have a different address for the ethernet PHY device than what is provided by the kernel DTB. The correct address is provided by the firmware, so we should carry it over into the loaded device tree so that ethernet works on such boards.
> >
> > Minor nit: this should be properly wrapped.
>
> Yes, I did end up resending the patch a few days later with proper
> formatting and superseding this series. I'm very sorry for the confusion.
>
> Resent on the 19th Aug.:
> https://patchwork.ozlabs.org/project/uboot/list/?series=314524
>
> No change apart from the formatting of the commit messages.

Probably should have been a v2 instead of a resend IMO.

> >> Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
> >
> > Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
> > Tested-by: Peter Robinson <pbrobinson@gmail.com>
> >
> > Tested on the RPi400 and a couple of different RPi4s
> >
> >> ---
> >>   board/raspberrypi/rpi/rpi.c | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> >> index 28b6f52506..793fd1aa30 100644
> >> --- a/board/raspberrypi/rpi/rpi.c
> >> +++ b/board/raspberrypi/rpi/rpi.c
> >> @@ -548,6 +548,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
> >>
> >>          /* kernel address randomisation seed as provided by the firmware */
> >>          copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");
> >> +
> >> +       /* address of the PHY device as provided by the firmware  */
> >> +       copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
> >>   }
> >>
> >>   int ft_board_setup(void *blob, struct bd_info *bd)
> >> --
> >> 2.37.1
> >>
diff mbox series

Patch

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 28b6f52506..793fd1aa30 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -548,6 +548,9 @@  void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 
 	/* kernel address randomisation seed as provided by the firmware */
 	copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");
+
+	/* address of the PHY device as provided by the firmware  */
+	copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
 }
 
 int ft_board_setup(void *blob, struct bd_info *bd)