* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
@ 2014-02-17 6:31 Magnus Damm
2014-02-17 7:21 ` Simon Horman
2014-02-17 8:53 ` Geert Uytterhoeven
0 siblings, 2 replies; 5+ messages in thread
From: Magnus Damm @ 2014-02-17 6:31 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm@opensource.se>
On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
mode bit MD21 indicates if hardware debug mode is enabled or not.
In case hardware debug mode is enabled print a warning and refrain
from booting secondary CPU cores. Without this patch Koelsch boards
with SW8-4 set to OFF will hang at SMP boot.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
Written against renesas-devel-v3.14-rc2-20140213
arch/arm/mach-shmobile/platsmp-apmu.c | 7 +++++++
1 file changed, 7 insertions(+)
--- 0001/arch/arm/mach-shmobile/platsmp-apmu.c
+++ work/arch/arm/mach-shmobile/platsmp-apmu.c 2014-02-17 15:11:15.000000000 +0900
@@ -17,6 +17,7 @@
#include <asm/cp15.h>
#include <asm/smp_plat.h>
#include <mach/common.h>
+#include <mach/rcar-gen2.h>
static struct {
void __iomem *iomem;
@@ -136,6 +137,12 @@ void __init shmobile_smp_apmu_prepare_cp
int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
+ /* Refrain boot when hardware debug mode is enabled */
+ if (rcar_gen2_read_mode_pins() & BIT(21)) {
+ pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu);
+ return -ENOTSUPP;
+ }
+
/* For this particular CPU register boot vector */
shmobile_smp_hook(cpu, virt_to_phys(shmobile_invalidate_start), 0);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
2014-02-17 6:31 [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU Magnus Damm
@ 2014-02-17 7:21 ` Simon Horman
2014-02-17 7:35 ` Magnus Damm
2014-02-17 8:53 ` Geert Uytterhoeven
1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2014-02-17 7:21 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 17, 2014 at 03:31:52PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
>
> On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
> mode bit MD21 indicates if hardware debug mode is enabled or not.
>
> In case hardware debug mode is enabled print a warning and refrain
> from booting secondary CPU cores. Without this patch Koelsch boards
> with SW8-4 set to OFF will hang at SMP boot.
Out of interest, is this the solution to your recent SMP troubles?
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> Written against renesas-devel-v3.14-rc2-20140213
>
> arch/arm/mach-shmobile/platsmp-apmu.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> --- 0001/arch/arm/mach-shmobile/platsmp-apmu.c
> +++ work/arch/arm/mach-shmobile/platsmp-apmu.c 2014-02-17 15:11:15.000000000 +0900
> @@ -17,6 +17,7 @@
> #include <asm/cp15.h>
> #include <asm/smp_plat.h>
> #include <mach/common.h>
> +#include <mach/rcar-gen2.h>
>
> static struct {
> void __iomem *iomem;
> @@ -136,6 +137,12 @@ void __init shmobile_smp_apmu_prepare_cp
>
> int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
> {
> + /* Refrain boot when hardware debug mode is enabled */
> + if (rcar_gen2_read_mode_pins() & BIT(21)) {
> + pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu);
> + return -ENOTSUPP;
> + }
> +
> /* For this particular CPU register boot vector */
> shmobile_smp_hook(cpu, virt_to_phys(shmobile_invalidate_start), 0);
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
2014-02-17 7:21 ` Simon Horman
@ 2014-02-17 7:35 ` Magnus Damm
0 siblings, 0 replies; 5+ messages in thread
From: Magnus Damm @ 2014-02-17 7:35 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 17, 2014 at 4:21 PM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Feb 17, 2014 at 03:31:52PM +0900, Magnus Damm wrote:
>> From: Magnus Damm <damm@opensource.se>
>>
>> On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
>> mode bit MD21 indicates if hardware debug mode is enabled or not.
>>
>> In case hardware debug mode is enabled print a warning and refrain
>> from booting secondary CPU cores. Without this patch Koelsch boards
>> with SW8-4 set to OFF will hang at SMP boot.
>
> Out of interest, is this the solution to your recent SMP troubles?
Yes, one of them. =)
/ magnus
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
2014-02-17 6:31 [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU Magnus Damm
2014-02-17 7:21 ` Simon Horman
@ 2014-02-17 8:53 ` Geert Uytterhoeven
2014-02-17 11:14 ` Magnus Damm
1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-02-17 8:53 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 17, 2014 at 7:31 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm@opensource.se>
>
> On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
> mode bit MD21 indicates if hardware debug mode is enabled or not.
>
> In case hardware debug mode is enabled print a warning and refrain
> from booting secondary CPU cores. Without this patch Koelsch boards
> with SW8-4 set to OFF will hang at SMP boot.
Ah, mine was set to OFF.
> Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
with one minor nit:
> int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
> {
> + /* Refrain boot when hardware debug mode is enabled */
> + if (rcar_gen2_read_mode_pins() & BIT(21)) {
> + pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu);
%u
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
2014-02-17 8:53 ` Geert Uytterhoeven
@ 2014-02-17 11:14 ` Magnus Damm
0 siblings, 0 replies; 5+ messages in thread
From: Magnus Damm @ 2014-02-17 11:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 17, 2014 at 5:53 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Mon, Feb 17, 2014 at 7:31 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> From: Magnus Damm <damm@opensource.se>
>>
>> On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
>> mode bit MD21 indicates if hardware debug mode is enabled or not.
>>
>> In case hardware debug mode is enabled print a warning and refrain
>> from booting secondary CPU cores. Without this patch Koelsch boards
>> with SW8-4 set to OFF will hang at SMP boot.
>
> Ah, mine was set to OFF.
>
>> Signed-off-by: Magnus Damm <damm@opensource.se>
>
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks!
> with one minor nit:
>
>> int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
>> {
>> + /* Refrain boot when hardware debug mode is enabled */
>> + if (rcar_gen2_read_mode_pins() & BIT(21)) {
>> + pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu);
>
> %u
Good catch, will send a V2.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-17 11:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 6:31 [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU Magnus Damm
2014-02-17 7:21 ` Simon Horman
2014-02-17 7:35 ` Magnus Damm
2014-02-17 8:53 ` Geert Uytterhoeven
2014-02-17 11:14 ` Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox