Introduction PCI Interface Booting PCI driver registration Other buses. Linux Device Drivers PCI Drivers

Similar documents
PCI Bus & Interrupts

ECE 471 Embedded Systems Lecture 30

VGA Assignment Using VFIO. Alex Williamson October 21 st, 2013

Driving Me Nuts Device Classes

Understanding Bus Architectures

Buses, Video, and Upgrades

Table of Contents. Preface... xi

STANDARD I/O INTERFACES

ECE 485/585 Microprocessor System Design

Interface: Ports. Microprocessor System Design EHB432E Lecture - 6. Interface: Bus. Timing Diagrams. Istanbul Technical University

Module 6: INPUT - OUTPUT (I/O)

Review Questions on Computer Basics

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand


Linux DRM Developer s Guide

PCI Bus Prototyping Card (2)

Device I/O Programming

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Lesson 4: The Network Interface Card

regmap The power of subsystems and abstractions 2012 Wolfson Microelectronics plc

LCP-001. RedHat Linux Certified Professional (LCP) Powered by LPI. LCP-001 RedHat

ECE 471 Embedded Systems Lecture 20

Introduction USB Pisanje gonilnika USB. USB drivers

Homework. Reading. Machine Projects. Labs. Exam Next Class. None (Finish all previous reading assignments) Continue with MP5

PCI. Contents. The PCI Bus. Configuration Space. 1 of /14/ :55 PM. Configuration Mechanism #1.

8. I/O Buses and Interfaces

Products with different interface

Experiment #0. PC Hardware and Operating Systems

CEC 450 Real-Time Systems

T E C H N O T E : Understanding PCI Expansion ROM Choices for Copland

DESIGNING THE NEW INFORMATION SYSTEM. Lecturer: Prof. E.E Badu, Dept. of Information Studies Contact Information:

GAQM Exam LCP-001 Linux Certified Professional (LCP) Powered by LPI Version: 5.0 [ Total Questions: 289 ]

PCI Express System Interconnect Software Architecture for PowerQUICC TM III-based Systems

Motherboard Central Processing Unit (CPU) Random access memory (RAM)

Organisasi Sistem Komputer

CS1101: Lecture 21. Organization: Input/Output. Lecture Outline. Buses. A simple personal computer. Buses

PCI Bus Quick Reference by Doug Abbott

Computer Architecture

Digital System Design

TABLE OF CONTENTS 1. INTRODUCTION 1.1. PREFACE KEY FEATURES PERFORMANCE LIST BLOCK DIAGRAM...

PCIe driver development for Exynos SoC

Exam : FC0-U21. Title : CompTIA Strata IT Fundamentals. Version : DEMO

Contents. Foreword...xxi Preface...xxiii Acknowledgments...xxix About the Author...xxx

Anne Bracy CS 3410 Computer Science Cornell University

Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses

I/O. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 6.5-6

Vinod Koul, Sanyog Kale Intel Corp. MIPI SoundWire Linux Subsystem: An introduction to Protocol and Linux Subsystem

Computer Architecture

Design of a Programmable Bus for Microprocessor-Based Systems

Chapter 02: Computer Organization Functional units and components in a computer organization Part 3 Bus Structures

Introduction to Linux kernel driver programming + i2c drivers

Porting Linux to a new SoC

Apple 9L Mac OS X Support Essentials Download Full Version :

1 PC Hardware Basics Microprocessors (A) PC Hardware Basics Fal 2004 Hadassah College Dr. Martin Land

FPGA Manager. State of the Union. Moritz Fischer, National Instruments

ECE 471 Embedded Systems Lecture 12

FC0-U21 CompTIA Strata IT Fundamentals

Buses. Disks PCI RDRAM RDRAM LAN. Some slides adapted from lecture by David Culler. Pentium 4 Processor. Memory Controller Hub.

CMOS Passwords and Resources

CyberSerial Dual PCI Quick Installation Guide

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

MCA Driver Programming Interface

Introduction to the PCI Interface. Meeta Srivastav

Storage Systems. NPTEL Course Jan K. Gopinath Indian Institute of Science

COURSE OUTLINE AND SCHEDULE: ASSIGNMENTS ARE DUE EACH MONDAY WEDNESDAY JANUARY Computing Overview

Master Thesis. Interconnecting a Linux Host with a FPGA Board through PCI-Express

Full file at

Kernel Korner Hot Plug

Knut Omang Ifi/Oracle 6 Nov, 2017

ECE 471 Embedded Systems Lecture 21

