From 27e294ee8e466af9dad4afb4d315db49beed40b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Thu, 27 Feb 2014 20:54:11 +0800 Subject: [PATCH] ARM: rockchip: common.h add RK_DEVICE macro --- arch/arm/mach-rockchip/common.h | 8 ++++++ arch/arm/mach-rockchip/rk3188.c | 49 +++++---------------------------- 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/arch/arm/mach-rockchip/common.h b/arch/arm/mach-rockchip/common.h index 994004a50611..cfcf6cfe5e1f 100644 --- a/arch/arm/mach-rockchip/common.h +++ b/arch/arm/mach-rockchip/common.h @@ -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; diff --git a/arch/arm/mach-rockchip/rk3188.c b/arch/arm/mach-rockchip/rk3188.c index c9d6c7f677b2..1869fde1193f 100644 --- a/arch/arm/mach-rockchip/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188.c @@ -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) -- 2.34.1