From owner-svn-src-all@freebsd.org Fri Jul 3 16:20:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DACDD994162; Fri, 3 Jul 2015 16:20:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF8A2CAA; Fri, 3 Jul 2015 16:20:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t63GKEiQ002852; Fri, 3 Jul 2015 16:20:14 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t63GKE2B002851; Fri, 3 Jul 2015 16:20:14 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201507031620.t63GKE2B002851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 3 Jul 2015 16:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285099 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 16:20:15 -0000 Author: marcel Date: Fri Jul 3 16:20:14 2015 New Revision: 285099 URL: https://svnweb.freebsd.org/changeset/base/285099 Log: Minor update to the proto(4) man page: 1. We now support ISA devices 2. DMA support has been added Modified: head/share/man/man4/proto.4 Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Fri Jul 3 16:02:06 2015 (r285098) +++ head/share/man/man4/proto.4 Fri Jul 3 16:20:14 2015 (r285099) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2014 Marcel Moolenaar +.\" Copyright (c) 2014, 2015 Marcel Moolenaar .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,13 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2014 +.Dd July 3, 2015 .Dt PROTO 4 .Os .\" .Sh NAME .Nm proto -.Nd Driver for prototyping and H/W diagnostics +.Nd Generic prototyping and diagnostics driver .\" .Sh SYNOPSIS To compile this driver into the kernel, @@ -51,9 +51,9 @@ proto_load="YES" .Sh DESCRIPTION The .Nm -device driver attaches to PCI devices when no other device drivers are -present and creates device special files for all resources associated -with the device. +device driver attaches to PCI or ISA devices when no other device drivers +are present for those devices and it creates device special files for all +resources associated with the device. The driver itself has no knowledge of the device it attaches to. Programs can open these device special files and perform register-level reads and writes. @@ -75,9 +75,9 @@ All device special files corresponding t with .Pa pci::: representing the location of the PCI device in the PCI hierarchy. -A location includes: +A PCI location includes: .Pp -.Bl -tag -width XXXXXX -compact +.Bl -tag -width XXXXXX -compact -offset indent .It The PCI domain number .It @@ -91,6 +91,10 @@ The PCI function number Every PCI device has a device special file called .Pa pcicfg . This device special file gives access to the PCI configuration space. +A device special file called +.Pa busdma +is also created. +This device special file provides the interfaces needed for doing DMA. For each valid base address register (BAR), a device special file is created that contains the BAR offset and the resource type. A resource type can be either @@ -98,15 +102,49 @@ A resource type can be either or .Pa mem representing I/O port or memory mapped I/O space (resp.) +.Pp +ISA devices do not have a location. Instead, they are identified by the +first I/O port address or first memory mapped I/O address. +Consequently, all device special files corresponding to an ISA device are +located under +.Pa /dev/proto/isa: +with +.Pa addr +the address in hexadecimal notation. +For each I/O port or memory mapped I/O address, a device special file is +created that contains the resource identification used by the kernel and +the resource type. +The resource type can be either +.Pa io +or +.Pa mem +representing I/O port or memory mapped I/O space (resp.) +When the device has a DMA channel assigned to it, a device special file +with the name +.Pa busdma +is created as well. +This device special file provides the interfaces needed for doing DMA. +.Pp +If the ISA device is not a Plug-and-Play device nor present in the ACPI +device tree, it must have the appropriate hints so that the kernel can +reserve the resources for it. .\" .Sh EXAMPLES A single function PCI device in domain 0, on bus 1, in slot 2 and having a single memory mapped I/O region will have the following device special files: .Pp -.Bl -tag -width XXXXXX -compact +.Bl -tag -width XXXXXX -compact -offset indent .It Pa /dev/proto/pci0:1:2:0/10.mem .It Pa /dev/proto/pci0:1:2:0/pcicfg .El +.Pp +A legacy floppy controller will have the following device files: +.Pp +.Bl -tag -width XXXXXX -compact -offset indent +.It Pa /dev/proto/isa:0x3f0/00.io +.It Pa /dev/proto/isa:0x3f0/01.io +.It Pa /dev/proto/isa:0x3f0/busdma +.El .\" .Sh AUTHORS The @@ -123,13 +161,12 @@ It is not advisable to use this driver o The .Nm driver does not yet support interrupts. -Since interrupts cannot be handled by the driver itself, they must be converted -into signals and delivered to the program that has registered for interrupts. -.Pp -In order to test the transmission or reception of data, some means of doing -direct memory access (DMA) by the device must be possible. -This too must be under the control of the program. -The details of how a program can set up and -initiate DMA still need to be fleshed out. -.Pp -Support for non-PCI devices has not been implemented yet. +Since interrupts cannot be handled by the driver itself, they must be +converted into signals and delivered to the program that has registered +for interrupts. +A satisfactory mechanism for keeping the interrupt masked during the +signal handling is still being worked out. +.Pp +DMA support for devices other than busmaster devices is not present yet. +The details of how a program is to interact with the DMA controller still +need to be fleshed out.