2017-09-18 13:47:44

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework

Hi Daniel, Thomas, Rob, Mark, Magnus,

This patch series updates the sh_cmt clocksource driver for the recent DT
binding rework that was merged in v4.14-rc1.

This series is an evolutionary improvement of Magnus Damm's series "[PATCH
v2 00/11] clocksource: sh_cmt: DT binding rework V2".
It complements Magnus' series "[PATCH v3 00/06] clocksource: sh_cmt: DT
binding rework V3" and "[PATCH v4 00/06] clocksource: sh_cmt: DT binding
rework V4", which included DT binding updates only.

- Patch 1 fixes wrong vendor/soc ordering in the SoC-specific compatible
values (This issue was raised during review before, but was not
addressed in later iterations of the DT binding rework. Oh well,
things like that happen when there's more than 2 years between initial
submission and acceptance...),
- Patches 2 to 6 implement the updated DT bindings, as already accepted
upstream, and amended in patch 1.
- Patch 7 is a small cleanup.

Changes compared to v2:
- Take over from Magnus,
- Drop DT binding updates that were revised and accepted upstream,
- Fix SoC-specific compatible values,
- Change channels_mask from "unsigned long" to "unsigned int,
- Remove support for "renesas,cmt-32*",
- Mark "renesas,cmt-48-gen2" deprecated,
- Remove unused "renesas,channels-mask" handling,
- Use of_device_get_match_data() helper.

Thanks!

Geert Uytterhoeven (5):
dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values
clocksource: sh_cmt: Remove support for "renesas,cmt-32*"
clocksource: sh_cmt: Mark "renesas,cmt-48-gen2" deprecated
clocksource: sh_cmt: Remove unused "renesas,channels-mask" handling
clocksource: sh_cmt: Use of_device_get_match_data() helper

Magnus Damm (2):
clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case
clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1

.../devicetree/bindings/timer/renesas,cmt.txt | 24 +++----
drivers/clocksource/sh_cmt.c | 76 ++++++++++------------
2 files changed, 45 insertions(+), 55 deletions(-)

--
2.7.4

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


2017-09-18 13:47:01

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 3/7] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1

From: Magnus Damm <[email protected]>

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 <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- Take over from Magnus,
- Update compatible values,

v2:
- 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(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index c104c80424c88f08..45af436483f39cb0 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -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_info[] = {
.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),
@@ -862,6 +875,7 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
ch->cmt = cmt;
ch->index = index;
ch->hwidx = hwidx;
+ ch->timer_bit = hwidx;

/*
* Compute the address of the channel control register block. For the
@@ -883,9 +897,11 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
*/
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;
}

@@ -897,8 +913,6 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
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) {
@@ -941,7 +955,9 @@ 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_CMT_48BIT_GEN2] },
+ { .compatible = "renesas,cmt-48-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
+ { .compatible = "renesas,rcar-gen2-cmt0", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
+ { .compatible = "renesas,rcar-gen2-cmt1", .data = &sh_cmt_info[SH_CMT1_RCAR_GEN2] },
{ }
};
MODULE_DEVICE_TABLE(of, sh_cmt_of_table);
--
2.7.4

2017-09-18 13:47:00

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 1/7] dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values

