234f7415f23e74f982b8c5c08006200d28309cb3
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk29 / board-rk29sdk.c
1 /* arch/arm/mach-rk29/board-rk29.c\r
2  *\r
3  * Copyright (C) 2010 ROCKCHIP, Inc.\r
4  *\r
5  * This software is licensed under the terms of the GNU General Public\r
6  * License version 2, as published by the Free Software Foundation, and\r
7  * may be copied, distributed, and modified under those terms.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  */\r
15 \r
16 #include <linux/kernel.h>\r
17 #include <linux/init.h>\r
18 #include <linux/platform_device.h>\r
19 #include <linux/input.h>\r
20 #include <linux/io.h>\r
21 #include <linux/delay.h>\r
22 #include <linux/i2c.h>\r
23 #include <linux/spi/spi.h>\r
24 #include <linux/mmc/host.h>\r
25 \r
26 #include <mach/hardware.h>\r
27 #include <asm/mach-types.h>\r
28 #include <asm/mach/arch.h>\r
29 #include <asm/mach/map.h>\r
30 #include <asm/mach/flash.h>\r
31 #include <asm/hardware/gic.h>\r
32 \r
33 #include <mach/irqs.h>\r
34 #include <mach/rk29_iomap.h>\r
35 #include <mach/board.h>\r
36 \r
37 \r
38 #include <linux/mtd/nand.h>\r
39 #include <linux/mtd/partitions.h>\r
40 \r
41 #include "devices.h"\r
42 \r
43 extern struct sys_timer rk29_timer;\r
44 \r
45 static struct platform_device *devices[] __initdata = {\r
46 #ifdef CONFIG_UART1_RK29        \r
47         &rk29_device_uart1,\r
48 #endif  \r
49 \r
50 };\r
51 \r
52 static void __init rk29_gic_init_irq(void)\r
53 {\r
54         gic_dist_init(0, (void __iomem *)RK29_GICPERI_BASE, 32);\r
55         gic_cpu_init(0, (void __iomem *)RK29_GICCPU_BASE);\r
56 }\r
57 \r
58 static void __init machine_rk29_init_irq(void)\r
59 {\r
60         rk29_gic_init_irq();\r
61         //rk29_gpio_init(rk29_gpioBank, 8);\r
62         //rk29_gpio_irq_setup();\r
63 }\r
64 static void __init machine_rk29_board_init(void)\r
65\r
66         platform_add_devices(devices, ARRAY_SIZE(devices));     \r
67 }\r
68 \r
69 static void __init machine_rk29_mapio(void)\r
70 {\r
71         rk29_map_common_io();\r
72         //rk29_clock_init();\r
73         //rk29_iomux_init();    \r
74 }\r
75 \r
76 MACHINE_START(RK29, "RK29board")\r
77 \r
78 /* UART for LL DEBUG */\r
79         .phys_io        = RK29_UART1_PHYS, \r
80         .io_pg_offst    = ((RK29_UART1_BASE) >> 18) & 0xfffc,\r
81         .boot_params    = RK29_SDRAM_PHYS + 0x88000,\r
82         .map_io         = machine_rk29_mapio,\r
83         .init_irq       = machine_rk29_init_irq,\r
84         .init_machine   = machine_rk29_board_init,\r
85         .timer          = &rk29_timer,\r
86 MACHINE_END\r