Subject: Re: micro-code and PCI
To: Steven Grunza <>
From: Eduardo Horvath <>
List: tech-kern
Date: 07/27/2000 09:21:17
On Thu, 27 Jul 2000, Steven Grunza wrote:

> I'm writing a driver for a PCI board that requires microcode to be
> downloaded to it.  Has any kind of standard been created for doing
> this?  Mainly, where should the microcode be kept (/sys/dev/pci,
> /sys/microcode, ???).

Most of the microcode is currently in src/sys/dev/microcode.

> Also, I need to have the board DMA the micro-code from host memory. 
> Should the driver be given the name of the micro-code by the userland
> program or should the userland program open the file and pass the
> driver a pointer to the memory?  If the userland program passes a
> pointer to memory, it would seem that the driver will need to
> allocate wired memory, copy the data from userland, and then start
> the DMA.

Usually, microcode is compiled into the kernel.  How big is this microcode

> If any one knows of a board (not necessarily PCI) that uses microcode
> downloaded from a file on the host's disk drive, let me know and I'll
> go read the code....

isp requires microcode, as well as the siop driver.

If you're debugging microcode I have found it useful to give the driver a
device node so you can copy the microcode to the driver when you build a
new image and don't have to rebuild and reboot the kernel.  But I don't
think this is a good idea for production code.  It's a huge security hole.

Eduardo Horvath