xref: /netbsd-src/sys/arch/arm/broadcom/bcm283x_platform.h (revision eb468e55d0480890cad5431591b7a2042f4c5612)
1*eb468e55Sskrll /*	$NetBSD: bcm283x_platform.h,v 1.5 2019/12/30 16:19:27 skrll Exp $	*/
2fe33aa27Sryo 
3fe33aa27Sryo /*-
4fe33aa27Sryo  * Copyright (c) 2012 The NetBSD Foundation, Inc.
5fe33aa27Sryo  * All rights reserved.
6fe33aa27Sryo  *
7fe33aa27Sryo  * This code is derived from software contributed to The NetBSD Foundation
8fe33aa27Sryo  * by Nick Hudson
9fe33aa27Sryo  *
10fe33aa27Sryo  * Redistribution and use in source and binary forms, with or without
11fe33aa27Sryo  * modification, are permitted provided that the following conditions
12fe33aa27Sryo  * are met:
13fe33aa27Sryo  * 1. Redistributions of source code must retain the above copyright
14fe33aa27Sryo  *    notice, this list of conditions and the following disclaimer.
15fe33aa27Sryo  * 2. Redistributions in binary form must reproduce the above copyright
16fe33aa27Sryo  *    notice, this list of conditions and the following disclaimer in the
17fe33aa27Sryo  *    documentation and/or other materials provided with the distribution.
18fe33aa27Sryo  *
19fe33aa27Sryo  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20fe33aa27Sryo  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21fe33aa27Sryo  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22fe33aa27Sryo  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23fe33aa27Sryo  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24fe33aa27Sryo  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25fe33aa27Sryo  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26fe33aa27Sryo  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27fe33aa27Sryo  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28fe33aa27Sryo  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29fe33aa27Sryo  * POSSIBILITY OF SUCH DAMAGE.
30fe33aa27Sryo  */
31fe33aa27Sryo 
32fe33aa27Sryo #ifndef	_ARM_BCM2835REG_PLATFORM_H_
33fe33aa27Sryo #define	_ARM_BCM2835REG_PLATFORM_H_
34fe33aa27Sryo 
35fe33aa27Sryo #include <arch/evbarm/fdt/platform.h>
36fe33aa27Sryo 
37fe33aa27Sryo #define	BCM2835_IOPHYSTOVIRT(a) \
38fe33aa27Sryo 	((KERNEL_IO_VBASE | (((a) & 0xf0000000) >> 4)) + ((a) & ~0xff000000))
39fe33aa27Sryo 
408b228a41Sskrll #define BCM2711_IOPHYSTOVIRT(a) \
413d1277ecSskrll 	((KERNEL_IO_VBASE | (a)))
423d1277ecSskrll 
43fe33aa27Sryo #define	BCM2835_PERIPHERALS_VBASE \
44fe33aa27Sryo 	BCM2835_IOPHYSTOVIRT(BCM2835_PERIPHERALS_BASE)
45fe33aa27Sryo 
46fe33aa27Sryo #define	BCM2836_PERIPHERALS_VBASE \
47fe33aa27Sryo 	BCM2835_IOPHYSTOVIRT(BCM2836_PERIPHERALS_BASE)
48fe33aa27Sryo 
498b228a41Sskrll #define	BCM2711_PERIPHERALS_VBASE \
508b228a41Sskrll 	BCM2711_IOPHYSTOVIRT(BCM2711_PERIPHERALS_BASE)
513d1277ecSskrll 
52fe33aa27Sryo #define	BCM2836_ARM_LOCAL_VBASE \
53fe33aa27Sryo 	BCM2835_IOPHYSTOVIRT(BCM2836_ARM_LOCAL_BASE)
54fe33aa27Sryo 
5566d31a2dSryo #define	BCM2836_ARM_SMP_VBASE	\
5666d31a2dSryo 	BCM2835_IOPHYSTOVIRT(BCM2836_ARM_SMP_BASE)
5766d31a2dSryo 
588b228a41Sskrll #define	BCM2711_ARM_LOCAL_VBASE \
598b228a41Sskrll 	BCM2711_IOPHYSTOVIRT(BCM2711_ARM_LOCAL_BASE)
603d1277ecSskrll 
61*eb468e55Sskrll #define	BCM2711_ARM_SMP_VBASE	\
62*eb468e55Sskrll 	BCM2711_IOPHYSTOVIRT(BCM2836_ARM_SMP_BASE)
63*eb468e55Sskrll 
64fe33aa27Sryo #endif /* _ARM_BCM2835REG_PLATFORM_H_ */
65