xref: /openbmc/linux/arch/arm/include/debug/ux500.S (revision 428b504e)
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)
239bed3e05SLinus Walleij#define __UX500_PHYS_UART(n)	U8500_UART##n##_PHYS_BASE
24f87b95ddSLinus Walleij#endif
25f87b95ddSLinus Walleij
26428b504eSLinus Walleij#if !defined(__UX500_PHYS_UART)
27f87b95ddSLinus Walleij#error Unknown SOC
28f87b95ddSLinus Walleij#endif
29f87b95ddSLinus Walleij
309bed3e05SLinus Walleij#define UX500_PHYS_UART(n)	__UX500_PHYS_UART(n)
319bed3e05SLinus Walleij#define UART_PHYS_BASE	UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART)
32428b504eSLinus Walleij#define UART_VIRT_BASE	(0xfff07000)
33f87b95ddSLinus Walleij
34f87b95ddSLinus Walleij	.macro	addruart, rp, rv, tmp
359bed3e05SLinus Walleij	ldr	\rp, =UART_PHYS_BASE		@ no, physical address
369bed3e05SLinus Walleij	ldr	\rv, =UART_VIRT_BASE		@ yes, virtual address
37f87b95ddSLinus Walleij	.endm
38f87b95ddSLinus Walleij
394e218b99SRussell King#include <debug/pl01x.S>
40