CH15 Overview Of Peripheral Buses ANT 鄭伊騏 (JOE)

Slides:



Advertisements
Similar presentations
Provide data pathways that connect various system components.
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Purdue University - RHIT Department How Technology Affects Us u Knowledge –Knowledge Explosion - Knowledge is doubling every 18 months to 2 years u Careers.
PCI Drivers 陳俐如 (greener). Bus architecture  The higher-level bus architectures  Consist of programming interface and electrical interface.
Chapter 10 Supporting I/O Devices. You Will Learn…  How to install peripheral I/O devices  How to use ports and expansion slots for add- on devices.
CPU Chips The logical pinout of a generic CPU. The arrows indicate input signals and output signals. The short diagonal lines indicate that multiple pins.
1 Introduction to Computers Day 6. 2 Main Circuit Board of a PC The main circuit board (motherboard or system board) is the central nervous system of.
PCI SLOTS. network cards, sound cards, modems, extra ports such as USB or serial, TV tuner cards and disk controllers. Disadvantage: their higher bandwidth.
LOGO. Types of System Boards  Nonintegrated System Board  Nonintegrated system boards can be easily identified because each expansion slot is usually.
PHY 201 (Blum) Buses Warning: some of the terminology is used inconsistently within the field.
Computer Organization CSC 405 Bus Structure. System Bus Functions and Features A bus is a common pathway across which data can travel within a computer.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Introduction to Computer Networks Introduction to Computer Networks.
Computer Organization
Interconnection Structures
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.
1 Chapter Overview Understanding Expansion Buses Configuring Expansion Cards Cables and Connectors.
PCI Drivers Ted Baker  Andy Wang CIS 4930 / COP 5641.
Bus structures Unit objectives Describe the primary types of buses, and define interrupt, IRQ, I/O address, DMA, and base memory address Describe the features.
E0001 Computers in Engineering1 The System Unit & Memory.
LOGO BUS SYSTEM Members: Bui Thi Diep Nguyen Thi Ngoc Mai Vu Thi Thuy Class: 1c06.
System Resources.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Buses Warning: some of the terminology is used inconsistently within the field.
MICROPROCESSOR INPUT/OUTPUT
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
BUS IN MICROPROCESSOR. Topics to discuss Bus Interface ISA VESA local PCI Plug and Play.
Computer Architecture Part IV-B: I/O Buses. Chipsets Intelligent bus controller chips found on the motherboard Enable higher speeds on one or more buses.
Motherboards The Main Printed Circuit Board Inside The PC That Contains and Controls The Components That Are Responsible For Processing Data.
Buses All devices in the computer are connected to the External Data Bus Extension to External Data Bus called Expansion Bus –Used for devices that might.
Chapter 3 System Configuration The Complete A+ Guide to PC Repair 5/e Update.
The BUS The Central Communications Network Copyright © Curt Hill.
CS-350 TERM PROJECT COMPUTER BUSES By : AJIT UMRANI.
Computer Organization & Assembly Language © by DR. M. Amer.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
CHAPTER Microcomputer as a Communication Device. Chapter Objectives Examine the components of the motherboard that relate to communication Describe a.
AmendmentsAmendments Advanced Higher. The PCI bus was adequate for many years, providing enough bandwidth for all the peripherals most users might want.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK– PARALLEL BUS DEVICE PROTOCOLS 1.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Motherboard A motherboard allows all the parts of your computer to receive power and communicate with one another.
PC Internal Components Lesson 4.  Intel is perhaps the most recognizable microprocessor manufacturer. List some others.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 5A Transforming Data Into Information.
1 Chapter 2 Central Processing Unit. 2 CPU The "brain" of the computer system is called the central processing unit. Everything that a computer does is.
Input/Output Organization III: Commercial Bus Standards CE 140 A1/A2 20 August 2003.
System Bus.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
A Look Inside The Processor
PHY 201 (Blum) Comparators and Buses. PHY 201 (Blum) What is it? A comparator is circuitry that compares two inputs A and B, determining whether the following.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
Lecture # 10 Processors Microcomputer Processors.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
Plug and Play (PnP) By: James Jacobs Jonathan Joyce.
Operating Systems (CS 340 D)
Introduction to microprocessor (Continued) Unit 1 Lecture 2
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
Chapter III Desktop Imaging Systems & Issues
Chapter Overview Understanding Expansion Buses
I/O BUSES.
Five Key Computer Components
PC Buses & Standards Bus = Pathway across which data can travel. Can be established between two or more computer elements. PC has a hierarchy of different.
CH15 Overview Of Peripheral Buses
Register sets The register section/array consists completely of circuitry used to temporarily store data or program codes until they are sent to the.
Presentation transcript:

