Changeset 12433
- Timestamp:
- 07/03/09 16:48:37 (5 months ago)
- Files:
-
- src/linux/rt2880/linux-2.6.23/.config (modified) (21 diffs)
- src/linux/rt2880/linux-2.6.23/.config_rt3052 (modified) (6 diffs)
- src/linux/rt2880/linux-2.6.23/arch/mips/Makefile (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/arch/mips/kernel/module.c (modified) (10 diffs)
- src/linux/rt2880/linux-2.6.23/arch/mips/kernel/scall32-o32.S (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/arch/mips/kernel/vmlinux.lds.S (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/arch/mips/mm/c-r4k.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/arch/mips/rt2880/init.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/net/Makefile (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/net/usb/Kconfig (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/net/usb/Makefile (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/core/hub.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/Kconfig (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/Makefile (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dummy_audio.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_attr.c (modified) (31 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_attr.h (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_cil.c (modified) (142 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_cil.h (modified) (24 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_cil_intr.c (modified) (36 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_driver.c (modified) (65 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_driver.h (modified) (3 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_hcd.c (modified) (122 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_hcd.h (modified) (30 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_hcd_intr.c (modified) (100 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_hcd_queue.c (modified) (35 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_pcd.c (modified) (81 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_pcd.h (modified) (9 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_pcd_intr.c (modified) (108 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_regs.h (modified) (15 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/serial/Makefile (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/serial/option.c (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/serial/sierra.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/storage/Makefile (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/storage/transport.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/drivers/usb/storage/unusual_devs.h (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/drivers/usb/storage/usb.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/fs/squashfs/LzmaDecode.c (modified) (9 diffs)
- src/linux/rt2880/linux-2.6.23/fs/squashfs/LzmaDecode.h (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/include/asm-mips/module.h (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/include/asm-mips/string.h (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/include/linux/jhash.h (modified) (5 diffs)
- src/linux/rt2880/linux-2.6.23/kernel/module.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/mm/page_alloc.c (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/net/ipv6/inet6_connection_sock.c (modified) (2 diffs)
- src/linux/rt2880/linux-2.6.23/net/ipv6/netfilter/nf_conntrack_reasm.c (modified) (1 diff)
- src/linux/rt2880/linux-2.6.23/net/ipv6/reassembly.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/linux/rt2880/linux-2.6.23/.config
r11871 r12433 2 2 # Automatically generated make config: don't edit 3 3 # Linux kernel version: 2.6.23.17 4 # Mon Apr 6 12:18:0720094 # Fri Jul 3 16:08:30 2009 5 5 # 6 6 CONFIG_MIPS=y … … 9 9 # Machine selection 10 10 # 11 CONFIG_RALINK_RT 2880_MP=y12 CONFIG_RALINK_RT2880=y 11 CONFIG_RALINK_RT3052_MP2=y 12 # CONFIG_RALINK_RT2880 is not set 13 13 # CONFIG_RALINK_RT2883 is not set 14 # CONFIG_RALINK_RT3052 is not set 14 CONFIG_RALINK_RT3052=y 15 15 # CONFIG_MACH_ALCHEMY is not set 16 16 # CONFIG_BASLER_EXCITE is not set … … 48 48 # CONFIG_TOSHIBA_RBTX4938 is not set 49 49 # CONFIG_WR_PPMC is not set 50 CONFIG_RT2880_ASIC=y 51 CONFIG_FLASH_REMAP_NEED=y 50 CONFIG_RT3052_ASIC=y 52 51 # CONFIG_RT2880_DRAM_8M is not set 53 52 # CONFIG_RT2880_DRAM_16M is not set 54 53 CONFIG_RT2880_DRAM_32M=y 55 54 # CONFIG_RT2880_DRAM_64M is not set 56 # CONFIG_RT2880_FLASH_2M is not set 57 # CONFIG_RT2880_FLASH_4M is not set 58 CONFIG_RT2880_FLASH_8M=y 59 # CONFIG_RT2880_FLASH_16M is not set 55 # CONFIG_RT2880_FLASH_32M is not set 60 56 CONFIG_RALINK_RAM_SIZE=32 61 57 CONFIG_MTD_PHYSMAP_START=0xBF000000 62 CONFIG_MTD_PHYSMAP_LEN=0x 80000058 CONFIG_MTD_PHYSMAP_LEN=0x1000000 63 59 CONFIG_MTD_PHYSMAP_BUSWIDTH=2 64 60 # CONFIG_RT2880_ROOTFS_IN_RAM is not set … … 194 190 CONFIG_EMBEDDED=y 195 191 # CONFIG_SYSCTL_SYSCALL is not set 196 # CONFIG_KALLSYMS is not set 192 CONFIG_KALLSYMS=y 193 # CONFIG_KALLSYMS_EXTRA_PASS is not set 197 194 CONFIG_HOTPLUG=y 198 195 CONFIG_PRINTK=y … … 241 238 # Bus options (PCI, PCMCIA, EISA, ISA, TC) 242 239 # 243 CONFIG_HW_HAS_PCI=y244 # CONFIG_PCI is not set245 240 # CONFIG_ARCH_SUPPORTS_MSI is not set 246 241 CONFIG_MMU=y … … 261 256 # Power management options 262 257 # 263 # CONFIG_PM is not set 258 CONFIG_PM=y 259 # CONFIG_PM_LEGACY is not set 260 # CONFIG_PM_DEBUG is not set 264 261 CONFIG_SUSPEND_UP_POSSIBLE=y 262 # CONFIG_SUSPEND is not set 265 263 266 264 # … … 555 553 # CONFIG_MAC80211 is not set 556 554 # CONFIG_IEEE80211 is not set 557 # CONFIG_RFKILL is not set 555 CONFIG_RFKILL=y 556 # CONFIG_RFKILL_INPUT is not set 558 557 # CONFIG_NET_9P is not set 559 558 … … 597 596 CONFIG_MTD=y 598 597 # CONFIG_MTD_DEBUG is not set 599 CONFIG_MTD_CONCAT=y 598 # CONFIG_MTD_CONCAT is not set 600 599 CONFIG_MTD_PARTITIONS=y 601 600 # CONFIG_MTD_REDBOOT_PARTS is not set … … 638 637 # CONFIG_MTD_CFI_INTELEXT is not set 639 638 CONFIG_MTD_CFI_AMDSTD=y 640 CONFIG_MTD_CFI_STAA=y 641 # CONFIG_MTD_CFI_SSTSTD is not set 639 # CONFIG_MTD_CFI_STAA is not set 640 CONFIG_MTD_CFI_SSTSTD=y 642 641 CONFIG_MTD_CFI_UTIL=y 643 642 # CONFIG_MTD_RAM is not set … … 682 681 # CONFIG_BLK_DEV_LOOP is not set 683 682 # CONFIG_BLK_DEV_NBD is not set 683 # CONFIG_BLK_DEV_UB is not set 684 684 # CONFIG_BLK_DEV_RAM is not set 685 685 # CONFIG_CDROM_PKTCDVD is not set … … 692 692 # 693 693 # CONFIG_RAID_ATTRS is not set 694 # CONFIG_SCSI is not set 695 # CONFIG_SCSI_DMA is not set 694 CONFIG_SCSI=y 695 CONFIG_SCSI_DMA=y 696 CONFIG_SCSI_TGT=y 696 697 # CONFIG_SCSI_NETLINK is not set 698 CONFIG_SCSI_PROC_FS=y 699 700 # 701 # SCSI support type (disk, tape, CD-ROM) 702 # 703 CONFIG_BLK_DEV_SD=y 704 # CONFIG_CHR_DEV_ST is not set 705 # CONFIG_CHR_DEV_OSST is not set 706 CONFIG_BLK_DEV_SR=y 707 # CONFIG_BLK_DEV_SR_VENDOR is not set 708 CONFIG_CHR_DEV_SG=y 709 # CONFIG_CHR_DEV_SCH is not set 710 711 # 712 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs 713 # 714 # CONFIG_SCSI_MULTI_LUN is not set 715 # CONFIG_SCSI_CONSTANTS is not set 716 # CONFIG_SCSI_LOGGING is not set 717 # CONFIG_SCSI_SCAN_ASYNC is not set 718 CONFIG_SCSI_WAIT_SCAN=m 719 720 # 721 # SCSI Transports 722 # 723 # CONFIG_SCSI_SPI_ATTRS is not set 724 # CONFIG_SCSI_FC_ATTRS is not set 725 # CONFIG_SCSI_ISCSI_ATTRS is not set 726 # CONFIG_SCSI_SAS_LIBSAS is not set 727 # CONFIG_SCSI_LOWLEVEL is not set 697 728 # CONFIG_ATA is not set 698 729 # CONFIG_MD is not set … … 731 762 CONFIG_RAETH=y 732 763 CONFIG_RAETH_NAPI=y 733 CONFIG_RAETH_JUMBOFRAME=y 734 # CONFIG_RAETH_ROUTER is not set 735 # CONFIG_MAC_TO_MAC_MODE is not set 736 CONFIG_GIGAPHY=y 737 CONFIG_MAC_TO_GIGAPHY_MODE_ADDR=0x1F 764 # CONFIG_RAETH_QOS is not set 765 CONFIG_RT_3052_ESW=y 766 CONFIG_LAN_WAN_SUPPORT=y 767 CONFIG_WAN_AT_P4=y 768 # CONFIG_WAN_AT_P0 is not set 769 # CONFIG_ESW_DOUBLE_VLAN_TAG is not set 770 # CONFIG_RAETH_RT3052_P5 is not set 738 771 CONFIG_NET_ETHERNET=y 739 772 CONFIG_MII=y … … 749 782 CONFIG_WLAN_80211=y 750 783 # CONFIG_LIBERTAS is not set 784 # CONFIG_USB_ZD1201 is not set 751 785 # CONFIG_HOSTAP is not set 752 786 CONFIG_RT2860V2_AP=m 753 # CONFIG_RT2860V2_AP_2850 is not set 787 # CONFIG_RALINK_RT3050AP_1T1R is not set 788 CONFIG_RALINK_RT3052AP_2T2R=y 754 789 CONFIG_RT2860V2_AP_LED=y 755 790 CONFIG_RT2860V2_AP_WSC=y … … 758 793 CONFIG_RT2860V2_AP_MBSS=y 759 794 CONFIG_RT2860V2_AP_APCLI=y 760 CONFIG_RT2860V2_AP_IGMP_SNOOP=y 795 # CONFIG_RT2860V2_AP_IGMP_SNOOP is not set 761 796 # CONFIG_RT2860V2_AP_NETIF_BLOCK is not set 762 797 # CONFIG_RT2860V2_AP_DFS is not set … … 768 803 # CONFIG_RT2860V2_AP_MEMORY_OPTIMIZATION is not set 769 804 CONFIG_RT2860V2_STA=m 770 # CONFIG_RT2860V2_STA_2850 is not set 805 # CONFIG_RALINK_RT3050STA_1T1R is not set 806 CONFIG_RALINK_RT3052STA_2T2R=y 771 807 CONFIG_RT2860V2_STA_LED=y 772 808 CONFIG_RT2860V2_STA_WPA_SUPPLICANT=y … … 776 812 CONFIG_RT2860V2_STA_DLS=y 777 813 # CONFIG_RT2860V2_STA_MESH is not set 814 815 # 816 # USB Network Adapters 817 # 818 # CONFIG_USB_CATC is not set 819 # CONFIG_USB_KAWETH is not set 820 # CONFIG_USB_PEGASUS is not set 821 # CONFIG_USB_RTL8150 is not set 822 # CONFIG_USB_USBNET_MII is not set 823 # CONFIG_USB_USBNET is not set 824 CONFIG_USB_HSO=m 778 825 # CONFIG_WAN is not set 779 826 CONFIG_PPP=y … … 838 885 # CONFIG_RALINK_PCM is not set 839 886 # CONFIG_RALINK_I2S is not set 840 # CONFIG_VT is not set 841 # CONFIG_SERIAL_NONSTANDARD is not set 887 CONFIG_VT=y 888 CONFIG_VT_CONSOLE=y 889 CONFIG_HW_CONSOLE=y 890 # CONFIG_VT_HW_CONSOLE_BINDING is not set 891 CONFIG_SERIAL_NONSTANDARD=y 842 892 # CONFIG_MOXA is not set 893 # CONFIG_MOXA_SMARTIO is not set 894 CONFIG_N_HDLC=m 895 # CONFIG_RISCOM8 is not set 896 # CONFIG_SPECIALIX is not set 897 # CONFIG_RIO is not set 898 # CONFIG_STALDRV is not set 843 899 844 900 # … … 871 927 # 872 928 # CONFIG_SOFT_WATCHDOG is not set 929 930 # 931 # USB-based Watchdog Cards 932 # 933 # CONFIG_USBPCWATCHDOG is not set 873 934 # CONFIG_HW_RANDOM is not set 874 935 # CONFIG_RTC is not set … … 913 974 914 975 # 976 # Console display driver support 977 # 978 CONFIG_VGA_CONSOLE=y 979 # CONFIG_VGACON_SOFT_SCROLLBACK is not set 980 CONFIG_DUMMY_CONSOLE=y 981 982 # 915 983 # Sound 916 984 # 917 985 # CONFIG_SOUND is not set 918 986 # CONFIG_HID_SUPPORT is not set 919 # CONFIG_USB_SUPPORT is not set 987 CONFIG_USB_SUPPORT=y 988 # CONFIG_USB_ARCH_HAS_OHCI is not set 989 # CONFIG_USB_ARCH_HAS_EHCI is not set 990 CONFIG_USB=y 991 # CONFIG_USB_DEBUG is not set 992 993 # 994 # Miscellaneous USB options 995 # 996 CONFIG_USB_DEVICEFS=y 997 CONFIG_USB_DEVICE_CLASS=y 998 CONFIG_USB_DYNAMIC_MINORS=y 999 CONFIG_USB_SUSPEND=y 1000 # CONFIG_USB_PERSIST is not set 1001 # CONFIG_USB_OTG is not set 1002 1003 # 1004 # USB Host Controller Drivers 1005 # 1006 # CONFIG_USB_ISP116X_HCD is not set 1007 # CONFIG_USB_SL811_HCD is not set 1008 # CONFIG_USB_R8A66597_HCD is not set 1009 1010 # 1011 # USB Device Class drivers 1012 # 1013 # CONFIG_USB_ACM is not set 1014 CONFIG_USB_PRINTER=m 1015 1016 # 1017 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1018 # 1019 1020 # 1021 # may also be needed; see USB_STORAGE Help for more information 1022 # 1023 CONFIG_USB_STORAGE=y 1024 # CONFIG_USB_STORAGE_DEBUG is not set 1025 # CONFIG_USB_STORAGE_DATAFAB is not set 1026 # CONFIG_USB_STORAGE_FREECOM is not set 1027 # CONFIG_USB_STORAGE_DPCM is not set 1028 # CONFIG_USB_STORAGE_USBAT is not set 1029 # CONFIG_USB_STORAGE_SDDR09 is not set 1030 # CONFIG_USB_STORAGE_SDDR55 is not set 1031 # CONFIG_USB_STORAGE_JUMPSHOT is not set 1032 # CONFIG_USB_STORAGE_ALAUDA is not set 1033 # CONFIG_USB_STORAGE_KARMA is not set 1034 CONFIG_USB_LIBUSUAL=y 1035 1036 # 1037 # USB Imaging devices 1038 # 1039 # CONFIG_USB_MDC800 is not set 1040 # CONFIG_USB_MICROTEK is not set 1041 # CONFIG_USB_MON is not set 1042 1043 # 1044 # USB port drivers 1045 # 1046 1047 # 1048 # USB Serial Converter support 1049 # 1050 CONFIG_USB_SERIAL=y 1051 # CONFIG_USB_SERIAL_CONSOLE is not set 1052 # CONFIG_USB_SERIAL_GENERIC is not set 1053 # CONFIG_USB_SERIAL_AIRCABLE is not set 1054 # CONFIG_USB_SERIAL_AIRPRIME is not set 1055 # CONFIG_USB_SERIAL_ARK3116 is not set 1056 # CONFIG_USB_SERIAL_BELKIN is not set 1057 # CONFIG_USB_SERIAL_WHITEHEAT is not set 1058 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 1059 # CONFIG_USB_SERIAL_CP2101 is not set 1060 # CONFIG_USB_SERIAL_CYPRESS_M8 is not set 1061 # CONFIG_USB_SERIAL_EMPEG is not set 1062 # CONFIG_USB_SERIAL_FTDI_SIO is not set 1063 # CONFIG_USB_SERIAL_FUNSOFT is not set 1064 # CONFIG_USB_SERIAL_VISOR is not set 1065 # CONFIG_USB_SERIAL_IPAQ is not set 1066 # CONFIG_USB_SERIAL_IR is not set 1067 # CONFIG_USB_SERIAL_EDGEPORT is not set 1068 # CONFIG_USB_SERIAL_EDGEPORT_TI is not set 1069 # CONFIG_USB_SERIAL_GARMIN is not set 1070 # CONFIG_USB_SERIAL_IPW is not set 1071 # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set 1072 # CONFIG_USB_SERIAL_KEYSPAN is not set 1073 # CONFIG_USB_SERIAL_KLSI is not set 1074 # CONFIG_USB_SERIAL_KOBIL_SCT is not set 1075 # CONFIG_USB_SERIAL_MCT_U232 is not set 1076 # CONFIG_USB_SERIAL_MOS7720 is not set 1077 # CONFIG_USB_SERIAL_MOS7840 is not set 1078 # CONFIG_USB_SERIAL_NAVMAN is not set 1079 # CONFIG_USB_SERIAL_PL2303 is not set 1080 # CONFIG_USB_SERIAL_OTI6858 is not set 1081 # CONFIG_USB_SERIAL_HP4X is not set 1082 # CONFIG_USB_SERIAL_SAFE is not set 1083 CONFIG_USB_SERIAL_SIERRAWIRELESS=m 1084 # CONFIG_USB_SERIAL_TI is not set 1085 # CONFIG_USB_SERIAL_CYBERJACK is not set 1086 # CONFIG_USB_SERIAL_XIRCOM is not set 1087 CONFIG_USB_SERIAL_OPTION=m 1088 # CONFIG_USB_SERIAL_OMNINET is not set 1089 # CONFIG_USB_SERIAL_DEBUG is not set 1090 1091 # 1092 # USB Miscellaneous drivers 1093 # 1094 # CONFIG_USB_EMI62 is not set 1095 # CONFIG_USB_EMI26 is not set 1096 # CONFIG_USB_ADUTUX is not set 1097 # CONFIG_USB_AUERSWALD is not set 1098 # CONFIG_USB_RIO500 is not set 1099 # CONFIG_USB_LEGOTOWER is not set 1100 # CONFIG_USB_LCD is not set 1101 # CONFIG_USB_BERRY_CHARGE is not set 1102 # CONFIG_USB_LED is not set 1103 # CONFIG_USB_CYPRESS_CY7C63 is not set 1104 # CONFIG_USB_CYTHERM is not set 1105 # CONFIG_USB_PHIDGET is not set 1106 # CONFIG_USB_IDMOUSE is not set 1107 # CONFIG_USB_FTDI_ELAN is not set 1108 # CONFIG_USB_APPLEDISPLAY is not set 1109 # CONFIG_USB_LD is not set 1110 # CONFIG_USB_TRANCEVIBRATOR is not set 1111 # CONFIG_USB_IOWARRIOR is not set 1112 # CONFIG_USB_TEST is not set 1113 1114 # 1115 # USB DSL modem support 1116 # 1117 1118 # 1119 # USB Gadget Support 1120 # 1121 # CONFIG_USB_GADGET is not set 1122 CONFIG_DWC_OTG=y 1123 CONFIG_DWC_OTG_HOST_ONLY=y 1124 # CONFIG_DWC_OTG_DEVICE_ONLY is not set 1125 # CONFIG_DWC_OTG_DEBUG is not set 1126 1127 # 1128 # USB Network Adapters 1129 # 920 1130 # CONFIG_MMC is not set 921 1131 # CONFIG_NEW_LEDS is not set … … 1018 1228 # CONFIG_NFSD is not set 1019 1229 # CONFIG_SMB_FS is not set 1020 # CONFIG_CIFS is not set 1230 CONFIG_CIFS=m 1231 # CONFIG_CIFS_STATS is not set 1232 CONFIG_CIFS_WEAK_PW_HASH=y 1233 # CONFIG_CIFS_XATTR is not set 1234 # CONFIG_CIFS_DEBUG2 is not set 1235 # CONFIG_CIFS_EXPERIMENTAL is not set 1021 1236 # CONFIG_NCP_FS is not set 1022 1237 # CONFIG_CODA_FS is not set … … 1032 1247 # Native Language Support 1033 1248 # 1034 # CONFIG_NLS is not set 1249 CONFIG_NLS=m 1250 CONFIG_NLS_DEFAULT="iso8859-1" 1251 # CONFIG_NLS_CODEPAGE_437 is not set 1252 # CONFIG_NLS_CODEPAGE_737 is not set 1253 # CONFIG_NLS_CODEPAGE_775 is not set 1254 # CONFIG_NLS_CODEPAGE_850 is not set 1255 # CONFIG_NLS_CODEPAGE_852 is not set 1256 # CONFIG_NLS_CODEPAGE_855 is not set 1257 # CONFIG_NLS_CODEPAGE_857 is not set 1258 # CONFIG_NLS_CODEPAGE_860 is not set 1259 # CONFIG_NLS_CODEPAGE_861 is not set 1260 # CONFIG_NLS_CODEPAGE_862 is not set 1261 # CONFIG_NLS_CODEPAGE_863 is not set 1262 # CONFIG_NLS_CODEPAGE_864 is not set 1263 # CONFIG_NLS_CODEPAGE_865 is not set 1264 # CONFIG_NLS_CODEPAGE_866 is not set 1265 # CONFIG_NLS_CODEPAGE_869 is not set 1266 # CONFIG_NLS_CODEPAGE_936 is not set 1267 # CONFIG_NLS_CODEPAGE_950 is not set 1268 # CONFIG_NLS_CODEPAGE_932 is not set 1269 # CONFIG_NLS_CODEPAGE_949 is not set 1270 # CONFIG_NLS_CODEPAGE_874 is not set 1271 # CONFIG_NLS_ISO8859_8 is not set 1272 # CONFIG_NLS_CODEPAGE_1250 is not set 1273 # CONFIG_NLS_CODEPAGE_1251 is not set 1274 # CONFIG_NLS_ASCII is not set 1275 # CONFIG_NLS_ISO8859_1 is not set 1276 # CONFIG_NLS_ISO8859_2 is not set 1277 # CONFIG_NLS_ISO8859_3 is not set 1278 # CONFIG_NLS_ISO8859_4 is not set 1279 # CONFIG_NLS_ISO8859_5 is not set 1280 # CONFIG_NLS_ISO8859_6 is not set 1281 # CONFIG_NLS_ISO8859_7 is not set 1282 # CONFIG_NLS_ISO8859_9 is not set 1283 # CONFIG_NLS_ISO8859_13 is not set 1284 # CONFIG_NLS_ISO8859_14 is not set 1285 # CONFIG_NLS_ISO8859_15 is not set 1286 # CONFIG_NLS_KOI8_R is not set 1287 # CONFIG_NLS_KOI8_U is not set 1288 # CONFIG_NLS_UTF8 is not set 1035 1289 1036 1290 # src/linux/rt2880/linux-2.6.23/.config_rt3052
r11871 r12433 2 2 # Automatically generated make config: don't edit 3 3 # Linux kernel version: 2.6.23.17 4 # Mon Jan 5 14:47:4120094 # Tue May 19 13:55:15 2009 5 5 # 6 6 CONFIG_MIPS=y … … 415 415 CONFIG_IP_NF_TARGET_REJECT=y 416 416 CONFIG_IP_NF_TARGET_IMQ=m 417 CONFIG_IP_NF_TARGET_ROUTE=y 417 418 CONFIG_IP_NF_TARGET_LOG=y 418 419 CONFIG_IP_NF_TARGET_ULOG=y … … 559 560 # Ralink Common Flash Driver 560 561 # 561 CONFIG_RALINK_FLASH_API=y 562 # CONFIG_RALINK_FLASH_API is not set 562 563 563 564 # 564 565 # 2MB Flash 565 566 # 566 # CONFIG_FLASH_EN29LV160 is not set567 # CONFIG_FLASH_MX29LV160 is not set568 # CONFIG_FLASH_S29AL016X is not set569 # CONFIG_FLASH_K8D3X16U is not set570 567 571 568 # 572 569 # 4MB Flash 573 570 # 574 CONFIG_FLASH_MX29LV320=y575 # CONFIG_FLASH_EN29LV320 is not set576 # CONFIG_FLASH_S29AL032X is not set577 # CONFIG_FLASH_S29GL032N is not set578 # CONFIG_FLASH_F49L320 is not set579 571 580 572 # 581 573 # 8MB Flash 582 574 # 583 # CONFIG_FLASH_MX29LV640 is not set584 # CONFIG_FLASH_S29GL064N is not set585 # CONFIG_FLASH_ST_M29W640 is not set586 575 587 576 # 588 577 # 16MB Flash 589 578 # 590 # CONFIG_FLASH_MX29LV128 is not set591 579 592 580 # 593 581 # 32MB Flash 594 582 # 595 # CONFIG_FLASH_S29GL256 is not set596 583 597 584 # … … 657 644 # 658 645 CONFIG_MTD_RALINK=y 646 # CONFIG_MTD_ESR6650 is not set 659 647 # CONFIG_MTD_COMPLEX_MAPPINGS is not set 660 648 # CONFIG_MTD_PHYSMAP is not set … … 738 726 CONFIG_RAETH=y 739 727 CONFIG_RAETH_NAPI=y 740 CONFIG_RAETH_CHECKSUM_OFFLOAD=y741 728 # CONFIG_RAETH_QOS is not set 742 # CONFIG_RAETH_ROUTER is not set743 # CONFIG_MAC_TO_MAC_MODE is not set744 729 CONFIG_RT_3052_ESW=y 745 # CONFIG_GIGAPHY is not set746 730 CONFIG_LAN_WAN_SUPPORT=y 747 731 # CONFIG_WAN_AT_P4 is not set … … 1141 1125 CONFIG_HAS_IOPORT=y 1142 1126 CONFIG_HAS_DMA=y 1143 CONFIG_IP_NF_TARGET_ROUTE=y1144 # CONFIG_MTD_ESR6650 is not setsrc/linux/rt2880/linux-2.6.23/arch/mips/Makefile
r10741 r12433 84 84 cflags-y += -msoft-float 85 85 LDFLAGS_vmlinux += -G 0 -static -n -nostdlib 86 MODFLAGS += -m long-calls86 MODFLAGS += -mno-long-calls 87 87 88 88 cflags-y += -ffreestanding src/linux/rt2880/linux-2.6.23/arch/mips/kernel/module.c
r10741 r12433 30 30 #include <linux/module.h> 31 31 #include <linux/spinlock.h> 32 #include <linux/mm.h> 32 33 #include <asm/pgtable.h> /* MODULE_START */ 33 34 … … 43 44 static DEFINE_SPINLOCK(dbe_lock); 44 45 46 static void *alloc_phys(unsigned long size) 47 { 48 unsigned order; 49 struct page *page; 50 struct page *p; 51 52 size = PAGE_ALIGN(size); 53 order = get_order(size); 54 55 page = alloc_pages( 56 GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN | __GFP_THISNODE, 57 order); 58 if (!page) 59 return 0; 60 61 split_page(page, order); 62 63 for (p = page + (size >> PAGE_SHIFT); p < page + (1 << order); ++p) 64 __free_page(p); 65 66 return page_address(page); 67 } 68 69 static void free_phys(void *ptr, unsigned long size) 70 { 71 struct page *page; 72 struct page *end; 73 74 page = virt_to_page(ptr); 75 end = page + (PAGE_ALIGN(size) >> PAGE_SHIFT); 76 77 for (; page < end; ++page) 78 __free_pages(page, 0); 79 } 80 45 81 void *module_alloc(unsigned long size) 46 82 { … … 58 94 return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); 59 95 #else 96 unsigned addr; 97 void *ptr; 98 99 size = PAGE_ALIGN(size); 60 100 if (size == 0) 61 101 return NULL; 62 return vmalloc(size); 102 103 ptr = alloc_phys(size); 104 if (ptr) 105 return ptr; 106 107 /* try to allocate contiguos chunk of memory not spanning 256Mb 108 range, so all jump instructions can work */ 109 addr = VMALLOC_START; 110 while (addr < VMALLOC_END) { 111 unsigned end = ALIGN(addr + 1, 1u << 28); 112 113 if (addr + size <= end) { 114 struct vm_struct *area 115 = __get_vm_area(size, VM_ALLOC, addr, end); 116 117 if (area) 118 return __vmalloc_area( 119 area, GFP_KERNEL, PAGE_KERNEL); 120 } 121 addr = end; 122 } 123 return NULL; 63 124 #endif 125 } 126 127 static inline int is_phys(void *ptr) 128 { 129 unsigned addr = (unsigned) ptr; 130 return addr && (addr < VMALLOC_START || addr > VMALLOC_END); 64 131 } 65 132 … … 67 134 void module_free(struct module *mod, void *module_region) 68 135 { 136 if (is_phys(module_region)) { 137 if (mod->module_init == module_region) 138 free_phys(module_region, mod->init_size); 139 else if (mod->module_core == module_region) 140 free_phys(module_region, mod->core_size); 141 else 142 BUG(); 143 return; 144 } 145 69 146 vfree(module_region); 70 147 /* FIXME: If module_region == mod->init_region, trim exception … … 78 155 } 79 156 157 /* Get the potential trampolines size required of the init and 158 non-init sections */ 159 static unsigned get_plt_size(const Elf32_Ehdr *hdr, 160 const Elf32_Shdr *sechdrs, 161 const char *secstrings, 162 unsigned symindex, 163 int is_init) 164 { 165 unsigned long ret = 0; 166 unsigned i, j; 167 Elf_Sym *syms; 168 169 /* Everything marked ALLOC (this includes the exported symbols) */ 170 for (i = 1; i < hdr->e_shnum; ++i) { 171 unsigned int info = sechdrs[i].sh_info; 172 173 if (sechdrs[i].sh_type != SHT_REL 174 && sechdrs[i].sh_type != SHT_RELA) 175 continue; 176 177 /* Not a valid relocation section? */ 178 if (info >= hdr->e_shnum) 179 continue; 180 181 /* Don't bother with non-allocated sections */ 182 if (!(sechdrs[info].sh_flags & SHF_ALLOC)) 183 continue; 184 185 /* If it's called *.init*, and we're not init, we're 186 not interested */ 187 if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != 0) 188 != is_init) 189 continue; 190 191 syms = (Elf_Sym *) sechdrs[symindex].sh_addr; 192 if (sechdrs[i].sh_type == SHT_REL) { 193 Elf_Mips_Rel *rel = (void *) sechdrs[i].sh_addr; 194 unsigned size = sechdrs[i].sh_size / sizeof(*rel); 195 196 for (j = 0; j < size; ++j) { 197 Elf_Sym *sym; 198 199 if (ELF_MIPS_R_TYPE(rel[j]) != R_MIPS_26) 200 continue; 201 sym = syms + ELF_MIPS_R_SYM(rel[j]); 202 if (!is_init && sym->st_shndx != SHN_UNDEF) 203 continue; 204 205 ret += sizeof(unsigned[4]); 206 } 207 } else { 208 Elf_Mips_Rela *rela = (void *) sechdrs[i].sh_addr; 209 unsigned size = sechdrs[i].sh_size / sizeof(*rela); 210 211 for (j = 0; j < size; ++j) { 212 Elf_Sym *sym; 213 214 if (ELF_MIPS_R_TYPE(rela[j]) != R_MIPS_26) 215 continue; 216 sym = syms + ELF_MIPS_R_SYM(rela[j]); 217 if (!is_init && sym->st_shndx != SHN_UNDEF) 218 continue; 219 220 ret += sizeof(unsigned[4]); 221 } 222 } 223 224 } 225 226 return ret; 227 } 228 229 int module_relayout(Elf32_Ehdr *hdr, 230 Elf32_Shdr *sechdrs, 231 char *secstrings, 232 unsigned symindex, 233 struct module *me) 234 { 235 unsigned core_plt_size = get_plt_size( 236 hdr, sechdrs, secstrings, symindex, 0); 237 unsigned init_plt_size = get_plt_size( 238 hdr, sechdrs, secstrings, symindex, 1); 239 240 if (core_plt_size > 0) 241 me->core_size = PAGE_ALIGN(me->core_size); 242 me->arch.core_plt_offset = me->core_size; 243 me->core_size = me->core_size + core_plt_size; 244 245 me->arch.init_plt_offset = me->init_size; 246 me->init_size = me->init_size + init_plt_size; 247 248 return 0; 249 } 250 80 251 static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v) 81 252 { … … 94 265 *location = v; 95 266 267 return 0; 268 } 269 270 static Elf_Addr add_plt_entry_to(unsigned *plt_offset, 271 void *start, unsigned size, Elf_Addr v) 272 { 273 unsigned *tramp = start + *plt_offset; 274 if (*plt_offset == size) return 0; 275 276 *plt_offset += sizeof(unsigned[4]); 277 278 /* adjust carry for addiu */ 279 if (v & 0x00008000) 280 v += 0x10000; 281 282 tramp[0] = 0x3c190000 | (v >> 16); /* lui t9, hi16 */ 283 tramp[1] = 0x27390000 | (v & 0xffff); /* addiu t9, t9, lo16 */ 284 tramp[2] = 0x03200008; /* jr t9 */ 285 tramp[3] = 0x00000000; /* nop */ 286 287 return (Elf_Addr) tramp; 288 } 289 290 static Elf_Addr add_plt_entry(struct module *me, void *location, Elf_Addr v) 291 { 292 if (location >= me->module_core 293 && location < me->module_core + me->core_size) { 294 return add_plt_entry_to(&me->arch.core_plt_offset, 295 me->module_core, me->core_size, v); 296 } else if (location > me->module_init 297 && location < me->module_init + me->init_size) { 298 return add_plt_entry_to(&me->arch.init_plt_offset, 299 me->module_init, me->init_size, v); 300 } else { 301 printk(KERN_ERR "module %s: " 302 "relocation to unknown segment %u\n", 303 me->name, v); 304 } 96 305 return 0; 97 306 } … … 105 314 106 315 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) { 316 v = add_plt_entry(me, location, 317 v + ((*location & 0x03ffffff) << 2)); 318 if (v == 0) { 107 319 printk(KERN_ERR 108 320 "module %s: relocation overflow\n", … … 110 322 return -ENOEXEC; 111 323 } 324 *location = (*location & ~0x03ffffff) | 325 ((v >> 2) & 0x03ffffff); 326 return 0; 327 } 112 328 113 329 *location = (*location & ~0x03ffffff) | … … 125 341 126 342 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) { 343 v = add_plt_entry(me, location, v); 344 if (v == 0) { 127 345 printk(KERN_ERR 128 346 "module %s: relocation overflow\n", 129 347 me->name); 130 348 return -ENOEXEC; 349 } 131 350 } 132 351 … … 400 619 spin_unlock_irq(&dbe_lock); 401 620 } 621 622 if (me->arch.core_plt_offset < me->core_size 623 && PAGE_ALIGN(me->arch.core_plt_offset) == me->arch.core_plt_offset 624 && is_phys(me->module_core)) { 625 free_phys(me->module_core + me->arch.core_plt_offset, 626 me->core_size - me->arch.core_plt_offset); 627 me->core_size = me->arch.core_plt_offset; 628 } 402 629 return 0; 403 630 } src/linux/rt2880/linux-2.6.23/arch/mips/kernel/scall32-o32.S
r10741 r12433 647 647 sys sys_ppoll 5 648 648 sys sys_unshare 1 649 sys sys_splice 4649 sys sys_splice 6 650 650 sys sys_sync_file_range 7 /* 4305 */ 651 651 sys sys_tee 4 src/linux/rt2880/linux-2.6.23/arch/mips/kernel/vmlinux.lds.S
r10741 r12433 135 135 *(.bss) 136 136 *(COMMON) 137 } 137 . = (ALIGN(_PAGE_SIZE) - .) < 8 ? ALIGN(_PAGE_SIZE) + 4 : . ; 138 } 138 139 __bss_stop = .; 139 140 src/linux/rt2880/linux-2.6.23/arch/mips/mm/c-r4k.c
r10741 r12433 929 929 c->dcache.waybit = __ffs(dcache_size/c->dcache.ways); 930 930 931 #ifdef CONFIG_CPU_HAS_PREFETCH 931 932 c->options |= MIPS_CPU_PREFETCH; 933 #endif 932 934 break; 933 935 } src/linux/rt2880/linux-2.6.23/arch/mips/rt2880/init.c
r10843 r12433 351 351 prom_meminit(); 352 352 prom_setup_printf(prom_get_ttysnum()); 353 // *(unsigned long *)(KSEG1ADDR(RALINK_USB_OTG_BASE+0xE00)) = 0x0; //Enable USB Port 353 354 prom_printf("\nLINUX started...\n"); 354 355 #if defined(CONFIG_RT2880_FPGA) || defined(CONFIG_RT3052_FPGA) || defined(CONFIG_RT2883_FPGA) src/linux/rt2880/linux-2.6.23/drivers/net/Makefile
r10741 r12433 285 285 obj-$(CONFIG_USB_PEGASUS) += usb/ 286 286 obj-$(CONFIG_USB_RTL8150) += usb/ 287 obj-$(CONFIG_USB_HSO) += usb/ 287 288 obj-$(CONFIG_USB_USBNET) += usb/ 288 289 obj-$(CONFIG_USB_ZD1201) += usb/ src/linux/rt2880/linux-2.6.23/drivers/net/usb/Kconfig
r10741 r12433 160 160 what other networking devices you have in use. 161 161 162 config USB_HSO 163 tristate "Option USB High Speed Mobile Devices" 164 depends on USB && RFKILL 165 default n 166 help 167 Choose this option if you have an Option HSDPA/HSUPA card. 168 These cards support downlink speeds of 7.2Mbps or greater. 169 170 To compile this driver as a module, choose M here: the 171 module will be called hso. 162 172 163 173 config USB_NET_CDCETHER src/linux/rt2880/linux-2.6.23/drivers/net/usb/Makefile
r10741 r12433 7 7 obj-$(CONFIG_USB_PEGASUS) += pegasus.o 8 8 obj-$(CONFIG_USB_RTL8150) += rtl8150.o 9 obj-$(CONFIG_USB_HSO) += hso.o 9 10 obj-$(CONFIG_USB_NET_AX8817X) += asix.o 10 11 obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o … … 22 23 EXTRA_CFLAGS += -DDEBUG 23 24 endif 25 26 ifeq ($(CONFIG_DWC_OTG_HOST_ONLY),y) 27 EXTRA_CFLAGS += -DDWC_HOST_ONLY 28 endif src/linux/rt2880/linux-2.6.23/drivers/usb/core/hub.c
r10741 r12433 31 31 #include "hcd.h" 32 32 #include "hub.h" 33 34 #ifdef ENABLE_HOT_PLUG_RESET 35 extern void ralink_reset(int reset_pin); 36 extern int usb_hotplug_flag; 37 enum 38 { 39 USB_PLUG_RESET = 1<<0, 40 USB_UNPLUG_RESET = 1<<1, 41 }; 42 #endif 33 43 34 44 #ifdef CONFIG_USB_PERSIST src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/Kconfig
r10741 r12433 1 1 config DWC_OTG 2 tristate "R ALINKDWC_OTG support"2 tristate "Ralink DWC_OTG support" 3 3 ---help--- 4 This driver supports Ralink DWC_OTG 4 This driver supports Ralink DWC_OTG 5 5 6 c onfig DWC_OTG_DEBUG7 bool "enable debug mode"6 choice 7 prompt "USB Operation Mode" 8 8 depends on DWC_OTG 9 9 default DWC_OTG_HOST_ONLY 10 10 11 11 config DWC_OTG_HOST_ONLY … … 17 17 depends on DWC_OTG 18 18 19 endchoice 20 21 22 config DWC_OTG_DEBUG 23 bool "Enable debug mode" 24 depends on DWC_OTG src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/Makefile
r10741 r12433 9 9 # Use one of the following flags to compile the software in host-only or 10 10 # device-only mode. 11 12 11 ifeq ($(CONFIG_DWC_OTG_HOST_ONLY),y) 13 12 EXTRA_CFLAGS += -DDWC_HOST_ONLY 13 EXTRA_CFLAGS += -DDWC_EN_ISOC 14 14 endif 15 15 … … 18 18 endif 19 19 20 #EXTRA_CFLAGS += -Dlinux-DDWC_HS_ELECT_TST20 EXTRA_CFLAGS += -DDWC_HS_ELECT_TST 21 21 22 obj-$(CONFIG_DWC_OTG) += dwc_otg.o22 obj-$(CONFIG_DWC_OTG) := dwc_otg.o 23 23 24 dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o25 dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o26 dwc_otg-objs += dwc_otg_pcd.o dwc_otg_pcd_intr.o27 dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o24 dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o 25 dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o 26 dwc_otg-objs += dwc_otg_pcd.o dwc_otg_pcd_intr.o 27 dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o 28 28 src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dummy_audio.c
r10741 r12433 85 85 #include <asm/unaligned.h> 86 86 87 #include <linux/usb_ch9.h> 87 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) 88 # include <linux/usb/ch9.h> 89 #else 90 # include <linux/usb_ch9.h> 91 #endif 92 88 93 #include <linux/usb_gadget.h> 89 94 src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_attr.c
r10741 r12433 1 1 /* ========================================================================== 2 * $File: //dwh/usb_iip/dev/software/otg _ipmate/linux/drivers/dwc_otg_attr.c $3 * $Revision: 1. 1$4 * $Date: 200 7-11-19 05:39:07$5 * $Change: 537387$2 * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ 3 * $Revision: 1.2 $ 4 * $Date: 2008-11-21 05:39:15 $ 5 * $Change: 1064918 $ 6 6 * 7 7 * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, … … 207 207 208 208 <tr> 209 <td> spramdump </td> 210 <td> Dumps the contents of core registers.</td> 211 <td> Read</td> 212 </tr> 213 214 <tr> 209 215 <td> hcddump </td> 210 216 <td> Dumps the current HCD state.</td> … … 255 261 #include <linux/types.h> 256 262 #include <linux/stat.h> /* permission constants */ 263 #include <linux/version.h> 257 264 258 265 //#include <asm/sizes.h> … … 268 275 #include "dwc_otg_hcd.h" 269 276 277 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 270 278 /* 271 279 * MACROs for defining sysfs attribute 272 280 */ 273 281 #define DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ 274 static ssize_t _otg_attr_name_##_show (struct device *_dev, char *buf) \282 static ssize_t _otg_attr_name_##_show (struct device *_dev, struct device_attribute *attr, char *buf) \ 275 283 { \ 276 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 284 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); \ 285 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); \ 277 286 uint32_t val; \ 278 287 val = dwc_read_reg32 (_addr_); \ … … 281 290 } 282 291 #define DWC_OTG_DEVICE_ATTR_BITFIELD_STORE(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ 283 static ssize_t _otg_attr_name_##_store (struct device *_dev, const char *buf, size_t count) \ 292 static ssize_t _otg_attr_name_##_store (struct device *_dev, struct device_attribute *attr, \ 293 const char *buf, size_t count) \ 284 294 { \ 285 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 295 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); \ 296 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); \ 286 297 uint32_t set = simple_strtoul(buf, NULL, 16); \ 287 298 uint32_t clear = set; \ … … 293 304 } 294 305 306 /* 307 * MACROs for defining sysfs attribute for 32-bit registers 308 */ 309 #define DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_addr_,_string_) \ 310 static ssize_t _otg_attr_name_##_show (struct device *_dev, struct device_attribute *attr, char *buf) \ 311 { \ 312 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); \ 313 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); \ 314 uint32_t val; \ 315 val = dwc_read_reg32 (_addr_); \ 316 return sprintf (buf, "%s = 0x%08x\n", _string_, val); \ 317 } 318 #define DWC_OTG_DEVICE_ATTR_REG_STORE(_otg_attr_name_,_addr_,_string_) \ 319 static ssize_t _otg_attr_name_##_store (struct device *_dev, struct device_attribute *attr, \ 320 const char *buf, size_t count) \ 321 { \ 322 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); \ 323 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); \ 324 uint32_t val = simple_strtoul(buf, NULL, 16); \ 325 dev_dbg(_dev, "Storing Address=0x%08x Val=0x%08x\n", (uint32_t)_addr_, val); \ 326 dwc_write_reg32(_addr_, val); \ 327 return count; \ 328 } 329 330 #else 331 332 /* 333 * MACROs for defining sysfs attribute 334 */ 335 #define DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ 336 static ssize_t _otg_attr_name_##_show (struct device *_dev, char *buf) \ 337 { \ 338 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 339 uint32_t val; \ 340 val = dwc_read_reg32 (_addr_); \ 341 val = (val & (_mask_)) >> _shift_; \ 342 return sprintf (buf, "%s = 0x%x\n", _string_, val); \ 343 } 344 #define DWC_OTG_DEVICE_ATTR_BITFIELD_STORE(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ 345 static ssize_t _otg_attr_name_##_store (struct device *_dev, const char *buf, size_t count) \ 346 { \ 347 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 348 uint32_t set = simple_strtoul(buf, NULL, 16); \ 349 uint32_t clear = set; \ 350 clear = ((~clear) << _shift_) & _mask_; \ 351 set = (set << _shift_) & _mask_; \ 352 dev_dbg(_dev, "Storing Address=0x%08x Set=0x%08x Clear=0x%08x\n", (uint32_t)_addr_, set, clear); \ 353 dwc_modify_reg32(_addr_, clear, set); \ 354 return count; \ 355 } 356 357 /* 358 * MACROs for defining sysfs attribute for 32-bit registers 359 */ 360 #define DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_addr_,_string_) \ 361 static ssize_t _otg_attr_name_##_show (struct device *_dev, char *buf) \ 362 { \ 363 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 364 uint32_t val; \ 365 val = dwc_read_reg32 (_addr_); \ 366 return sprintf (buf, "%s = 0x%08x\n", _string_, val); \ 367 } 368 #define DWC_OTG_DEVICE_ATTR_REG_STORE(_otg_attr_name_,_addr_,_string_) \ 369 static ssize_t _otg_attr_name_##_store (struct device *_dev, const char *buf, size_t count) \ 370 { \ 371 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\ 372 uint32_t val = simple_strtoul(buf, NULL, 16); \ 373 dev_dbg(_dev, "Storing Address=0x%08x Val=0x%08x\n", (uint32_t)_addr_, val); \ 374 dwc_write_reg32(_addr_, val); \ 375 return count; \ 376 } 377 378 #endif 379 295 380 #define DWC_OTG_DEVICE_ATTR_BITFIELD_RW(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ 296 381 DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW(_otg_attr_name_,_addr_,_mask_,_shift_,_string_) \ … … 302 387 DEVICE_ATTR(_otg_attr_name_,0444,_otg_attr_name_##_show,NULL); 303 388 304 /*305 * MACROs for defining sysfs attribute for 32-bit registers306 */307 #define DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_addr_,_string_) \308 static ssize_t _otg_attr_name_##_show (struct device *_dev, char *buf) \309 { \310 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\311 uint32_t val; \312 val = dwc_read_reg32 (_addr_); \313 return sprintf (buf, "%s = 0x%08x\n", _string_, val); \314 }315 #define DWC_OTG_DEVICE_ATTR_REG_STORE(_otg_attr_name_,_addr_,_string_) \316 static ssize_t _otg_attr_name_##_store (struct device *_dev, const char *buf, size_t count) \317 { \318 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);\319 uint32_t val = simple_strtoul(buf, NULL, 16); \320 dev_dbg(_dev, "Storing Address=0x%08x Val=0x%08x\n", (uint32_t)_addr_, val); \321 dwc_write_reg32(_addr_, val); \322 return count; \323 }324 325 389 #define DWC_OTG_DEVICE_ATTR_REG32_RW(_otg_attr_name_,_addr_,_string_) \ 326 390 DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_addr_,_string_) \ … … 339 403 * Show the register offset of the Register Access. 340 404 */ 341 static ssize_t regoffset_show( struct device *_dev, char *buf) 342 { 343 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 405 static ssize_t regoffset_show( struct device *_dev, 406 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 407 struct device_attribute *attr, 408 #endif 409 char *buf) 410 { 411 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 412 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 413 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 414 #else 415 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 416 #endif 344 417 return snprintf(buf, sizeof("0xFFFFFFFF\n")+1,"0x%08x\n", otg_dev->reg_offset); 345 418 } … … 348 421 * Set the register offset for the next Register Access Read/Write 349 422 */ 350 static ssize_t regoffset_store( struct device *_dev, const char *buf, 351 size_t count ) 352 { 353 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 423 static ssize_t regoffset_store( struct device *_dev, 424 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 425 struct device_attribute *attr, 426 #endif 427 const char *buf, 428 size_t count ) 429 { 430 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 431 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 432 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 433 #else 434 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 435 #endif 354 436 uint32_t offset = simple_strtoul(buf, NULL, 16); 355 437 //dev_dbg(_dev, "Offset=0x%08x\n", offset); … … 363 445 return count; 364 446 } 365 DEVICE_ATTR(regoffset, S_IRUGO|S_IWUSR, regoffset_show, regoffset_store);447 DEVICE_ATTR(regoffset, S_IRUGO|S_IWUSR, (void *)regoffset_show, regoffset_store); 366 448 367 449 … … 370 452 * attribute. 371 453 */ 372 static ssize_t regvalue_show( struct device *_dev, char *buf) 373 { 374 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 454 static ssize_t regvalue_show( struct device *_dev, 455 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 456 struct device_attribute *attr, 457 #endif 458 char *buf) 459 { 460 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 461 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 462 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 463 #else 464 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 465 #endif 375 466 uint32_t val; 376 467 volatile uint32_t *addr; … … 399 490 * 400 491 */ 401 static ssize_t regvalue_store( struct device *_dev, const char *buf, 402 size_t count ) 403 { 404 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 492 static ssize_t regvalue_store( struct device *_dev, 493 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 494 struct device_attribute *attr, 495 #endif 496 const char *buf, 497 size_t count ) 498 { 499 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 500 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 501 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 502 #else 503 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 504 #endif 405 505 volatile uint32_t * addr; 406 506 uint32_t val = simple_strtoul(buf, NULL, 16); … … 453 553 * Show the HNP status bit 454 554 */ 455 static ssize_t hnp_show( struct device *_dev, char *buf) 456 { 457 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 555 static ssize_t hnp_show( struct device *_dev, 556 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 557 struct device_attribute *attr, 558 #endif 559 char *buf) 560 { 561 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 562 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 563 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 564 #else 565 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 566 #endif 458 567 gotgctl_data_t val; 459 568 val.d32 = dwc_read_reg32 (&(otg_dev->core_if->core_global_regs->gotgctl)); … … 464 573 * Set the HNP Request bit 465 574 */ 466 static ssize_t hnp_store( struct device *_dev, const char *buf, 575 static ssize_t hnp_store( struct device *_dev, 576 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 577 struct device_attribute *attr, 578 #endif 579 const char *buf, 467 580 size_t count ) 468 581 { 469 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 582 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 583 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 584 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 585 #else 586 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 587 #endif 470 588 uint32_t in = simple_strtoul(buf, NULL, 16); 471 589 uint32_t *addr = (uint32_t *)&(otg_dev->core_if->core_global_regs->gotgctl); … … 485 603 * Show the SRP status bit 486 604 */ 487 static ssize_t srp_show( struct device *_dev, char *buf) 605 static ssize_t srp_show( struct device *_dev, 606 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 607 struct device_attribute *attr, 608 #endif 609 char *buf) 488 610 { 489 611 #ifndef DWC_HOST_ONLY 490 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 612 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 613 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 614 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 615 #else 616 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 617 #endif 491 618 gotgctl_data_t val; 492 619 val.d32 = dwc_read_reg32 (&(otg_dev->core_if->core_global_regs->gotgctl)); … … 502 629 * Set the SRP Request bit 503 630 */ 504 static ssize_t srp_store( struct device *_dev, const char *buf, 631 static ssize_t srp_store( struct device *_dev, 632 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 633 struct device_attribute *attr, 634 #endif 635 const char *buf, 505 636 size_t count ) 506 637 { 507 638 #ifndef DWC_HOST_ONLY 508 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 639 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 640 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 641 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 642 #else 643 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 644 #endif 509 645 dwc_otg_pcd_initiate_srp(otg_dev->pcd); 510 646 #endif … … 519 655 * Show the Bus Power status 520 656 */ 521 static ssize_t buspower_show( struct device *_dev, char *buf) 522 { 523 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 657 static ssize_t buspower_show( struct device *_dev, 658 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 659 struct device_attribute *attr, 660 #endif 661 char *buf) 662 { 663 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 664 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 665 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 666 #else 667 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 668 #endif 524 669 hprt0_data_t val; 525 670 val.d32 = dwc_read_reg32 (otg_dev->core_if->host_if->hprt0); … … 531 676 * Set the Bus Power status 532 677 */ 533 static ssize_t buspower_store( struct device *_dev, const char *buf, 534 size_t count ) 535 { 536 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 678 static ssize_t buspower_store( struct device *_dev, 679 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 680 struct device_attribute *attr, 681 #endif 682 const char *buf, 683 size_t count ) 684 { 685 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 686 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 687 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 688 #else 689 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 690 #endif 537 691 uint32_t on = simple_strtoul(buf, NULL, 16); 538 692 uint32_t *addr = (uint32_t *)otg_dev->core_if->host_if->hprt0; … … 555 709 * Show the Bus Suspend status 556 710 */ 557 static ssize_t bussuspend_show( struct device *_dev, char *buf) 558 { 559 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 711 static ssize_t bussuspend_show( struct device *_dev, 712 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 713 struct device_attribute *attr, 714 #endif 715 char *buf) 716 { 717 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 718 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 719 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 720 #else 721 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 722 #endif 560 723 hprt0_data_t val; 561 724 val.d32 = dwc_read_reg32 (otg_dev->core_if->host_if->hprt0); … … 566 729 * Set the Bus Suspend status 567 730 */ 568 static ssize_t bussuspend_store( struct device *_dev, const char *buf, 569 size_t count ) 570 { 571 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 731 static ssize_t bussuspend_store( struct device *_dev, 732 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 733 struct device_attribute *attr, 734 #endif 735 const char *buf, 736 size_t count ) 737 { 738 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 739 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 740 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 741 #else 742 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 743 #endif 572 744 uint32_t in = simple_strtoul(buf, NULL, 16); 573 745 uint32_t *addr = (uint32_t *)otg_dev->core_if->host_if->hprt0; … … 584 756 * Show the status of Remote Wakeup. 585 757 */ 586 static ssize_t remote_wakeup_show( struct device *_dev, char *buf) 758 static ssize_t remote_wakeup_show( struct device *_dev, 759 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 760 struct device_attribute *attr, 761 #endif 762 char *buf) 587 763 { 588 764 #ifndef DWC_HOST_ONLY 589 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 765 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 766 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 767 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 768 #else 769 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 770 #endif 590 771 dctl_data_t val; 591 772 val.d32 = 592 dwc_read_reg32( &otg_dev->core_if->dev_if->dev_global_regs->dctl);773 dwc_read_reg32( &otg_dev->core_if->dev_if->dev_global_regs->dctl); 593 774 return sprintf( buf, "Remote Wakeup = %d Enabled = %d\n", 594 val.b.rmtwkupsig, otg_dev->pcd->remote_wakeup_enable);775 val.b.rmtwkupsig, otg_dev->pcd->remote_wakeup_enable); 595 776 #else 596 777 return sprintf(buf, "Host Only Mode!\n"); … … 603 784 * 604 785 */ 605 static ssize_t remote_wakeup_store( struct device *_dev, const char *buf, 606 size_t count ) 786 static ssize_t remote_wakeup_store( struct device *_dev, 787 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 788 struct device_attribute *attr, 789 #endif 790 const char *buf, 791 size_t count ) 607 792 { 608 793 #ifndef DWC_HOST_ONLY 609 uint32_t val = simple_strtoul(buf, NULL, 16); 610 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 794 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 795 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 796 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 797 #else 798 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 799 #endif 800 uint32_t val = simple_strtoul(buf, NULL, 16); 611 801 if (val&1) { 612 802 dwc_otg_pcd_remote_wakeup(otg_dev->pcd, 1); … … 619 809 } 620 810 DEVICE_ATTR(remote_wakeup, S_IRUGO|S_IWUSR, remote_wakeup_show, 621 remote_wakeup_store);811 remote_wakeup_store); 622 812 623 813 /** … … 625 815 * current mode of the core). 626 816 */ 627 static ssize_t regdump_show( struct device *_dev, char *buf) 628 { 629 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 630 817 static ssize_t regdump_show( struct device *_dev, 818 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 819 struct device_attribute *attr, 820 #endif 821 char *buf) 822 { 823 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 824 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 825 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 826 #else 827 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 828 #endif 631 829 dwc_otg_dump_global_registers( otg_dev->core_if); 632 830 if (dwc_otg_is_host_mode(otg_dev->core_if)) { … … 634 832 } else { 635 833 dwc_otg_dump_dev_registers( otg_dev->core_if); 834 636 835 } 637 836 return sprintf( buf, "Register Dump\n" ); … … 641 840 642 841 /** 842 * Dump global registers and either host or device registers (depending on the 843 * current mode of the core). 844 */ 845 static ssize_t spramdump_show( struct device *_dev, 846 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 847 struct device_attribute *attr, 848 #endif 849 char *buf) 850 { 851 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 852 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 853 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 854 #else 855 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 856 #endif 857 dwc_otg_dump_spram( otg_dev->core_if); 858 859 return sprintf( buf, "SPRAM Dump\n" ); 860 } 861 862 DEVICE_ATTR(spramdump, S_IRUGO|S_IWUSR, spramdump_show, 0); 863 864 /** 643 865 * Dump the current hcd state. 644 866 */ 645 static ssize_t hcddump_show( struct device *_dev, char *buf) 867 static ssize_t hcddump_show( struct device *_dev, 868 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 869 struct device_attribute *attr, 870 #endif 871 char *buf) 646 872 { 647 873 #ifndef DWC_DEVICE_ONLY 648 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 874 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 875 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 876 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 877 #else 878 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 879 #endif 649 880 dwc_otg_hcd_dump_state(otg_dev->hcd); 650 881 #endif … … 659 890 * start transfer and two additional sample points. 660 891 */ 661 static ssize_t hcd_frrem_show( struct device *_dev, char *buf) 892 static ssize_t hcd_frrem_show( struct device *_dev, 893 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 894 struct device_attribute *attr, 895 #endif 896 char *buf) 662 897 { 663 898 #ifndef DWC_DEVICE_ONLY 664 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 899 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 900 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 901 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 902 #else 903 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 904 #endif 665 905 dwc_otg_hcd_dump_frrem(otg_dev->hcd); 666 906 #endif … … 676 916 #define RW_REG_COUNT 10000000 677 917 #define MSEC_PER_JIFFIE 1000/HZ 678 static ssize_t rd_reg_test_show( struct device *_dev, char *buf) 679 { 918 static ssize_t rd_reg_test_show( struct device *_dev, 919 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 920 struct device_attribute *attr, 921 #endif 922 char *buf) 923 { 924 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 925 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 926 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 927 #else 928 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 929 #endif 680 930 int i; 681 931 int time; 682 932 int start_jiffies; 683 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);684 933 685 934 printk("HZ %d, MSEC_PER_JIFFIE %d, loops_per_jiffy %lu\n", … … 700 949 * output shows the number of times the register is written). 701 950 */ 702 static ssize_t wr_reg_test_show( struct device *_dev, char *buf) 703 { 951 static ssize_t wr_reg_test_show( struct device *_dev, 952 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 953 struct device_attribute *attr, 954 #endif 955 char *buf) 956 { 957 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 958 struct lm_device *lm_dev = container_of(_dev, struct lm_device, dev); 959 dwc_otg_device_t *otg_dev = lm_get_drvdata(lm_dev); 960 #else 961 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev); 962 #endif 963 uint32_t reg_val; 704 964 int i; 705 965 int time; 706 966 int start_jiffies; 707 dwc_otg_device_t *otg_dev = dev_get_drvdata(_dev);708 uint32_t reg_val;709 967 710 968 printk("HZ %d, MSEC_PER_JIFFIE %d, loops_per_jiffy %lu\n", … … 728 986 void dwc_otg_attr_create (struct lm_device *lmdev) 729 987 { 730 device_create_file(&lmdev->dev, &dev_attr_regoffset); 731 device_create_file(&lmdev->dev, &dev_attr_regvalue); 732 device_create_file(&lmdev->dev, &dev_attr_mode); 733 device_create_file(&lmdev->dev, &dev_attr_hnpcapable); 734 device_create_file(&lmdev->dev, &dev_attr_srpcapable); 735 device_create_file(&lmdev->dev, &dev_attr_hnp); 736 device_create_file(&lmdev->dev, &dev_attr_srp); 737 device_create_file(&lmdev->dev, &dev_attr_buspower); 738 device_create_file(&lmdev->dev, &dev_attr_bussuspend); 739 device_create_file(&lmdev->dev, &dev_attr_busconnected); 740 device_create_file(&lmdev->dev, &dev_attr_gotgctl); 741 device_create_file(&lmdev->dev, &dev_attr_gusbcfg); 742 device_create_file(&lmdev->dev, &dev_attr_grxfsiz); 743 device_create_file(&lmdev->dev, &dev_attr_gnptxfsiz); 744 device_create_file(&lmdev->dev, &dev_attr_gpvndctl); 745 device_create_file(&lmdev->dev, &dev_attr_ggpio); 746 device_create_file(&lmdev->dev, &dev_attr_guid); 747 device_create_file(&lmdev->dev, &dev_attr_gsnpsid); 748 device_create_file(&lmdev->dev, &dev_attr_devspeed); 749 device_create_file(&lmdev->dev, &dev_attr_enumspeed); 750 device_create_file(&lmdev->dev, &dev_attr_hptxfsiz); 751 device_create_file(&lmdev->dev, &dev_attr_hprt0); 752 device_create_file(&lmdev->dev, &dev_attr_remote_wakeup); 753 device_create_file(&lmdev->dev, &dev_attr_regdump); 754 device_create_file(&lmdev->dev, &dev_attr_hcddump); 755 device_create_file(&lmdev->dev, &dev_attr_hcd_frrem); 756 device_create_file(&lmdev->dev, &dev_attr_rd_reg_test); 757 device_create_file(&lmdev->dev, &dev_attr_wr_reg_test); 988 int error; 989 990 error = device_create_file(&lmdev->dev, &dev_attr_regoffset); 991 error = device_create_file(&lmdev->dev, &dev_attr_regvalue); 992 error = device_create_file(&lmdev->dev, &dev_attr_mode); 993 error = device_create_file(&lmdev->dev, &dev_attr_hnpcapable); 994 error = device_create_file(&lmdev->dev, &dev_attr_srpcapable); 995 error = device_create_file(&lmdev->dev, &dev_attr_hnp); 996 error = device_create_file(&lmdev->dev, &dev_attr_srp); 997 error = device_create_file(&lmdev->dev, &dev_attr_buspower); 998 error = device_create_file(&lmdev->dev, &dev_attr_bussuspend); 999 error = device_create_file(&lmdev->dev, &dev_attr_busconnected); 1000 error = device_create_file(&lmdev->dev, &dev_attr_gotgctl); 1001 error = device_create_file(&lmdev->dev, &dev_attr_gusbcfg); 1002 error = device_create_file(&lmdev->dev, &dev_attr_grxfsiz); 1003 error = device_create_file(&lmdev->dev, &dev_attr_gnptxfsiz); 1004 error = device_create_file(&lmdev->dev, &dev_attr_gpvndctl); 1005 error = device_create_file(&lmdev->dev, &dev_attr_ggpio); 1006 error = device_create_file(&lmdev->dev, &dev_attr_guid); 1007 error = device_create_file(&lmdev->dev, &dev_attr_gsnpsid); 1008 error = device_create_file(&lmdev->dev, &dev_attr_devspeed); 1009 error = device_create_file(&lmdev->dev, &dev_attr_enumspeed); 1010 error = device_create_file(&lmdev->dev, &dev_attr_hptxfsiz); 1011 error = device_create_file(&lmdev->dev, &dev_attr_hprt0); 1012 error = device_create_file(&lmdev->dev, &dev_attr_remote_wakeup); 1013 error = device_create_file(&lmdev->dev, &dev_attr_regdump); 1014 error = device_create_file(&lmdev->dev, &dev_attr_spramdump); 1015 error = device_create_file(&lmdev->dev, &dev_attr_hcddump); 1016 error = device_create_file(&lmdev->dev, &dev_attr_hcd_frrem); 1017 error = device_create_file(&lmdev->dev, &dev_attr_rd_reg_test); 1018 error = device_create_file(&lmdev->dev, &dev_attr_wr_reg_test); 758 1019 } 759 1020 … … 787 1048 device_remove_file(&lmdev->dev, &dev_attr_remote_wakeup); 788 1049 device_remove_file(&lmdev->dev, &dev_attr_regdump); 1050 device_remove_file(&lmdev->dev, &dev_attr_spramdump); 789 1051 device_remove_file(&lmdev->dev, &dev_attr_hcddump); 790 1052 device_remove_file(&lmdev->dev, &dev_attr_hcd_frrem); src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_attr.h
r10741 r12433 1 1 /* ========================================================================== 2 * $File: //dwh/usb_iip/dev/software/otg _ipmate/linux/drivers/dwc_otg_attr.h $3 * $Revision: 1. 1$4 * $Date: 200 7-11-19 05:39:07$5 * $Change: 510275$2 * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $ 3 * $Revision: 1.2 $ 4 * $Date: 2008-11-21 05:39:15 $ 5 * $Change: 477051 $ 6 6 * 7 7 * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, src/linux/rt2880/linux-2.6.23/drivers/usb/dwc_otg/dwc_otg_cil.c
r10741 r12433 1 1 /* ========================================================================== 2 * $File: //dwh/usb_iip/dev/software/otg _ipmate/linux/drivers/dwc_otg_cil.c $3 * $Revision: 1. 4$4 * $Date: 2008- 07-03 07:05:18$5 * $Change: 791271$2 * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.c $ 3 * $Revision: 1.7 $ 4 * $Date: 2008-12-22 11:43:05 $ 5 * $Change: 1117667 $ 6 6 * 7 7 * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, … … 58 58 */ 59 59 #include <asm/unaligned.h> 60 #include <linux/dma-mapping.h> 60 61 #ifdef DEBUG 61 62 #include <linux/jiffies.h> … … 65 66 #include "dwc_otg_regs.h" 66 67 #include "dwc_otg_cil.h" 68 69 /* Included only to access hc->qh for non-dword buffer handling 70 * TODO: account it 71 */ 72 #include "dwc_otg_hcd.h" 67 73 68 74 /** … … 75 81 * configured. 76 82 * 77 * @param[in] _reg_base_addr Base address of DWC_otg core registers78 * @param[in] _core_params Pointer to the core configuration parameters79 * 80 */ 81 dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t * _reg_base_addr,82 dwc_otg_core_params_t *_core_params)83 * @param[in] reg_base_addr Base address of DWC_otg core registers 84 * @param[in] core_params Pointer to the core configuration parameters 85 * 86 */ 87 dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t *reg_base_addr, 88 dwc_otg_core_params_t *core_params) 83 89 { 84 90 dwc_otg_core_if_t *core_if = 0; 85 91 dwc_otg_dev_if_t *dev_if = 0; 86 92 dwc_otg_host_if_t *host_if = 0; 87 uint8_t *reg_base = (uint8_t *) _reg_base_addr;93 uint8_t *reg_base = (uint8_t *)reg_base_addr; 88 94 int i = 0; 89 95 90 DWC_DEBUGPL(DBG_CILV, "%s(%p,%p)\n", __func__, _reg_base_addr, _core_params); 91 92 core_if = kmalloc( sizeof(dwc_otg_core_if_t), GFP_KERNEL); 93 94 if (core_if == 0) \ 95 { 96 DWC_DEBUGPL(DBG_CIL, "Allocation of dwc_otg_core_if_t failed\n"); 97 return 0; 96 DWC_DEBUGPL(DBG_CILV, "%s(%p,%p)\n", __func__, reg_base_addr, core_params); 97 98 core_if = kmalloc(sizeof(dwc_otg_core_if_t), GFP_KERNEL); 99 100 if (core_if == 0) { 101 DWC_DEBUGPL(DBG_CIL, "Allocation of dwc_otg_core_if_t failed\n"); 102 return 0; 98 103 } 99 104 100 105 memset(core_if, 0, sizeof(dwc_otg_core_if_t)); 101 106 102 core_if->core_params = _core_params;107 core_if->core_params = core_params; 103 108 core_if->core_global_regs = (dwc_otg_core_global_regs_t *)reg_base; 104 109 … … 106 111 * Allocate the Device Mode structures. 107 112 */ 108 dev_if = kmalloc( sizeof(dwc_otg_dev_if_t), GFP_KERNEL); 109 110 if (dev_if == 0) 111 { 113 dev_if = kmalloc(sizeof(dwc_otg_dev_if_t), GFP_KERNEL); 114 115 if (dev_if == 0) { 112 116 DWC_DEBUGPL(DBG_CIL, "Allocation of dwc_otg_dev_if_t failed\n"); 113 kfree( core_if);117 kfree(core_if); 114 118 return 0; 115 119 } … … 140 144 * Allocate the Host Mode structures. 141 145 */ 142 host_if = kmalloc( sizeof(dwc_otg_host_if_t), GFP_KERNEL); 143 144 if (host_if == 0) 145 { 146 host_if = kmalloc(sizeof(dwc_otg_host_if_t), GFP_KERNEL); 147 148 if (host_if == 0) { 146 149 DWC_DEBUGPL(DBG_CIL, "Allocation of dwc_otg_host_if_t failed\n"); 147 kfree( dev_if);148 kfree( core_if);150 kfree(dev_if); 151 kfree(core_if); 149 152 return 0; 150 153 } … … 192 195 DWC_DEBUGPL(DBG_CILV,"hwcfg4=%08x\n",core_if->hwcfg4.d32); 193 196 197 core_if->hcfg.d32 = dwc_read_reg32(&core_if->host_if->host_global_regs->hcfg); 198 core_if->dcfg.d32 = dwc_read_reg32(&core_if->dev_if->dev_global_regs->dcfg); 199 200 DWC_DEBUGPL(DBG_CILV,"hcfg=%08x\n",core_if->hcfg.d32); 201 DWC_DEBUGPL(DBG_CILV,"dcfg=%08x\n",core_if->dcfg.d32); 202 194 203 DWC_DEBUGPL(DBG_CILV,"op_mode=%0x\n",core_if->hwcfg2.b.op_mode); 195 204 DWC_DEBUGPL(DBG_CILV,"arch=%0x\n",core_if->hwcfg2.b.architecture); … … 209 218 core_if->srp_timer_started = 0; 210 219 220 221 /* 222 * Create new workqueue and init works 223 */ 224 core_if->wq_otg = create_singlethread_workqueue("dwc_otg"); 225 if(core_if->wq_otg == 0) { 226 DWC_DEBUGPL(DBG_CIL, "Creation of wq_otg failed\n"); 227 kfree(host_if); 228 kfree(dev_if); 229 kfree(core_if); 230 return 0 * HZ; 231 } 232 233 234 235 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 236 237 INIT_WORK(&core_if->w_conn_id, w_conn_id_status_change, core_if); 238 INIT_WORK(&core_if->w_wkp, w_wakeup_detected, core_if); 239 240 #else 241 242 INIT_WORK(&core_if->w_conn_id, w_conn_id_status_change); 243 INIT_DELAYED_WORK(&core_if->w_wkp, w_wakeup_detected); 244 245 #endif 211 246 return core_if; 212 247 } … … 215 250 * This function frees the structures allocated by dwc_otg_cil_init(). 216 251 * 217 * @param[in] _core_if The core interface pointer returned from252 * @param[in] core_if The core interface pointer returned from 218 253 * dwc_otg_cil_init(). 219 254 * 220 255 */ 221 void dwc_otg_cil_remove( dwc_otg_core_if_t *_core_if)256 void dwc_otg_cil_remove(dwc_otg_core_if_t *core_if) 222 257 { 223 258 /* Disable all interrupts */ 224 dwc_modify_reg32( &_core_if->core_global_regs->gahbcfg, 1, 0); 225 dwc_write_reg32( &_core_if->core_global_regs->gintmsk, 0); 226 227 if ( _core_if->dev_if ) { 228 kfree( _core_if->dev_if ); 229 } 230 if ( _core_if->host_if ) { 231 kfree( _core_if->host_if ); 232 } 233 kfree( _core_if ); 259 dwc_modify_reg32(&core_if->core_global_regs->gahbcfg, 1, 0); 260 dwc_write_reg32(&core_if->core_global_regs->gintmsk, 0); 261 262 if (core_if->wq_otg) { 263 destroy_workqueue(core_if->wq_otg); 264 } 265 if (core_if->dev_if) { 266 kfree(core_if->dev_if); 267 } 268 if (core_if->host_if) { 269 kfree(core_if->host_if); 270 } 271 kfree(core_if); 234 272 } 235 273 … … 238 276 * register. 239 277 * 240 * @param[in] _core_if Programming view of DWC_otg controller.241 */ 242 extern void dwc_otg_enable_global_interrupts( dwc_otg_core_if_t *_core_if)278 * @param[in] core_if Programming view of DWC_otg controller. 279 */ 280 void dwc_otg_enable_global_interrupts(dwc_otg_core_if_t *core_if) 243 281 { 244 282 gahbcfg_data_t ahbcfg = { .d32 = 0}; 245 283 ahbcfg.b.glblintrmsk = 1; /* Enable interrupts */ 246 dwc_modify_reg32(& _core_if->core_global_regs->gahbcfg, 0, ahbcfg.d32);284 dwc_modify_reg32(&core_if->core_global_regs->gahbcfg, 0, ahbcfg.d32); 247 285 } 248 286 … … 251 289 * register. 252 290 * 253 * @param[in] _core_if Programming view of DWC_otg controller.254 */ 255 extern void dwc_otg_disable_global_interrupts( dwc_otg_core_if_t *_core_if)291 * @param[in] core_if Programming view of DWC_otg controller. 292 */ 293 void dwc_otg_disable_global_interrupts(dwc_otg_core_if_t *core_if) 256 294 { 257 295 gahbcfg_data_t ahbcfg = { .d32 = 0}; 258 296 ahbcfg.b.glblintrmsk = 1; /* Enable interrupts */ 259 dwc_modify_reg32(& _core_if->core_global_regs->gahbcfg, ahbcfg.d32, 0);297 dwc_modify_reg32(&core_if->core_global_regs->gahbcfg, ahbcfg.d32, 0); 260 298 } 261 299 … … 264 302 * device and host modes. 265 303 * 266 * @param[in] _core_if Programming view of the DWC_otg controller267 * 268 */ 269 static void dwc_otg_enable_common_interrupts(dwc_otg_core_if_t * _core_if)304 * @param[in] core_if Programming view of the DWC_otg controller 305 * 306 */ 307 static void dwc_otg_enable_common_interrupts(dwc_otg_core_if_t *core_if) 270 308 { 271 309 dwc_otg_core_global_regs_t *global_regs = 272 _core_if->core_global_regs;310 core_if->core_global_regs; 273 311 gintmsk_data_t intr_mask = { .d32 = 0}; 274 312 275 313 /* Clear any pending OTG Interrupts */ 276 dwc_write_reg32( &global_regs->gotgint, 0xFFFFFFFF);314 dwc_write_reg32(&global_regs->gotgint, 0xFFFFFFFF); 277 315 278 316 /* Clear any pending interrupts */ 279 dwc_write_reg32( &global_regs->gintsts, 0xFFFFFFFF);317 dwc_write_reg32(&global_regs->gintsts, 0xFFFFFFFF); 280 318 281 319 /* … … 285 323 intr_mask.b.otgintr = 1; 286 324 287 if (!_core_if->dma_enable) 288 { 325 if (!core_if->dma_enable) { 289 326 intr_mask.b.rxstsqlvl = 1; 290 327 } … … 295 332 intr_mask.b.usbsuspend = 1; 296 333 intr_mask.b.sessreqintr = 1; 297 dwc_write_reg32( &global_regs->gintmsk, intr_mask.d32);334 dwc_write_reg32(&global_regs->gintmsk, intr_mask.d32); 298 335 } 299 336 … … 302 339 * type. 303 340 */ 304 static void init_fslspclksel(dwc_otg_core_if_t * _core_if)341 static void init_fslspclksel(dwc_otg_core_if_t *core_if) 305 342 { 306 343 uint32_t val; 307 344 hcfg_data_t hcfg; 308 345 309 if (((_core_if->hwcfg2.b.hs_phy_type == 2) && 310 (_core_if->hwcfg2.b.fs_phy_type == 1) && 311 (_core_if->core_params->ulpi_fs_ls)) || 312 (_core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) 313 { 346 if (((core_if->hwcfg2.b.hs_phy_type == 2) && 347 (core_if->hwcfg2.b.fs_phy_type == 1) && 348 (core_if->core_params->ulpi_fs_ls)) || 349 (core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) { 314 350 /* Full speed PHY */ 315 351 val = DWC_HCFG_48_MHZ; 316 352 } 317 else 318 { 353 else { 319 354 /* High speed PHY running at full speed or high speed */ 320 355 val = DWC_HCFG_30_60_MHZ; … … 322 357 323 358 DWC_DEBUGPL(DBG_CIL, "Initializing HCFG.FSLSPClkSel to 0x%1x\n", val); 324 hcfg.d32 = dwc_read_reg32(& _core_if->host_if->host_global_regs->hcfg);359 hcfg.d32 = dwc_read_reg32(&core_if->host_if->host_global_regs->hcfg); 325 360 hcfg.b.fslspclksel = val; 326 dwc_write_reg32(& _core_if->host_if->host_global_regs->hcfg, hcfg.d32);361 dwc_write_reg32(&core_if->host_if->host_global_regs->hcfg, hcfg.d32); 327 362 } 328 363 … … 331 366 * and the enumeration speed of the device. 332 367 */ 333 static void init_devspd(dwc_otg_core_if_t * _core_if)368 static void init_devspd(dwc_otg_core_if_t *core_if) 334 369 { 335 370 uint32_t val; 336 371 dcfg_data_t dcfg; 337 372 338 if (((_core_if->hwcfg2.b.hs_phy_type == 2) && 339 (_core_if->hwcfg2.b.fs_phy_type == 1) && 340 (_core_if->core_params->ulpi_fs_ls)) || 341 (_core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) 342 { 373 if (((core_if->hwcfg2.b.hs_phy_type == 2) && 374 (core_if->hwcfg2.b.fs_phy_type == 1) && 375 (core_if->core_params->ulpi_fs_ls)) || 376 (core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) { 343 377 /* Full speed PHY */ 344 378 val = 0x3; 345 379 } 346 else if (_core_if->core_params->speed == DWC_SPEED_PARAM_FULL) 347 { 380 else if (core_if->core_params->speed == DWC_SPEED_PARAM_FULL) { 348 381 /* High speed PHY running at full speed */ 349 382 val = 0x1; 350 383 } 351 else 352 { 384 else { 353 385 /* High speed PHY running at high speed */ 354 386 val = 0x0; … … 357 389 DWC_DEBUGPL(DBG_CIL, "Initializing DCFG.DevSpd to 0x%1x\n", val); 358 390 359 dcfg.d32 = dwc_read_reg32(& _core_if->dev_if->dev_global_regs->dcfg);391 dcfg.d32 = dwc_read_reg32(&core_if->dev_if->dev_global_regs->dcfg); 360 392 dcfg.b.devspd = val; 361 dwc_write_reg32(& _core_if->dev_if->dev_global_regs->dcfg, dcfg.d32);393 dwc_write_reg32(&core_if->dev_if->dev_global_regs->dcfg, dcfg.d32); 362 394 } 363 395 … … 366 398 * using GHWCFG1 and GHWCFG2 registers values 367 399 * 368 * @param _pcd the pcd structure.369 */ 370 static uint32_t calc_num_in_eps(dwc_otg_core_if_t * _core_if)400 * @param core_if Programming view of the DWC_otg controller 401 */ 402 static uint32_t calc_num_in_eps(dwc_otg_core_if_t *core_if) 371 403 { 372 404 uint32_t num_in_eps = 0; 373 uint32_t num_eps = _core_if->hwcfg2.b.num_dev_ep;374 uint32_t hwcfg1 = _core_if->hwcfg1.d32 >> 3;375 uint32_t num_tx_fifos = _core_if->hwcfg4.b.num_in_eps;405 uint32_t num_eps = core_if->hwcfg2.b.num_dev_ep; 406 uint32_t hwcfg1 = core_if->hwcfg1.d32 >> 3; 407 uint32_t num_tx_fifos = core_if->hwcfg4.b.num_in_eps; 376 408 int i; 377 409 … … 385 417 } 386 418 387 if(_core_if->hwcfg4.b.ded_fifo_en) 388 { 419 if(core_if->hwcfg4.b.ded_fifo_en) { 389 420 num_in_eps = (num_in_eps > num_tx_fifos) ? num_tx_fifos : num_in_eps; 390 421 } … … 398 429 * using GHWCFG1 and GHWCFG2 registers values 399 430 * 400 * @param _pcd the pcd structure.401 */ 402 static uint32_t calc_num_out_eps(dwc_otg_core_if_t * _core_if)431 * @param core_if Programming view of the DWC_otg controller 432 */ 433 static uint32_t calc_num_out_eps(dwc_otg_core_if_t *core_if) 403 434 { 404 435 uint32_t num_out_eps = 0; 405 uint32_t num_eps = _core_if->hwcfg2.b.num_dev_ep;406 uint32_t hwcfg1 = _core_if->hwcfg1.d32 >> 2;436 uint32_t num_eps = core_if->hwcfg2.b.num_dev_ep; 437 uint32_t hwcfg1 = core_if->hwcfg1.d32 >> 2; 407 438 int i; 408 439 … … 420 451 * prepares the core for device mode or host mode operation. 421 452 * 422 * @param _core_if Programming view of the DWC_otg controller423 * 424 */ 425 void dwc_otg_core_init(dwc_otg_core_if_t * _core_if)453 * @param core_if Programming view of the DWC_otg controller 454 * 455 */ 456 void dwc_otg_core_init(dwc_otg_core_if_t *core_if) 426 457 { 427 458 int i = 0; 428 459 dwc_otg_core_global_regs_t *global_regs = 429 _core_if->core_global_regs;430 dwc_otg_dev_if_t *dev_if = _core_if->dev_if;431 gahbcfg_data_t ahbcfg = { .d32 = 0 };460 core_if->core_global_regs; 461 dwc_otg_dev_if_t *dev_if = core_if->dev_if; 462 gahbcfg_data_t ahbcfg = { .d32 = 0 }; 432 463 gusbcfg_data_t usbcfg = { .d32 = 0 }; 433 gi2cctl_data_t i2cctl = { .d32 = 0};434 435 DWC_DEBUGPL(DBG_CILV, "dwc_otg_core_init(%p)\n", _core_if);464 gi2cctl_data_t i2cctl = { .d32 = 0 }; 465 466 DWC_DEBUGPL(DBG_CILV, "dwc_otg_core_init(%p)\n", core_if); 436 467 437 468 /* Common Initialization */ … … 439 470 usbcfg.d32 = dwc_read_reg32(&global_regs->gusbcfg); 440 471 472 // usbcfg.b.tx_end_delay = 1; 441 473 /* Program the ULPI External VBUS bit if needed */ 442 474 usbcfg.b.ulpi_ext_vbus_drv = 443 ( _core_if->core_params->phy_ulpi_ext_vbus == DWC_PHY_ULPI_EXTERNAL_VBUS) ? 1 : 0;475 (core_if->core_params->phy_ulpi_ext_vbus == DWC_PHY_ULPI_EXTERNAL_VBUS) ? 1 : 0; 444 476 445 477 /* Set external TS Dline pulsing */ 446 usbcfg.b.term_sel_dl_pulse = ( _core_if->core_params->ts_dline == 1) ? 1 : 0;478 usbcfg.b.term_sel_dl_pulse = (core_if->core_params->ts_dline == 1) ? 1 : 0; 447 479 dwc_write_reg32 (&global_regs->gusbcfg, usbcfg.d32); 448 480 481 449 482 /* Reset the Controller */ 450 dwc_otg_core_reset( _core_if);483 dwc_otg_core_reset(core_if); 451 484 452 485 /* Initialize parameters from Hardware configuration registers. */ 453 dev_if->num_in_eps = calc_num_in_eps( _core_if);454 dev_if->num_out_eps = calc_num_out_eps( _core_if);455 456 457 DWC_DEBUGPL(DBG_CIL, "num_dev_perio_in_ep=%d\n", _core_if->hwcfg4.b.num_dev_perio_in_ep);458 459 for (i=0; i < _core_if->hwcfg4.b.num_dev_perio_in_ep; i++)486 dev_if->num_in_eps = calc_num_in_eps(core_if); 487 dev_if->num_out_eps = calc_num_out_eps(core_if); 488 489 490 DWC_DEBUGPL(DBG_CIL, "num_dev_perio_in_ep=%d\n", core_if->hwcfg4.b.num_dev_perio_in_ep); 491 492 for (i=0; i < core_if->hwcfg4.b.num_dev_perio_in_ep; i++) 460 493 { 461 494 dev_if->perio_tx_fifo_size[i] = 462 dwc_read_reg32( &global_regs->dptxfsiz_dieptxf[i]) >> 16;495 dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i]) >> 16; 463 496 DWC_DEBUGPL(DBG_CIL, "Periodic Tx FIFO SZ #%d=0x%0x\n", 464 497 i, dev_if->perio_tx_fifo_size[i]); 465 498 } 466 499 467 for (i=0; i < _core_if->hwcfg4.b.num_in_eps; i++)500 for (i=0; i < core_if->hwcfg4.b.num_in_eps; i++) 468 501 { 469 502 dev_if->tx_fifo_size[i] = 470 dwc_read_reg32( &global_regs->dptxfsiz_dieptxf[i]) >> 16;503 dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i]) >> 16; 471 504 DWC_DEBUGPL(DBG_CIL, "Tx FIFO SZ #%d=0x%0x\n", 472 i, dev_if->tx_fifo_size[i]); 473 DWC_DEBUGPL(DBG_CIL,"\n dptxfsiz_dieptxf = 0x%08X \n",dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i])); 474 } 475 476 _core_if->total_fifo_size = _core_if->hwcfg3.b.dfifo_depth; 477 _core_if->rx_fifo_size = 478 dwc_read_reg32( &global_regs->grxfsiz); 479 _core_if->nperio_tx_fifo_size = 480 dwc_read_reg32( &global_regs->gnptxfsiz) >> 16; 481 482 DWC_DEBUGPL(DBG_CIL, "Total FIFO SZ=%d\n", _core_if->total_fifo_size); 483 DWC_DEBUGPL(DBG_CIL, "Rx FIFO SZ=%d\n", _core_if->rx_fifo_size); 484 DWC_DEBUGPL(DBG_CIL, "NP Tx FIFO SZ=%d\n", _core_if->nperio_tx_fifo_size); 505 i, dev_if->perio_tx_fifo_size[i]); 506 } 507 508 core_if->total_fifo_size = core_if->hwcfg3.b.dfifo_depth; 509 core_if->rx_fifo_size = 510 dwc_read_reg32(&global_regs->grxfsiz); 511 core_if->nperio_tx_fifo_size = 512 dwc_read_reg32(&global_regs->gnptxfsiz) >> 16; 513 514 DWC_DEBUGPL(DBG_CIL, "Total FIFO SZ=%d\n", core_if->total_fifo_size); 515 DWC_DEBUGPL(DBG_CIL, "Rx FIFO SZ=%d\n", core_if->rx_fifo_size); 516 DWC_DEBUGPL(DBG_CIL, "NP Tx FIFO SZ=%d\n", core_if->nperio_tx_fifo_size); 485 517 486 518 /* This programming sequence needs to happen in FS mode before any other 487 519 * programming occurs */ 488 if ((_core_if->core_params->speed == DWC_SPEED_PARAM_FULL) && 489 (_core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) 490 { 520 if ((core_if->core_params->speed == DWC_SPEED_PARAM_FULL) && 521 (core_if->core_params->phy_type == DWC_PHY_TYPE_PARAM_FS)) { 491 522 /* If FS mode with FS PHY */ 492 523 493 524 /* core_init() is now called on every switch so only call the 494 525 * following for the first time through. */ 495 if (!_core_if->phy_init_done) 496 { 497 _core_if->phy_init_done = 1; 526 if (!core_if->phy_init_done) { 527 core_if->phy_init_done = 1; 498 528 DWC_DEBUGPL(DBG_CIL, "FS_PHY detected\n"); 499 529 usbcfg.d32 = dwc_read_reg32(&global_regs->gusbcfg); … … 502 532 503 533 /* Reset after a PHY select */ 504 dwc_otg_core_reset( _core_if);534 dwc_otg_core_reset(core_if); 505 535 } 506 536 … … 508 538 * do this on HNP Dev/Host mode switches (done in dev_init and 509 539 * host_init). */ 510 if (dwc_otg_is_host_mode(_core_if)) 511 { 512 init_fslspclksel(_core_if); 513 } 514 else 515 { 516 init_devspd(_core_if); 517 } 518 519 if (_core_if->core_params->i2c_enable) 520 { 540 if (dwc_otg_is_host_mode(core_if)) { 541 init_fslspclksel(core_if); 542 } 543 else { 544 init_devspd(core_if); 545 } 546 547 if (core_if->core_params->i2c_enable) { 521 548 DWC_DEBUGPL(DBG_CIL, "FS_PHY Enabling I2c\n"); 522 549 /* Program GUSBCFG.OtgUtmifsSel to I2C */ … … 536 563 } /* endif speed == DWC_SPEED_PARAM_FULL */ 537 564 538 else 539 { 565 else { 540 566 /* High speed PHY. */ 541 if (!_core_if->phy_init_done) 542 { 543 _core_if->phy_init_done = 1; 567 if (!core_if->phy_init_done) { 568 core_if->phy_init_done = 1; 544 569 /* HS PHY parameters. These parameters are preserved 545 570 * during soft reset so only program the first time. Do 546 571 * a soft reset immediately after setting phyif. */ 547 usbcfg.b.ulpi_utmi_sel = _core_if->core_params->phy_type; 548 if (usbcfg.b.ulpi_utmi_sel == 1) 549 { 572 usbcfg.b.ulpi_utmi_sel = core_if->core_params->phy_type; 573 if (usbcfg.b.ulpi_utmi_sel == 1) { 550 574 /* ULPI interface */ 551 575 usbcfg.b.phyif = 0; 552 usbcfg.b.ddrsel = _core_if->core_params->phy_ulpi_ddr;576 usbcfg.b.ddrsel = core_if->core_params->phy_ulpi_ddr; 553 577 } 554 else 555 { 578 else { 556 579 /* UTMI+ interface */ 557 if ( _core_if->core_params->phy_utmi_width == 16) {580 if (core_if->core_params->phy_utmi_width == 16) { 558 581 usbcfg.b.phyif = 1; 559 582 } 560 else 561 { 583 else { 562 584 usbcfg.b.phyif = 0; 563 585 } 564 586 } 565 587 566 dwc_write_reg32( &global_regs->gusbcfg, usbcfg.d32);588 dwc_write_reg32(&global_regs->gusbcfg, usbcfg.d32); 567 589 568 590 /* Reset after setting the PHY parameters */ 569 dwc_otg_core_reset( _core_if ); 570 } 571 } 572 573 if ((_core_if->hwcfg2.b.hs_phy_type == 2) && 574 (_core_if->hwcfg2.b.fs_phy_type == 1) && 575 (_core_if->core_params->ulpi_fs_ls)) 576 { 591 dwc_otg_core_reset(core_if); 592 } 593 } 594 595 if ((core_if->hwcfg2.b.hs_phy_type == 2) && 596 (core_if->hwcfg2.b.fs_phy_type == 1) && 597 (core_if->core_params->ulpi_fs_ls)) { 577 598 DWC_DEBUGPL(DBG_CIL, "Setting ULPI FSLS\n"); 578 599 usbcfg.d32 = dwc_read_reg32(&global_regs->gusbcfg); … … 581 602 dwc_write_reg32(&global_regs->gusbcfg, usbcfg.d32); 582 603 } 583 else 584 { 604 else { 585 605 usbcfg.d32 = dwc_read_reg32(&global_regs->gusbcfg); 586 606 usbcfg.b.ulpi_fsls = 0; … … 590 610 591 611 /* Program the GAHBCFG Register.*/ 592 switch (_core_if->hwcfg2.b.architecture) 593 { 612 switch (core_if->hwcfg2.b.architecture) { 594 613 595 614 case DWC_SLAVE_ONLY_ARCH: … … 597 616 ahbcfg.b.nptxfemplvl_txfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_HALFEMPTY; 598 617 ahbcfg.b.ptxfemplvl = DWC_GAHBCFG_TXFEMPTYLVL_HALFEMPTY; 599 _core_if->dma_enable = 0; 618 core_if->dma_enable = 0; 619 core_if->dma_desc_enable = 0; 600 620 break; 601 621 602 622 case DWC_EXT_DMA_ARCH: 603 623 DWC_DEBUGPL(DBG_CIL, "External DMA Mode\n"); 604 ahbcfg.b.hburstlen = _core_if->core_params->dma_burst_size; 605 _core_if->dma_enable = (_core_if->core_params->dma_enable != 0); 624 ahbcfg.b.hburstlen = core_if->core_params->dma_burst_size; 625 core_if->dma_enable = (core_if->core_params->dma_enable != 0); 626 core_if->dma_desc_enable = (core_if->core_params->dma_desc_enable != 0); 606 627 break; 607 628 608 629 case DWC_INT_DMA_ARCH: 609 630 DWC_DEBUGPL(DBG_CIL, "Internal DMA Mode\n"); 610 ahbcfg.b.hburstlen = DWC_GAHBCFG_INT_DMA_BURST_INCR16; 611 _core_if->dma_enable = (_core_if->core_params->dma_enable != 0); 631 ahbcfg.b.hburstlen = DWC_GAHBCFG_INT_DMA_BURST_INCR; 632 core_if->dma_enable = (core_if->core_params->dma_enable != 0); 633 core_if->dma_desc_enable = (core_if->core_params->dma_desc_enable != 0); 612 634 break; 613 635 614 636 } 615 616 ahbcfg.b.dmaenable = _core_if->dma_enable; 637 ahbcfg.b.dmaenable = core_if->dma_enable; 617 638 dwc_write_reg32(&global_regs->gahbcfg, ahbcfg.d32); 618 639 619 _core_if->en_multiple_tx_fifo = _core_if->hwcfg4.b.ded_fifo_en; 620 640 core_if->en_multiple_tx_fifo = core_if->hwcfg4.b.ded_fifo_en; 641 642 core_if->pti_enh_enable = core_if->core_params->pti_enable != 0; 643 core_if->multiproc_int_enable = core_if->core_params->mpi_enable; 644 DWC_PRINT("Periodic Transfer Interrupt Enhancement - %s\n", ((core_if->pti_enh_enable) ? "enabled": "disabled")); 645 DWC_PRINT("Multiprocessor Interrupt Enhancement - %s\n", ((core_if->multiproc_int_enable) ? "enabled": "disabled")); 621 646 622 647 /* 623 648 * Program the GUSBCFG register. 624 649 */ 625 usbcfg.d32 = dwc_read_reg32( &global_regs->gusbcfg ); 626 627 switch (_core_if->hwcfg2.b.op_mode) 628 { 650 usbcfg.d32 = dwc_read_reg32(&global_regs->gusbcfg); 651 652 switch (core_if->hwcfg2.b.op_mode) { 629 653 case DWC_MODE_HNP_SRP_CAPABLE: 630 usbcfg.b.hnpcap = ( _core_if->core_params->otg_cap ==654 usbcfg.b.hnpcap = (core_if->core_params->otg_cap == 631 655 DWC_OTG_CAP_PARAM_HNP_SRP_CAPABLE); 632 usbcfg.b.srpcap = ( _core_if->core_params->otg_cap !=656 usbcfg.b.srpcap = (core_if->core_params->otg_cap != 633 657 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE); 634 658 break; … … 636 660 case DWC_MODE_SRP_ONLY_CAPABLE: 637 661 usbcfg.b.hnpcap = 0; 638 usbcfg.b.srpcap = ( _core_if->core_params->otg_cap !=662 usbcfg.b.srpcap = (core_if->core_params->otg_cap != 639 663 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE); 640 664 break; … … 647 671 case DWC_MODE_SRP_CAPABLE_DEVICE: 648 672 usbcfg.b.hnpcap = 0; 649 usbcfg.b.srpcap = ( _core_if->core_params->otg_cap !=673 usbcfg.b.srpcap = (core_if->core_params->otg_cap != 650 674 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE); 651 675 break; … … 658 682 case DWC_MODE_SRP_CAPABLE_HOST: 659 683 usbcfg.b.hnpcap = 0; 660 usbcfg.b.srpcap = ( _core_if->core_params->otg_cap !=684 usbcfg.b.srpcap = (core_if->core_params->otg_cap != 661 685 DWC_OTG_CAP_PARAM_NO_HNP_SRP_CAPABLE); 662 686 break; … … 668 692 } 669 693 670 dwc_write_reg32( &global_regs->gusbcfg, usbcfg.d32);694 dwc_write_reg32(&global_regs->gusbcfg, usbcfg.d32); 671 695 672 696 /* Enable common interrupts */ 673 dwc_otg_enable_common_interrupts( _core_if);697 dwc_otg_enable_common_interrupts(core_if); 674 698 675 699 /* Do device or host intialization based on mode during PCD 676 700 * and HCD initialization */ 677 if (dwc_otg_is_host_mode( _core_if )) 678 { 679 DWC_DEBUGPL(DBG_ANY, "Host Mode\n" ); 680 _core_if->op_state = A_HOST; 681 } 682 else 683 { 684 DWC_DEBUGPL(DBG_ANY, "Device Mode\n" ); 685 _core_if->op_state = B_PERIPHERAL; 701 if (dwc_otg_is_host_mode(core_if)) { 702 DWC_DEBUGPL(DBG_ANY, "Host Mode\n"); 703 core_if->op_state = A_HOST; 704 } 705 else { 706 DWC_DEBUGPL(DBG_ANY, "Device Mode\n"); 707 core_if->op_state = B_PERIPHERAL; 686 708 #ifdef DWC_DEVICE_ONLY 687 dwc_otg_core_dev_init( _core_if);709 dwc_otg_core_dev_init(core_if); 688 710 #endif 689 711 } … … 694 716 * This function enables the Device mode interrupts. 695 717 * 696 * @param _core_if Programming view of DWC_otg controller697 */ 698 void dwc_otg_enable_device_interrupts(dwc_otg_core_if_t * _core_if)718 * @param core_if Programming view of DWC_otg controller 719 */ 720 void dwc_otg_enable_device_interrupts(dwc_otg_core_if_t *core_if) 699 721 { 700 722 gintmsk_data_t intr_mask = { .d32 = 0}; 701 723 dwc_otg_core_global_regs_t *global_regs = 702 _core_if->core_global_regs;703 724 core_if->core_global_regs; 725 704 726 DWC_DEBUGPL(DBG_CIL, "%s()\n", __func__); 705 727 706 728 /* Disable all interrupts. */ 707 dwc_write_reg32( &global_regs->gintmsk, 0);729 dwc_write_reg32(&global_regs->gintmsk, 0); 708 730 709 731 /* Clear any pending interrupts */ 710 dwc_write_reg32( &global_regs->gintsts, 0xFFFFFFFF);732 dwc_write_reg32(&global_regs->gintsts, 0xFFFFFFFF); 711 733 712 734 /* Enable the common interrupts */ 713 dwc_otg_enable_common_interrupts( _core_if);735 dwc_otg_enable_common_interrupts(core_if); 714 736 715 737 /* Enable interrupts */ 716 738 intr_mask.b.usbreset = 1; 717 739 intr_mask.b.enumdone = 1; 718 intr_mask.b.inepintr = 1; 719 intr_mask.b.outepintr = 1; 740 741 if(!core_if->multiproc_int_enable) { 742 intr_mask.b.inepintr = 1; 743 intr_mask.b.outepintr = 1; 744 } 745 720 746 intr_mask.b.erlysuspend = 1; 721 747 722 if(_core_if->en_multiple_tx_fifo == 0) 723 { 748 if(core_if->en_multiple_tx_fifo == 0) { 724 749 intr_mask.b.epmismatch = 1; 725 750 } 726 751 727 /** @todo NGS: Should this be a module parameter? */ 752 753 #ifdef DWC_EN_ISOC 754 if(core_if->dma_enable) { 755 if(core_if->dma_desc_enable == 0) { 756 if(core_if->pti_enh_enable) { 757 dctl_data_t dctl = { .d32 = 0 }; 758 dctl.b.ifrmnum = 1; 759 dwc_modify_reg32(&core_if->dev_if->dev_global_regs->dctl, 0, dctl.d32); 760 } else { 761 intr_mask.b.incomplisoin = 1; 762 intr_mask.b.incomplisoout = 1; 763 } 764 } 765 } else { 766 intr_mask.b.incomplisoin = 1; 767 intr_mask.b.incomplisoout = 1; 768 } 769 #endif // DWC_EN_ISOC 770 771 /** @todo NGS: Should this be a module parameter? */ 728 772 #ifdef USE_PERIODIC_EP 729 773 intr_mask.b.isooutdrop = 1; … … 733 777 #endif 734 778 735 dwc_modify_reg32( &global_regs->gintmsk, intr_mask.d32, intr_mask.d32);779 dwc_modify_reg32(&global_regs->gintmsk, intr_mask.d32, intr_mask.d32); 736 780 737 781 DWC_DEBUGPL(DBG_CIL, "%s() gintmsk=%0x\n", __func__, 738 dwc_read_reg32( &global_regs->gintmsk));782 dwc_read_reg32(&global_regs->gintmsk)); 739 783 } 740 784 … … 743 787 * device mode. 744 788 * 745 * @param _core_if Programming view of DWC_otg controller746 * 747 */ 748 void dwc_otg_core_dev_init(dwc_otg_core_if_t * _core_if)789 * @param core_if Programming view of DWC_otg controller 790 * 791 */ 792 void dwc_otg_core_dev_init(dwc_otg_core_if_t *core_if) 749 793 { 750 794 int i; 751 795 dwc_otg_core_global_regs_t *global_regs = 752 _core_if->core_global_regs;753 dwc_otg_dev_if_t *dev_if = _core_if->dev_if;754 dwc_otg_core_params_t *params = _core_if->core_params;755 dcfg_data_t dcfg = { .d32 = 0};756 grstctl_t resetctl = { .d32 =0 };796 core_if->core_global_regs; 797 dwc_otg_dev_if_t *dev_if = core_if->dev_if; 798 dwc_otg_core_params_t *params = core_if->core_params; 799 dcfg_data_t dcfg = { .d32 = 0}; 800 grstctl_t resetctl = { .d32 = 0 }; 757 801 uint32_t rx_fifo_size; 758 802 fifosize_data_t nptxfifosize; … … 762 806 763 807 /* Restart the Phy Clock */ 764 dwc_write_reg32( _core_if->pcgcctl, 0);808 dwc_write_reg32(core_if->pcgcctl, 0); 765 809 766 810 /* Device configuration register */ 767 init_devspd(_core_if); 768 dcfg.d32 = dwc_read_reg32( &dev_if->dev_global_regs->dcfg); 811 init_devspd(core_if); 812 dcfg.d32 = dwc_read_reg32(&dev_if->dev_global_regs->dcfg); 813 dcfg.b.descdma = (core_if->dma_desc_enable) ? 1 : 0; 769 814 dcfg.b.perfrint = DWC_DCFG_FRAME_INTERVAL_80; 770 dwc_write_reg32( &dev_if->dev_global_regs->dcfg, dcfg.d32 ); 815 816 dwc_write_reg32(&dev_if->dev_global_regs->dcfg, dcfg.d32); 771 817 772 818 /* Configure data FIFO sizes */ 773 if ( _core_if->hwcfg2.b.dynamic_fifo && params->enable_dynamic_fifo ) 774 { 775 DWC_DEBUGPL(DBG_CIL, "Total FIFO Size=%d\n", _core_if->total_fifo_size); 819 if (core_if->hwcfg2.b.dynamic_fifo && params->enable_dynamic_fifo) { 820 DWC_DEBUGPL(DBG_CIL, "Total FIFO Size=%d\n", core_if->total_fifo_size); 776 821 DWC_DEBUGPL(DBG_CIL, "Rx FIFO Size=%d\n", params->dev_rx_fifo_size); 777 822 DWC_DEBUGPL(DBG_CIL, "NP Tx FIFO Size=%d\n", params->dev_nperio_tx_fifo_size); … … 782 827 783 828 rx_fifo_size = params->dev_rx_fifo_size; 784 dwc_write_reg32( &global_regs->grxfsiz, rx_fifo_size);829 dwc_write_reg32(&global_regs->grxfsiz, rx_fifo_size); 785 830 786 831 DWC_DEBUGPL(DBG_CIL, "new grxfsiz=%08x\n", … … 788 833 789 834 /** Set Periodic Tx FIFO Mask all bits 0 */ 790 _core_if->p_tx_msk = 0;835 core_if->p_tx_msk = 0; 791 836 792 837 /** Set Tx FIFO Mask all bits 0 */ 793 _core_if->tx_msk = 0; 794 795 if(_core_if->en_multiple_tx_fifo == 0) 796 { 838 core_if->tx_msk = 0; 839 840 if(core_if->en_multiple_tx_fifo == 0) { 797 841 /* Non-periodic Tx FIFO */ 798 842 DWC_DEBUGPL(DBG_CIL, "initial gnptxfsiz=%08x\n", … … 802 846 nptxfifosize.b.startaddr = params->dev_rx_fifo_size; 803 847 804 dwc_write_reg32( &global_regs->gnptxfsiz, nptxfifosize.d32);848 dwc_write_reg32(&global_regs->gnptxfsiz, nptxfifosize.d32); 805 849 806 850 DWC_DEBUGPL(DBG_CIL, "new gnptxfsiz=%08x\n", … … 816 860 /** @todo Finish debug of this */ 817 861 ptxfifosize.b.startaddr = nptxfifosize.b.startaddr + nptxfifosize.b.depth; 818 for (i=0; i < _core_if->hwcfg4.b.num_dev_perio_in_ep; i++)862 for (i=0; i < core_if->hwcfg4.b.num_dev_perio_in_ep; i++) 819 863 { 820 864 ptxfifosize.b.depth = params->dev_perio_tx_fifo_size[i]; 821 865 DWC_DEBUGPL(DBG_CIL, "initial dptxfsiz_dieptxf[%d]=%08x\n", i, 822 866 dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i])); 823 dwc_write_reg32( &global_regs->dptxfsiz_dieptxf[i],824 ptxfifosize.d32 );867 dwc_write_reg32(&global_regs->dptxfsiz_dieptxf[i], 868 ptxfifosize.d32); 825 869 DWC_DEBUGPL(DBG_CIL, "new dptxfsiz_dieptxf[%d]=%08x\n", i, 826 870 dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i])); … … 828 872 } 829 873 } 830 else 831 { 874 else { 832 875 /* 833 876 * Tx FIFOs These FIFOs are numbered from 1 to 15. … … 845 888 nptxfifosize.b.startaddr = params->dev_rx_fifo_size; 846 889 847 dwc_write_reg32( &global_regs->gnptxfsiz, nptxfifosize.d32);890 dwc_write_reg32(&global_regs->gnptxfsiz, nptxfifosize.d32); 848 891 849 892 DWC_DEBUGPL(DBG_CIL, "new gnptxfsiz=%08x\n", … … 865 908 #endif 866 909 { 867 //Modify by kaiker,910 868 911 txfifosize.b.depth = params->dev_tx_fifo_size[i]; 869 //txfifosize.b.depth = dev_if->tx_fifo_size[i];870 912 871 913 DWC_DEBUGPL(DBG_CIL, "initial dptxfsiz_dieptxf[%d]=%08x\n", i, 872 914 dwc_read_reg32(&global_regs->dptxfsiz_dieptxf[i])); 873 915 874 dwc_write_reg32( &global_regs->dptxfsiz_dieptxf[i-1],875 txfifosize.d32 );916 dwc_write_reg32(&global_regs->dptxfsiz_dieptxf[i-1], 917 txfifosize.d32); 876 918 877 919 DWC_DEBUGPL(DBG_CIL, "new dptxfsiz_dieptxf[%d]=%08x\n", i, … … 883 925 } 884 926 /* Flush the FIFOs */ 885 dwc_otg_flush_tx_fifo( _core_if, 0x10); /* all Tx FIFOs */886 dwc_otg_flush_rx_fifo( _core_if);927 dwc_otg_flush_tx_fifo(core_if, 0x10); /* all Tx FIFOs */ 928 dwc_otg_flush_rx_fifo(core_if); 887 929 888 930 /* Flush the Learning Queue. */ 889 931 resetctl.b.intknqflsh = 1; 890 dwc_write_reg32( &_core_if->core_global_regs->grstctl, resetctl.d32);932 dwc_write_reg32(&core_if->core_global_regs->grstctl, resetctl.d32); 891 933 892 934 /* Clear all pending Device Interrupts */ 893 dwc_write_reg32( &dev_if->dev_global_regs->diepmsk, 0 ); 894 dwc_write_reg32( &dev_if->dev_global_regs->doepmsk, 0 ); 895 dwc_write_reg32( &dev_if->dev_global_regs->daint, 0xFFFFFFFF ); 896 dwc_write_reg32( &dev_if->dev_global_regs->daintmsk, 0 ); 897 935 936 if(core_if->multiproc_int_enable) { 937 } 938 939 /** @todo - if the condition needed to be checked 940 * or in any case all pending interrutps should be cleared? 941 */ 942 if(core_if->multiproc_int_enable) { 943 for(i = 0; i < core_if->dev_if->num_in_eps; ++i) { 944 dwc_write_reg32(&dev_if->dev_global_regs->diepeachintmsk[i], 0); 945 } 946 947 for(i = 0; i < core_if->dev_if->num_out_eps; ++i) { 948 dwc_write_reg32(&dev_if->dev_global_regs->doepeachintmsk[i], 0); 949 } 950 951 dwc_write_reg32(&dev_if->dev_global_regs->deachint, 0xFFFFFFFF); 952 dwc_write_reg32(&dev_if->dev_global_regs->deachintmsk, 0); 953 } else { 954 dwc_write_reg32(&dev_if->dev_global_regs->diepmsk, 0); 955 dwc_write_reg32(&dev_if->dev_global_regs->doepmsk, 0); 956 dwc_write_reg32(&dev_if->dev_global_regs->daint, 0xFFFFFFFF); 957 dwc_write_reg32(&dev_if->dev_global_regs->daintmsk, 0); 958 } 959 898 960 for (i=0; i <= dev_if->num_in_eps; i++) 899 961 { 900 962 depctl_data_t depctl; 901 963 depctl.d32 = dwc_read_reg32(&dev_if->in_ep_regs[i]->diepctl); 902 if (depctl.b.epena) 903 { 964 if (depctl.b.epena) { 904 965 depctl.d32 = 0; 905 966 depctl.b.epdis = 1; 906 967 depctl.b.snak = 1; 907 968 } 908 else 909 { 969 else { 910 970 depctl.d32 = 0; 911 971 } 912 972 913 dwc_write_reg32( &dev_if->in_ep_regs[i]->diepctl, depctl.d32);914 915 916 dwc_write_reg32( &dev_if->in_ep_regs[i]->dieptsiz, 0);917 dwc_write_reg32( &dev_if->in_ep_regs[i]->diepdma, 0);918 dwc_write_reg32( &dev_if->in_ep_regs[i]->diepint, 0xFF);973 dwc_write_reg32(&dev_if->in_ep_regs[i]->diepctl, depctl.d32); 974 975 976 dwc_write_reg32(&dev_if->in_ep_regs[i]->dieptsiz, 0); 977 dwc_write_reg32(&dev_if->in_ep_regs[i]->diepdma, 0); 978 dwc_write_reg32(&dev_if->in_ep_regs[i]->diepint, 0xFF); 919 979 } 920 980 … … 923 983 depctl_data_t depctl; 924 984 depctl.d32 = dwc_read_reg32(&dev_if->out_ep_regs[i]->doepctl); 925 if (depctl.b.epena) 926 { 985 if (depctl.b.epena) { 927 986 depctl.d32 = 0; 928 987 depctl.b.epdis = 1; 929 988 depctl.b.snak = 1; 930 989 } 931 else 932 { 990 else { 933 991 depctl.d32 = 0; 934 992 } 935 993 936 dwc_write_reg32( &dev_if->out_ep_regs[i]->doepctl, depctl.d32); 937 938 dwc_write_reg32( &dev_if->out_ep_regs[i]->doeptsiz, 0); 939 dwc_write_reg32( &dev_if->out_ep_regs[i]->doepdma, 0); 940 dwc_write_reg32( &dev_if->out_ep_regs[i]->doepint, 0xFF); 941 } 942 943 if(_core_if->en_multiple_tx_fifo && _core_if->dma_enable) 944 { 945 dev_if->non_iso_tx_thr_en = _core_if->core_params->thr_ctl & 0x1; 946 dev_if->iso_tx_thr_en = (_core_if->core_params->thr_ctl >> 1) & 0x1; 947 dev_if->rx_thr_en = (_core_if->core_params->thr_ctl >> 2) & 0x1; 994 dwc_write_reg32(&dev_if->out_ep_regs[i]->doepctl, depctl.d32); 995 996 dwc_write_reg32(&dev_if->out_ep_regs[i]->doeptsiz, 0); 997 dwc_write_reg32(&dev_if->out_ep_regs[i]->doepdma, 0); 998 dwc_write_reg32(&dev_if->out_ep_regs[i]->doepint, 0xFF); 999 } 1000 1001 if(core_if->en_multiple_tx_fifo && core_if->dma_enable) { 1002 dev_if->non_iso_tx_thr_en = params->thr_ctl & 0x1; 1003 dev_if->iso_tx_thr_en = (params->thr_ctl >> 1) & 0x1; 1004 dev_if->rx_thr_en = (params->thr_ctl >> 2) & 0x1; 948 1005 949 dev_if->rx_thr_length = _core_if->core_params->rx_thr_length; 950 dev_if->tx_thr_length = _core_if->core_params->tx_thr_length; 951 1006 dev_if->rx_thr_length = params->rx_thr_length; 1007 dev_if->tx_thr_length = params->tx_thr_length; 1008 1009 dev_if->setup_desc_index = 0; 952 1010 953 1011 dthrctl.d32 = 0; … … 958 1016 dthrctl.b.rx_thr_len = dev_if->rx_thr_length; 959 1017 960 dwc_write_reg32( &dev_if->dev_global_regs->dtknqr3_dthrctl, dthrctl.d32);1018 dwc_write_reg32(&dev_if->dev_global_regs->dtknqr3_dthrctl, dthrctl.d32); 961 1019 962 1020 DWC_DEBUGPL(DBG_CIL, "Non ISO Tx Thr - %d\nISO Tx Thr - %d\nRx Thr - %d\nTx Thr Len - %d\nRx Thr Len - %d\n", … … 965 1023 } 966 1024 967 dwc_otg_enable_device_interrupts( _core_if);1025 dwc_otg_enable_device_interrupts(core_if); 968 1026 969 1027 { 970 diepmsk_data_t msk = { .d32 = 0};1028 diepmsk_data_t msk = { .d32 = 0 }; 971 1029 msk.b.txfifoundrn = 1; 972 dwc_modify_reg32(&dev_if->dev_global_regs->diepmsk, msk.d32, msk.d32); 973 } 974 975 1030 if(core_if->multiproc_int_enable) { 1031 dwc_modify_reg32(&dev_if->dev_global_regs->diepeachintmsk[0], msk.d32, msk.d32); 1032 } else { 1033 dwc_modify_reg32(&dev_if->dev_global_regs->diepmsk, msk.d32, msk.d32); 1034 } 1035 } 1036 1037 1038 if(core_if->multiproc_int_enable) { 1039 /* Set NAK on Babble */ 1040 dctl_data_t dctl = { .d32 = 0}; 1041 dctl.b.nakonbble = 1; 1042 dwc_modify_reg32(&dev_if->dev_global_regs->dctl, 0, dctl.d32); 1043 } 976 1044 } 977 1045 … … 979 1047 * This function enables the Host mode interrupts. 980 1048 * 981 * @param _core_if Programming view of DWC_otg controller982 */ 983 void dwc_otg_enable_host_interrupts(dwc_otg_core_if_t * _core_if)984 { 985 dwc_otg_core_global_regs_t *global_regs = _core_if->core_global_regs;986 gintmsk_data_t intr_mask = { .d32 = 0};1049 * @param core_if Programming view of DWC_otg controller 1050 */ 1051 void dwc_otg_enable_host_interrupts(dwc_otg_core_if_t *core_if) 1052 { 1053 dwc_otg_core_global_regs_t *global_regs = core_if->core_global_regs; 1054 gintmsk_data_t intr_mask = { .d32 = 0 }; 987 1055 988 1056 DWC_DEBUGPL(DBG_CIL, "%s()\n", __func__); … … 995 1063 996 1064 /* Enable the common interrupts */ 997 dwc_otg_enable_common_interrupts( _core_if);1065 dwc_otg_enable_common_interrupts(core_if); 998 1066 999 1067 /* … … 1011 1079 * This function disables the Host Mode interrupts. 1012 1080 * 1013 * @param _core_if Programming view of DWC_otg controller1014 */ 1015 void dwc_otg_disable_host_interrupts(dwc_otg_core_if_t * _core_if)1081 * @param core_if Programming view of DWC_otg controller 1082 */ 1083 void dwc_otg_disable_host_interrupts(dwc_otg_core_if_t *core_if) 1016 1084 { 1017 1085 dwc_otg_core_global_regs_t *global_regs = 1018 _core_if->core_global_regs;1019 gintmsk_data_t intr_mask = { .d32 = 0};1086 core_if->core_global_regs; 1087 gintmsk_data_t intr_mask = { .d32 = 0 }; 1020 1088 1021 1089 DWC_DEBUGPL(DBG_CILV, "%s()\n", __func__); … … 1042 1110 * performing transfers. 1043 1111 * 1044 * @param _core_if Programming view of DWC_otg controller1045 * 1046 */ 1047 void dwc_otg_core_host_init(dwc_otg_core_if_t * _core_if)1048 { 1049 dwc_otg_core_global_regs_t *global_regs = _core_if->core_global_regs;1050 dwc_otg_host_if_t *host_if = _core_if->host_if;1051 dwc_otg_core_params_t *params = _core_if->core_params;1052 hprt0_data_t hprt0 = { .d32 = 0};1112 * @param core_if Programming view of DWC_otg controller 1113 * 1114 */ 1115 void dwc_otg_core_host_init(dwc_otg_core_if_t *core_if) 1116 { 1117 dwc_otg_core_global_regs_t *global_regs = core_if->core_global_regs; 1118 dwc_otg_host_if_t *host_if = core_if->host_if; 1119 dwc_otg_core_params_t *params = core_if->core_params; 1120 hprt0_data_t hprt0 = { .d32 = 0 }; 1053 1121 fifosize_data_t nptxfifosize; 1054 1122 fifosize_data_t ptxfifosize; … … 1058 1126 dwc_otg_hc_regs_t *hc_regs; 1059 1127 int num_channels; 1060 gotgctl_data_t gotgctl = { .d32 = 0};1061 1062 DWC_DEBUGPL(DBG_CILV,"%s(%p)\n", __func__, _core_if);1128 gotgctl_data_t gotgctl = { .d32 = 0 }; 1129 1130 DWC_DEBUGPL(DBG_CILV,"%s(%p)\n", __func__, core_if); 1063 1131 1064 1132 /* Restart the Phy Clock */ 1065 dwc_write_reg32( _core_if->pcgcctl, 0);1133 dwc_write_reg32(core_if->pcgcctl, 0); 1066 1134 1067 1135 /* Initialize Host Configuration Register */ 1068 init_fslspclksel( _core_if);1069 if ( _core_if->core_params->speed == DWC_SPEED_PARAM_FULL)1136 init_fslspclksel(core_if); 1137 if (core_if->core_params->speed == DWC_SPEED_PARAM_FULL) 1070 1138 { 1071 1139 hcfg.d32 = dwc_read_reg32(&host_if->host_global_regs->hcfg); … … 1075 1143 1076 1144 /* Configure data FIFO sizes */ 1077 if (_core_if->hwcfg2.b.dynamic_fifo && params->enable_dynamic_fifo) 1078 { 1079 DWC_DEBUGPL(DBG_CIL,"Total FIFO Size=%d\n", _core_if->total_fifo_size); 1145 if (core_if->hwcfg2.b.dynamic_fifo && params->enable_dynamic_fifo) { 1146 DWC_DEBUGPL(DBG_CIL,"Total FIFO Size=%d\n", core_if->total_fifo_size); 1080 1147 DWC_DEBUGPL(DBG_CIL,"Rx FIFO Size=%d\n", params->host_rx_fifo_size); 1081 1148 DWC_DEBUGPL(DBG_CIL,"NP Tx FIFO Size=%d\n", params->host_nperio_tx_fifo_size); 1082 1149 DWC_DEBUGPL(DBG_CIL,"P Tx FIFO Size=%d\n", params->host_perio_tx_fifo_size); 1083 1084 /* Rx FIFO */ 1150 1151 /* Rx FIFO */ 1085 1152 DWC_DEBUGPL(DBG_CIL,"initial grxfsiz=%08x\n", dwc_read_reg32(&global_regs->grxfsiz)); 1086 1153 dwc_write_reg32(&global_regs->grxfsiz, params->host_rx_fifo_size); … … 1104 1171 /* Clear Host Set HNP Enable in the OTG Control Register */ 1105 1172 gotgctl.b.hstsethnpen = 1; 1106 dwc_modify_reg32( &global_regs->gotgctl, gotgctl.d32, 0);1173 dwc_modify_reg32(&global_regs->gotgctl, gotgctl.d32, 0); 1107 1174 1108 1175 /* Make sure the FIFOs are flushed. */ 1109 dwc_otg_flush_tx_fifo( _core_if, 0x10 /* all Tx FIFOs */);1110 dwc_otg_flush_rx_fifo( _core_if);1176 dwc_otg_flush_tx_fifo(core_if, 0x10 /* all Tx FIFOs */); 1177 dwc_otg_flush_rx_fifo(core_if); 1111 1178 1112 1179 /* Flush out any leftover queued requests. */ 1113 num_channels = _core_if->core_params->host_channels;1180 num_channels = core_if->core_params->host_channels; 1114 1181 for (i = 0; i < num_channels; i++) 1115 1182 { 1116 hc_regs = _core_if->host_if->hc_regs[i];1183 hc_regs = core_if->host_if->hc_regs[i]; 1117 1184 hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); 1118 1185 hcchar.b.chen = 0; … … 1126 1193 { 1127 1194 int count = 0; 1128 hc_regs = _core_if->host_if->hc_regs[i];1195 hc_regs = core_if->host_if->hc_regs[i]; 1129 1196 hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); 1130 1197 hcchar.b.chen = 1; … … 1133 1200 dwc_write_reg32(&hc_regs->hcchar, hcchar.d32); 1134 1201 DWC_DEBUGPL(DBG_HCDV, "%s: Halt channel %d\n", __func__, i); 1135 do 1136 { 1202 do { 1137 1203 hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); 1138 1204 if (++count > 1000) … … 1147 1213 1148 1214 /* Turn on the vbus power. */ 1149 DWC_PRINT("Init: Port Power? op_state=%d\n", _core_if->op_state); 1150 if (_core_if->op_state == A_HOST) 1151 { 1152 hprt0.d32 = dwc_otg_read_hprt0(_core_if); 1215 DWC_PRINT("Init: Port Power? op_state=%d\n", core_if->op_state); 1216 if (core_if->op_state == A_HOST) { 1217 hprt0.d32 = dwc_otg_read_hprt0(core_if); 1153 1218 DWC_PRINT("Init: Power Port (%d)\n", hprt0.b.prtpwr); 1154 if (hprt0.b.prtpwr == 0 ) 1155 { 1219 if (hprt0.b.prtpwr == 0) { 1156 1220 hprt0.b.prtpwr = 1; 1157 1221 dwc_write_reg32(host_if->hprt0, hprt0.d32); … … 1159 1223 } 1160 1224 1161 dwc_otg_enable_host_interrupts( _core_if);1225 dwc_otg_enable_host_interrupts(core_if); 1162 1226 } 1163 1227 … … 1168 1232 * transfer is in progress are enabled. 1169 1233 * 1170 * @param _core_if Programming view of DWC_otg controller1171 * @param _hc Information needed to initialize the host channel1172 */ 1173 void dwc_otg_hc_init(dwc_otg_core_if_t * _core_if, dwc_hc_t *_hc)1234 * @param core_if Programming view of DWC_otg controller 1235 * @param hc Information needed to initialize the host channel 1236 */ 1237 void dwc_otg_hc_init(dwc_otg_core_if_t *core_if, dwc_hc_t *hc) 1174 1238 { 1175 1239 uint32_t intr_enable; 1176 1240 hcintmsk_data_t hc_intr_mask; 1177 gintmsk_data_t gintmsk = { .d32 = 0};1241 gintmsk_data_t gintmsk = { .d32 = 0 }; 1178 1242 hcchar_data_t hcchar; 1179 1243 hcsplt_data_t hcsplt; 1180 1244 1181 uint8_t hc_num = _hc->hc_num;1182 dwc_otg_host_if_t *host_if = _core_if->host_if;1245 uint8_t hc_num = hc->hc_num; 1246 dwc_otg_host_if_t *host_if = core_if->host_if; 1183 1247 dwc_otg_hc_regs_t *hc_regs = host_if->hc_regs[hc_num]; 1184 1248 … … 1191 1255 hc_intr_mask.d32 = 0; 1192 1256 hc_intr_mask.b.chhltd = 1; 1193 if (_core_if->dma_enable) 1194 { 1257 if (core_if->dma_enable) { 1195 1258 hc_intr_mask.b.ahberr = 1; 1196 if (_hc->error_state && !_hc->do_split && 1197 _hc->ep_type != DWC_OTG_EP_TYPE_ISOC) 1198 { 1259 if (hc->error_state && !hc->do_split && 1260 hc->ep_type != DWC_OTG_EP_TYPE_ISOC) { 1199 1261 hc_intr_mask.b.ack = 1; 1200 if (_hc->ep_is_in) 1201 { 1262 if (hc->ep_is_in) { 1202 1263 hc_intr_mask.b.datatglerr = 1; 1203 if (_hc->ep_type != DWC_OTG_EP_TYPE_INTR) 1204 { 1264 if (hc->ep_type != DWC_OTG_EP_TYPE_INTR) { 1205 1265 hc_intr_mask.b.nak = 1; 1206 1266 } … … 1208 1268 } 1209 1269 } 1210 else 1211 { 1212 switch (_hc->ep_type) 1213 { 1270 else { 1271 switch (hc->ep_type) { 1214 1272 case DWC_OTG_EP_TYPE_CONTROL: 1215 1273 case DWC_OTG_EP_TYPE_BULK: … … 1218 1276 hc_intr_mask.b.xacterr = 1; 1219 1277 hc_intr_mask.b.datatglerr = 1; 1220 if (_hc->ep_is_in) 1221 { 1278 if (hc->ep_is_in) { 1222 1279 hc_intr_mask.b.bblerr = 1; 1223 1280 } 1224 else 1225 { 1281 else { 1226 1282 hc_intr_mask.b.nak = 1; 1227 1283 hc_intr_mask.b.nyet = 1; 1228 if (_hc->do_ping) 1229 { 1284 if (hc->do_ping) { 1230 1285 hc_intr_mask.b.ack = 1; 1231 1286 } 1232 1287 } 1233 1288 1234 if (_hc->do_split) 1235 { 1289 if (hc->do_split) { 1236 1290 hc_intr_mask.b.nak = 1; 1237 if (_hc->complete_split) 1238 { 1291 if (hc->complete_split) { 1239 1292 hc_intr_mask.b.nyet = 1; 1240 1293 } 1241 else 1242 { 1294 else { 1243 1295 hc_intr_mask.b.ack = 1; 1244 1296 } 1245 1297 } 1246 1298 1247 if (_hc->error_state) 1248 { 1299 if (hc->error_state) { 1249 1300 hc_intr_mask.b.ack = 1; 1250 1301 } … … 1258 1309 hc_intr_mask.b.frmovrun = 1; 1259 1310 1260 if (_hc->ep_is_in) 1261 { 1311 if (hc->ep_is_in) { 1262 1312 hc_intr_mask.b.bblerr = 1; 1263 1313 } 1264 if (_hc->error_state) 1265 { 1314 if (hc->error_state) { 1266 1315 hc_intr_mask.b.ack = 1; 1267 1316 } 1268 if (_hc->do_split) 1269 { 1270 if (_hc->complete_split) 1271 { 1317 if (hc->do_split) { 1318 if (hc->complete_split) { 1272 1319 hc_intr_mask.b.nyet = 1; 1273 1320 } 1274 else 1275 { 1321 else { 1276 1322 hc_intr_mask.b.ack = 1; 1277 1323 } … … 1283 1329 hc_intr_mask.b.ack = 1; 1284 1330 1285 if (_hc->ep_is_in) 1286 { 1331 if (hc->ep_is_in) { 1287 1332 hc_intr_mask.b.xacterr = 1; 1288 1333 hc_intr_mask.b.bblerr = 1; … … 1293 1338 dwc_write_reg32(&hc_regs->hcintmsk, hc_intr_mask.d32); 1294 1339 1340 // if(hc->ep_type == DWC_OTG_EP_TYPE_BULK && !hc->ep_is_in) 1341 // hc->max_packet = 512; 1295 1342 /* Enable the top level host channel interrupt. */ 1296 1343 intr_enable = (1 << hc_num); … … 1299 1346 /* Make sure host channel interrupts are enabled. */ 1300 1347 gintmsk.b.hcintr = 1; 1301 dwc_modify_reg32(& _core_if->core_global_regs->gintmsk, 0, gintmsk.d32);1348 dwc_modify_reg32(&core_if->core_global_regs->gintmsk, 0, gintmsk.d32); 1302 1349 1303 1350 /* … … 1306 1353 */ 1307 1354 hcchar.d32 = 0; 1308 hcchar.b.devaddr = _hc->dev_addr;1309 hcchar.b.epnum = _hc->ep_num;1310 hcchar.b.epdir = _hc->ep_is_in;1311 hcchar.b.lspddev = ( _hc->speed == DWC_OTG_EP_SPEED_LOW);1312 hcchar.b.eptype = _hc->ep_type;1313 hcchar.b.mps = _hc->max_packet;1355 hcchar.b.devaddr = hc->dev_addr; 1356 hcchar.b.epnum = hc->ep_num; 1357 hcchar.b.epdir = hc->ep_is_in; 1358 hcchar.b.lspddev = (hc->speed == DWC_OTG_EP_SPEED_LOW); 1359 hcchar.b.eptype = hc->ep_type; 1360 hcchar.b.mps = hc->max_packet; 1314 1361 1315 1362 dwc_write_reg32(&host_if->hc_regs[hc_num]->hcchar, hcchar.d32); 1316 1363 1317 DWC_DEBUGPL(DBG_HCDV, "%s: Channel %d\n", __func__, _hc->hc_num);1364 DWC_DEBUGPL(DBG_HCDV, "%s: Channel %d\n", __func__, hc->hc_num); 1318 1365 DWC_DEBUGPL(DBG_HCDV, " Dev Addr: %d\n", hcchar.b.devaddr); 1319 1366 DWC_DEBUGPL(DBG_HCDV, " Ep Num: %d\n", hcchar.b.epnum); … … 1328 1375 */ 1329 1376 hcsplt.d32 = 0; 1330 if (_hc->do_split) 1331 { 1332 DWC_DEBUGPL(DBG_HCDV, "Programming HC %d with split --> %s\n", _hc->hc_num, 1333 _hc->complete_split ? "CSPLIT" : "SSPLIT"); 1334 hcsplt.b.compsplt = _hc->complete_split; 1335 hcsplt.b.xactpos = _hc->xact_pos; 1336 hcsplt.b.hubaddr = _hc->hub_addr; 1337 hcsplt.b.prtaddr = _hc->port_addr; 1338 DWC_DEBUGPL(DBG_HCDV, " comp split %d\n", _hc->complete_split); 1339 DWC_DEBUGPL(DBG_HCDV, " xact pos %d\n", _hc->xact_pos); 1340 DWC_DEBUGPL(DBG_HCDV, " hub addr %d\n", _hc->hub_addr); 1341 DWC_DEBUGPL(DBG_HCDV, " port addr %d\n", _hc->port_addr); 1342 DWC_DEBUGPL(DBG_HCDV, " is_in %d\n", _hc->ep_is_in); 1377 if (hc->do_split) { 1378 DWC_DEBUGPL(DBG_HCDV, "Programming HC %d with split --> %s\n", hc->hc_num, 1379 hc->complete_split ? "CSPLIT" : "SSPLIT"); 1380 hcsplt.b.compsplt = hc->complete_split; 1381 hcsplt.b.xactpos = hc->xact_pos; 1382 hcsplt.b.hubaddr = hc->hub_addr; 1383 hcsplt.b.prtaddr = hc->port_addr; 1384 DWC_DEBUGPL(DBG_HCDV, " comp split %d\n", hc->complete_split); 1385 DWC_DEBUGPL(DBG_HCDV, " xact pos %d\n", hc->xact_pos); 1386 DWC_DEBUGPL(DBG_HCDV, " hub addr %d\n", hc->hub_addr); 1387 DWC_DEBUGPL(DBG_HCDV, " port addr %d\n", hc->port_addr); 1388 DWC_DEBUGPL(DBG_HCDV, " is_in %d\n", hc->ep_is_in); 1343 1389 DWC_DEBUGPL(DBG_HCDV, " Max Pkt: %d\n", hcchar.b.mps); 1344 DWC_DEBUGPL(DBG_HCDV, " xferlen: %d\n", _hc->xfer_len);1390 DWC_DEBUGPL(DBG_HCDV, " xferlen: %d\n", hc->xfer_len); 1345 1391 } 1346 1392 dwc_write_reg32(&host_if->hc_regs[hc_num]->hcsplt, hcsplt.d32); … … 1371 1417 * deactivation of the host channel. 1372 1418 * 1373 * @param _core_if Controller register interface.1374 * @param _hc Host channel to halt.1375 * @param _halt_status Reason for halting the channel.1376 */ 1377 void dwc_otg_hc_halt(dwc_otg_core_if_t * _core_if,1378 dwc_hc_t * _hc,1379 dwc_otg_halt_status_e _halt_status)1419 * @param core_if Controller register interface. 1420 * @param hc Host channel to halt. 1421 * @param halt_status Reason for halting the channel. 1422 */ 1423 void dwc_otg_hc_halt(dwc_otg_core_if_t *core_if, 1424 dwc_hc_t *hc, 1425 dwc_otg_halt_status_e halt_status) 1380 1426 { 1381 1427 gnptxsts_data_t nptxsts; … … 1386 1432 dwc_otg_host_global_regs_t *host_global_regs; 1387 1433 1388 hc_regs = _core_if->host_if->hc_regs[_hc->hc_num]; 1389 global_regs = _core_if->core_global_regs; 1390 host_global_regs = _core_if->host_if->host_global_regs; 1391 1392 WARN_ON(_halt_status == DWC_OTG_HC_XFER_NO_HALT_STATUS); 1393 1394 if (_halt_status == DWC_OTG_HC_XFER_URB_DEQUEUE || 1395 _halt_status == DWC_OTG_HC_XFER_AHB_ERR) 1396 { 1434 hc_regs = core_if->host_if->hc_regs[hc->hc_num]; 1435 global_regs = core_if->core_global_regs; 1436 host_global_regs = core_if->host_if->host_global_regs; 1437 1438 WARN_ON(halt_status == DWC_OTG_HC_XFER_NO_HALT_STATUS); 1439 1440 if (halt_status == DWC_OTG_HC_XFER_URB_DEQUEUE || 1441 halt_status == DWC_OTG_HC_XFER_AHB_ERR) { 1397 1442 /* 1398 1443 * Disable all channel interrupts except Ch Halted. The QTD … … 1418 1463 * reason. 1419 1464 */ 1420 _hc->halt_status = _halt_status;1465 hc->halt_status = halt_status; 1421 1466 1422 1467 hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); 1423 if (hcchar.b.chen == 0) 1424 { 1468 if (hcchar.b.chen == 0) { 1425 1469 /* 1426 1470 * The channel is either already halted or it hasn't … … 1438 1482 } 1439 1483 1440 if (_hc->halt_pending) 1441 { 1484 if (hc->halt_pending) { 1442 1485 /* 1443 1486 * A halt has already been issued for this channel. This might … … 1447 1490 #ifdef DEBUG 1448 1491 DWC_PRINT("*** %s: Channel %d, _hc->halt_pending already set ***\n", 1449 __func__, _hc->hc_num);1450 1451 /* dwc_otg_dump_global_registers( _core_if); */1452 /* dwc_otg_dump_host_registers( _core_if); */1492 __func__, hc->hc_num); 1493 1494 /* dwc_otg_dump_global_registers(core_if); */ 1495 /* dwc_otg_dump_host_registers(core_if); */ 1453 1496 #endif 1454 1497 return; … … 1459 1502 hcchar.b.chdis = 1; 1460 1503 1461 if (!_core_if->dma_enable) 1462 { 1504 if (!core_if->dma_enable) { 1463 1505 /* Check for space in the request queue to issue the halt. */ 1464 if (_hc->ep_type == DWC_OTG_EP_TYPE_CONTROL || 1465 _hc->ep_type == DWC_OTG_EP_TYPE_BULK) 1466 { 1506 if (hc->ep_type == DWC_OTG_EP_TYPE_CONTROL || 1507 hc->ep_type == DWC_OTG_EP_TYPE_BULK) { 1467 1508 nptxsts.d32 = dwc_read_reg32(&global_regs->gnptxsts); 1468 if (nptxsts.b.nptxqspcavail == 0) 1469 { 1509 if (nptxsts.b.nptxqspcavail == 0) { 1470 1510 hcchar.b.chen = 0; 1471 1511 } 1472 1512 } 1473 else 1474 { 1513 else { 1475 1514 hptxsts.d32 = dwc_read_reg32(&host_global_regs->hptxsts); 1476 if ((hptxsts.b.ptxqspcavail == 0) || (_core_if->queuing_high_bandwidth)) 1477 { 1515 if ((hptxsts.b.ptxqspcavail == 0) || (core_if->queuing_high_bandwidth)) { 1478 1516 hcchar.b.chen = 0; 1479 1517 } … … 1483 1521 dwc_write_reg32(&hc_regs->hcchar, hcchar.d32); 1484 1522 1485 _hc->halt_status = _halt_status; 1486 1487 if (hcchar.b.chen) 1488 { 1489 _hc->halt_pending = 1; 1490 _hc->halt_on_queue = 0; 1523 hc->halt_status = halt_status; 1524 1525 if (hcchar.b.chen) { 1526 hc->halt_pending = 1; 1527 hc->halt_on_queue = 0; 1491 1528 } 1492 else 1493 { 1494 _hc->halt_on_queue = 1; 1495 } 1496 1497 DWC_DEBUGPL(DBG_HCDV, "%s: Channel %d\n", __func__, _hc->hc_num); 1529 else { 1530 hc->halt_on_queue = 1; 1531 } 1532 1533 DWC_DEBUGPL(DBG_HCDV, "%s: Channel %d\n", __func__, hc->hc_num); 1498 1534 DWC_DEBUGPL(DBG_HCDV, " hcchar: 0x%08x\n", hcchar.d32); 1499 DWC_DEBUGPL(DBG_HCDV, " halt_pending: %d\n", _hc->halt_pending);1500 DWC_DEBUGPL(DBG_HCDV, " halt_on_queue: %d\n", _hc->halt_on_queue);1501 DWC_DEBUGPL(DBG_HCDV, " halt_status: %d\n", _hc->halt_status);1535 DWC_DEBUGPL(DBG_HCDV, " halt_pending: %d\n", hc->halt_pending); 1536 DWC_DEBUGPL(DBG_HCDV, " halt_on_queue: %d\n", hc->halt_on_queue); 1537 DWC_DEBUGPL(DBG_HCDV, " halt_status: %d\n", hc->halt_status); 1502 1538 1503 1539 return; … … 1508 1544 * called after a transfer is done and the host channel is being released. 1509 1545 * 1510 * @param _core_if Programming view of DWC_otg controller.1511 * @param _hc Identifies the host channel to clean up.1512 */ 1513 void dwc_otg_hc_cleanup(dwc_otg_core_if_t * _core_if, dwc_hc_t *_hc)1546 * @param core_if Programming view of DWC_otg controller. 1547 * @param hc Identifies the host channel to clean up. 1548 */ 1549 void dwc_otg_hc_cleanup(dwc_otg_core_if_t *core_if, dwc_hc_t *hc) 1514 1550 { 1515 1551 dwc_otg_hc_regs_t *hc_regs; 1516 1552 1517 _hc->xfer_started = 0;1553 hc->xfer_started = 0; 1518 1554 1519 1555 /* … … 1521 1557 * conditions. 1522 1558 */ 1523 hc_regs = _core_if->host_if->hc_regs[_hc->hc_num];1559 hc_regs = core_if->host_if->hc_regs[hc->hc_num]; 1524 1560 dwc_write_reg32(&hc_regs->hcintmsk, 0); 1525 1561 dwc_write_reg32(&hc_regs->hcint, 0xFFFFFFFF); 1526 1562 1527 1563 #ifdef DEBUG 1528 del_timer(& _core_if->hc_xfer_timer[_hc->hc_num]);1564 del_timer(&core_if->hc_xfer_timer[hc->hc_num]); 1529 1565 { 1530 1566 hcchar_data_t hcchar; 1531 1567 hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); 1532 if (hcchar.b.chdis) 1533 { 1568 if (hcchar.b.chdis) { 1534 1569 DWC_WARN("%s: chdis set, channel %d, hcchar 0x%08x\n", 1535 __func__, _hc->hc_num, hcchar.d32);1570 __func__, hc->hc_num, hcchar.d32); 1536 1571 } 1537 1572 } … … 1544 1579 * effect on non-periodic transfers. 1545 1580 * 1546 * @param _core_if Programming view of DWC_otg controller.1547 * @param _hc Identifies the host channel to set up and its properties.1548 * @param _hcchar Current value of the HCCHAR register for the specified host1581 * @param core_if Programming view of DWC_otg controller. 1582 * @param hc Identifies the host channel to set up and its properties. 1583 * @param hcchar Current value of the HCCHAR register for the specified host 1549 1584 * channel. 1550 1585 */ 1551 static inline void hc_set_even_odd_frame(dwc_otg_core_if_t *_core_if, 1552 dwc_hc_t *_hc, 1553 hcchar_data_t *_hcchar) 1554 { 1555 if (_hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1556 _hc->ep_type == DWC_OTG_EP_TYPE_ISOC) 1557 { 1586 static inline void hc_set_even_odd_frame(dwc_otg_core_if_t *core_if, 1587 dwc_hc_t *hc, 1588 hcchar_data_t *hcchar) 1589 { 1590 if (hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1591 hc->ep_type == DWC_OTG_EP_TYPE_ISOC) { 1558 1592 hfnum_data_t hfnum; 1559 hfnum.d32 = dwc_read_reg32(& _core_if->host_if->host_global_regs->hfnum);1593 hfnum.d32 = dwc_read_reg32(&core_if->host_if->host_global_regs->hfnum); 1560 1594 1561 1595 /* 1 if _next_ frame is odd, 0 if it's even */ 1562 _hcchar->b.oddfrm = (hfnum.b.frnum & 0x1) ? 0 : 1;1596 hcchar->b.oddfrm = (hfnum.b.frnum & 0x1) ? 0 : 1; 1563 1597 #ifdef DEBUG 1564 if (_hc->ep_type == DWC_OTG_EP_TYPE_INTR && _hc->do_split && !_hc->complete_split) 1565 { 1566 switch (hfnum.b.frnum & 0x7) 1567 { 1598 if (hc->ep_type == DWC_OTG_EP_TYPE_INTR && hc->do_split && !hc->complete_split) { 1599 switch (hfnum.b.frnum & 0x7) { 1568 1600 case 7: 1569 _core_if->hfnum_7_samples++;1570 _core_if->hfnum_7_frrem_accum += hfnum.b.frrem;1601 core_if->hfnum_7_samples++; 1602 core_if->hfnum_7_frrem_accum += hfnum.b.frrem; 1571 1603 break; 1572 1604 case 0: 1573 _core_if->hfnum_0_samples++;1574 _core_if->hfnum_0_frrem_accum += hfnum.b.frrem;1605 core_if->hfnum_0_samples++; 1606 core_if->hfnum_0_frrem_accum += hfnum.b.frrem; 1575 1607 break; 1576 1608 default: 1577 _core_if->hfnum_other_samples++;1578 _core_if->hfnum_other_frrem_accum += hfnum.b.frrem;1609 core_if->hfnum_other_samples++; 1610 core_if->hfnum_other_frrem_accum += hfnum.b.frrem; 1579 1611 break; 1580 1612 } … … 1585 1617 1586 1618 #ifdef DEBUG 1587 static void hc_xfer_timeout(unsigned long _ptr)1588 { 1589 hc_xfer_info_t *xfer_info = (hc_xfer_info_t *) _ptr;1619 static void hc_xfer_timeout(unsigned long ptr) 1620 { 1621 hc_xfer_info_t *xfer_info = (hc_xfer_info_t *)ptr; 1590 1622 int hc_num = xfer_info->hc->hc_num; 1591 1623 DWC_WARN("%s: timeout on channel %d\n", __func__, hc_num); … … 1608 1640 * additional data packets are requested in the Host ISR. 1609 1641 * 1610 * For a PING transfer in Slave mode, the Do Ping bit is set in the HCTSIZ 1642 * For a PING transfer in Slave mode, the Do Ping bit is set in the egards, 1643 * 1644 * Steven 1645 * 1611 1646 * register along with a packet count of 1 and the channel is enabled. This 1612 1647 * causes a single PING transaction to occur. Other fields in HCTSIZ are … … 1619 1654 * transfer. 1620 1655 * 1621 * @param _core_if Programming view of DWC_otg controller.1622 * @param _hc Information needed to initialize the host channel. The xfer_len1656 * @param core_if Programming view of DWC_otg controller. 1657 * @param hc Information needed to initialize the host channel. The xfer_len 1623 1658 * value may be reduced to accommodate the max widths of the XferSize and 1624 1659 * PktCnt fields in the HCTSIZn register. The multi_count value may be changed 1625 1660 * to reflect the final xfer_len value. 1626 1661 */ 1627 void dwc_otg_hc_start_transfer(dwc_otg_core_if_t * _core_if, dwc_hc_t *_hc)1662 void dwc_otg_hc_start_transfer(dwc_otg_core_if_t *core_if, dwc_hc_t *hc) 1628 1663 { 1629 1664 hcchar_data_t hcchar; 1630 1665 hctsiz_data_t hctsiz; 1631 1666 uint16_t num_packets; 1632 uint32_t max_hc_xfer_size = _core_if->core_params->max_transfer_size;1633 uint16_t max_hc_pkt_count = _core_if->core_params->max_packet_count;1634 dwc_otg_hc_regs_t *hc_regs = _core_if->host_if->hc_regs[_hc->hc_num];1667 uint32_t max_hc_xfer_size = core_if->core_params->max_transfer_size; 1668 uint16_t max_hc_pkt_count = core_if->core_params->max_packet_count; 1669 dwc_otg_hc_regs_t *hc_regs = core_if->host_if->hc_regs[hc->hc_num]; 1635 1670 1636 1671 hctsiz.d32 = 0; 1637 1672 1638 if (_hc->do_ping) 1639 { 1640 if (!_core_if->dma_enable) 1641 { 1642 dwc_otg_hc_do_ping(_core_if, _hc); 1643 _hc->xfer_started = 1; 1673 if (hc->do_ping) { 1674 if (!core_if->dma_enable) { 1675 dwc_otg_hc_do_ping(core_if, hc); 1676 hc->xfer_started = 1; 1644 1677 return; 1645 1678 } 1646 else 1647 { 1679 else { 1648 1680 hctsiz.b.dopng = 1; 1649 1681 } 1650 1682 } 1651 1683 1652 if (_hc->do_split) 1653 { 1684 if (hc->do_split) { 1654 1685 num_packets = 1; 1655 1686 1656 if (_hc->complete_split && !_hc->ep_is_in) 1657 { 1687 if (hc->complete_split && !hc->ep_is_in) { 1658 1688 /* For CSPLIT OUT Transfer, set the size to 0 so the 1659 1689 * core doesn't expect any data written to the FIFO */ 1660 _hc->xfer_len = 0;1690 hc->xfer_len = 0; 1661 1691 } 1662 else if (_hc->ep_is_in || (_hc->xfer_len > _hc->max_packet)) 1663 { 1664 _hc->xfer_len = _hc->max_packet; 1692 else if (hc->ep_is_in || (hc->xfer_len > hc->max_packet)) { 1693 hc->xfer_len = hc->max_packet; 1665 1694 } 1666 else if (!_hc->ep_is_in && (_hc->xfer_len > 188)) 1667 { 1668 _hc->xfer_len = 188; 1669 } 1670 1671 hctsiz.b.xfersize = _hc->xfer_len; 1695 else if (!hc->ep_is_in && (hc->xfer_len > 188)) { 1696 hc->xfer_len = 188; 1697 } 1698 1699 hctsiz.b.xfersize = hc->xfer_len; 1672 1700 } 1673 else 1674 { 1701 else { 1675 1702 /* 1676 1703 * Ensure that the transfer length and packet count will fit 1677 1704 * in the widths allocated for them in the HCTSIZn register. 1678 1705 */ 1679 if (_hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1680 _hc->ep_type == DWC_OTG_EP_TYPE_ISOC) 1681 { 1706 if (hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1707 hc->ep_type == DWC_OTG_EP_TYPE_ISOC) { 1682 1708 /* 1683 1709 * Make sure the transfer size is no larger than one … … 1687 1713 * programmed into a channel.) 1688 1714 */ 1689 uint32_t max_periodic_len = _hc->multi_count * _hc->max_packet; 1690 if (_hc->xfer_len > max_periodic_len) 1691 { 1692 _hc->xfer_len = max_periodic_len; 1715 uint32_t max_periodic_len = hc->multi_count * hc->max_packet; 1716 if (hc->xfer_len > max_periodic_len) { 1717 hc->xfer_len = max_periodic_len; 1693 1718 } 1694 else 1695 {1696 } 1719 else { 1720 } 1721 1697 1722 } 1698 else if (_hc->xfer_len > max_hc_xfer_size) 1699 { 1723 else if (hc->xfer_len > max_hc_xfer_size) { 1700 1724 /* Make sure that xfer_len is a multiple of max packet size. */ 1701 _hc->xfer_len = max_hc_xfer_size - _hc->max_packet + 1; 1702 } 1703 1704 if (_hc->xfer_len > 0) 1705 { 1706 num_packets = (_hc->xfer_len + _hc->max_packet - 1) / _hc->max_packet; 1707 if (num_packets > max_hc_pkt_count) 1708 { 1725 hc->xfer_len = max_hc_xfer_size - hc->max_packet + 1; 1726 } 1727 1728 if (hc->xfer_len > 0) { 1729 num_packets = (hc->xfer_len + hc->max_packet - 1) / hc->max_packet; 1730 if (num_packets > max_hc_pkt_count) { 1709 1731 num_packets = max_hc_pkt_count; 1710 _hc->xfer_len = num_packets * _hc->max_packet;1732 hc->xfer_len = num_packets * hc->max_packet; 1711 1733 } 1712 1734 } 1713 else 1714 { 1735 else { 1715 1736 /* Need 1 packet for transfer length of 0. */ 1716 1737 num_packets = 1; 1717 1738 } 1718 1739 1719 if (_hc->ep_is_in) 1720 { 1740 if (hc->ep_is_in) { 1721 1741 /* Always program an integral # of max packets for IN transfers. */ 1722 _hc->xfer_len = num_packets * _hc->max_packet; 1723 } 1724 1725 if (_hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1726 _hc->ep_type == DWC_OTG_EP_TYPE_ISOC) 1727 { 1742 hc->xfer_len = num_packets * hc->max_packet; 1743 } 1744 1745 if (hc->ep_type == DWC_OTG_EP_TYPE_INTR || 1746 hc->ep_type == DWC_OTG_EP_TYPE_ISOC) { 1728 1747 /* 1729 1748 * Make sure that the multi_count field matches the 1730 1749 * actual transfer length. 1731 1750 */ 1732 _hc->multi_count = num_packets; 1733 } 1734 1735 if (_hc->ep_type == DWC_OTG_EP_TYPE_ISOC) 1736 { 1751 hc->multi_count = num_packets; 1752 } 1753 1754 if (hc->ep_type == DWC_OTG_EP_TYPE_ISOC) { 1737 1755 /* Set up the initial PID for the transfer. */ 1738 if (_hc->speed == DWC_OTG_EP_SPEED_HIGH) 1739 { 1740 if (_hc->ep_is_in) 1741 { 1742 if (_hc->multi_count == 1) 1743 { 1744 _hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1756 if (hc->speed == DWC_OTG_EP_SPEED_HIGH) { 1757 if (hc->ep_is_in) { 1758 if (hc->multi_count == 1) { 1759 hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1745 1760 } 1746 else if (_hc->multi_count == 2) 1747 { 1748 _hc->data_pid_start = DWC_OTG_HC_PID_DATA1; 1761 else if (hc->multi_count == 2) { 1762 hc->data_pid_start = DWC_OTG_HC_PID_DATA1; 1749 1763 } 1750 else 1751 { 1752 _hc->data_pid_start = DWC_OTG_HC_PID_DATA2; 1764 else { 1765 hc->data_pid_start = DWC_OTG_HC_PID_DATA2; 1753 1766 } 1754 1767 } 1755 else 1756 { 1757 if (_hc->multi_count == 1) 1758 { 1759 _hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1768 else { 1769 if (hc->multi_count == 1) { 1770 hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1760 1771 } 1761 else 1762 { 1763 _hc->data_pid_start = DWC_OTG_HC_PID_MDATA; 1772 else { 1773 hc->data_pid_start = DWC_OTG_HC_PID_MDATA; 1764 1774 } 1765 1775 } 1766 1776 } 1767 else 1768 { 1769 _hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1770 } 1771 } 1772 1773 hctsiz.b.xfersize = _hc->xfer_len; 1774 } 1775 1776 _hc->start_pkt_count = num_packets; 1777 else { 1778 hc->data_pid_start = DWC_OTG_HC_PID_DATA0; 1779 } 1780
