1195333Simp/*-
2195333Simp * Copyright (c) 2009 Neelkanth Natu
3195333Simp * All rights reserved.
4195333Simp *
5195333Simp * Redistribution and use in source and binary forms, with or without
6195333Simp * modification, are permitted provided that the following conditions
7195333Simp * are met:
8195333Simp * 1. Redistributions of source code must retain the above copyright
9195333Simp *    notice, this list of conditions and the following disclaimer.
10195333Simp * 2. Redistributions in binary form must reproduce the above copyright
11195333Simp *    notice, this list of conditions and the following disclaimer in the
12195333Simp *    documentation and/or other materials provided with the distribution.
13195333Simp *
14195333Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15195333Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16195333Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17195333Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18195333Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19195333Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20195333Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21195333Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22195333Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23195333Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24195333Simp * SUCH DAMAGE.
25203509Sneel *
26203509Sneel * $FreeBSD: releng/10.3/sys/mips/sibyte/sb_scd.h 205364 2010-03-20 05:49:06Z neel $
27195333Simp */
28195333Simp
29195333Simp#ifndef _SB_SCD_H_
30195333Simp#define	_SB_SCD_H_
31195333Simp
32195333Simp#define	NUM_INTSRC		64	/* total number of interrupt sources */
33195333Simp
34205364Sneeluint64_t	sb_zbbus_cycle_count(void);
35195333Simpuint64_t	sb_cpu_speed(void);
36195333Simpvoid		sb_system_reset(void);
37195333Simp
38195333Simpint		sb_route_intsrc(int src);
39203509Sneelvoid		sb_enable_intsrc(int cpu, int src);
40203509Sneelvoid		sb_disable_intsrc(int cpu, int src);
41203509Sneeluint64_t	sb_read_intsrc_mask(int cpu);
42203509Sneelvoid		sb_write_intsrc_mask(int cpu, uint64_t mask);
43203509Sneelvoid		sb_write_intmap(int cpu, int intsrc, int intrnum);
44203509Sneelint		sb_read_intmap(int cpu, int intsrc);
45195333Simp
46203697Sneel#ifdef SMP
47203697Sneel#define	INTSRC_MAILBOX3		29
48203697Sneelvoid		sb_set_mailbox(int cpuid, uint64_t val);
49203697Sneelvoid		sb_clear_mailbox(int cpuid, uint64_t val);
50203697Sneel#endif
51203697Sneel
52195333Simp#endif	/* _SB_SCD_H_ */
53