DYNAMIC ENGINEERING 150 DuBois Suite C Santa Cruz, CA (831) Fax (831) Est.

Similar documents
DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

spwr_base & spwr_chan

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois, Suite C, Santa Cruz, CA Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

PcieAltBase & PcieAltChan

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

PHLnkBase & PHLnkChan

Pci3Ip, Pci5Ip, Pc104pIp, Pc104p4Ip, cpci2ip, cpci4ip and PcieCar IndustryPack Carrier Device Drivers

DYNAMIC ENGINEERING 150 DuBois, Suite 3 Santa Cruz, CA (831) Fax (831) Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

IP-429-II ARINC 429 Interface 1-4 Transmitters 2-8 Receivers

& WizChan. Driver Documentation

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St Suite 3, Santa Cruz CA Fax Est.

ccpmc Parallel TTL BA18 Base & Channel

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois, Suite 3 Santa Cruz, CA (831) Fax (831) Est

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

PMC-BiSerial-III SDLC 8-Channel SDLC Interface

PCIeBiSerial-L3com1 One-Channel Half Duplex Interface

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA (831) Fax (831) Est.

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING. 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est.

PMC Parallel TTL BA17 Base & Channel

DYNAMIC ENGINEERING 150 DuBois St. Suite 3, Santa Cruz Ca Fax Est

Stand-Alone-Relay S-A-Relay

DYNAMIC ENGINEERING. 150 DuBois St. #3, Santa Cruz Ca Fax Est

DYNAMIC ENGINEERING 150 DuBois St. Suite C Santa Cruz CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois St. Suite 3, Santa Cruz, Calif Fax Est.

DYNAMIC ENGINEERING 150 DuBois St. Suite C Santa Cruz CA Fax Est.

IP-Unidig-E Line Input/Output with LineSafe ESD Protection IndustryPack User s Manual

PMC Parallel TTL BA16 Base. Channel Software Manual

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA (831) Fax (831) Est.

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, Calif Fax Est.

DYNAMIC ENGINEERING 150 DuBois, Suite 3 Santa Cruz, CA (831) Fax (831) Est.

cpci-dart Base-Board & Daughter-Board

Artisan Scientific is You~ Source for: Quality New and Certified-Used/Pre:-awned ECJuiflment

IP-QuadUART-485-PLRA

DYNAMIC ENGINEERING 150 Dubois St. Suite C, Santa Cruz, CA Fax Est.

DYNAMIC ENGINEERING 150 DuBois St. Suite C Santa Cruz, CA FAX Est.

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

PCI LVDS 8T 8 Channel LVDS Serial Interface Dynamic Engineering 435 Park Drive, Ben Lomond, CA

Sensoray Model 627 CompactPCI to PCI Adapter

DYNAMIC ENGINEERING 150 DuBois, Suite 3 Santa Cruz, CA (831) Fax (831) Est

Instruction Manual. CT-4 High-Current Transformer

PCMCIA Flash Card User Guide

HUNT ENGINEERING HEL_UNPACK.LIB USER MANUAL

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

ssj1708 User s Manual Version 1.3 Revised February 2nd, 2009 Created by the J1708 Experts

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

tekdxfxsl FibreXtreme I/O Interface

Pressurized Line Leak Controller Module. For Veeder-Root TLS-350/350R Systems

GEN10. HD/SD Sync Generator. User Manual

Windows Device Driver and API Reference Manual

NOVPEK NetLeap User Guide

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

CD-ROM COMPATIBLE TAPE FORMAT FOR INSTALLABLE FILE SYSTEM

DYNAMIC ENGINEERING 150 DuBois St., Suite C Santa Cruz, CA (831) Fax (831) Est.

May 2014 Product Shipping Configuration Change Notice

ExpressCard Serial Card

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, Ca Fax Est.

INTELLITAPE USERS MANUAL. Intellitape USERS MANUAL Chief Automotive Technologies, Inc.

TS-Modem User s Manual