While the new family-specific compatible values introduced by commit
6f54cc1adcc8957f ("devicetree: bindings: R-Car Gen2 CMT0 and CMT1
bindings") use the recommended order "<vendor>,<family>-<device>", the
new SoC-specific compatible values still use the old and deprecated
order "<vendor>,<device>-<soc>".

Switch the SoC-specific compatible values to the recommended order while
there are no upstream users of these compatible values yet.

Fixes: 7f03a0ecfdc786c1 ("devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings")
Fixes: 63d9e8ca0dd4bfa4 ("devicetree: bindings: Deprecate property, update example")
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- New.
---
.../devicetree/bindings/timer/renesas,cmt.txt | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/timer/renesas,cmt.txt b/Documentation/devicetree/bindings/timer/renesas,cmt.txt
index 6ca6b9e582a0e803..d740989eb56981cb 100644
--- a/Documentation/devicetree/bindings/timer/renesas,cmt.txt
+++ b/Documentation/devicetree/bindings/timer/renesas,cmt.txt
@@ -20,16 +20,16 @@ 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,r8a73a4-cmt0" for the 32-bit CMT0 device included in r8a73a4.
+ - "renesas,r8a73a4-cmt1" for the 48-bit CMT1 device included in r8a73a4.
+ - "renesas,r8a7790-cmt0" for the 32-bit CMT0 device included in r8a7790.
+ - "renesas,r8a7790-cmt1" for the 48-bit CMT1 device included in r8a7790.
+ - "renesas,r8a7791-cmt0" for the 32-bit CMT0 device included in r8a7791.
+ - "renesas,r8a7791-cmt1" for the 48-bit CMT1 device included in r8a7791.
+ - "renesas,r8a7793-cmt0" for the 32-bit CMT0 device included in r8a7793.
+ - "renesas,r8a7793-cmt1" for the 48-bit CMT1 device included in r8a7793.
+ - "renesas,r8a7794-cmt0" for the 32-bit CMT0 device included in r8a7794.
+ - "renesas,r8a7794-cmt1" for the 48-bit CMT1 device included in r8a7794.

- "renesas,rcar-gen2-cmt0" for 32-bit CMT0 devices included in R-Car Gen2.
- "renesas,rcar-gen2-cmt1" for 48-bit CMT1 devices included in R-Car Gen2.
@@ -46,7 +46,7 @@ Required Properties:
Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes

cmt0: timer@ffca0000 {
- compatible = "renesas,cmt0-r8a7790", "renesas,rcar-gen2-cmt0";
+ compatible = "renesas,r8a7790-cmt0", "renesas,rcar-gen2-cmt0";
reg = <0 0xffca0000 0 0x1004>;
interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
<0 142 IRQ_TYPE_LEVEL_HIGH>;
@@ -55,7 +55,7 @@ Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes
};

cmt1: timer@e6130000 {
- compatible = "renesas,cmt1-r8a7790", "renesas,rcar-gen2-cmt1";
+ compatible = "renesas,r8a7790-cmt1", "renesas,rcar-gen2-cmt1";
reg = <0 0xe6130000 0 0x1004>;
interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
<0 121 IRQ_TYPE_LEVEL_HIGH>,
--
2.7.4

2017-09-18 13:46:59

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 6/7] clocksource: sh_cmt: Remove unused "renesas,channels-mask" handling

The in-driver channel configuration in sh_cmt_info.channels_mask is now
always set for all CMT devices instantiated from DT.

Hence the "renesas,channels-mask" property is no longer checked, and its
handling can be removed, cfr. commit 4e18111ff38f0664 ("devicetree:
bindings: Remove deprecated properties").

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- New.
---
drivers/clocksource/sh_cmt.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 61a9225097065cc4..89c514cf59a44e48 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -946,14 +946,6 @@ static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
};
MODULE_DEVICE_TABLE(of, sh_cmt_of_table);

-static int sh_cmt_parse_dt(struct sh_cmt_device *cmt)
-{
- struct device_node *np = cmt->pdev->dev.of_node;
-
- return of_property_read_u32(np, "renesas,channels-mask",
- &cmt->hw_channels);
-}
-
static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
{
unsigned int mask;
@@ -968,15 +960,7 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)

id = of_match_node(sh_cmt_of_table, pdev->dev.of_node);
cmt->info = id->data;
-
- /* 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;
- }
+ cmt->hw_channels = cmt->info->channels_mask;
} else if (pdev->dev.platform_data) {
struct sh_timer_config *cfg = pdev->dev.platform_data;
const struct platform_device_id *id = pdev->id_entry;
--
2.7.4

2017-09-18 13:47:48

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 7/7] clocksource: sh_cmt: Use of_device_get_match_data() helper

Use the existing of_device_get_match_data() helper instead of
open-coding its functionality.

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- New.
---
drivers/clocksource/sh_cmt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 89c514cf59a44e48..70b3cf8e23d01bd8 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -25,6 +25,7 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
@@ -956,10 +957,7 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
raw_spin_lock_init(&cmt->lock);

if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
- const struct of_device_id *id;
-
- id = of_match_node(sh_cmt_of_table, pdev->dev.of_node);
- cmt->info = id->data;
+ cmt->info = of_device_get_match_data(&pdev->dev);
cmt->hw_channels = cmt->info->channels_mask;
} else if (pdev->dev.platform_data) {
struct sh_timer_config *cfg = pdev->dev.platform_data;
--
2.7.4

2017-09-18 13:47:46

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 2/7] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case

From: Magnus Damm <[email protected]>

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 <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- Take over from Magnus,
- Change channels_mask from "unsigned long" to "unsigned int, as it's
assigned to sh_cmt_device.hw_channels, which is "unsigned int",

v2:
- Fixed compile error,
- 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(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index e09e8bf0bb9bf536..c104c80424c88f08 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -74,6 +74,8 @@ enum sh_cmt_model {
struct sh_cmt_info {
enum sh_cmt_model model;

+ unsigned int 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_info[] = {
},
[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),
@@ -966,9 +969,14 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
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;
--
2.7.4

2017-09-18 13:47:45

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 5/7] clocksource: sh_cmt: Mark "renesas,cmt-48-gen2" deprecated

Document in the driver that "renesas,cmt-48-gen2" is deprecated, but
still supported for backward compatibility with old DTBs, cfr. commit
4e18111ff38f0664 ("devicetree: bindings: Remove deprecated
properties").

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- New.
---
drivers/clocksource/sh_cmt.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 8546736e3bc8e961..61a9225097065cc4 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -935,7 +935,11 @@ MODULE_DEVICE_TABLE(platform, sh_cmt_id_table);

static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
{ .compatible = "renesas,cmt-48", .data = &sh_cmt_info[SH_CMT_48BIT] },
- { .compatible = "renesas,cmt-48-gen2", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
+ {
+ /* deprecated, preserved for backward compatibility */
+ .compatible = "renesas,cmt-48-gen2",
+ .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2]
+ },
{ .compatible = "renesas,rcar-gen2-cmt0", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
{ .compatible = "renesas,rcar-gen2-cmt1", .data = &sh_cmt_info[SH_CMT1_RCAR_GEN2] },
{ }
--
2.7.4

2017-09-18 13:48:58

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v3 4/7] clocksource: sh_cmt: Remove support for "renesas,cmt-32*"

