Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uboot: Copy additional DT property for pi400 PHY #185905

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 15f872f2db217d87dff2ae304b96096068b0de32 Mon Sep 17 00:00:00 2001
From: Antoine Mazeas <[email protected]>
Date: Wed, 10 Aug 2022 13:51:21 +0200
Subject: [PATCH 2/2] rpi: Copy eth PHY address from fw DT to loaded DT

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 <[email protected]>
---
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

4 changes: 4 additions & 0 deletions pkgs/misc/uboot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ let
# See also: https://github.com/NixOS/nixpkgs/issues/135828
# Source: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
./0001-rpi-Copy-properties-from-firmware-dtb-to-the-loaded-.patch

# also copy the correct ethernet PHY address to ensure ethernet works
# See: https://github.com/NixOS/nixpkgs/issues/183019
./0002-rpi-Copy-eth-PHY-address-from-fw-DT-to-loaded-DT.patch
] ++ extraPatches;

postPatch = ''
Expand Down