xref: /openbsd/sys/arch/alpha/pci/tsvar.h (revision 9ec0cef0)
1*9ec0cef0Sderaadt /* $OpenBSD: tsvar.h,v 1.8 2016/01/12 17:20:02 deraadt Exp $ */
28186b1fcSericj /* $NetBSD: tsvar.h,v 1.1 1999/06/29 06:46:47 ross Exp $ */
38186b1fcSericj 
48186b1fcSericj /*-
58186b1fcSericj  * Copyright (c) 1999 by Ross Harvey.  All rights reserved.
68186b1fcSericj  *
78186b1fcSericj  * Redistribution and use in source and binary forms, with or without
88186b1fcSericj  * modification, are permitted provided that the following conditions
98186b1fcSericj  * are met:
108186b1fcSericj  * 1. Redistributions of source code must retain the above copyright
118186b1fcSericj  *    notice, this list of conditions and the following disclaimer.
128186b1fcSericj  * 2. Redistributions in binary form must reproduce the above copyright
138186b1fcSericj  *    notice, this list of conditions and the following disclaimer in the
148186b1fcSericj  *    documentation and/or other materials provided with the distribution.
158186b1fcSericj  * 3. All advertising materials mentioning features or use of this software
168186b1fcSericj  *    must display the following acknowledgement:
178186b1fcSericj  *	This product includes software developed by Ross Harvey.
188186b1fcSericj  * 4. The name of Ross Harvey may not be used to endorse or promote products
198186b1fcSericj  *    derived from this software without specific prior written permission.
208186b1fcSericj  *
218186b1fcSericj  * THIS SOFTWARE IS PROVIDED BY ROSS HARVEY ``AS IS'' AND ANY EXPRESS
228186b1fcSericj  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
238186b1fcSericj  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP0SE
248186b1fcSericj  * ARE DISCLAIMED.  IN NO EVENT SHALL ROSS HARVEY BE LIABLE FOR ANY
258186b1fcSericj  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
268186b1fcSericj  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
278186b1fcSericj  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
288186b1fcSericj  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
298186b1fcSericj  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
308186b1fcSericj  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
318186b1fcSericj  * SUCH DAMAGE.
328186b1fcSericj  *
338186b1fcSericj  */
348186b1fcSericj 
358186b1fcSericj #include <dev/pci/pcivar.h>
368186b1fcSericj #include <alpha/pci/pci_sgmap_pte64.h>
378186b1fcSericj 
388186b1fcSericj #define	tsvar() { Generate ctags(1) key. }
398186b1fcSericj 
408186b1fcSericj struct tsp_config {
418186b1fcSericj 	int	pc_pslot;		/* Pchip 0 or 1 */
428186b1fcSericj 	int	pc_initted;		/* Initialized */
438186b1fcSericj 	u_int64_t pc_iobase;		/* All Pchip space starts here */
448186b1fcSericj 	struct	ts_pchip *pc_csr;	/* Pchip CSR space starts here */
453c4251e0Smiod 	volatile u_int64_t *pc_tlbia;	/* Pchip TLBIA register address */
468186b1fcSericj 
4770048494Snate 	struct	alpha_bus_space pc_iot, pc_memt;
488186b1fcSericj 	struct	alpha_pci_chipset pc_pc;
498186b1fcSericj 
508186b1fcSericj 	struct	alpha_bus_dma_tag pc_dmat_direct;
518186b1fcSericj 	struct	alpha_bus_dma_tag pc_dmat_sgmap;
528186b1fcSericj 
538186b1fcSericj 	struct alpha_sgmap pc_sgmap;
548186b1fcSericj 
558186b1fcSericj 	u_int32_t pc_hae_mem;
568186b1fcSericj 	u_int32_t pc_hae_io;
578186b1fcSericj 
588186b1fcSericj 	struct	extent *pc_io_ex, *pc_mem_ex;
59106ae577Smiod 	char	pc_io_ex_name[16], pc_mem_ex_name[16];
60106ae577Smiod 	long	pc_io_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long)];
61106ae577Smiod 	long	pc_mem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long)];
628186b1fcSericj 	int	pc_mallocsafe;
638186b1fcSericj };
648186b1fcSericj 
658186b1fcSericj struct tsp_softc {
668186b1fcSericj 	struct	device sc_dev;
678186b1fcSericj 	struct	tsp_config *sc_ccp;
688186b1fcSericj };
698186b1fcSericj 
708186b1fcSericj struct tsp_attach_args {
718186b1fcSericj 	char	*tsp_name;
728186b1fcSericj 	int	tsp_slot;
738186b1fcSericj };
748186b1fcSericj 
758186b1fcSericj extern int tsp_console_hose;
768186b1fcSericj 
77c4071fd1Smillert struct	tsp_config *tsp_init(int, int);
78c4071fd1Smillert void	tsp_pci_init(pci_chipset_tag_t, void *);
793c4251e0Smiod void	tsp_dma_init(struct device *, struct tsp_config *);
808186b1fcSericj 
81c4071fd1Smillert void	tsp_bus_io_init(bus_space_tag_t, void *);
82c4071fd1Smillert void	tsp_bus_mem_init(bus_space_tag_t, void *);
832a09dbffSmjacob 
84c4071fd1Smillert void tsp_bus_mem_init2(void *);
85