add rk2906 feature
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / io.c
1 /* arch/arm/mach-rk29/io.c
2  *
3  * Copyright (C) 2010 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 <mach/rk29_iomap.h>
22 #include <asm/mach/map.h>
23 #include <mach/board.h>
24
25 #define RK29_DEVICE(name) { \
26                 .virtual = (unsigned long) RK29_##name##_BASE, \
27                 .pfn = __phys_to_pfn(RK29_##name##_PHYS), \
28                 .length = RK29_##name##_SIZE, \
29                 .type = MT_DEVICE_NONSHARED, \
30          }
31
32 static struct map_desc rk29_io_desc[] __initdata = {
33         RK29_DEVICE(GICCPU),
34         RK29_DEVICE(GICPERI),
35         RK29_DEVICE(TIMER0),
36         RK29_DEVICE(TIMER1),
37         RK29_DEVICE(TIMER2),
38         RK29_DEVICE(TIMER3),
39         RK29_DEVICE(DDRC),
40         RK29_DEVICE(UART1),
41         RK29_DEVICE(PWM),
42         RK29_DEVICE(GRF),
43         RK29_DEVICE(CRU),
44         RK29_DEVICE(PMU),
45         RK29_DEVICE(GPIO0),
46         RK29_DEVICE(GPIO1),
47         RK29_DEVICE(GPIO2),
48         RK29_DEVICE(GPIO3),
49         RK29_DEVICE(GPIO4),
50         RK29_DEVICE(GPIO5),
51         RK29_DEVICE(GPIO6),
52         RK29_DEVICE(NANDC),
53         RK29_DEVICE(SPI0),
54         RK29_DEVICE(SPI1),
55         RK29_DEVICE(I2C0),
56         RK29_DEVICE(I2C1),
57         RK29_DEVICE(I2C2),
58         RK29_DEVICE(I2C3),
59         RK29_DEVICE(LCDC),
60 #ifdef CONFIG_DDR_RECONFIG
61         RK29_DEVICE(GPU),
62         RK29_DEVICE(VCODEC),
63         RK29_DEVICE(VIP),
64         RK29_DEVICE(IPP),
65         RK29_DEVICE(DMAC0),
66         RK29_DEVICE(DMAC1),
67         RK29_DEVICE(SDMAC0),
68 #endif
69 };
70
71 extern void rk29_boot_mode_init_by_register(void);
72 void __init rk29_map_common_io(void)
73 {
74         iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));
75         rk29_boot_mode_init_by_register();
76 }