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

add u-boot ethernet support to orange pi one plus (h6) #389

Merged
merged 1 commit into from
Jul 12, 2023
Merged
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,58 @@
From: Anne Macedo <[email protected]>
Date: Tue, 11 Jul 2023 00:39:58 +0000
Subject: [PATCH] sunxi: H6: Enable Ethernet on Orange Pi One Plus

Enable Ethernet on Orange Pi One Plus by using the correct phy for
Realtek RTL8211E instead of the Generic One. Also use CONFIG_MACPWR to
turn on ethernet on startup.

After this patch is applied, a few issues can be seen:

- there's still a PHY reset timed out error that doesn't seem to cause
any impacts to the overall connection

- sometimes the emac driver times out after reset (yellow LED turns on
and never blinks)

For future patches: for now, CONFIG_MACPWR is the only way to enable
Ethernet on boot. There's already code on the dts for using the 3v3-gmac
regulator. However, it is not probed on boot, so it only starts after a
"regulator status" command is issued.

More details about the troubleshooting on [1].

Upstream-Status: Submitted

[1] https://lore.kernel.org/u-boot/4wsvwgy56e2xfgtvioru2tf2ofkqprlts36qggivxogww6pn5j@4jk63zxhzhag/

Signed-off-by: Anne Macedo <[email protected]>
---
arch/arm/dts/sun50i-h6-orangepi-one-plus.dts | 2 +-
configs/orangepi_one_plus_defconfig | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/sun50i-h6-orangepi-one-plus.dts b/arch/arm/dts/sun50i-h6-orangepi-one-plus.dts
index 29a081e72a..6427c58f8a 100644
--- a/arch/arm/dts/sun50i-h6-orangepi-one-plus.dts
+++ b/arch/arm/dts/sun50i-h6-orangepi-one-plus.dts
@@ -37,7 +37,7 @@

&mdio {
ext_rgmii_phy: ethernet-phy@1 {
- compatible = "ethernet-phy-ieee802.3-c22";
+ compatible = "ethernet-phy-id001c.c915", "ethernet-phy-ieee802.3-c22" ;
reg = <1>;
};
};
diff --git a/configs/orangepi_one_plus_defconfig b/configs/orangepi_one_plus_defconfig
index aa5f540eb1..a1835492db 100644
--- a/configs/orangepi_one_plus_defconfig
+++ b/configs/orangepi_one_plus_defconfig
@@ -8,3 +8,7 @@ CONFIG_SUNXI_DRAM_H6_LPDDR3=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_PHY_REALTEK=y
+CONFIG_PHY_ETHERNET_ID=y
+CONFIG_MACPWR="PD6"
1 change: 1 addition & 0 deletions recipes-bsp/u-boot/u-boot_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DEFAULT_PREFERENCE:sun50i = "1"
SRC_URI:append:sunxi = " \
file://0001-nanopi_neo_air_defconfig-Enable-eMMC-support.patch \
file://0002-Added-nanopi-r1-board-support.patch \
file://0003-sunxi-H6-Enable-Ethernet-on-Orange-Pi-One-Plus.patch \
file://boot.cmd \
"

Expand Down