xref: /freebsd/sys/powerpc/include/ofw_machdep.h (revision fdafd315)
1b98807d4SBenno Rice /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
371e3c308SPedro F. Giffuni  *
4b98807d4SBenno Rice  * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
5b98807d4SBenno Rice  * All rights reserved.
6b98807d4SBenno Rice  *
7b98807d4SBenno Rice  * Redistribution and use in source and binary forms, with or without
8b98807d4SBenno Rice  * modification, are permitted provided that the following conditions
9b98807d4SBenno Rice  * are met:
10b98807d4SBenno Rice  * 1. Redistributions of source code must retain the above copyright
11b98807d4SBenno Rice  *    notice, this list of conditions and the following disclaimer.
12b98807d4SBenno Rice  * 2. Redistributions in binary form must reproduce the above copyright
13b98807d4SBenno Rice  *    notice, this list of conditions and the following disclaimer in the
14b98807d4SBenno Rice  *    documentation and/or other materials provided with the distribution.
15b98807d4SBenno Rice  *
16b98807d4SBenno Rice  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17b98807d4SBenno Rice  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18b98807d4SBenno Rice  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19b98807d4SBenno Rice  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20b98807d4SBenno Rice  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21b98807d4SBenno Rice  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22b98807d4SBenno Rice  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23b98807d4SBenno Rice  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24b98807d4SBenno Rice  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25b98807d4SBenno Rice  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26b98807d4SBenno Rice  */
27b98807d4SBenno Rice 
28b98807d4SBenno Rice #ifndef _MACHINE_OFW_MACHDEP_H_
29b98807d4SBenno Rice #define _MACHINE_OFW_MACHDEP_H_
30b98807d4SBenno Rice 
3191416fb2SNathan Whitehorn #include <sys/types.h>
3291416fb2SNathan Whitehorn #include <sys/rman.h>
33b98807d4SBenno Rice #include <sys/bus.h>
3491416fb2SNathan Whitehorn #include <dev/ofw/openfirm.h>
35b40ce02aSNathan Whitehorn #include <machine/platform.h>
3691416fb2SNathan Whitehorn 
37490ebb8fSJustin Hibbits struct mem_region;
38490ebb8fSJustin Hibbits struct numa_mem_region;
39490ebb8fSJustin Hibbits 
4091416fb2SNathan Whitehorn typedef	uint32_t	cell_t;
41b98807d4SBenno Rice 
42b98807d4SBenno Rice void OF_getetheraddr(device_t dev, u_char *addr);
43b98807d4SBenno Rice 
4491416fb2SNathan Whitehorn void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *));
4591416fb2SNathan Whitehorn boolean_t OF_bootstrap(void);
4691416fb2SNathan Whitehorn 
47b40ce02aSNathan Whitehorn void OF_reboot(void);
48b40ce02aSNathan Whitehorn 
49c1cb22d7SNathan Whitehorn void ofw_mem_regions(struct mem_region *, int *, struct mem_region *, int *);
5049d9a597SJustin Hibbits void ofw_numa_mem_regions(struct numa_mem_region *, int *);
519f706727SNathan Whitehorn void ofw_quiesce(void); /* Must be called before VM is up! */
52f367ffdeSAndreas Tobler void ofw_save_trap_vec(char *);
5349d9a597SJustin Hibbits int ofw_pcibus_get_domain(device_t dev, device_t child, int *domain);
5449d9a597SJustin Hibbits int ofw_pcibus_get_cpus(device_t dev, device_t child, enum cpu_sets op,
5549d9a597SJustin Hibbits 		size_t setsize, cpuset_t *cpuset);
56b40ce02aSNathan Whitehorn 
57b98807d4SBenno Rice #endif /* _MACHINE_OFW_MACHDEP_H_ */
58