rk3026: i2s add several attempts to double confirm i2s frac effect
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk3188 / io.c
1 /*
2  *
3  * Copyright (C) 2013 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 #include <asm/page.h>
20 #include <asm/mach/map.h>
21 #include <mach/debug_uart.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         {
32                 .virtual = (unsigned long) RK30_ROM_BASE,
33                 .pfn = __phys_to_pfn(RK3188_ROM_PHYS),
34                 .length = RK30_ROM_SIZE,
35                 .type = MT_DEVICE,
36         },
37         RK30_DEVICE(CORE),
38         RK30_DEVICE(CPU_AXI_BUS),
39 #if CONFIG_RK_DEBUG_UART == 0
40         RK30_DEVICE(UART0),
41 #elif CONFIG_RK_DEBUG_UART == 1
42         RK30_DEVICE(UART1),
43 #elif CONFIG_RK_DEBUG_UART == 2
44         RK30_DEVICE(UART2),
45 #elif CONFIG_RK_DEBUG_UART == 3
46         RK30_DEVICE(UART3),
47 #endif
48         RK30_DEVICE(GRF),
49         RK30_DEVICE(CRU),
50         RK30_DEVICE(PMU),
51         RK30_DEVICE(GPIO0),
52         RK30_DEVICE(GPIO1),
53         RK30_DEVICE(GPIO2),
54         RK30_DEVICE(GPIO3),
55         RK30_DEVICE(TIMER0),
56         RK30_DEVICE(EFUSE),
57         {
58                 .virtual = (unsigned long) RK3188_TIMER3_BASE,
59                 .pfn = __phys_to_pfn(RK3188_TIMER3_PHYS),
60                 .length = RK3188_TIMER3_SIZE,
61                 .type = MT_DEVICE,
62         },
63         RK30_DEVICE(PWM01),
64         RK30_DEVICE(PWM23),
65         RK30_DEVICE(DDR_PCTL),
66         RK30_DEVICE(DDR_PUBL),
67         RK30_DEVICE(I2C1),
68 };
69
70 void __init rk30_map_common_io(void)
71 {
72         iotable_init(rk30_io_desc, ARRAY_SIZE(rk30_io_desc));
73 }