FUNCTIONS OF COMPONENTS OF A PERSONAL COMPUTER

MMX Enhanced. 586 GXM-AV Main Board. Trademarks and / or Registered trademarks are the properties of their respective owners.

PCIe Hot-Swap Device Driver

Inside the Computer System

Exam Questions fc0-u21

CyberSerial Dual PCI Quick Installation Guide

The Serial Device Bus

VxWorks Device Driver Developer's Guide, 6.7. VxWorks. DEVICE DRIVER DEVELOPER'S GUIDE Volume 1: Fundamentals of Writing Device Drivers 6.

Input Components C H A P T E R 1 4. See also: System FAQs for WHQL Testing on

1. INTRODUCTION 2. OVERVIEW

OVERVIEW OF PERIPHERAL BUSES

I/O Channels. RAM size. Chipsets. Cluster Computing Paul A. Farrell 9/8/2011. Memory (RAM) Dept of Computer Science Kent State University 1

MODEL ANSWER FOR CLASS TEST NO: 1 (S-2014) SHREE DATTA POLYTECHNIC COLLEGE, DATTANAGAR, SHIROL.

- Knowledge of basic computer architecture and organization, ECE 445

The University of the West Indies, St. Augustine INFO 2603 Platform Technologies /2018 Semester 1 Lab 1 - Wednesday 13th September 2017

LINUX DEVICE DRIVERS Weekend Workshop

PC BIOS Settings: (22 Jan 2004) These settings will be required for either O.S. Installation or to improve the PC performance.

Computer Overview. A computer item you can physically see or touch. A computer program that tells computer hardware how to operate.

Personal computer hardware From Wikipedia, the free encyclopedia (Redirected from Computer hardware)

Mon Sep 17, 2007 Lecture 3: Process Management

VGPU ON KVM VFIO BASED MEDIATED DEVICE FRAMEWORK Neo Jia & Kirti Wankhede, 08/25/2016

Introduction to the Personal Computer

Computer Architecture and Organization (CS-507)

Linux DRM Developer s Guide

- It must provide a stable programming interfaces that applications can be built upon.

Driving Me Nuts Writing a Simple USB Driver

Computers and Microprocessors. Lecture 34 PHYS3360/AEP3630

The task of writing device drivers to facilitate booting of the DSP via these interfaces is with the user.

Computer Hardware. In this lesson we will learn about Computer Hardware, so that we have a better understanding of what a computer is.

... Application Note AN-531. PCI Express System Interconnect Software Architecture. Notes Introduction. System Architecture.

Transcription:

Overview 1 2 PCI addressing 3 4 5

bus, The most common is the PCI (in the PC world), PCI - Peripheral Component Interconnect, bus consists of two components: electrical interface programming interface, other buses.

PCI addressing PCI is more than just a bunch of wires, it is a complete set of specifications, defines how different parts of the computer should work together, differs from other simpler buses: autodetection: PCI devices do not have a jumper (older buses and devices require it), devices are configured during boot time, driver must read the configuration information on the device itself.

PCI addressing PCI addressing each PCI device is represented by: bus number, device number, function number.

PCI addressing PCI addressing PCI specification allows up to 256 buses on one system, Linux combines buses into domains, most of today s systems have at least two PCI buses, they are connected with a bridge.

PCI addressing PCI addressing Figure: A typical PCI system.

PCI addressing PCI addressing $ lspci cut -d: -f1-3 0000:00:00.0 Host bridge 0000:00:00.1 RAM memory 0000:00:00.2 RAM memory 0000:00:02.0 USB Controller 0000:00:04.0 Multimedia audio controller 0000:00:06.0 Bridge 0000:00:07.0 ISA bridge 0000:00:09.0 USB Controller 0000:00:09.1 USB Controller 0000:00:09.2 USB Controller 0000:00:0c.0 CardBus bridge 0000:00:0f.0 IDE interface 0000:00:10.0 Ethernet controller 0000:00:12.0 Network controller 0000:00:13.0 FireWire (IEEE 1394) 0000:00:14.0 VGA compatible controller

PCI addressing PCI addressing $ cat /proc/bus/pci/devices cut -f1 0000 0001 0002 0010 0020 0030 0038 0048 0049 004a 0060 0078 0080 0090 0098 00a0

