UM10012_2 ISP1362 Linux Stack July 2003 User’s Guide Rev. 1.2 Revision History: Version Date 1.2 Jun 2003 1.1 Nov 2002 1.0 Oct 2002 Description • Additions for Accelent IDP platform (Rev 04) • Additions for Aaccelent IDP platform • First release. We welcome your feedback. Send it to wired.support@philips.com. Philips Semiconductors - Asia Product Innovation Centre Visit www.semiconductors.philips.com/buses/usb or www.flexiusb.
Philips Semiconductors ISP1362 Linux Stack User’s Guide This is a legal agreement between you (either an individual or an entity) and Philips Semiconductors. By accepting this product, you indicate your agreement to the disclaimer specified as follows: DISCLAIMER PRODUCT IS DEEMED ACCEPTED BY RECIPIENT. THE PRODUCT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.
Philips Semiconductors ISP1362 Linux Stack User’s Guide CONTENTS 1. INTRODUCTION ............................................................................................................................. 6 1.1. 1.2. 1.3. 2. PURPOSE ............................................................................................................................................................................6 SCOPE ............................................................................................
Philips Semiconductors 5. ISP1362 Linux Stack User’s Guide CONFIGURATION......................................................................................................................... 30 5.1. COMPILATION FLAGS .................................................................................................................................................... 30 5.1.1. Global ............................................................................................................................
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figures Figure 2-1: ISP1362 Linux Stack Architecture ....................................................................................................................................................7 Figure 3-1: ISP1362 Linux Setup Example............................................................................................................................................................
Philips Semiconductors ISP1362 Linux Stack User’s Guide 1. Introduction 1.1. Purpose This document explains how to install, configure and use the ISP1362 Linux stack. 1.2. Scope This document is intended for the users of the ISP1362 evaluation kit on Linux. 1.3. Abbreviations DCD Device Controller Driver FSM Finite State Machine HCD Host Controller Driver IDP Integrated Development Platform OS Operating System OTG On-The-Go USB Universal Serial Bus 2. Concept 2.1.
Philips Semiconductors 2.3. Core Modules 2.3.1. Host Stack ISP1362 Linux Stack User’s Guide The host stack consists of the Host Controller Driver (HCD) module. The driver is used for data transfer on the USB bus for the connected devices. This driver can work in parallel with other HCDs (OHCI HCD, UHCI HCD, EHCI HCD) present in the kernel. This is a kernel module and the Linux OS has support for USB, connected USB device class drivers and suitable applications.
Philips Semiconductors ISP1362 Linux Stack User’s Guide product-specific. Therefore, this driver communicates with a mass storage bridge (portable). For more information on the device stack interface, refer to API ISP1362 Device Stack. 2.3.3. OTG Stack The OTG stack consists of the OTG driver. This driver maintains the OTG software FSM, and coordinates the host and device functionality switching. It interfaces with OTG applications through the Linux file system.
Philips Semiconductors ISP1362 Linux Stack User’s Guide ISP1362 Evaluation Kit on Machine 2 ISP1362 Evaluation Kit on Machine 1 OTG Cable USB Peripherals on Machine 1 USB Peripherals on Machine 2 Figure 3-1: ISP1362 Linux Setup Example 3.1. ISP1362 PCI Evaluation Kit 3.1.1. Setting Up the PC and OS For one evaluation kit, prepare one PC. The ISP1362 Linux stack does not support two or more boards on one PC at the same time. Therefore, for the ISP1362 OTG evaluation, you must have two PCs.
Philips Semiconductors ISP1362 Linux Stack User’s Guide 2. Copy the ISP1362 Linux stack (isp1362_linux_sw_stack.tar.gz) to a local directory (This installation uses /usr/src/linux-otg). 3. Apply the OTG patch to the kernel: # cd /usr/src/linux-otg # tar –zxvf /mnt/cdrom/isp1362_linux_sw_stack.tar.gz # patch -p1 < 1362/misc/pci/otg_kernel_patch_pci 4. 5. Configure, compile, install and run the new kernel. You can get information on how to configure, compile and install the new kernel at http://www.
Philips Semiconductors 3.2. ISP1362 Linux Stack User’s Guide ISP1362 Add-on Card for Intel PXA250 based Accelent IDP (Rev 04) Accelent Systems developed the IDP - Integrated Development Platform to speed up the embedded device development cycles. Accelent IDP provides a feature-rich, cost-effective development platform for embedded device application and product development. The ISP1362 Linux stack and the Accelent IDP do not support two or more boards at the same time.
Philips Semiconductors ISP1362 Linux Stack User’s Guide #cp /mnt/cdrom/Tools/tool_chain/arm-linux-gcc2953.tar.bz2 / #cd / (Older versions of tar might not accept this, then try using #tar jxvf arm-linux-gcc2953.tar.bz2 #tar Ixvf arm-linux-gcc2953.tar.bz2) Be careful about the root directory of the ARM cross compiler. arm-linux-gcc will invoke cpp0 and cc1 assuming they reside in certain directories relative to the compiler’s root directory.
Philips Semiconductors ISP1362 Linux Stack User’s Guide CROSS_COMPILE = /pub/usr/ bin/arm-linux- The cross compile path (/usr/include/arm/2.95.3) depends on where the tool chain is installed and the version of the tool chain and from where the tool chain is downloaded. Similarly edit the Rules.Make of ISP1362 source (/usr/src/AccelentIDPRev4/linux/1362/source) for any changes • The kernel source directory is different from the one specified above. • Compile time flags. Refer to section 5.1.
Philips Semiconductors 1. 2. 3. ISP1362 Linux Stack User’s Guide The boot loader boot.bin (from the accelent CD) does not support ISP1362 add-on card. Use the boot loader from the ISP1362 stack release (/home/1362/AccelentIDP/boot.bin). To load the new kernel and root file system from the development environment, copy the nk_jffs_flash.bin from the earlier section as nk.bin to the CompactFlash card and boot up the Accelent IDP.
Philips Semiconductors ISP1362 Linux Stack User’s Guide The ISP1362 Linux stack and Accelent IDP does not support two or more boards at the same time. Therefore, for the ISP1362 OTG evaluation, you must have two Accelent IDPs. The ISP1362 Linux stack on Intel PXA250 based Accelent IDP platform has been tested with AccelLinux kernel version 2.4.18. Linux kernel versions 2.4.19 or above need a different kernel patch for OTG. Therefore, it is preferable to have Accelent IDP running on kernel version 2.4.18.
Philips Semiconductors ISP1362 Linux Stack User’s Guide #cp /mnt/cdrom/tools/tool_chain/arm_toolchaintar.bz2 / #cd / #tar jxvf arm_toolchaintar.bz2 arm_toolchaintar.bz2) (Older versions of tar might not accept this, then try using #tar Ixvf Be careful about the root directory of the ARM cross compiler. arm-linux-gcc will invoke cpp0 and cc1 assuming they reside in certain directories relative to the compiler’s root directory. To be on the safe side, unzip the ARM tool chain in the root directory /.
Philips Semiconductors ISP1362 Linux Stack User’s Guide 3.3.2.12.Linux Kernel Configuration Makefile Edit the Makefile of the kernel source (/usr/src/linux-otg) CROSS_COMPILE path to the path of the cross compiler CROSS_COMPILE = /pub/usr/ bin/arm-linux- The cross compile path (/usr/include/arm/2.95.3) depends on where the tool chain is installed and the version of the tool chain and from where the tool chain is downloaded.
Philips Semiconductors ISP1362 Linux Stack User’s Guide • CROSS_COMPILE path • MS_SIZE_FLAG is set to _8MB_SIZE_ (because of limitation of Accelent board for Mass storage demo) 3.3.2.14.
Philips Semiconductors 5. ISP1362 Linux Stack User’s Guide Write the following in a temporary file, say TempData, and give the file as an input to the fdisk command x h 1 c 1024 2 16 r n p 1 p w The following values are made for an OTG mass storage disk of size 8MB. Use the following command on the host PC: #fdisk /dev/sd[X]
Philips Semiconductors ISP1362 Linux Stack User’s Guide You should also see the msdisk application running as an application process when you list the current running processes (ps). 4.1.2. 1. Unloading the Stack As root of the system, go to the ISP1362 Linux source directory and use the script to unload module. #cd /usr/src/linux-otg/1362/source/objs #./rmod 2.
Philips Semiconductors ISP1362 Linux Stack User’s Guide This script mounts the OTG mass storage disk data from Accelent IDP ROM to RAM. 4.3.2. Loading the Stack The ISP1362 Linux stack modules (kernel as well as application) are dynamically loaded and unloaded to the kernel. • Log on to the system as root, go to the ISP1362 object directory and use the script to load modules. #cd /home/1362/objs #.
Philips Semiconductors ISP1362 Linux Stack User’s Guide ISP1362 Evaluation Kit on Machine 1 USB Peripherals on Machine 1 Figure 4-1: Host Stack Evaluation Example Setup In Figure 4-1, the requirements for the connected devices to work are: • The Linux kernel has class drivers or drivers corresponding to the connected USB device enabled and loaded. • The Linux OS has the appropriate application to work with the connected device.
Philips Semiconductors ISP1362 Linux Stack User’s Guide When connected to another USB host, with the ISP1362 as a device, you can: • See the mass storage as a removable disk (capacity of 16 MB including the file system) • See the contents of the disk • Read/write the contents of the disk • Format the disk (FAT16, EXT2 file systems) • Partition the disk into smaller disks. 4.6.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figure 4-4: OTG Mass Storage Application in the IDLE State Snapshot Figure 4-5: OTG Mass Storage Application in the HOST State Snapshot The application has a provision to change the state from IDLE to HOST and HOST to IDLE. In the HOST state, both the local OTG device disk and the remote OTG device disk (connected) will be mounted and available for use. UM10012-_2 User’s Guide © Koninklijke Philips Electronics N.V. 2003. All rights reserved.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figure 4-5 shows a snapshot of the application in the HOST state when a Mini-B plug is connected to the OTG port. In the HOST state, both the local and remote OTG device disks are mounted and are available for operation. You can select files from the source disk and transfer (copy or move) the files to the destination disk. You can also select the source and destination disks to be local or remote.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figure 4-7: OTG Application as a Device Snapshot Another way to use the OTG mass storage is by using the command-line application in the tools directory. To see the list of options supported by this command, use the help option. #cd /home/1362/objs #./otgcmd.o help The following table provides a list of otgcmd.
Philips Semiconductors 2. ISP1362 Linux Stack User’s Guide #./otgcmd mount This command will mount the local and connected OTG mass storage disks to the specified mount points and the disks are ready for use. To disconnect the OTG mass storage device, follow these steps: 1. #./otgcmd umount This command will unmount the already mounted local and connected OTG mass storage disks. 2. #./otgcmd idle This command will bring the OTG mass storage device to idle state.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figure 4-9 OTG B closing the session after connected device data access Figure 4-8 shows the screen capture of otgcmd.o utility when running on the Accelent IDP platform. It shows the execution of otgcmd.o for current status, becoming usb host, mounting the connected device disks and accessing the connected OTG mass storage device (A device) files. Figure 4-9 shows the screen captures of otgcmd.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Figure 4-10 Operations with OTG A and B devices UM10012-_2 User’s Guide © Koninklijke Philips Electronics N.V. 2003. All rights reserved. Rev. 1.
Philips Semiconductors ISP1362 Linux Stack User’s Guide 5. Configuration The ISP1362 Linux stack can be configured to work in different ways by using the static compilation time flags. The Rules.Make file in the root directory of the source code selects the global compilation flags. The local compilation flags for the modules are selected in the Makefile of the corresponding module directory. 5.1. Compilation Flags 5.1.1. Global Table 5-1 shows the compilation flags that are selected in the Rules.
Philips Semiconductors ISP1362 Linux Stack User’s Guide 6. Inside the ISP1362 Linux Stack The ISP1362 Linux stack release consists of two parts: a Linux kernel OTG patch for kernel version 2.4.18 and the ISP1362 Linux stack source code. The code is written in C. This chapter explains the ISP1362 Linux stack source code organization. 6.1. Top-Level Directory The root directory consists of all the substack directories and the make files.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Table 6-4: Contents of the device Directory File Name Description Makefile for the device stack subdirectories ISP1362 Device Controller Driver C source file ISP1362 Device Controller Driver C header file ISP1362 USB protocol driver C source file release/device/Makefile release/device/pdc release/device/devmscd release/device/diskemu 6.3.1.
Philips Semiconductors ISP1362 Linux Stack User’s Guide Table 6-8: Contents of the otg Directory File Name release/otg/Makefile release/otg/usb_otg.c release/otg/usb_otg.h release/otg/otg_fsm.c release/otg/otg_fsm.h 6.5.
Philips Semiconductors 6.6.2. ISP1362 Linux Stack User’s Guide tools The tools directory consists of files related to the mass storage disk emulation. The contents of this directory and their description are given in Table 6-13.
Philips Semiconductors Philips Semiconductors is a worldwide company with over 100 sales offices in more than 50 countries. For a complete up-to-date list of our sales offices please e-mail sales.addresses@www.semiconductors.philips.com. A complete list will be sent to you automatically. You can also visit our website http://www.semiconductors.philips.com/sales/ www.semiconductors.philips.com © Koninklijke Philips Electronics N.V. 2003 All rights reserved.