Skip to contentSkip to conversation

ARM: shmobile: Consolidate R8A779[234] machine definitions

PATCH Superseded Laurent Pinchart 4 participants 5 messages Oct 5, 2016 – Oct 7, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: shmobile: Consolidate R8A779[234] machine definitions

The three SoCs use the exact same machine definition, consolidate them into a single one.

---
 arch/arm/mach-shmobile/Makefile          |  3 ---
 arch/arm/mach-shmobile/setup-r8a7792.c   | 35 --------------------------------
 arch/arm/mach-shmobile/setup-r8a7793.c   | 33 ------------------------------
 arch/arm/mach-shmobile/setup-r8a7794.c   | 33 ------------------------------
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 20 ++++++++++++++++++
 5 files changed, 20 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7792.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7793.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7794.c

I don't have access to any R8A779[234] board, I'd appreciate if someone could test the patch series.

arch/arm/mach-shmobile/Makefile +0 -3
index 3fc48b02eb4f..64611a1b4276 100644
@@ -13,9 +13,6 @@ obj-$(CONFIG_ARCH_R8A7778)	+= setup-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)	+= setup-r8a7779.o pm-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)	+= setup-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)	+= setup-r8a7791.o
-obj-$(CONFIG_ARCH_R8A7792)	+= setup-r8a7792.o
-obj-$(CONFIG_ARCH_R8A7793)	+= setup-r8a7793.o
-obj-$(CONFIG_ARCH_R8A7794)	+= setup-r8a7794.o
 obj-$(CONFIG_ARCH_EMEV2)	+= setup-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)	+= setup-r7s72100.o
 
arch/arm/mach-shmobile/setup-r8a7792.c deleted +0 -35
deleted file mode 100644
index a0910395da09..000000000000
@@ -1,35 +0,0 @@
-/*
- * r8a7792 processor support
- *
- * Copyright (C) 2014 Renesas Electronics Corporation
- * Copyright (C) 2016 Cogent  Embedded, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7792_boards_compat_dt[] __initconst = {
-	"renesas,r8a7792",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7792_DT, "Generic R8A7792 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_late	= shmobile_init_late,
-	.init_time	= rcar_gen2_timer_init,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7792_boards_compat_dt,
-MACHINE_END
arch/arm/mach-shmobile/setup-r8a7793.c deleted +0 -33
deleted file mode 100644
index 5fce87f7f254..000000000000
@@ -1,33 +0,0 @@
-/*
- * r8a7793 processor support
- *
- * Copyright (C) 2015  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/init.h>
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7793_boards_compat_dt[] __initconst = {
-	"renesas,r8a7793",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7793_DT, "Generic R8A7793 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_time	= rcar_gen2_timer_init,
-	.init_late	= shmobile_init_late,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7793_boards_compat_dt,
-MACHINE_END
arch/arm/mach-shmobile/setup-r8a7794.c deleted +0 -33
deleted file mode 100644
index d2b093033132..000000000000
@@ -1,33 +0,0 @@
-/*
- * r8a7794 processor support
- *
- * Copyright (C) 2014  Renesas Electronics Corporation
- * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-#include "common.h"
-#include "rcar-gen2.h"
-#include <asm/mach/arch.h>
-
-static const char * const r8a7794_boards_compat_dt[] __initconst = {
-	"renesas,r8a7794",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7794_DT, "Generic R8A7794 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_late	= shmobile_init_late,
-	.init_time	= rcar_gen2_timer_init,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7794_boards_compat_dt,
-MACHINE_END
arch/arm/mach-shmobile/setup-rcar-gen2.c +20 -0
index afb9fdcd3d90..4d5052564f21 100644
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/of_platform.h>
 #include <asm/mach/arch.h>
 #include "common.h"
 #include "rcar-gen2.h"
@@ -203,3 +204,22 @@ void __init rcar_gen2_reserve(void)
 	}
 #endif
 }
+
+static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
+	/*
+	 * R8A7790 and R8A7791 can't be handled here as long as they need SMP
+	 * initialization fallback.
+	 */
+	"renesas,r8a7792",
+	"renesas,r8a7793",
+	"renesas,r8a7794",
+	NULL,
+};
+
+DT_MACHINE_START(RCAR_GEN2_DT, "Generic Gen2 (Flattened Device Tree)")
+	.init_early	= shmobile_init_delay,
+	.init_late	= shmobile_init_late,
+	.init_time	= rcar_gen2_timer_init,
+	.reserve	= rcar_gen2_reserve,
+	.dt_compat	= rcar_gen2_boards_compat_dt,
+MACHINE_END
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

PATCH 1/1 ARM: shmobile: Consolidate R8A779[234] machine definitions

Quoted 172 lines · On Wednesday 05 Oct 2016 13:31:29 Laurent Pinchart wrote:

The three SoCs use the exact same machine definition, consolidate them into a single one.

