CH15 Overview Of Peripheral Buses

Slides:



Advertisements
Similar presentations
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Advertisements

PCI Drivers 陳俐如 (greener). Bus architecture  The higher-level bus architectures  Consist of programming interface and electrical interface.
CH15 Overview Of Peripheral Buses ANT 鄭伊騏 (JOE)
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.
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.
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.
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.
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,
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.
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.
CHAPTER Microcomputer as a Communication Device. Chapter Objectives Examine the components of the motherboard that relate to communication Describe a.
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.
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.
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.
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.
Chapter 4: Network Interface Cards
DIRECT MEMORY ACCESS and Computer Buses
Unit Subtitle: Bus Structures Excerpted from
Chapter Objectives In this chapter, you will learn:
Bus Systems ISA PCI AGP.
Computer Hardware – System Unit
Local Area Networks, 3rd Edition David A. Stamper
Components of Computer
Operating Systems (CS 340 D)
Discovering Computers 2011: Living in a Digital World Chapter 4
Introduction to microprocessor (Continued) Unit 1 Lecture 2
McGraw-Hill Technology Education
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
Microcomputer Architecture
Plug-and-Play.
CSCI 315 Operating Systems Design
University of Gujrat Department of Computer Science
Chapter Overview Understanding Expansion Buses
McGraw-Hill Technology Education
Today’s agenda Hardware architecture and runtime system
Guide to Networking Essentials Fifth Edition
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.
Chapters 1-3 Concepts NT Server Capabilities
Chapter 2: Planning for Server Hardware
McGraw-Hill Technology Education
Universal Serial Bus (USB)
McGraw-Hill Technology Education
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 LAB@CCUCOMM 鄭伊騏 (JOE)

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

The PCI Interface Peripheral Component Interconnect (週邊元件互連) 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.

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.

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)

PCI Addressing

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

Layout of a Typical PCI System

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.

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.

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

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.

Configuration Registers and Initialization

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.

Registers vendorID deviceID class 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). Class:Ethernet與Token Ring是屬於網路組的兩種類別,

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.

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

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 <linux/pci.h>.

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.

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);

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.

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.

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.

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.

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

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.

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.

Other PC Buses PC/104 and PC/104+ MCA 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.

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.

Other PC Buses SBus NuBus 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).

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).

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

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.

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.

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)

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

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.