From b37a39212764df1885e25e43493d567658fb69d1 Mon Sep 17 00:00:00 2001 From: "Huang, Tao" Date: Wed, 10 Dec 2014 19:50:00 +0800 Subject: [PATCH] ARM: rockchip: common files support ARM64 Signed-off-by: Huang, Tao --- arch/arm/mach-rockchip/common.c | 4 ++++ arch/arm/mach-rockchip/efuse.c | 6 ++++++ arch/arm/mach-rockchip/last_log.c | 5 +++-- arch/arm/mach-rockchip/rknandbase.c | 4 ++++ arch/arm/mach-rockchip/rockchip_pm.c | 2 ++ arch/arm/mach-rockchip/sram.h | 2 ++ 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/common.c b/arch/arm/mach-rockchip/common.c index bd944c53fa3b..82b574275fc9 100755 --- a/arch/arm/mach-rockchip/common.c +++ b/arch/arm/mach-rockchip/common.c @@ -21,7 +21,9 @@ #include #include #include +#ifdef CONFIG_CACHE_L2X0 #include +#endif #include #include #include "cpu_axi.h" @@ -110,6 +112,7 @@ static int __init rockchip_cpu_axi_init(void) } early_initcall(rockchip_cpu_axi_init); +#ifdef CONFIG_CACHE_L2X0 static int __init rockchip_pl330_l2_cache_init(void) { struct device_node *np; @@ -149,6 +152,7 @@ static int __init rockchip_pl330_l2_cache_init(void) return 0; } early_initcall(rockchip_pl330_l2_cache_init); +#endif struct gen_pool *rockchip_sram_pool = NULL; struct pie_chunk *rockchip_pie_chunk = NULL; diff --git a/arch/arm/mach-rockchip/efuse.c b/arch/arm/mach-rockchip/efuse.c index 235e124e9be6..dbb2325ebbd3 100644 --- a/arch/arm/mach-rockchip/efuse.c +++ b/arch/arm/mach-rockchip/efuse.c @@ -10,7 +10,9 @@ #include #include #include +#ifdef CONFIG_ARM #include +#endif #include "efuse.h" #define efuse_readl(offset) readl_relaxed(RK_EFUSE_VIRT + offset) @@ -83,6 +85,7 @@ static int rk3288_get_leakage(int ch) return efuse_buf[23+ch]; } +#ifdef CONFIG_ARM static void __init rk3288_set_system_serial(void) { int i; @@ -96,6 +99,9 @@ static void __init rk3288_set_system_serial(void) system_serial_low = crc32(0, buf, 8); system_serial_high = crc32(system_serial_low, buf + 8, 8); } +#else +static inline void __init rk3288_set_system_serial(void) {} +#endif int rk312x_efuse_readregs(u32 addr, u32 length, u8 *buf) { diff --git a/arch/arm/mach-rockchip/last_log.c b/arch/arm/mach-rockchip/last_log.c index e3c1d5fbf845..2907bab41feb 100644 --- a/arch/arm/mach-rockchip/last_log.c +++ b/arch/arm/mach-rockchip/last_log.c @@ -85,7 +85,8 @@ static int __init rk_last_log_init(void) log_buf = last_log_vmap(virt_to_phys(buf), 1 << LOG_BUF_PAGE_ORDER); if (!log_buf) { - pr_err("failed to map %d pages at 0x%08x\n", 1 << LOG_BUF_PAGE_ORDER, virt_to_phys(buf)); + pr_err("failed to map %d pages at 0x%08llx\n", 1 << LOG_BUF_PAGE_ORDER, + (unsigned long long)virt_to_phys(buf)); return 0; } @@ -100,7 +101,7 @@ static int __init rk_last_log_init(void) memcpy(log_buf, early_log_buf, early_log_size); memset(log_buf + early_log_size, 0, LOG_BUF_LEN - early_log_size); - pr_info("0x%08x map to 0x%p and copy to 0x%p, size 0x%x early 0x%x (version 3.0)\n", virt_to_phys(buf), log_buf, last_log_buf, LOG_BUF_LEN, early_log_size); + pr_info("0x%08llx map to 0x%p and copy to 0x%p, size 0x%x early 0x%zx (version 3.0)\n", (unsigned long long)virt_to_phys(buf), log_buf, last_log_buf, LOG_BUF_LEN, early_log_size); entry = proc_create("last_kmsg", S_IRUSR, NULL, &last_log_fops); if (!entry) { diff --git a/arch/arm/mach-rockchip/rknandbase.c b/arch/arm/mach-rockchip/rknandbase.c index 24d43619aa6d..b8ab1a787f11 100755 --- a/arch/arm/mach-rockchip/rknandbase.c +++ b/arch/arm/mach-rockchip/rknandbase.c @@ -141,7 +141,11 @@ EXPORT_SYMBOL(rk_nand_get_device); unsigned long rknand_dma_flush_dcache(unsigned long ptr,int size,int dir) { +#ifdef CONFIG_ARM64 + __flush_dcache_area((void *)ptr, size + 63); +#else __cpuc_flush_dcache_area((void*)ptr, size + 63); +#endif return ((unsigned long )virt_to_phys((void *)ptr)); } EXPORT_SYMBOL(rknand_dma_flush_dcache); diff --git a/arch/arm/mach-rockchip/rockchip_pm.c b/arch/arm/mach-rockchip/rockchip_pm.c index 74ac848c2c64..d3e8a1ead7f9 100755 --- a/arch/arm/mach-rockchip/rockchip_pm.c +++ b/arch/arm/mach-rockchip/rockchip_pm.c @@ -11,6 +11,7 @@ #include #include "pm.h" +#ifdef CONFIG_ARM /*************************dump reg********************************************/ void rkpm_ddr_reg_offset_dump(void __iomem * base_addr,u32 _offset) @@ -567,6 +568,7 @@ void __init rockchip_suspend_init(void) suspend_set_ops(&rockchip_suspend_ops); return; } +#endif /* CONFIG_ARM */ static enum rockchip_pm_policy pm_policy; static BLOCKING_NOTIFIER_HEAD(policy_notifier_list); diff --git a/arch/arm/mach-rockchip/sram.h b/arch/arm/mach-rockchip/sram.h index 91149ae23097..f7863de25bda 100644 --- a/arch/arm/mach-rockchip/sram.h +++ b/arch/arm/mach-rockchip/sram.h @@ -2,7 +2,9 @@ #define __MACH_ROCKCHIP_SRAM_H #include +#ifdef CONFIG_PIE #include +#endif extern char __pie_common_start[]; extern char __pie_common_end[]; -- 2.34.1