blob: 2fdc9bf2fb5e812c177e14d805fc71562a060065 [file] [log] [blame]
Shawn Guobac89d72011-10-02 15:09:11 +08001/*
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 Guo50f2de62012-09-14 14:14:45 +080017
18#include "hardware.h"
Shawn Guobac89d72011-10-02 15:09:11 +080019
Shawn Guo49c9e602012-10-08 13:44:29 +080020#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 Guobac89d72011-10-02 15:09:11 +080034static struct map_desc imx_lluart_desc = {
Shawn Guo49c9e602012-10-08 13:44:29 +080035#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 Guobac89d72011-10-02 15:09:11 +080039 .type = MT_DEVICE,
40#endif
41};
42
43void __init imx_lluart_map_io(void)
44{
45 if (imx_lluart_desc.virtual)
46 iotable_init(&imx_lluart_desc, 1);
47}