Message ID | CAD=FV=U6HuQj3MxZ-yF-MYdjzqjT5bu=K26JuHZP1hjJzkSqbg@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jun 06, 2014 at 01:49:11PM -0700, Doug Anderson wrote: > This works and IMHO is much cleaner because it totally removes the > U-Boot dependency. I'll cleanup to not be so insane and post: > > diff --git a/arch/arm/mach-exynos/mcpm-exynos.c > b/arch/arm/mach-exynos/mcpm-exynos.c > index 0498d0b..9c5df7b 100644 > --- a/arch/arm/mach-exynos/mcpm-exynos.c > +++ b/arch/arm/mach-exynos/mcpm-exynos.c > @@ -290,6 +290,14 @@ static void __naked > exynos_pm_power_up_setup(unsigned int affinity_level) > "b cci_enable_port_for_self"); > } > > +static void __naked exynos_mcpm_secondary_cpu_start(void) > +{ > + asm volatile ("\n" > + "ldr r0, [pc, #0]\n" > + "bx r0\n" > + ".word 0" ); > +} > + So does it matter whether the above code gets assembled as thumb or ARM? How does your caller know which ISA mode to enter this fragment in?
Hi, On Fri, Jun 6, 2014 at 2:01 PM, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Fri, Jun 06, 2014 at 01:49:11PM -0700, Doug Anderson wrote: >> This works and IMHO is much cleaner because it totally removes the >> U-Boot dependency. I'll cleanup to not be so insane and post: >> >> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c >> b/arch/arm/mach-exynos/mcpm-exynos.c >> index 0498d0b..9c5df7b 100644 >> --- a/arch/arm/mach-exynos/mcpm-exynos.c >> +++ b/arch/arm/mach-exynos/mcpm-exynos.c >> @@ -290,6 +290,14 @@ static void __naked >> exynos_pm_power_up_setup(unsigned int affinity_level) >> "b cci_enable_port_for_self"); >> } >> >> +static void __naked exynos_mcpm_secondary_cpu_start(void) >> +{ >> + asm volatile ("\n" >> + "ldr r0, [pc, #0]\n" >> + "bx r0\n" >> + ".word 0" ); >> +} >> + > > So does it matter whether the above code gets assembled as thumb or > ARM? How does your caller know which ISA mode to enter this fragment > in? I'm going to take Olof's suggestion and just hardcode the instructions like: __raw_writel(0xe59f0000, ns_sram_base_addr); /* ldr r0, [pc, #0] */ __raw_writel(0xe12fff10, ns_sram_base_addr + 4); /* bx r0 */ __raw_writel(virt_to_phys(mcpm_entry_point), ns_sram_base_addr + 8); The caller always jumps to this code with "bx" but always jumps into ARM mode. Specifically U-Boot will have: branch_bx(CONFIG_EXYNOS_RELOCATE_CODE_BASE); -Doug -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On Fri, Jun 6, 2014 at 1:49 PM, Doug Anderson <dianders@google.com> wrote: >> Are you talking about the re-writing the mcpm entry point address post-resume ? > > Or even (as Andrew points out) just don't use it. > > This works and IMHO is much cleaner because it totally removes the > U-Boot dependency. I'll cleanup to not be so insane and post: The less insane version is at <https://patchwork.kernel.org/patch/4313611/>. Thanks to Andrew for the suggestion! -Doug -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index 0498d0b..9c5df7b 100644 --- a/arch/arm/mach-exynos/mcpm-exynos.c +++ b/arch/arm/mach-exynos/mcpm-exynos.c @@ -290,6 +290,14 @@ static void __naked exynos_pm_power_up_setup(unsigned int affinity_level) "b cci_enable_port_for_self"); } +static void __naked exynos_mcpm_secondary_cpu_start(void) +{ + asm volatile ("\n" + "ldr r0, [pc, #0]\n" + "bx r0\n" + ".word 0" ); +} + static const struct of_device_id exynos_dt_mcpm_match[] = { { .compatible = "samsung,exynos5420" },