-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nanopi-r3s: bump
edge
u-boot to 2025.01
add support for `current`
- Loading branch information
Showing
4 changed files
with
959 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
patch/kernel/archive/rockchip64-6.12/board-nanopi-r3s-fix-leds.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: John Doe <[email protected]> | ||
Date: Tue, 28 Jan 2025 12:13:35 +0800 | ||
Subject: Patching NanoPi-R3S LEDs | ||
|
||
Signed-off-by: John Doe <[email protected]> | ||
--- | ||
arch/arm64/boot/dts/rockchip/rk3566-nanopi-r3s.dts | 41 +++++++--- | ||
drivers/net/ethernet/realtek/r8169_main.c | 11 +++ | ||
drivers/net/phy/realtek.c | 11 +++ | ||
3 files changed, 53 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c | ||
index 8a3959bb2..f8c046a69 100644 | ||
--- a/drivers/net/ethernet/realtek/r8169_main.c | ||
+++ b/drivers/net/ethernet/realtek/r8169_main.c | ||
@@ -19,10 +19,11 @@ | ||
#include <linux/phy.h> | ||
#include <linux/if_vlan.h> | ||
#include <linux/in.h> | ||
#include <linux/io.h> | ||
#include <linux/ip.h> | ||
+#include <linux/of.h> | ||
#include <linux/tcp.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/dma-mapping.h> | ||
#include <linux/pm_runtime.h> | ||
#include <linux/bitfield.h> | ||
@@ -2404,10 +2405,19 @@ void r8169_apply_firmware(struct rtl8169_private *tp) | ||
!(val & BMCR_RESET), | ||
50000, 600000, true); | ||
} | ||
} | ||
|
||
+static void rtl8168_led_of_init(struct rtl8169_private *tp) | ||
+{ | ||
+ struct device *d = tp_to_dev(tp); | ||
+ u32 val; | ||
+ | ||
+ if (!of_property_read_u32(d->of_node, "realtek,ledsel", &val)) | ||
+ RTL_W16(tp, LED_CTRL, val); | ||
+} | ||
+ | ||
static void rtl8168_config_eee_mac(struct rtl8169_private *tp) | ||
{ | ||
/* Adjust EEE LED frequency */ | ||
if (tp->mac_version != RTL_GIGA_MAC_VER_38) | ||
RTL_W8(tp, EEE_LED, RTL_R8(tp, EEE_LED) & ~0x07); | ||
@@ -3389,10 +3399,11 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp) | ||
|
||
rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); | ||
rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); | ||
|
||
rtl8168_config_eee_mac(tp); | ||
+ rtl8168_led_of_init(tp); | ||
|
||
RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN); | ||
RTL_W8(tp, MISC_1, RTL_R8(tp, MISC_1) & ~PFM_D3COLD_EN); | ||
|
||
RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~TX_10M_PS_EN); | ||
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c | ||
index f65d7f1f3..f5d831924 100644 | ||
--- a/drivers/net/phy/realtek.c | ||
+++ b/drivers/net/phy/realtek.c | ||
@@ -121,10 +121,19 @@ static int rtl821x_read_page(struct phy_device *phydev) | ||
static int rtl821x_write_page(struct phy_device *phydev, int page) | ||
{ | ||
return __phy_write(phydev, RTL821x_PAGE_SELECT, page); | ||
} | ||
|
||
+static void rtl821x_led_of_init(struct phy_device *phydev) | ||
+{ | ||
+ struct device *dev = &phydev->mdio.dev; | ||
+ u32 val; | ||
+ | ||
+ if (!of_property_read_u32(dev->of_node, "realtek,ledsel", &val)) | ||
+ phy_write_paged(phydev, 0xd04, 0x10, val); | ||
+} | ||
+ | ||
static int rtl821x_probe(struct phy_device *phydev) | ||
{ | ||
struct device *dev = &phydev->mdio.dev; | ||
struct rtl821x_priv *priv; | ||
u32 phy_id = phydev->drv->phy_id; | ||
@@ -440,10 +449,12 @@ static int rtl8211f_config_init(struct phy_device *phydev) | ||
dev_dbg(dev, | ||
"2ns RX delay was already %s (by pin-strapping RXD0 or bootloader configuration)\n", | ||
val_rxdly ? "enabled" : "disabled"); | ||
} | ||
|
||
+ rtl821x_led_of_init(phydev); | ||
+ | ||
if (priv->has_phycr2) { | ||
ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR2, | ||
RTL8211F_CLKOUT_EN, priv->phycr2); | ||
if (ret < 0) { | ||
dev_err(dev, "clkout configuration failed: %pe\n", | ||
-- | ||
Created with Armbian build tools https://github.com/armbian/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.