DM6816 Driver for Windows 98/NT4/2000/XP

PMC-BiSerial-III SDLC

USB Port (PCI) Users Guide

BRG17088HR User's Manual PCI to ISA Bridge PC/104-Plus Module

Using LPC11Axx EEPROM (with IAP)

quick setup Plug the keyboard into your computer. For: Windows Linux Mac OS X 10.3 or earlier For: Mac OS X 10.4 or later

Macon Plastics, Inc. Solvent Weld SCH 40/80 DWV

R227. Terms Code Discount per Sales Code Qty Ordered AR-1227

IP-Pulse 4 Channel Digital Pulse Generator IP Module

Serial Converters WTS 1201/-CP. RS-232 to IEEE b Wireless Converter with WEP Encryption, and External Antenna

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

for Windows NT 4.0 Edition 1.1

MODEL P104-COM232-8 USER MANUAL

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

Transport Pro FireWire and USB Portable Hard Drive

USB 3.0 Spectra

Intel Cache Acceleration Software for Windows* Workstation

ACT-IR220L+/220L/200L IrDA PC Adapter. User s Manual

OPERATIONS MANUAL PCM-I/O48

ESC(LP)-100. Eight Channel Low Profile RS-232 Asynchronous Communications Adapter. for PCI bus. User's Manual

10 Digital Photo Frame Instructional Manual

VAR-EXT-CB8 Datasheet Camera Extension Board for VAR-DT8MCustomBoard & SPEAR-MX8CustomBoard V 1.x

UM PR533 - PCSC Tool. User manual COMPANY PUBLIC. Rev November Document information

Firmware Updates Model 24 / 44 / 42 Cryogenic Temperature Controllers

Sensoray Model 623 PC/104+ to PCI Adapter. Revised December 19, Sensoray Model 623 Instruction Manual 1

QSC(LP)-100. User's Manual

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

Transcription:

DYNAMIC ENGINEERING 150 DuBois Suite C Santa Cruz, CA. 95060 (831) 457-8891 Fax (831) 457-4793 http://www.dyneng.com sales@dyneng.com Est. 1988 ip_gen Linux Driver Documentation Revision A

ip_gen Linux Device Driver for an Unknown IP Module Dynamic Engineering 150 DuBois, Suite C Santa Cruz, CA 95060 831-457-8891 831-457-4793 FAX This document contains information of proprietary interest to Dynamic Engineering. It has been supplied in confidence and the recipient, by accepting this material, agrees that the subject matter will not be copied or reproduced, in whole or in part, nor its contents revealed in any manner or to any person except to meet the purpose for which it was delivered. Dynamic Engineering has made every effort to ensure that this manual is accurate and complete. Still, the company reserves the right to make improvements or changes in the product described in this document at any time and without notice. Furthermore, Dynamic Engineering assumes no liability arising out of the application or use of the device described herein. The electronic equipment described herein generates, uses, and can radiate radio frequency energy. Operation of this equipment in a residential area is likely to cause radio interference, in which case the user, at his own expense, will be required to take whatever measures may be required to correct the interference. Dynamic Engineering s products are not authorized for use as critical components in life support devices or systems without the express written approval of the president of Dynamic Engineering. 2008 by Dynamic Engineering. Trademarks and registered trademarks are owned by their respective manufactures. Manual Revision A. Revised June 18, 2008. This product has been designed to operate with IP Module carriers and compatible user-provided equipment. Connection of incompatible hardware is likely to cause serious damage. Embedded Solutions Page 2 of 10

