ax88796: add 93cx6 eeprom support
This patch hooks up the 93cx6 eeprom code to the ax88796 driver and modifies
the ax88796 driver to read out the mac address from the eeprom. We need
this for the ax88796 on certain SuperH boards. The pin configuration used
to connect the eeprom to the ax88796 on these boards is the same as pointed
out by the ax88796 datasheet, so we can probably reuse this code for multiple
platforms in the future.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
This is a broken out version of the larger patch recently posted to netdev:
http://www.mail-archive.com/netdev@vger.kernel.org/msg47278.html
drivers/net/Kconfig | 7 ++++++
drivers/net/ax88796.c | 49 ++++++++++++++++++++++++++++++++++++++++++
include/linux/eeprom_93cx6.h | 3 +-
include/net/ax88796.h | 1
4 files changed, 59 insertions(+), 1 deletion(-)
--- 0001/drivers/net/Kconfig
+++ work/drivers/net/Kconfig 2007-09-27 19:32:10.000000000 +0900
@@ -225,6 +225,13 @@ config AX88796
AX88796 driver, using platform bus to provide
chip detection and resources
+config AX88796_93CX6
+ bool "ASIX AX88796 external 93CX6 eeprom support"
+ depends on AX88796
+ select EEPROM_93CX6
+ help
+ Select this if your platform comes with an external 93CX6 eeprom.
+
config MACE
tristate "MACE (Power Mac ethernet) support"
depends on PPC_PMAC && PPC32
--- 0001/drivers/net/ax88796.c
+++ work/drivers/net/ax88796.c 2007-09-27 19:17:44.000000000 +0900
@@ -24,6 +24,7 @@
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
+#include <linux/eeprom_93cx6.h>
#include <net/ax88796.h>
@@ -582,6 +583,37 @@ static const struct ethtool_ops ax_ethto
.get_link = ax_get_link,
};
+#ifdef CONFIG_AX88796_93CX6
+static void ax_eeprom_register_read(struct eeprom_93cx6 *eeprom)
+{
+ struct ei_device *ei_local = eeprom->data;
+ u8 reg = ei_inb(ei_local->mem + AX_MEMR);
+
+ eeprom->reg_data_in = reg & ...