-obj-y += timer.o
+obj-y += timer.o io.o
obj-$(CONFIG_MACH_RK29SDK) += board-rk29sdk.o
-/* linux/arch/arm/mach-rk29/board-rk29.c\r
+/* arch/arm/mach-rk29/board-rk29.c\r
*\r
* Copyright (C) 2010 ROCKCHIP, Inc.\r
*\r
\r
#include <mach/irqs.h>\r
#include <mach/rk29_iomap.h>\r
-\r
+#include <mach/board.h>\r
\r
\r
#include <linux/mtd/nand.h>\r
\r
extern struct sys_timer rk29_timer;\r
\r
-\r
-//IOÓ³É䷽ʽÃèÊö £¬Ã¿¸öΪһ¶ÎÏßÐÔÁ¬ÐøÓ³Éä\r
-static struct map_desc rk29_io_desc[] __initdata = {\r
- \r
- {\r
- .virtual = RK29_GICCPU_BASE, \r
- .pfn = __phys_to_pfn(RK29_GICCPU_PHYS), \r
- .length = RK29_GICCPU_SIZE, \r
- .type = MT_DEVICE \r
- },\r
- \r
- {\r
- .virtual = RK29_GICPERI_BASE, \r
- .pfn = __phys_to_pfn(RK29_GICPERI_PHYS), \r
- .length = RK29_GICPERI_SIZE, \r
- .type = MT_DEVICE \r
- },\r
- \r
- {\r
- .virtual = RK29_NANDC_BASE, \r
- .pfn = __phys_to_pfn(RK29_NANDC_PHYS), \r
- .length = RK29_NANDC_SIZE, \r
- .type = MT_DEVICE \r
- },\r
-\r
- {\r
- .virtual = RK29_DDRC_BASE,\r
- .pfn = __phys_to_pfn(RK29_DDRC_PHYS),\r
- .length = RK29_DDRC_SIZE,\r
- .type = MT_DEVICE\r
- },\r
- \r
-};\r
-\r
static void __init rk29_gic_init_irq(void)\r
{\r
gic_dist_init(0, RK29_GICPERI_BASE, 32);\r
\r
static void __init machine_rk29_mapio(void)\r
{\r
- iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));\r
+ rk29_map_common_io();\r
//rk29_clock_init();\r
//rk29_iomux_init(); \r
}\r
--- /dev/null
+/* arch/arm/mach-rk29/include/mach/board.h
+ *
+ * Copyright (C) 2010 ROCKCHIP, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef __ASM_ARCH_RK29_BOARD_H
+#define __ASM_ARCH_RK29_BOARD_H
+
+#include <linux/types.h>
+
+void __init rk29_map_common_io(void);
+
+#endif
\ No newline at end of file
#define RK29_TIMER0_BASE (RK29_ADDR_BASE1+0x38000)
#define RK29_TIMER0_PHYS 0x20038000
#define RK29_TIMER0_SIZE SZ_8K
+#define RK29_TIMER1_BASE (RK29_ADDR_BASE1+0x3A000)
#define RK29_TIMER1_PHYS 0x2003A000
-#define RK29_TIMER0_SIZE SZ_8K
+#define RK29_TIMER1_SIZE SZ_8K
#define RK29_GPIO4_PHYS 0x2003C000
#define RK29_GPIO4_SIZE SZ_8K
#define RK29_GPIO6_PHYS 0x2003E000
--- /dev/null
+/* arch/arm/mach-rk29/io.c
+ *
+ * Copyright (C) 2010 ROCKCHIP, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+
+#include <asm/page.h>
+#include <mach/rk29_iomap.h>
+#include <asm/mach/map.h>
+#include <mach/board.h>
+
+#define RK29_DEVICE(name) { \
+ .virtual = (unsigned long) RK29_##name##_BASE, \
+ .pfn = __phys_to_pfn(RK29_##name##_PHYS), \
+ .length = RK29_##name##_SIZE, \
+ .type = MT_DEVICE_NONSHARED, \
+ }
+
+static struct map_desc rk29_io_desc[] __initdata = {
+ RK29_DEVICE(GICCPU),
+ RK29_DEVICE(GICPERI),
+ RK29_DEVICE(TIMER0),
+ RK29_DEVICE(TIMER1),
+ RK29_DEVICE(DDRC),
+ RK29_DEVICE(UART1),
+};
+
+void __init rk29_map_common_io(void)
+{
+ iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));
+}
\ No newline at end of file