1*4882a593Smuzhiyun======================== 2*4882a593SmuzhiyunS3C24XX USB Host support 3*4882a593Smuzhiyun======================== 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunIntroduction 8*4882a593Smuzhiyun------------ 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun This document details the S3C2410/S3C2440 in-built OHCI USB host support. 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunConfiguration 13*4882a593Smuzhiyun------------- 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun Enable at least the following kernel options: 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun menuconfig:: 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun Device Drivers ---> 20*4882a593Smuzhiyun USB support ---> 21*4882a593Smuzhiyun <*> Support for Host-side USB 22*4882a593Smuzhiyun <*> OHCI HCD support 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun .config: 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun - CONFIG_USB 28*4882a593Smuzhiyun - CONFIG_USB_OHCI_HCD 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun Once these options are configured, the standard set of USB device 32*4882a593Smuzhiyun drivers can be configured and used. 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunBoard Support 36*4882a593Smuzhiyun------------- 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun The driver attaches to a platform device, which will need to be 39*4882a593Smuzhiyun added by the board specific support file in linux/arch/arm/mach-s3c2410, 40*4882a593Smuzhiyun such as mach-bast.c or mach-smdk2410.c 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun The platform device's platform_data field is only needed if the 43*4882a593Smuzhiyun board implements extra power control or over-current monitoring. 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun The OHCI driver does not ensure the state of the S3C2410's MISCCTRL 46*4882a593Smuzhiyun register, so if both ports are to be used for the host, then it is 47*4882a593Smuzhiyun the board support file's responsibility to ensure that the second 48*4882a593Smuzhiyun port is configured to be connected to the OHCI core. 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunPlatform Data 52*4882a593Smuzhiyun------------- 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun See arch/arm/mach-s3c2410/include/mach/usb-control.h for the 55*4882a593Smuzhiyun descriptions of the platform device data. An implementation 56*4882a593Smuzhiyun can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun The `struct s3c2410_hcd_info` contains a pair of functions 59*4882a593Smuzhiyun that get called to enable over-current detection, and to 60*4882a593Smuzhiyun control the port power status. 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun The ports are numbered 0 and 1. 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun power_control: 65*4882a593Smuzhiyun Called to enable or disable the power on the port. 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun enable_oc: 68*4882a593Smuzhiyun Called to enable or disable the over-current monitoring. 69*4882a593Smuzhiyun This should claim or release the resources being used to 70*4882a593Smuzhiyun check the power condition on the port, such as an IRQ. 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun report_oc: 73*4882a593Smuzhiyun The OHCI driver fills this field in for the over-current code 74*4882a593Smuzhiyun to call when there is a change to the over-current state on 75*4882a593Smuzhiyun an port. The ports argument is a bitmask of 1 bit per port, 76*4882a593Smuzhiyun with bit X being 1 for an over-current on port X. 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun The function s3c2410_usb_report_oc() has been provided to 79*4882a593Smuzhiyun ensure this is called correctly. 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun port[x]: 82*4882a593Smuzhiyun This is struct describes each port, 0 or 1. The platform driver 83*4882a593Smuzhiyun should set the flags field of each port to S3C_HCDFLG_USED if 84*4882a593Smuzhiyun the port is enabled. 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun 88*4882a593SmuzhiyunDocument Author 89*4882a593Smuzhiyun--------------- 90*4882a593Smuzhiyun 91*4882a593SmuzhiyunBen Dooks, Copyright 2005 Simtec Electronics 92