CH15 Overview Of Peripheral Buses ANT 鄭伊騏 (JOE)

2/36 Outline The PCI Interface A Look Back: ISA Other PC Buses External Buses

3/36 The PCI Interface P eripheral C omponent I nterconnect ( 週邊元件互連 ) Designed as a replacement for the ISA standard. 3 main goals: to get better performance when transferring data between the computer and its peripherals. to be as platform independent as possible. To simplify adding and removing peripherals to the system.

4/36 The PCI Interface To get better performance uses a higher clock rate (25 or 33 MHz) than ISA. To be as platform independent is used extensively on IA-32, Alpha, PowerPC, SPARC64, and IA-64 systems. To simplify adding and removing peripherals supports for auto detection of interface boards.

5/36 PCI Addressing Each PCI peripheral is identified by a bus number(16-bits), combined by bus (8), device(5), and function(3). Using the lspci tool, we can get the information of each PCI peripheral. BB:DD.F as three values (bus, device, and function)

6/36 PCI Addressing

7/36 PCI Addressing lspci is from the /proc/bus/pci/devices

8/36 Layout of a Typical PCI System

9/36 PCI Addressing The hardware circuitry of each peripheral board will know memory locations, I/O ports, and configuration registers. Memory locations and I/O ports are shared by all the devices on a PCI bus. When you access a memory location, all the devices see the bus cycle at the same time. Configuration space exploits geographical addressing( 槽位定址法 ). Configuration transactions address only one slot at a time.

10/36 Boot Time When power is applied to a PCI device, the hardware the will respond only to configuration transactions. Every PCI motherboard is equipped with PCI- aware firmware, called the BIOS, NVRAM, or PROM. The firmware offers access to the device configuration address space by reading and writing registers in the PCI controller.

11/36 Boot Time User can see the PCI device list and the devices’ configuration registers by reading the follows. cat /proc/bus/pci/devices hexadecimal text file cat /proc/pci

12/36 Configuration Registers and Initialization PCI devices feature a 256-byte address space. The first 64 bytes are standardized, while the rest are device dependent. Every PCI device must contain meaningful values in the required registers, whereas the contents of the optional registers depend on the actual capabilities of the peripheral. The required fields assert the board ’ s capabilities, including whether the other fields are usable or not.

13/36 Configuration Registers and Initialization

14/36 Configuration Registers and Initialization The PCI registers are always little- endian. The driver writer should be careful about byte ordering when accessing multibyte configuration registers; code that works on the PC might not work on other platforms.

15/36 Registers vendorID 16-bit register identifies a hardware manufacturer. (ex: INTEL is 0x8086.) deviceID 16-bit register, selected by the manufacturer. This ID is usually paired with the vendor ID to make a unique 32-bit identifier for a hardware device. class Every peripheral device belongs to a class. The class register is a 16-bit value whose top 8 bits identify the ‘‘ base class ’’ (or group).

16/36 Registers subsystem vendorID subsystem deviceID These fields can be used for further identification of a device. If the chip has several different roles, and the driver must identify the actual device it is talking with. The subsystem identifiers are used to this aim.

17/36 Initialization #ifndef CONFIG_PCI # error "This driver needs PCI support to be available" #endif int jail_find_all_devices(void) { struct pci_dev *dev = NULL; int found; if (!pci_present()) return -ENODEV; for (found=0; found < JAIL_MAX_DEV;) { dev = pci_find_device(JAIL_VENDOR, JAIL_ID, dev); if (!dev) /* no more devices are there */ break; /* do device-specific actions and count the device */ found += jail_init_one(dev); } return (index == 0) ? -ENODEV : 0; } PCI_present=1, 表示主機板 支援 PCI PCI_find_device=null, 表示 找不到其他 Device

18/36 Accessing the Configuration Space After the driver has detected the device, it usually needs to read from or write to the three address spaces: memory, port, and configuration. Because the microprocessor has no way to access the configuration space directly, the computer vendor has to use the PCI controller to write and read registers. Linux offers a standard interface to access the configuration space in.

