Subject: Re: byte-sized PCI conf regs?
To: Todd Whitesel <toddpw@best.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 09/20/1999 15:05:54
On Mon, Sep 20, 1999 at 04:35:53AM -0700, Todd Whitesel wrote:
> Is there a way to do the equivalent of pci_conf_{read,write} on a single
> byte?

No, you have to read the four bytes and to the shifts, etc ... by yourself.
You can have a look at pciide.c, the pciide_pci_read() and pciide_pci_write()
function do this.

> 
> I'm trying to get at a device-specific register (which happens to be PCI conf
> offset 0x40 if it matters) that is documented as being just a byte, and the
> obvious
> 
>         i = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x40);
>         printf("PCI conf 0x40 was %#x\n", i);
>         pci_conf_write(pa->pa_pc, pa->pa_tag, 0x40, 8);
>         i = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x40);
>         printf("PCI conf 0x40 set to %#x\n", i);
> 
> earns me
> 
> PCI conf 0x40 was 0
> PCI conf 0x40 set to 0
> 
> which is strange because there are supposed to be 4 1-byte registers
> starting at 0x40, so I would expect to see something back...

Sure, this should have worked ...

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--