diff options
author | Michael Schmitz <schmitzmic@gmail.com> | 2013-04-05 20:26:45 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-04-16 15:35:41 -0400 |
commit | 01a18d168776f27309e49c983415de9851d6cb57 (patch) | |
tree | dbffd96e81a739a81cb62758fd9d55bd6e620153 | |
parent | c8ee038bd14881e3ceac1cafa551f260fd0acd29 (diff) |
m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
Add platform devices used by the isp116x-hcd driver for EtherNAT and
NetUSBee. Note that the NetUSBee also contains a RTL8019 Ethernet chip,
so its platform device is used to cover the EtherNEC case, too.
Register definitions thanks to David Galvez <dgalvez75@gmail.com>
[Geert] Conditionalize isp1160_delay() definition
Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r-- | arch/m68k/atari/config.c | 135 |
1 files changed, 129 insertions, 6 deletions
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 83ff931ad97a..fb2d0bd9b3ad 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/ioport.h> | 33 | #include <linux/ioport.h> |
34 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
35 | #include <linux/usb/isp116x.h> | ||
35 | #include <linux/vt_kern.h> | 36 | #include <linux/vt_kern.h> |
36 | #include <linux/module.h> | 37 | #include <linux/module.h> |
37 | 38 | ||
@@ -659,9 +660,16 @@ static void atari_get_hardware_list(struct seq_file *m) | |||
659 | 660 | ||
660 | /* | 661 | /* |
661 | * MSch: initial platform device support for Atari, | 662 | * MSch: initial platform device support for Atari, |
662 | * required for EtherNAT/EtherNEC drivers | 663 | * required for EtherNAT/EtherNEC/NetUSBee drivers |
663 | */ | 664 | */ |
664 | 665 | ||
666 | #if defined(CONFIG_ATARI_ETHERNAT) || defined(CONFIG_ATARI_ETHERNEC) | ||
667 | static void isp1160_delay(struct device *dev, int delay) | ||
668 | { | ||
669 | ndelay(delay); | ||
670 | } | ||
671 | #endif | ||
672 | |||
665 | #ifdef CONFIG_ATARI_ETHERNAT | 673 | #ifdef CONFIG_ATARI_ETHERNAT |
666 | /* | 674 | /* |
667 | * EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver | 675 | * EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver |
@@ -691,8 +699,65 @@ static struct platform_device smc91x_device = { | |||
691 | .resource = smc91x_resources, | 699 | .resource = smc91x_resources, |
692 | }; | 700 | }; |
693 | 701 | ||
702 | /* | ||
703 | * ISP 1160 - using the isp116x-hcd module | ||
704 | */ | ||
705 | |||
706 | #define ATARI_USB_PHYS_ADDR 0x80000012 | ||
707 | #define ATARI_USB_IRQ 139 | ||
708 | |||
709 | static struct resource isp1160_resources[] = { | ||
710 | [0] = { | ||
711 | .name = "isp1160-data", | ||
712 | .start = ATARI_USB_PHYS_ADDR, | ||
713 | .end = ATARI_USB_PHYS_ADDR + 0x1, | ||
714 | .flags = IORESOURCE_MEM, | ||
715 | }, | ||
716 | [1] = { | ||
717 | .name = "isp1160-regs", | ||
718 | .start = ATARI_USB_PHYS_ADDR + 0x4, | ||
719 | .end = ATARI_USB_PHYS_ADDR + 0x5, | ||
720 | .flags = IORESOURCE_MEM, | ||
721 | }, | ||
722 | [2] = { | ||
723 | .name = "isp1160-irq", | ||
724 | .start = ATARI_USB_IRQ, | ||
725 | .end = ATARI_USB_IRQ, | ||
726 | .flags = IORESOURCE_IRQ, | ||
727 | }, | ||
728 | }; | ||
729 | |||
730 | /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ | ||
731 | static struct isp116x_platform_data isp1160_platform_data = { | ||
732 | /* Enable internal resistors on downstream ports */ | ||
733 | .sel15Kres = 1, | ||
734 | /* On-chip overcurrent protection */ | ||
735 | .oc_enable = 1, | ||
736 | /* INT output polarity */ | ||
737 | .int_act_high = 1, | ||
738 | /* INT edge or level triggered */ | ||
739 | .int_edge_triggered = 0, | ||
740 | |||
741 | /* WAKEUP pin connected - NOT SUPPORTED */ | ||
742 | /* .remote_wakeup_connected = 0, */ | ||
743 | /* Wakeup by devices on usb bus enabled */ | ||
744 | .remote_wakeup_enable = 0, | ||
745 | .delay = isp1160_delay, | ||
746 | }; | ||
747 | |||
748 | static struct platform_device isp1160_device = { | ||
749 | .name = "isp116x-hcd", | ||
750 | .id = 0, | ||
751 | .num_resources = ARRAY_SIZE(isp1160_resources), | ||
752 | .resource = isp1160_resources, | ||
753 | .dev = { | ||
754 | .platform_data = &isp1160_platform_data, | ||
755 | }, | ||
756 | }; | ||
757 | |||
694 | static struct platform_device *atari_ethernat_devices[] __initdata = { | 758 | static struct platform_device *atari_ethernat_devices[] __initdata = { |
695 | &smc91x_device | 759 | &smc91x_device, |
760 | &isp1160_device | ||
696 | }; | 761 | }; |
697 | #endif /* CONFIG_ATARI_ETHERNAT */ | 762 | #endif /* CONFIG_ATARI_ETHERNAT */ |
698 | 763 | ||
@@ -728,8 +793,66 @@ static struct platform_device rtl8019_device = { | |||
728 | .resource = rtl8019_resources, | 793 | .resource = rtl8019_resources, |
729 | }; | 794 | }; |
730 | 795 | ||
731 | static struct platform_device *atari_ethernec_devices[] __initdata = { | 796 | /* |
732 | &rtl8019_device | 797 | * NetUSBee: ISP1160 USB host adapter via ROM-port adapter |
798 | */ | ||
799 | |||
800 | #define ATARI_NETUSBEE_PHYS_ADDR 0xfffa8000 | ||
801 | #define ATARI_NETUSBEE_BASE 0x340 | ||
802 | #define ATARI_NETUSBEE_IRQ IRQ_MFP_TIMER2 | ||
803 | |||
804 | static struct resource netusbee_resources[] = { | ||
805 | [0] = { | ||
806 | .name = "isp1160-data", | ||
807 | .start = ATARI_NETUSBEE_BASE, | ||
808 | .end = ATARI_NETUSBEE_BASE + 0x1, | ||
809 | .flags = IORESOURCE_MEM, | ||
810 | }, | ||
811 | [1] = { | ||
812 | .name = "isp1160-regs", | ||
813 | .start = ATARI_NETUSBEE_BASE + 0x20, | ||
814 | .end = ATARI_NETUSBEE_BASE + 0x21, | ||
815 | .flags = IORESOURCE_MEM, | ||
816 | }, | ||
817 | [2] = { | ||
818 | .name = "isp1160-irq", | ||
819 | .start = ATARI_NETUSBEE_IRQ, | ||
820 | .end = ATARI_NETUSBEE_IRQ, | ||
821 | .flags = IORESOURCE_IRQ, | ||
822 | }, | ||
823 | }; | ||
824 | |||
825 | /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ | ||
826 | static struct isp116x_platform_data netusbee_platform_data = { | ||
827 | /* Enable internal resistors on downstream ports */ | ||
828 | .sel15Kres = 1, | ||
829 | /* On-chip overcurrent protection */ | ||
830 | .oc_enable = 1, | ||
831 | /* INT output polarity */ | ||
832 | .int_act_high = 1, | ||
833 | /* INT edge or level triggered */ | ||
834 | .int_edge_triggered = 0, | ||
835 | |||
836 | /* WAKEUP pin connected - NOT SUPPORTED */ | ||
837 | /* .remote_wakeup_connected = 0, */ | ||
838 | /* Wakeup by devices on usb bus enabled */ | ||
839 | .remote_wakeup_enable = 0, | ||
840 | .delay = isp1160_delay, | ||
841 | }; | ||
842 | |||
843 | static struct platform_device netusbee_device = { | ||
844 | .name = "isp116x-hcd", | ||
845 | .id = 1, | ||
846 | .num_resources = ARRAY_SIZE(netusbee_resources), | ||
847 | .resource = netusbee_resources, | ||
848 | .dev = { | ||
849 | .platform_data = &netusbee_platform_data, | ||
850 | }, | ||
851 | }; | ||
852 | |||
853 | static struct platform_device *atari_netusbee_devices[] __initdata = { | ||
854 | &rtl8019_device, | ||
855 | &netusbee_device | ||
733 | }; | 856 | }; |
734 | #endif /* CONFIG_ATARI_ETHERNEC */ | 857 | #endif /* CONFIG_ATARI_ETHERNEC */ |
735 | 858 | ||
@@ -758,8 +881,8 @@ int __init atari_platform_init(void) | |||
758 | unsigned char *enec_virt; | 881 | unsigned char *enec_virt; |
759 | enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf); | 882 | enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf); |
760 | if (hwreg_present(enec_virt)) { | 883 | if (hwreg_present(enec_virt)) { |
761 | error = platform_add_devices(atari_ethernec_devices, | 884 | error = platform_add_devices(atari_netusbee_devices, |
762 | ARRAY_SIZE(atari_ethernec_devices)); | 885 | ARRAY_SIZE(atari_netusbee_devices)); |
763 | if (error && !rv) | 886 | if (error && !rv) |
764 | rv = error; | 887 | rv = error; |
765 | } | 888 | } |