Table of Contents Introduction 4 Note 4 Driver Installation 4 Driver Startup 5 IO Controls 6 IOCTL_IP_GEN_GET_INFO 6 IOCTL_IP_GEN_SET_MEM_OFFSET 6 IOCTL_IP_GEN_GET_MEM_OFFSET 6 IOCTL_IP_GEN_PUT_IO_DATA 6 IOCTL_IP_GEN_GET_IO_DATA 7 IOCTL_IP_GEN_SET_IP_CONTROL 7 IOCTL_IP_GEN_GET_IP_CONTROL 7 IOCTL_IP_GEN_SET_BASE_CONFIG 7 IOCTL_IP_GEN_WAIT_ON_INTERRUPT 7 IOCTL_IP_GEN_ENABLE_INTERRUPT 8 IOCTL_IP_GEN_DISABLE_INTERRUPT 8 IOCTL_IP_GEN_FORCE_INTERRUPT 8 IOCTL_IP_GEN_GET_ISR_STATUS 8 write 9 read 9 WARRANTY AND REPAIR 9 Service Policy 10 Out of Warranty Repairs 10 For Service Contact: 10 Embedded Solutions Page 3 of 10

Introduction The ip_gen driver is a modular Linux driver for an unknown Industry Pack (IP) module. This driver can control any IP module by mapping the IO, MEM, and INT memory spaces so that they can be accessed by driver calls. When the IP carrier driver is loaded, it enumerates its IP bus by reading the ID proms of each installed IP, entering the results into the IP_CHILD_CONTEXT structure and cross-referencing this with the ip_device_table array in ip_device_table.h. The carrier driver makes the device type information available to both the user and the IP load script through the sys file system (/sys/bus/ip/devices/ip_x_y/devtype) where x is the zero-based carrier number and y is the zero-based ip carrier slot number. If no match is found for the data read or if a match is found, but the driver_exists field in the table is zero, the fields in IP_CHILD_CONTEXT are all set to zero and the ip_gen driver will be installed. When the ip_gen driver initializes, it checks the IP_CHILD_CONTEXT structure in each ip_device structure found. If all fields are zero, it has found an ip_gen device and will complete initialization and enter a pointer to the device structure into its device table. To access the hardware, a device node must be created in the /dev directory for each installed module. This is accomplished by the load_ip driver load script. A separate handle to each unknown IP can be obtained using open() calls (see below). IO Control calls, ioctl() s are used to configure the module and write/read data to/from the IO space. Write and read calls are used to move data blocks in and out of the IP module MEM space. Note This documentation will provide information about all calls made to the driver, and how the driver interacts with the device for each of these calls. For more detailed information on the hardware implementation, refer to the hardware manual for the particular device being used. Driver Installation The source files for both the driver (ip_gen) and a test application for controlling a parallel TTL IP module (ip_gen_par_ttl_user_app) are provided in the driver delivery. Makefiles in each directory build and install the driver and test application with make and make install commands. A make clean command will remove all executables and object files. Copy the source file directory tree to a directory where the driver and application code will be built and run make in the appropriate directories to build the driver and test application. Run make install in each directory to copy the ip_gen.ko file to the /lib/module/version/kernel/driver/misc/ directory and the test executable to the /usr/local/bin/ directory. Load and unload scripts are provided to facilitate starting and stopping the carrier and IP module drivers. The load_ip script will load the ip carrier driver module, explore the /sys/bus/ip/devices/ device tree to discover which IP modules are installed, parse the /proc/devices file for the devices major numbers and create the required number of Embedded Solutions Page 4 of 10

device nodes for the carrier. Then it loads the ip_gen driver and creates the appropriate number of ip_gen_x device nodes as well (where x is the zero-based device number). Similarly the unload_ip script first unloads the installed IP module driver(s), and then unloads the carrier driver(s). These scripts and the ip_car_list and ip_driver_table files that list the possible ip carriers and correlate IP device names with driver names should be copied to /usr/local/bin/. Driver Startup Install the hardware and boot the computer. After the drivers have been installed run the load_ip script to start the drivers and create the device interface nodes. A handle can be opened to a specific board by using the open() function call and passing in the appropriate device name. Below is example code for opening a handle for unknown IP device dev_num #define NUM_DEVICES 5 #define HANDLE long HANDLE char int hip_gen; Name[INPUT_SIZE]; i, dev_num; do { printf("\nenter target board number (starting with zero): \n"); scanf("%d", &dev_num); if(dev_num < 0 dev_num > NUM_DEVICES) printf("\ntarget board number %d out of range!\n", dev_num); } while(dev_num < 0 dev_num > NUM_DEVICES); sprintf(name, "/dev/ip_gen_%d", dev_num); hip_gen = open(name, O_RDWR); if(hip_gen < 2) { printf("\n%sfailed to open!\n", Name); return 1; } Embedded Solutions Page 5 of 10

