linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2
@ 2015-09-17  9:53 Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding Magnus Damm
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

clocksource: sh_cmt: DT binding rework V2

[PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding
[PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case
[PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings
[PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1
[PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings
[PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS
[PATCH v2 07/11] devicetree: bindings: Deprecate property, update example
[PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS
[PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
[PATCH v2 10/11] clocksource: sh_cmt: Remove unused 32-bit CMT bindings
[PATCH v2 11/11] devicetree: bindings: Remove deprecated properties

This series reworks the CMT DT bindings to try to deal with the following:
- R-Car Gen2 CMT0 and CMT1 hardware instances are not identical
- The property renesas,channels-mask is not enough to describe the difference
- DT should describe the hardware, not the software implementation
- Not all documented DT bindings are actually used

Without these patches the binding "renesas,cmt-48-gen2" is used for both
CMT0 and CMT1 on R-Car Gen2 SoCs. CMT0 and CMT1 are currently seen by the
Linux device driver as compatible hardware, and the device-specific property
"renesas,channels-mask" is used to point out some of the hardware configuration
differences. Since the driver is not feature complete only some differences are
described and when diving into the data sheet we can see that:

1) CMT0 is not 48-bit at all, instead it only supports 32-bit counters.
2) Some channels of CMT1 are 48-bit, some 32-bit.
3) A couple of CMT1 channels have even more features.

It turns out that none of the above differences are described in our current
DT files. And since we use the same compat string for CMT0 and CMT1 the driver
itself cannot enable features specific only to CMT1 without first updating
the DTS. So this series is ground work for future feature patches.

It seems that we have two choices if we want to support CMT1 features:
A) Keep existing DT bindings, add more properties for CMT1
B) Rework the compatible strings and keep configuration in the driver

Judging by above it seems that DT update is inevitable. In my mind it is
rather painful to update the DT so I'd like to minimize the number of
updates and let the majority of the changes only happen in the driver.
And since we should really describe hardware in DT but driver features tend
to be implemented incrementally then B) seems like a good fit to me.

I wouldn't mind going with A) but to be honest I must say that the existing
compat string "renesas,cmt-48-gen2" is just too confusing with "48"
(when CMT0 is 32bit-only) and also "gen2" (used without product line R-Car).

Because of that I've gone with B) and reworked the bindings to separate
CMT0 from CMT1 and keep channel configuration in the device driver.

While at it I've deprecated "renesas,channels-mask" and the old DT compat
strings. Per-SoC compat strings have also been reworked, but are not left
around documented as deprecated since they were never used by the driver.

Comments are very welcome! If all are in favor then it would be good to
merge patch 1-5 first and patch 6-8 later once 1-5 are in. Old DTBs are
left working but treated as low-feature CMT0. New DTBs including patch 6
will not work on old kernels.

V2 patch series fixes patch 1-2 and adds patches 9, 10, 11.
Patch 9 and 10 cleans up r8a7740 and sh73a0 bindings.
Patch 11 removes deprecated properties as proposed by Laurent.

Many thanks to Geert and Laurent for feedback!

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> (For patch 1-8)
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> (For patch 1-8)
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> (For patch 1-7)
---

 Written against renesas-drivers-2015-09-15-v4.3-rc1

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |   85 ++++++---------
 arch/arm/boot/dts/r8a73a4.dtsi                          |    5 
 arch/arm/boot/dts/r8a7740.dtsi                          |    3 
 arch/arm/boot/dts/r8a7790.dtsi                          |   10 -
 arch/arm/boot/dts/r8a7791.dtsi                          |   10 -
 arch/arm/boot/dts/r8a7793.dtsi                          |   10 -
 arch/arm/boot/dts/r8a7794.dtsi                          |   10 -
 arch/arm/boot/dts/sh73a0.dtsi                           |    3 
 drivers/clocksource/sh_cmt.c                            |   54 ++++++---
 9 files changed, 85 insertions(+), 105 deletions(-)

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

* [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
@ 2015-09-17  9:53 ` Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case Magnus Damm
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Remove the sh7372 CMT compat string to reduce maintenance burden.

It should be fine to break DT compatibility because:
1) The sh7372 SoC support has been removed from upstream
2) The sh7372 CMT DT binding was never part of upstream DTS
3) The CMT driver never matches on the sh7372 binding

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Removed all references to sh7372
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

--- 0001/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 17:22:52.420513000 +0900
@@ -14,32 +14,26 @@ Required Properties:
   - compatible: must contain one or more of the following:
     - "renesas,cmt-32-r8a7740" for the r8a7740 32-bit CMT
 		(CMT0)
-    - "renesas,cmt-32-sh7372" for the sh7372 32-bit CMT
-		(CMT0)
     - "renesas,cmt-32-sh73a0" for the sh73a0 32-bit CMT
 		(CMT0)
     - "renesas,cmt-32" for all 32-bit CMT without fast clock support
-		(CMT0 on sh7372, sh73a0 and r8a7740)
+		(CMT0 on sh73a0 and r8a7740)
 		This is a fallback for the above renesas,cmt-32-* entries.
 
     - "renesas,cmt-32-fast-r8a7740" for the r8a7740 32-bit CMT with fast
 		clock support (CMT[234])
-    - "renesas,cmt-32-fast-sh7372" for the sh7372 32-bit CMT with fast
-		clock support (CMT[234])
     - "renesas,cmt-32-fast-sh73a0" for the sh73A0 32-bit CMT with fast
 		clock support (CMT[234])
     - "renesas,cmt-32-fast" for all 32-bit CMT with fast clock support
-		(CMT[234] on sh7372, sh73a0 and r8a7740)
+		(CMT[234] on sh73a0 and r8a7740)
 		This is a fallback for the above renesas,cmt-32-fast-* entries.
 
-    - "renesas,cmt-48-sh7372" for the sh7372 48-bit CMT
-		(CMT1)
     - "renesas,cmt-48-sh73a0" for the sh73A0 48-bit CMT
 		(CMT1)
     - "renesas,cmt-48-r8a7740" for the r8a7740 48-bit CMT
 		(CMT1)
     - "renesas,cmt-48" for all non-second generation 48-bit CMT
-		(CMT1 on sh7372, sh73a0 and r8a7740)
+		(CMT1 on sh73a0 and r8a7740)
 		This is a fallback for the above renesas,cmt-48-* entries.
 
     - "renesas,cmt-48-r8a73a4" for the r8a73a4 48-bit CMT

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

* [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding Magnus Damm
@ 2015-09-17  9:53 ` Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings Magnus Damm
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Always use 0x3f as channel mask for the SH_CMT_48BIT type of devices.
Once this patch is applied the "renesas,channels-mask" property will
be ignored by the driver for older devices matching SH_CMT_48BIT. In
the future when all CMT types store channel mask in the driver then
we will be able to deprecate and remove "renesas,channels-mask" from DTS.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Fixed compile error - thanks Geert!
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

drivers/clocksource/sh_cmt.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- 0001/drivers/clocksource/sh_cmt.c
+++ work/drivers/clocksource/sh_cmt.c	2015-09-17 17:25:15.820513000 +0900
@@ -74,6 +74,8 @@ enum sh_cmt_model {
 struct sh_cmt_info {
 	enum sh_cmt_model model;
 
+	unsigned long channels_mask;
+
 	unsigned long width; /* 16 or 32 bit version of hardware block */
 	unsigned long overflow_bit;
 	unsigned long clear_bits;
@@ -212,6 +214,7 @@ static const struct sh_cmt_info sh_cmt_i
 	},
 	[SH_CMT_48BIT] = {
 		.model = SH_CMT_48BIT,
+		.channels_mask = 0x3f,
 		.width = 32,
 		.overflow_bit = SH_CMT32_CMCSR_CMF,
 		.clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF),
@@ -972,9 +975,14 @@ static int sh_cmt_setup(struct sh_cmt_de
 		id = of_match_node(sh_cmt_of_table, pdev->dev.of_node);
 		cmt->info = id->data;
 
-		ret = sh_cmt_parse_dt(cmt);
-		if (ret < 0)
-			return ret;
+		/* prefer in-driver channel configuration over DT */
+		if (cmt->info->channels_mask) {
+			cmt->hw_channels = cmt->info->channels_mask;
+		} else {
+			ret = sh_cmt_parse_dt(cmt);
+			if (ret < 0)
+				return ret;
+		}
 	} else if (pdev->dev.platform_data) {
 		struct sh_timer_config *cfg = pdev->dev.platform_data;
 		const struct platform_device_id *id = pdev->id_entry;

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

* [PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding Magnus Damm
  2015-09-17  9:53 ` [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case Magnus Damm
@ 2015-09-17  9:53 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1 Magnus Damm
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Add documentation for new separate CMT0 and CMT1 DT compatible strings
for R-Car Gen2. These compat strings allow us to enable CMT1-specific
features in the driver. The old compat strings will be deprecated in
the not so distant future.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |    3 +++
 1 file changed, 3 insertions(+)

--- 0002/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 17:26:57.440513000 +0900
@@ -36,6 +36,9 @@ Required Properties:
 		(CMT1 on sh73a0 and r8a7740)
 		This is a fallback for the above renesas,cmt-48-* entries.
 
+    - "renesas,cmt0-rcar-gen2" for 32-bit CMT0 devices included in R-Car Gen2.
+    - "renesas,cmt1-rcar-gen2" for 48-bit CMT1 devices included in R-Car Gen2.
+
     - "renesas,cmt-48-r8a73a4" for the r8a73a4 48-bit CMT
 		(CMT[01])
     - "renesas,cmt-48-r8a7790" for the r8a7790 48-bit CMT

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

* [PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (2 preceding siblings ...)
  2015-09-17  9:53 ` [PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings Magnus Damm
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Add support for the new R-Car Gen2 CMT0 and CMT1 bindings. Support
for the old DT binding is still kept around, however devices using
such binding will be treated as a low-feature CMT0 device. If users
want to make use of CMT1-specific features then they need to update
their DTBs. No special CMT1-specific features are however implemented
by his patch, only DT bindings are redone as groundwork for future
feature patches.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 drivers/clocksource/sh_cmt.c |   38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

--- 0003/drivers/clocksource/sh_cmt.c
+++ work/drivers/clocksource/sh_cmt.c	2015-09-17 17:28:33.380513000 +0900
@@ -39,16 +39,16 @@ struct sh_cmt_device;
  * SoC but also on the particular instance. The following table lists the main
  * characteristics of those flavours.
  *
- *			16B	32B	32B-F	48B	48B-2
+ *			16B	32B	32B-F	48B	R-Car Gen2
  * -----------------------------------------------------------------------------
  * Channels		2	1/4	1	6	2/8
  * Control Width	16	16	16	16	32
  * Counter Width	16	32	32	32/48	32/48
  * Shared Start/Stop	Y	Y	Y	Y	N
  *
- * The 48-bit gen2 version has a per-channel start/stop register located in the
- * channel registers block. All other versions have a shared start/stop register
- * located in the global space.
+ * The r8a73a4 / R-Car Gen2 version has a per-channel start/stop register
+ * located in the channel registers block. All other versions have a shared
+ * start/stop register located in the global space.
  *
  * Channels are indexed from 0 to N-1 in the documentation. The channel index
  * infers the start/stop bit position in the control register and the channel
@@ -68,7 +68,8 @@ enum sh_cmt_model {
 	SH_CMT_32BIT,
 	SH_CMT_32BIT_FAST,
 	SH_CMT_48BIT,
-	SH_CMT_48BIT_GEN2,
+	SH_CMT0_RCAR_GEN2,
+	SH_CMT1_RCAR_GEN2,
 };
 
 struct sh_cmt_info {
@@ -223,8 +224,20 @@ static const struct sh_cmt_info sh_cmt_i
 		.read_count = sh_cmt_read32,
 		.write_count = sh_cmt_write32,
 	},
-	[SH_CMT_48BIT_GEN2] = {
-		.model = SH_CMT_48BIT_GEN2,
+	[SH_CMT0_RCAR_GEN2] = {
+		.model = SH_CMT0_RCAR_GEN2,
+		.channels_mask = 0x60,
+		.width = 32,
+		.overflow_bit = SH_CMT32_CMCSR_CMF,
+		.clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF),
+		.read_control = sh_cmt_read32,
+		.write_control = sh_cmt_write32,
+		.read_count = sh_cmt_read32,
+		.write_count = sh_cmt_write32,
+	},
+	[SH_CMT1_RCAR_GEN2] = {
+		.model = SH_CMT1_RCAR_GEN2,
+		.channels_mask = 0xff,
 		.width = 32,
 		.overflow_bit = SH_CMT32_CMCSR_CMF,
 		.clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF),
@@ -867,6 +880,7 @@ static int sh_cmt_setup_channel(struct s
 	ch->cmt = cmt;
 	ch->index = index;
 	ch->hwidx = hwidx;
+	ch->timer_bit = hwidx;
 
 	/*
 	 * Compute the address of the channel control register block. For the
@@ -888,9 +902,11 @@ static int sh_cmt_setup_channel(struct s
 		 */
 		ch->ioctrl = cmt->mapbase + 0x40;
 		break;
-	case SH_CMT_48BIT_GEN2:
+	case SH_CMT0_RCAR_GEN2:
+	case SH_CMT1_RCAR_GEN2:
 		ch->iostart = cmt->mapbase + ch->hwidx * 0x100;
 		ch->ioctrl = ch->iostart + 0x10;
+		ch->timer_bit = 0;
 		break;
 	}
 
@@ -902,8 +918,6 @@ static int sh_cmt_setup_channel(struct s
 	ch->match_value = ch->max_match_value;
 	raw_spin_lock_init(&ch->lock);
 
-	ch->timer_bit = cmt->info->model == SH_CMT_48BIT_GEN2 ? 0 : ch->hwidx;
-
 	ret = sh_cmt_register(ch, dev_name(&cmt->pdev->dev),
 			      clockevent, clocksource);
 	if (ret) {
@@ -946,7 +960,9 @@ static const struct of_device_id sh_cmt_
 	{ .compatible = "renesas,cmt-32", .data = &sh_cmt_info[SH_CMT_32BIT] },
 	{ .compatible = "renesas,cmt-32-fast", .data = &sh_cmt_info[SH_CMT_32BIT_FAST] },
 	{ .compatible = "renesas,cmt-48", .data = &sh_cmt_info[SH_CMT_48BIT] },
-	{ .compatible = "renesas,cmt-48-gen2", .data = &sh_cmt_info[SH_CMT_48BIT_GEN2] },
+	{ .compatible = "renesas,cmt-48-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
+	{ .compatible = "renesas,cmt0-rcar-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
+	{ .compatible = "renesas,cmt1-rcar-gen2", .data = &sh_cmt_info[SH_CMT1_RCAR_GEN2] },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sh_cmt_of_table);

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

* [PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (3 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1 Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS Magnus Damm
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Update SoC-specific bindings for r8a73a4 and R-Car Gen2 CMT0 and CMT1.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |   26 ++++++++-------
 1 file changed, 15 insertions(+), 11 deletions(-)

--- 0005/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 17:31:02.650513000 +0900
@@ -36,20 +36,24 @@ Required Properties:
 		(CMT1 on sh73a0 and r8a7740)
 		This is a fallback for the above renesas,cmt-48-* entries.
 
+    - "renesas,cmt0-r8a73a4" for the 32-bit CMT0 device included in r8a73a4.
+    - "renesas,cmt1-r8a73a4" for the 48-bit CMT1 device included in r8a73a4.
+    - "renesas,cmt0-r8a7790" for the 32-bit CMT0 device included in r8a7790.
+    - "renesas,cmt1-r8a7790" for the 48-bit CMT1 device included in r8a7790.
+    - "renesas,cmt0-r8a7791" for the 32-bit CMT0 device included in r8a7791.
+    - "renesas,cmt1-r8a7791" for the 48-bit CMT1 device included in r8a7791.
+    - "renesas,cmt0-r8a7793" for the 32-bit CMT0 device included in r8a7793.
+    - "renesas,cmt1-r8a7793" for the 48-bit CMT1 device included in r8a7793.
+    - "renesas,cmt0-r8a7794" for the 32-bit CMT0 device included in r8a7794.
+    - "renesas,cmt1-r8a7794" for the 48-bit CMT1 device included in r8a7794.
+
     - "renesas,cmt0-rcar-gen2" for 32-bit CMT0 devices included in R-Car Gen2.
     - "renesas,cmt1-rcar-gen2" for 48-bit CMT1 devices included in R-Car Gen2.
+		These are fallbacks for r8a73a4 and all the R-Car Gen2
+		entries	listed above.
 
-    - "renesas,cmt-48-r8a73a4" for the r8a73a4 48-bit CMT
-		(CMT[01])
-    - "renesas,cmt-48-r8a7790" for the r8a7790 48-bit CMT
-		(CMT[01])
-    - "renesas,cmt-48-r8a7791" for the r8a7791 48-bit CMT
-		(CMT[01])
-    - "renesas,cmt-48-gen2" for all second generation 48-bit CMT
-		(CMT[01] on r8a73a4, r8a7790 and r8a7791)
-		This is a fallback for the renesas,cmt-48-r8a73a4,
-		renesas,cmt-48-r8a7790 and renesas,cmt-48-r8a7791 entries.
-
+    - "renesas,cmt-48-gen2" is <deprecated>, use "renesas,cmt[01]-*" instead.
+    
   - reg: base address and length of the registers block for the timer module.
   - interrupts: interrupt-specifier for the timer, one per channel.
   - clocks: a list of phandle + clock-specifier pairs, one for each entry

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

* [PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (4 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 07/11] devicetree: bindings: Deprecate property, update example Magnus Damm
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Use recently updated r8a73a4 and R-Car Gen2 CMT0 and CMT1 compat strings.

With this change in place we can keep device-specific configuration in
the driver and the driver can be able to support CMT1 specific features.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 arch/arm/boot/dts/r8a73a4.dtsi |    2 +-
 arch/arm/boot/dts/r8a7790.dtsi |    4 ++--
 arch/arm/boot/dts/r8a7791.dtsi |    4 ++--
 arch/arm/boot/dts/r8a7793.dtsi |    4 ++--
 arch/arm/boot/dts/r8a7794.dtsi |    4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

--- 0001/arch/arm/boot/dts/r8a73a4.dtsi
+++ work/arch/arm/boot/dts/r8a73a4.dtsi	2015-09-17 17:35:37.230513000 +0900
@@ -114,7 +114,7 @@
 	};
 
 	cmt1: timer@e6130000 {
-		compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt1-r8a73a4", "renesas,cmt1-rcar-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
 		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
--- 0001/arch/arm/boot/dts/r8a7790.dtsi
+++ work/arch/arm/boot/dts/r8a7790.dtsi	2015-09-17 17:35:37.230513000 +0900
@@ -219,7 +219,7 @@
 	};
 
 	cmt0: timer@ffca0000 {
-		compatible = "renesas,cmt-48-r8a7790", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt0-r8a7790", "renesas,cmt0-rcar-gen2";
 		reg = <0 0xffca0000 0 0x1004>;
 		interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 143 IRQ_TYPE_LEVEL_HIGH>;
@@ -233,7 +233,7 @@
 	};
 
 	cmt1: timer@e6130000 {
-		compatible = "renesas,cmt-48-r8a7790", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt1-r8a7790", "renesas,cmt1-rcar-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
 		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 121 IRQ_TYPE_LEVEL_HIGH>,
--- 0001/arch/arm/boot/dts/r8a7791.dtsi
+++ work/arch/arm/boot/dts/r8a7791.dtsi	2015-09-17 17:35:37.230513000 +0900
@@ -202,7 +202,7 @@
 	};
 
 	cmt0: timer@ffca0000 {
-		compatible = "renesas,cmt-48-r8a7791", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt0-r8a7791", "renesas,cmt0-rcar-gen2";
 		reg = <0 0xffca0000 0 0x1004>;
 		interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 143 IRQ_TYPE_LEVEL_HIGH>;
@@ -216,7 +216,7 @@
 	};
 
 	cmt1: timer@e6130000 {
-		compatible = "renesas,cmt-48-r8a7791", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt1-r8a7791", "renesas,cmt1-rcar-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
 		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 121 IRQ_TYPE_LEVEL_HIGH>,
--- 0001/arch/arm/boot/dts/r8a7793.dtsi
+++ work/arch/arm/boot/dts/r8a7793.dtsi	2015-09-17 17:35:37.230513000 +0900
@@ -62,7 +62,7 @@
 	};
 
 	cmt0: timer@ffca0000 {
-		compatible = "renesas,cmt-48-r8a7793", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt0-r8a7793", "renesas,cmt0-rcar-gen2";
 		reg = <0 0xffca0000 0 0x1004>;
 		interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 143 IRQ_TYPE_LEVEL_HIGH>;
@@ -76,7 +76,7 @@
 	};
 
 	cmt1: timer@e6130000 {
-		compatible = "renesas,cmt-48-r8a7793", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt1-r8a7793", "renesas,cmt1-rcar-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
 		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 121 IRQ_TYPE_LEVEL_HIGH>,
--- 0001/arch/arm/boot/dts/r8a7794.dtsi
+++ work/arch/arm/boot/dts/r8a7794.dtsi	2015-09-17 17:35:37.230513000 +0900
@@ -154,7 +154,7 @@
 	};
 
 	cmt0: timer@ffca0000 {
-		compatible = "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt0-r8a7794", "renesas,cmt0-rcar-gen2";
 		reg = <0 0xffca0000 0 0x1004>;
 		interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 143 IRQ_TYPE_LEVEL_HIGH>;
@@ -168,7 +168,7 @@
 	};
 
 	cmt1: timer@e6130000 {
-		compatible = "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt1-r8a7794", "renesas,cmt1-rcar-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
 		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 121 IRQ_TYPE_LEVEL_HIGH>,

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

* [PATCH v2 07/11] devicetree: bindings: Deprecate property, update example
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (5 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS Magnus Damm
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Deprecate "renesas,channels-mask" and update the r8a7790 CMT example.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---

 Changes since V1:
 - Added Acked-by and Tested-by from Geert
 - Added Acked-by from Laurent

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |   24 ++++++++++-----
 1 file changed, 17 insertions(+), 7 deletions(-)

--- 0009/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 17:39:47.080513000 +0900
@@ -60,21 +60,31 @@ Required Properties:
     in clock-names.
   - clock-names: must contain "fck" for the functional clock.
 
-  - renesas,channels-mask: bitmask of the available channels.
+  - renesas,channels-mask: <deprecated>, information kept in device driver.
 
 
-Example: R8A7790 (R-Car H2) CMT0 node
-
-	CMT0 on R8A7790 implements hardware channels 5 and 6 only and names
-	them channels 0 and 1 in the documentation.
+Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes
 
 	cmt0: timer@ffca0000 {
-		compatible = "renesas,cmt-48-r8a7790", "renesas,cmt-48-gen2";
+		compatible = "renesas,cmt0-r8a7790", "renesas,cmt0-rcar-gen2";
 		reg = <0 0xffca0000 0 0x1004>;
 		interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
 			     <0 142 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp1_clks R8A7790_CLK_CMT0>;
 		clock-names = "fck";
+	};
 
-		renesas,channels-mask = <0x60>;
+	cmt1: timer@e6130000 {
+		compatible = "renesas,cmt1-r8a7790", "renesas,cmt1-rcar-gen2";
+		reg = <0 0xe6130000 0 0x1004>;
+		interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 121 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 122 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 123 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 124 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 125 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 126 IRQ_TYPE_LEVEL_HIGH>,
+			     <0 127 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7790_CLK_CMT1>;
+		clock-names = "fck";
 	};

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

* [PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (6 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 07/11] devicetree: bindings: Deprecate property, update example Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:54 ` [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings Magnus Damm
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Update the DTS to remove the now deprecated "renesas,channels-mask" property.

The channel information is now kept in the device driver and can easily
be determined based on the compat string.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

 Changes since V1:
 - Rebased on top of power-domain changes
 - Added Acked-by and Tested-by from Geert

 arch/arm/boot/dts/r8a73a4.dtsi |    3 ---
 arch/arm/boot/dts/r8a7740.dtsi |    3 ---
 arch/arm/boot/dts/r8a7790.dtsi |    6 ------
 arch/arm/boot/dts/r8a7791.dtsi |    6 ------
 arch/arm/boot/dts/r8a7793.dtsi |    6 ------
 arch/arm/boot/dts/r8a7794.dtsi |    6 ------
 arch/arm/boot/dts/sh73a0.dtsi  |    3 ---
 7 files changed, 33 deletions(-)

--- 0010/arch/arm/boot/dts/r8a73a4.dtsi
+++ work/arch/arm/boot/dts/r8a73a4.dtsi	2015-09-17 17:41:05.250513000 +0900
@@ -120,9 +120,6 @@
 		clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&pd_c5>;
-
-		renesas,channels-mask = <0xff>;
-
 		status = "disabled";
 	};
 
--- 0001/arch/arm/boot/dts/r8a7740.dtsi
+++ work/arch/arm/boot/dts/r8a7740.dtsi	2015-09-17 17:41:05.250513000 +0900
@@ -60,9 +60,6 @@
 		clocks = <&mstp3_clks R8A7740_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&pd_c5>;
-
-		renesas,channels-mask = <0x3f>;
-
 		status = "disabled";
 	};
 
--- 0010/arch/arm/boot/dts/r8a7790.dtsi
+++ work/arch/arm/boot/dts/r8a7790.dtsi	2015-09-17 17:45:02.110513000 +0900
@@ -226,9 +226,6 @@
 		clocks = <&mstp1_clks R8A7790_CLK_CMT0>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0x60>;
-
 		status = "disabled";
 	};
 
@@ -246,9 +243,6 @@
 		clocks = <&mstp3_clks R8A7790_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0xff>;
-
 		status = "disabled";
 	};
 
--- 0010/arch/arm/boot/dts/r8a7791.dtsi
+++ work/arch/arm/boot/dts/r8a7791.dtsi	2015-09-17 17:44:54.210513000 +0900
@@ -209,9 +209,6 @@
 		clocks = <&mstp1_clks R8A7791_CLK_CMT0>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0x60>;
-
 		status = "disabled";
 	};
 
@@ -229,9 +226,6 @@
 		clocks = <&mstp3_clks R8A7791_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0xff>;
-
 		status = "disabled";
 	};
 
--- 0010/arch/arm/boot/dts/r8a7793.dtsi
+++ work/arch/arm/boot/dts/r8a7793.dtsi	2015-09-17 17:44:48.400513000 +0900
@@ -69,9 +69,6 @@
 		clocks = <&mstp1_clks R8A7793_CLK_CMT0>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0x60>;
-
 		status = "disabled";
 	};
 
@@ -89,9 +86,6 @@
 		clocks = <&mstp3_clks R8A7793_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0xff>;
-
 		status = "disabled";
 	};
 
--- 0010/arch/arm/boot/dts/r8a7794.dtsi
+++ work/arch/arm/boot/dts/r8a7794.dtsi	2015-09-17 17:44:43.300513000 +0900
@@ -161,9 +161,6 @@
 		clocks = <&mstp1_clks R8A7794_CLK_CMT0>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0x60>;
-
 		status = "disabled";
 	};
 
@@ -181,9 +178,6 @@
 		clocks = <&mstp3_clks R8A7794_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&cpg_clocks>;
-
-		renesas,channels-mask = <0xff>;
-
 		status = "disabled";
 	};
 
--- 0001/arch/arm/boot/dts/sh73a0.dtsi
+++ work/arch/arm/boot/dts/sh73a0.dtsi	2015-09-17 17:44:32.950513000 +0900
@@ -84,9 +84,6 @@
 		clocks = <&mstp3_clks SH73A0_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&pd_c5>;
-
-		renesas,channels-mask = <0x3f>;
-
 		status = "disabled";
 	};
 

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

* [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (7 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS Magnus Damm
@ 2015-09-17  9:54 ` Magnus Damm
  2015-09-17  9:59   ` Geert Uytterhoeven
  2015-09-17 12:14   ` Sergei Shtylyov
  2015-09-17  9:55 ` [PATCH v2 10/11] clocksource: sh_cmt: " Magnus Damm
                   ` (2 subsequent siblings)
  11 siblings, 2 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Remove the 32-bit CMT compat strings to reduce maintenance burden.

It should be fine to break DT compatibility because the 32-bit
32-bit CMT DT binding was never part of any upstream DTS file.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Changes since V1:
 - New patch

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |   16 ---------------
 1 file changed, 16 deletions(-)

--- 0008/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 18:04:35.060513000 +0900
@@ -12,22 +12,6 @@ datasheets.
 Required Properties:
 
   - compatible: must contain one or more of the following:
-    - "renesas,cmt-32-r8a7740" for the r8a7740 32-bit CMT
-		(CMT0)
-    - "renesas,cmt-32-sh73a0" for the sh73a0 32-bit CMT
-		(CMT0)
-    - "renesas,cmt-32" for all 32-bit CMT without fast clock support
-		(CMT0 on sh73a0 and r8a7740)
-		This is a fallback for the above renesas,cmt-32-* entries.
-
-    - "renesas,cmt-32-fast-r8a7740" for the r8a7740 32-bit CMT with fast
-		clock support (CMT[234])
-    - "renesas,cmt-32-fast-sh73a0" for the sh73A0 32-bit CMT with fast
-		clock support (CMT[234])
-    - "renesas,cmt-32-fast" for all 32-bit CMT with fast clock support
-		(CMT[234] on sh73a0 and r8a7740)
-		This is a fallback for the above renesas,cmt-32-fast-* entries.
-
     - "renesas,cmt-48-sh73a0" for the sh73A0 48-bit CMT
 		(CMT1)
     - "renesas,cmt-48-r8a7740" for the r8a7740 48-bit CMT

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

* [PATCH v2 10/11] clocksource: sh_cmt: Remove unused 32-bit CMT bindings
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (8 preceding siblings ...)
  2015-09-17  9:54 ` [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings Magnus Damm
@ 2015-09-17  9:55 ` Magnus Damm
  2015-09-17  9:59   ` Geert Uytterhoeven
  2015-09-17  9:55 ` [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties Magnus Damm
  2015-09-21 14:25 ` [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Rob Herring
  11 siblings, 1 reply; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

Remove the 32-bit CMT compat strings to reduce maintenance burden.

It should be fine to break DT compatibility because the 32-bit
32-bit CMT DT binding was never part of any upstream DTS file.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Changes since V1:
 - New patch

 drivers/clocksource/sh_cmt.c |    2 --
 1 file changed, 2 deletions(-)

--- 0005/drivers/clocksource/sh_cmt.c
+++ work/drivers/clocksource/sh_cmt.c	2015-09-17 18:06:35.940513000 +0900
@@ -957,8 +957,6 @@ static const struct platform_device_id s
 MODULE_DEVICE_TABLE(platform, sh_cmt_id_table);
 
 static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
-	{ .compatible = "renesas,cmt-32", .data = &sh_cmt_info[SH_CMT_32BIT] },
-	{ .compatible = "renesas,cmt-32-fast", .data = &sh_cmt_info[SH_CMT_32BIT_FAST] },
 	{ .compatible = "renesas,cmt-48", .data = &sh_cmt_info[SH_CMT_48BIT] },
 	{ .compatible = "renesas,cmt-48-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
 	{ .compatible = "renesas,cmt0-rcar-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },

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

* [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (9 preceding siblings ...)
  2015-09-17  9:55 ` [PATCH v2 10/11] clocksource: sh_cmt: " Magnus Damm
@ 2015-09-17  9:55 ` Magnus Damm
  2015-09-17 10:04   ` Geert Uytterhoeven
  2015-09-21 14:25 ` [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Rob Herring
  11 siblings, 1 reply; 19+ messages in thread
From: Magnus Damm @ 2015-09-17  9:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, Magnus Damm, tglx

From: Magnus Damm <damm+renesas@opensource.se>

The deprecated DT properies are part of the GIT history,
no need to keep them around any longer.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Changes since V1:
 - New patch

 Documentation/devicetree/bindings/timer/renesas,cmt.txt |    4 ----
 1 file changed, 4 deletions(-)

--- 0011/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ work/Documentation/devicetree/bindings/timer/renesas,cmt.txt	2015-09-17 18:08:17.000513000 +0900
@@ -35,8 +35,6 @@ Required Properties:
     - "renesas,cmt1-rcar-gen2" for 48-bit CMT1 devices included in R-Car Gen2.
 		These are fallbacks for r8a73a4 and all the R-Car Gen2
 		entries	listed above.
-
-    - "renesas,cmt-48-gen2" is <deprecated>, use "renesas,cmt[01]-*" instead.
     
   - reg: base address and length of the registers block for the timer module.
   - interrupts: interrupt-specifier for the timer, one per channel.
@@ -44,8 +42,6 @@ Required Properties:
     in clock-names.
   - clock-names: must contain "fck" for the functional clock.
 
-  - renesas,channels-mask: <deprecated>, information kept in device driver.
-
 
 Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes
 

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

* Re: [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
  2015-09-17  9:54 ` [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings Magnus Damm
@ 2015-09-17  9:59   ` Geert Uytterhoeven
  2015-09-17 12:14   ` Sergei Shtylyov
  1 sibling, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2015-09-17  9:59 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, devicetree, Laurent Pinchart, Geert Uytterhoeven,
	Linux-sh list, Daniel Lezcano, Simon Horman, Thomas Gleixner

On Thu, Sep 17, 2015 at 11:54 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> Remove the 32-bit CMT compat strings to reduce maintenance burden.
>
> It should be fine to break DT compatibility because the 32-bit
> 32-bit CMT DT binding was never part of any upstream DTS file.
>
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 19+ messages in thread

* Re: [PATCH v2 10/11] clocksource: sh_cmt: Remove unused 32-bit CMT bindings
  2015-09-17  9:55 ` [PATCH v2 10/11] clocksource: sh_cmt: " Magnus Damm
@ 2015-09-17  9:59   ` Geert Uytterhoeven
  0 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2015-09-17  9:59 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, devicetree, Laurent Pinchart, Geert Uytterhoeven,
	Linux-sh list, Daniel Lezcano, Simon Horman, Thomas Gleixner

On Thu, Sep 17, 2015 at 11:55 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> Remove the 32-bit CMT compat strings to reduce maintenance burden.
>
> It should be fine to break DT compatibility because the 32-bit
> 32-bit CMT DT binding was never part of any upstream DTS file.
>
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 19+ messages in thread

* Re: [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties
  2015-09-17  9:55 ` [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties Magnus Damm
@ 2015-09-17 10:04   ` Geert Uytterhoeven
  2015-09-17 10:33     ` Magnus Damm
  0 siblings, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2015-09-17 10:04 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, devicetree, Laurent Pinchart, Geert Uytterhoeven,
	Linux-sh list, Daniel Lezcano, Simon Horman, Thomas Gleixner

On Thu, Sep 17, 2015 at 11:55 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> The deprecated DT properies are part of the GIT history,

properties

> no need to keep them around any longer.

They're still in the driver because in-the-field R-Car Gen2 DTSes use them,
right? You may add a comment in the driver, to prevent a janitor from
re-adding them to the bindings.

> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

Nevertheless
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 19+ messages in thread

* Re: [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties
  2015-09-17 10:04   ` Geert Uytterhoeven
@ 2015-09-17 10:33     ` Magnus Damm
  0 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17 10:33 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-kernel, devicetree, Laurent Pinchart, Geert Uytterhoeven,
	Linux-sh list, Daniel Lezcano, Simon Horman, Thomas Gleixner

Hi Geert,

On Thu, Sep 17, 2015 at 7:04 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Thu, Sep 17, 2015 at 11:55 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> The deprecated DT properies are part of the GIT history,
>
> properties

Oops!

>> no need to keep them around any longer.
>
> They're still in the driver because in-the-field R-Car Gen2 DTSes use them,
> right? You may add a comment in the driver, to prevent a janitor from
> re-adding them to the bindings.

Yes, good idea!

>> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>
> Nevertheless
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thank you!

/ magnus

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

* Re: [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
  2015-09-17  9:54 ` [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings Magnus Damm
  2015-09-17  9:59   ` Geert Uytterhoeven
@ 2015-09-17 12:14   ` Sergei Shtylyov
  2015-09-17 12:41     ` Magnus Damm
  1 sibling, 1 reply; 19+ messages in thread
From: Sergei Shtylyov @ 2015-09-17 12:14 UTC (permalink / raw)
  To: Magnus Damm, linux-kernel
  Cc: devicetree, laurent.pinchart+renesas, geert+renesas, linux-sh,
	daniel.lezcano, horms+renesas, tglx

Hello.

On 9/17/2015 12:54 PM, Magnus Damm wrote:

> From: Magnus Damm <damm+renesas@opensource.se>
>
> Remove the 32-bit CMT compat strings to reduce maintenance burden.
>
> It should be fine to break DT compatibility because the 32-bit
> 32-bit CMT DT binding was never part of any upstream DTS file.

    Nit: "32-bit" repeated twice.

> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
[...]

MBR, Sergei


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

* Re: [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
  2015-09-17 12:14   ` Sergei Shtylyov
@ 2015-09-17 12:41     ` Magnus Damm
  0 siblings, 0 replies; 19+ messages in thread
From: Magnus Damm @ 2015-09-17 12:41 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-kernel, devicetree, Laurent Pinchart, Geert Uytterhoeven,
	SH-Linux, Daniel Lezcano, Simon Horman, Thomas Gleixner

Hi Sergei,

On Thu, Sep 17, 2015 at 9:14 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
> On 9/17/2015 12:54 PM, Magnus Damm wrote:
>
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> Remove the 32-bit CMT compat strings to reduce maintenance burden.
>>
>> It should be fine to break DT compatibility because the 32-bit
>> 32-bit CMT DT binding was never part of any upstream DTS file.
>
>
>    Nit: "32-bit" repeated twice.

Oops, will fix, thanks for reporting!

Cheers,

/ magnus

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

* Re: [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2
  2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
                   ` (10 preceding siblings ...)
  2015-09-17  9:55 ` [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties Magnus Damm
@ 2015-09-21 14:25 ` Rob Herring
  11 siblings, 0 replies; 19+ messages in thread
From: Rob Herring @ 2015-09-21 14:25 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, devicetree, laurent.pinchart+renesas,
	geert+renesas, linux-sh, daniel.lezcano, horms+renesas, tglx

On 09/17/2015 04:53 AM, Magnus Damm wrote:
> clocksource: sh_cmt: DT binding rework V2
> 
> [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding
> [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case
> [PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings
> [PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1
> [PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings
> [PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS
> [PATCH v2 07/11] devicetree: bindings: Deprecate property, update example
> [PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS
> [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings
> [PATCH v2 10/11] clocksource: sh_cmt: Remove unused 32-bit CMT bindings
> [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties
> 
> This series reworks the CMT DT bindings to try to deal with the following:
> - R-Car Gen2 CMT0 and CMT1 hardware instances are not identical
> - The property renesas,channels-mask is not enough to describe the difference
> - DT should describe the hardware, not the software implementation
> - Not all documented DT bindings are actually used
> 
> Without these patches the binding "renesas,cmt-48-gen2" is used for both
> CMT0 and CMT1 on R-Car Gen2 SoCs. CMT0 and CMT1 are currently seen by the
> Linux device driver as compatible hardware, and the device-specific property
> "renesas,channels-mask" is used to point out some of the hardware configuration
> differences. Since the driver is not feature complete only some differences are
> described and when diving into the data sheet we can see that:
> 
> 1) CMT0 is not 48-bit at all, instead it only supports 32-bit counters.
> 2) Some channels of CMT1 are 48-bit, some 32-bit.
> 3) A couple of CMT1 channels have even more features.
> 
> It turns out that none of the above differences are described in our current
> DT files. And since we use the same compat string for CMT0 and CMT1 the driver
> itself cannot enable features specific only to CMT1 without first updating
> the DTS. So this series is ground work for future feature patches.
> 
> It seems that we have two choices if we want to support CMT1 features:
> A) Keep existing DT bindings, add more properties for CMT1
> B) Rework the compatible strings and keep configuration in the driver
> 
> Judging by above it seems that DT update is inevitable. In my mind it is
> rather painful to update the DT so I'd like to minimize the number of
> updates and let the majority of the changes only happen in the driver.
> And since we should really describe hardware in DT but driver features tend
> to be implemented incrementally then B) seems like a good fit to me.

Agreed.

For 1, 3. 5, 7, 9, 11:

Acked-by: Rob Herring <robh@kernel.org>

> 
> I wouldn't mind going with A) but to be honest I must say that the existing
> compat string "renesas,cmt-48-gen2" is just too confusing with "48"
> (when CMT0 is 32bit-only) and also "gen2" (used without product line R-Car).
> 
> Because of that I've gone with B) and reworked the bindings to separate
> CMT0 from CMT1 and keep channel configuration in the device driver.
> 
> While at it I've deprecated "renesas,channels-mask" and the old DT compat
> strings. Per-SoC compat strings have also been reworked, but are not left
> around documented as deprecated since they were never used by the driver.
> 
> Comments are very welcome! If all are in favor then it would be good to
> merge patch 1-5 first and patch 6-8 later once 1-5 are in. Old DTBs are
> left working but treated as low-feature CMT0. New DTBs including patch 6
> will not work on old kernels.
> 
> V2 patch series fixes patch 1-2 and adds patches 9, 10, 11.
> Patch 9 and 10 cleans up r8a7740 and sh73a0 bindings.
> Patch 11 removes deprecated properties as proposed by Laurent.
> 
> Many thanks to Geert and Laurent for feedback!
> 
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> (For patch 1-8)
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> (For patch 1-8)
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> (For patch 1-7)
> ---
> 
>  Written against renesas-drivers-2015-09-15-v4.3-rc1
> 
>  Documentation/devicetree/bindings/timer/renesas,cmt.txt |   85 ++++++---------
>  arch/arm/boot/dts/r8a73a4.dtsi                          |    5 
>  arch/arm/boot/dts/r8a7740.dtsi                          |    3 
>  arch/arm/boot/dts/r8a7790.dtsi                          |   10 -
>  arch/arm/boot/dts/r8a7791.dtsi                          |   10 -
>  arch/arm/boot/dts/r8a7793.dtsi                          |   10 -
>  arch/arm/boot/dts/r8a7794.dtsi                          |   10 -
>  arch/arm/boot/dts/sh73a0.dtsi                           |    3 
>  drivers/clocksource/sh_cmt.c                            |   54 ++++++---
>  9 files changed, 85 insertions(+), 105 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

end of thread, other threads:[~2015-09-21 18:55 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17  9:53 [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Magnus Damm
2015-09-17  9:53 ` [PATCH v2 01/11] devicetree: bindings: Remove sh7372 CMT binding Magnus Damm
2015-09-17  9:53 ` [PATCH v2 02/11] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case Magnus Damm
2015-09-17  9:53 ` [PATCH v2 03/11] devicetree: bindings: R-Car Gen2 CMT0 and CMT1 bindings Magnus Damm
2015-09-17  9:54 ` [PATCH v2 04/11] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1 Magnus Damm
2015-09-17  9:54 ` [PATCH v2 05/11] devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings Magnus Damm
2015-09-17  9:54 ` [PATCH v2 06/11] ARM: shmobile: Update CMT compat string users in DTS Magnus Damm
2015-09-17  9:54 ` [PATCH v2 07/11] devicetree: bindings: Deprecate property, update example Magnus Damm
2015-09-17  9:54 ` [PATCH v2 08/11] ARM: shmobile: Remove CMT renesas,channels-mask from DTS Magnus Damm
2015-09-17  9:54 ` [PATCH v2 09/11] devicetree: bindings: Remove unused 32-bit CMT bindings Magnus Damm
2015-09-17  9:59   ` Geert Uytterhoeven
2015-09-17 12:14   ` Sergei Shtylyov
2015-09-17 12:41     ` Magnus Damm
2015-09-17  9:55 ` [PATCH v2 10/11] clocksource: sh_cmt: " Magnus Damm
2015-09-17  9:59   ` Geert Uytterhoeven
2015-09-17  9:55 ` [PATCH v2 11/11] devicetree: bindings: Remove deprecated properties Magnus Damm
2015-09-17 10:04   ` Geert Uytterhoeven
2015-09-17 10:33     ` Magnus Damm
2015-09-21 14:25 ` [PATCH v2 00/11] clocksource: sh_cmt: DT binding rework V2 Rob Herring

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).