diff options
author | Michael Schmitz <schmitzmic@gmail.com> | 2013-04-05 20:26:40 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-04-16 15:20:14 -0400 |
commit | 1d87a8f2911fe6c22416f4a5dc5e0362f5bb9ef4 (patch) | |
tree | 423d2f6c42df815c3832bedc2b04bc0df159c2e6 /arch/m68k | |
parent | 736b24db32a806f79b43511e461321981bcfd5bf (diff) |
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>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/Kconfig.devices | 14 | ||||
-rw-r--r-- | arch/m68k/atari/config.c | 54 |
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 | |||
65 | To compile the actual ethernet driver, choose Y or M for the SMC91X | 65 | To compile the actual ethernet driver, choose Y or M for the SMC91X |
66 | option in the network device section; the module will be called smc91x. | 66 | option in the network device section; the module will be called smc91x. |
67 | 67 | ||
68 | config ATARI_ETHERNEC | ||
69 | bool "Atari EtherNEC Ethernet support" | ||
70 | depends on ATARI_ROM_ISA | ||
71 | ---help--- | ||
72 | Say Y to include support for the EtherNEC network adapter for the | ||
73 | ROM port. The driver works by polling instead of interrupts, so it | ||
74 | is quite slow. | ||
75 | |||
76 | This driver also suppports the ethernet part of the NetUSBee ROM | ||
77 | port combined Ethernet/USB adapter. | ||
78 | |||
79 | To compile the actual ethernet driver, choose Y or M in for the NE2000 | ||
80 | option in the network device section; the module will be called ne. | ||
81 | |||
68 | endmenu | 82 | endmenu |
69 | 83 | ||
70 | menu "Character devices" | 84 | 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) | |||
659 | 659 | ||
660 | /* | 660 | /* |
661 | * MSch: initial platform device support for Atari, | 661 | * MSch: initial platform device support for Atari, |
662 | * required for EtherNAT driver | 662 | * required for EtherNAT/EtherNEC drivers |
663 | */ | 663 | */ |
664 | 664 | ||
665 | #ifdef CONFIG_ATARI_ETHERNAT | 665 | #ifdef CONFIG_ATARI_ETHERNAT |
@@ -696,6 +696,43 @@ static struct platform_device *atari_ethernat_devices[] __initdata = { | |||
696 | }; | 696 | }; |
697 | #endif /* CONFIG_ATARI_ETHERNAT */ | 697 | #endif /* CONFIG_ATARI_ETHERNAT */ |
698 | 698 | ||
699 | #ifdef CONFIG_ATARI_ETHERNEC | ||
700 | /* | ||
701 | * EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset, | ||
702 | * handled by ne.c driver | ||
703 | */ | ||
704 | |||
705 | #define ATARI_ETHERNEC_PHYS_ADDR 0xfffa0000 | ||
706 | #define ATARI_ETHERNEC_BASE 0x300 | ||
707 | #define ATARI_ETHERNEC_IRQ IRQ_MFP_TIMER1 | ||
708 | |||
709 | static struct resource rtl8019_resources[] = { | ||
710 | [0] = { | ||
711 | .name = "rtl8019-regs", | ||
712 | .start = ATARI_ETHERNEC_BASE, | ||
713 | .end = ATARI_ETHERNEC_BASE + 0x20 - 1, | ||
714 | .flags = IORESOURCE_IO, | ||
715 | }, | ||
716 | [1] = { | ||
717 | .name = "rtl8019-irq", | ||
718 | .start = ATARI_ETHERNEC_IRQ, | ||
719 | .end = ATARI_ETHERNEC_IRQ, | ||
720 | .flags = IORESOURCE_IRQ, | ||
721 | }, | ||
722 | }; | ||
723 | |||
724 | static struct platform_device rtl8019_device = { | ||
725 | .name = "ne", | ||
726 | .id = -1, | ||
727 | .num_resources = ARRAY_SIZE(rtl8019_resources), | ||
728 | .resource = rtl8019_resources, | ||
729 | }; | ||
730 | |||
731 | static struct platform_device *atari_ethernec_devices[] __initdata = { | ||
732 | &rtl8019_device | ||
733 | }; | ||
734 | #endif /* CONFIG_ATARI_ETHERNEC */ | ||
735 | |||
699 | int __init atari_platform_init(void) | 736 | int __init atari_platform_init(void) |
700 | { | 737 | { |
701 | int rv = 0; | 738 | int rv = 0; |
@@ -715,6 +752,21 @@ int __init atari_platform_init(void) | |||
715 | } | 752 | } |
716 | #endif | 753 | #endif |
717 | 754 | ||
755 | #ifdef CONFIG_ATARI_ETHERNEC | ||
756 | { | ||
757 | int error; | ||
758 | unsigned char *enec_virt; | ||
759 | enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf); | ||
760 | if (hwreg_present(enec_virt)) { | ||
761 | error = platform_add_devices(atari_ethernec_devices, | ||
762 | ARRAY_SIZE(atari_ethernec_devices)); | ||
763 | if (error && !rv) | ||
764 | rv = error; | ||
765 | } | ||
766 | iounmap(enec_virt); | ||
767 | } | ||
768 | #endif | ||
769 | |||
718 | return rv; | 770 | return rv; |
719 | } | 771 | } |
720 | 772 | ||