1 /* linux/arch/arm/mach-rk2818/board-midsdk.c
3 * Copyright (C) 2010 ROCKCHIP, Inc.
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.
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.
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/input.h>
21 #include <linux/delay.h>
23 #include <mach/hardware.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
26 #include <asm/mach/map.h>
27 #include <asm/mach/flash.h>
29 #include <mach/irqs.h>
30 #include <mach/board.h>
31 #include <mach/rk2818_iomap.h>
32 #include <mach/iomux.h>
33 #include <mach/gpio.h>
35 #include <linux/mtd/nand.h>
36 #include <linux/mtd/partitions.h>
41 /* --------------------------------------------------------------------
42 * ÉùÃ÷ÁËrk2818_gpioBankÊý×飬²¢¶¨ÒåÁËGPIO¼Ä´æÆ÷×éIDºÍ¼Ä´æÆ÷»ùµØÖ·¡£
43 * -------------------------------------------------------------------- */
45 static struct rk2818_gpio_bank rk2818_gpioBank[] = {
48 .offset = RK2818_GPIO0_BASE,
53 .offset = RK2818_GPIO0_BASE,
58 .offset = RK2818_GPIO0_BASE,
63 .offset = RK2818_GPIO0_BASE,
68 .offset = RK2818_GPIO1_BASE,
73 .offset = RK2818_GPIO1_BASE,
78 .offset = RK2818_GPIO1_BASE,
83 .offset = RK2818_GPIO1_BASE,
88 //IOÓ³É䷽ʽÃèÊö £¬Ã¿¸öΪһ¶ÎÏßÐÔÁ¬ÐøÓ³Éä
89 static struct map_desc rk2818_io_desc[] __initdata = {
92 .virtual = RK2818_MCDMA_BASE, //ÐéÄâµØÖ·
93 .pfn = __phys_to_pfn(RK2818_MCDMA_PHYS), //ÎïÀíµØÖ·£¬ÐëÓëÒ³±í¶ÔÆë
94 .length = RK2818_MCDMA_SIZE, //³¤¶È
95 .type = MT_DEVICE //Ó³É䷽ʽ
99 .virtual = RK2818_DWDMA_BASE,
100 .pfn = __phys_to_pfn(RK2818_DWDMA_PHYS),
101 .length = RK2818_DWDMA_SIZE,
106 .virtual = RK2818_INTC_BASE,
107 .pfn = __phys_to_pfn(RK2818_INTC_PHYS),
108 .length = RK2818_INTC_SIZE,
113 .virtual = RK2818_ARMDARBITER_BASE,
114 .pfn = __phys_to_pfn(RK2818_ARMDARBITER_PHYS),
115 .length = RK2818_ARMDARBITER_SIZE,
120 .virtual = RK2818_APB_BASE,
121 .pfn = __phys_to_pfn(RK2818_APB_PHYS),
127 .virtual = RK2818_WDT_BASE,
128 .pfn = __phys_to_pfn(RK2818_WDT_PHYS),
129 .length = 0xa0000, ///apb bus i2s i2c spi no map in this
134 .virtual = 0xff400000, /* for itcm , vir = phy , for reboot */
135 .pfn = __phys_to_pfn(0xff400000),
142 static struct platform_device *devices[] __initdata = {
143 &rk2818_device_uart1,
146 extern struct sys_timer rk2818_timer;
148 static void __init machine_rk2818_init_irq(void)
151 rk2818_gpio_init(rk2818_gpioBank, 8);
152 rk2818_gpio_irq_setup();
155 static void __init machine_rk2818_board_init(void)
157 platform_add_devices(devices, ARRAY_SIZE(devices));
161 static void __init machine_rk2818_mapio(void)
163 iotable_init(rk2818_io_desc, ARRAY_SIZE(rk2818_io_desc));
168 MACHINE_START(RK2818, "rk2818midsdk")
170 /* UART for LL DEBUG */
171 .phys_io = 0x18002000,
172 .io_pg_offst = ((0xFF100000) >> 18) & 0xfffc,
173 .boot_params = RK2818_SDRAM_PHYS + 0x100,
174 .map_io = machine_rk2818_mapio,
175 .init_irq = machine_rk2818_init_irq,
176 .init_machine = machine_rk2818_board_init,
177 .timer = &rk2818_timer,