18c2ecf20Sopenharmony_ci========================
28c2ecf20Sopenharmony_ciS3C24XX USB Host support
38c2ecf20Sopenharmony_ci========================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciIntroduction
88c2ecf20Sopenharmony_ci------------
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci  This document details the S3C2410/S3C2440 in-built OHCI USB host support.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciConfiguration
138c2ecf20Sopenharmony_ci-------------
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci  Enable at least the following kernel options:
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci  menuconfig::
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci   Device Drivers  --->
208c2ecf20Sopenharmony_ci     USB support  --->
218c2ecf20Sopenharmony_ci       <*> Support for Host-side USB
228c2ecf20Sopenharmony_ci       <*>   OHCI HCD support
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci  .config:
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci    - CONFIG_USB
288c2ecf20Sopenharmony_ci    - CONFIG_USB_OHCI_HCD
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci  Once these options are configured, the standard set of USB device
328c2ecf20Sopenharmony_ci  drivers can be configured and used.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciBoard Support
368c2ecf20Sopenharmony_ci-------------
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci  The driver attaches to a platform device, which will need to be
398c2ecf20Sopenharmony_ci  added by the board specific support file in linux/arch/arm/mach-s3c2410,
408c2ecf20Sopenharmony_ci  such as mach-bast.c or mach-smdk2410.c
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci  The platform device's platform_data field is only needed if the
438c2ecf20Sopenharmony_ci  board implements extra power control or over-current monitoring.
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci  The OHCI driver does not ensure the state of the S3C2410's MISCCTRL
468c2ecf20Sopenharmony_ci  register, so if both ports are to be used for the host, then it is
478c2ecf20Sopenharmony_ci  the board support file's responsibility to ensure that the second
488c2ecf20Sopenharmony_ci  port is configured to be connected to the OHCI core.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciPlatform Data
528c2ecf20Sopenharmony_ci-------------
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci  See arch/arm/mach-s3c2410/include/mach/usb-control.h for the
558c2ecf20Sopenharmony_ci  descriptions of the platform device data. An implementation
568c2ecf20Sopenharmony_ci  can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c .
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci  The `struct s3c2410_hcd_info` contains a pair of functions
598c2ecf20Sopenharmony_ci  that get called to enable over-current detection, and to
608c2ecf20Sopenharmony_ci  control the port power status.
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci  The ports are numbered 0 and 1.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci  power_control:
658c2ecf20Sopenharmony_ci    Called to enable or disable the power on the port.
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci  enable_oc:
688c2ecf20Sopenharmony_ci    Called to enable or disable the over-current monitoring.
698c2ecf20Sopenharmony_ci    This should claim or release the resources being used to
708c2ecf20Sopenharmony_ci    check the power condition on the port, such as an IRQ.
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci  report_oc:
738c2ecf20Sopenharmony_ci    The OHCI driver fills this field in for the over-current code
748c2ecf20Sopenharmony_ci    to call when there is a change to the over-current state on
758c2ecf20Sopenharmony_ci    an port. The ports argument is a bitmask of 1 bit per port,
768c2ecf20Sopenharmony_ci    with bit X being 1 for an over-current on port X.
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci    The function s3c2410_usb_report_oc() has been provided to
798c2ecf20Sopenharmony_ci    ensure this is called correctly.
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci  port[x]:
828c2ecf20Sopenharmony_ci    This is struct describes each port, 0 or 1. The platform driver
838c2ecf20Sopenharmony_ci    should set the flags field of each port to S3C_HCDFLG_USED if
848c2ecf20Sopenharmony_ci    the port is enabled.
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ciDocument Author
898c2ecf20Sopenharmony_ci---------------
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciBen Dooks, Copyright 2005 Simtec Electronics
92