linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 00/17] ARM: shmobile: r8a7779, marzen: multiplatform
@ 2013-11-25  1:18 Simon Horman
  2013-11-25  1:18 ` [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Simon Horman @ 2013-11-25  1:18 UTC (permalink / raw)
  To: linux-arm-kernel

The aim of this series is to adding common clock framework and in turn
multiplatform support to the r8a7779 SoC and marzen-reference.  It
subsequently removes non-multiplatform support from marzen-reference.  This
last step is provided to illustrate that it can be done, it may not be
desirable to do so for some time.

This is based on work for R-Car Gen2 by Laurent Pinchart and Magnus Damm.

I expect the R-Car Gen2 work in this area to change and
I intend to update this series as necessary.


This series is based on the clocks/ccf/rcar-gen2 branch
of Laurent's fbdev tree. I expect that branch to be rebased/changed,
but it seems to be an adequate base for an RFC.

I have made this series, including its base, available
in the topic/clocks/ccf/r8a7779-marzen branch of my renesas tree.
That branch is likely to be rebased/changed in the future.


Simon Horman (17):
  clk: shmobile: r8a7779: Add clocks support
  clk: shmobile: r8a7779: Add MSTP clock support
  ARM: shmobile: r8a7779: Add clock index macros for DT sources
  ARM: shmobile: r8a7779: Add clocks
  ARM: shmobile: r8a7779: Reference clocks
  ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  ARM: shmobile: r8a7779: Sort headers alphabetically
  ARM: shmobile: r8a7779: Add helper to read mode pins
  ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to
    clock-r8a7779.c
  ARM: shmobile: marzen-reference: Move clock and OF device
    initialisation into board code
  ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h
  ARM: shmobile: r8a7779: Initial multiplatform support
  ARM: shmobile: marzen-reference: Initialize CPG device
  ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and CMT
  ARM: shmobile: Remove non-multiplatform Marzen reference support
  ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  ARM: shmobile: Remove Marzen reference DTS

 .../bindings/clock/renesas,cpg-mstp-clocks.txt     |   1 +
 .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
 arch/arm/boot/dts/Makefile                         |   2 +-
 arch/arm/boot/dts/r8a7779-marzen-reference.dts     | 110 --------------
 arch/arm/boot/dts/r8a7779-marzen.dts               |  82 ++++++++++
 arch/arm/boot/dts/r8a7779.dtsi                     | 132 ++++++++++++++++
 arch/arm/mach-shmobile/Kconfig                     |  21 +--
 arch/arm/mach-shmobile/Makefile                    |   4 +-
 arch/arm/mach-shmobile/Makefile.boot               |   1 -
 arch/arm/mach-shmobile/board-koelsch-reference.c   |   1 +
 arch/arm/mach-shmobile/board-marzen-reference.c    |  44 ++++++
 arch/arm/mach-shmobile/board-marzen.c              |  28 ++--
 arch/arm/mach-shmobile/clock-r8a7779.c             |  22 +--
 arch/arm/mach-shmobile/include/mach/r8a7779.h      |   2 +-
 arch/arm/mach-shmobile/setup-r8a7779.c             |  28 ++--
 drivers/clk/shmobile/Makefile                      |   1 +
 drivers/clk/shmobile/clk-r8a7779.c                 | 166 +++++++++++++++++++++
 include/dt-bindings/clock/r8a7779-clock.h          |  61 ++++++++
 include/linux/clk/shmobile.h                       |   1 +
 19 files changed, 564 insertions(+), 165 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
 delete mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 drivers/clk/shmobile/clk-r8a7779.c
 create mode 100644 include/dt-bindings/clock/r8a7779-clock.h

-- 
1.8.4


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins
@ 2013-11-25  1:18 ` Simon Horman
  2013-11-25 11:53   ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Horman @ 2013-11-25  1:18 UTC (permalink / raw)
  To: linux-sh

Add and use helper to read mode pins.
This will be re-used when moving marzen-reference to
the common clock framework.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
 arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
 arch/arm/mach-shmobile/setup-r8a7779.c        | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index b7ce0e7..decf122 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -25,6 +25,7 @@
 #include <linux/clkdev.h>
 #include <mach/clock.h>
 #include <mach/common.h>
+#include <mach/r8a7779.h>
 
 /*
  *		MD1 = 1			MD1 = 0
@@ -59,9 +60,6 @@
 #define MSTPCR6		IOMEM(0xffc80058)
 #define MSTPCR7		IOMEM(0xffc80040)
 
-#define MODEMR		0xffcc0020
-
-
 /* ioremap() through clock mapping mandatory to avoid
  * collision with ARM coherent DMA virtual memory range.
  */