19/36 Accessing the Configuration Space int pci_read_config_byte(struct pci_dev *dev, int where, u8 *ptr); int pci_read_config_word(struct pci_dev *dev, int where, u16 *ptr); int pci_read_config_dword(struct pci_dev *dev, int where, u32 *ptr); where argument is the byte offset from the beginning of the configuration space. The value fetched from the configuration space is returned through ptr, and the return value of the functions is an error code.

20/36 Accessing the Configuration Space int pci_write_config_byte (struct pci_dev *dev, int where, u8 val); int pci_write_config_word (struct pci_dev *dev, int where, u16 val); int pci_write_config_dword (struct pci_dev *dev, int where, u32 val);

21/36 Accessing the I/O and Memory Spaces A PCI device implements up to 6 I/O address regions. Each region consists of either memory or I/O locations. The PCI device that implements I/O registers as a memory region marks the difference by setting a ‘‘ memory-is-prefetchable ’’ bit in its configuration register.

22/36 PCI Interrupts PCI interrupt is easy to handle. By the time Linux boots, the computer ’ s firmware has already assigned a unique interrupt number to the device, and the driver just needs to use it.

23/36 PCI Interrupts The IRQ number is stored in configuration register 60 (PCI_INTERRUPT_LINE), which is one byte wide. If the device doesn ’ t support interrupts, register 61 (PCI_INTERRUPT_PIN) is 0; otherwise, it ’ s nonzero.

24/36 Handling Hot-Pluggable Devices Hot-pluggable devices that can be added to or removed from the system while the system runs (EX: CardBus). Driver-Object Technology The hot-plug-aware device driver must register an object with the kernel, and the probe function for the object will be asked to check any device in the system to take hold of it or leave it alone.

25/36 A Look Back: ISA The 3 disadvantage of ISA bus poor performance. tightly bound to the PC architecture. lack of geographical addressing.

26/36 Hardware Resources ISA device can be equipped with I/O ports, memory areas, and interrupt lines. Even though the x86 processors support 64k of I/O port memory (16 address lines), some old PC hardware decodes only the lowest 10 address lines.

27/36 Hardware Resources An ISA device can use only the memory range between 640 KB and 1 MB and between 15 MB and 16 MB. The 640KB to 1MB range is used by the PC BIOS, by VGA-compatible video boards, and by various other devices, leaving little space available for new devices. Memory at 15 MB is not directly supported by Linux.

28/36 Other PC Buses PC/104 and PC/104+ Quite fashionable currently in the industrial world. MCA Micro Channel Architecture (MCA) is an IBM standard used in PS/2 computers and some laptops. is the lack of documentation, which has resulted in a lack of Linux support for MCA up until recently.

29/36 Other PC Buses EISA Extended ISA (EISA) bus is a 32-bit extension to ISA. VLB Another extension to ISA is the VESA Local Bus (VLB) interface bus, which extends the ISA connectors by adding a lengthwise slot.

30/36 Other PC Buses SBus Most not-so-recent SPARC-based workstations use SBus to connect their peripherals. NuBus It is found on older Mac computers (those with the M68k family of CPUs).

31/36 External Buses One of the most recent entries in the field of interface buses is the whole class of external buses. This includes USB, FireWire (IEEE 1394), and IEEE1284 (parallel-port-based external bus).

32/36 USB Universal Serial Bus (USB) It ’ s a single-master implementation in which the host computer polls the various devices.

33/36 USB Has the ability for a device to request a fixed bandwidth for its data transfers in order to reliably support video and audio I/O. Acts merely as a communication channel between the device and the host, without requiring specific meaning or structure in the data it delivers.

34/36 USB USB is becoming popular in the PC market. USB 1.1 has 2 transfer rates: Low speed : 1.5 Mbps. Full speed : 12 Mbps. USB 2.0 is compatible with USB 1.1 High speed : 400 Mbps.

35/36 USB controller USB 1.1 Open Host Controller Interface (OHCI) Compaq Use Memory Access (CPU uses memory instructions to access the USB Controller.) Universal Host Controller Interface (UHCI) INTEL Use I/O-mapped Access (CPU use I/O instructions to access the USB Controller)

36/36 USB controller USB 2.0 Enhanced Host Controller Interface (EHCI) Use /proc/pci can know what kind of USB controller you use.

37/36 Writing a USB Driver The approach to write a USB driver is similar to the pci_driver layout. The device driver registers its driver object with the USB subsystem, and it later uses vendor and device identifiers to identify insertion of its hardware.