fdt.h revision 236992
1209130Sraj/*- 2209130Sraj * Copyright (c) 2010 The FreeBSD Foundation 3209130Sraj * All rights reserved. 4209130Sraj * 5209130Sraj * This software was developed by Semihalf under sponsorship from 6209130Sraj * the FreeBSD Foundation. 7209130Sraj * 8209130Sraj * Redistribution and use in source and binary forms, with or without 9209130Sraj * modification, are permitted provided that the following conditions 10209130Sraj * are met: 11209130Sraj * 1. Redistributions of source code must retain the above copyright 12209130Sraj * notice, this list of conditions and the following disclaimer. 13209130Sraj * 2. Redistributions in binary form must reproduce the above copyright 14209130Sraj * notice, this list of conditions and the following disclaimer in the 15209130Sraj * documentation and/or other materials provided with the distribution. 16209130Sraj * 17209130Sraj * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18209130Sraj * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19209130Sraj * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20209130Sraj * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21209130Sraj * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22209130Sraj * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23209130Sraj * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24209130Sraj * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25209130Sraj * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26209130Sraj * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27209130Sraj * SUCH DAMAGE. 28209130Sraj * 29209130Sraj * $FreeBSD: head/sys/arm/include/fdt.h 236992 2012-06-13 05:02:51Z imp $ 30209130Sraj */ 31209130Sraj 32209130Sraj#ifndef _MACHINE_FDT_H_ 33209130Sraj#define _MACHINE_FDT_H_ 34209130Sraj 35209130Sraj#include <dev/ofw/openfirm.h> 36209130Sraj 37209130Sraj#include <vm/vm.h> 38209130Sraj#include <vm/pmap.h> 39209130Sraj 40210247Sraj#include <machine/bus.h> 41209130Sraj#include <machine/pmap.h> 42209130Sraj#include <machine/intr.h> 43209130Sraj 44209130Sraj/* Max interrupt number */ 45209130Sraj#define FDT_INTR_MAX NIRQ 46209130Sraj 47236992Simp/* Map phandle/intpin pair to global IRQ number */ 48218073Smarcel#define FDT_MAP_IRQ(node, pin) (pin) 49218073Smarcel 50209130Sraj/* 51209130Sraj * Bus space tag. XXX endianess info needs to be derived from the blob. 52209130Sraj */ 53209130Srajextern bus_space_tag_t fdtbus_bs_tag; 54209130Sraj 55209130Srajstruct mem_region { 56209130Sraj vm_offset_t mr_start; 57209130Sraj vm_size_t mr_size; 58209130Sraj}; 59209130Sraj 60235609Sgberint fdt_localbus_devmap(phandle_t, struct pmap_devmap *, int, int *); 61209130Srajint fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t, 62209130Sraj vm_offset_t); 63209130Sraj 64209130Sraj#endif /* _MACHINE_FDT_H_ */ 65