Blob Blame History Raw
From ae1f7fc89fe25fa663069f697a436aba85df3c06 Mon Sep 17 00:00:00 2001
From: Sergey Lichack <shadowpilot34@gmail.com>
Date: Tue, 4 Jan 2011 11:20:33 +0300
Subject: [PATCH 13/13] rtl8169 support

Here's a small patch that would add rtl8169 support to flashrom, but I
need someone to test it for me.

Signed-off-by: Sergey Lichack <shadowpilot34@gmail.com>
---
 nicrealtek.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/nicrealtek.c b/nicrealtek.c
index b5bcbaf..b43e330 100644
--- a/nicrealtek.c
+++ b/nicrealtek.c
@@ -25,11 +25,12 @@
 #define PCI_VENDOR_ID_REALTEK	0x10ec
 #define PCI_VENDOR_ID_SMC1211	0x1113
 
-#define BIOS_ROM_ADDR		0xD4
-#define BIOS_ROM_DATA		0xD7
+int BIOS_ROM_ADDR, BIOS_ROM_DATA;
+
 
 const struct pcidev_status nics_realtek[] = {
 	{0x10ec, 0x8139, OK, "Realtek", "RTL8139/8139C/8139C+"},
+	{0x10ec, 0x8169, OK, "Realtek", "RTL8169"},
 	{},
 };
 
@@ -38,6 +39,8 @@ const struct pcidev_status nics_realteksmc1211[] = {
 	{},
 };
 
+static uint16_t id;
+
 int nicrealtek_init(void)
 {
 	get_io_perms();
@@ -47,6 +50,16 @@ int nicrealtek_init(void)
 
 	buses_supported = CHIP_BUSTYPE_PARALLEL;
 
+	id = pcidev_dev->device_id;
+	if(id == 0x8139) {
+		BIOS_ROM_ADDR = 0xD4;
+		BIOS_ROM_DATA = 0xD7;
+	}
+	else {
+		BIOS_ROM_ADDR = 0x30;
+		BIOS_ROM_DATA = 0x33;
+	}
+
 	return 0;
 }
 
-- 
1.7.3.4