sh: add support for ax88796 and 93cx6 to highlander boards
Subsystems (3)
sh: add support for ax88796 and 93cx6 to highlander boards
This patch adds eeprom support to the ax88796 driver together with a platform device for highlander boards. The 93cx6 driver is hooked up to the ax88796 driver and is used to read out the mac address from the on board eeprom. The pin configuration used to connect the eeprom to the ax88796 is the same one as pointed out by the ax88796 datasheet. So it's likely that we can reuse this code for other boards as well.
---
arch/sh/boards/renesas/r7780rp/setup.c | 40 ++++++++++++++++++++++++++ drivers/net/Kconfig | 9 +++++ drivers/net/ax88796.c | 49 ++++++++++++++++++++++++++++++++ include/linux/eeprom_93cx6.h | 3 + include/net/ax88796.h | 1 5 files changed, 100 insertions(+), 2 deletions(-)
arch/sh/boards/renesas/r7780rp/setup.c +40 -0
@@ -21,6 +21,7 @@#include <asm/clock.h> #include <asm/heartbeat.h> #include <asm/io.h> +#include <net/ax88796.h> static struct resource r8a66597_usb_host_resources[] = { [0 ] = {
@@ -136,11 +137,50 @@ static struct platform_device heartbeat_ .resource = heartbeat_resources, }; +static struct ax_plat_data ax88796_platdata = { + .flags =AXFLG_HAS_93CX6 , + .wordlength =2 , + .dcr_val =0x1 , + .rcr_val =0x40 , +}; + +static struct resource ax88796_resources[] = { + { +#ifdef CONFIG_SH_R7780RP + .start =0xa5800400 , + .end =0xa5800400 + (0x20 *0x2 ) -1 , +#else + .start =0xa4100400 , + .end =0xa4100400 + (0x20 *0x2 ) -1 , +#endif + .flags =IORESOURCE_MEM , + }, + { + .start =IRQ_AX88796 , + .end =IRQ_AX88796 , + .flags =IORESOURCE_IRQ , + }, +}; + +static struct platform_device ax88796_device = { + .name ="ax88796" , + .id =0 , + + .dev = { + .platform_data = &ax88796_platdata, + }, + + .num_resources =ARRAY_SIZE (ax88796_resources), + .resource = ax88796_resources, +}; + +static struct platform_device *r7780rp_devices[]__initdata = { &r8a66597_usb_host_device, &m66592_usb_peripheral_device, &cf_ide_device, &heartbeat_device, + &ax88796_device, };static int __init r7780rp_devices_setup (void )
drivers/net/Kconfig +8 -1
@@ -218,13 +218,20 @@ source "drivers/net/arm/Kconfig" config AX88796 tristate "ASIX AX88796 NE2000 clone support" - depends on ARM || MIPS + depends on ARM || MIPS || SUPERH select CRC32 select MII help 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
drivers/net/ax88796.c +49 -0
67 lines not on this page · raw message
include/linux/eeprom_93cx6.h +2 -1
@@ -21,13 +21,14 @@/* Module: eeprom_93cx6 Abstract: EEPROM reader datastructures for 93cx6 chipsets. -Supported chipsets: 93c46 & 93c66. +Supported chipsets: 93c46, 93c56 and 93c66. */ /* * EEPROM operation defines. */ #define PCI_EEPROM_WIDTH_93C46 6 +#define PCI_EEPROM_WIDTH_93C56 8#define PCI_EEPROM_WIDTH_93C66 8#define PCI_EEPROM_WIDTH_OPCODE 3#define PCI_EEPROM_WRITE_OPCODE 0x05
include/net/ax88796.h +1 -0
@@ -14,6 +14,7 @@#define AXFLG_HAS_EEPROM (1<<0)#define AXFLG_MAC_FROMDEV (1<<1)/* device already has MAC */ +#define AXFLG_HAS_93CX6 (1<<2)/* use eeprom_93cx6 driver */ struct ax_plat_data {unsigned int flags;
Quoted 51 lines · Magnus Damm
arch/sh/boards/renesas/r7780rp/setup.c +38
-0@@ -21,6 +21,7 @@#include <asm/clock.h> #include <asm/heartbeat.h> #include <asm/io.h> +#include <net/ax88796.h> static struct resource r8a66597_usb_host_resources[] = { [0 ] = {@@ -136,11 +137,50 @@ static struct platform_device heartbeat_ .resource = heartbeat_resources, }; +static struct ax_plat_data ax88796_platdata = { + .flags =AXFLG_HAS_93CX6 , + .wordlength =2 , + .dcr_val =0x1 , + .rcr_val =0x40 , +}; + +static struct resource ax88796_resources[] = { + { +#ifdef CONFIG_SH_R7780RP + .start =0xa5800400 , + .end =0xa5800400 + (0x20 *0x2 ) -1 , +#else + .start =0xa4100400 , + .end =0xa4100400 + (0x20 *0x2 ) -1 , +#endif + .flags =IORESOURCE_MEM , + }, + { + .start =IRQ_AX88796 , + .end =IRQ_AX88796 , + .flags =IORESOURCE_IRQ , + }, +}; + +static struct platform_device ax88796_device = { + .name ="ax88796" , + .id =0 , + + .dev = { + .platform_data = &ax88796_platdata, + }, + + .num_resources =ARRAY_SIZE (ax88796_resources), + .resource = ax88796_resources, +}; +
arch/sh/boards/renesas/r7780rp/setup.c static struct platform_device heartbeat_ · line 186
Quoted 10 lines
arch/sh/boards/renesas/r7780rp/setup.c +2
-0+static struct platform_device *r7780rp_devices[]__initdata = { &r8a66597_usb_host_device, &m66592_usb_peripheral_device, &cf_ide_device, &heartbeat_device, + &ax88796_device, };static int __init r7780rp_devices_setup (void )
These bits I'll merge separately once the other patches have been applied.
Quoted 14 lines
drivers/net/Kconfig +1
-1@@ -218,13 +218,20 @@ source "drivers/net/arm/Kconfig" config AX88796 tristate "ASIX AX88796 NE2000 clone support" - depends on ARM || MIPS + depends on ARM || MIPS || SUPERH select CRC32 select MII help AX88796 driver, using platform bus to provide chip detection and resources
drivers/net/Kconfig source "drivers/net/arm/Kconfig" · line 237
Quoted 10 lines
drivers/net/Kconfig +7
-0+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
There are two different changes here, these should probably be split up and applied independently of each other, given that there's no real dependency between them.
Quoted 15 lines · Paul Mundt
Quoted 14 lines · Magnus Damm
drivers/net/Kconfig 2007-09-06 15:35:41.000000000 +0900 renamed from drivers/net/Kconfig +1
-1@@ -218,13 +218,20 @@ source "drivers/net/arm/Kconfig" config AX88796 tristate "ASIX AX88796 NE2000 clone support" - depends on ARM || MIPS + depends on ARM || MIPS || SUPERH select CRC32 select MII help AX88796 driver, using platform bus to provide chip detection and resources
Quoted 14 lines
drivers/net/Kconfig 2007-09-06 15:35:41.000000000 +0900 source "drivers/net/arm/Kconfig" · line 237
Quoted 10 lines
drivers/net/Kconfig 2007-09-06 15:35:41.000000000 +0900 renamed from drivers/net/Kconfig +7
-0+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 && PPC32There are two different changes here, these should probably be split up and applied independently of each other, given that there's no real dependency between them.
Sure. I hope to first get some feedback regarding the AX88796 specific parts of the patch, then i'll split it up and repost. Getting this one included in 2.6.24 would be nice if possible.
Thanks,
/ magnus