@@ -213,14 +211,9 @@ static struct clk_lookup lookups[] = {
 
 void __init r8a7779_clock_init(void)
 {
-	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
-	u32 mode;
+	u32 mode = r8a7779_read_mode_pins();
 	int k, ret = 0;
 
-	BUG_ON(!modemr);
-	mode = ioread32(modemr);
-	iounmap(modemr);
-
 	if (mode & MD(1)) {
 		plla_clk.rate = 1500000000;
 
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 5014145..bd66cd82 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -39,6 +39,7 @@ extern void r8a7779_add_early_devices(void);
 extern void r8a7779_add_standard_devices(void);
 extern void r8a7779_add_standard_devices_dt(void);
 extern void r8a7779_init_late(void);
+extern u32 r8a7779_read_mode_pins(void);
 extern void r8a7779_clock_init(void);
 extern void r8a7779_pinmux_init(void);
 extern void r8a7779_pm_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 8f94531..4e3fbfb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -874,6 +874,20 @@ void __init r8a7779_add_standard_devices_dt(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
+#define MODEMR		0xffcc0020
+
+u32 __init r8a7779_read_mode_pins(void)
+{
+	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
+	u32 mode;
+
+	BUG_ON(!modemr);
+	mode = ioread32(modemr);
+	iounmap(modemr);
+
+	return mode;
+}
+
 static const char *r8a7779_compat_dt[] __initdata = {
 	"renesas,r8a7779",
 	NULL,
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC 13/17] ARM: shmobile: marzen-reference: Initialize CPG device
@ 2013-11-25  1:18 ` Simon Horman
  2013-11-25 12:15   ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Horman @ 2013-11-25  1:18 UTC (permalink / raw)
  To: linux-sh

On multiplatform kernels clocks are handled by the CCF CPG driver. It
must be explicitly initialized by a call to rcar_gen2_clocks_init() with
the value of the boot mode pins.

Based on similar work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 782907f..3a7c0fc 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,7 +19,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/clk-provider.h>
+#include <linux/clk/shmobile.h>
+#include <linux/clocksource.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -28,11 +29,17 @@
 #include <asm/mach/arch.h>
 
 
-static void __init marzen_init(void)
+static void __init marzen_init_timer(void)
 {
 #ifdef CONFIG_COMMON_CLK
-	of_clk_init(NULL);
-#else
+	r8a7779_clocks_init(r8a7779_read_mode_pins());
+#endif
+	clocksource_of_init();
+}
+
+static void __init marzen_init(void)
+{
+#ifndef CONFIG_COMMON_CLK
 	r8a7779_clock_init();
 #endif
 	r8a7779_add_standard_devices_dt();
@@ -49,6 +56,7 @@ DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_init_delay,
+	.init_time	= marzen_init_timer,
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= r8a7779_init_irq_dt,
 	.init_machine	= marzen_init,
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-25  1:18 ` Simon Horman
  2013-11-25  6:51   ` Kuninori Morimoto
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Horman @ 2013-11-25  1:18 UTC (permalink / raw)
  To: linux-sh

Now that r8a7779 has CCF support remove the legacy Marzen reference
Kconfig bits CONFIG_MACH_KOELSCH_REFERENCE for the non-multiplatform
case.

Starting from this commit Marzen board support is always enabled via
CONFIG_MACH_KOELSCH, and CONFIG_ARCH_MULTIPLATFORM is used to select
between board-koelsch.c and board-koelsch-reference.c

The file board-koelsch-reference.c can no longer be used together with
the legacy sh-clk clock framework, instead CCF is used.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile           |  1 -
 arch/arm/mach-shmobile/Kconfig       | 13 -------------
 arch/arm/mach-shmobile/Makefile      |  3 +--
 arch/arm/mach-shmobile/Makefile.boot |  1 -
 4 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 723fe71..166e3dd 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -205,7 +205,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7740-armadillo800eva-reference.dtb \
 	r8a7779-marzen.dtb \
-	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch.dtb \
 	r8a7791-koelsch-reference.dtb \
 	r8a7790-lager.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4216baa..a27d60c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -239,19 +239,6 @@ config MACH_MARZEN
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select USE_OF
 
-config MACH_MARZEN_REFERENCE
-	bool "MARZEN board - Reference Device Tree Implementation"
-	depends on ARCH_R8A7779
-	select ARCH_REQUIRE_GPIOLIB
-	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select USE_OF
-	---help---
-	   Use reference implementation of Marzen board support
-	   which makes use of device tree at the expense
-	   of not supporting a number of devices.
-
-	   This is intended to aid developers
-
 config MACH_LAGER
 	bool "Lager board"
 	depends on ARCH_R8A7790
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 6d75ae8..6a04c70 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -69,8 +69,7 @@ obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
 obj-$(CONFIG_MACH_GENMAI)	+= board-genmai.o
 obj-$(CONFIG_MACH_GENMAI_REFERENCE)	+= board-genmai-reference.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
-obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
-obj-$(CONFIG_MACH_LAGER)	+= board-lager.o
+obj-$(CONFIG_MACH_LAGER)	+= boardo-lager.o
 obj-$(CONFIG_MACH_LAGER_REFERENCE)	+= board-lager-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)	+= board-armadillo800eva-reference.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 759e4f8f..6f761b4 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -16,7 +16,6 @@ loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
 loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
-loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
 
 __ZRELADDR	:= $(sort $(loadaddr-y))
    zreladdr-y   += $(__ZRELADDR)
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
@ 2013-11-25  1:18 ` Simon Horman
  2013-11-25  6:56   ` Kuninori Morimoto
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Horman @ 2013-11-25  1:18 UTC (permalink / raw)
  To: linux-sh

Let the multiplatform Marzen support boot with the legacy DTS for
Marzen as well as the Marzen reference DTS.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                       | 2 +-
 arch/arm/mach-shmobile/board-koelsch-reference.c | 1 +
 arch/arm/mach-shmobile/board-marzen-reference.c  | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 166e3dd..2812344 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -216,7 +216,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
-	r8a7779-marzen-reference.dtb \
+	r8a7779-marzen.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 25b558f..daad66a 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -38,6 +38,7 @@ static void __init koelsch_add_standard_devices(void)
 }
 
 static const char * const koelsch_boards_compat_dt[] __initconst = {
+	"renesas,koelsch",
 	"renesas,koelsch-reference",
 	NULL,
 };
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 7a240e5..2d60798 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -74,6 +74,7 @@ static void __init marzen_init(void)
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen",
 	"renesas,marzen-reference",
 	NULL,
 };
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [RFC 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-25  1:18 ` [RFC 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
@ 2013-11-25  6:51   ` Kuninori Morimoto
  2013-11-26  0:26     ` Simon Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Kuninori Morimoto @ 2013-11-25  6:51 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Simon

> Now that r8a7779 has CCF support remove the legacy Marzen reference
> Kconfig bits CONFIG_MACH_KOELSCH_REFERENCE for the non-multiplatform
> case.

I guess

 - CONFIG_MACH_KOELSCH_REFERENCE
 + CONFIG_MACH_MARZEN_REFERENCE

> Starting from this commit Marzen board support is always enabled via
> CONFIG_MACH_KOELSCH, and CONFIG_ARCH_MULTIPLATFORM is used to select

ditto ?

> between board-koelsch.c and board-koelsch-reference.c
> The file board-koelsch-reference.c can no longer be used together with

koelsch <-> marzen ?

> --- a/arch/arm/mach-shmobile/Makefile
> +++ b/arch/arm/mach-shmobile/Makefile
> @@ -69,8 +69,7 @@ obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
>  obj-$(CONFIG_MACH_GENMAI)	+= board-genmai.o
>  obj-$(CONFIG_MACH_GENMAI_REFERENCE)	+= board-genmai-reference.o
>  obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
> -obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
> -obj-$(CONFIG_MACH_LAGER)	+= board-lager.o
> +obj-$(CONFIG_MACH_LAGER)	+= boardo-lager.o

boardo-lager ??
     ^

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  2013-11-25  1:18 ` [RFC 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
@ 2013-11-25  6:56   ` Kuninori Morimoto
  2013-11-26  0:27     ` Simon Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Kuninori Morimoto @ 2013-11-25  6:56 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Simon

> Let the multiplatform Marzen support boot with the legacy DTS for
> Marzen as well as the Marzen reference DTS.
> 
> Based on work for the Koelsch board by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
(snip)
> --- a/arch/arm/mach-shmobile/board-koelsch-reference.c
> +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
> @@ -38,6 +38,7 @@ static void __init koelsch_add_standard_devices(void)
>  }
>  
>  static const char * const koelsch_boards_compat_dt[] __initconst = {
> +	"renesas,koelsch",
>  	"renesas,koelsch-reference",
>  	NULL,
>  };

You are modifying koelsch file in marzen patch ?


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins
  2013-11-25  1:18 ` [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
@ 2013-11-25 11:53   ` Sergei Shtylyov
  2013-11-26  0:34     ` Simon Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2013-11-25 11:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 25-11-2013 5:18, Simon Horman wrote:

> Add and use helper to read mode pins.
> This will be re-used when moving marzen-reference to
> the common clock framework.

> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
>   arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
>   arch/arm/mach-shmobile/setup-r8a7779.c        | 14 ++++++++++++++
>   3 files changed, 17 insertions(+), 9 deletions(-)

> diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
> index b7ce0e7..decf122 100644
> --- a/arch/arm/mach-shmobile/clock-r8a7779.c
> +++ b/arch/arm/mach-shmobile/clock-r8a7779.c
[...]
> diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
> index 8f94531..4e3fbfb 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7779.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7779.c
> @@ -874,6 +874,20 @@ void __init r8a7779_add_standard_devices_dt(void)
>   	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>   }
>
> +#define MODEMR		0xffcc0020
> +
> +u32 __init r8a7779_read_mode_pins(void)
> +{
> +	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);

    Why waste 2 4K pages if you're only interested in 4 bytes (i.e. 1 page)? I 
remember I've already asked that question...

> +	u32 mode;
> +
> +	BUG_ON(!modemr);
> +	mode = ioread32(modemr);
> +	iounmap(modemr);
> +
> +	return mode;
> +}
> +

WBR, Sergei


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 13/17] ARM: shmobile: marzen-reference: Initialize CPG device
  2013-11-25  1:18 ` [RFC 13/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
@ 2013-11-25 12:15   ` Sergei Shtylyov
  2013-11-26  0:35     ` Simon Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2013-11-25 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 25-11-2013 5:18, Simon Horman wrote:

> On multiplatform kernels clocks are handled by the CCF CPG driver. It
> must be explicitly initialized by a call to rcar_gen2_clocks_init() with

    You meant r8a7779_clocks_init() instead?

> the value of the boot mode pins.

> Based on similar work for the Koelsch board by Laurent Pinchart.

> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/board-marzen-reference.c | 16 ++++++++++++----
>   1 file changed, 12 insertions(+), 4 deletions(-)

> diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
> index 782907f..3a7c0fc 100644
> --- a/arch/arm/mach-shmobile/board-marzen-reference.c
> +++ b/arch/arm/mach-shmobile/board-marzen-reference.c
[...]
> @@ -28,11 +29,17 @@
>   #include <asm/mach/arch.h>
>
>
> -static void __init marzen_init(void)
> +static void __init marzen_init_timer(void)
>   {
>   #ifdef CONFIG_COMMON_CLK
> -	of_clk_init(NULL);
> -#else
> +	r8a7779_clocks_init(r8a7779_read_mode_pins());
> +#endif
> +	clocksource_of_init();
> +}
> +
> +static void __init marzen_init(void)
> +{
> +#ifndef CONFIG_COMMON_CLK
>   	r8a7779_clock_init();
>   #endif
>   	r8a7779_add_standard_devices_dt();

WBR, Sergei


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-25  6:51   ` Kuninori Morimoto
@ 2013-11-26  0:26     ` Simon Horman
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2013-11-26  0:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Nov 24, 2013 at 10:51:33PM -0800, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > Now that r8a7779 has CCF support remove the legacy Marzen reference
> > Kconfig bits CONFIG_MACH_KOELSCH_REFERENCE for the non-multiplatform
> > case.
> 
> I guess
> 
>  - CONFIG_MACH_KOELSCH_REFERENCE
>  + CONFIG_MACH_MARZEN_REFERENCE
> 
> > Starting from this commit Marzen board support is always enabled via
> > CONFIG_MACH_KOELSCH, and CONFIG_ARCH_MULTIPLATFORM is used to select
> 
> ditto ?
> 
> > between board-koelsch.c and board-koelsch-reference.c
> > The file board-koelsch-reference.c can no longer be used together with
> 
> koelsch <-> marzen ?
> 
> > --- a/arch/arm/mach-shmobile/Makefile
> > +++ b/arch/arm/mach-shmobile/Makefile
> > @@ -69,8 +69,7 @@ obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
> >  obj-$(CONFIG_MACH_GENMAI)	+= board-genmai.o
> >  obj-$(CONFIG_MACH_GENMAI_REFERENCE)	+= board-genmai-reference.o
> >  obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
> > -obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
> > -obj-$(CONFIG_MACH_LAGER)	+= board-lager.o
> > +obj-$(CONFIG_MACH_LAGER)	+= boardo-lager.o
> 
> boardo-lager ??

Thanks. Sorry for the silly errors.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  2013-11-25  6:56   ` Kuninori Morimoto
@ 2013-11-26  0:27     ` Simon Horman
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2013-11-26  0:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Nov 24, 2013 at 10:56:19PM -0800, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > Let the multiplatform Marzen support boot with the legacy DTS for
> > Marzen as well as the Marzen reference DTS.
> > 
> > Based on work for the Koelsch board by Laurent Pinchart.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> (snip)
> > --- a/arch/arm/mach-shmobile/board-koelsch-reference.c
> > +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
> > @@ -38,6 +38,7 @@ static void __init koelsch_add_standard_devices(void)
> >  }
> >  
> >  static const char * const koelsch_boards_compat_dt[] __initconst = {
> > +	"renesas,koelsch",
> >  	"renesas,koelsch-reference",
> >  	NULL,
> >  };
> 
> You are modifying koelsch file in marzen patch ?

Sorry, my mistake. I'll fix that.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins
  2013-11-25 11:53   ` Sergei Shtylyov
@ 2013-11-26  0:34     ` Simon Horman
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2013-11-26  0:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 25, 2013 at 03:53:25PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 25-11-2013 5:18, Simon Horman wrote:
> 
> >Add and use helper to read mode pins.
> >This will be re-used when moving marzen-reference to
> >the common clock framework.
> 
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
> >  arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
> >  arch/arm/mach-shmobile/setup-r8a7779.c        | 14 ++++++++++++++
> >  3 files changed, 17 insertions(+), 9 deletions(-)
> 
> >diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
> >index b7ce0e7..decf122 100644
> >--- a/arch/arm/mach-shmobile/clock-r8a7779.c
> >+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
> [...]
> >diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
> >index 8f94531..4e3fbfb 100644
> >--- a/arch/arm/mach-shmobile/setup-r8a7779.c
> >+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
> >@@ -874,6 +874,20 @@ void __init r8a7779_add_standard_devices_dt(void)
> >  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> >  }
> >
> >+#define MODEMR		0xffcc0020
> >+
> >+u32 __init r8a7779_read_mode_pins(void)
> >+{
> >+	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
> 
>    Why waste 2 4K pages if you're only interested in 4 bytes (i.e. 1
> page)? I remember I've already asked that question...

I don't recall if there was a conclusion to that discussion.

In any case, this patch just shuffles code around.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC 13/17] ARM: shmobile: marzen-reference: Initialize CPG device
  2013-11-25 12:15   ` Sergei Shtylyov
@ 2013-11-26  0:35     ` Simon Horman
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2013-11-26  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 25, 2013 at 04:15:28PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 25-11-2013 5:18, Simon Horman wrote:
> 
> >On multiplatform kernels clocks are handled by the CCF CPG driver. It
> >must be explicitly initialized by a call to rcar_gen2_clocks_init() with
> 
>    You meant r8a7779_clocks_init() instead?

Yes, thanks. I will fix that.

> 
> >the value of the boot mode pins.
> 
> >Based on similar work for the Koelsch board by Laurent Pinchart.
> 
> >Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/board-marzen-reference.c | 16 ++++++++++++----
> >  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> >diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
> >index 782907f..3a7c0fc 100644
> >--- a/arch/arm/mach-shmobile/board-marzen-reference.c
> >+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
> [...]
> >@@ -28,11 +29,17 @@
> >  #include <asm/mach/arch.h>
> >
> >
> >-static void __init marzen_init(void)
> >+static void __init marzen_init_timer(void)
> >  {
> >  #ifdef CONFIG_COMMON_CLK
> >-	of_clk_init(NULL);
> >-#else
> >+	r8a7779_clocks_init(r8a7779_read_mode_pins());
> >+#endif
> >+	clocksource_of_init();
> >+}
> >+
> >+static void __init marzen_init(void)
> >+{
> >+#ifndef CONFIG_COMMON_CLK
> >  	r8a7779_clock_init();
> >  #endif
> >  	r8a7779_add_standard_devices_dt();
> 
> WBR, Sergei
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-11-26  0:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-25  1:18 [RFC 00/17] ARM: shmobile: r8a7779, marzen: multiplatform Simon Horman
2013-11-25  1:18 ` [RFC 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
2013-11-25 11:53   ` Sergei Shtylyov
2013-11-26  0:34     ` Simon Horman
2013-11-25  1:18 ` [RFC 13/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
2013-11-25 12:15   ` Sergei Shtylyov
2013-11-26  0:35     ` Simon Horman
2013-11-25  1:18 ` [RFC 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
2013-11-25  6:51   ` Kuninori Morimoto
2013-11-26  0:26     ` Simon Horman
2013-11-25  1:18 ` [RFC 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
2013-11-25  6:56   ` Kuninori Morimoto
2013-11-26  0:27     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).