Subject: Re: troubles mapping isa registers
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-alpha
Date: 09/01/1999 14:22:29
On Tue, Aug 31, 1999 at 10:11:41AM -0700, Jason Thorpe wrote:
> On Tue, 31 Aug 1999 18:13:32 +0200 
>  Manuel Bouyer <bouyer@antioche.lip6.fr> wrote:
> 
>  > Hi,
>  > in order to fully support the cypress IDE controller, I need to read/write
>  > things to I/O 0x22/0x23. A first attempt to map these registers fails.
> 
> Hi...
> 
> I know precisely what is wrong here...
> 
> 0x22/0x23 == IO_ICU1 + 2 and IO_ICU1 + 3...
> 
> Those are the Cypress `magick control registers'.
> 
> They're already mapped/used by arch/alpha/pci/sio_pic.c:
> 
> u_int8_t
> cy82c693_read_elcr(elcr)
> 	int elcr;
> {
> 
> 	bus_space_write_1(sio_iot, sio_ioh_elcr, 0x02, 0x03 + elcr);
> 	return (bus_space_read_1(sio_iot, sio_ioh_elcr, 0x03));
> }
> 
> ...etc.  `sio_ioh_elcr' is mapped at IO_ICU1 (0x20) size IO_ICUSIZE (16).
> 
> How, specifically, do you need to use these registers?  We probably need

To setup the DMA timings of the pci ide controller.
To select the dma mode we need to write 0x30 or 0x31 (primary/secondary
channel) to I/O 0x22 and then write the DMA mode (0,1,2) to 0x23.

> to have a dev/ic/cy82c693.c which inits it, maps it, and exports functions
> to read/write the control registers.

This can be a solution. However I'd prefer a MI one, I suspect this chip
is present on some PC motherboard too.

> 
> Can you point me at the manual for this chip, please?

I got the doc from www.cypress.com, but it seems it's not available any more
(the product is now "obsolete"). A copy is on cvs.netbsd.org:~bouyer/

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