Home | History | Annotate | Line # | Download | only in xscale
i80312.c revision 1.22
      1  1.22      matt /*	$NetBSD: i80312.c,v 1.22 2012/09/18 05:47:28 matt Exp $	*/
      2   1.1   thorpej 
      3   1.1   thorpej /*
      4  1.10   thorpej  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
      5   1.1   thorpej  * All rights reserved.
      6   1.1   thorpej  *
      7   1.1   thorpej  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
      8   1.1   thorpej  *
      9   1.1   thorpej  * Redistribution and use in source and binary forms, with or without
     10   1.1   thorpej  * modification, are permitted provided that the following conditions
     11   1.1   thorpej  * are met:
     12   1.1   thorpej  * 1. Redistributions of source code must retain the above copyright
     13   1.1   thorpej  *    notice, this list of conditions and the following disclaimer.
     14   1.1   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.1   thorpej  *    notice, this list of conditions and the following disclaimer in the
     16   1.1   thorpej  *    documentation and/or other materials provided with the distribution.
     17   1.1   thorpej  * 3. All advertising materials mentioning features or use of this software
     18   1.1   thorpej  *    must display the following acknowledgement:
     19   1.1   thorpej  *	This product includes software developed for the NetBSD Project by
     20   1.1   thorpej  *	Wasabi Systems, Inc.
     21   1.1   thorpej  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22   1.1   thorpej  *    or promote products derived from this software without specific prior
     23   1.1   thorpej  *    written permission.
     24   1.1   thorpej  *
     25   1.1   thorpej  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26   1.1   thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27   1.1   thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28   1.1   thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29   1.1   thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30   1.1   thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31   1.1   thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32   1.1   thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33   1.1   thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34   1.1   thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35   1.1   thorpej  * POSSIBILITY OF SUCH DAMAGE.
     36   1.1   thorpej  */
     37   1.1   thorpej 
     38   1.1   thorpej /*
     39   1.1   thorpej  * Autoconfiguration support for the Intel i80312 Companion I/O chip.
     40   1.1   thorpej  */
     41  1.15     lukem 
     42  1.15     lukem #include <sys/cdefs.h>
     43  1.22      matt __KERNEL_RCSID(0, "$NetBSD: i80312.c,v 1.22 2012/09/18 05:47:28 matt Exp $");
     44   1.1   thorpej 
     45   1.1   thorpej #include <sys/param.h>
     46   1.1   thorpej #include <sys/systm.h>
     47   1.1   thorpej #include <sys/device.h>
     48   1.1   thorpej 
     49  1.10   thorpej #define	_ARM32_BUS_DMA_PRIVATE
     50  1.21    dyoung #include <sys/bus.h>
     51   1.1   thorpej 
     52   1.1   thorpej #include <arm/xscale/i80312reg.h>
     53   1.1   thorpej #include <arm/xscale/i80312var.h>
     54   1.1   thorpej 
     55   1.1   thorpej #include <dev/pci/ppbreg.h>
     56   1.1   thorpej 
     57   1.1   thorpej /*
     58  1.19       wiz  * Statically-allocated bus_space structure used to access the
     59   1.1   thorpej  * i80312's own registers.
     60   1.1   thorpej  */
     61   1.1   thorpej struct bus_space i80312_bs_tag;
     62   1.1   thorpej 
     63   1.5   thorpej /*
     64   1.5   thorpej  * There can be only one i80312, so we keep a global pointer to
     65   1.5   thorpej  * the softc, so board-specific code can use features of the
     66   1.5   thorpej  * i80312 without having to have a handle on the softc itself.
     67   1.5   thorpej  */
     68   1.5   thorpej struct i80312_softc *i80312_softc;
     69   1.5   thorpej 
     70  1.10   thorpej static void i80312_pci_dma_init(struct i80312_softc *);
     71  1.16   thorpej static void i80312_local_dma_init(struct i80312_softc *);
     72  1.10   thorpej 
     73  1.16   thorpej static int i80312_iopxs_print(void *, const char *);
     74   1.1   thorpej 
     75  1.16   thorpej /* Built-in devices. */
     76  1.16   thorpej static const struct iopxs_device {
     77  1.16   thorpej 	const char *id_name;
     78  1.16   thorpej 	bus_addr_t id_offset;
     79  1.16   thorpej 	bus_size_t id_size;
     80  1.16   thorpej } iopxs_devices[] = {
     81  1.16   thorpej /*	{ "iopaau",	I80312_AAU_BASE,	I80312_AAU_SIZE }, */
     82  1.16   thorpej /*	{ "iopdma",	I80312_DMA_BASE0,	I80312_DMA_SIZE }, */
     83  1.16   thorpej /*	{ "iopdma",	I80312_DMA_BASE1,	I80312_DMA_SIZE }, */
     84  1.16   thorpej 	{ "iopiic",	I80312_IIC_BASE,	I80312_IIC_SIZE },
     85  1.16   thorpej /*	{ "iopmu",	I80312_MSG_BASE,	I80312_MU_SIZE }, */
     86  1.16   thorpej 	{ NULL,		0,			0 }
     87  1.16   thorpej };
     88  1.16   thorpej 
     89   1.1   thorpej /*
     90   1.1   thorpej  * i80312_attach:
     91   1.1   thorpej  *
     92   1.1   thorpej  *	Board-independent attach routine for the i80312.
     93   1.1   thorpej  */
     94   1.1   thorpej void
     95   1.1   thorpej i80312_attach(struct i80312_softc *sc)
     96   1.1   thorpej {
     97   1.1   thorpej 	struct pcibus_attach_args pba;
     98  1.16   thorpej 	const struct iopxs_device *id;
     99  1.16   thorpej 	struct iopxs_attach_args ia;
    100   1.1   thorpej 	uint32_t atucr;
    101   1.1   thorpej 	pcireg_t preg;
    102   1.8    briggs 
    103   1.8    briggs 	i80312_softc = sc;
    104   1.1   thorpej 
    105   1.1   thorpej 	/*
    106   1.1   thorpej 	 * Slice off some useful subregion handles.
    107   1.1   thorpej 	 */
    108   1.1   thorpej 
    109   1.1   thorpej 	if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_PPB_BASE,
    110   1.1   thorpej 	    I80312_PPB_SIZE, &sc->sc_ppb_sh))
    111  1.12    provos 		panic("%s: unable to subregion PPB registers",
    112   1.1   thorpej 		    sc->sc_dev.dv_xname);
    113   1.1   thorpej 
    114   1.1   thorpej 	if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_ATU_BASE,
    115   1.1   thorpej 	    I80312_ATU_SIZE, &sc->sc_atu_sh))
    116  1.12    provos 		panic("%s: unable to subregion ATU registers",
    117   1.5   thorpej 		    sc->sc_dev.dv_xname);
    118   1.5   thorpej 
    119   1.5   thorpej 	if (bus_space_subregion(sc->sc_st, sc->sc_sh, I80312_INTC_BASE,
    120   1.5   thorpej 	    I80312_INTC_SIZE, &sc->sc_intc_sh))
    121  1.12    provos 		panic("%s: unable to subregion INTC registers",
    122   1.1   thorpej 		    sc->sc_dev.dv_xname);
    123   1.1   thorpej 
    124   1.3   thorpej 	/* We expect the Memory Controller to be already sliced off. */
    125   1.3   thorpej 
    126   1.1   thorpej 	/*
    127   1.1   thorpej 	 * Disable the private space decode.
    128   1.1   thorpej 	 */
    129   1.1   thorpej 	sc->sc_sder = bus_space_read_1(sc->sc_st, sc->sc_ppb_sh,
    130   1.1   thorpej 	    I80312_PPB_SDER);
    131   1.1   thorpej 	sc->sc_sder &= ~PPB_SDER_PMSE;
    132   1.1   thorpej 	bus_space_write_1(sc->sc_st, sc->sc_ppb_sh,
    133   1.1   thorpej 	    I80312_PPB_SDER, sc->sc_sder);
    134   1.1   thorpej 
    135   1.1   thorpej 	/*
    136   1.1   thorpej 	 * Program the Secondary ID Select register.
    137   1.1   thorpej 	 */
    138   1.1   thorpej 	bus_space_write_2(sc->sc_st, sc->sc_ppb_sh,
    139   1.1   thorpej 	    I80312_PPB_SISR, sc->sc_sisr);
    140   1.1   thorpej 
    141   1.1   thorpej 	/*
    142   1.1   thorpej 	 * Program the private secondary bus spaces.
    143   1.1   thorpej 	 */
    144   1.1   thorpej 	if (sc->sc_privmem_size && sc->sc_privio_size) {
    145   1.1   thorpej 		bus_space_write_1(sc->sc_st, sc->sc_ppb_sh, I80312_PPB_SIOBR,
    146   1.1   thorpej 		    (sc->sc_privio_base >> 12) << 4);
    147   1.1   thorpej 		bus_space_write_1(sc->sc_st, sc->sc_ppb_sh, I80312_PPB_SIOLR,
    148   1.1   thorpej 		    ((sc->sc_privio_base + sc->sc_privio_size - 1)
    149   1.1   thorpej 		     >> 12) << 4);
    150   1.1   thorpej 
    151   1.1   thorpej 		bus_space_write_2(sc->sc_st, sc->sc_ppb_sh, I80312_PPB_SMBR,
    152   1.1   thorpej 		    (sc->sc_privmem_base >> 20) << 4);
    153   1.1   thorpej 		bus_space_write_2(sc->sc_st, sc->sc_ppb_sh, I80312_PPB_SMLR,
    154   1.1   thorpej 		    ((sc->sc_privmem_base + sc->sc_privmem_size - 1)
    155   1.1   thorpej 		     >> 20) << 4);
    156   1.1   thorpej 
    157   1.1   thorpej 		sc->sc_sder |= PPB_SDER_PMSE;
    158   1.1   thorpej 		bus_space_write_1(sc->sc_st, sc->sc_ppb_sh, I80312_PPB_SDER,
    159   1.1   thorpej 		    sc->sc_sder);
    160   1.1   thorpej 	} else if (sc->sc_privmem_size || sc->sc_privio_size) {
    161   1.1   thorpej 		printf("%s: WARNING: privmem_size 0x%08x privio_size 0x%08x\n",
    162   1.1   thorpej 		    sc->sc_dev.dv_xname, sc->sc_privmem_size,
    163   1.1   thorpej 		    sc->sc_privio_size);
    164   1.1   thorpej 		printf("%s: private bus spaces not enabled\n",
    165   1.1   thorpej 		    sc->sc_dev.dv_xname);
    166   1.1   thorpej 	}
    167   1.1   thorpej 
    168   1.1   thorpej 	/*
    169   1.1   thorpej 	 * Program the Primary Inbound window.
    170   1.1   thorpej 	 */
    171   1.1   thorpej 	if (sc->sc_is_host)
    172   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    173   1.1   thorpej 		    PCI_MAPREG_START, sc->sc_pin_base);
    174   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    175   1.1   thorpej 	    I80312_ATU_PIAL, ATU_LIMIT(sc->sc_pin_size));
    176   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    177   1.1   thorpej 	    I80312_ATU_PIATV, sc->sc_pin_xlate);
    178   1.1   thorpej 
    179   1.1   thorpej 	/*
    180   1.1   thorpej 	 * Program the Secondary Inbound window.
    181   1.1   thorpej 	 */
    182   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    183   1.1   thorpej 	    I80312_ATU_SIAM, sc->sc_sin_base);
    184   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    185   1.1   thorpej 	    I80312_ATU_SIAL, ATU_LIMIT(sc->sc_sin_size));
    186   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    187   1.1   thorpej 	    I80312_ATU_SIATV, sc->sc_sin_xlate);
    188   1.2   thorpej 
    189   1.2   thorpej 	/*
    190   1.2   thorpej 	 * Mask (disable) the ATU interrupt sources.
    191   1.2   thorpej 	 * XXX May want to revisit this if we encounter
    192   1.2   thorpej 	 * XXX an application that wants it.
    193   1.2   thorpej 	 */
    194   1.2   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    195   1.2   thorpej 	    I80312_ATU_PAIM,
    196   1.2   thorpej 	    ATU_AIM_MPEIM | ATU_AIM_TATIM | ATU_AIM_TAMIM |
    197   1.2   thorpej 	    ATU_AIM_MAIM | ATU_AIM_SAIM | ATU_AIM_DPEIM |
    198   1.2   thorpej 	    ATU_AIM_PSTIM);
    199   1.2   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    200   1.2   thorpej 	    I80312_ATU_SAIM,
    201   1.2   thorpej 	    ATU_AIM_MPEIM | ATU_AIM_TATIM | ATU_AIM_TAMIM |
    202   1.2   thorpej 	    ATU_AIM_MAIM | ATU_AIM_SAIM | ATU_AIM_DPEIM);
    203   1.1   thorpej 
    204   1.1   thorpej 	/*
    205   1.1   thorpej 	 * Clear:
    206   1.1   thorpej 	 *
    207   1.1   thorpej 	 *	Primary Outbound ATU Enable
    208   1.1   thorpej 	 *	Secondary Outbound ATU Enable
    209   1.1   thorpej 	 *	Secondary Direct Addressing Select
    210   1.1   thorpej 	 *	Direct Addressing Enable
    211   1.1   thorpej 	 */
    212   1.1   thorpej 	atucr = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, I80312_ATU_ACR);
    213   1.1   thorpej 	atucr &= ~(ATU_ACR_POAE|ATU_ACR_SOAE|ATU_ACR_SDAS|ATU_ACR_DAE);
    214   1.1   thorpej 
    215   1.1   thorpej 	/*
    216   1.1   thorpej 	 * Program the Primary Outbound windows.
    217   1.1   thorpej 	 */
    218   1.1   thorpej 	if (sc->sc_pmemout_size)
    219   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    220   1.1   thorpej 		    I80312_ATU_POMWV, sc->sc_pmemout_base);
    221   1.1   thorpej 	if (sc->sc_pioout_size)
    222   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    223   1.1   thorpej 		    I80312_ATU_POIOWV, sc->sc_pioout_base);
    224   1.1   thorpej 	if (sc->sc_pmemout_size || sc->sc_pioout_size)
    225   1.1   thorpej 		atucr |= ATU_ACR_POAE;
    226   1.1   thorpej 
    227   1.1   thorpej 	/*
    228   1.1   thorpej 	 * Program the Secondary Outbound windows.
    229   1.1   thorpej 	 */
    230   1.1   thorpej 	if (sc->sc_smemout_size)
    231   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    232   1.1   thorpej 		    I80312_ATU_SOMWV, sc->sc_smemout_base);
    233   1.1   thorpej 	if (sc->sc_sioout_size)
    234   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    235   1.1   thorpej 		    I80312_ATU_SOIOWV, sc->sc_sioout_base);
    236   1.1   thorpej 	if (sc->sc_smemout_size || sc->sc_sioout_size)
    237   1.1   thorpej 		atucr |= ATU_ACR_SOAE;
    238   1.1   thorpej 
    239   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh, I80312_ATU_ACR, atucr);
    240   1.1   thorpej 
    241   1.1   thorpej 	/*
    242   1.1   thorpej 	 * Enable bus mastering, memory access, SERR, and parity
    243   1.1   thorpej 	 * checking on the ATU.
    244   1.1   thorpej 	 */
    245   1.1   thorpej 	if (sc->sc_is_host) {
    246   1.1   thorpej 		preg = bus_space_read_4(sc->sc_st, sc->sc_atu_sh,
    247   1.1   thorpej 		    PCI_COMMAND_STATUS_REG);
    248   1.1   thorpej 		preg |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE |
    249   1.1   thorpej 		    PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE;
    250   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    251   1.1   thorpej 		    PCI_COMMAND_STATUS_REG, preg);
    252   1.1   thorpej 	}
    253   1.1   thorpej 	preg = bus_space_read_4(sc->sc_st, sc->sc_atu_sh,
    254   1.1   thorpej 	    I80312_ATU_SACS);
    255   1.1   thorpej 	preg |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE |
    256   1.1   thorpej 	    PCI_COMMAND_PARITY_ENABLE | PCI_COMMAND_SERR_ENABLE;
    257   1.1   thorpej 	bus_space_write_4(sc->sc_st, sc->sc_atu_sh,
    258   1.1   thorpej 	    I80312_ATU_SACS, preg);
    259   1.1   thorpej 
    260   1.1   thorpej 	/*
    261   1.1   thorpej 	 * Configure the bridge.  If we're a host, set the primary
    262   1.1   thorpej 	 * bus to bus #0 and the secondary bus to bus #1.  We also
    263   1.1   thorpej 	 * set the PPB's subordinate bus # to 1.  It will be fixed
    264   1.1   thorpej 	 * up later when we fully configure the bus.
    265   1.1   thorpej 	 *
    266   1.1   thorpej 	 * If we're a slave, just use the bus #'s that the host
    267   1.1   thorpej 	 * provides.
    268   1.1   thorpej 	 */
    269   1.1   thorpej 	if (sc->sc_is_host) {
    270   1.1   thorpej 		bus_space_write_4(sc->sc_st, sc->sc_ppb_sh,
    271   1.1   thorpej 		    PPB_REG_BUSINFO,
    272   1.1   thorpej 		    (0 << PCI_BRIDGE_BUS_PRIMARY_SHIFT) |
    273   1.1   thorpej 		    (1 << PCI_BRIDGE_BUS_SECONDARY_SHIFT) |
    274   1.1   thorpej 		    (1 << PCI_BRIDGE_BUS_SUBORDINATE_SHIFT));
    275   1.1   thorpej 	}
    276   1.1   thorpej 
    277  1.10   thorpej 	/* Initialize the bus space tags. */
    278   1.1   thorpej 	i80312_io_bs_init(&sc->sc_pci_iot, sc);
    279   1.1   thorpej 	i80312_mem_bs_init(&sc->sc_pci_memt, sc);
    280  1.10   thorpej 
    281  1.10   thorpej 	/* Initialize the PCI chipset tag. */
    282   1.1   thorpej 	i80312_pci_init(&sc->sc_pci_chipset, sc);
    283   1.1   thorpej 
    284  1.10   thorpej 	/* Initialize the DMA tags. */
    285  1.10   thorpej 	i80312_pci_dma_init(sc);
    286  1.16   thorpej 	i80312_local_dma_init(sc);
    287  1.16   thorpej 
    288  1.16   thorpej 	/*
    289  1.16   thorpej 	 * Attach all the IOP built-ins.
    290  1.16   thorpej 	 */
    291  1.16   thorpej 	for (id = iopxs_devices; id->id_name != NULL; id++) {
    292  1.16   thorpej 		ia.ia_name = id->id_name;
    293  1.16   thorpej 		ia.ia_st = sc->sc_st;
    294  1.16   thorpej 		ia.ia_sh = sc->sc_sh;
    295  1.16   thorpej 		ia.ia_dmat = &sc->sc_local_dmat;
    296  1.16   thorpej 		ia.ia_offset = id->id_offset;
    297  1.16   thorpej 		ia.ia_size = id->id_size;
    298  1.16   thorpej 
    299  1.17  drochner 		(void) config_found_ia(&sc->sc_dev, "iopxs", &ia, i80312_iopxs_print);
    300  1.16   thorpej 	}
    301  1.10   thorpej 
    302   1.1   thorpej 	/*
    303   1.6   thorpej 	 * Attach the PCI bus.
    304   1.6   thorpej 	 *
    305   1.6   thorpej 	 * Note: We only probe the Secondary PCI bus, since that
    306   1.6   thorpej 	 * is the only bus on which we can have a private device
    307   1.6   thorpej 	 * space.
    308   1.1   thorpej 	 */
    309   1.6   thorpej 	preg = bus_space_read_4(sc->sc_st, sc->sc_ppb_sh, PPB_REG_BUSINFO);
    310   1.1   thorpej 	pba.pba_iot = &sc->sc_pci_iot;
    311   1.1   thorpej 	pba.pba_memt = &sc->sc_pci_memt;
    312   1.1   thorpej 	pba.pba_dmat = &sc->sc_pci_dmat;
    313  1.14      fvdl 	pba.pba_dmat64 = NULL;
    314   1.1   thorpej 	pba.pba_pc = &sc->sc_pci_chipset;
    315   1.6   thorpej 	pba.pba_bus = PPB_BUSINFO_SECONDARY(preg);
    316   1.9   thorpej 	pba.pba_bridgetag = NULL;
    317   1.7    briggs 	pba.pba_intrswiz = 3;
    318   1.7    briggs 	pba.pba_intrtag = 0;
    319   1.4   thorpej 	/* XXX MRL/MRM/MWI seem to have problems, at the moment. */
    320  1.20    dyoung 	pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY /* |
    321   1.4   thorpej 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY */;
    322  1.17  drochner 	(void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
    323   1.1   thorpej }
    324   1.1   thorpej 
    325   1.1   thorpej /*
    326  1.16   thorpej  * i80312_iopxs_print:
    327  1.16   thorpej  *
    328  1.16   thorpej  *	Autoconfiguration cfprint routine when attaching
    329  1.16   thorpej  *	to the "iopxs" device.
    330  1.16   thorpej  */
    331  1.16   thorpej static int
    332  1.16   thorpej i80312_iopxs_print(void *aux, const char *pnp)
    333  1.16   thorpej {
    334  1.16   thorpej 
    335  1.16   thorpej 	return (QUIET);
    336  1.16   thorpej }
    337  1.16   thorpej 
    338  1.16   thorpej /*
    339  1.10   thorpej  * i80312_pci_dma_init:
    340  1.10   thorpej  *
    341  1.10   thorpej  *	Initialize the PCI DMA tag.
    342  1.10   thorpej  */
    343  1.10   thorpej static void
    344  1.10   thorpej i80312_pci_dma_init(struct i80312_softc *sc)
    345  1.10   thorpej {
    346  1.10   thorpej 	bus_dma_tag_t dmat = &sc->sc_pci_dmat;
    347  1.10   thorpej 	struct arm32_dma_range *dr = &sc->sc_pci_dma_range;
    348  1.10   thorpej 
    349  1.10   thorpej 	dr->dr_sysbase = sc->sc_sin_xlate;
    350  1.10   thorpej 	dr->dr_busbase = sc->sc_sin_base;
    351  1.10   thorpej 	dr->dr_len = sc->sc_sin_size;
    352  1.10   thorpej 
    353  1.10   thorpej 	dmat->_ranges = dr;
    354  1.10   thorpej 	dmat->_nranges = 1;
    355  1.16   thorpej 
    356  1.16   thorpej 	dmat->_dmamap_create = _bus_dmamap_create;
    357  1.16   thorpej 	dmat->_dmamap_destroy = _bus_dmamap_destroy;
    358  1.16   thorpej 	dmat->_dmamap_load = _bus_dmamap_load;
    359  1.16   thorpej 	dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
    360  1.16   thorpej 	dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
    361  1.16   thorpej 	dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
    362  1.16   thorpej 	dmat->_dmamap_unload = _bus_dmamap_unload;
    363  1.16   thorpej 	dmat->_dmamap_sync_pre = _bus_dmamap_sync;
    364  1.16   thorpej 	dmat->_dmamap_sync_post = NULL;
    365  1.16   thorpej 
    366  1.16   thorpej 	dmat->_dmamem_alloc = _bus_dmamem_alloc;
    367  1.16   thorpej 	dmat->_dmamem_free = _bus_dmamem_free;
    368  1.16   thorpej 	dmat->_dmamem_map = _bus_dmamem_map;
    369  1.16   thorpej 	dmat->_dmamem_unmap = _bus_dmamem_unmap;
    370  1.16   thorpej 	dmat->_dmamem_mmap = _bus_dmamem_mmap;
    371  1.22      matt 
    372  1.22      matt 	dmat->_dmatag_subregion = _bus_dmatag_subregion;
    373  1.22      matt 	dmat->_dmatag_destroy = _bus_dmatag_destroy;
    374  1.16   thorpej }
    375  1.16   thorpej 
    376  1.16   thorpej /*
    377  1.16   thorpej  * i80312_local_dma_init:
    378  1.16   thorpej  *
    379  1.16   thorpej  *	Initialize the local DMA tag.
    380  1.16   thorpej  */
    381  1.16   thorpej static void
    382  1.16   thorpej i80312_local_dma_init(struct i80312_softc *sc)
    383  1.16   thorpej {
    384  1.16   thorpej 	bus_dma_tag_t dmat = &sc->sc_local_dmat;
    385  1.16   thorpej 
    386  1.16   thorpej 	dmat->_ranges = NULL;
    387  1.16   thorpej 	dmat->_nranges = 0;
    388  1.10   thorpej 
    389  1.10   thorpej 	dmat->_dmamap_create = _bus_dmamap_create;
    390  1.10   thorpej 	dmat->_dmamap_destroy = _bus_dmamap_destroy;
    391  1.10   thorpej 	dmat->_dmamap_load = _bus_dmamap_load;
    392  1.10   thorpej 	dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
    393  1.10   thorpej 	dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
    394  1.10   thorpej 	dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
    395  1.10   thorpej 	dmat->_dmamap_unload = _bus_dmamap_unload;
    396  1.11   thorpej 	dmat->_dmamap_sync_pre = _bus_dmamap_sync;
    397  1.11   thorpej 	dmat->_dmamap_sync_post = NULL;
    398  1.10   thorpej 
    399  1.10   thorpej 	dmat->_dmamem_alloc = _bus_dmamem_alloc;
    400  1.10   thorpej 	dmat->_dmamem_free = _bus_dmamem_free;
    401  1.10   thorpej 	dmat->_dmamem_map = _bus_dmamem_map;
    402  1.10   thorpej 	dmat->_dmamem_unmap = _bus_dmamem_unmap;
    403  1.10   thorpej 	dmat->_dmamem_mmap = _bus_dmamem_mmap;
    404   1.1   thorpej }
    405