summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Schmitz <schmitzmic@gmail.com>2013-04-06 13:26:40 +1300
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-04-16 21:20:14 +0200
commit1d87a8f2911fe6c22416f4a5dc5e0362f5bb9ef4 (patch)
tree423d2f6c42df815c3832bedc2b04bc0df159c2e6
parent736b24db32a806f79b43511e461321981bcfd5bf (diff)
downloadtalos-obmc-linux-1d87a8f2911fe6c22416f4a5dc5e0362f5bb9ef4.tar.gz
talos-obmc-linux-1d87a8f2911fe6c22416f4a5dc5e0362f5bb9ef4.zip
m68k/atari: EtherNEC - add platform device support
Add platform device for the Atari ROM port ethernet adapter, EtherNEC. This platform device will be used by the ne.c driver. [Geert] Conditionalize platform device data structures Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--arch/m68k/Kconfig.devices14
-rw-r--r--arch/m68k/atari/config.c54
2 files changed, 67 insertions, 1 deletions
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
index d50ecbf6d64f..d163991c5717 100644
--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -65,6 +65,20 @@ config ATARI_ETHERNAT
To compile the actual ethernet driver, choose Y or M for the SMC91X
option in the network device section; the module will be called smc91x.
+config ATARI_ETHERNEC
+ bool "Atari EtherNEC Ethernet support"
+ depends on ATARI_ROM_ISA
+ ---help---
+ Say Y to include support for the EtherNEC network adapter for the
+ ROM port. The driver works by polling instead of interrupts, so it
+ is quite slow.
+
+ This driver also suppports the ethernet part of the NetUSBee ROM
+ port combined Ethernet/USB adapter.
+
+ To compile the actual ethernet driver, choose Y or M in for the NE2000
+ option in the network device section; the module will be called ne.
+
endmenu
menu "Character devices"
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 49d1c750acb0..83ff931ad97a 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -659,7 +659,7 @@ static void atari_get_hardware_list(struct seq_file *m)
/*
* MSch: initial platform device support for Atari,
- * required for EtherNAT driver
+ * required for EtherNAT/EtherNEC drivers
*/
#ifdef CONFIG_ATARI_ETHERNAT
@@ -696,6 +696,43 @@ static struct platform_device *atari_ethernat_devices[] __initdata = {
};
#endif /* CONFIG_ATARI_ETHERNAT */
+#ifdef CONFIG_ATARI_ETHERNEC
+/*
+ * EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset,
+ * handled by ne.c driver
+ */
+
+#define ATARI_ETHERNEC_PHYS_ADDR 0xfffa0000
+#define ATARI_ETHERNEC_BASE 0x300
+#define ATARI_ETHERNEC_IRQ IRQ_MFP_TIMER1
+
+static struct resource rtl8019_resources[] = {
+ [0] = {
+ .name = "rtl8019-regs",
+ .start = ATARI_ETHERNEC_BASE,
+ .end = ATARI_ETHERNEC_BASE + 0x20 - 1,
+ .flags = IORESOURCE_IO,
+ },
+ [1] = {
+ .name = "rtl8019-irq",
+ .start = ATARI_ETHERNEC_IRQ,
+ .end = ATARI_ETHERNEC_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device rtl8019_device = {
+ .name = "ne",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(rtl8019_resources),
+ .resource = rtl8019_resources,
+};
+
+static struct platform_device *atari_ethernec_devices[] __initdata = {
+ &rtl8019_device
+};
+#endif /* CONFIG_ATARI_ETHERNEC */
+
int __init atari_platform_init(void)
{
int rv = 0;
@@ -715,6 +752,21 @@ int __init atari_platform_init(void)
}
#endif
+#ifdef CONFIG_ATARI_ETHERNEC
+ {
+ int error;
+ unsigned char *enec_virt;
+ enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf);
+ if (hwreg_present(enec_virt)) {
+ error = platform_add_devices(atari_ethernec_devices,
+ ARRAY_SIZE(atari_ethernec_devices));
+ if (error && !rv)
+ rv = error;
+ }
+ iounmap(enec_virt);
+ }
+#endif
+
return rv;
}
OpenPOWER on IntegriCloud