Skip to contentSkip to conversation

ARM: shmobile: r8a7740: Multiplatform support

PATCH In review Magnus Damm 3 participants 7 messages Aug 25, 2014 – Aug 27, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7740: Multiplatform support

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

---

Built on top of renesas-devel-20140823-v3.17-rc1 and "[PATCH v2 00/05] ARM: shmobile: Kconfig and Makefile cleanups V2"

 arch/arm/mach-shmobile/Kconfig         |    5 +++++
 arch/arm/mach-shmobile/pm-r8a7740.c    |    5 ++---
 arch/arm/mach-shmobile/r8a7740.h       |    4 ++--
 arch/arm/mach-shmobile/setup-r8a7740.c |    8 +++++++-
 4 files changed, 16 insertions(+), 6 deletions(-)
arch/arm/mach-shmobile/Kconfig +5 -0
@@ -50,6 +50,11 @@ config ARCH_R7S72100
 	bool "RZ/A1H (R7S72100)"
 	select SYS_SUPPORTS_SH_MTU2
 
+config ARCH_R8A7740
+	bool "R-Mobile A1 (R8A77400)"
+	select ARCH_RMOBILE
+	select RENESAS_INTC_IRQPIN
+
 config ARCH_R8A7779
 	bool "R-Car H1 (R8A77790)"
 	select ARCH_RCAR_GEN1
