18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 38c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 48c2ecf20Sopenharmony_ci * for more details. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * xtalk.h -- platform-independent crosstalk interface, derived from 78c2ecf20Sopenharmony_ci * IRIX <sys/PCI/bridge.h>, revision 1.38. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc. 108c2ecf20Sopenharmony_ci * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci#ifndef _ASM_XTALK_XTALK_H 138c2ecf20Sopenharmony_ci#define _ASM_XTALK_XTALK_H 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 168c2ecf20Sopenharmony_ci/* 178c2ecf20Sopenharmony_ci * User-level device driver visible types 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_citypedef char xwidgetnum_t; /* xtalk widget number (0..15) */ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define XWIDGET_NONE -1 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_citypedef int xwidget_part_num_t; /* xtalk widget part number */ 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#define XWIDGET_PART_NUM_NONE -1 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_citypedef int xwidget_rev_num_t; /* xtalk widget revision number */ 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define XWIDGET_REV_NUM_NONE -1 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_citypedef int xwidget_mfg_num_t; /* xtalk widget manufacturing ID */ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define XWIDGET_MFG_NUM_NONE -1 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_citypedef struct xtalk_piomap_s *xtalk_piomap_t; 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* It is often convenient to fold the XIO target port 388c2ecf20Sopenharmony_ci * number into the XIO address. 398c2ecf20Sopenharmony_ci */ 408c2ecf20Sopenharmony_ci#define XIO_NOWHERE (0xFFFFFFFFFFFFFFFFull) 418c2ecf20Sopenharmony_ci#define XIO_ADDR_BITS (0x0000FFFFFFFFFFFFull) 428c2ecf20Sopenharmony_ci#define XIO_PORT_BITS (0xF000000000000000ull) 438c2ecf20Sopenharmony_ci#define XIO_PORT_SHIFT (60) 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define XIO_PACKED(x) (((x)&XIO_PORT_BITS) != 0) 468c2ecf20Sopenharmony_ci#define XIO_ADDR(x) ((x)&XIO_ADDR_BITS) 478c2ecf20Sopenharmony_ci#define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT)) 488c2ecf20Sopenharmony_ci#define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS)) 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci#endif /* _ASM_XTALK_XTALK_H */ 53