Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Getting Started
USB quickstart guide
ST Logo
Previous   Contents   Next

Introduction

This guide will help the setup and configuration of a working USB subsystem on a LinuxSH installation. The topics covered will be specific to the SH architecture in general and the ST40GX1 processor in particular.

This guide is meant to be read with a generic knowledge of how the USB bus works and how it is used under Linux. Please read the first sections of the Linux-USB guide at www.linux-usb.org before proceeding.

Kernel configuration

Adding support for USB

The standard Linux kernel has complete support for USB out of the box. Most kernels now have support for USB enabled by default. In addition there is support for the ST40GX1 embedded Host Controller.

All the USB configuration options are available by selecting one of the kernel configuration top-level menus that is displayed by a make menuconfig command. The USB Support menu entry should be available between the Sound and Kernel hacking menu entries.

To add USB support visibility to a standard LinuxSH kernel you have to modify one file as specified in the following points.

  1. Open the arch/sh/config.in file in your favorite editor file and find the kernel hacking section near the end:

    tristate 'Sound card support' CONFIG_SOUND
    if [ "$CONFIG_SOUND" != "n" ]; then
       source drivers/sound/Config.in
    fi
    endmenu
     
    mainmenu_option next_comment
    comment 'Kernel hacking'
     
    bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
    

    And add the following line before the mainmenu_option next_comment line:

    source drivers/usb/Config.in
    

    The final section should look like:

    tristate 'Sound card support' CONFIG_SOUND
    if [ "$CONFIG_SOUND" != "n" ]; then
       source drivers/sound/Config.in
    fi
    endmenu
     
    source drivers/usb/Config.in
    
    mainmenu_option next_comment
    comment 'Kernel hacking'
     
    bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
    
  2. A USB Support section should now be available in the kernel top level configuration menu. Please refer to the Linux-USB guide for more information on what to select in it.

This change added support for USB devices through an external PCI Host Controller. These controllers come in the from of small PCI boards that can be easily added to any LinuxSH system equipped with a free PCI slot.

Using the ST40GX1

The ST40GX1 chip has an embedded Host Controller device connected to the CPU core by an on-chip bus called SuperHyway and many boards using this chip have all the necessary electronics to make use of this controller.

The problem is that the standard USB code in the Linux kernel expects all Host Controllers to be PCI devices. In order to use it, a PCI emulation layer was written that allows the cell to be seen as a PCI device by the rest of the kernel. This code is included in the kernel package provided as part of the ST distribution, will soon be added to the mainstream LinuxSH kernel.

This emulation is selected by setting two options in the Processor type and features section of the top-level configuration menu. Once in there select both the following options:

 [ ] PCI emulation of on-chip peripherals
 [ ]   USB OHCI Host Controller

These options are hierarchical and the second one only becomes available after the first is selected and they both can be used only after the processor type has been defined as ST40GX1.

Once these options are selected proceed to the USB Support section and configure the USB modules needed by your application. Please remind that the ST40GX1 Host Controller is an OHCI controller and that, consequently, the

 < >   OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support

entry must be selected.

Resources

USB standards information

Linux-USB information & drivers

Previous   Contents   Next
Valid HTML 4.01! Last updated: 2002/08/05 22:19:38
© Copyright STMicroelectronics Limited, 2005
Printer