IO Controls The driver uses ioctl() calls to configure the device and ascertain status information. The parameters passed to the ioctl() function include the handle obtained from the open() call, an integer command defined in the ip_gen_api.h file and an optional parameter used to pass data in and/or out of the device. The ioctl commands defined for the ip_gen driver are listed below. IOCTL_IP_GEN_GET_INFO Function: Returns the current driver version, instance number and location string. Output: DRIVER_IP_GEN_DEVICE_INFO structure Notes: This call does not access the hardware, only driver parameters. Instance number is the zero-based count of ip_gen devices. The location string is a concatenation of the carrier name and IP slot number e.g. an IP in slot C on the second PCI3IP installed would have a location string of pci3ip_1_2. See ip_gen_api.h for the definition of DRIVER_IP_GEN_DEVICE_INFO. IOCTL_IP_GEN_SET_MEM_OFFSET Function: Sets the address offset into the MEM space for the next read or write call. Input: offset (unsigned long integer) Notes: Sets the address offset into the IP MEM space for read and write operations. IOCTL_IP_GEN_GET_MEM_OFFSET Function: Returns the address offset into the MEM space. Output: offset (unsigned long integer) Notes: Returns the value set in the previous call. IOCTL_IP_GEN_PUT_IO_DATA Function: Writes data to the IP IO space. Input: IO_ACCESS structure Notes: The IO_ACCESS structure has three fields: Address, Data and Length. Address is the offset into the mapped IO space for the module, Data is the value to write to that address and Length is the size of the data (1, 2 or 4 bytes). If Length is set to 4, the carrier will perform two successive 16-bit writes to consecutive 16-bit addresses otherwise the a single access is made. Embedded Solutions Page 6 of 10

IOCTL_IP_GEN_GET_IO_DATA Function: Reads data from the IP IO space. Input: IO_ACCESS structure Output: IO_ACCESS structure Notes: The Address and Length fields must be filled in prior to making this call. When the structure is returned, the Data field will contain the data value read at the requested address. IOCTL_IP_GEN_SET_IP_CONTROL Function: Sets the configuration of the IP slot. Input: Register configuration (unsigned long integer) Notes: Controls the IP clock speed IP data controls and IP interrupt enables for the IP slot that the board occupies. See the bit definitions in the ip_gen_api.h header file for information on the register controls. IOCTL_IP_GEN_GET_IP_CONTROL Function: Returns the configuration of the IP slot. Output: Register configuration (unsigned long integer) Notes: Returns the slot configuration register value for the IP slot that the board occupies. See the bit definitions in the ip_gen_api.h header file for information on decoding this value. IOCTL_IP_GEN_SET_BASE_CONFIG Function: Sets configuration parameters in the IP-QuadUART base control register. Input: IP_GEN_BASE_CONFIG structure Notes: Selects the reference clock source(s) for the UART channels and the bus timeout interrupt enable state. See ip_gen_api.h for the definition of IP_GEN_BASE_CONFIG. IOCTL_IP_GEN_WAIT_ON_INTERRUPT Function: Causes an entry to be placed in the interrupt wait queue. Input: Delay value to wait in jiffies. Notes: This call is used to implement a user defined interrupt service routine. It will return when an interrupt occurs or when the delay time specified expires. If the delay is set to zero, the call will wait indefinitely. The delay time is dependent on the platform setting for jiffy, which could be anything from 10 milliseconds to less than 1 millisecond. Embedded Solutions Page 7 of 10

