Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. USB Introduction USB Architecture USB Framming USB Drivers URB (USB request Block)

Slides:



Advertisements
Similar presentations
Lecture 21Comp. Arch. Fall 2006 Chapter 8: I/O Systems (continued) Adapted from Mary Jane Irwin at Penn State University for Computer Organization and.
Advertisements

Universal Serial Bus Grant Heileman. The History of USB In 1994 a collaborative effort to design a standard for peripheral devices was made between Compaq,
Chapter 4 Making Connections. 2 Introduction  Examine the interface between a computer and a device. This interface occurs at the physical layer.  Connecting.
Introduction Computer Hardware Jess 2006 EXPANSION CARDS BUS ARCHITECTURE AND CONNECTORS.
Data Communications and Computer Networks: A Business User’s Approach
1 Chapter Four Making Connections. 2 Introduction Connecting peripheral devices to a computer has, in the past, been a fairly challenging task Newer interfaces.
Serial Interfaces. 2 Legacy Serial ports Parallel ports Keyboard / Mouse connectors … keyboard mouseSP PP Monitor Ethernet Sound Card Modem.
I/O Channels I/O devices getting more sophisticated e.g. 3D graphics cards CPU instructs I/O controller to do transfer I/O controller does entire transfer.
1 USB 2.0 Specification  General Description  From where we could begin the work  What would be valid to do?  Main doubts  What is OTG (On the Go)
1 USB 2.0 Specification  General Description  What is OTG (On the Go)  From where we could begin the work  What would be valid to do?
USB – An Overview Group 3 Kaushik Nandha Bikram What is the Universal Serial bus (USB)? Is a cable bus that supports data exchange between a host computer.
IT Systems In and Out EN230-1 Justin Champion C208 –
USB 2.0 INTRODUCTION NTUT CSIE 學 生:許家豪 指導教授:柯開維教授.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 15 PC Standard Bus Interfaces WK.
Introduction to USB. 2 Agenda Introduction to USB LPC23xx Block diagram MCB2300 demo.
EE 446 Embedded Architecture. Universal Serial Bus A representative peripheral interface Universal Serial Bus (USB) provides a serial bus standard for.
Local Asynchronous Communications. Bit-wise data transmission Data transmission requires: Encoding bits as energy Transmitting energy through medium Decoding.
USB: UNIVERSAL SERIAL BUS Joe Kaewbaidhoon Alex Motalleb Vishal Joshi Prepared for EECS 373 University of Michigan, Ann Arbor 1.
18 - Winter 2003 EE EE 766 Computer Interfacing and Protocols 1 USB (Universal Serial Bus) Need for “Plug and Play” capability for PC peripherals outside.
Serial Interfaces. Bit serial bus New generation of busses Uses bit-serial, differential drive technology Uses on-line device drivers (Hot-plug technology)
Copyright ©: Nahrstedt, Angrave, Abdelzaher
USB Josh Rickmar John Marcoux. Topics Purpose and Goals History Bus Design Power Differential Signaling Connectors Changes in USB 3.0.
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 41 – Input/Output Ports.
Universal Serial Bus Evann Seary Mike Kezele. Content Overview History of USB Overview Future of USB USB 3.0 WUSB.
Peripheral Buses COMP Jamie Curtis. PC Buses ISA is the first generation bus 8 bit on IBM XT 16 bit on 286 or above (16MB/s) Extended through.
May 8, The EASY Way to Create I/O Devices John Hyde Intel Corporation intel.com.
Shadi Agel Pongsakorn Bunyaphriruang Chih-Chung Chang Winnie Chia USB 2.0 VS FireWire.
Kristian Naess Qicai Guo Roy Torres Mark Bacchus Yue Kun Alberto Chestaro.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Embedded Systems Architecture Class Project USB 2.0 Function Controller December 12, 2008 Brandon Wolfe, Ben Marrou, Daniel Chan.
Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Peripheral Busses COMP Jamie Curtis. PC Busses ISA is the first generation bus 8 bit on IBM XT 16 bit on 286 or above (16MB/s) Extended through.
Introduction to USB Development. USB Development Introduction Technical Overview USB in Embedded Systems Recent Developments Extensions to USB USB as.
Introduction to USB © 2010 Renesas Electronics America Inc. All rights reserved.
1 Chapter Overview Understanding Expansion Buses Configuring Expansion Cards Cables and Connectors.
ECE 371 – UNIT 20 Universal Serial Bus (USB). References 1. Universal Serial Bus Specification, Revision 2.0. This specification is available on the World.
Universal Serial Bus - USB Historical Perspective The Universal Serial Bus was originally developed in 1995 by a group of industry.
Microprocessor-based Systems
NETW 3005 I/O Systems. Reading For this lecture, you should have read Chapter 13 (Sections 1-4, 7). NETW3005 (Operating Systems) Lecture 10 - I/O Systems2.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
BR 6/001 Universal Serial Bus Universal Serial Bus is a new synchronous serial protocol for low to medium speed data transmission Full speed signaling.
Computer Maintenance Copyright © Texas Education Agency, All rights reserved. 1 FireWire Ports.
11 NETWORK CONNECTION HARDWARE Chapter 3. Chapter 3: NETWORK CONNECTION HARDWARE2 NETWORK INTERFACE ADAPTER  Provides the link between a computer and.
A Cyclic-Executive-Based QoS Guarantee over USB Chih-Yuan Huang,Li-Pin Chang, and Tei-Wei Kuo Department of Computer Science and Information Engineering.
Input/Output Computer component : Input/Output I/O Modules External Devices I/O Modules Function and Structure I/O Operation Techniques I/O Channels and.
Data Communications (E&T2760): USB and IEEE USB and IEEE 1394.
Copyright 2003 The McGraw-Hill Companies, Inc CHAPTER The System Unit computing ESSENTIALS    
Organisasi Sistem Komputer Materi VIII (Input Output)
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Tutorial 12 Managing Hardware and Networks
Computer Maintenance UNT in partnership with TEA, Copyright ©. All rights reserved1 FireWire Ports.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
USB Universal Serial Bus. University of Tehran 2.
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
USB PHYISICAL LAYER PROTOCOL ENGINE LAYER APPLICATION LAYER
Operating Systems (CS 340 D)
USB Universal Serial Bus
Input/Output Organization
IRQ, DMA and I/O Ports - Introduction -
USB- Universal Serial Bus
USB : Universal Serial Bus
Universal Serial Bus (USB)
Chapter 13: I/O Systems.
Presentation transcript:

Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati

