summaryrefslogtreecommitdiffstats
path: root/arch/m68k/atari
diff options
context:
space:
mode:
authorMichael Schmitz <schmitzmic@gmail.com>2013-04-06 13:26:39 +1300
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-04-16 21:18:29 +0200
commit736b24db32a806f79b43511e461321981bcfd5bf (patch)
tree1a8a84dedc03ca7366ddbe382ad88f2cb5cbb89d /arch/m68k/atari
parentb1ae432c5e3d682d86a88fc798a9ed2469c14a7a (diff)
downloadlinux-736b24db32a806f79b43511e461321981bcfd5bf.tar.bz2
m68k/atari: EtherNAT - platform device and IRQ support code
Add platform device and interrupt definitions necessary for the EtherNAT Ethernet/USB adapter for the Falcon extension port. EtherNAT interrupt numbers are 139/140 so the max. interrupt number for Atari has to be increased. [Geert] Conditionalize platform device data structures Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/atari')
-rw-r--r--arch/m68k/atari/config.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 037c11c99331..49d1c750acb0 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -31,6 +31,7 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/ioport.h>
+#include <linux/platform_device.h>
#include <linux/vt_kern.h>
#include <linux/module.h>
@@ -655,3 +656,66 @@ static void atari_get_hardware_list(struct seq_file *m)
ATARIHW_ANNOUNCE(VME, "VME Bus");
ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
}
+
+/*
+ * MSch: initial platform device support for Atari,
+ * required for EtherNAT driver
+ */
+
+#ifdef CONFIG_ATARI_ETHERNAT
+/*
+ * EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver
+ */
+
+#define ATARI_ETHERNAT_IRQ 140
+
+static struct resource smc91x_resources[] = {
+ [0] = {
+ .name = "smc91x-regs",
+ .start = ATARI_ETHERNAT_PHYS_ADDR,
+ .end = ATARI_ETHERNAT_PHYS_ADDR + 0xfffff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .name = "smc91x-irq",
+ .start = ATARI_ETHERNAT_IRQ,
+ .end = ATARI_ETHERNAT_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device smc91x_device = {
+ .name = "smc91x",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(smc91x_resources),
+ .resource = smc91x_resources,
+};
+
+static struct platform_device *atari_ethernat_devices[] __initdata = {
+ &smc91x_device
+};
+#endif /* CONFIG_ATARI_ETHERNAT */
+
+int __init atari_platform_init(void)
+{
+ int rv = 0;
+
+ if (!MACH_IS_ATARI)
+ return -ENODEV;
+
+#ifdef CONFIG_ATARI_ETHERNAT
+ {
+ unsigned char *enatc_virt;
+ enatc_virt = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0xf);
+ if (hwreg_present(enatc_virt)) {
+ rv = platform_add_devices(atari_ethernat_devices,
+ ARRAY_SIZE(atari_ethernat_devices));
+ }
+ iounmap(enatc_virt);
+ }
+#endif
+
+ return rv;
+}
+
+arch_initcall(atari_platform_init);