Home | History | Annotate | Line # | Download | only in ifpga
ifpga.c revision 1.6
      1  1.6   thorpej /*	$NetBSD: ifpga.c,v 1.6 2002/01/30 03:59:41 thorpej Exp $ */
      2  1.1  rearnsha 
      3  1.1  rearnsha /*
      4  1.1  rearnsha  * Copyright (c) 2001 ARM Ltd
      5  1.1  rearnsha  * All rights reserved.
      6  1.1  rearnsha  *
      7  1.1  rearnsha  * Redistribution and use in source and binary forms, with or without
      8  1.1  rearnsha  * modification, are permitted provided that the following conditions
      9  1.1  rearnsha  * are met:
     10  1.1  rearnsha  * 1. Redistributions of source code must retain the above copyright
     11  1.1  rearnsha  *    notice, this list of conditions and the following disclaimer.
     12  1.1  rearnsha  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  rearnsha  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  rearnsha  *    documentation and/or other materials provided with the distribution.
     15  1.1  rearnsha  * 3. The name of the company may not be used to endorse or promote
     16  1.1  rearnsha  *    products derived from this software without specific prior written
     17  1.1  rearnsha  *    permission.
     18  1.1  rearnsha  *
     19  1.1  rearnsha  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     20  1.1  rearnsha  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     21  1.1  rearnsha  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22  1.1  rearnsha  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     23  1.1  rearnsha  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     24  1.1  rearnsha  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     25  1.1  rearnsha  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  1.1  rearnsha  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.1  rearnsha  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  1.1  rearnsha  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  1.1  rearnsha  * SUCH DAMAGE.
     30  1.1  rearnsha  */
     31  1.1  rearnsha 
     32  1.1  rearnsha /*
     33  1.1  rearnsha  * Integrator FPGA core logic support.
     34  1.1  rearnsha  *
     35  1.1  rearnsha  * The integrator board supports the core logic in an FPGA which is loaded
     36  1.1  rearnsha  * at POR with a custom design.  This code supports the default logic as the
     37  1.1  rearnsha  * board is shipped.
     38  1.1  rearnsha  */
     39  1.1  rearnsha 
     40  1.1  rearnsha #include <sys/types.h>
     41  1.1  rearnsha #include <sys/device.h>
     42  1.1  rearnsha #include <sys/systm.h>
     43  1.1  rearnsha #include <sys/extent.h>
     44  1.1  rearnsha #include <sys/malloc.h>
     45  1.1  rearnsha #include <sys/null.h>
     46  1.1  rearnsha 
     47  1.1  rearnsha #include <dev/pci/pcivar.h>
     48  1.1  rearnsha #include <dev/pci/pciconf.h>
     49  1.1  rearnsha 
     50  1.1  rearnsha #include <machine/intr.h>
     51  1.6   thorpej #include <evbarm/ifpga/irqhandler.h>	/* XXX XXX XXX */
     52  1.5   thorpej 
     53  1.5   thorpej #include <arm/cpufunc.h>
     54  1.1  rearnsha 
     55  1.1  rearnsha #include "opt_cputypes.h"
     56  1.1  rearnsha #include "opt_pci.h"
     57  1.1  rearnsha #include "pci.h"
     58  1.1  rearnsha 
     59  1.1  rearnsha #include <evbarm/ifpga/ifpgamem.h>
     60  1.1  rearnsha #include <evbarm/ifpga/ifpgavar.h>
     61  1.1  rearnsha #include <evbarm/ifpga/ifpgareg.h>
     62  1.1  rearnsha #include <evbarm/ifpga/ifpga_pcivar.h>
     63  1.1  rearnsha #include <evbarm/dev/v360reg.h>
     64  1.1  rearnsha 
     65  1.1  rearnsha /* Prototypes */
     66  1.1  rearnsha static int  ifpga_match		(struct device *, struct cfdata *, void *);
     67  1.1  rearnsha static void ifpga_attach	(struct device *, struct device *, void *);
     68  1.1  rearnsha static int  ifpga_print		(void *, const char *);
     69  1.1  rearnsha static int  ifpga_pci_print	(void *, const char *);
     70  1.1  rearnsha 
     71  1.1  rearnsha /* Drive and attach structures */
     72  1.1  rearnsha struct cfattach ifpga_ca = {
     73  1.1  rearnsha 	sizeof(struct ifpga_softc), ifpga_match, ifpga_attach
     74  1.1  rearnsha };
     75  1.1  rearnsha 
     76  1.1  rearnsha int ifpga_found;
     77  1.1  rearnsha 
     78  1.1  rearnsha /* Default UART clock speed (we should make this a boot option).  */
     79  1.1  rearnsha int ifpga_uart_clk = IFPGA_UART_CLK;
     80  1.1  rearnsha 
     81  1.1  rearnsha /* Virtual base of IRQ controller.  */
     82  1.1  rearnsha void *ifpga_irq_vbase;
     83  1.1  rearnsha 
     84  1.1  rearnsha #if NPCI > 0
     85  1.1  rearnsha /* PCI handles */
     86  1.1  rearnsha extern struct arm32_pci_chipset ifpga_pci_chipset;
     87  1.1  rearnsha extern struct arm32_bus_dma_tag ifpga_pci_bus_dma_tag;
     88  1.1  rearnsha 
     89  1.1  rearnsha static struct bus_space ifpga_pci_io_tag;
     90  1.1  rearnsha static struct bus_space ifpga_pci_mem_tag;
     91  1.1  rearnsha #endif /* NPCI > 0 */
     92  1.1  rearnsha 
     93  1.1  rearnsha struct ifpga_softc *clock_sc;
     94  1.1  rearnsha 
     95  1.1  rearnsha static struct bus_space ifpga_bs_tag;
     96  1.1  rearnsha 
     97  1.1  rearnsha static struct ifpga_softc *ifpga_sc;
     98  1.1  rearnsha /*
     99  1.1  rearnsha  * Print the configuration information for children
    100  1.1  rearnsha  */
    101  1.1  rearnsha 
    102  1.1  rearnsha static int
    103  1.1  rearnsha ifpga_print(void *aux, const char *pnp)
    104  1.1  rearnsha {
    105  1.1  rearnsha 	struct ifpga_attach_args *ifa = aux;
    106  1.1  rearnsha 
    107  1.1  rearnsha 	if (ifa->ifa_addr != -1)
    108  1.1  rearnsha 		printf(" addr 0x%lx", (unsigned long)ifa->ifa_addr);
    109  1.1  rearnsha 	if (ifa->ifa_irq != -1)
    110  1.1  rearnsha 		printf(" irq %d", ifa->ifa_irq);
    111  1.1  rearnsha 
    112  1.1  rearnsha 	return UNCONF;
    113  1.1  rearnsha }
    114  1.1  rearnsha 
    115  1.1  rearnsha #if NPCI > 0
    116  1.1  rearnsha static int
    117  1.1  rearnsha ifpga_pci_print(void *aux, const char *pnp)
    118  1.1  rearnsha {
    119  1.1  rearnsha 	struct pcibus_attach_args *pci_pba = (struct pcibus_attach_args *)aux;
    120  1.1  rearnsha 
    121  1.1  rearnsha 	if (pnp)
    122  1.1  rearnsha 		printf("%s at %s", pci_pba->pba_busname, pnp);
    123  1.1  rearnsha 	if (strcmp(pci_pba->pba_busname, "pci") == 0)
    124  1.1  rearnsha 		printf(" bus %d", pci_pba->pba_bus);
    125  1.1  rearnsha 
    126  1.1  rearnsha 	return UNCONF;
    127  1.1  rearnsha }
    128  1.1  rearnsha #endif
    129  1.1  rearnsha 
    130  1.1  rearnsha static int
    131  1.1  rearnsha ifpga_search(struct device *parent, struct cfdata *cf, void *aux)
    132  1.1  rearnsha {
    133  1.1  rearnsha 	struct ifpga_softc *sc = (struct ifpga_softc *)parent;
    134  1.1  rearnsha 	struct ifpga_attach_args ifa;
    135  1.1  rearnsha 	int tryagain;
    136  1.1  rearnsha 
    137  1.1  rearnsha 	do {
    138  1.1  rearnsha 		ifa.ifa_name = "ifpga_periph";
    139  1.1  rearnsha 		ifa.ifa_iot = sc->sc_iot;
    140  1.1  rearnsha 		ifa.ifa_addr = cf->cf_iobase;
    141  1.1  rearnsha 		ifa.ifa_irq = cf->cf_irq;
    142  1.1  rearnsha 		ifa.ifa_sc_ioh = sc->sc_sc_ioh;
    143  1.1  rearnsha 
    144  1.1  rearnsha 		tryagain = 0;
    145  1.1  rearnsha 		if ((*cf->cf_attach->ca_match)(parent, cf, &ifa) > 0) {
    146  1.1  rearnsha 			config_attach(parent, cf, &ifa, ifpga_print);
    147  1.1  rearnsha 			tryagain = (cf->cf_fstate == FSTATE_STAR);
    148  1.1  rearnsha 		}
    149  1.1  rearnsha 	} while (tryagain);
    150  1.1  rearnsha 
    151  1.1  rearnsha 	return 0;
    152  1.1  rearnsha }
    153  1.1  rearnsha 
    154  1.1  rearnsha static int
    155  1.1  rearnsha ifpga_match(struct device *parent, struct cfdata *cf, void *aux)
    156  1.1  rearnsha {
    157  1.1  rearnsha #if 0
    158  1.1  rearnsha 	struct mainbus_attach_args *ma = aux;
    159  1.1  rearnsha 
    160  1.1  rearnsha 	/* Make sure that we're looking for the IFPGA.  */
    161  1.1  rearnsha 	if (strcmp(ma->ma_name, ifpga_md.md_name))
    162  1.1  rearnsha 		return 0;
    163  1.1  rearnsha #endif
    164  1.1  rearnsha 
    165  1.1  rearnsha 	/* We can only have one instance of the IFPGA.  */
    166  1.1  rearnsha 	if (ifpga_found)
    167  1.1  rearnsha 		return 0;
    168  1.1  rearnsha 
    169  1.1  rearnsha 	return 1;
    170  1.1  rearnsha }
    171  1.1  rearnsha 
    172  1.1  rearnsha static void
    173  1.1  rearnsha ifpga_attach(struct device *parent, struct device *self, void *aux)
    174  1.1  rearnsha {
    175  1.1  rearnsha 	struct ifpga_softc *sc = (struct ifpga_softc *)self;
    176  1.1  rearnsha 	u_int id, sysclk;
    177  1.1  rearnsha #if defined(PCI_NETBSD_CONFIGURE) && NPCI > 0
    178  1.1  rearnsha 	struct extent *ioext, *memext, *pmemext;
    179  1.1  rearnsha 	struct ifpga_pci_softc *pci_sc;
    180  1.1  rearnsha 	struct pcibus_attach_args pci_pba;
    181  1.1  rearnsha #endif
    182  1.1  rearnsha 
    183  1.1  rearnsha 	ifpga_found = 1;
    184  1.1  rearnsha 
    185  1.1  rearnsha 	/* We want a memory-mapped bus space, since the I/O space is sparse. */
    186  1.1  rearnsha 	ifpga_create_mem_bs_tag(&ifpga_bs_tag, (void *)IFPGA_IO_BASE);
    187  1.1  rearnsha 
    188  1.1  rearnsha #if NPCI > 0
    189  1.1  rearnsha 	/* But the PCI config space is quite large, so we have a linear region
    190  1.1  rearnsha 	   for that pre-allocated.  */
    191  1.1  rearnsha 
    192  1.1  rearnsha 	ifpga_create_io_bs_tag(&ifpga_pci_io_tag, (void *)IFPGA_PCI_IO_VBASE);
    193  1.1  rearnsha 	ifpga_create_mem_bs_tag(&ifpga_pci_mem_tag, (void *)0);
    194  1.1  rearnsha #endif
    195  1.1  rearnsha 
    196  1.1  rearnsha 	sc->sc_iot = &ifpga_bs_tag;
    197  1.1  rearnsha 
    198  1.1  rearnsha 	ifpga_sc = sc;
    199  1.1  rearnsha 
    200  1.1  rearnsha 	/* Now map in the IFPGA motherboard registers.  */
    201  1.1  rearnsha 	if (bus_space_map(sc->sc_iot, IFPGA_IO_SC_BASE, IFPGA_IO_SC_SIZE, 0,
    202  1.1  rearnsha 	    &sc->sc_sc_ioh))
    203  1.1  rearnsha 		panic("%s: Cannot map system controller registers",
    204  1.1  rearnsha 		    self->dv_xname);
    205  1.1  rearnsha 
    206  1.1  rearnsha 	id = bus_space_read_4(sc->sc_iot, sc->sc_sc_ioh, IFPGA_SC_ID);
    207  1.1  rearnsha 
    208  1.1  rearnsha 	printf(": Build %d, ", (id & IFPGA_SC_ID_BUILD_MASK) >>
    209  1.1  rearnsha 	    IFPGA_SC_ID_BUILD_SHIFT);
    210  1.1  rearnsha 	switch (id & IFPGA_SC_ID_REV_MASK)
    211  1.1  rearnsha 	{
    212  1.1  rearnsha 	case IFPGA_SC_ID_REV_A:
    213  1.1  rearnsha 		printf("Rev A, ");
    214  1.1  rearnsha 		break;
    215  1.1  rearnsha 	case IFPGA_SC_ID_REV_B:
    216  1.1  rearnsha 		printf("Rev B, ");
    217  1.1  rearnsha 		break;
    218  1.1  rearnsha 	}
    219  1.1  rearnsha 
    220  1.1  rearnsha 	printf("Manufacturer ");
    221  1.1  rearnsha 	switch (id & IFPGA_SC_ID_MAN_MASK)
    222  1.1  rearnsha 	{
    223  1.1  rearnsha 	case IFPGA_SC_ID_MAN_ARM:
    224  1.1  rearnsha 		printf("ARM Ltd,");
    225  1.1  rearnsha 		break;
    226  1.1  rearnsha 	default:
    227  1.1  rearnsha 		printf("Unknown,");
    228  1.1  rearnsha 		break;
    229  1.1  rearnsha 	}
    230  1.1  rearnsha 
    231  1.1  rearnsha 	switch (id & IFPGA_SC_ID_ARCH_MASK)
    232  1.1  rearnsha 	{
    233  1.1  rearnsha 	case IFPGA_SC_ID_ARCH_ASBLE:
    234  1.1  rearnsha 		printf(" ASB, Little-endian,");
    235  1.1  rearnsha 		break;
    236  1.1  rearnsha 	case IFPGA_SC_ID_ARCH_AHBLE:
    237  1.1  rearnsha 		printf(" AHB, Little-endian,");
    238  1.1  rearnsha 		break;
    239  1.1  rearnsha 	default:
    240  1.1  rearnsha 		panic(" Unsupported bus");
    241  1.1  rearnsha 	}
    242  1.1  rearnsha 
    243  1.1  rearnsha 	printf("\n%s: FPGA ", self->dv_xname);
    244  1.1  rearnsha 
    245  1.1  rearnsha 	switch (id & IFPGA_SC_ID_FPGA_MASK)
    246  1.1  rearnsha 	{
    247  1.1  rearnsha 	case IFPGA_SC_ID_FPGA_XC4062:
    248  1.1  rearnsha 		printf("XC4062");
    249  1.1  rearnsha 		break;
    250  1.1  rearnsha 	case IFPGA_SC_ID_FPGA_XC4085:
    251  1.1  rearnsha 		printf("XC4085");
    252  1.1  rearnsha 		break;
    253  1.1  rearnsha 	default:
    254  1.1  rearnsha 		printf("unknown");
    255  1.1  rearnsha 		break;
    256  1.1  rearnsha 	}
    257  1.1  rearnsha 
    258  1.1  rearnsha 	sysclk = bus_space_read_1(sc->sc_iot, sc->sc_sc_ioh, IFPGA_SC_OSC);
    259  1.1  rearnsha 	sysclk &= IFPGA_SC_OSC_S_VDW;
    260  1.1  rearnsha 	sysclk += 8;
    261  1.1  rearnsha 
    262  1.1  rearnsha 	printf(", SYSCLK %d.%02dMHz", sysclk >> 2, (sysclk & 3) * 25);
    263  1.1  rearnsha 
    264  1.1  rearnsha 	/* Map the Interrupt controller */
    265  1.1  rearnsha 	if (bus_space_map(sc->sc_iot, IFPGA_IO_IRQ_BASE, IFPGA_IO_IRQ_SIZE,
    266  1.1  rearnsha 	    BUS_SPACE_MAP_LINEAR, &sc->sc_irq_ioh))
    267  1.1  rearnsha 		panic("%s: Cannot map irq controller registers",
    268  1.1  rearnsha 		    self->dv_xname);
    269  1.1  rearnsha 	ifpga_irq_vbase = bus_space_vaddr(sc->sc_iot, sc->sc_irq_ioh);
    270  1.1  rearnsha 
    271  1.1  rearnsha 	/* We can write to the IRQ/FIQ controller now.  */
    272  1.1  rearnsha 	irq_postinit();
    273  1.1  rearnsha 
    274  1.1  rearnsha 	/* Map the core module */
    275  1.1  rearnsha 	if (bus_space_map(sc->sc_iot, IFPGA_IO_CM_BASE, IFPGA_IO_CM_SIZE, 0,
    276  1.1  rearnsha 	    &sc->sc_cm_ioh))
    277  1.1  rearnsha 		panic("%s: Cannot map core module registers", self->dv_xname);
    278  1.1  rearnsha 
    279  1.1  rearnsha 	/* Map the timers */
    280  1.1  rearnsha 	if (bus_space_map(sc->sc_iot, IFPGA_IO_TMR_BASE, IFPGA_IO_TMR_SIZE, 0,
    281  1.1  rearnsha 	    &sc->sc_tmr_ioh))
    282  1.1  rearnsha 		panic("%s: Cannot map timer registers", self->dv_xname);
    283  1.1  rearnsha 
    284  1.1  rearnsha 	clock_sc = sc;
    285  1.1  rearnsha 
    286  1.1  rearnsha 	printf("\n");
    287  1.1  rearnsha 
    288  1.1  rearnsha #if NPCI > 0
    289  1.1  rearnsha 	pci_sc = malloc(sizeof(struct ifpga_pci_softc), M_DEVBUF, M_WAITOK);
    290  1.1  rearnsha 	pci_sc->sc_iot = &ifpga_pci_io_tag;
    291  1.1  rearnsha 	pci_sc->sc_memt = &ifpga_pci_mem_tag;
    292  1.1  rearnsha 
    293  1.1  rearnsha 	if (bus_space_map(pci_sc->sc_iot, 0, IFPGA_PCI_IO_VSIZE, 0,
    294  1.1  rearnsha 	    &pci_sc->sc_io_ioh)
    295  1.1  rearnsha 	    || bus_space_map(pci_sc->sc_iot,
    296  1.1  rearnsha 	    IFPGA_PCI_CONF_VBASE - IFPGA_PCI_IO_VBASE, IFPGA_PCI_CONF_VSIZE, 0,
    297  1.1  rearnsha 	    &pci_sc->sc_conf_ioh)
    298  1.1  rearnsha 	    || bus_space_map(pci_sc->sc_memt, IFPGA_V360_REG_BASE,
    299  1.1  rearnsha 	    IFPGA_V360_REG_SIZE, 0, &pci_sc->sc_reg_ioh))
    300  1.1  rearnsha 		panic("%s: Cannot map pci memory", self->dv_xname);
    301  1.1  rearnsha 
    302  1.1  rearnsha 	{
    303  1.1  rearnsha 		pcireg_t id_reg, class_reg;
    304  1.1  rearnsha 		char buf[1000];
    305  1.1  rearnsha 
    306  1.1  rearnsha 		id_reg = bus_space_read_4(pci_sc->sc_memt, pci_sc->sc_reg_ioh,
    307  1.1  rearnsha 		    V360_PCI_VENDOR);
    308  1.1  rearnsha 		class_reg = bus_space_read_4(pci_sc->sc_memt,
    309  1.1  rearnsha 		    pci_sc->sc_reg_ioh, V360_PCI_CC_REV);
    310  1.1  rearnsha 
    311  1.1  rearnsha 		pci_devinfo(id_reg, class_reg, 1, buf);
    312  1.1  rearnsha 		printf("%s: %s\n", self->dv_xname, buf);
    313  1.1  rearnsha 	}
    314  1.1  rearnsha 
    315  1.1  rearnsha #if defined(PCI_NETBSD_CONFIGURE)
    316  1.1  rearnsha 	ioext = extent_create("pciio", 0x00000000,
    317  1.1  rearnsha 	    0x00000000 + IFPGA_PCI_IO_VSIZE, M_DEVBUF, NULL, 0, EX_NOWAIT);
    318  1.1  rearnsha 	memext = extent_create("pcimem", IFPGA_PCI_APP0_BASE,
    319  1.1  rearnsha 	    IFPGA_PCI_APP0_BASE + IFPGA_PCI_APP0_SIZE,
    320  1.1  rearnsha 	    M_DEVBUF, NULL, 0, EX_NOWAIT);
    321  1.1  rearnsha 	pmemext = extent_create("pcipmem", IFPGA_PCI_APP1_BASE,
    322  1.1  rearnsha 	    IFPGA_PCI_APP1_BASE + IFPGA_PCI_APP1_SIZE,
    323  1.1  rearnsha 	    M_DEVBUF, NULL, 0, EX_NOWAIT);
    324  1.1  rearnsha 	ifpga_pci_chipset.pc_conf_v = (void *)pci_sc;
    325  1.4   thorpej 	pci_configure_bus(&ifpga_pci_chipset, ioext, memext, pmemext, 0,
    326  1.4   thorpej 	    arm_dcache_align);
    327  1.1  rearnsha 	extent_destroy(pmemext);
    328  1.1  rearnsha 	extent_destroy(memext);
    329  1.1  rearnsha 	extent_destroy(ioext);
    330  1.1  rearnsha 
    331  1.1  rearnsha 	printf("pci_configure_bus done\n");
    332  1.1  rearnsha #endif /* PCI_NETBSD_CONFIGURE */
    333  1.1  rearnsha #endif /* NPCI > 0 */
    334  1.1  rearnsha 
    335  1.1  rearnsha 	/* Finally, search for children.  */
    336  1.1  rearnsha 	config_search(ifpga_search, self, NULL);
    337  1.1  rearnsha 
    338  1.1  rearnsha #if NPCI > 0
    339  1.1  rearnsha 	pci_pba.pba_busname = "pci";
    340  1.1  rearnsha 	pci_pba.pba_pc = &ifpga_pci_chipset;
    341  1.1  rearnsha 	pci_pba.pba_iot = &ifpga_pci_io_tag;
    342  1.1  rearnsha 	pci_pba.pba_memt = &ifpga_pci_mem_tag;
    343  1.1  rearnsha 	pci_pba.pba_dmat = &ifpga_pci_bus_dma_tag;
    344  1.1  rearnsha 	pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
    345  1.1  rearnsha 	pci_pba.pba_bus = 0;
    346  1.1  rearnsha 
    347  1.1  rearnsha 	config_found(self, &pci_pba, ifpga_pci_print);
    348  1.1  rearnsha #endif
    349  1.1  rearnsha }
    350  1.1  rearnsha 
    351  1.1  rearnsha void
    352  1.1  rearnsha ifpga_reset(void)
    353  1.1  rearnsha {
    354  1.1  rearnsha 	bus_space_write_1(ifpga_sc->sc_iot, ifpga_sc->sc_sc_ioh,
    355  1.1  rearnsha 	    IFPGA_SC_CTRLS, IFPGA_SC_CTRL_SOFTRESET);
    356  1.1  rearnsha }
    357