ARM64: DTS: Add rk3399-firefly uart4 device, node as /dev/ttyS1
[firefly-linux-kernel-4.4.55.git] / io.c
1 /* arch/arm/mach-rk30/io.c
2  *
3  * Copyright (C) 2011 ROCKCHIP, Inc.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15  
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/io.h>
19
20 #include <asm/page.h>
21 #include <asm/mach/map.h>
22
23 #define RK30_DEVICE(name) { \
24                 .virtual = (unsigned long) RK30_##name##_BASE, \
25                 .pfn = __phys_to_pfn(RK30_##name##_PHYS), \
26                 .length = RK30_##name##_SIZE, \
27                 .type = MT_DEVICE, \
28          }
29
30 static struct map_desc rk30_io_desc[] __initdata = {
31         RK30_DEVICE(ROM),
32         RK30_DEVICE(CORE),
33         RK30_DEVICE(CPU_AXI_BUS),
34 #if CONFIG_RK_DEBUG_UART == 0
35         RK30_DEVICE(UART0),
36 #elif CONFIG_RK_DEBUG_UART == 1
37         RK30_DEVICE(UART1),
38 #elif CONFIG_RK_DEBUG_UART == 2
39         RK30_DEVICE(UART2),
40 #elif CONFIG_RK_DEBUG_UART == 3
41         RK30_DEVICE(UART3),
42 #endif
43         RK30_DEVICE(GRF),
44         RK30_DEVICE(CRU),
45         RK30_DEVICE(PMU),
46         RK30_DEVICE(GPIO0),
47         RK30_DEVICE(GPIO1),
48         RK30_DEVICE(GPIO2),
49         RK30_DEVICE(GPIO3),
50 #if !defined(CONFIG_ARCH_RK3066B)
51         RK30_DEVICE(GPIO4),
52         RK30_DEVICE(GPIO6),
53 #endif
54         RK30_DEVICE(TIMER0),
55         RK30_DEVICE(TIMER1),
56         RK30_DEVICE(TIMER2),
57         RK30_DEVICE(PWM01),
58         RK30_DEVICE(PWM23),
59         RK30_DEVICE(DDR_PCTL),
60         RK30_DEVICE(DDR_PUBL),
61         RK30_DEVICE(I2C1),
62 };
63
64 void __init rk30_map_common_io(void)
65 {
66         iotable_init(rk30_io_desc, ARRAY_SIZE(rk30_io_desc));
67 }