Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Debugging macro include header |
| 3 | * |
| 4 | * Copyright (C) 2009 ST-Ericsson |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | */ |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 11 | |
Rabin Vincent | 59778fb | 2010-02-12 06:23:07 +0100 | [diff] [blame] | 12 | |
Rabin Vincent | 39a982b | 2010-05-03 07:38:06 +0100 | [diff] [blame] | 13 | #if CONFIG_UX500_DEBUG_UART > 2 |
| 14 | #error Invalid Ux500 debug UART |
| 15 | #endif |
| 16 | |
Rabin Vincent | 92389ca | 2010-12-08 11:07:57 +0530 | [diff] [blame] | 17 | /* |
| 18 | * DEBUG_LL only works if only one SOC is built in. We don't use #else below |
| 19 | * in order to get "__UX500_UART redefined" warnings if more than one SOC is |
| 20 | * built, so that there's some hint during the build that something is wrong. |
| 21 | */ |
| 22 | |
Rabin Vincent | 92389ca | 2010-12-08 11:07:57 +0530 | [diff] [blame] | 23 | #ifdef CONFIG_UX500_SOC_DB8500 |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 24 | #define U8500_UART0_PHYS_BASE (0x80120000) |
| 25 | #define U8500_UART1_PHYS_BASE (0x80121000) |
| 26 | #define U8500_UART2_PHYS_BASE (0x80007000) |
Lee Jones | ea63a11 | 2013-05-08 14:29:05 +0100 | [diff] [blame] | 27 | #define U8500_UART0_VIRT_BASE (0xf8120000) |
| 28 | #define U8500_UART1_VIRT_BASE (0xf8121000) |
| 29 | #define U8500_UART2_VIRT_BASE (0xf8007000) |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 30 | #define __UX500_PHYS_UART(n) U8500_UART##n##_PHYS_BASE |
| 31 | #define __UX500_VIRT_UART(n) U8500_UART##n##_VIRT_BASE |
Rabin Vincent | 92389ca | 2010-12-08 11:07:57 +0530 | [diff] [blame] | 32 | #endif |
| 33 | |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 34 | #if !defined(__UX500_PHYS_UART) || !defined(__UX500_VIRT_UART) |
Rabin Vincent | 92389ca | 2010-12-08 11:07:57 +0530 | [diff] [blame] | 35 | #error Unknown SOC |
| 36 | #endif |
| 37 | |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 38 | #define UX500_PHYS_UART(n) __UX500_PHYS_UART(n) |
| 39 | #define UX500_VIRT_UART(n) __UX500_VIRT_UART(n) |
| 40 | #define UART_PHYS_BASE UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART) |
| 41 | #define UART_VIRT_BASE UX500_VIRT_UART(CONFIG_UX500_DEBUG_UART) |
Rabin Vincent | 39a982b | 2010-05-03 07:38:06 +0100 | [diff] [blame] | 42 | |
Nicolas Pitre | 639da5e | 2011-08-31 22:55:46 -0400 | [diff] [blame] | 43 | .macro addruart, rp, rv, tmp |
Linus Walleij | 9bed3e0 | 2013-04-05 16:07:31 +0200 | [diff] [blame] | 44 | ldr \rp, =UART_PHYS_BASE @ no, physical address |
| 45 | ldr \rv, =UART_VIRT_BASE @ yes, virtual address |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 46 | .endm |
| 47 | |
| 48 | #include <asm/hardware/debug-pl01x.S> |