Remove driver matching support for the unused "renesas,cmt-32" and
"renesas,cmt-32-fast" compatible values, cfr. commit 203bb3479958c48a
("devicetree: bindings: Remove unused 32-bit CMT bindings").

As this removes the last user of SH_CMT_32BIT_FAST, all support for this
variant is removed from the driver.

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v3:
- New.
---
drivers/clocksource/sh_cmt.c | 20 --------------------
1 file changed, 20 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 45af436483f39cb0..8546736e3bc8e961 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -66,7 +66,6 @@ struct sh_cmt_device;
enum sh_cmt_model {
SH_CMT_16BIT,
SH_CMT_32BIT,
- SH_CMT_32BIT_FAST,
SH_CMT_48BIT,
SH_CMT0_RCAR_GEN2,
SH_CMT1_RCAR_GEN2,
@@ -203,16 +202,6 @@ static const struct sh_cmt_info sh_cmt_info[] = {
.read_count = sh_cmt_read32,
.write_count = sh_cmt_write32,
},
- [SH_CMT_32BIT_FAST] = {
- .model = SH_CMT_32BIT_FAST,
- .width = 32,
- .overflow_bit = SH_CMT32_CMCSR_CMF,
- .clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF),
- .read_control = sh_cmt_read16,
- .write_control = sh_cmt_write16,
- .read_count = sh_cmt_read32,
- .write_count = sh_cmt_write32,
- },
[SH_CMT_48BIT] = {
.model = SH_CMT_48BIT,
.channels_mask = 0x3f,
@@ -890,13 +879,6 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
case SH_CMT_48BIT:
ch->ioctrl = cmt->mapbase + 0x10 + ch->hwidx * 0x10;
break;
- case SH_CMT_32BIT_FAST:
- /*
- * The 32-bit "fast" timer has a single channel at hwidx 5 but
- * is located at offset 0x40 instead of 0x60 for some reason.
- */
- ch->ioctrl = cmt->mapbase + 0x40;
- break;
case SH_CMT0_RCAR_GEN2:
case SH_CMT1_RCAR_GEN2:
ch->iostart = cmt->mapbase + ch->hwidx * 0x100;
@@ -952,8 +934,6 @@ static const struct platform_device_id sh_cmt_id_table[] = {
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,rcar-gen2-cmt0", .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2] },
--
2.7.4

2017-09-21 23:10:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3 1/7] dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values

On Mon, Sep 18, 2017 at 03:46:41PM +0200, Geert Uytterhoeven wrote:
> While the new family-specific compatible values introduced by commit
> 6f54cc1adcc8957f ("devicetree: bindings: R-Car Gen2 CMT0 and CMT1
> bindings") use the recommended order "<vendor>,<family>-<device>", the
> new SoC-specific compatible values still use the old and deprecated
> order "<vendor>,<device>-<soc>".
>
> Switch the SoC-specific compatible values to the recommended order while
> there are no upstream users of these compatible values yet.
>
> Fixes: 7f03a0ecfdc786c1 ("devicetree: bindings: r8a73a4 and R-Car Gen2 CMT bindings")
> Fixes: 63d9e8ca0dd4bfa4 ("devicetree: bindings: Deprecate property, update example")
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> v3:
> - New.
> ---
> .../devicetree/bindings/timer/renesas,cmt.txt | 24 +++++++++++-----------
> 1 file changed, 12 insertions(+), 12 deletions(-)

Acked-by: Rob Herring <[email protected]>

2017-09-25 23:21:40

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework


Hi all,

last call for comments before I merge this series.

Thanks.

-- Daniel


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2017-09-26 08:26:48

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework

Hi Geert,

Thank you for the patches.

On Monday, 18 September 2017 16:46:40 EEST Geert Uytterhoeven wrote:
> Hi Daniel, Thomas, Rob, Mark, Magnus,
>
> This patch series updates the sh_cmt clocksource driver for the recent DT
> binding rework that was merged in v4.14-rc1.
>
> This series is an evolutionary improvement of Magnus Damm's series "[PATCH
> v2 00/11] clocksource: sh_cmt: DT binding rework V2".
> It complements Magnus' series "[PATCH v3 00/06] clocksource: sh_cmt: DT
> binding rework V3" and "[PATCH v4 00/06] clocksource: sh_cmt: DT binding
> rework V4", which included DT binding updates only.
>
> - Patch 1 fixes wrong vendor/soc ordering in the SoC-specific compatible
> values (This issue was raised during review before, but was not
> addressed in later iterations of the DT binding rework. Oh well,
> things like that happen when there's more than 2 years between initial
> submission and acceptance...),
> - Patches 2 to 6 implement the updated DT bindings, as already accepted
> upstream, and amended in patch 1.
> - Patch 7 is a small cleanup.
>
> Changes compared to v2:
> - Take over from Magnus,
> - Drop DT binding updates that were revised and accepted upstream,
> - Fix SoC-specific compatible values,
> - Change channels_mask from "unsigned long" to "unsigned int,
> - Remove support for "renesas,cmt-32*",
> - Mark "renesas,cmt-48-gen2" deprecated,
> - Remove unused "renesas,channels-mask" handling,
> - Use of_device_get_match_data() helper.
>
> Thanks!
>
> Geert Uytterhoeven (5):
> dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values
> clocksource: sh_cmt: Remove support for "renesas,cmt-32*"
> clocksource: sh_cmt: Mark "renesas,cmt-48-gen2" deprecated
> clocksource: sh_cmt: Remove unused "renesas,channels-mask" handling
> clocksource: sh_cmt: Use of_device_get_match_data() helper
>
> Magnus Damm (2):
> clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case
> clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1

For the whole series,

Reviewed-by: Laurent Pinchart <[email protected]>

> .../devicetree/bindings/timer/renesas,cmt.txt | 24 +++----
> drivers/clocksource/sh_cmt.c | 76 +++++++++----------
> 2 files changed, 45 insertions(+), 55 deletions(-)

--
Regards,

Laurent Pinchart

2017-09-26 18:38:13

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework

On 26/09/2017 10:26, Laurent Pinchart wrote:
> Reviewed-by: Laurent Pinchart <[email protected]>

Thanks. I applied the whole series.

-- Daniel


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2017-09-27 07:14:56

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework

Hi Daniel,

On Tue, Sep 26, 2017 at 8:38 PM, Daniel Lezcano
<[email protected]> wrote:
> On 26/09/2017 10:26, Laurent Pinchart wrote:
>> Reviewed-by: Laurent Pinchart <[email protected]>
>
> Thanks. I applied the whole series.

Thank you! So we can update DTS in v4.16.

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