USB Introduction USB Architecture USB Framming USB Drivers URB (USB request Block)

Created to replace a wide range of slow and diff bus – Parallel, serial, keyboard connections – With a single bus type that could connect to 480 MBps speed USB subsystem not like a bus but tree build out of several point to point link These links are 4wires cable (gnd,power, two signal) that connect a device & hub The USB host controller is in charge of asking every USB device if it has any data to send – This configuration allow for a very easy plug & play type of system, where device can automatically configured

USB protocol spec define a set of standard that any device of a specific type can follow If a device follow that standard then a special driver for that device is not necessary These device types are called class and consist of thing like – Storage, keyboard, mice, joy stick, network, modem Other that don’t fit require a vendor specific driver Video devices, USB 2 serial devices This features inherent hot plug capability of the design, make USB a handy, low cost mechanism to connect/disconnect several devices a runtime

– Originally developed in 1995 by a consortium including Compaq, HP, Intel, Lucent, Microsoft, and Philips – USB 1.1 supports Low-speed devices (1.5 Mbps) Full-speed devices (12 Mbps) – USB 2.0 supports High-speed devices – Up to 480 Mbps (a factor of 40 over USB 1.1) Uses the same connectors – Transmission speed is negotiated on device-by-device basis

– Avoid device-specific interfaces Eliminates multitude of interfaces – PS/2, serial, parallel, monitor, microphone, keyboard,… – Avoid non-shareable interfaces Standard interfaces support only one device – Avoid I/O address space and IRQ problems USB does not require memory or address space – Avoid installation and configuration problems Don’t have to open the box to install and configure jumpers – Allow hot attachment of devices

– Power distribution Simple devices can be bus-powered – Examples: mouse, keyboards, floppy disk drives, wireless LANs, … – Control peripherals Possible because USB allows data to flow in both directions – Expandable through hubs – Power conservation Enters suspend state if there is no activity for 3 ms – Error detection and recovery Uses CRC

USB cables

– Uses NRZI encoding Non-Return to Zero-Inverted

– A signal transition occurs if the next bit is zero It is called differential encoding – Two desirable properties Signal transitions, not levels, need to be detected Long string of zeros causes signal changes – Still a problem Long strings of 1s do not causes signal change – To solve this problem Uses bit stuffing – A zero is inserted after every six consecutive 1s

Bit stuffing

Transfer types : Four types of transfer – Control – Interrupt transfer Uses polling – Polling interval can range from 1 ms to 255 ms – Bulk – Isochronous transfer Used in real-time applications that require constant data transfer rate – Example: Reading audio from CD-ROM These transfers are scheduled regularly Do not use error detection and recovery

Used to configure and set up USB devices Three phases – Setup stage » Conveys type of request made to target device – Data stage » Optional stage » Control transfers that require data use this stage – Status stage » Checks the status of the operation Allocates a guaranteed bandwidth of 10% Error detection and recovery are used – Recovery is by means of retries

For devices with no specific data transfer rate requirements – Example: sending data to a printer Lowest priority bandwidth allocation If the other three types of transfers take 100% of the bandwidth – Bulk transfers are deferred until load decreases Error detection and recovery are used – Recovery is by means of retries

