ARM: rockchip: common files support ARM64
authorHuang, Tao <huangtao@rock-chips.com>
Wed, 10 Dec 2014 11:50:00 +0000 (19:50 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 10 Dec 2014 11:50:00 +0000 (19:50 +0800)
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
arch/arm/mach-rockchip/common.c
arch/arm/mach-rockchip/efuse.c
arch/arm/mach-rockchip/last_log.c
arch/arm/mach-rockchip/rknandbase.c
arch/arm/mach-rockchip/rockchip_pm.c
arch/arm/mach-rockchip/sram.h

index bd944c53fa3bf3c74aa4cb3f0630e769ad87f34f..82b574275fc922739d4f0a319ef54f48e0a20c49 100755 (executable)
@@ -21,7 +21,9 @@
 #include <linux/of_platform.h>
 #include <linux/of_fdt.h>
 #include <asm/cputype.h>
+#ifdef CONFIG_CACHE_L2X0
 #include <asm/hardware/cache-l2x0.h>
+#endif
 #include <linux/rockchip/common.h>
 #include <linux/rockchip/pmu.h>
 #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;
index 235e124e9be656e464e7cf471ea15f2787bb3281..dbb2325ebbd35eddb27495ed89ac4546f6314c27 100644 (file)
@@ -10,7 +10,9 @@
 #include <linux/delay.h>
 #include <linux/rockchip/cpu.h>
 #include <linux/rockchip/iomap.h>
+#ifdef CONFIG_ARM
 #include <asm/system_info.h>
+#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)
 {
index e3c1d5fbf8453881a3b4d6db837560daa37c040e..2907bab41febc148e6bbf6a948da663dce0b69a1 100644 (file)
@@ -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) {
index 24d43619aa6df7f4c0dfd8247fc0c0c227b844d1..b8ab1a787f1166cd922bb6df07952a235a821e38 100755 (executable)
@@ -141,7 +141,11 @@ EXPORT_SYMBOL(rk_nand_get_device);
 \r
 unsigned long rknand_dma_flush_dcache(unsigned long ptr,int size,int dir)\r
 {\r
+#ifdef CONFIG_ARM64\r
+       __flush_dcache_area((void *)ptr, size + 63);\r
+#else\r
      __cpuc_flush_dcache_area((void*)ptr, size + 63);\r
+#endif\r
     return ((unsigned long )virt_to_phys((void *)ptr));\r
 }\r
 EXPORT_SYMBOL(rknand_dma_flush_dcache);\r
index 74ac848c2c649bf4e8eccb3cec5ca73aa5931df4..d3e8a1ead7f9e0b200141d3db689db8109cba2ce 100755 (executable)
@@ -11,6 +11,7 @@
 #include <asm/io.h>
 #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);
index 91149ae23097f5e9ef5996d2fbfd330c175fd87a..f7863de25bdadde72f2e5c8fae949a014a7ec409 100644 (file)
@@ -2,7 +2,9 @@
 #define __MACH_ROCKCHIP_SRAM_H
 
 #include <linux/pie.h>
+#ifdef CONFIG_PIE
 #include <asm/pie.h>
+#endif
 
 extern char __pie_common_start[];
 extern char __pie_common_end[];