fdt.h revision 226501
1130803Smarcel/*-
2130803Smarcel * Copyright (c) 2010 The FreeBSD Foundation
3130803Smarcel * All rights reserved.
4130803Smarcel *
5130803Smarcel * This software was developed by Semihalf under sponsorship from
6130803Smarcel * the FreeBSD Foundation.
7130803Smarcel *
8130803Smarcel * Redistribution and use in source and binary forms, with or without
9130803Smarcel * modification, are permitted provided that the following conditions
10130803Smarcel * are met:
11130803Smarcel * 1. Redistributions of source code must retain the above copyright
12130803Smarcel *    notice, this list of conditions and the following disclaimer.
13130803Smarcel * 2. Redistributions in binary form must reproduce the above copyright
14130803Smarcel *    notice, this list of conditions and the following disclaimer in the
15130803Smarcel *    documentation and/or other materials provided with the distribution.
16130803Smarcel *
17130803Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18130803Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19130803Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20130803Smarcel * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21130803Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22130803Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23130803Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24130803Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/mips/include/fdt.h 226501 2011-10-18 08:10:23Z jchandra $
30 */
31
32#ifndef _MACHINE_FDT_H_
33#define _MACHINE_FDT_H_
34
35#include <machine/bus.h>
36#include <machine/intr_machdep.h>
37
38/* Max interrupt number */
39#if defined(CPU_RMI) || defined(CPU_NLM)
40#define FDT_INTR_MAX	XLR_MAX_INTR
41#else
42#define FDT_INTR_MAX	(NHARD_IRQS + NSOFT_IRQS)
43#endif
44
45/* Map phandle/intpin pair to global IRQ number */
46#define	FDT_MAP_IRQ(node, pin)	(pin)
47
48/*
49 * Bus space tag. XXX endianess info needs to be derived from the blob.
50 */
51#if defined(CPU_RMI) || defined(CPU_NLM)
52#define fdtbus_bs_tag	rmi_uart_bus_space
53#else
54#define fdtbus_bs_tag	NULL
55#endif
56
57#endif /* _MACHINE_FDT_H_ */
58