PCI addressing PCI addressing $ tree /sys/bus/pci/devices/ /sys/bus/pci/devices/ -- 0000:00:00.0 ->../../../devices/pci0000:00/0000:00:00.0 -- 0000:00:00.1 ->../../../devices/pci0000:00/0000:00:00.1 -- 0000:00:00.2 ->../../../devices/pci0000:00/0000:00:00.2 -- 0000:00:02.0 ->../../../devices/pci0000:00/0000:00:02.0 -- 0000:00:04.0 ->../../../devices/pci0000:00/0000:00:04.0 -- 0000:00:06.0 ->../../../devices/pci0000:00/0000:00:06.0 -- 0000:00:07.0 ->../../../devices/pci0000:00/0000:00:07.0 -- 0000:00:09.0 ->../../../devices/pci0000:00/0000:00:09.0 -- 0000:00:09.1 ->../../../devices/pci0000:00/0000:00:09.1 -- 0000:00:09.2 ->../../../devices/pci0000:00/0000:00:09.2 -- 0000:00:0c.0 ->../../../devices/pci0000:00/0000:00:0c.0 -- 0000:00:0f.0 ->../../../devices/pci0000:00/0000:00:0f.0 -- 0000:00:10.0 ->../../../devices/pci0000:00/0000:00:10.0 -- 0000:00:12.0 ->../../../devices/pci0000:00/0000:00:12.0 -- 0000:00:13.0 ->../../../devices/pci0000:00/0000:00:13.0 -- 0000:00:14.0 ->../../../devices/pci0000:00/0000:00:14.0

PCI addressing PCI addressing The example explained: VGA video, 0x00a0 = 0000:00:14.0, domain (16 bits), bus (8 bits). device (5 bits), function (3 bits),

PCI addressing PCI addressing The hardware of each peripheral device responds to queries: memory locations, I/O ports, configuration registers the first two are shared among all devices, configuration registers use geographical addressing, the configuration queries address a single slot, never collide.

PCI addressing PCI addressing access to memory and I/O regions is well known, inb, readb, configuration transactions are performed by calling specific kernel functions for accessing configuration registers, Each PCI slot has four interrupting pins, device is defined by an n-touple: domain number, bus number, device number, function number.

boot time, at that time all devices will be configured, when the device gets electricity, it remains inactive, each motherboard is equipped with firmware, this equipment prepares the configuration part of the devices, reads and writes to device registers,

at the boot time configuration transactions for each device are triggered, to do the firmware or the Linux kernel (depending on the configuration), I/O regions and device memory are already mapped into the memory of the processor when the device driver accesses the device.

the user can view the list of PCI devices: /proc/bus/pci/devices (text file, device information), /proc/bus/pci/*/* (binary file, configuration registers for each device, one file per device), each device has a directory in sysfs: /sys/bus/pci/devices.

PCI device directory: $ tree /sys/bus/pci/devices/0000:00:10.0 /sys/bus/pci/devices/0000:00:10.0 -- class -- config -- detach_state -- device -- irq -- power -- state -- resource -- subsystem_device -- subsystem_vendor -- vendor

config - binary file configuration information, vendor, device, subsystem device, subsystem vendor, class - values for a particular device, irq - the current irq, resource - the current memory resources of this device.

PCI Figure: PCI Jernej configuration Vičič Linux Device registers. Drivers PCI Drivers

As the figure shows, some of the PCI configuration registers are required and some are optional

some registers are mandatory, other optional, PCI registers are always little-endian,

main structure: struct pci driver, consists of: a set of callback functions, a set of variables describing the driver.

const char *name; driver name, unique for all PCI drivers, const struct pci device id *id table; pointer to the pci device id structure. int (*probe) (struct pci dev *dev, const struct pci device id *id); pointer to a probing function, void (*remove) (struct pci dev *dev); pointer to a function called by PCI kernel when pci dev is being removed from the system, int (*suspend) (struct pci dev *dev, u32 state); pointer to a function called by PCI kernel at suspend int (*resume) (struct pci dev *dev); pointer to a function called by PCI kernel at resume.

this is the least needed: static struct pci_driver pci_driver = {.name = "pci_skel",.id_table = ids,.probe = probe,.remove = remove, };

registration of the structure pci driver in PCI kernel: static int init pci_skel_init(void) { return pci_register_driver(&pci_driver); }

Industry Standard Architecture (ISA) old in design and is a notoriously poor performer, Micro Channel Architecture (MCA) IBM v PS/2 računalnikih, Extended ISA (EISA) 32 bitno ISA vodilo, VESA Local Bus (VLB) Mac computers, SBus SPARC-based workstations, NuBus Mac computers M68k. USB zunanje vodilo.