/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Marc Horowitz.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* XXX this driver frontend is *very* i386 dependent and should be relocated
*/
/*
* XXX need some memory for mapping pcmcia cards into. Ideally, this
* would be completely dynamic. Practically this doesn't work,
* because the extent mapper doesn't know about all the devices all
* the time. With ISA we could finesse the issue by specifying the
* memory region in the config line. We can't do that here, so we
* cheat for now. Jason Thorpe, you are my Savior, come up with a fix
* :-)
*/
/* Map mem space. */
if (bus_space_map(memt, 0xd0000, 0x4000, 0, &memh))
panic("pcic_pci_attach: can't map mem space");
/*
* Check to see if we're using PCI or ISA interrupts. I don't
* know of any i386 systems that use the 6729 in PCI interrupt
* mode, but maybe when the PCMCIA code runs on other platforms
* we'll need to fix this.
*/
pcic_write(&sc->handle[0], PCIC_CIRRUS_EXTENDED_INDEX,
PCIC_CIRRUS_EXT_CONTROL_1);
if ((pcic_read(&sc->handle[0], PCIC_CIRRUS_EXTENDED_DATA) &
PCIC_CIRRUS_EXT_CONTROL_1_PCI_INTR_MASK)) {
aprint_error_dev(self, "PCI interrupts not supported\n");
return;
}
#if 0
/* Map and establish the interrupt. */
sc->ih = pcic_pci_machdep_pcic_intr_establish(sc, pcic_intr);
if (sc->ih == NULL) {
aprint_error_dev(self, "couldn't map interrupt\n");
return;
}
#endif
/*
* Defer configuration of children until ISA has had its chance
* to use up whatever IO space and IRQs it wants. XXX This will
* only work if ISA is attached to a pcib, AND the PCI probe finds
* and defers the ISA attachment before this one.
*/
config_defer(self, pcic_pci_callback);
config_interrupts(self, pcic_isa_config_interrupts);
}