xref: /openbmc/linux/arch/arm/include/debug/ux500.S (revision d2912cb1)
1d2912cb1SThomas Gleixner/* SPDX-License-Identifier: GPL-2.0-only */
2f87b95ddSLinus Walleij/*
3f87b95ddSLinus Walleij * Debugging macro include header
4f87b95ddSLinus Walleij *
5f87b95ddSLinus Walleij *  Copyright (C) 2009 ST-Ericsson
6f87b95ddSLinus Walleij */
79bed3e05SLinus Walleij
8f87b95ddSLinus Walleij
9f87b95ddSLinus Walleij#if CONFIG_UX500_DEBUG_UART > 2
10f87b95ddSLinus Walleij#error Invalid Ux500 debug UART
11f87b95ddSLinus Walleij#endif
12f87b95ddSLinus Walleij
13f87b95ddSLinus Walleij/*
14f87b95ddSLinus Walleij * DEBUG_LL only works if only one SOC is built in.  We don't use #else below
15f87b95ddSLinus Walleij * in order to get "__UX500_UART redefined" warnings if more than one SOC is
16f87b95ddSLinus Walleij * built, so that there's some hint during the build that something is wrong.
17f87b95ddSLinus Walleij */
18f87b95ddSLinus Walleij
19f87b95ddSLinus Walleij#ifdef CONFIG_UX500_SOC_DB8500
209bed3e05SLinus Walleij#define U8500_UART0_PHYS_BASE	(0x80120000)
219bed3e05SLinus Walleij#define U8500_UART1_PHYS_BASE	(0x80121000)
229bed3e05SLinus Walleij#define U8500_UART2_PHYS_BASE	(0x80007000)
23ea63a110SLee Jones#define U8500_UART0_VIRT_BASE	(0xf8120000)
24ea63a110SLee Jones#define U8500_UART1_VIRT_BASE	(0xf8121000)
25ea63a110SLee Jones#define U8500_UART2_VIRT_BASE	(0xf8007000)
269bed3e05SLinus Walleij#define __UX500_PHYS_UART(n)	U8500_UART##n##_PHYS_BASE
279bed3e05SLinus Walleij#define __UX500_VIRT_UART(n)	U8500_UART##n##_VIRT_BASE
28f87b95ddSLinus Walleij#endif
29f87b95ddSLinus Walleij
309bed3e05SLinus Walleij#if !defined(__UX500_PHYS_UART) || !defined(__UX500_VIRT_UART)
31f87b95ddSLinus Walleij#error Unknown SOC
32f87b95ddSLinus Walleij#endif
33f87b95ddSLinus Walleij
349bed3e05SLinus Walleij#define UX500_PHYS_UART(n)	__UX500_PHYS_UART(n)
359bed3e05SLinus Walleij#define UX500_VIRT_UART(n)	__UX500_VIRT_UART(n)
369bed3e05SLinus Walleij#define UART_PHYS_BASE	UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART)
379bed3e05SLinus Walleij#define UART_VIRT_BASE	UX500_VIRT_UART(CONFIG_UX500_DEBUG_UART)
38f87b95ddSLinus Walleij
39f87b95ddSLinus Walleij	.macro	addruart, rp, rv, tmp
409bed3e05SLinus Walleij	ldr	\rp, =UART_PHYS_BASE		@ no, physical address
419bed3e05SLinus Walleij	ldr	\rv, =UART_VIRT_BASE		@ yes, virtual address
42f87b95ddSLinus Walleij	.endm
43f87b95ddSLinus Walleij
444e218b99SRussell King#include <debug/pl01x.S>
45