---
 arch/arm/mach-shmobile/Makefile          |  3 ---
 arch/arm/mach-shmobile/setup-r8a7792.c   | 35

-------------------------------- arch/arm/mach-shmobile/setup-r8a7793.c |
33 ------------------------------ arch/arm/mach-shmobile/setup-r8a7794.c | 33 ------------------------------ arch/arm/mach-shmobile/setup-rcar-gen2.c | 20 ++++++++++++++++++

 5 files changed, 20 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7792.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7793.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7794.c

I don't have access to any R8A779[234] board, I'd appreciate if someone could test the patch series.

(quoted diff) +0 -0

b/arch/arm/mach-shmobile/Makefile index 3fc48b02eb4f..64611a1b4276 100644

arch/arm/mach-shmobile/Makefile +0 -3
@@ -13,9 +13,6 @@ obj-$(CONFIG_ARCH_R8A7778)	+= setup-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)	+= setup-r8a7779.o pm-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)	+= setup-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)	+= setup-r8a7791.o
-obj-$(CONFIG_ARCH_R8A7792)	+= setup-r8a7792.o
-obj-$(CONFIG_ARCH_R8A7793)	+= setup-r8a7793.o
-obj-$(CONFIG_ARCH_R8A7794)	+= setup-r8a7794.o
 obj-$(CONFIG_ARCH_EMEV2)	+= setup-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)	+= setup-r7s72100.o
 
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/setup-r8a7792.c deleted file mode 100644 index a0910395da09..000000000000

arch/arm/mach-shmobile/setup-r8a7792.c deleted +0 -35
@@ -1,35 +0,0 @@
-/*
- * r8a7792 processor support
- *
- * Copyright (C) 2014 Renesas Electronics Corporation
- * Copyright (C) 2016 Cogent  Embedded, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7792_boards_compat_dt[] __initconst = {
-	"renesas,r8a7792",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7792_DT, "Generic R8A7792 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_late	= shmobile_init_late,
-	.init_time	= rcar_gen2_timer_init,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7792_boards_compat_dt,
-MACHINE_END
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/setup-r8a7793.c deleted file mode 100644 index 5fce87f7f254..000000000000

arch/arm/mach-shmobile/setup-r8a7793.c deleted +0 -33
@@ -1,33 +0,0 @@
-/*
- * r8a7793 processor support
- *
- * Copyright (C) 2015  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/init.h>
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7793_boards_compat_dt[] __initconst = {
-	"renesas,r8a7793",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7793_DT, "Generic R8A7793 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_time	= rcar_gen2_timer_init,
-	.init_late	= shmobile_init_late,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7793_boards_compat_dt,
-MACHINE_END
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/setup-r8a7794.c deleted file mode 100644 index d2b093033132..000000000000

arch/arm/mach-shmobile/setup-r8a7794.c deleted +0 -33
@@ -1,33 +0,0 @@
-/*
- * r8a7794 processor support
- *
- * Copyright (C) 2014  Renesas Electronics Corporation
- * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-#include "common.h"
-#include "rcar-gen2.h"
-#include <asm/mach/arch.h>
-
-static const char * const r8a7794_boards_compat_dt[] __initconst = {
-	"renesas,r8a7794",
-	NULL,
-};
-
-DT_MACHINE_START(R8A7794_DT, "Generic R8A7794 (Flattened Device Tree)")
-	.init_early	= shmobile_init_delay,
-	.init_late	= shmobile_init_late,
-	.init_time	= rcar_gen2_timer_init,
-	.reserve	= rcar_gen2_reserve,
-	.dt_compat	= r8a7794_boards_compat_dt,
-MACHINE_END
(quoted diff) +0 -0

b/arch/arm/mach-shmobile/setup-rcar-gen2.c index afb9fdcd3d90..4d5052564f21 100644

arch/arm/mach-shmobile/setup-rcar-gen2.c +4 -0
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/of_platform.h>
 #include <asm/mach/arch.h>
 #include "common.h"
 #include "rcar-gen2.h"
@@ -203,3 +204,22 @@ void __init rcar_gen2_reserve(void)
 	}
 #endif
 }
+
+static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
+	/*

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 219

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +10 -0
+	 * R8A7790 and R8A7791 can't be handled here as long as they need SMP
+	 * initialization fallback.
+	 */
+	"renesas,r8a7792",
+	"renesas,r8a7793",
+	"renesas,r8a7794",
+	NULL,
+};
+
+DT_MACHINE_START(RCAR_GEN2_DT, "Generic Gen2 (Flattened Device Tree)")

This should of course read "Generic R-Car Gen2 (Flattened Device Tree)". I'll fix it in the next version, after getting initial review.

Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +6 -0
+	.init_early	= shmobile_init_delay,
+	.init_late	= shmobile_init_late,
+	.init_time	= rcar_gen2_timer_init,
+	.reserve	= rcar_gen2_reserve,
+	.dt_compat	= rcar_gen2_boards_compat_dt,
+MACHINE_END
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw

