diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2011-08-12 14:12:33 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-10-24 18:34:23 -0400 |
commit | ce6bc92285cabd0df1f154a9ef5aeb937b6de57e (patch) | |
tree | fc2313d5a921624d512020ab5825861b6b3e1f8b /arch/mips/include/asm/mach-au1x00/au1000.h | |
parent | 694b8c35e95078bfe1cb1388bf0cf7942e32f009 (diff) |
MIPS: Alchemy: abstract USB block control register access
Alchemy chips have one or more registers which control access
to the usb blocks as well as PHY configuration. I don't want
the OHCI/EHCI glues to know about the different registers and bits;
new code hides the gory details of USB configuration from them.
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Cc: linux-usb@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Patchwork: https://patchwork.linux-mips.org/patch/2709/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
create mode 100644 drivers/usb/host/alchemy-common.c
Diffstat (limited to 'arch/mips/include/asm/mach-au1x00/au1000.h')
-rw-r--r-- | arch/mips/include/asm/mach-au1x00/au1000.h | 84 |
1 files changed, 17 insertions, 67 deletions
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h index f260ebed713b..3b0a1e774dc9 100644 --- a/arch/mips/include/asm/mach-au1x00/au1000.h +++ b/arch/mips/include/asm/mach-au1x00/au1000.h | |||
@@ -245,6 +245,15 @@ void alchemy_sleep_au1000(void); | |||
245 | void alchemy_sleep_au1550(void); | 245 | void alchemy_sleep_au1550(void); |
246 | void au_sleep(void); | 246 | void au_sleep(void); |
247 | 247 | ||
248 | /* USB: drivers/usb/host/alchemy-common.c */ | ||
249 | enum alchemy_usb_block { | ||
250 | ALCHEMY_USB_OHCI0, | ||
251 | ALCHEMY_USB_UDC0, | ||
252 | ALCHEMY_USB_EHCI0, | ||
253 | ALCHEMY_USB_OTG0, | ||
254 | }; | ||
255 | int alchemy_usb_control(int block, int enable); | ||
256 | |||
248 | 257 | ||
249 | /* SOC Interrupt numbers */ | 258 | /* SOC Interrupt numbers */ |
250 | 259 | ||
@@ -687,7 +696,8 @@ enum soc_au1200_ints { | |||
687 | */ | 696 | */ |
688 | 697 | ||
689 | #define AU1000_AC97_PHYS_ADDR 0x10000000 /* 012 */ | 698 | #define AU1000_AC97_PHYS_ADDR 0x10000000 /* 012 */ |
690 | #define AU1000_USBD_PHYS_ADDR 0x10200000 /* 0123 */ | 699 | #define AU1000_USB_OHCI_PHYS_ADDR 0x10100000 /* 012 */ |
700 | #define AU1000_USB_UDC_PHYS_ADDR 0x10200000 /* 0123 */ | ||
691 | #define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */ | 701 | #define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */ |
692 | #define AU1000_MAC0_PHYS_ADDR 0x10500000 /* 023 */ | 702 | #define AU1000_MAC0_PHYS_ADDR 0x10500000 /* 023 */ |
693 | #define AU1000_MAC1_PHYS_ADDR 0x10510000 /* 023 */ | 703 | #define AU1000_MAC1_PHYS_ADDR 0x10510000 /* 023 */ |
@@ -710,12 +720,17 @@ enum soc_au1200_ints { | |||
710 | #define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 34 */ | 720 | #define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 34 */ |
711 | #define AU1000_MACDMA0_PHYS_ADDR 0x14004000 /* 0123 */ | 721 | #define AU1000_MACDMA0_PHYS_ADDR 0x14004000 /* 0123 */ |
712 | #define AU1000_MACDMA1_PHYS_ADDR 0x14004200 /* 0123 */ | 722 | #define AU1000_MACDMA1_PHYS_ADDR 0x14004200 /* 0123 */ |
723 | #define AU1550_USB_OHCI_PHYS_ADDR 0x14020000 /* 3 */ | ||
724 | #define AU1200_USB_CTL_PHYS_ADDR 0x14020000 /* 4 */ | ||
725 | #define AU1200_USB_OTG_PHYS_ADDR 0x14020020 /* 4 */ | ||
726 | #define AU1200_USB_OHCI_PHYS_ADDR 0x14020100 /* 4 */ | ||
727 | #define AU1200_USB_EHCI_PHYS_ADDR 0x14020200 /* 4 */ | ||
728 | #define AU1200_USB_UDC_PHYS_ADDR 0x14022000 /* 4 */ | ||
713 | 729 | ||
714 | 730 | ||
715 | #ifdef CONFIG_SOC_AU1000 | 731 | #ifdef CONFIG_SOC_AU1000 |
716 | #define MEM_PHYS_ADDR 0x14000000 | 732 | #define MEM_PHYS_ADDR 0x14000000 |
717 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | 733 | #define STATIC_MEM_PHYS_ADDR 0x14001000 |
718 | #define USBH_PHYS_ADDR 0x10100000 | ||
719 | #define IRDA_PHYS_ADDR 0x10300000 | 734 | #define IRDA_PHYS_ADDR 0x10300000 |
720 | #define SSI0_PHYS_ADDR 0x11600000 | 735 | #define SSI0_PHYS_ADDR 0x11600000 |
721 | #define SSI1_PHYS_ADDR 0x11680000 | 736 | #define SSI1_PHYS_ADDR 0x11680000 |
@@ -729,7 +744,6 @@ enum soc_au1200_ints { | |||
729 | #ifdef CONFIG_SOC_AU1500 | 744 | #ifdef CONFIG_SOC_AU1500 |
730 | #define MEM_PHYS_ADDR 0x14000000 | 745 | #define MEM_PHYS_ADDR 0x14000000 |
731 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | 746 | #define STATIC_MEM_PHYS_ADDR 0x14001000 |
732 | #define USBH_PHYS_ADDR 0x10100000 | ||
733 | #define PCI_PHYS_ADDR 0x14005000 | 747 | #define PCI_PHYS_ADDR 0x14005000 |
734 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL | 748 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL |
735 | #define PCI_IO_PHYS_ADDR 0x500000000ULL | 749 | #define PCI_IO_PHYS_ADDR 0x500000000ULL |
@@ -745,7 +759,6 @@ enum soc_au1200_ints { | |||
745 | #ifdef CONFIG_SOC_AU1100 | 759 | #ifdef CONFIG_SOC_AU1100 |
746 | #define MEM_PHYS_ADDR 0x14000000 | 760 | #define MEM_PHYS_ADDR 0x14000000 |
747 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | 761 | #define STATIC_MEM_PHYS_ADDR 0x14001000 |
748 | #define USBH_PHYS_ADDR 0x10100000 | ||
749 | #define IRDA_PHYS_ADDR 0x10300000 | 762 | #define IRDA_PHYS_ADDR 0x10300000 |
750 | #define SSI0_PHYS_ADDR 0x11600000 | 763 | #define SSI0_PHYS_ADDR 0x11600000 |
751 | #define SSI1_PHYS_ADDR 0x11680000 | 764 | #define SSI1_PHYS_ADDR 0x11680000 |
@@ -760,7 +773,6 @@ enum soc_au1200_ints { | |||
760 | #ifdef CONFIG_SOC_AU1550 | 773 | #ifdef CONFIG_SOC_AU1550 |
761 | #define MEM_PHYS_ADDR 0x14000000 | 774 | #define MEM_PHYS_ADDR 0x14000000 |
762 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | 775 | #define STATIC_MEM_PHYS_ADDR 0x14001000 |
763 | #define USBH_PHYS_ADDR 0x14020000 | ||
764 | #define PCI_PHYS_ADDR 0x14005000 | 776 | #define PCI_PHYS_ADDR 0x14005000 |
765 | #define PE_PHYS_ADDR 0x14008000 | 777 | #define PE_PHYS_ADDR 0x14008000 |
766 | #define PSC0_PHYS_ADDR 0x11A00000 | 778 | #define PSC0_PHYS_ADDR 0x11A00000 |
@@ -783,8 +795,6 @@ enum soc_au1200_ints { | |||
783 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | 795 | #define STATIC_MEM_PHYS_ADDR 0x14001000 |
784 | #define AES_PHYS_ADDR 0x10300000 | 796 | #define AES_PHYS_ADDR 0x10300000 |
785 | #define CIM_PHYS_ADDR 0x14004000 | 797 | #define CIM_PHYS_ADDR 0x14004000 |
786 | #define USBM_PHYS_ADDR 0x14020000 | ||
787 | #define USBH_PHYS_ADDR 0x14020100 | ||
788 | #define PSC0_PHYS_ADDR 0x11A00000 | 798 | #define PSC0_PHYS_ADDR 0x11A00000 |
789 | #define PSC1_PHYS_ADDR 0x11B00000 | 799 | #define PSC1_PHYS_ADDR 0x11B00000 |
790 | #define LCD_PHYS_ADDR 0x15000000 | 800 | #define LCD_PHYS_ADDR 0x15000000 |
@@ -868,21 +878,6 @@ enum soc_au1200_ints { | |||
868 | #define USB_EHCI_LEN 0x100 | 878 | #define USB_EHCI_LEN 0x100 |
869 | #define USB_UDC_BASE 0x14022000 | 879 | #define USB_UDC_BASE 0x14022000 |
870 | #define USB_UDC_LEN 0x2000 | 880 | #define USB_UDC_LEN 0x2000 |
871 | #define USB_MSR_BASE 0xB4020000 | ||
872 | #define USB_MSR_MCFG 4 | ||
873 | #define USBMSRMCFG_OMEMEN 0 | ||
874 | #define USBMSRMCFG_OBMEN 1 | ||
875 | #define USBMSRMCFG_EMEMEN 2 | ||
876 | #define USBMSRMCFG_EBMEN 3 | ||
877 | #define USBMSRMCFG_DMEMEN 4 | ||
878 | #define USBMSRMCFG_DBMEN 5 | ||
879 | #define USBMSRMCFG_GMEMEN 6 | ||
880 | #define USBMSRMCFG_OHCCLKEN 16 | ||
881 | #define USBMSRMCFG_EHCCLKEN 17 | ||
882 | #define USBMSRMCFG_UDCCLKEN 18 | ||
883 | #define USBMSRMCFG_PHYPLLEN 19 | ||
884 | #define USBMSRMCFG_RDCOMB 30 | ||
885 | #define USBMSRMCFG_PFEN 31 | ||
886 | 881 | ||
887 | #define FOR_PLATFORM_C_USB_HOST_INT AU1200_USB_INT | 882 | #define FOR_PLATFORM_C_USB_HOST_INT AU1200_USB_INT |
888 | 883 | ||
@@ -963,51 +958,6 @@ enum soc_au1200_ints { | |||
963 | #define USB_OHCI_LEN 0x00100000 | 958 | #define USB_OHCI_LEN 0x00100000 |
964 | #endif | 959 | #endif |
965 | 960 | ||
966 | #ifndef CONFIG_SOC_AU1200 | ||
967 | |||
968 | /* USB Device Controller */ | ||
969 | #define USBD_EP0RD 0xB0200000 | ||
970 | #define USBD_EP0WR 0xB0200004 | ||
971 | #define USBD_EP2WR 0xB0200008 | ||
972 | #define USBD_EP3WR 0xB020000C | ||
973 | #define USBD_EP4RD 0xB0200010 | ||
974 | #define USBD_EP5RD 0xB0200014 | ||
975 | #define USBD_INTEN 0xB0200018 | ||
976 | #define USBD_INTSTAT 0xB020001C | ||
977 | # define USBDEV_INT_SOF (1 << 12) | ||
978 | # define USBDEV_INT_HF_BIT 6 | ||
979 | # define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT) | ||
980 | # define USBDEV_INT_CMPLT_BIT 0 | ||
981 | # define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT) | ||
982 | #define USBD_CONFIG 0xB0200020 | ||
983 | #define USBD_EP0CS 0xB0200024 | ||
984 | #define USBD_EP2CS 0xB0200028 | ||
985 | #define USBD_EP3CS 0xB020002C | ||
986 | #define USBD_EP4CS 0xB0200030 | ||
987 | #define USBD_EP5CS 0xB0200034 | ||
988 | # define USBDEV_CS_SU (1 << 14) | ||
989 | # define USBDEV_CS_NAK (1 << 13) | ||
990 | # define USBDEV_CS_ACK (1 << 12) | ||
991 | # define USBDEV_CS_BUSY (1 << 11) | ||
992 | # define USBDEV_CS_TSIZE_BIT 1 | ||
993 | # define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT) | ||
994 | # define USBDEV_CS_STALL (1 << 0) | ||
995 | #define USBD_EP0RDSTAT 0xB0200040 | ||
996 | #define USBD_EP0WRSTAT 0xB0200044 | ||
997 | #define USBD_EP2WRSTAT 0xB0200048 | ||
998 | #define USBD_EP3WRSTAT 0xB020004C | ||
999 | #define USBD_EP4RDSTAT 0xB0200050 | ||
1000 | #define USBD_EP5RDSTAT 0xB0200054 | ||
1001 | # define USBDEV_FSTAT_FLUSH (1 << 6) | ||
1002 | # define USBDEV_FSTAT_UF (1 << 5) | ||
1003 | # define USBDEV_FSTAT_OF (1 << 4) | ||
1004 | # define USBDEV_FSTAT_FCNT_BIT 0 | ||
1005 | # define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT) | ||
1006 | #define USBD_ENABLE 0xB0200058 | ||
1007 | # define USBDEV_ENABLE (1 << 1) | ||
1008 | # define USBDEV_CE (1 << 0) | ||
1009 | |||
1010 | #endif /* !CONFIG_SOC_AU1200 */ | ||
1011 | 961 | ||
1012 | /* Ethernet Controllers */ | 962 | /* Ethernet Controllers */ |
1013 | 963 | ||