From 0d8657dd3056063fb115946b10157477b5c70451 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 20 Nov 2023 09:09:45 +0000
Subject: [PATCH] enable lvds 1280x800
---
kernel/drivers/net/ethernet/realtek/r8169.c | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/kernel/drivers/net/ethernet/realtek/r8169.c b/kernel/drivers/net/ethernet/realtek/r8169.c
index 99678fd..6a6c6d0 100644
--- a/kernel/drivers/net/ethernet/realtek/r8169.c
+++ b/kernel/drivers/net/ethernet/realtek/r8169.c
@@ -5117,6 +5117,10 @@
/* Adjust EEE LED frequency */
RTL_W8(tp, EEE_LED, RTL_R8(tp, EEE_LED) & ~0x07);
+ printk("r8169 EEE_LED value init: %x\n",RTL_R16(tp,0x18));
+ RTL_W16(tp, 0x18, 0x024F);
+ printk("r8169 EEE_LED write: %x\n",RTL_R16(tp,0x18));
+
}
static void rtl_hw_start_8411(struct rtl8169_private *tp)
@@ -7435,6 +7439,7 @@
clk_disable_unprepare(data);
}
+extern ssize_t at24_mac1_read(unsigned char* mac);
static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
@@ -7442,6 +7447,7 @@
struct net_device *dev;
int chipset, region, i;
int jumbo_max, rc;
+ unsigned char mac[6];
dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
if (!dev)
@@ -7593,8 +7599,30 @@
default:
break;
}
- for (i = 0; i < ETH_ALEN; i++)
- dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
+// for (i = 0; i < ETH_ALEN; i++)
+// dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
+ memset(mac, 0x00, 6);
+ at24_mac1_read(mac);
+
+ if ((mac[0] == 0x68) && (mac[1] == 0xed))
+ {
+ printk("rtl811h mac read from eeprom success!! \n");
+ for (i = 0; i < ETH_ALEN; i++)
+ dev->dev_addr[i] = mac[i];
+ }
+ else
+ {
+ printk("rtl811h mac read from eeprom error!! \n");
+
+ dev->dev_addr[0] = 0x66;
+ dev->dev_addr[1] = 0xED;
+ dev->dev_addr[2] = 0xB5;
+ dev->dev_addr[3] = 0x64;
+ dev->dev_addr[4] = 0x72;
+ dev->dev_addr[5] = 0x2C;
+ }
+
+ rtl_rar_set(tp, dev->dev_addr);
dev->ethtool_ops = &rtl8169_ethtool_ops;
dev->watchdog_timeo = RTL8169_TX_TIMEOUT;
@@ -7696,4 +7724,5 @@
.driver.pm = RTL8169_PM_OPS,
};
-module_pci_driver(rtl8169_pci_driver);
+//module_pci_driver(rtl8169_pci_driver);
+module_pci_driver2(rtl8169_pci_driver); //late_initcall();
--
Gitblit v1.6.2