PATCH 1/1 ARM: shmobile: Consolidate R8A779[234] machine definitions

Quoted 17 lines · Laurent Pinchart
Quoted 16 lines · On Wednesday 05 Oct 2016 13:31:29 Laurent Pinchart wrote:

The three SoCs use the exact same machine definition, consolidate them into a single one.

---
 arch/arm/mach-shmobile/Makefile          |  3 ---
 arch/arm/mach-shmobile/setup-r8a7792.c   | 35

-------------------------------- arch/arm/mach-shmobile/setup-r8a7793.c |
33 ------------------------------ arch/arm/mach-shmobile/setup-r8a7794.c | 33 ------------------------------ arch/arm/mach-shmobile/setup-rcar-gen2.c | 20 ++++++++++++++++++

 5 files changed, 20 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7792.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7793.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7794.c
Quoted 2 lines
Quoted 2 lines

I don't have access to any R8A779[234] board, I'd appreciate if someone could test the patch series.

I have tested this on an r8a7793/gose and r8a7794/alt.

#3 lore raw

PATCH 1/1 ARM: shmobile: Consolidate R8A779[234] machine definitions

In reply to Laurent Pinchart

Hi Laurent,

Quoted 2 lines · Laurent Pinchart

The three SoCs use the exact same machine definition, consolidate them into a single one.

Thanks for your patch!

Quoted 1 line

I'm wondering if we can improve upon...

Quoted 11 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +4 -0
@@ -203,3 +204,22 @@ void __init rcar_gen2_reserve(void)
        }
 #endif
 }
+
+static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
+       /*
+        * R8A7790 and R8A7791 can't be handled here as long as they need SMP

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 220

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +10 -0
+        * initialization fallback.
+        */
+       "renesas,r8a7792",
+       "renesas,r8a7793",
+       "renesas,r8a7794",
+       NULL,
+};
+
+DT_MACHINE_START(RCAR_GEN2_DT, "Generic Gen2 (Flattened Device Tree)")
+       .init_early     = shmobile_init_delay,

shmobile_init_delay() is not really Renesas-specific, but ARM-specific. This is just to avoid calibrating the delay loop?

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 221

Quoted 1 line
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -0
+       .init_late      = shmobile_init_late,

This calls only into shmobile_suspend_init(), which is also not Renesas-specific.

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 222

Quoted 1 line
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -0
+       .init_time      = rcar_gen2_timer_init,

This is about fixing up the ARM Arch timer, and initializing clocks as we need to pass the mode pin state (ugh, will hopefully go away soon).

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 223

Quoted 1 line
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -0
+       .reserve        = rcar_gen2_reserve,

Reserving a block for CMA DMA is also not really Renesas-specific.

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 225

Quoted 2 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -0
+       .dt_compat      = rcar_gen2_boards_compat_dt,
+MACHINE_END

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

#4 lore raw

PATCH 1/1 ARM: shmobile: Consolidate R8A779[234] machine definitions

Hi Geert,

Quoted 10 lines · On Friday 07 Oct 2016 09:43:53 Geert Uytterhoeven wrote:
Quoted 2 lines · Laurent Pinchart

The three SoCs use the exact same machine definition, consolidate them into a single one.

Thanks for your patch!

Quoted 2 lines

Signed-off-by: Laurent Pinchart
<[email protected]>

Thanks.

Quoted 1 line

I'm wondering if we can improve upon...

I think we can. Your points below are valid, patches are welcome ;-)

Quoted 41 lines
Quoted 11 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +4 -0
@@ -203,3 +204,22 @@ void __init rcar_gen2_reserve(void)
        }
 #endif
 }
+
+static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
+       /*
+        * R8A7790 and R8A7791 can't be handled here as long as they need

SMP

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_reserve(void) · line 220

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +10 -0
+        * initialization fallback.
+        */
+       "renesas,r8a7792",
+       "renesas,r8a7793",
+       "renesas,r8a7794",
+       NULL,
+};
+
+DT_MACHINE_START(RCAR_GEN2_DT, "Generic Gen2 (Flattened Device Tree)")
+       .init_early     = shmobile_init_delay,

shmobile_init_delay() is not really Renesas-specific, but ARM-specific. This is just to avoid calibrating the delay loop?

Quoted 1 line

+ .init_late = shmobile_init_late,

This calls only into shmobile_suspend_init(), which is also not Renesas-specific.

Quoted 1 line

+ .init_time = rcar_gen2_timer_init,

This is about fixing up the ARM Arch timer, and initializing clocks as we need to pass the mode pin state (ugh, will hopefully go away soon).

Quoted 1 line

+ .reserve = rcar_gen2_reserve,

Reserving a block for CMA DMA is also not really Renesas-specific.

Quoted 2 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -0
+       .dt_compat      = rcar_gen2_boards_compat_dt,
+MACHINE_END
Signature · 3 lines
Regards,

Laurent Pinchart