– USB host controller Initiates transactions over USB – Root hub Provides connection points – Two types of host controllers Open host controller (OHC) – Defined by Intel Universal host controller (UHC) – Specified by National Semiconductor, Microsoft, Compaq Difference between the two – How they schedule the four types of transfers

– Universal Host Controller – Schedules periodic transfers first Periodic transfers: isochronous and interrupts Can take up to 90% of bandwidth – These transfers are followed by control and bulk transfers Control transfers are guaranteed 10% of bandwidth – Bulk transfers are scheduled only if there is bandwidth available

– Open Host Controller – Different from UHC scheduling – Reserves space for non-periodic transfers first Non-periodic transfers: control and bulk 10% bandwidth reserved – Next periodic transfers are scheduled Guarantees 90% bandwidth – Left over bandwidth is allocated to non-periodic transfers

– Low-power Less than 100 mA Can be bus-powered – High-powered Between 100 mA and 500 mA – Full-powered ports can power these devices Can be designed to have their own power Operate in three modes – Configured (500 mA) – Unconfigured (100 mA) – Suspended ( about 2.5 mA)

– Bus-powered No extra power supply required Must be connected to an upstream port that can supply 500 mA Downstream ports can only supply 100 mA – Number of ports is limited to four – Support only low-powered devices – Self-powered Support 4 high-powered devices Support 4 bus-powered USB hubs – Most 4-port hubs are dual-powered

Hubs can be used to expand Upstream port Downstream ports

– Transfers are done in one or more transactions Each transaction consists of several packets – Transactions may have between 1 and 3 phases Token packet phase – Specifies transaction type and target device address Data packet phase (optional) – Maximum of 1023 bytes are transferred Handshake packet phase – Except for isochronous transfers, others use error detection for guaranteed delivery – Provides feedback on whether data has been received without error

USB IRP frame

Specifies token, data, or handshake packet Complement of type field Token packets use CRC-5 Hardware encoded special pattern

USB 1.1 transactions

USB 2.0 – USB 1.1 uses 1 ms frames – USB 2.0 uses 125  s frames 1/8 of USB 1.1 – Supports 40X data rates Up to 480 Mbps – Competitive with SCSI IEEE 1394 (FireWire) – Widely available now

USB drivers lives between different kernel subsystem (blk,net,char..) and USB HW controller USB core provide an interface to access for USB drivers to use to access and control USB hw Connect without worrying the different types of USB hardware controller that are present in the system VFS layer Blok layer Net Layer Net Layer Char Layer Char Layer TTY Layer TTY Layer …. USB device driver USB Core USB host controller USER Hardware kernel

Config Interface USB device is complex thing Linux kernel provides a subsystem USB Core to handle most of the complexity USB device consist of configuration, interface, endpoints USB device bind to USB interfaces not to entire USB devices Endpoint Interface Endpoint USB Drivers Device

USB endpoint can carry data in only one direction either host to dev (OUT endpoint) or host to dev (IN endpoint) Endpoints are 4 types: that describe how data is transmitted – Control: allow access to diff parts of USB dev. Used for conf dev, retrieve info, send cmd, retrieve status. This is small size end points call endpoint 0 – Interrupt:small amount of data at fixed rate: keyborad/mice – BULK:Large data with no loss : printer, storage, network – ISOCHRONOUS: large data, not guaranteed, stream audio/video Struct usb_host_endpoint: address, bitmask attaributes, Maxpacket size that point can handle, Intr Interval

USB end points are bundled up with interfaces One interface handle one type of logical connection (a kbd,mice or a audio) Some USB can handle multiple interfaces USB speaker with kbd for buttons and USB audio stream USB interfaces may have alternate setting which are diff choices for param of the interface Struct usb_interface: array of altsetting, num_altsetting, cur_altsetting, minor

USB interface are themselves bundle up with configurations A USB device can have multiple conf and might switch between them inorder to change the state of device A single conf is activated at a time Summery: – Device: one or more Conf – Conf : one or more Interface – Interface: one or more setting – Interface: one or more end points

/sys/dev/pci0000:00/000:9:0/usb2/2-1 Long device path First USB device is a root hub: USB controller usually connected in a PCI device Whole USB bus connect to root hub Every USB device take number of root hub as first number in its name, followed by character and then the number of port that device connected. Root_hub-hub_port:config.interface

Linux kernel communicated with all USB device with URBS Urb is used to send/receive data from a specific USB endpoints on a specific usb device in async manner Every end point can handle queue of urbs Lifecycle of urb – Created by USB dev driver – Assigned to specific endpoints of a USB dev – Submitted to a USB core by USB driver – Submitted to USB host Controller by USB core – Processed by the USB Host Controller that makes a USB transfer to the device – When urbb is completed, USB host controller notify the dev driver