IOCTL_IP_GEN_ENABLE_INTERRUPT Function: Enables the IP slot interrupts. Notes: Sets both of the IP slot interrupt enables, leaving all other bit values in the IP slot control register the same. This call is used in the user interrupt processing function to re-enable the interrupts after they were disabled in the driver interrupt service routine. This allows that function to enable the interrupts without knowing the particulars of the other configuration bits. IOCTL_IP_GEN_DISABLE_INTERRUPT Function: Disables the IP slot interrupts. Notes: Clears both of the IP slot interrupt enables, leaving all other bit values in the IP slot control register the same. This call is used when interrupt processing is no longer desired. IOCTL_IP_GEN_FORCE_INTERRUPT Function: Causes a system interrupt to occur. Notes: Causes an interrupt to be asserted for the IP slot. This call is used for development, to test interrupt processing. IOCTL_IP_GEN_GET_ISR_STATUS Function: Returns the InterruptStatus, InterruptVector, and TimedOut status read in the last interrupt service routine. Output: IP_GEN_INT_STAT structure Notes: The InterruptStatus field contains information on the interrupt source IP_INT0, IP_INT1, Force Interrupt or Bus Error from the last driver interrupt service routine execution. The interrupt vector read in the last ISR is also returned as well as the timeout status. See ip_gen_api.h for the definition of IP_GEN_INT_STAT and information on the InterruptStatus bits. Embedded Solutions Page 8 of 10

write Data to be written to the IP MEM space uses a write() call starting at the memory offset specified with the SET_MEM_OFFSET call. The user supplies the device handle, a pointer to the buffer containing the data, and the number of bytes to write. The driver takes advantage of the carrier s 32-bit double-write capability to load two 16-bit IP bus words with a single PCI write until less than four bytes remain in the buffer, which are completed with byte writes. read Data to be read from the IP MEM space uses a read() call starting from the memory offset specified with the SET_MEM_OFFSET call. The user supplies the device handle, a pointer to the buffer to store the data in, and the number of bytes to read. As with the write call above the driver takes advantage of the carrier 32-bit double-read capability to read two 16-bit IP bus words with a single PCI read until less than four bytes remain to be read, which are completed with byte reads. Warranty and Repair Dynamic Engineering warrants this product to be free from defects under normal use and service and in its original, unmodified condition, for a period of one year from the time of purchase. If the product is found to be defective within the terms of this warranty, Dynamic Engineering's sole responsibility shall be to repair, or at Dynamic Engineering's sole option to replace, the defective product. Dynamic Engineering's warranty of and liability for defective products is limited to that set forth herein. Dynamic Engineering disclaims and excludes all other product warranties and product liability, expressed or implied, including but not limited to any implied warranties of merchandisability or fitness for a particular purpose or use, liability for negligence in manufacture or shipment of product, liability for injury to persons or property, or for any incidental or consequential damages. Dynamic Engineering s products are not authorized for use as critical components in life support devices or systems without the express written approval of the president of Dynamic Engineering. Embedded Solutions Page 9 of 10

Service Policy Before returning a product for repair, verify as well as possible that the driver is at fault. The driver has gone through extensive testing and in most cases it will be cockpit error rather than an error with the driver. When you are sure or at least willing to pay to have someone help then call the Customer Service Department and arrange to speak with an engineer. We will work with you to determine the cause of the issue. If the issue is one of a defective driver we will correct the problem and provide an updated module(s) to you [no cost]. If the issue is of the customer s making [anything that is not the driver] the engineering time will be invoiced to the customer. Pre-approval may be required in some cases depending on the customer s invoicing policy. Out of Warranty Repairs Out of warranty support will be billed. The current minimum repair charge is $125. An open PO will be required. For Service Contact: Customer Service Department Dynamic Engineering 150 DuBois, Suite C Santa Cruz, CA 95060 (831) 457-8891 (831) 457-4793 fax support@dyneng.com All information provided is Copyright Dynamic Engineering Embedded Solutions Page 10 of 10