add rk29 io.c and board.h
authorlhh <lhh@rock-chips.com>
Wed, 20 Oct 2010 12:09:28 +0000 (20:09 +0800)
committerlhh <lhh@rock-chips.com>
Wed, 20 Oct 2010 12:09:28 +0000 (20:09 +0800)
arch/arm/mach-rk29/Makefile
arch/arm/mach-rk29/board-rk29sdk.c
arch/arm/mach-rk29/include/mach/board.h [new file with mode: 0644]
arch/arm/mach-rk29/include/mach/rk29_iomap.h
arch/arm/mach-rk29/io.c [new file with mode: 0644]

index 7e5236b094987e9b0147fc05c6f4f5f133c87d9d..ad969989dba7daf3e432a67e461dd39e67e715bf 100644 (file)
@@ -1,2 +1,2 @@
-obj-y += timer.o 
+obj-y += timer.o io.o
 obj-$(CONFIG_MACH_RK29SDK) += board-rk29sdk.o
index 6ee0dd5fd9edf669f4e9219fb14d5b377397dce6..62b627302b2ad805eba5e906ccf912fd45385f5f 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -32,7 +32,7 @@
 \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
@@ -93,7 +59,7 @@ static void __init machine_rk29_board_init(void)
 \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
diff --git a/arch/arm/mach-rk29/include/mach/board.h b/arch/arm/mach-rk29/include/mach/board.h
new file mode 100644 (file)
index 0000000..0126051
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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
index 274e5efa2223a1bff642fcd5148c0610faf51db2..a8d39b827d4df8ef915a23cf904946c8e0f1d0b6 100644 (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
diff --git a/arch/arm/mach-rk29/io.c b/arch/arm/mach-rk29/io.c
new file mode 100644 (file)
index 0000000..8fd8840
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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