Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Mar 1997 09:01:00 -0800
From:      Marcio Saito <marcio@cyclades.com>
To:        Brian McGovern <bmcgover@cisco.com>
Cc:        hackers@freebsd.org, Cyclades Technical Support <support@cyclades.com>, cy_serial
Subject:   Re: PCI probe invokation...
Message-ID:  <331EF84C.7902@cyclades.com>
References:  <199703061607.LAA14212@bmcgover-pc.cisco.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
----------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?331EF84C.7902>