ARM: rockchip: common.h add RK_DEVICE macro
author黄涛 <huangtao@rock-chips.com>
Thu, 27 Feb 2014 12:54:11 +0000 (20:54 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 27 Feb 2014 12:54:55 +0000 (20:54 +0800)
arch/arm/mach-rockchip/common.h
arch/arm/mach-rockchip/rk3188.c

index 994004a50611cd1cb3eeb61dfbb5f37a205046ea..cfcf6cfe5e1fdb411b7eefdf8fc4c27a23067646 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef __MACH_ROCKCHIP_COMMON_H
 #define __MACH_ROCKCHIP_COMMON_H
 
+#define RK_DEVICE(VIRT,PHYS,SIZE) \
+       { \
+               .virtual        = (unsigned long)(VIRT), \
+               .pfn            = __phys_to_pfn(PHYS), \
+               .length         = SIZE, \
+               .type           = MT_DEVICE, \
+       }
+
 extern unsigned long rockchip_boot_fn;
 extern struct smp_operations rockchip_smp_ops;
 
index c9d6c7f677b2f2b775da2627c3220f7fbdb7d2e8..1869fde1193fe268a17d36cad1c7abb8e0605185 100644 (file)
@@ -49,48 +49,13 @@ static struct map_desc rk3188_io_desc[] __initdata = {
        RK3188_DEVICE(ROM),
        RK3188_DEVICE(EFUSE),
        RK3188_DEVICE(CPU_AXI_BUS),
-       {
-               .virtual        = (unsigned long) RK_DDR_VIRT,
-               .pfn            = __phys_to_pfn(RK3188_DDR_PCTL_PHYS),
-               .length         = RK3188_DDR_PCTL_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_DDR_VIRT + RK3188_DDR_PCTL_SIZE,
-               .pfn            = __phys_to_pfn(RK3188_DDR_PUBL_PHYS),
-               .length         = RK3188_DDR_PUBL_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_GPIO_VIRT(0),
-               .pfn            = __phys_to_pfn(RK3188_GPIO0_PHYS),
-               .length         = RK3188_GPIO_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_GPIO_VIRT(1),
-               .pfn            = __phys_to_pfn(RK3188_GPIO1_PHYS),
-               .length         = RK3188_GPIO_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_GPIO_VIRT(2),
-               .pfn            = __phys_to_pfn(RK3188_GPIO2_PHYS),
-               .length         = RK3188_GPIO_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_GPIO_VIRT(3),
-               .pfn            = __phys_to_pfn(RK3188_GPIO3_PHYS),
-               .length         = RK3188_GPIO_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = (unsigned long) RK_DEBUG_UART_VIRT,
-               .pfn            = __phys_to_pfn(RK3188_UART2_PHYS),
-               .length         = RK3188_UART_SIZE,
-               .type           = MT_DEVICE,
-       },
+       RK_DEVICE(RK_DDR_VIRT, RK3188_DDR_PCTL_PHYS, RK3188_DDR_PCTL_SIZE),
+       RK_DEVICE(RK_DDR_VIRT + RK3188_DDR_PCTL_SIZE, RK3188_DDR_PUBL_PHYS, RK3188_DDR_PUBL_SIZE),
+       RK_DEVICE(RK_GPIO_VIRT(0), RK3188_GPIO0_PHYS, RK3188_GPIO_SIZE),
+       RK_DEVICE(RK_GPIO_VIRT(1), RK3188_GPIO1_PHYS, RK3188_GPIO_SIZE),
+       RK_DEVICE(RK_GPIO_VIRT(2), RK3188_GPIO2_PHYS, RK3188_GPIO_SIZE),
+       RK_DEVICE(RK_GPIO_VIRT(3), RK3188_GPIO3_PHYS, RK3188_GPIO_SIZE),
+       RK_DEVICE(RK_DEBUG_UART_VIRT, RK3188_UART2_PHYS, RK3188_UART_SIZE),
 };
 
 static void __init rk3188_boot_mode_init(void)