From owner-freebsd-hackers Thu Mar 6 08:55:39 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA28241 for hackers-outgoing; Thu, 6 Mar 1997 08:55:39 -0800 (PST) Received: from main.cyclades.com (root@main.cyclades.com [208.138.19.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA28234 for ; Thu, 6 Mar 1997 08:55:35 -0800 (PST) Received: from main.cyclades.com ([208.138.19.230]) by main.cyclades.com with smtp id m0w2gS9-000SiuC (Debian Smail-3.2 1996-Jul-4 #2); Thu, 6 Mar 1997 08:55:37 -0800 (PST) Message-ID: <331EF84C.7902@cyclades.com> Date: Thu, 06 Mar 1997 09:01:00 -0800 From: Marcio Saito Reply-To: marcio@cyclades.com Organization: Cyclades Corporation X-Mailer: Mozilla 3.0 (Win95; I) MIME-Version: 1.0 To: Brian McGovern CC: hackers@freebsd.org, Cyclades Technical Support , cy_serial Subject: Re: PCI probe invokation... References: <199703061607.LAA14212@bmcgover-pc.cisco.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hello. Brian McGovern wrote: > Hi. I'm currently working on a driver for Cyclades' Cyclom-Zo card, and > (as usual), I have a ton of questions.... > > However, my first one is about the PCI probe routine. Having looked > at the cy driver for PCI, I've noticed that it compares the > device_id field to Cyclades Vendor ID (0x120e), and the device > id field to 0x100 or 0x101. > > Could someone please let me know where these values come from (function > prototype is below), so that I can ask the appropriate questions of > Cyclades, to see what I should be comparing against? Thanks. > > static char cy_probe(pcici_t config_id, pcidi_t device_id) > > -Brian Every PCI vendor part of the PCI-SIG has a unique vendor ID. 0x120e is Cyclades Corporation vendor ID. The Device ID is defined by Cyclades for each Cyclades product. 0x100 - Cyclom-Y (<1Mb) 0x101 - Cyclom-Y (>1Mb) 0x200 - Cyclom-Z (<1Mb) 0x201 - Cyclom-Z (>1Mb) As you probably know, in PCI the IRQ/address/IO/etc for each device is dynamicaly defined by the BIOS at power on time. The driver asks the kernel "Is there any PCI device in the system with vendor ID 0x120e and device ID 0x201?". The kernel inquires the BIOS (I don't know the FreeBSD kernel calls, but it should be very similar to UNIX/Linux) and answers not only yes or not, but also passes the I/O, IRQ and memory addresses used to interface with the board. Each PCI device can request the resources needed to interface with the card. The Cyclades-Z can be software configured to be "<1Mb" (32kb window of memory under 1Mb) or ">1Mb" (512kb in the 32-bit address space - default). It can also be configured to request or not one IRQ (default is no IRQ). The information on what the board requests to the BIOS is stored in a on-board EEPROM and can be changed with CYCTEST.EXE (available at cyclades ftp area). You should use the board ">1Mb" and preferably not use IRQ (because of the huge Cyclades-Z buffers -- 4kb -- a polling driver normally works well and save one IRQ, a scarce resource in PCs). Once you get the information from the BIOS/kernel, the driver usually has to "register" the device (allocate IRQ, map memory, etc). From them on, the board is accessible as any other device. Remember that the Cyclom-Z is a real 32-bit device. The driver can be much more efficient than other serial drivers if it takes advantage of it (copy data in 32-bit chunks). The Cyclades-Z is a PCI master device. In theory, the on-board CPU could copy the data directly to the kernel buffers, eliminating CPU overhead (for that matter, the Cyclades-Z could even run kernel tasks :). But, for difficulties integrating a very intelligent board into the kernel architecture, the current firmware is currently not using these features. Regards, Marcio. ---------------------------------------------------------------------- Marcio Saito e-mail: marcio@cyclades.com SW Engineer/Product Manager phone: (510)770-9727 x214 Cyclades Corporation fax: (510)770-0355 ----------------------------------------------------------------------