xref: /freebsd-src/sys/powerpc/include/platform.h (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
1b40ce02aSNathan Whitehorn /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
351369649SPedro F. Giffuni  *
4b40ce02aSNathan Whitehorn  * Copyright (C) 1996 Wolfgang Solfrank.
5b40ce02aSNathan Whitehorn  * Copyright (C) 1996 TooLs GmbH.
6b40ce02aSNathan Whitehorn  * All rights reserved.
7b40ce02aSNathan Whitehorn  *
8b40ce02aSNathan Whitehorn  * Redistribution and use in source and binary forms, with or without
9b40ce02aSNathan Whitehorn  * modification, are permitted provided that the following conditions
10b40ce02aSNathan Whitehorn  * are met:
11b40ce02aSNathan Whitehorn  * 1. Redistributions of source code must retain the above copyright
12b40ce02aSNathan Whitehorn  *    notice, this list of conditions and the following disclaimer.
13b40ce02aSNathan Whitehorn  * 2. Redistributions in binary form must reproduce the above copyright
14b40ce02aSNathan Whitehorn  *    notice, this list of conditions and the following disclaimer in the
15b40ce02aSNathan Whitehorn  *    documentation and/or other materials provided with the distribution.
16b40ce02aSNathan Whitehorn  * 3. All advertising materials mentioning features or use of this software
17b40ce02aSNathan Whitehorn  *    must display the following acknowledgement:
18b40ce02aSNathan Whitehorn  *	This product includes software developed by TooLs GmbH.
19b40ce02aSNathan Whitehorn  * 4. The name of TooLs GmbH may not be used to endorse or promote products
20b40ce02aSNathan Whitehorn  *    derived from this software without specific prior written permission.
21b40ce02aSNathan Whitehorn  *
22b40ce02aSNathan Whitehorn  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23b40ce02aSNathan Whitehorn  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24b40ce02aSNathan Whitehorn  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25b40ce02aSNathan Whitehorn  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26b40ce02aSNathan Whitehorn  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27b40ce02aSNathan Whitehorn  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28b40ce02aSNathan Whitehorn  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29b40ce02aSNathan Whitehorn  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30b40ce02aSNathan Whitehorn  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31b40ce02aSNathan Whitehorn  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32b40ce02aSNathan Whitehorn  *
33b40ce02aSNathan Whitehorn  *	$NetBSD: powerpc.h,v 1.3 2000/06/01 00:49:59 matt Exp $
34b40ce02aSNathan Whitehorn  */
35b40ce02aSNathan Whitehorn 
36b40ce02aSNathan Whitehorn #ifndef	_MACHINE_PLATFORM_H_
37b40ce02aSNathan Whitehorn #define	_MACHINE_PLATFORM_H_
38b40ce02aSNathan Whitehorn 
39*490ebb8fSJustin Hibbits #include <machine/ofw_machdep.h>
40b40ce02aSNathan Whitehorn #include <machine/smp.h>
41b40ce02aSNathan Whitehorn #include <machine/pcpu.h>
42b40ce02aSNathan Whitehorn 
43b40ce02aSNathan Whitehorn struct mem_region {
44b3936ebeSJustin Hibbits 	uint64_t	mr_start;
45b3936ebeSJustin Hibbits 	uint64_t	mr_size;
46b40ce02aSNathan Whitehorn };
47b40ce02aSNathan Whitehorn 
4849d9a597SJustin Hibbits struct numa_mem_region {
4949d9a597SJustin Hibbits 	uint64_t	mr_start;
5049d9a597SJustin Hibbits 	uint64_t	mr_size;
5149d9a597SJustin Hibbits 	uint64_t	mr_domain;
5249d9a597SJustin Hibbits };
5349d9a597SJustin Hibbits 
54de2dd83fSNathan Whitehorn /* Documentation for these functions is in platform_if.m */
55de2dd83fSNathan Whitehorn 
56b40ce02aSNathan Whitehorn void	mem_regions(struct mem_region **, int *, struct mem_region **, int *);
5749d9a597SJustin Hibbits void	numa_mem_regions(struct numa_mem_region **, int *);
586413b057SNathan Whitehorn vm_offset_t platform_real_maxaddr(void);
59b40ce02aSNathan Whitehorn 
60b40ce02aSNathan Whitehorn u_long	platform_timebase_freq(struct cpuref *);
61b40ce02aSNathan Whitehorn 
62b40ce02aSNathan Whitehorn int	platform_smp_first_cpu(struct cpuref *);
63b40ce02aSNathan Whitehorn int	platform_smp_next_cpu(struct cpuref *);
64b40ce02aSNathan Whitehorn int	platform_smp_get_bsp(struct cpuref *);
65b40ce02aSNathan Whitehorn int	platform_smp_start_cpu(struct pcpu *);
66de2dd83fSNathan Whitehorn void	platform_smp_timebase_sync(u_long tb, int ap);
670658fe8cSNathan Whitehorn void	platform_smp_ap_init(void);
68bba9cbe3SConrad Meyer void	platform_smp_probe_threads(void);
69*490ebb8fSJustin Hibbits int	platform_node_numa_domain(phandle_t);
70b40ce02aSNathan Whitehorn 
71b40ce02aSNathan Whitehorn const char *installed_platform(void);
72b40ce02aSNathan Whitehorn void platform_probe_and_attach(void);
73e1c161e7SJustin Hibbits 
74e1c161e7SJustin Hibbits void platform_sleep(void);
75b40ce02aSNathan Whitehorn 
76b40ce02aSNathan Whitehorn #endif	/* _MACHINE_PLATFORM_H_ */
77