ARM: EXYNOS: add exynos_get_boot_addr() helper
[deliverable/linux.git] / arch / arm / mach-exynos / platsmp.c
index b7cfcdcc0984a35505d5b8cbf903a08dbb51c18d..449edd1121e4d85a15b5e5e8ff40804407b480f5 100644 (file)
@@ -272,6 +272,31 @@ fail:
        return ret;
 }
 
+static int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr)
+{
+       int ret;
+
+       /*
+        * Try to get boot address using firmware first
+        * and fall back to boot register if it fails.
+        */
+       ret = call_firmware_op(get_cpu_boot_addr, core_id, boot_addr);
+       if (ret && ret != -ENOSYS)
+               goto fail;
+       if (ret == -ENOSYS) {
+               void __iomem *boot_reg = cpu_boot_reg(core_id);
+
+               if (IS_ERR(boot_reg)) {
+                       ret = PTR_ERR(boot_reg);
+                       goto fail;
+               }
+               *boot_addr = __raw_readl(boot_reg);
+               ret = 0;
+       }
+fail:
+       return ret;
+}
+
 static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        unsigned long timeout;
This page took 0.025725 seconds and 5 git commands to generate.