arch/arm/mach-shmobile/pm-r8a7740.c +2 -3
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -58,8 +58,7 @@ void __init r8a7740_init_pm_domains(void
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck)
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #endif /* __ASM_R8A7740_H__ */
arch/arm/mach-shmobile/setup-r8a7740.c +7 -1
@@ -36,6 +36,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "dma-register.h"
@@ -813,7 +814,12 @@ void __init r8a7740_init_irq_of(void)
 
 static void __init r8a7740_generic_init(void)
 {
-	r8a7740_clock_init(0);
+	r8a7740_meram_workaround();
+
+#ifdef CONFIG_CACHE_L2X0
+	/* Shared attribute override enable, 32K*8way */
+	l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
+#endif
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
#1 lore raw
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

Quoted 92 lines

---

Built on top of renesas-devel-20140823-v3.17-rc1 and "[PATCH v2 00/05] ARM: shmobile: Kconfig and Makefile cleanups V2"

 arch/arm/mach-shmobile/Kconfig         |    5 +++++
 arch/arm/mach-shmobile/pm-r8a7740.c    |    5 ++---
 arch/arm/mach-shmobile/r8a7740.h       |    4 ++--
 arch/arm/mach-shmobile/setup-r8a7740.c |    8 +++++++-
 4 files changed, 16 insertions(+), 6 deletions(-)
arch/arm/mach-shmobile/Kconfig +5 -0
@@ -50,6 +50,11 @@ config ARCH_R7S72100
 	bool "RZ/A1H (R7S72100)"
 	select SYS_SUPPORTS_SH_MTU2
 
+config ARCH_R8A7740
+	bool "R-Mobile A1 (R8A77400)"
+	select ARCH_RMOBILE
+	select RENESAS_INTC_IRQPIN
+
 config ARCH_R8A7779
 	bool "R-Car H1 (R8A77790)"
 	select ARCH_RCAR_GEN1
arch/arm/mach-shmobile/pm-r8a7740.c +2 -3
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -58,8 +58,7 @@ void __init r8a7740_init_pm_domains(void
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck)
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #endif /* __ASM_R8A7740_H__ */
arch/arm/mach-shmobile/setup-r8a7740.c +7 -2
@@ -36,6 +36,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "dma-register.h"
@@ -813,7 +814,12 @@ void __init r8a7740_init_irq_of(void)
 
 static void __init r8a7740_generic_init(void)
 {
-	r8a7740_clock_init(0);
+	r8a7740_meram_workaround();
+
+#ifdef CONFIG_CACHE_L2X0
+	/* Shared attribute override enable, 32K*8way */
+	l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
+#endif
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
--

To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Magnus Damm
Quoted 7 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

Quoted 8 lines

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

I am confused.

I see that in "[PATCH v2 05/05] ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig" you propose adding PM_RMOBILE but it isn't used in this series.

Quoted 98 lines
Quoted 89 lines

---

Built on top of renesas-devel-20140823-v3.17-rc1 and "[PATCH v2 00/05] ARM: shmobile: Kconfig and Makefile cleanups V2"

 arch/arm/mach-shmobile/Kconfig         |    5 +++++
 arch/arm/mach-shmobile/pm-r8a7740.c    |    5 ++---
 arch/arm/mach-shmobile/r8a7740.h       |    4 ++--
 arch/arm/mach-shmobile/setup-r8a7740.c |    8 +++++++-
 4 files changed, 16 insertions(+), 6 deletions(-)
arch/arm/mach-shmobile/Kconfig +5 -0
@@ -50,6 +50,11 @@ config ARCH_R7S72100
 	bool "RZ/A1H (R7S72100)"
 	select SYS_SUPPORTS_SH_MTU2
 
+config ARCH_R8A7740
+	bool "R-Mobile A1 (R8A77400)"
+	select ARCH_RMOBILE
+	select RENESAS_INTC_IRQPIN
+
 config ARCH_R8A7779
 	bool "R-Car H1 (R8A77790)"
 	select ARCH_RCAR_GEN1
arch/arm/mach-shmobile/pm-r8a7740.c +2 -3
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -58,8 +58,7 @@ void __init r8a7740_init_pm_domains(void
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck)
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
 
 #endif /* __ASM_R8A7740_H__ */
arch/arm/mach-shmobile/setup-r8a7740.c +7 -2
@@ -36,6 +36,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "dma-register.h"
@@ -813,7 +814,12 @@ void __init r8a7740_init_irq_of(void)
 
 static void __init r8a7740_generic_init(void)
 {
-	r8a7740_clock_init(0);
+	r8a7740_meram_workaround();
+
+#ifdef CONFIG_CACHE_L2X0
+	/* Shared attribute override enable, 32K*8way */
+	l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
+#endif
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Magnus Damm
Quoted 14 lines · Simon Horman
Quoted 13 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

Quoted 8 lines
Quoted 2 lines

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

I am confused.

I see that in "[PATCH v2 05/05] ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig" you propose adding PM_RMOBILE but it isn't used in this series.

PM_RMOBILE controls the build of pm-rmobile.c, while the new #ifdefs are in the r8a7740-specific code in pm-r8a7740.c.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
In reply to Magnus Damm
Quoted 18 lines · Geert Uytterhoeven
Quoted 17 lines · Simon Horman
Quoted 15 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

Quoted 8 lines
Quoted 5 lines

I am confused.

I see that in "[PATCH v2 05/05] ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig" you propose adding PM_RMOBILE but it isn't used in this series.

PM_RMOBILE controls the build of pm-rmobile.c, while the new #ifdefs are in the r8a7740-specific code in pm-r8a7740.c.

Ok, that seems clear.

I object less to !defined(CONFIG_ARCH_MULTIPLATFORM) in pm-r8a7740.c as it is specific to one SoC that doesn't support pm+multilpatform (yet). But it still seems to me that it would be cleaner if either PM_RMOBILE was re-used here or another Kconfig symbol was added.

author maintainer
#5 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 28 lines · Simon Horman
Quoted 18 lines · Geert Uytterhoeven
Quoted 17 lines · Simon Horman
Quoted 15 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

Quoted 8 lines
Quoted 5 lines

I am confused.

I see that in "[PATCH v2 05/05] ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig" you propose adding PM_RMOBILE but it isn't used in this series.

PM_RMOBILE controls the build of pm-rmobile.c, while the new #ifdefs are in the r8a7740-specific code in pm-r8a7740.c.

Quoted 6 lines

Ok, that seems clear.

I object less to !defined(CONFIG_ARCH_MULTIPLATFORM) in pm-r8a7740.c as it is specific to one SoC that doesn't support pm+multilpatform (yet). But it still seems to me that it would be cleaner if either PM_RMOBILE was re-used here or another Kconfig symbol was added.

While I agree about cleaning up code in general I'm not sure if just keep on inventing new Kconfig symbols is the absolute best way forward. =)

If someone can think about how to clean up the PM bits as a separate topic then that would of course be greatly appreciated!

Historically the PM bits have been kind of messy in general, but now we do have PM_RMOBILE which may improve the situation.

The question from my side is more why we would want to postpone multiplatform any further?

Cheers,

/ magnus

#6 lore raw
In reply to Magnus Damm
Quoted 42 lines · Magnus Damm

Hi Simon,

Quoted 28 lines · Simon Horman
Quoted 18 lines · Geert Uytterhoeven
Quoted 17 lines · Simon Horman
Quoted 15 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable r8a7740 Multiplatform support for the generic r8a7740 machine vector. No board support is enabled, and the board code for Armadillo 800 EVA DT Reference is left by itself.

I would still like some discussion of weather using #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) is the best way to go.

It seems to me that it would be cleaner to add a new Kconfig symbol or two.

E.g. CONFIG_RMOBILE_PM which depends on CONFIG_PM and CONFIG_HAS_RMOBILE_PM and then allow SoC or board Kconfig stanzas to select CONFIG_HAS_RMOBILE_PM.

Quoted 8 lines
Quoted 5 lines

I am confused.

I see that in "[PATCH v2 05/05] ARM: shmobile: Cleanup pm-rmobile.o build using Kconfig" you propose adding PM_RMOBILE but it isn't used in this series.

PM_RMOBILE controls the build of pm-rmobile.c, while the new #ifdefs are in the r8a7740-specific code in pm-r8a7740.c.

Quoted 6 lines

Ok, that seems clear.

I object less to !defined(CONFIG_ARCH_MULTIPLATFORM) in pm-r8a7740.c as it is specific to one SoC that doesn't support pm+multilpatform (yet). But it still seems to me that it would be cleaner if either PM_RMOBILE was re-used here or another Kconfig symbol was added.

While I agree about cleaning up code in general I'm not sure if just keep on inventing new Kconfig symbols is the absolute best way forward. =)

Quoted 8 lines

If someone can think about how to clean up the PM bits as a separate topic then that would of course be greatly appreciated!

Historically the PM bits have been kind of messy in general, but now we do have PM_RMOBILE which may improve the situation.

The question from my side is more why we would want to postpone multiplatform any further?

After speaking with Magnus over the phone I now understand and agree with his concern about a potential explosion of Kconfig symbols.

Accordingly I have queued up this series with the understanding that some effort will be made to untangle the Kconfig/ifdef and other mess surrounding PM. And in particular to examine the possibility or re-using PM_RMOBILE in pm-r8a7740.c and other locations.