Home | History | Annotate | Line # | Download | only in dev
      1 /*	$NetBSD: xpbusvar.h,v 1.1 2022/06/10 21:42:23 tsutsui Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 2016 Izumi Tsutsui.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25  */
     26 
     27 #ifndef _XPBUSVAR_H_
     28 #define _XPBUSVAR_H_
     29 
     30 #include <machine/board.h>
     31 
     32 #define TRI_PORT_RAM_XP_OFFSET	0x00000
     33 
     34 #define XP_SHM_BASE	(TRI_PORT_RAM + TRI_PORT_RAM_XP_OFFSET)
     35 #define XP_SHM_SIZE	0x00010000	/* 64KB for XP; rest 64KB for lance */
     36 #define XP_TAS_ADDR	OBIO_TAS
     37 
     38 #define XP_CPU_FREQ	6144000
     39 
     40 struct xpbus_attach_args {
     41 	const char *xa_name;
     42 };
     43 
     44 /* xpbus sharing control */
     45 #define XP_ACQ_EXCL	(1 << 31)
     46 u_int xp_acquire(int, u_int);
     47 void xp_release(int);
     48 void xp_set_shm_dirty(void);
     49 void xp_ensure_firmware(void);
     50 
     51 /* PIO control */
     52 uint8_t put_pio0c(uint8_t, uint8_t);
     53 
     54 /* XP reset control */
     55 void xp_cpu_reset_hold(void);
     56 void xp_cpu_reset_release(void);
     57 void xp_cpu_reset(void);
     58 
     59 /* XP interrupt control */
     60 void xp_intr1_enable(void);
     61 void xp_intr1_disable(void);
     62 void xp_intr1_acknowledge(void);
     63 
     64 void xp_intr5_enable(void);
     65 void xp_intr5_disable(void);
     66 void xp_intr5_acknowledge(void);
     67 
     68 /* XP SHM control */
     69 void *xp_shmptr(int);
     70 int  xp_readmem8(int);
     71 int  xp_readmem16le(int);
     72 void xp_writemem8(int, int);
     73 void xp_writemem16le(int, int);
     74 
     75 #endif /* !_XPBUSVAR_H_ */
     76