Home | History | Annotate | Line # | Download | only in tx
tx39.c revision 1.20.2.2
      1  1.20.2.2  bouyer /*	$NetBSD: tx39.c,v 1.20.2.2 2000/11/20 20:47:12 bouyer Exp $ */
      2  1.20.2.2  bouyer 
      3  1.20.2.2  bouyer /*-
      4  1.20.2.2  bouyer  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
      5  1.20.2.2  bouyer  * All rights reserved.
      6  1.20.2.2  bouyer  *
      7  1.20.2.2  bouyer  * This code is derived from software contributed to The NetBSD Foundation
      8  1.20.2.2  bouyer  * by UCHIYAMA Yasushi.
      9  1.20.2.2  bouyer  *
     10  1.20.2.2  bouyer  * Redistribution and use in source and binary forms, with or without
     11  1.20.2.2  bouyer  * modification, are permitted provided that the following conditions
     12  1.20.2.2  bouyer  * are met:
     13  1.20.2.2  bouyer  * 1. Redistributions of source code must retain the above copyright
     14  1.20.2.2  bouyer  *    notice, this list of conditions and the following disclaimer.
     15  1.20.2.2  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.20.2.2  bouyer  *    notice, this list of conditions and the following disclaimer in the
     17  1.20.2.2  bouyer  *    documentation and/or other materials provided with the distribution.
     18  1.20.2.2  bouyer  * 3. All advertising materials mentioning features or use of this software
     19  1.20.2.2  bouyer  *    must display the following acknowledgement:
     20  1.20.2.2  bouyer  *        This product includes software developed by the NetBSD
     21  1.20.2.2  bouyer  *        Foundation, Inc. and its contributors.
     22  1.20.2.2  bouyer  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.20.2.2  bouyer  *    contributors may be used to endorse or promote products derived
     24  1.20.2.2  bouyer  *    from this software without specific prior written permission.
     25  1.20.2.2  bouyer  *
     26  1.20.2.2  bouyer  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.20.2.2  bouyer  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.20.2.2  bouyer  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.20.2.2  bouyer  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.20.2.2  bouyer  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.20.2.2  bouyer  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.20.2.2  bouyer  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.20.2.2  bouyer  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.20.2.2  bouyer  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.20.2.2  bouyer  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.20.2.2  bouyer  * POSSIBILITY OF SUCH DAMAGE.
     37  1.20.2.2  bouyer  */
     38  1.20.2.2  bouyer 
     39  1.20.2.2  bouyer #include "opt_tx39_debug.h"
     40  1.20.2.2  bouyer #include "m38813c.h"
     41  1.20.2.2  bouyer #include "tc5165buf.h"
     42  1.20.2.2  bouyer 
     43  1.20.2.2  bouyer #include <sys/param.h>
     44  1.20.2.2  bouyer #include <sys/systm.h>
     45  1.20.2.2  bouyer #include <sys/device.h>
     46  1.20.2.2  bouyer #include <sys/kcore.h>
     47  1.20.2.2  bouyer 
     48  1.20.2.2  bouyer #include <machine/locore.h>   /* cpu_id */
     49  1.20.2.2  bouyer #include <machine/bootinfo.h> /* bootinfo */
     50  1.20.2.2  bouyer #include <machine/sysconf.h>  /* platform */
     51  1.20.2.2  bouyer 
     52  1.20.2.2  bouyer #include <machine/platid.h>
     53  1.20.2.2  bouyer #include <machine/platid_mask.h>
     54  1.20.2.2  bouyer 
     55  1.20.2.2  bouyer #include <machine/bus.h>
     56  1.20.2.2  bouyer #include <machine/intr.h>
     57  1.20.2.2  bouyer 
     58  1.20.2.2  bouyer #include <hpcmips/hpcmips/machdep.h> /* cpu_name */
     59  1.20.2.2  bouyer 
     60  1.20.2.2  bouyer #include <hpcmips/tx/tx39biureg.h>
     61  1.20.2.2  bouyer #include <hpcmips/tx/tx39reg.h>
     62  1.20.2.2  bouyer #include <hpcmips/tx/tx39var.h>
     63  1.20.2.2  bouyer #ifdef TX391X
     64  1.20.2.2  bouyer #include <hpcmips/tx/tx3912videovar.h>
     65  1.20.2.2  bouyer #endif
     66  1.20.2.2  bouyer 
     67  1.20.2.2  bouyer #include <sys/termios.h>
     68  1.20.2.2  bouyer #include <sys/ttydefaults.h>
     69  1.20.2.2  bouyer #include <hpcmips/tx/tx39uartvar.h>
     70  1.20.2.2  bouyer #ifndef CONSPEED
     71  1.20.2.2  bouyer #define CONSPEED TTYDEF_SPEED
     72  1.20.2.2  bouyer #endif
     73  1.20.2.2  bouyer 
     74  1.20.2.2  bouyer /* console keyboard */
     75  1.20.2.2  bouyer #if NM38813C > 0
     76  1.20.2.2  bouyer #include <hpcmips/dev/m38813cvar.h>
     77  1.20.2.2  bouyer #endif
     78  1.20.2.2  bouyer #if NTC5165BUF > 0
     79  1.20.2.2  bouyer #include <hpcmips/dev/tc5165bufvar.h>
     80  1.20.2.2  bouyer #endif
     81  1.20.2.2  bouyer 
     82  1.20.2.2  bouyer extern unsigned nullclkread(void);
     83  1.20.2.2  bouyer extern unsigned (*clkread)(void);
     84  1.20.2.2  bouyer 
     85  1.20.2.2  bouyer struct tx_chipset_tag tx_chipset;
     86  1.20.2.2  bouyer 
     87  1.20.2.2  bouyer #ifdef TX39_DEBUG
     88  1.20.2.2  bouyer u_int32_t tx39debugflag;
     89  1.20.2.2  bouyer #endif
     90  1.20.2.2  bouyer 
     91  1.20.2.2  bouyer void	tx_init(void);
     92  1.20.2.2  bouyer int	tx39icu_intr(u_int32_t, u_int32_t, u_int32_t, u_int32_t);
     93  1.20.2.2  bouyer void	tx39clock_cpuspeed(int*, int*);
     94  1.20.2.2  bouyer 
     95  1.20.2.2  bouyer /* TX39-specific initialization vector */
     96  1.20.2.2  bouyer void	tx_os_init(void);
     97  1.20.2.2  bouyer void	tx_bus_reset(void);
     98  1.20.2.2  bouyer void	tx_cons_init(void);
     99  1.20.2.2  bouyer void	tx_device_register(struct device *, void *);
    100  1.20.2.2  bouyer void    tx_fb_init(caddr_t*);
    101  1.20.2.2  bouyer void    tx_mem_init(paddr_t);
    102  1.20.2.2  bouyer void	tx_find_dram(paddr_t, paddr_t);
    103  1.20.2.2  bouyer void	tx_reboot(int, char *);
    104  1.20.2.2  bouyer int	tx_intr(u_int32_t, u_int32_t, u_int32_t, u_int32_t);
    105  1.20.2.2  bouyer 
    106  1.20.2.2  bouyer extern phys_ram_seg_t mem_clusters[];
    107  1.20.2.2  bouyer extern int mem_cluster_cnt;
    108  1.20.2.2  bouyer 
    109  1.20.2.2  bouyer void
    110  1.20.2.2  bouyer tx_init()
    111  1.20.2.2  bouyer {
    112  1.20.2.2  bouyer 	tx_chipset_tag_t tc;
    113  1.20.2.2  bouyer 	int model, rev;
    114  1.20.2.2  bouyer 	int cpuclock;
    115  1.20.2.2  bouyer 
    116  1.20.2.2  bouyer 	tc = tx_conf_get_tag();
    117  1.20.2.2  bouyer 	/*
    118  1.20.2.2  bouyer 	 * Platform Specific Function Hooks
    119  1.20.2.2  bouyer 	 */
    120  1.20.2.2  bouyer 	platform.os_init = tx_os_init;
    121  1.20.2.2  bouyer 	platform.bus_reset = tx_bus_reset;
    122  1.20.2.2  bouyer 	platform.cons_init = tx_cons_init;
    123  1.20.2.2  bouyer 	platform.device_register = tx_device_register;
    124  1.20.2.2  bouyer 	platform.fb_init = tx_fb_init;
    125  1.20.2.2  bouyer 	platform.mem_init = tx_mem_init;
    126  1.20.2.2  bouyer 	platform.reboot = tx_reboot;
    127  1.20.2.2  bouyer 	platform.iointr = tx39icu_intr;
    128  1.20.2.2  bouyer 
    129  1.20.2.2  bouyer 	model = MIPS_PRID_REV(cpu_id);
    130  1.20.2.2  bouyer 
    131  1.20.2.2  bouyer 	switch (model) {
    132  1.20.2.2  bouyer 	default:
    133  1.20.2.2  bouyer 		 /* Unknown TOSHIBA TX39-series */
    134  1.20.2.2  bouyer 		sprintf(cpu_name, "Unknown TOSHIBA TX39-series %x", model);
    135  1.20.2.2  bouyer 		break;
    136  1.20.2.2  bouyer 	case TMPR3912:
    137  1.20.2.2  bouyer 		tx39clock_cpuspeed(&cpuclock, &cpuspeed);
    138  1.20.2.2  bouyer 
    139  1.20.2.2  bouyer 		sprintf(cpu_name, "TOSHIBA TMPR3912 %d.%02d MHz",
    140  1.20.2.2  bouyer 			cpuclock / 1000000, (cpuclock % 1000000) / 10000);
    141  1.20.2.2  bouyer 		tc->tc_chipset = __TX391X;
    142  1.20.2.2  bouyer 		break;
    143  1.20.2.2  bouyer 	case TMPR3922:
    144  1.20.2.2  bouyer 		tx39clock_cpuspeed(&cpuclock, &cpuspeed);
    145  1.20.2.2  bouyer 		rev = tx_conf_read(tc, TX3922_REVISION_REG);
    146  1.20.2.2  bouyer 
    147  1.20.2.2  bouyer 		sprintf(cpu_name, "TOSHIBA TMPR3922 rev. %x.%x "
    148  1.20.2.2  bouyer 			"%d.%02d MHz", (rev >> 4) & 0xf, rev & 0xf,
    149  1.20.2.2  bouyer 			cpuclock / 1000000, (cpuclock % 1000000) / 10000);
    150  1.20.2.2  bouyer 		tc->tc_chipset = __TX392X;
    151  1.20.2.2  bouyer 		break;
    152  1.20.2.2  bouyer 	}
    153  1.20.2.2  bouyer }
    154  1.20.2.2  bouyer 
    155  1.20.2.2  bouyer void
    156  1.20.2.2  bouyer tx_os_init()
    157  1.20.2.2  bouyer {
    158  1.20.2.2  bouyer 	/*
    159  1.20.2.2  bouyer 	 * Set up interrupt handling and I/O addresses.
    160  1.20.2.2  bouyer 	 */
    161  1.20.2.2  bouyer 
    162  1.20.2.2  bouyer 	splvec.splbio = MIPS_SPL_2_4;
    163  1.20.2.2  bouyer 	splvec.splnet = MIPS_SPL_2_4;
    164  1.20.2.2  bouyer 	splvec.spltty = MIPS_SPL_2_4;
    165  1.20.2.2  bouyer 	splvec.splimp = MIPS_SPL_2_4;
    166  1.20.2.2  bouyer 	splvec.splclock = MIPS_SPL_2_4;
    167  1.20.2.2  bouyer 	splvec.splstatclock = MIPS_SPL_2_4;
    168  1.20.2.2  bouyer 
    169  1.20.2.2  bouyer 	/* no high resolution timer circuit; possibly never called */
    170  1.20.2.2  bouyer 	clkread = nullclkread;
    171  1.20.2.2  bouyer }
    172  1.20.2.2  bouyer 
    173  1.20.2.2  bouyer void
    174  1.20.2.2  bouyer tx_fb_init(kernend)
    175  1.20.2.2  bouyer 	caddr_t *kernend;
    176  1.20.2.2  bouyer {
    177  1.20.2.2  bouyer #ifdef TX391X
    178  1.20.2.2  bouyer 	paddr_t fb_end;
    179  1.20.2.2  bouyer 
    180  1.20.2.2  bouyer 	fb_end = MIPS_KSEG0_TO_PHYS(mem_clusters[0].start +
    181  1.20.2.2  bouyer 				    mem_clusters[0].size - 1);
    182  1.20.2.2  bouyer 	tx3912video_init(MIPS_KSEG0_TO_PHYS(*kernend), &fb_end);
    183  1.20.2.2  bouyer 
    184  1.20.2.2  bouyer 	/* Skip V-RAM area */
    185  1.20.2.2  bouyer 	*kernend = (caddr_t)MIPS_PHYS_TO_KSEG0(fb_end);
    186  1.20.2.2  bouyer #endif /* TX391X */
    187  1.20.2.2  bouyer #ifdef TX392X
    188  1.20.2.2  bouyer 	/*
    189  1.20.2.2  bouyer 	 *  Plum V-RAM isn't accessible until pmap_bootstrap,
    190  1.20.2.2  bouyer 	 * at this time, frame buffer device is disabled.
    191  1.20.2.2  bouyer 	 */
    192  1.20.2.2  bouyer 	bootinfo->fb_addr = 0;
    193  1.20.2.2  bouyer #endif /* TX392X */
    194  1.20.2.2  bouyer }
    195  1.20.2.2  bouyer 
    196  1.20.2.2  bouyer void
    197  1.20.2.2  bouyer tx_mem_init(kernend)
    198  1.20.2.2  bouyer 	paddr_t kernend;
    199  1.20.2.2  bouyer {
    200  1.20.2.2  bouyer 	mem_clusters[0].start = 0;
    201  1.20.2.2  bouyer 	mem_clusters[0].size = kernend;
    202  1.20.2.2  bouyer 	mem_cluster_cnt = 1;
    203  1.20.2.2  bouyer 	/* search DRAM bank 0 */
    204  1.20.2.2  bouyer 	tx_find_dram(kernend, 0x02000000);
    205  1.20.2.2  bouyer 
    206  1.20.2.2  bouyer 	/* search DRAM bank 1 */
    207  1.20.2.2  bouyer 	tx_find_dram(0x02000000, 0x04000000);
    208  1.20.2.2  bouyer 	/*
    209  1.20.2.2  bouyer 	 *  Clear currently unused D-RAM area
    210  1.20.2.2  bouyer 	 *  (For reboot Windows CE clearly)
    211  1.20.2.2  bouyer 	 */
    212  1.20.2.2  bouyer 	memset((void *)(KERNBASE + 0x400), 0, KERNTEXTOFF -
    213  1.20.2.2  bouyer 	       (KERNBASE + 0x800));
    214  1.20.2.2  bouyer }
    215  1.20.2.2  bouyer 
    216  1.20.2.2  bouyer void
    217  1.20.2.2  bouyer tx_find_dram(start, end)
    218  1.20.2.2  bouyer 	paddr_t start, end;
    219  1.20.2.2  bouyer {
    220  1.20.2.2  bouyer 	caddr_t page, startaddr, endaddr;
    221  1.20.2.2  bouyer 
    222  1.20.2.2  bouyer 	startaddr = (void*)MIPS_PHYS_TO_KSEG1(start);
    223  1.20.2.2  bouyer 	endaddr = (void*)MIPS_PHYS_TO_KSEG1(end);
    224  1.20.2.2  bouyer 
    225  1.20.2.2  bouyer #define DRAM_MAGIC0 0xac1dcafe
    226  1.20.2.2  bouyer #define DRAM_MAGIC1 0x19700220
    227  1.20.2.2  bouyer 
    228  1.20.2.2  bouyer 	page = startaddr;
    229  1.20.2.2  bouyer 	if (badaddr(page, 4))
    230  1.20.2.2  bouyer 		return;
    231  1.20.2.2  bouyer 
    232  1.20.2.2  bouyer 	*(volatile int *)(page + 0) = DRAM_MAGIC0;
    233  1.20.2.2  bouyer 	*(volatile int *)(page + 4) = DRAM_MAGIC1;
    234  1.20.2.2  bouyer 	wbflush();
    235  1.20.2.2  bouyer 
    236  1.20.2.2  bouyer 	if (*(volatile int *)(page + 0) != DRAM_MAGIC0 ||
    237  1.20.2.2  bouyer 	    *(volatile int *)(page + 4) != DRAM_MAGIC1)
    238  1.20.2.2  bouyer 		return;
    239  1.20.2.2  bouyer 
    240  1.20.2.2  bouyer 	for (page += NBPG; page < endaddr; page += NBPG) {
    241  1.20.2.2  bouyer 		if (badaddr(page, 4))
    242  1.20.2.2  bouyer 			return;
    243  1.20.2.2  bouyer 
    244  1.20.2.2  bouyer 		if (*(volatile int *)(page + 0) == DRAM_MAGIC0 &&
    245  1.20.2.2  bouyer 		    *(volatile int *)(page + 4) == DRAM_MAGIC1) {
    246  1.20.2.2  bouyer 			goto memend_found;
    247  1.20.2.2  bouyer 		}
    248  1.20.2.2  bouyer 	}
    249  1.20.2.2  bouyer 
    250  1.20.2.2  bouyer 	/* check for 32MByte memory */
    251  1.20.2.2  bouyer 	page -= NBPG;
    252  1.20.2.2  bouyer 	*(volatile int *)(page + 0) = DRAM_MAGIC0;
    253  1.20.2.2  bouyer 	*(volatile int *)(page + 4) = DRAM_MAGIC1;
    254  1.20.2.2  bouyer 	wbflush();
    255  1.20.2.2  bouyer 
    256  1.20.2.2  bouyer 	if (*(volatile int *)(page + 0) != DRAM_MAGIC0 ||
    257  1.20.2.2  bouyer 	    *(volatile int *)(page + 4) != DRAM_MAGIC1)
    258  1.20.2.2  bouyer 		return; /* no memory in this bank */
    259  1.20.2.2  bouyer 
    260  1.20.2.2  bouyer  memend_found:
    261  1.20.2.2  bouyer 	mem_clusters[mem_cluster_cnt].start = start;
    262  1.20.2.2  bouyer 	mem_clusters[mem_cluster_cnt].size = page - startaddr;
    263  1.20.2.2  bouyer 
    264  1.20.2.2  bouyer 	/* skip kernel area */
    265  1.20.2.2  bouyer 	if (mem_cluster_cnt == 1)
    266  1.20.2.2  bouyer 		mem_clusters[mem_cluster_cnt].size -= start;
    267  1.20.2.2  bouyer 
    268  1.20.2.2  bouyer 	mem_cluster_cnt++;
    269  1.20.2.2  bouyer }
    270  1.20.2.2  bouyer 
    271  1.20.2.2  bouyer void
    272  1.20.2.2  bouyer tx_reboot(howto, bootstr)
    273  1.20.2.2  bouyer 	int howto;
    274  1.20.2.2  bouyer 	char *bootstr;
    275  1.20.2.2  bouyer {
    276  1.20.2.2  bouyer 	goto *(u_int32_t *)MIPS_RESET_EXC_VEC;
    277  1.20.2.2  bouyer }
    278  1.20.2.2  bouyer 
    279  1.20.2.2  bouyer void
    280  1.20.2.2  bouyer tx_bus_reset()
    281  1.20.2.2  bouyer {
    282  1.20.2.2  bouyer 	/* hpcmips port don't use */
    283  1.20.2.2  bouyer }
    284  1.20.2.2  bouyer 
    285  1.20.2.2  bouyer void
    286  1.20.2.2  bouyer tx_cons_init()
    287  1.20.2.2  bouyer {
    288  1.20.2.2  bouyer 	int slot;
    289  1.20.2.2  bouyer #define CONSPLATIDMATCH(p)						\
    290  1.20.2.2  bouyer 	platid_match(&platid, &platid_mask_MACH_##p)
    291  1.20.2.2  bouyer 
    292  1.20.2.2  bouyer #ifdef SERIALCONSSLOT
    293  1.20.2.2  bouyer 	slot = SERIALCONSSLOT;
    294  1.20.2.2  bouyer #else
    295  1.20.2.2  bouyer 	slot = TX39_UARTA;
    296  1.20.2.2  bouyer #endif
    297  1.20.2.2  bouyer 	if (bootinfo->bi_cnuse & BI_CNUSE_SERIAL) {
    298  1.20.2.2  bouyer 		if(txcom_cnattach(slot, CONSPEED,
    299  1.20.2.2  bouyer 				  (TTYDEF_CFLAG & ~(CSIZE | PARENB)) |
    300  1.20.2.2  bouyer 				  CS8)) {
    301  1.20.2.2  bouyer 			panic("tx_cons_init: can't attach serial console.");
    302  1.20.2.2  bouyer 		}
    303  1.20.2.2  bouyer 	} else {
    304  1.20.2.2  bouyer #if NM38813C > 0
    305  1.20.2.2  bouyer 		if(CONSPLATIDMATCH(VICTOR_INTERLINK) &&
    306  1.20.2.2  bouyer 		   m38813c_cnattach(TX39_SYSADDR_CARD1)) {
    307  1.20.2.2  bouyer 			goto panic;
    308  1.20.2.2  bouyer 		}
    309  1.20.2.2  bouyer #endif
    310  1.20.2.2  bouyer #if NTC5165BUF > 0
    311  1.20.2.2  bouyer 		if(CONSPLATIDMATCH(COMPAQ_C) &&
    312  1.20.2.2  bouyer 		   tc5165buf_cnattach(TX39_SYSADDR_CS3)) {
    313  1.20.2.2  bouyer 			goto panic;
    314  1.20.2.2  bouyer 		}
    315  1.20.2.2  bouyer 
    316  1.20.2.2  bouyer 		if(CONSPLATIDMATCH(SHARP_TELIOS) &&
    317  1.20.2.2  bouyer 		   tc5165buf_cnattach(TX39_SYSADDR_CS1)) {
    318  1.20.2.2  bouyer 			goto panic;
    319  1.20.2.2  bouyer 		}
    320  1.20.2.2  bouyer 
    321  1.20.2.2  bouyer 		if(CONSPLATIDMATCH(SHARP_MOBILON) &&
    322  1.20.2.2  bouyer 		   tc5165buf_cnattach(TX39_SYSADDR_MCS0)) {
    323  1.20.2.2  bouyer 			goto panic;
    324  1.20.2.2  bouyer 		}
    325  1.20.2.2  bouyer #endif
    326  1.20.2.2  bouyer 	}
    327  1.20.2.2  bouyer 
    328  1.20.2.2  bouyer 	return;
    329  1.20.2.2  bouyer  panic:
    330  1.20.2.2  bouyer 	panic("tx_cons_init: can't init console");
    331  1.20.2.2  bouyer 	/* NOTREACHED */
    332  1.20.2.2  bouyer }
    333  1.20.2.2  bouyer 
    334  1.20.2.2  bouyer void
    335  1.20.2.2  bouyer tx_device_register(dev, aux)
    336  1.20.2.2  bouyer 	struct device *dev;
    337  1.20.2.2  bouyer 	void *aux;
    338  1.20.2.2  bouyer {
    339  1.20.2.2  bouyer 	/* hpcmips port don't use */
    340  1.20.2.2  bouyer }
    341  1.20.2.2  bouyer 
    342  1.20.2.2  bouyer void
    343  1.20.2.2  bouyer tx_conf_register_intr(t, intrt)
    344  1.20.2.2  bouyer 	tx_chipset_tag_t t;
    345  1.20.2.2  bouyer 	void *intrt;
    346  1.20.2.2  bouyer {
    347  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    348  1.20.2.2  bouyer 
    349  1.20.2.2  bouyer 	tx_chipset.tc_intrt = intrt;
    350  1.20.2.2  bouyer }
    351  1.20.2.2  bouyer 
    352  1.20.2.2  bouyer void
    353  1.20.2.2  bouyer tx_conf_register_power(t, powert)
    354  1.20.2.2  bouyer 	tx_chipset_tag_t t;
    355  1.20.2.2  bouyer 	void *powert;
    356  1.20.2.2  bouyer {
    357  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    358  1.20.2.2  bouyer 
    359  1.20.2.2  bouyer 	tx_chipset.tc_powert = powert;
    360  1.20.2.2  bouyer }
    361  1.20.2.2  bouyer 
    362  1.20.2.2  bouyer void
    363  1.20.2.2  bouyer tx_conf_register_clock(t, clockt)
    364  1.20.2.2  bouyer 	tx_chipset_tag_t t;
    365  1.20.2.2  bouyer 	void *clockt;
    366  1.20.2.2  bouyer {
    367  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    368  1.20.2.2  bouyer 
    369  1.20.2.2  bouyer 	tx_chipset.tc_clockt = clockt;
    370  1.20.2.2  bouyer }
    371  1.20.2.2  bouyer 
    372  1.20.2.2  bouyer void
    373  1.20.2.2  bouyer tx_conf_register_sound(t, soundt)
    374  1.20.2.2  bouyer 	tx_chipset_tag_t t;
    375  1.20.2.2  bouyer 	void *soundt;
    376  1.20.2.2  bouyer {
    377  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    378  1.20.2.2  bouyer 
    379  1.20.2.2  bouyer 	tx_chipset.tc_soundt = soundt;
    380  1.20.2.2  bouyer }
    381  1.20.2.2  bouyer 
    382  1.20.2.2  bouyer void
    383  1.20.2.2  bouyer tx_conf_register_ioman(tx_chipset_tag_t t, struct txio_ops *ops)
    384  1.20.2.2  bouyer {
    385  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    386  1.20.2.2  bouyer 	KASSERT(ops);
    387  1.20.2.2  bouyer 
    388  1.20.2.2  bouyer 	tx_chipset.tc_ioops[ops->_group] = ops;
    389  1.20.2.2  bouyer }
    390  1.20.2.2  bouyer 
    391  1.20.2.2  bouyer void
    392  1.20.2.2  bouyer tx_conf_register_video(t, videot)
    393  1.20.2.2  bouyer 	tx_chipset_tag_t t;
    394  1.20.2.2  bouyer 	void *videot;
    395  1.20.2.2  bouyer {
    396  1.20.2.2  bouyer 	KASSERT(t == &tx_chipset);
    397  1.20.2.2  bouyer 
    398  1.20.2.2  bouyer 	tx_chipset.tc_videot = videot;
    399  1.20.2.2  bouyer }
    400  1.20.2.2  bouyer 
    401  1.20.2.2  bouyer int
    402  1.20.2.2  bouyer __is_set_print(reg, mask, name)
    403  1.20.2.2  bouyer 	u_int32_t reg;
    404  1.20.2.2  bouyer 	int mask;
    405  1.20.2.2  bouyer 	char *name;
    406  1.20.2.2  bouyer {
    407  1.20.2.2  bouyer 	const char onoff[2] = "_x";
    408  1.20.2.2  bouyer 	int ret = reg & mask ? 1 : 0;
    409  1.20.2.2  bouyer 
    410  1.20.2.2  bouyer 	printf("%s[%c] ", name, onoff[ret]);
    411  1.20.2.2  bouyer 
    412  1.20.2.2  bouyer 	return ret;
    413  1.20.2.2  bouyer }
    414