Shawn Guo | bac89d7 | 2011-10-02 15:09:11 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. |
| 3 | * Copyright 2011 Linaro Ltd. |
| 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
| 13 | #include <linux/init.h> |
| 14 | #include <asm/page.h> |
| 15 | #include <asm/sizes.h> |
| 16 | #include <asm/mach/map.h> |
Shawn Guo | 50f2de6 | 2012-09-14 14:14:45 +0800 | [diff] [blame] | 17 | |
| 18 | #include "hardware.h" |
Shawn Guo | bac89d7 | 2011-10-02 15:09:11 +0800 | [diff] [blame] | 19 | |
Shawn Guo | 49c9e60 | 2012-10-08 13:44:29 +0800 | [diff] [blame^] | 20 | #define IMX6Q_UART1_BASE_ADDR 0x02020000 |
| 21 | #define IMX6Q_UART2_BASE_ADDR 0x021e8000 |
| 22 | #define IMX6Q_UART3_BASE_ADDR 0x021ec000 |
| 23 | #define IMX6Q_UART4_BASE_ADDR 0x021f0000 |
| 24 | #define IMX6Q_UART5_BASE_ADDR 0x021f4000 |
| 25 | |
| 26 | /* |
| 27 | * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion |
| 28 | * of IMX6Q_UART##n##_BASE_ADDR. |
| 29 | */ |
| 30 | #define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR |
| 31 | #define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n) |
| 32 | #define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT) |
| 33 | |
Shawn Guo | bac89d7 | 2011-10-02 15:09:11 +0800 | [diff] [blame] | 34 | static struct map_desc imx_lluart_desc = { |
Shawn Guo | 49c9e60 | 2012-10-08 13:44:29 +0800 | [diff] [blame^] | 35 | #ifdef CONFIG_DEBUG_IMX6Q_UART |
| 36 | .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE), |
| 37 | .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE), |
| 38 | .length = 0x4000, |
Shawn Guo | bac89d7 | 2011-10-02 15:09:11 +0800 | [diff] [blame] | 39 | .type = MT_DEVICE, |
| 40 | #endif |
| 41 | }; |
| 42 | |
| 43 | void __init imx_lluart_map_io(void) |
| 44 | { |
| 45 | if (imx_lluart_desc.virtual) |
| 46 | iotable_init(&imx_lluart_desc, 1); |
| 47 | } |