Renesas CMT, MTU2 and TMU timers DT support
Subsystems (6)
v3 cover Renesas CMT, MTU2 and TMU timers DT support
Hello,
This patch set adds DT bindings to the Renesas CMT, MTU2 and TMU timers. Patches 02/19 to 13/19, 16/19 and 17/19 have already been posted in the previous version of this series. Patches 14/19, 15/19, 18/19 and 19/19 are new.
Compared to v2 I've rebased the patches on top of Simon's latest devel branch.
Compared to v1 I've dropped the channel subnodes from the CMT DT bindings and just use a channels mask, as I don't need to specify per-channel properties. I'm slightly uncertain about this change though, as I can't easily predict whether per-channel properties would be needed later for new hardware. It won't be difficult to reintroduce channel subnodes then, so I'd rather not clutter the DT bindings with channel subnodes now. Please feel free to disagree.
The first 11 patches should go through the timers tree while the last 8 patches should go through the Renesas SoC tree. Patches 12/19 to 15/19 have no build time or run time dependency on the drivers changes. Patches 16/19 to 19/19 may have a run time dependency on the drivers changes depending on the kernel configuration. Patches 16/19 and 17/19, for instance, require the driver changes only when architected timer support isn't enabled in the kernel.
Laurent Pinchart (19):
clocksource: sh_tmu: Fix channel IRQ retrieval in legacy case
clocksource: sh_cmt: Drop support for legacy platform data
clocksource: sh_cmt: Replace global spinlock with a per-device
spinlock
clocksource: sh_tmu: Drop support for legacy platform data
clocksource: sh_tmu: Replace global spinlock with a per-device
spinlock
clocksource: sh_mtu2: Drop support for legacy platform data
clocksource: sh_mtu2: Replace global spinlock with a per-device
spinlock
clocksource: shmobile: Remove unused sh_timer_config members
clocksource: sh_cmt: Add DT support
clocksource: sh_tmu: Add DT support
clocksource: sh_mtu2: Add DT support
ARM: shmobile: r8a7790: Add CMT devices to DT
ARM: shmobile: r8a7791: Add CMT devices to DT
ARM: shmobile: r8a7779: Add TMU devices to DT
ARM: shmobile: r7s72100: Add MTU2 device to DT
ARM: shmobile: lager-reference: Enable CMT0 in device tree
ARM: shmobile: koelsch-reference: Enable CMT0 in device tree
ARM: shmobile: marzen-reference: Enable TMU0 in device tree
ARM: shmobile: genmai-reference: Enable MTU2 in device tree
.../devicetree/bindings/timer/renesas,cmt.txt | 49 +++++ .../devicetree/bindings/timer/renesas,mtu2.txt | 40 ++++ .../devicetree/bindings/timer/renesas,tmu.txt | 40 ++++ arch/arm/boot/dts/r7s72100-genmai.dts | 4 + arch/arm/boot/dts/r7s72100.dtsi | 10 + arch/arm/boot/dts/r8a7779-marzen.dts | 4 + arch/arm/boot/dts/r8a7779.dtsi | 42 ++++ arch/arm/boot/dts/r8a7790-lager.dts | 4 + arch/arm/boot/dts/r8a7790.dtsi | 34 +++ arch/arm/boot/dts/r8a7791-koelsch.dts | 4 + arch/arm/boot/dts/r8a7791.dtsi | 34 +++ arch/arm/mach-shmobile/board-genmai-reference.c | 16 -- arch/arm/mach-shmobile/board-genmai.c | 14 +- arch/arm/mach-shmobile/board-koelsch-reference.c | 2 - arch/arm/mach-shmobile/board-lager-reference.c | 2 - arch/arm/mach-shmobile/board-marzen-reference.c | 10 - arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 21 -- arch/arm/mach-shmobile/setup-r8a7779.c | 17 +- arch/arm/mach-shmobile/setup-r8a7790.c | 7 +- arch/arm/mach-shmobile/setup-r8a7791.c | 7 +- drivers/clocksource/sh_cmt.c | 233 ++++++++------------- drivers/clocksource/sh_mtu2.c | 146 ++++--------- drivers/clocksource/sh_tmu.c | 125 +++++------ include/linux/sh_timer.h | 5 - 28 files changed, 467 insertions(+), 407 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/renesas,cmt.txt create mode 100644 Documentation/devicetree/bindings/timer/renesas,mtu2.txt create mode 100644 Documentation/devicetree/bindings/timer/renesas,tmu.txt
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 1/19 clocksource: sh_tmu: Fix channel IRQ retrieval in legacy case
In the legacy platform data case each TMU platform device handles a single channel with a single IRQ for the platform device. Retrieve the IRQ using the logical channel number instead of the hardware channel number.
--- drivers/clocksource/sh_tmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/sh_tmu.c +1 -1
@@ -498,7 +498,7 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, unsigned int index, ch->base = tmu->mapbase +8 + ch->index *12 ; } - ch->irq =platform_get_irq (tmu->pdev, ch->index); + ch->irq =platform_get_irq (tmu->pdev, index);if (ch->irq <0 ) {dev_err (&tmu->pdev->dev,"ch%u: failed to get irq\n" , ch->index);
Signature · 1 line
1.8.5.5
PATCH v3 2/19 clocksource: sh_cmt: Drop support for legacy platform data
In reply to Laurent PinchartNow that all platforms have switched to the new-style platform data, drop support for the legacy version.
--- drivers/clocksource/sh_cmt.c | 172 ++++++++++--------------------------------- 1 file changed, 40 insertions(+), 132 deletions(-)
drivers/clocksource/sh_cmt.c +40 -132
@@ -114,9 +114,7 @@ struct sh_cmt_device {struct platform_device *pdev;const struct sh_cmt_info *info; -bool legacy; -void __iomem *mapbase_ch;void __iomem *mapbase;struct clk *clk;
@@ -792,7 +790,7 @@ static int sh_cmt_register_clockevent(struct sh_cmt_channel *ch,int irq;int ret; - irq =platform_get_irq (ch->cmt->pdev, ch->cmt->legacy ?0 : ch->index); + irq =platform_get_irq (ch->cmt->pdev, ch->index);if (irq <0 ) {dev_err (&ch->cmt->pdev->dev,"ch%u: failed to get irq\n" , ch->index);
@@ -863,33 +861,26 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,* Compute the address of the channel control register block. For the * timers with a per-channel start/stop register, compute its address * as well. -* -* For legacy configuration the address has been mapped explicitly. */ -if (cmt->legacy) { - ch->ioctrl = cmt->mapbase_ch; - }else { -switch (cmt->info->model) { -case SH_CMT_16BIT : - ch->ioctrl = cmt->mapbase +2 + ch->hwidx *6 ; -break ; -case SH_CMT_32BIT : -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_CMT_48BIT_GEN2 : - ch->iostart = cmt->mapbase + ch->hwidx *0x100 ; - ch->ioctrl = ch->iostart +0x10 ; -break ; - } +switch (cmt->info->model) { +case SH_CMT_16BIT : + ch->ioctrl = cmt->mapbase +2 + ch->hwidx *6 ; +break ; +case SH_CMT_32BIT : +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_CMT_48BIT_GEN2 : + ch->iostart = cmt->mapbase + ch->hwidx *0x100 ; + ch->ioctrl = ch->iostart +0x10 ; +break ; }if (cmt->info->width == (sizeof (ch->max_match_value) *8 ))
@@ -900,12 +891,7 @@ 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); -if (cmt->legacy) { - ch->timer_bit = ch->hwidx; - }else { - ch->timer_bit = cmt->info->model ==SH_CMT_48BIT_GEN2 - ?0 : ch->hwidx; - } + 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);
@@ -938,60 +924,12 @@ static int sh_cmt_map_memory(struct sh_cmt_device *cmt)return 0 ; } -static int sh_cmt_map_memory_legacy (struct sh_cmt_device *cmt) -{ -struct sh_timer_config *cfg = cmt->pdev->dev.platform_data; -struct resource *res, *res2; - -/* map memory, let mapbase_ch point to our channel */ - res =platform_get_resource (cmt->pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&cmt->pdev->dev,"failed to get I/O memory\n" ); -return -ENXIO ; - } - - cmt->mapbase_ch =ioremap_nocache (res->start,resource_size (res)); -if (cmt->mapbase_ch ==NULL ) { -dev_err (&cmt->pdev->dev,"failed to remap I/O memory\n" ); -return -ENXIO ; - } - -/* optional resource for the shared timer start/stop register */ - res2 =platform_get_resource (cmt->pdev,IORESOURCE_MEM ,1 ); - -/* map second resource for CMSTR */ - cmt->mapbase =ioremap_nocache (res2 ? res2->start : - res->start - cfg->channel_offset, - res2 ?resource_size (res2) :2 ); -if (cmt->mapbase ==NULL ) { -dev_err (&cmt->pdev->dev,"failed to remap I/O second memory\n" ); -iounmap (cmt->mapbase_ch); -return -ENXIO ; - } - -/* identify the model based on the resources */ -if (resource_size (res) ==6 ) - cmt->info = &sh_cmt_info[SH_CMT_16BIT ]; -else if (res2 && (resource_size (res2) ==4 )) - cmt->info = &sh_cmt_info[SH_CMT_48BIT_GEN2 ]; -else - cmt->info = &sh_cmt_info[SH_CMT_32BIT ]; - -return 0 ; -} - -static void sh_cmt_unmap_memory (struct sh_cmt_device *cmt) -{ -iounmap (cmt->mapbase); -if (cmt->mapbase_ch) -iounmap (cmt->mapbase_ch); -} -static int sh_cmt_setup (struct sh_cmt_device *cmt,struct platform_device *pdev) {struct sh_timer_config *cfg = pdev->dev.platform_data;const struct platform_device_id *id = pdev->id_entry; -unsigned int hw_channels; +unsigned int mask; +unsigned int i;int ret;memset (cmt,0 ,sizeof (*cmt));
@@ -1003,10 +941,9 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) } cmt->info = (const struct sh_cmt_info *)id->driver_data; - cmt->legacy = cmt->info ? false : true;/* Get hold of clock. */ - cmt->clk =clk_get (&cmt->pdev->dev, cmt->legacy ?"cmt_fck" :"fck" ); + cmt->clk =clk_get (&cmt->pdev->dev,"fck" );if (IS_ERR (cmt->clk)) {dev_err (&cmt->pdev->dev,"cannot get clock\n" );return PTR_ERR (cmt->clk);
@@ -1016,27 +953,13 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)if (ret <0 ) goto err_clk_put; -/* -* Map the memory resource(s). We need to support both the legacy -* platform device configuration (with one device per channel) and the -* new version (with multiple channels per device). -*/ -if (cmt->legacy) - ret =sh_cmt_map_memory_legacy (cmt); -else - ret =sh_cmt_map_memory (cmt); - +/* Map the memory resource(s). */ + ret =sh_cmt_map_memory (cmt);if (ret <0 ) goto err_clk_unprepare;/* Allocate and setup the channels. */ -if (cmt->legacy) { - cmt->num_channels =1 ; - hw_channels =0 ; - }else { - cmt->num_channels =hweight8 (cfg->channels_mask); - hw_channels = cfg->channels_mask; - } + cmt->num_channels =hweight8 (cfg->channels_mask); cmt->channels =kzalloc (cmt->num_channels *sizeof (*cmt->channels),GFP_KERNEL );
@@ -1045,35 +968,21 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) goto err_unmap; } -if (cmt->legacy) { - ret =sh_cmt_setup_channel (&cmt->channels[0 ], - cfg->timer_bit, cfg->timer_bit, - cfg->clockevent_rating !=0 , - cfg->clocksource_rating !=0 , cmt); +/* +* Use the first channel as a clock event device and the second channel +* as a clock source. If only one channel is available use it for both. +*/ +for (i =0 , mask = cfg->channels_mask; i < cmt->num_channels; ++i) { +unsigned int hwidx =ffs (mask) -1 ; +bool clocksource = i ==1 || cmt->num_channels ==1 ; +bool clockevent = i ==0 ; + + ret =sh_cmt_setup_channel (&cmt->channels[i], i, hwidx, + clockevent, clocksource, cmt);if (ret <0 ) goto err_unmap; - }else { -unsigned int mask = hw_channels; -unsigned int i; -/* -* Use the first channel as a clock event device and the second -* channel as a clock source. If only one channel is available -* use it for both. -*/ -for (i =0 ; i < cmt->num_channels; ++i) { -unsigned int hwidx =ffs (mask) -1 ; -bool clocksource = i ==1 || cmt->num_channels ==1 ; -bool clockevent = i ==0 ; - - ret =sh_cmt_setup_channel (&cmt->channels[i], i, hwidx, - clockevent, clocksource, - cmt); -if (ret <0 ) - goto err_unmap; - - mask &= ~(1 << hwidx); - } + mask &= ~(1 << hwidx); }platform_set_drvdata (pdev, cmt);
@@ -1082,7 +991,7 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) err_unmap:kfree (cmt->channels); -sh_cmt_unmap_memory (cmt); +iounmap (cmt->mapbase); err_clk_unprepare:clk_unprepare (cmt->clk); err_clk_put:
@@ -1135,7 +1044,6 @@ static int sh_cmt_remove(struct platform_device *pdev) }static const struct platform_device_id sh_cmt_id_table[] = { - {"sh_cmt" ,0 }, {"sh-cmt-16" , (kernel_ulong_t)&sh_cmt_info[SH_CMT_16BIT ] }, {"sh-cmt-32" , (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT ] }, {"sh-cmt-32-fast" , (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT_FAST ] },
Signature · 1 line
1.8.5.5
PATCH v3 3/19 clocksource: sh_cmt: Replace global spinlock with a per-device spinlock
In reply to Laurent PinchartThe global spinlock is used to protect the shared start/stop register. Now that all CMT channels are handled by a single device instance, use a per-device spinlock.
--- drivers/clocksource/sh_cmt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/clocksource/sh_cmt.c +5 -4
@@ -118,6 +118,8 @@ struct sh_cmt_device {void __iomem *mapbase;struct clk *clk; +raw_spinlock_t lock;/* Protect the shared start/stop register */ +struct sh_cmt_channel *channels;unsigned int num_channels;
@@ -299,14 +301,12 @@ static unsigned long sh_cmt_get_counter(struct sh_cmt_channel *ch,return v2; } -static DEFINE_RAW_SPINLOCK (sh_cmt_lock); -static void sh_cmt_start_stop_ch (struct sh_cmt_channel *ch,int start) {unsigned long flags, value;/* start stop register shared by multiple timer channels */ -raw_spin_lock_irqsave (&sh_cmt_lock, flags); +raw_spin_lock_irqsave (&ch->cmt->lock, flags); value =sh_cmt_read_cmstr (ch);if (start)
@@ -315,7 +315,7 @@ static void sh_cmt_start_stop_ch(struct sh_cmt_channel *ch, int start) value &= ~(1 << ch->timer_bit);sh_cmt_write_cmstr (ch, value); -raw_spin_unlock_irqrestore (&sh_cmt_lock, flags); +raw_spin_unlock_irqrestore (&ch->cmt->lock, flags); }static int sh_cmt_enable (struct sh_cmt_channel *ch,unsigned long *rate)
@@ -934,6 +934,7 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)memset (cmt,0 ,sizeof (*cmt)); cmt->pdev = pdev; +raw_spin_lock_init (&cmt->lock);if (!cfg) {dev_err (&cmt->pdev->dev,"missing platform data\n" );
Signature · 1 line
1.8.5.5
PATCH v3 4/19 clocksource: sh_tmu: Drop support for legacy platform data
In reply to Laurent PinchartNow that all platforms have switched to the new-style platform data, drop support for the legacy version.
--- drivers/clocksource/sh_tmu.c | 82 ++++++++------------------------------------ 1 file changed, 15 insertions(+), 67 deletions(-)
drivers/clocksource/sh_tmu.c +15 -67
@@ -32,7 +32,6 @@#include <linux/spinlock.h> enum sh_tmu_model { -SH_TMU_LEGACY ,SH_TMU ,SH_TMU_SH3 , };
@@ -91,8 +90,6 @@ static inline unsigned long sh_tmu_read(struct sh_tmu_channel *ch, int reg_nr)if (reg_nr ==TSTR ) {switch (ch->tmu->model) { -case SH_TMU_LEGACY : -return ioread8 (ch->tmu->mapbase);case SH_TMU_SH3 :return ioread8 (ch->tmu->mapbase +2 );case SH_TMU :
@@ -115,8 +112,6 @@ static inline void sh_tmu_write(struct sh_tmu_channel *ch, int reg_nr,if (reg_nr ==TSTR ) {switch (ch->tmu->model) { -case SH_TMU_LEGACY : -return iowrite8 (value, ch->tmu->mapbase);case SH_TMU_SH3 :return iowrite8 (value, ch->tmu->mapbase +2 );case SH_TMU :
@@ -476,27 +471,12 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, unsigned int index,return 0 ; ch->tmu = tmu; + ch->index = index; -if (tmu->model ==SH_TMU_LEGACY ) { -struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; - -/* -* The SH3 variant (SH770x, SH7705, SH7710 and SH7720) maps -* channel registers blocks at base + 2 + 12 * index, while all -* other variants map them at base + 4 + 12 * index. We can -* compute the index by just dividing by 12, the 2 bytes or 4 -* bytes offset being hidden by the integer division. -*/ - ch->index = cfg->channel_offset /12 ; - ch->base = tmu->mapbase + cfg->channel_offset; - }else { - ch->index = index; - -if (tmu->model ==SH_TMU_SH3 ) - ch->base = tmu->mapbase +4 + ch->index *12 ; -else - ch->base = tmu->mapbase +8 + ch->index *12 ; - } +if (tmu->model ==SH_TMU_SH3 ) + ch->base = tmu->mapbase +4 + ch->index *12 ; +else + ch->base = tmu->mapbase +8 + ch->index *12 ; ch->irq =platform_get_irq (tmu->pdev, index);if (ch->irq <0 ) {
@@ -526,28 +506,9 @@ static int sh_tmu_map_memory(struct sh_tmu_device *tmu)if (tmu->mapbase ==NULL )return -ENXIO ; -/* -* In legacy platform device configuration (with one device per channel) -* the resource points to the channel base address. -*/ -if (tmu->model ==SH_TMU_LEGACY ) { -struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; - tmu->mapbase -= cfg->channel_offset; - } -return 0 ; } -static void sh_tmu_unmap_memory (struct sh_tmu_device *tmu) -{ -if (tmu->model ==SH_TMU_LEGACY ) { -struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; - tmu->mapbase += cfg->channel_offset; - } - -iounmap (tmu->mapbase); -} -static int sh_tmu_setup (struct sh_tmu_device *tmu,struct platform_device *pdev) {struct sh_timer_config *cfg = pdev->dev.platform_data;
@@ -564,8 +525,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) tmu->model = id->driver_data;/* Get hold of clock. */ - tmu->clk =clk_get (&tmu->pdev->dev, - tmu->model ==SH_TMU_LEGACY ?"tmu_fck" :"fck" ); + tmu->clk =clk_get (&tmu->pdev->dev,"fck" );if (IS_ERR (tmu->clk)) {dev_err (&tmu->pdev->dev,"cannot get clock\n" );return PTR_ERR (tmu->clk);
@@ -583,10 +543,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) }/* Allocate and setup the channels. */ -if (tmu->model ==SH_TMU_LEGACY ) - tmu->num_channels =1 ; -else - tmu->num_channels =hweight8 (cfg->channels_mask); + tmu->num_channels =hweight8 (cfg->channels_mask); tmu->channels =kzalloc (sizeof (*tmu->channels) * tmu->num_channels,GFP_KERNEL );
@@ -595,23 +552,15 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) goto err_unmap; } -if (tmu->model ==SH_TMU_LEGACY ) { - ret =sh_tmu_channel_setup (&tmu->channels[0 ],0 , - cfg->clockevent_rating !=0 , - cfg->clocksource_rating !=0 , tmu); +/* +* Use the first channel as a clock event device and the second channel +* as a clock source. +*/ +for (i =0 ; i < tmu->num_channels; ++i) { + ret =sh_tmu_channel_setup (&tmu->channels[i], i, + i ==0 , i ==1 , tmu);if (ret <0 ) goto err_unmap; - }else { -/* -* Use the first channel as a clock event device and the second -* channel as a clock source. -*/ -for (i =0 ; i < tmu->num_channels; ++i) { - ret =sh_tmu_channel_setup (&tmu->channels[i], i, - i ==0 , i ==1 , tmu); -if (ret <0 ) - goto err_unmap; - } }platform_set_drvdata (pdev, tmu);
@@ -620,7 +569,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) err_unmap:kfree (tmu->channels); -sh_tmu_unmap_memory (tmu); +iounmap (tmu->mapbase); err_clk_unprepare:clk_unprepare (tmu->clk); err_clk_put:
@@ -673,7 +622,6 @@ static int sh_tmu_remove(struct platform_device *pdev) }static const struct platform_device_id sh_tmu_id_table[] = { - {"sh_tmu" ,SH_TMU_LEGACY }, {"sh-tmu" ,SH_TMU }, {"sh-tmu-sh3" ,SH_TMU_SH3 }, { }
Signature · 1 line
1.8.5.5
PATCH v3 5/19 clocksource: sh_tmu: Replace global spinlock with a per-device spinlock
In reply to Laurent PinchartThe global spinlock is used to protect the shared start/stop register. Now that all TMU channels are handled by a single device instance, use a per-device spinlock.
--- drivers/clocksource/sh_tmu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/clocksource/sh_tmu.c +6 -4
@@ -61,6 +61,8 @@ struct sh_tmu_device {enum sh_tmu_model model; +raw_spinlock_t lock;/* Protect the shared start/stop register */ +struct sh_tmu_channel *channels;unsigned int num_channels;
@@ -68,8 +70,6 @@ struct sh_tmu_device {bool has_clocksource; }; -static DEFINE_RAW_SPINLOCK (sh_tmu_lock); -#define TSTR -1/* shared register */ #define TCOR 0/* channel register */ #define TCNT 1/* channel register */
@@ -132,7 +132,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_channel *ch, int start)unsigned long flags, value;/* start stop register shared by multiple timer channels */ -raw_spin_lock_irqsave (&sh_tmu_lock, flags); +raw_spin_lock_irqsave (&ch->tmu->lock, flags); value =sh_tmu_read (ch,TSTR );if (start)
@@ -141,7 +141,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_channel *ch, int start) value &= ~(1 << ch->index);sh_tmu_write (ch,TSTR , value); -raw_spin_unlock_irqrestore (&sh_tmu_lock, flags); +raw_spin_unlock_irqrestore (&ch->tmu->lock, flags); }static int __sh_tmu_enable (struct sh_tmu_channel *ch)
@@ -524,6 +524,8 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) tmu->pdev = pdev; tmu->model = id->driver_data; +raw_spin_lock_init (&tmu->lock); +/* Get hold of clock. */ tmu->clk =clk_get (&tmu->pdev->dev,"fck" );if (IS_ERR (tmu->clk)) {
Signature · 1 line
1.8.5.5
PATCH v3 6/19 clocksource: sh_mtu2: Drop support for legacy platform data
In reply to Laurent PinchartNow that all platforms have switched to the new-style platform data, drop support for the legacy version.
--- drivers/clocksource/sh_mtu2.c | 130 ++++++++++-------------------------------- 1 file changed, 31 insertions(+), 99 deletions(-)
drivers/clocksource/sh_mtu2.c +31 -99
@@ -37,7 +37,6 @@ struct sh_mtu2_channel {unsigned int index;void __iomem *base; -int irq;struct clock_event_device ced; };
@@ -51,7 +50,6 @@ struct sh_mtu2_device {struct sh_mtu2_channel *channels;unsigned int num_channels; -bool legacy;bool has_clockevent; };
@@ -162,12 +160,8 @@ static inline unsigned long sh_mtu2_read(struct sh_mtu2_channel *ch, int reg_nr) {unsigned long offs; -if (reg_nr ==TSTR ) { -if (ch->mtu->legacy) -return ioread8 (ch->mtu->mapbase); -else -return ioread8 (ch->mtu->mapbase +0x280 ); - } +if (reg_nr ==TSTR ) +return ioread8 (ch->mtu->mapbase +0x280 ); offs = mtu2_reg_offs[reg_nr];
@@ -182,12 +176,8 @@ static inline void sh_mtu2_write(struct sh_mtu2_channel *ch, int reg_nr, {unsigned long offs; -if (reg_nr ==TSTR ) { -if (ch->mtu->legacy) -return iowrite8 (value, ch->mtu->mapbase); -else -return iowrite8 (value, ch->mtu->mapbase +0x280 ); - } +if (reg_nr ==TSTR ) +return iowrite8 (value, ch->mtu->mapbase +0x280 ); offs = mtu2_reg_offs[reg_nr];
@@ -331,7 +321,6 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_channel *ch, const char *name) {struct clock_event_device *ced = &ch->ced; -int ret; ced->name = name; ced->features =CLOCK_EVT_FEAT_PERIODIC ;
@@ -344,24 +333,12 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_channel *ch,dev_info (&ch->mtu->pdev->dev,"ch%u: used for clock events\n" , ch->index);clockevents_register_device (ced); - - ret =request_irq (ch->irq, sh_mtu2_interrupt, -IRQF_TIMER |IRQF_IRQPOLL |IRQF_NOBALANCING , -dev_name (&ch->mtu->pdev->dev), ch); -if (ret) { -dev_err (&ch->mtu->pdev->dev,"ch%u: failed to request irq %d\n" , - ch->index, ch->irq); -return ; - } } -static int sh_mtu2_register (struct sh_mtu2_channel *ch,const char *name, -bool clockevent) +static int sh_mtu2_register (struct sh_mtu2_channel *ch,const char *name) { -if (clockevent) { - ch->mtu->has_clockevent = true; -sh_mtu2_register_clockevent (ch, name); - } + ch->mtu->has_clockevent = true; +sh_mtu2_register_clockevent (ch, name);return 0 ; }
@@ -372,40 +349,32 @@ static int sh_mtu2_setup_channel(struct sh_mtu2_channel *ch, unsigned int index,static const unsigned int channel_offsets[] = {0x300 ,0x380 ,0x000 , }; -bool clockevent; +char name[6 ]; +int irq; +int ret; ch->mtu = mtu; -if (mtu->legacy) { -struct sh_timer_config *cfg = mtu->pdev->dev.platform_data; - - clockevent = cfg->clockevent_rating !=0 ; - - ch->irq =platform_get_irq (mtu->pdev,0 ); - ch->base = mtu->mapbase - cfg->channel_offset; - ch->index = cfg->timer_bit; - }else { -char name[6 ]; - - clockevent = true; - -sprintf (name,"tgi%ua" , index); - ch->irq =platform_get_irq_byname (mtu->pdev, name); - ch->base = mtu->mapbase + channel_offsets[index]; - ch->index = index; - } - -if (ch->irq <0 ) { +sprintf (name,"tgi%ua" , index); + irq =platform_get_irq_byname (mtu->pdev, name); +if (irq <0 ) {/* Skip channels with no declared interrupt. */ -if (!mtu->legacy) -return 0 ; +return 0 ; + } -dev_err (&mtu->pdev->dev,"ch%u: failed to get irq\n" , - ch->index); -return ch->irq; + ret =request_irq (irq, sh_mtu2_interrupt, +IRQF_TIMER |IRQF_IRQPOLL |IRQF_NOBALANCING , +dev_name (&ch->mtu->pdev->dev), ch); +if (ret) { +dev_err (&ch->mtu->pdev->dev,"ch%u: failed to request irq %d\n" , + index, irq); +return ret; } -return sh_mtu2_register (ch,dev_name (&mtu->pdev->dev), clockevent); + ch->base = mtu->mapbase + channel_offsets[index]; + ch->index = index; + +return sh_mtu2_register (ch,dev_name (&mtu->pdev->dev)); }static int sh_mtu2_map_memory (struct sh_mtu2_device *mtu)
@@ -422,46 +391,19 @@ static int sh_mtu2_map_memory(struct sh_mtu2_device *mtu)if (mtu->mapbase ==NULL )return -ENXIO ; -/* -* In legacy platform device configuration (with one device per channel) -* the resource points to the channel base address. -*/ -if (mtu->legacy) { -struct sh_timer_config *cfg = mtu->pdev->dev.platform_data; - mtu->mapbase += cfg->channel_offset; - } -return 0 ; } -static void sh_mtu2_unmap_memory (struct sh_mtu2_device *mtu) -{ -if (mtu->legacy) { -struct sh_timer_config *cfg = mtu->pdev->dev.platform_data; - mtu->mapbase -= cfg->channel_offset; - } - -iounmap (mtu->mapbase); -} -static int sh_mtu2_setup (struct sh_mtu2_device *mtu,struct platform_device *pdev) { -struct sh_timer_config *cfg = pdev->dev.platform_data; -const struct platform_device_id *id = pdev->id_entry;unsigned int i;int ret; mtu->pdev = pdev; - mtu->legacy = id->driver_data; - -if (mtu->legacy && !cfg) { -dev_err (&mtu->pdev->dev,"missing platform data\n" ); -return -ENXIO ; - }/* Get hold of clock. */ - mtu->clk =clk_get (&mtu->pdev->dev, mtu->legacy ?"mtu2_fck" :"fck" ); + mtu->clk =clk_get (&mtu->pdev->dev,"fck" );if (IS_ERR (mtu->clk)) {dev_err (&mtu->pdev->dev,"cannot get clock\n" );return PTR_ERR (mtu->clk);
@@ -479,10 +421,7 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, }/* Allocate and setup the channels. */ -if (mtu->legacy) - mtu->num_channels =1 ; -else - mtu->num_channels =3 ; + mtu->num_channels =3 ; mtu->channels =kzalloc (sizeof (*mtu->channels) * mtu->num_channels,GFP_KERNEL );
@@ -491,16 +430,10 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, goto err_unmap; } -if (mtu->legacy) { - ret =sh_mtu2_setup_channel (&mtu->channels[0 ],0 , mtu); +for (i =0 ; i < mtu->num_channels; ++i) { + ret =sh_mtu2_setup_channel (&mtu->channels[i], i, mtu);if (ret <0 ) goto err_unmap; - }else { -for (i =0 ; i < mtu->num_channels; ++i) { - ret =sh_mtu2_setup_channel (&mtu->channels[i], i, mtu); -if (ret <0 ) - goto err_unmap; - } }platform_set_drvdata (pdev, mtu);
@@ -509,7 +442,7 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, err_unmap:kfree (mtu->channels); -sh_mtu2_unmap_memory (mtu); +iounmap (mtu->mapbase); err_clk_unprepare:clk_unprepare (mtu->clk); err_clk_put:
@@ -562,7 +495,6 @@ static int sh_mtu2_remove(struct platform_device *pdev) }static const struct platform_device_id sh_mtu2_id_table[] = { - {"sh_mtu2" ,1 }, {"sh-mtu2" ,0 }, { }, };
Signature · 1 line
1.8.5.5
PATCH v3 7/19 clocksource: sh_mtu2: Replace global spinlock with a per-device spinlock
In reply to Laurent PinchartThe global spinlock is used to protect the shared start/stop register. Now that all MTU2 channels are handled by a single device instance, use a per-device spinlock.
--- drivers/clocksource/sh_mtu2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/clocksource/sh_mtu2.c +6 -4
@@ -47,14 +47,14 @@ struct sh_mtu2_device {void __iomem *mapbase;struct clk *clk; +raw_spinlock_t lock;/* Protect the shared registers */ +struct sh_mtu2_channel *channels;unsigned int num_channels;bool has_clockevent; }; -static DEFINE_RAW_SPINLOCK (sh_mtu2_lock); -#define TSTR -1/* shared register */ #define TCR 0/* channel register */ #define TMDR 1/* channel register */
@@ -192,7 +192,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_channel *ch, int start)unsigned long flags, value;/* start stop register shared by multiple timer channels */ -raw_spin_lock_irqsave (&sh_mtu2_lock, flags); +raw_spin_lock_irqsave (&ch->mtu->lock, flags); value =sh_mtu2_read (ch,TSTR );if (start)
@@ -201,7 +201,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_channel *ch, int start) value &= ~(1 << ch->index);sh_mtu2_write (ch,TSTR , value); -raw_spin_unlock_irqrestore (&sh_mtu2_lock, flags); +raw_spin_unlock_irqrestore (&ch->mtu->lock, flags); }static int sh_mtu2_enable (struct sh_mtu2_channel *ch)
@@ -402,6 +402,8 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, mtu->pdev = pdev; +raw_spin_lock_init (&mtu->lock); +/* Get hold of clock. */ mtu->clk =clk_get (&mtu->pdev->dev,"fck" );if (IS_ERR (mtu->clk)) {
Signature · 1 line
1.8.5.5
PATCH v3 8/19 clocksource: shmobile: Remove unused sh_timer_config members
In reply to Laurent PinchartThe name, channel_offset, timer_bit, clockevent_rating and clocksource_rating members are unused. Remove them.
--- include/linux/sh_timer.h | 5 ----- 1 file changed, 5 deletions(-)
include/linux/sh_timer.h +0 -5
@@ -2,11 +2,6 @@#define __SH_TIMER_H__struct sh_timer_config { -char *name; -long channel_offset; -int timer_bit; -unsigned long clockevent_rating; -unsigned long clocksource_rating;unsigned int channels_mask; };
Signature · 1 line
1.8.5.5
PATCH v3 9/19 clocksource: sh_cmt: Add DT support
In reply to Laurent PinchartDocument DT bindings and parse them in the CMT driver.
--- .../devicetree/bindings/timer/renesas,cmt.txt | 49 ++++++++++++++++ drivers/clocksource/sh_cmt.c | 66 ++++++++++++++++------ 2 files changed, 97 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/renesas,cmt.txt
Documentation/devicetree/bindings/timer/renesas,cmt.txt new file +49 -0
@@ -0,0 +1,49 @@ +* Renesas R-Car Compare Match Timer (CMT) + +The CMT is a multi-channel 16/32/48-bit timer/counter with configurable clock +inputs and programmable compare match. + +Channels share hardware resources but their counter and compare match value +are independent. A particular CMT instance can implement only a subset of the +channels supported by the CMT model. Channel indices represent the hardware +position of the channel in the CMT and don't match the channel numbers in the +datasheets. + +Required Properties: + + - compatible: must contain one of the following. + - "renesas,cmt-32" for the 32-bit CMT + (CMT0 on sh7372, sh73a0 and r8a7740) + - "renesas,cmt-32-fast" for the 32-bit CMT with fast clock support + (CMT[234] on sh7372, sh73a0 and r8a7740) + - "renasas,cmt-48" for the 48-bit CMT + (CMT1 on sh7372, sh73a0 and r8a7740) + - "renesas,cmt-48-gen2" for the second generation 48-bit CMT + (CMT[01] on r8a73a4, r8a7790 and r8a7791) + + - reg: base address and length of the registers block for the timer module. + - interrupt-parent, interrupts: interrupt-specifier for the timer, one per + channel. + - clocks: a list of phandle + clock-specifier pairs, one for each entry + in clock-names. + - clock-names: must contain "fck" for the functional clock. + + - renesas,channels-mask: bitmask of the available channels. + + +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. + + cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>; + 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>; + };
drivers/clocksource/sh_cmt.c +48 -18
119 lines not on this page · raw message
Signature · 1 line
1.8.5.5
PATCH v3 10/19 clocksource: sh_tmu: Add DT support
In reply to Laurent PinchartDocument DT bindings and parse them in the TMU driver.
--- .../devicetree/bindings/timer/renesas,tmu.txt | 40 +++++++++++++++++++ drivers/clocksource/sh_tmu.c | 45 ++++++++++++++++++---- 2 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/renesas,tmu.txt
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +40 -0
@@ -0,0 +1,40 @@ +* Renesas R-Car Timer Unit (TMU) + +The TMU is a 32-bit timer/counter with configurable clock inputs and +programmable compare match. + +Channels share hardware resources but their counter and compare match value +are independent. The TMU hardware supports up to three channels. + +Required Properties: + + - compatible: must contain "renesas,tmu" + + - 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 + in clock-names. + - clock-names: must contain "fck" for the functional clock. + +Optional Properties: + + - #renesas,channels: number of channels implemented by the timer, must be 2 + or 3 (if not specified the value defaults to 3). + + +Example: R8A7779 (R-Car H1) TMU0 node + + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupt-parent = <&gic>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + };
drivers/clocksource/sh_tmu.c +37 -8
85 lines not on this page · raw message
Signature · 1 line
1.8.5.5
PATCH v3 10/19 clocksource: sh_tmu: Add DT support
Hi Laurent,
thanks for your patch.
Quoted 3 lines · Laurent Pinchart
Document DT bindings and parse them in the TMU driver.
Signed-off-by Laurent Pinchart <[email protected]>
[snip]
Quoted 55 lines
drivers/clocksource/sh_tmu.c +23
-6@@ -24,6 +24,7 @@#include <linux/ioport.h> #include <linux/irq.h> #include <linux/module.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/pm_runtime.h> @@ -509,23 +510,46 @@ static int sh_tmu_map_memory(struct sh_tmu_device *tmu)return 0 ; } +static int sh_tmu_parse_dt (struct sh_tmu_device *tmu) +{ +struct device_node *np = tmu->pdev->dev.of_node; + + tmu->num_channels =3 ; +of_property_read_u32 (np,"#renesas,channels" , &tmu->num_channels); + +if (tmu->num_channels !=2 && tmu->num_channels !=3 ) { +dev_err (&tmu->pdev->dev,"invalid number of channels %u\n" , + tmu->num_channels); +return -EINVAL ; + } + +return 0 ; +} +static int sh_tmu_setup (struct sh_tmu_device *tmu,struct platform_device *pdev) { -struct sh_timer_config *cfg = pdev->dev.platform_data;const struct platform_device_id *id = pdev->id_entry;unsigned int i;int ret; -if (!cfg) { -dev_err (&tmu->pdev->dev,"missing platform data\n" ); -return -ENXIO ; - } - tmu->pdev = pdev; tmu->model = id->driver_data;raw_spin_lock_init (&tmu->lock); +if (IS_ENABLED (CONFIG_OF ) && pdev->dev.of_node) { + ret =sh_tmu_parse_dt (tmu); +if (ret <0 ) +return ret; + }else if (pdev->dev.platform_data) { +struct sh_timer_config *cfg = pdev->dev.platform_data;
drivers/clocksource/sh_tmu.c static int sh_tmu_map_memory(struct sh_tmu_device *tmu) · line 555
Quoted 10 lines
drivers/clocksource/sh_tmu.c +7
-0+ + tmu->num_channels =hweight8 (cfg->channels_mask); + }else { +dev_err (&tmu->pdev->dev,"missing platform data\n" ); +return -ENXIO ; + } +/* Get hold of clock. */ tmu->clk =clk_get (&tmu->pdev->dev,"fck" );if (IS_ERR (tmu->clk)) {
[snip]
I had a bit of trouble running this code and after some investigation it seems to me that in the case of using DT id will be NULL and thus things do not go well when id->driver_data is accessed.
The following incremental patch resolved the problem for me.
drivers/clocksource/sh_tmu.c +3 -1
@@ -523,6 +523,8 @@ static int sh_tmu_parse_dt(struct sh_tmu_device *tmu)return -EINVAL ; } + tmu->model =SH_TMU ; +return 0 ; }
@@ -533,7 +535,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)int ret; tmu->pdev = pdev; - tmu->model = id->driver_data;raw_spin_lock_init (&tmu->lock);
@@ -545,6 +546,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)struct sh_timer_config *cfg = pdev->dev.platform_data; tmu->num_channels =hweight8 (cfg->channels_mask); + tmu->model = id->driver_data; }else {dev_err (&tmu->pdev->dev,"missing platform data\n" );return -ENXIO ;
PATCH v3 10/19 clocksource: sh_tmu: Add DT support
Hi Simon,
Quoted 12 lines · On Monday 16 June 2014 17:34:23 Simon Horman wrote:
Quoted 4 lines · Laurent Pinchart
Document DT bindings and parse them in the TMU driver.
Signed-off-by: Laurent Pinchart
<[email protected]>[snip]
Quoted 4 lines
drivers/clocksource/sh_tmu.c +0
-0
[snip]
Quoted 58 lines
Quoted 55 lines
drivers/clocksource/sh_tmu.c +29
-6@@ -509,23 +510,46 @@ static int sh_tmu_map_memory(struct sh_tmu_device *tmu)return 0 ; } +static int sh_tmu_parse_dt (struct sh_tmu_device *tmu) +{ +struct device_node *np = tmu->pdev->dev.of_node; + + tmu->num_channels =3 ; +of_property_read_u32 (np,"#renesas,channels" , &tmu->num_channels); + +if (tmu->num_channels !=2 && tmu->num_channels !=3 ) { +dev_err (&tmu->pdev->dev,"invalid number of channels %u\n" , + tmu->num_channels); +return -EINVAL ; + } + +return 0 ; +} +static int sh_tmu_setup (struct sh_tmu_device *tmu,struct platform_device *pdev) { -struct sh_timer_config *cfg = pdev->dev.platform_data;const struct platform_device_id *id = pdev->id_entry;unsigned int i;int ret; -if (!cfg) { -dev_err (&tmu->pdev->dev,"missing platform data\n" ); -return -ENXIO ; - } - tmu->pdev = pdev; tmu->model = id->driver_data;raw_spin_lock_init (&tmu->lock); +if (IS_ENABLED (CONFIG_OF ) && pdev->dev.of_node) { + ret =sh_tmu_parse_dt (tmu); +if (ret <0 ) +return ret; + }else if (pdev->dev.platform_data) { +struct sh_timer_config *cfg = pdev->dev.platform_data; + + tmu->num_channels =hweight8 (cfg->channels_mask); + }else { +dev_err (&tmu->pdev->dev,"missing platform data\n" ); +return -ENXIO ; + } +/* Get hold of clock. */ drivers/clocksource/sh_tmu.c +0
-0tmu->clk =clk_get (&tmu->pdev->dev,"fck" );if (IS_ERR (tmu->clk)) {[snip]
Quoted 3 lines
I had a bit of trouble running this code and after some investigation it seems to me that in the case of using DT id will be NULL and thus things do not go well when
id->driver_datais accessed.
Indeed. I wonder how I've missed that :-/ Anyway, I'll fix it and resubmit.
Quoted 32 lines
The following incremental patch resolved the problem for me.
drivers/clocksource/sh_tmu.c +2
-1@@ -523,6 +523,8 @@ static int sh_tmu_parse_dt(struct sh_tmu_device *tmu)return -EINVAL ; } + tmu->model =SH_TMU ; +return 0 ; }@@ -533,7 +535,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) int ret; tmu->pdev = pdev; - tmu->model = id->driver_data;raw_spin_lock_init (&tmu->lock);@@ -545,6 +546,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu,struct
platform_device*pdev) structsh_timer_config*cfg =pdev->dev.platform_data;drivers/clocksource/sh_tmu.c +1
-0tmu->num_channels =hweight8 (cfg->channels_mask); + tmu->model = id->driver_data; }else {dev_err (&tmu->pdev->dev,"missing platform data\n" );return -ENXIO ;
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 10/19 clocksource: sh_tmu: Add DT support
In reply to Laurent PinchartQuoted 45 lines · Laurent Pinchart
Document DT bindings and parse them in the TMU driver.
Signed-off-by Laurent Pinchart <[email protected]>--- .../devicetree/bindings/timer/renesas,tmu.txt | 40 +++++++++++++++++++ drivers/clocksource/sh_tmu.c | 45 ++++++++++++++++++---- 2 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/renesas,tmu.txtDocumentation/devicetree/bindings/timer/renesas,tmu.txt new file +30
-0@@ -0,0 +1,40 @@ +* Renesas R-Car Timer Unit (TMU) + +The TMU is a 32-bit timer/counter with configurable clock inputs and +programmable compare match. + +Channels share hardware resources but their counter and compare match value +are independent. The TMU hardware supports up to three channels. + +Required Properties: + + - compatible: must contain "renesas,tmu" + + - 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 + in clock-names. + - clock-names: must contain "fck" for the functional clock. + +Optional Properties: + + - #renesas,channels: number of channels implemented by the timer, must be 2 + or 3 (if not specified the value defaults to 3). + + +Example: R8A7779 (R-Car H1) TMU0 node + + tmu0: timer at ffd80000 { + compatible = "renesas,tmu";
Documentation/devicetree/bindings/timer/renesas,tmu.txt line 40
Quoted 10 lines
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +10
-0+ reg = <0xffd80000 0x30>; + interrupt-parent = <&gic>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + };
As per my feedback for "[PATCH v3 14/19] ARM: shmobile: r8a7779: Add TMU devices to DT" I believe the IRQ values should be 32, 33 and 34, not 40, 41, 42. I realise this is just an example but I feel that I should mention it.
PATCH v3 10/19 clocksource: sh_tmu: Add DT support
Hi Simon,
Quoted 60 lines · On Monday 16 June 2014 17:48:32 Simon Horman wrote:
Quoted 59 lines · Laurent Pinchart
Document DT bindings and parse them in the TMU driver.
Signed-off-by: Laurent Pinchart
<[email protected]>
---.../devicetree/bindings/timer/renesas,tmu.txt | 40 +++++++++++++++++ drivers/clocksource/sh_tmu.c | 45 +++++++++++++---- 2 files changed, 77 insertions(+), 8 deletions(-) create mode 100644
Documentation/devicetree/bindings/timer/renesas,tmu.txt(quoted diff) +0
-0
b/Documentation/devicetree/bindings/timer/renesas,tmu.txtnew file mode 100644
index 0000000..2392e89Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +6
-0@@ -0,0 +1,40 @@ +* Renesas R-Car Timer Unit (TMU) + +The TMU is a 32-bit timer/counter with configurable clock inputs and +programmable compare match. + +Channels share hardware resources but their counter and compare matchvalue
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +7
-0+are independent. The TMU hardware supports up to three channels. + +Required Properties: + + - compatible: must contain "renesas,tmu" + + - reg: base address and length of the registers block for the timermodule.
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +10
-0+ + - interrupts: interrupt-specifier for the timer, one per channel. + + - clocks: a list of phandle + clock-specifier pairs, one for each entry + in clock-names. + - clock-names: must contain "fck" for the functional clock. + +Optional Properties: + + - #renesas,channels: number of channels implemented by the timer, mustbe 2
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +14
-0+ or 3 (if not specified the value defaults to 3). + + +Example: R8A7779 (R-Car H1) TMU0 node + + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupt-parent = <&gic>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck";
Quoted 8 lines
Documentation/devicetree/bindings/timer/renesas,tmu.txt line 40
Quoted 3 lines
Documentation/devicetree/bindings/timer/renesas,tmu.txt new file +3
-0+ + #renesas,channels = <3>; + };As per my feedback for "[PATCH v3 14/19] ARM: shmobile: r8a7779: Add TMU devices to DT" I believe the IRQ values should be 32, 33 and 34, not 40, 41, 42. I realise this is just an example but I feel that I should mention it.
Sure, I'll fix that, and remove the interrupt-parent property.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 11/19 clocksource: sh_mtu2: Add DT support
In reply to Laurent PinchartDocument DT bindings and parse them in the MTU2 driver.
--- .../devicetree/bindings/timer/renesas,mtu2.txt | 40 ++++++++++++++++++++++ drivers/clocksource/sh_mtu2.c | 8 +++++ 2 files changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/renesas,mtu2.txt
Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +40 -0
@@ -0,0 +1,40 @@ +* Renesas R-Car Multi-Function Timer Pulse Unit 2 (MTU2) + +The MTU2 is a multi-purpose, multi-channel timer/counter with configurable +clock inputs and programmable compare match. + +Channels share hardware resources but their counter and compare match value +are independent. The MTU2 hardware supports five channels indexed from 0 to 4. + +Required Properties: + + - compatible: must contain "renesas,mtu2" + + - reg: base address and length of the registers block for the timer module. + + - interrupt-parent, interrupts: interrupt specifiers for the timer, one for + each entry in interrupt-names. + - interrupt-names: must contain one entry named "tgi?a" for each enabled + channel, where "?" is the channel index expressed as one digit from "0" to + "4". + + - clocks: a list of phandle + clock-specifier pairs, one for each entry + in clock-names. + - clock-names: must contain "fck" for the functional clock. + + +Example: R7S72100 (RZ/A1H) MTU2 node + + mtu2: timer at fcff0000 { + compatible = "renesas,mtu2"; + reg = <0xfcff0000 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 139 IRQ_TYPE_LEVEL_HIGH>, + <0 146 IRQ_TYPE_LEVEL_HIGH>, + <0 150 IRQ_TYPE_LEVEL_HIGH>, + <0 154 IRQ_TYPE_LEVEL_HIGH>, + <0 159 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tgi0a", "tgi1a", "tgi2a", "tgi3a", "tgi4a"; + clocks = <&mstp3_clks R7S72100_CLK_MTU2>; + clock-names = "fck"; + };
drivers/clocksource/sh_mtu2.c +8 -0
@@ -23,6 +23,7 @@#include <linux/ioport.h> #include <linux/irq.h> #include <linux/module.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/pm_runtime.h>
@@ -502,11 +503,18 @@ static const struct platform_device_id sh_mtu2_id_table[] = { };MODULE_DEVICE_TABLE (platform, sh_mtu2_id_table); +static const struct of_device_id sh_mtu2_of_table[] = { + { .compatible ="renesas,mtu2" }, + { } +}; +MODULE_DEVICE_TABLE (of, sh_mtu2_of_table); +static struct platform_driver sh_mtu2_device_driver = { .probe = sh_mtu2_probe, .remove = sh_mtu2_remove, .driver = { .name ="sh_mtu2" , + .of_match_table =of_match_ptr (sh_mtu2_of_table), }, .id_table = sh_mtu2_id_table, };
Signature · 1 line
1.8.5.5
PATCH v3 11/19 clocksource: sh_mtu2: Add DT support
Quoted 22 lines · Laurent Pinchart
Document DT bindings and parse them in the MTU2 driver.
Signed-off-by Laurent Pinchart <[email protected]>Tested-by Wolfram Sang <[email protected]>--- .../devicetree/bindings/timer/renesas,mtu2.txt | 40 ++++++++++++++++++++++ drivers/clocksource/sh_mtu2.c | 8 +++++ 2 files changed, 48 insertions(+)create mode 100644
Documentation/devicetree/bindings/timer/renesas,mtu2.txtDocumentation/devicetree/bindings/timer/renesas,mtu2.txt new file +6
-0@@ -0,0 +1,40 @@ +* Renesas R-Car Multi-Function Timer Pulse Unit 2 (MTU2) + +The MTU2 is a multi-purpose, multi-channel timer/counter with configurable +clock inputs and programmable compare match. + +Channels share hardware resources but their counter and compare match value
Documentation/devicetree/bindings/timer/renesas,mtu2.txt line 16
Quoted 10 lines
Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +10
-0+are independent. The MTU2 hardware supports five channels indexed from 0 to 4. + +Required Properties: + + - compatible: must contain "renesas,mtu2" + + - reg: base address and length of the registers block for the timer module. + + - interrupt-parent, interrupts: interrupt specifiers for the timer, one for + each entry in interrupt-names.
The "interrupt-parent" has never been a required property, it can and
should be inherited from an upper level node.
[...]
Quoted 4 lines
drivers/clocksource/sh_mtu2.c +0
-0
[...]
Quoted 6 lines
drivers/clocksource/sh_mtu2.c +2
-0@@ -502,11 +503,18 @@ static const struct platform_device_id sh_mtu2_id_table[] = { };MODULE_DEVICE_TABLE (platform, sh_mtu2_id_table); +static const struct of_device_id sh_mtu2_of_table[] = { + { .compatible ="renesas,mtu2" },
drivers/clocksource/sh_mtu2.c static const struct platform_device_id sh_mtu2_id_table[] = { · line 517
Quoted 10 lines
drivers/clocksource/sh_mtu2.c +5
-0+ { } +}; +MODULE_DEVICE_TABLE (of, sh_mtu2_of_table); +static struct platform_driver sh_mtu2_device_driver = { .probe = sh_mtu2_probe, .remove = sh_mtu2_remove, .driver = { .name ="sh_mtu2" , + .of_match_table =of_match_ptr (sh_mtu2_of_table),
No need for of_match_ptr() since the table us not protected by #ifdefCONFIG_OF...
WBR, Sergei
PATCH v3 11/19 clocksource: sh_mtu2: Add DT support
Hi Sergei,
Quoted 37 lines · On Saturday 14 June 2014 21:00:20 Sergei Shtylyov wrote:
Quoted 36 lines · Laurent Pinchart
Document DT bindings and parse them in the MTU2 driver.
Signed-off-by: Laurent Pinchart
<[email protected]>Tested-by Wolfram Sang <[email protected]>---
.../devicetree/bindings/timer/renesas,mtu2.txt | 40 +++++++++++++++++ drivers/clocksource/sh_mtu2.c | 8 +++++ 2 files changed, 48 insertions(+)create mode 100644
Documentation/devicetree/bindings/timer/renesas,mtu2.txt(quoted diff) +0
-0
b/Documentation/devicetree/bindings/timer/renesas,mtu2.txtnew file mode 100644
index 0000000..c5dd032Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +3
-0@@ -0,0 +1,40 @@ +* Renesas R-Car Multi-Function Timer Pulse Unit 2 (MTU2) + +The MTU2 is a multi-purpose, multi-channel timer/counter withconfigurable
Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +3
-0+clock inputs and programmable compare match. + +Channels share hardware resources but their counter and compare matchvalue
+are independent. The MTU2 hardware supports five channels indexed from 0 to 4.Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +6
-0+ +Required Properties: + + - compatible: must contain "renesas,mtu2" + + - reg: base address and length of the registers block for the timer
Quoted 8 lines
Quoted 5 lines
module.
Documentation/devicetree/bindings/timer/renesas,mtu2.txt new file +2
-0+ + - interrupt-parent, interrupts: interrupt specifiers for the timer, onefor
+ each entry in interrupt-names.The "interrupt-parent" has never been a required property, it can and should be inherited from an upper level node.
Only when it makes sense (which is the case here). We need a standard wording to describe the interrupt-related properties. In the meantime I'll drop interrupt-parent.
Quoted 14 lines
[...]
Quoted 4 lines
drivers/clocksource/sh_mtu2.c +0
-0[...]
Quoted 5 lines
drivers/clocksource/sh_mtu2.c +0
-0@@ -502,11 +503,18 @@ static const struct platform_device_idsh_mtu2_id_table[] = {>
};
MODULE_DEVICE_TABLE(platform, sh_mtu2_id_table);
Quoted 15 lines
drivers/clocksource/sh_mtu2.c static const struct platform_device_id sh_mtu2_id_table[] = { · line 517
Quoted 12 lines
drivers/clocksource/sh_mtu2.c +7
-0+static const struct of_device_id sh_mtu2_of_table[] = { + { .compatible ="renesas,mtu2" }, + { } +}; +MODULE_DEVICE_TABLE (of, sh_mtu2_of_table); +static struct platform_driver sh_mtu2_device_driver = { .probe = sh_mtu2_probe, .remove = sh_mtu2_remove, .driver = { .name ="sh_mtu2" , + .of_match_table =of_match_ptr (sh_mtu2_of_table),No need for
of_match_ptr()since the table us not protected by #ifdefCONFIG_OF...
I'll fix that.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 11/19 clocksource: sh_mtu2: Add DT support
Hi Sergei,
Quoted 15 lines · On Monday 16 June 2014 16:40:55 Laurent Pinchart wrote:
Quoted 14 lines · On Saturday 14 June 2014 21:00:20 Sergei Shtylyov wrote:
Quoted 13 lines · Laurent Pinchart
Document DT bindings and parse them in the MTU2 driver.
Signed-off-by: Laurent Pinchart
<[email protected]>Tested-by Wolfram Sang <[email protected]>---
.../devicetree/bindings/timer/renesas,mtu2.txt | 40 +++++++++++++++ drivers/clocksource/sh_mtu2.c | 8 +++++2 files changed, 48 insertions(+)create mode 100644
Documentation/devicetree/bindings/timer/renesas,mtu2.txt
[snip]
Quoted 29 lines
Quoted 13 lines
Quoted 5 lines
drivers/clocksource/sh_mtu2.c +0
-0[...]
Quoted 5 lines
drivers/clocksource/sh_mtu2.c +0
-0@@ -502,11 +503,18 @@ static const struct platform_device_id sh_mtu2_id_table[] = { };MODULE_DEVICE_TABLE (platform, sh_mtu2_id_table);Quoted 15 lines
drivers/clocksource/sh_mtu2.c static const struct platform_device_id sh_mtu2_id_table[] = { · line 517
Quoted 12 lines
drivers/clocksource/sh_mtu2.c +7
-0+static const struct of_device_id sh_mtu2_of_table[] = { + { .compatible ="renesas,mtu2" }, + { } +}; +MODULE_DEVICE_TABLE (of, sh_mtu2_of_table); +static struct platform_driver sh_mtu2_device_driver = { .probe = sh_mtu2_probe, .remove = sh_mtu2_remove, .driver = { .name ="sh_mtu2" , + .of_match_table =of_match_ptr (sh_mtu2_of_table),No need for
of_match_ptr()since the table us not protected by #ifdefCONFIG_OF...
Quoted 1 line
I'll fix that.
I spoke too fast. On non-OF platforms memory shouldn't be wasted by the OF match table. I'll mark the table as __maybe_unused and keep of_match_ptr().
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 12/19 ARM: shmobile: r8a7790: Add CMT devices to DT
In reply to Laurent PinchartAdd the CMT0 and CMT1 counters to the r8a7790 device tree and make them disabled by default.
--- arch/arm/boot/dts/r8a7790.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +34 -0
@@ -206,6 +206,40 @@ <1 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; + cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>; + interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, + <0 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7790_CLK_CMT0>; + clock-names = "fck"; + + renesas,channels-mask = <0x60>; + + status = "disabled"; + }; + + cmt1: timer at e6130000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; + interrupt-parent = <&gic>; + 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"; + + renesas,channels-mask = <0xff>; + + status = "disabled"; + }; + irqc0: interrupt-controller at e61c0000 { compatible = "renesas,irqc-r8a7790", "renesas,irqc"; #interrupt-cells = <2>;
Signature · 1 line
1.8.5.5
PATCH v3 12/19 ARM: shmobile: r8a7790: Add CMT devices to DT
Hello.
Quoted 13 lines · Laurent Pinchart
Add the CMT0 and CMT1 counters to the r8a7790 device tree and make them disabled by default.
Signed-off-by Laurent Pinchart <[email protected]>--- arch/arm/boot/dts/r8a7790.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)arch/arm/boot/dts/r8a7790.dtsi +0
-0
arch/arm/boot/dts/r8a7790.dtsi line 212
Quoted 7 lines
arch/arm/boot/dts/r8a7790.dtsi +4
-0@@ -206,6 +206,40 @@ <1 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; + cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>;
This prop is inherited from the root node, so unneeded here.
Quoted 4 lines
arch/arm/boot/dts/r8a7790.dtsi +4
-0+ interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, + <0 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7790_CLK_CMT0>; + clock-names = "fck";
arch/arm/boot/dts/r8a7790.dtsi line 226
Quoted 10 lines
arch/arm/boot/dts/r8a7790.dtsi +10
-0+ + renesas,channels-mask = <0x60>; + + status = "disabled"; + }; + + cmt1: timer at e6130000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; + interrupt-parent = <&gic>;
Likewise.
WBR, Sergei
PATCH v3 12/19 ARM: shmobile: r8a7790: Add CMT devices to DT
Hi Sergei,
Quoted 19 lines · On Saturday 14 June 2014 20:54:05 Sergei Shtylyov wrote:
Quoted 18 lines · Laurent Pinchart
Add the CMT0 and CMT1 counters to the r8a7790 device tree and make them disabled by default.
Signed-off-by: Laurent Pinchart
<[email protected]>
---arch/arm/boot/dts/r8a7790.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7790.dtsiindex 29907c9..cc32ac5 100644arch/arm/boot/dts/r8a7790.dtsi +0
-0@@ -206,6 +206,40 @@ <1 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; };
Quoted 6 lines
arch/arm/boot/dts/r8a7790.dtsi line 212
Quoted 4 lines
arch/arm/boot/dts/r8a7790.dtsi +4
-0+ cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>;This prop is inherited from the root node, so unneeded here.
Thank you, I'll fix that. Same for patch 13/19.
Quoted 16 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7790.dtsi +4
-0+ interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, + <0 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7790_CLK_CMT0>; + clock-names = "fck";arch/arm/boot/dts/r8a7790.dtsi line 226
Quoted 10 lines
arch/arm/boot/dts/r8a7790.dtsi +10
-0+ + renesas,channels-mask = <0x60>; + + status = "disabled"; + }; + + cmt1: timer at e6130000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; + interrupt-parent = <&gic>;Likewise.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 13/19 ARM: shmobile: r8a7791: Add CMT devices to DT
In reply to Laurent PinchartAdd the CMT0 and CMT1 counters to the r8a7791 device tree and make them disabled by default.
--- arch/arm/boot/dts/r8a7791.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
arch/arm/boot/dts/r8a7791.dtsi +34 -0
@@ -189,6 +189,40 @@ <1 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; + cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>; + interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, + <0 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7791_CLK_CMT0>; + clock-names = "fck"; + + renesas,channels-mask = <0x60>; + + status = "disabled"; + }; + + cmt1: timer at e6130000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; + interrupt-parent = <&gic>; + 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 R8A7791_CLK_CMT1>; + clock-names = "fck"; + + renesas,channels-mask = <0xff>; + + status = "disabled"; + }; + irqc0: interrupt-controller at e61c0000 { compatible = "renesas,irqc-r8a7791", "renesas,irqc"; #interrupt-cells = <2>;
Signature · 1 line
1.8.5.5
PATCH v3 13/19 ARM: shmobile: r8a7791: Add CMT devices to DT
Quoted 13 lines · Laurent Pinchart
Add the CMT0 and CMT1 counters to the r8a7791 device tree and make them disabled by default.
Signed-off-by Laurent Pinchart <[email protected]>--- arch/arm/boot/dts/r8a7791.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)arch/arm/boot/dts/r8a7791.dtsi +0
-0
arch/arm/boot/dts/r8a7791.dtsi line 195
Quoted 7 lines
arch/arm/boot/dts/r8a7791.dtsi +4
-0@@ -189,6 +189,40 @@ <1 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; + cmt0: timer at ffca0000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xffca0000 0 0x1004>; + interrupt-parent = <&gic>;
This prop inherited from the root node, no need to specify it here.
Quoted 4 lines
arch/arm/boot/dts/r8a7791.dtsi +4
-0+ interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, + <0 143 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7791_CLK_CMT0>; + clock-names = "fck";
arch/arm/boot/dts/r8a7791.dtsi line 209
Quoted 10 lines
arch/arm/boot/dts/r8a7791.dtsi +10
-0+ + renesas,channels-mask = <0x60>; + + status = "disabled"; + }; + + cmt1: timer at e6130000 { + compatible = "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; + interrupt-parent = <&gic>;
Likewise.
WBR, Sergei
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
In reply to Laurent PinchartAdd the TMU0, TMU1 and TMU2 counters to the r8a7779 device tree and make them disabled by default.
--- arch/arm/boot/dts/r8a7779.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
arch/arm/boot/dts/r8a7779.dtsi +42 -0
@@ -266,6 +266,48 @@ reg = <0xffc48000 0x38>; }; + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu1: timer at ffd81000 { + compatible = "renesas,tmu"; + reg = <0xffd81000 0x30>; + interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, + <0 45 IRQ_TYPE_LEVEL_HIGH>, + <0 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU1>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu2: timer at ffd82000 { + compatible = "renesas,tmu"; + reg = <0xffd82000 0x30>; + interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, + <0 49 IRQ_TYPE_LEVEL_HIGH>, + <0 50 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU2>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + sata: sata at fc600000 { compatible = "renesas,rcar-sata"; reg = <0xfc600000 0x2000>;
Signature · 1 line
1.8.5.5
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
Hi Laurent,
thanks for your patch.
Quoted 63 lines · Laurent Pinchart
Add the TMU0, TMU1 and TMU2 counters to the r8a7779 device tree and make them disabled by default.
Signed-off-by Laurent Pinchart <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)arch/arm/boot/dts/r8a7779.dtsi +42
-0@@ -266,6 +266,48 @@ reg = <0xffc48000 0x38>; }; + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu1: timer at ffd81000 { + compatible = "renesas,tmu"; + reg = <0xffd81000 0x30>; + interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, + <0 45 IRQ_TYPE_LEVEL_HIGH>, + <0 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU1>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu2: timer at ffd82000 { + compatible = "renesas,tmu"; + reg = <0xffd82000 0x30>; + interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, + <0 49 IRQ_TYPE_LEVEL_HIGH>, + <0 50 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU2>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + sata: sata at fc600000 { compatible = "renesas,rcar-sata"; reg = <0xfc600000 0x2000>;Signature · 1 line
1.8.5.5
There are no interrupt-parents in in the nodes above nodes although the documentation of the binding has one in the example. Is it just an oversight in this patch?
I believe that the IRQ numbers are not correct.
In setup-r8a7779.c I see gic_iid(0x40). But above I see 40. I think the correct value is 0x40 - 32 = 32. Likewise for the other IRQs of tmu0. And looking at the documentaiton this seems true for tmu1 and tmu2 too.
I have successfully booted a marzen board with the following incremental patch to the DT nodes.
arch/arm/boot/dts/r8a7779.dtsi +12 -9
@@ -269,9 +269,10 @@ tmu0: timer at ffd80000 { compatible = "renesas,tmu"; reg = <0xffd80000 0x30>; - interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, - <0 41 IRQ_TYPE_LEVEL_HIGH>, - <0 42 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, + <0 33 IRQ_TYPE_LEVEL_HIGH>, + <0 34 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU0>; clock-names = "fck";
@@ -283,9 +284,10 @@ tmu1: timer at ffd81000 { compatible = "renesas,tmu"; reg = <0xffd81000 0x30>; - interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, - <0 45 IRQ_TYPE_LEVEL_HIGH>, - <0 46 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, + <0 36 IRQ_TYPE_LEVEL_HIGH>, + <0 37 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU1>; clock-names = "fck";
@@ -296,10 +298,11 @@ tmu2: timer at ffd82000 { compatible = "renesas,tmu"; + interrupt-parent = <&gic>; reg = <0xffd82000 0x30>; - interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, - <0 49 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>, + <0 39 IRQ_TYPE_LEVEL_HIGH>, + <0 40 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU2>; clock-names = "fck";
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
Hi Simon,
Quoted 60 lines · On Monday 16 June 2014 17:47:07 Simon Horman wrote:
Quoted 59 lines · Laurent Pinchart
Add the TMU0, TMU1 and TMU2 counters to the r8a7779 device tree and make them disabled by default.
Signed-off-by: Laurent Pinchart
<[email protected]>
---arch/arm/boot/dts/r8a7779.dtsi | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7779.dtsiindex 94e2fc8..bf716ce 100644arch/arm/boot/dts/r8a7779.dtsi +41
-0@@ -266,6 +266,48 @@ reg = <0xffc48000 0x38>; }; + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu1: timer at ffd81000 { + compatible = "renesas,tmu"; + reg = <0xffd81000 0x30>; + interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, + <0 45 IRQ_TYPE_LEVEL_HIGH>, + <0 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU1>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu2: timer at ffd82000 { + compatible = "renesas,tmu"; + reg = <0xffd82000 0x30>; + interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, + <0 49 IRQ_TYPE_LEVEL_HIGH>, + <0 50 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU2>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + };
Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 313
Quoted 4 lines
arch/arm/boot/dts/r8a7779.dtsi +1
-0+ sata: sata at fc600000 { compatible = "renesas,rcar-sata"; reg = <0xfc600000 0x2000>;There are no interrupt-parents in in the nodes above nodes although the documentation of the binding has one in the example. Is it just an oversight in this patch?
Not really.
The interrupt-parent property is required but can be inherited. Furthermore, the interrupts-extended property can be used to replace the interrupts and interrupt-parent properties. This should all be documented in the DT bindings, but not by duplicating the full explanation in dozens of different flavours in all bindings. We need standard wordings for common properties such as interrupts, clocks or reg.
Quoted 9 lines
I believe that the IRQ numbers are not correct.
In
setup-r8a7779.cI seegic_iid(0x40). But above I see 40. I think the correct value is0x40- 32 = 32. Likewise for the other IRQs of tmu0. And looking at the documentaiton this seems true for tmu1 and tmu2 too.I have successfully booted a marzen board with the following incremental patch to the DT nodes.
You're right, sorry about that. I'll fix the interrupt numbers and resubmit. The interrupt-parent is specified at the top level so there's no need to add it to the TMU nodes.
Quoted 19 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -269,9 +269,10 @@ tmu0: timer at ffd80000 { compatible = "renesas,tmu"; reg = <0xffd80000 0x30>; - interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, - <0 41 IRQ_TYPE_LEVEL_HIGH>, - <0 42 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, + <0 33 IRQ_TYPE_LEVEL_HIGH>, + <0 34 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU0>; clock-names = "fck";
arch/arm/boot/dts/r8a7779.dtsi line 290
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -283,9 +284,10 @@ tmu1: timer at ffd81000 { compatible = "renesas,tmu"; reg = <0xffd81000 0x30>; - interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, - <0 45 IRQ_TYPE_LEVEL_HIGH>, - <0 46 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, + <0 36 IRQ_TYPE_LEVEL_HIGH>, + <0 37 IRQ_TYPE_LEVEL_HIGH>;
If I'm not mistaken the interrupts should be 36, 37 and 38.
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU1>; clock-names = "fck";@@ -296,10 +298,11 @@
arch/arm/boot/dts/r8a7779.dtsi line 305
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3tmu2: timer at ffd82000 { compatible = "renesas,tmu"; + interrupt-parent = <&gic>; reg = <0xffd82000 0x30>; - interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, - <0 49 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>, + <0 39 IRQ_TYPE_LEVEL_HIGH>, + <0 40 IRQ_TYPE_LEVEL_HIGH>;
And 40, 41 and 42 here.
Quoted 2 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU2>; clock-names = "fck";
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
Hi Laurent,
Quoted 18 lines · Laurent Pinchart
Quoted 18 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -269,9 +269,10 @@ tmu0: timer at ffd80000 { compatible = "renesas,tmu"; reg = <0xffd80000 0x30>; - interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, - <0 41 IRQ_TYPE_LEVEL_HIGH>, - <0 42 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, + <0 33 IRQ_TYPE_LEVEL_HIGH>, + <0 34 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU0>; clock-names = "fck";
Quoted 13 lines
arch/arm/boot/dts/r8a7779.dtsi line 290
Quoted 11 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -283,9 +284,10 @@ tmu1: timer at ffd81000 { compatible = "renesas,tmu"; reg = <0xffd81000 0x30>; - interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, - <0 45 IRQ_TYPE_LEVEL_HIGH>, - <0 46 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, + <0 36 IRQ_TYPE_LEVEL_HIGH>, + <0 37 IRQ_TYPE_LEVEL_HIGH>;If I'm not mistaken the interrupts should be 36, 37 and 38.
(diving into the documentation)
Yes, probably 36, 37, and 38. I say "probably", as I find it non-trivial to convert from docs to DT.
What happens with 35, which is "TMU21 (input capture)"? As DT describes the hardware, shouldn't it be mentioned here?
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU1>; clock-names = "fck";@@ -296,10 +298,11 @@
Quoted 12 lines
arch/arm/boot/dts/r8a7779.dtsi line 305
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3tmu2: timer at ffd82000 { compatible = "renesas,tmu"; + interrupt-parent = <&gic>; reg = <0xffd82000 0x30>; - interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, - <0 49 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>, + <0 39 IRQ_TYPE_LEVEL_HIGH>, + <0 40 IRQ_TYPE_LEVEL_HIGH>;And 40, 41 and 42 here.
Likewise for "TMU51 (input capture)"?
Quoted 2 lines
arch/arm/boot/dts/r8a7779.dtsi line 307
Quoted 2 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU2>; clock-names = "fck";
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
Hi Geert,
Quoted 34 lines · On Monday 16 June 2014 18:19:02 Geert Uytterhoeven wrote:
Quoted 19 lines · Laurent Pinchart
Quoted 19 lines
(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7779.dtsiindex bf716ce..81714ce 100644arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -269,9 +269,10 @@ tmu0: timer at ffd80000 { compatible = "renesas,tmu"; reg = <0xffd80000 0x30>; - interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, - <0 41 IRQ_TYPE_LEVEL_HIGH>, - <0 42 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, + <0 33 IRQ_TYPE_LEVEL_HIGH>, + <0 34 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU0>; clock-names = "fck";Quoted 13 lines
arch/arm/boot/dts/r8a7779.dtsi line 290
Quoted 11 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -283,9 +284,10 @@ tmu1: timer at ffd81000 { compatible = "renesas,tmu"; reg = <0xffd81000 0x30>; - interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, - <0 45 IRQ_TYPE_LEVEL_HIGH>, - <0 46 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, + <0 36 IRQ_TYPE_LEVEL_HIGH>, + <0 37 IRQ_TYPE_LEVEL_HIGH>;If I'm not mistaken the interrupts should be 36, 37 and 38.
Quoted 7 lines
(diving into the documentation)
Yes, probably 36, 37, and 38. I say "probably", as I find it non-trivial to convert from docs to DT.
What happens with 35, which is "TMU21 (input capture)"? As DT describes the hardware, shouldn't it be mentioned here?
Input capture isn't supported by the TMU driver yet. I haven't checked how the feature is implemented in the hardware, which is why I've left it out from the DT bindings for now.
Quoted 22 lines
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU1>; clock-names = "fck";@@ -296,10 +298,11 @@Quoted 12 lines
arch/arm/boot/dts/r8a7779.dtsi line 305
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3tmu2: timer at ffd82000 { compatible = "renesas,tmu"; + interrupt-parent = <&gic>; reg = <0xffd82000 0x30>; - interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, - <0 49 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>, + <0 39 IRQ_TYPE_LEVEL_HIGH>, + <0 40 IRQ_TYPE_LEVEL_HIGH>;And 40, 41 and 42 here.
Likewise for "TMU51 (input capture)"?
Quoted 2 lines
Quoted 2 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU2>; clock-names = "fck";
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v3 14/19 ARM: shmobile: r8a7779: Add TMU devices to DT
In reply to Laurent PinchartQuoted 72 lines · Laurent Pinchart
Hi Simon,
Quoted 60 lines · On Monday 16 June 2014 17:47:07 Simon Horman wrote:
Quoted 59 lines · Laurent Pinchart
Add the TMU0, TMU1 and TMU2 counters to the r8a7779 device tree and make them disabled by default.
Signed-off-by: Laurent Pinchart
<[email protected]>
---arch/arm/boot/dts/r8a7779.dtsi | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7779.dtsiindex 94e2fc8..bf716ce 100644arch/arm/boot/dts/r8a7779.dtsi +41
-0@@ -266,6 +266,48 @@ reg = <0xffc48000 0x38>; }; + tmu0: timer at ffd80000 { + compatible = "renesas,tmu"; + reg = <0xffd80000 0x30>; + interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, + <0 41 IRQ_TYPE_LEVEL_HIGH>, + <0 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU0>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu1: timer at ffd81000 { + compatible = "renesas,tmu"; + reg = <0xffd81000 0x30>; + interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, + <0 45 IRQ_TYPE_LEVEL_HIGH>, + <0 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU1>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + }; + + tmu2: timer at ffd82000 { + compatible = "renesas,tmu"; + reg = <0xffd82000 0x30>; + interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, + <0 49 IRQ_TYPE_LEVEL_HIGH>, + <0 50 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_TMU2>; + clock-names = "fck"; + + #renesas,channels = <3>; + + status = "disabled"; + };Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 313
Quoted 4 lines
arch/arm/boot/dts/r8a7779.dtsi +1
-0+ sata: sata at fc600000 { compatible = "renesas,rcar-sata"; reg = <0xfc600000 0x2000>;There are no interrupt-parents in in the nodes above nodes although the documentation of the binding has one in the example. Is it just an oversight in this patch?
Quoted 8 lines
Not really.
The interrupt-parent property is required but can be inherited. Furthermore, the interrupts-extended property can be used to replace the interrupts and interrupt-parent properties. This should all be documented in the DT bindings, but not by duplicating the full explanation in dozens of different flavours in all bindings. We need standard wordings for common properties such as interrupts, clocks or reg.
Thanks for the clarification, I'm fine with that.
Quoted 32 lines
Quoted 9 lines
I believe that the IRQ numbers are not correct.
In
setup-r8a7779.cI seegic_iid(0x40). But above I see 40. I think the correct value is0x40- 32 = 32. Likewise for the other IRQs of tmu0. And looking at the documentaiton this seems true for tmu1 and tmu2 too.I have successfully booted a marzen board with the following incremental patch to the DT nodes.
You're right, sorry about that. I'll fix the interrupt numbers and resubmit. The interrupt-parent is specified at the top level so there's no need to add it to the TMU nodes.
Quoted 18 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -269,9 +269,10 @@ tmu0: timer at ffd80000 { compatible = "renesas,tmu"; reg = <0xffd80000 0x30>; - interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>, - <0 41 IRQ_TYPE_LEVEL_HIGH>, - <0 42 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>, + <0 33 IRQ_TYPE_LEVEL_HIGH>, + <0 34 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp0_clks R8A7779_CLK_TMU0>; clock-names = "fck";
Quoted 13 lines
arch/arm/boot/dts/r8a7779.dtsi line 290
Quoted 11 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3@@ -283,9 +284,10 @@ tmu1: timer at ffd81000 { compatible = "renesas,tmu"; reg = <0xffd81000 0x30>; - interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>, - <0 45 IRQ_TYPE_LEVEL_HIGH>, - <0 46 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>, + <0 36 IRQ_TYPE_LEVEL_HIGH>, + <0 37 IRQ_TYPE_LEVEL_HIGH>;If I'm not mistaken the interrupts should be 36, 37 and 38.
Yes, sorry about that.
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU1>; clock-names = "fck";@@ -296,10 +298,11 @@
Quoted 12 lines
arch/arm/boot/dts/r8a7779.dtsi line 305
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +4
-3tmu2: timer at ffd82000 { compatible = "renesas,tmu"; + interrupt-parent = <&gic>; reg = <0xffd82000 0x30>; - interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>, - <0 49 IRQ_TYPE_LEVEL_HIGH>, - <0 50 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>, + <0 39 IRQ_TYPE_LEVEL_HIGH>, + <0 40 IRQ_TYPE_LEVEL_HIGH>;And 40, 41 and 42 here.
Yes. I wonder how I managed to mess these up.
Quoted 2 lines
Quoted 2 lines
arch/arm/boot/dts/r8a7779.dtsi +0
-0clocks = <&mstp0_clks R8A7779_CLK_TMU2>; clock-names = "fck";
PATCH v3 15/19 ARM: shmobile: r7s72100: Add MTU2 device to DT
In reply to Laurent PinchartAdd the MTU2 counter to the r7s72100 device tree and make it disabled by default.
--- arch/arm/boot/dts/r7s72100.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/r7s72100.dtsi +10 -0
@@ -229,6 +229,16 @@ status = "disabled"; }; + mtu2: timer at fcff0000 { + compatible = "renesas,mtu2"; + reg = <0xfcff0000 0x400>; + interrupts = <0 139 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tgi0a"; + clocks = <&mstp3_clks R7S72100_CLK_MTU2>; + clock-names = "fck"; + status = "disabled"; + }; + scif0: serial at e8007000 { compatible = "renesas,scif-r7s72100", "renesas,scif"; reg = <0xe8007000 64>;
Signature · 1 line
1.8.5.5
PATCH v3 16/19 ARM: shmobile: lager-reference: Enable CMT0 in device tree
In reply to Laurent PinchartNo more device needs to be added from platform code when booting the reference platform, remove the now empty r8a7790_add_dt_devices() function completely.
--- arch/arm/boot/dts/r8a7790-lager.dts | 4 ++++ arch/arm/mach-shmobile/board-lager-reference.c | 2 -- arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 - arch/arm/mach-shmobile/setup-r8a7790.c | 7 +------ 4 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +4 -0
@@ -237,6 +237,10 @@ }; }; +&cmt0 { + status = "ok"; +}; + &mmcif1 { pinctrl-0 = <&mmc1_pins>; pinctrl-names = "default";
arch/arm/mach-shmobile/board-lager-reference.c +0 -2
@@ -90,7 +90,6 @@ static void __init lager_add_du_device(void)* devices until they get moved to DT. */ static const struct clk_name clk_names[]__initconst = { - {"cmt0" ,"fck" ,"sh-cmt-48-gen2.0" }, {"du0" ,"du.0" ,"rcar-du-r8a7790" }, {"du1" ,"du.1" ,"rcar-du-r8a7790" }, {"du2" ,"du.2" ,"rcar-du-r8a7790" },
@@ -101,7 +100,6 @@ static const struct clk_name clk_names[] __initconst = {static void __init lager_add_standard_devices (void ) {shmobile_clk_workaround (clk_names,ARRAY_SIZE (clk_names), false); -r8a7790_add_dt_devices ();of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );lager_add_du_device ();
arch/arm/mach-shmobile/include/mach/r8a7790.h +0 -1
@@ -29,7 +29,6 @@ enum { };void r8a7790_add_standard_devices (void ); -void r8a7790_add_dt_devices (void );void r8a7790_clock_init (void );void r8a7790_pinmux_init (void );void r8a7790_pm_init (void );
arch/arm/mach-shmobile/setup-r8a7790.c +1 -6
@@ -279,11 +279,6 @@ static struct resource cmt0_resources[] = { &cmt##idx##_platform_data, \ sizeof(struct sh_timer_config)) -void __init r8a7790_add_dt_devices (void ) -{ -r8a7790_register_cmt (0 ); -} -void __init r8a7790_add_standard_devices (void ) {r8a7790_register_scif (0 );
@@ -296,7 +291,7 @@ void __init r8a7790_add_standard_devices(void)r8a7790_register_scif (7 );r8a7790_register_scif (8 );r8a7790_register_scif (9 ); -r8a7790_add_dt_devices (); +r8a7790_register_cmt (0 );r8a7790_register_irqc (0 );r8a7790_register_thermal ();r8a7790_register_i2c (0 );
Signature · 1 line
1.8.5.5
PATCH v3 17/19 ARM: shmobile: koelsch-reference: Enable CMT0 in device tree
In reply to Laurent PinchartNo more device needs to be added from platform code when booting the reference platform, remove the now empty r8a7791_add_dt_devices() function completely.
--- arch/arm/boot/dts/r8a7791-koelsch.dts | 4 ++++ arch/arm/mach-shmobile/board-koelsch-reference.c | 2 -- arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 - arch/arm/mach-shmobile/setup-r8a7791.c | 7 +------ 4 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/boot/dts/r8a7791-koelsch.dts +4 -0
@@ -303,6 +303,10 @@ }; }; +&cmt0 { + status = "ok"; +}; + &sata0 { status = "okay"; };
arch/arm/mach-shmobile/board-koelsch-reference.c +0 -2
@@ -86,7 +86,6 @@ static void __init koelsch_add_du_device(void)* devices until they get moved to DT. */ static const struct clk_name clk_names[]__initconst = { - {"cmt0" ,"fck" ,"sh-cmt-48-gen2.0" }, {"du0" ,"du.0" ,"rcar-du-r8a7791" }, {"du1" ,"du.1" ,"rcar-du-r8a7791" }, {"lvds0" ,"lvds.0" ,"rcar-du-r8a7791" },
@@ -95,7 +94,6 @@ static const struct clk_name clk_names[] __initconst = {static void __init koelsch_add_standard_devices (void ) {shmobile_clk_workaround (clk_names,ARRAY_SIZE (clk_names), false); -r8a7791_add_dt_devices ();of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );koelsch_add_du_device ();
arch/arm/mach-shmobile/include/mach/r8a7791.h +0 -1
@@ -2,7 +2,6 @@#define __ASM_R8A7791_H__void r8a7791_add_standard_devices (void ); -void r8a7791_add_dt_devices (void );void r8a7791_clock_init (void );void r8a7791_pinmux_init (void );void r8a7791_pm_init (void );
arch/arm/mach-shmobile/setup-r8a7791.c +1 -6
@@ -180,11 +180,6 @@ static const struct resource thermal_resources[] __initconst = { thermal_resources, \ ARRAY_SIZE(thermal_resources)) -void __init r8a7791_add_dt_devices (void ) -{ -r8a7791_register_cmt (0 ); -} -void __init r8a7791_add_standard_devices (void ) {r8a7791_register_scif (0 );
@@ -202,7 +197,7 @@ void __init r8a7791_add_standard_devices(void)r8a7791_register_scif (12 );r8a7791_register_scif (13 );r8a7791_register_scif (14 ); -r8a7791_add_dt_devices (); +r8a7791_register_cmt (0 );r8a7791_register_irqc (0 );r8a7791_register_thermal (); }
Signature · 1 line
1.8.5.5
PATCH v3 18/19 ARM: shmobile: marzen-reference: Enable TMU0 in device tree
In reply to Laurent PinchartNo more device needs to be added from platform code when booting the reference platform, remove the now empty r8a7779_add_standard_devices_dt() function completely.
--- arch/arm/boot/dts/r8a7779-marzen.dts | 4 ++++ arch/arm/mach-shmobile/board-marzen-reference.c | 10 ---------- arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 - arch/arm/mach-shmobile/setup-r8a7779.c | 17 +++++------------ 4 files changed, 9 insertions(+), 23 deletions(-)
arch/arm/boot/dts/r8a7779-marzen.dts +4 -0
@@ -78,6 +78,10 @@ clock-frequency = <31250000>; }; +&tmu0 { + status = "okay"; +}; + &pfc { lan0_pins: lan0 { intc {
arch/arm/mach-shmobile/board-marzen-reference.c +0 -10
@@ -35,18 +35,8 @@ static void __init marzen_init_timer(void)clocksource_of_init (); } -/* -* This is a really crude hack to provide clkdev support to platform -* devices until they get moved to DT. -*/ -static const struct clk_name clk_names[]__initconst = { - {"tmu0" ,"fck" ,"sh-tmu.0" }, -}; -static void __init marzen_init (void ) { -shmobile_clk_workaround (clk_names,ARRAY_SIZE (clk_names), false); -r8a7779_add_standard_devices_dt ();of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );r8a7779_init_irq_extpin_dt (1 );/* IRQ1 as individual interrupt */ }
arch/arm/mach-shmobile/include/mach/r8a7779.h +0 -1
@@ -28,7 +28,6 @@ extern void r8a7779_map_io(void);extern void r8a7779_earlytimer_init (void );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 );
arch/arm/mach-shmobile/setup-r8a7779.c +5 -12
@@ -639,7 +639,7 @@ static void __init r8a7779_register_hpb_dmae(void) sizeof(dma_platform_data)); } -static struct platform_device *r8a7779_devices_dt[]__initdata = { +static struct platform_device *r8a7779_early_devices[]__initdata = { &tmu0_device, };
@@ -667,8 +667,8 @@ void __init r8a7779_add_standard_devices(void)r8a7779_init_pm_domains (); -platform_add_devices (r8a7779_devices_dt, -ARRAY_SIZE (r8a7779_devices_dt)); +platform_add_devices (r8a7779_early_devices, +ARRAY_SIZE (r8a7779_early_devices));platform_add_devices (r8a7779_standard_devices,ARRAY_SIZE (r8a7779_standard_devices));r8a7779_register_hpb_dmae ();
@@ -676,8 +676,8 @@ void __init r8a7779_add_standard_devices(void)void __init r8a7779_add_early_devices (void ) { -early_platform_add_devices (r8a7779_devices_dt, -ARRAY_SIZE (r8a7779_devices_dt)); +early_platform_add_devices (r8a7779_early_devices, +ARRAY_SIZE (r8a7779_early_devices));/* Early serial console setup is not included here due to * memory map collisions. The SCIF serial ports in r8a7779
@@ -737,12 +737,6 @@ void __init r8a7779_init_irq_dt(void)__raw_writel (0x003fee3f ,INT2SMSKCR4 ); } -void __init r8a7779_add_standard_devices_dt (void ) -{ -platform_add_devices (r8a7779_devices_dt, -ARRAY_SIZE (r8a7779_devices_dt)); -} -#define MODEMR 0xffcc0020u32 __init r8a7779_read_mode_pins (void )
@@ -771,7 +765,6 @@ DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") .init_early = shmobile_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, - .init_machine = r8a7779_add_standard_devices_dt, .init_late = r8a7779_init_late, .dt_compat = r8a7779_compat_dt,MACHINE_END
Signature · 1 line
1.8.5.5
PATCH v3 19/19 ARM: shmobile: genmai-reference: Enable MTU2 in device tree
In reply to Laurent PinchartNo more device needs to be added from platform code when booting the reference platform, move MTU2 registration from setup-r7s72100.c to board-genmai.c and remove the now empty r7s72100_add_dt_devices() function.
As the genmai_add_standard_devices() function is now identical to the default init_machine implementation, remove it as well.
--- arch/arm/boot/dts/r7s72100-genmai.dts | 4 ++++ arch/arm/mach-shmobile/board-genmai-reference.c | 16 ---------------- arch/arm/mach-shmobile/board-genmai.c | 14 +++++++++++++- arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 21 --------------------- 5 files changed, 17 insertions(+), 39 deletions(-)
arch/arm/boot/dts/r7s72100-genmai.dts +4 -0
@@ -43,6 +43,10 @@ clock-frequency = <48000000>; }; +&mtu2 { + status = "ok"; +}; + &i2c2 { status = "okay"; clock-frequency = <400000>;
arch/arm/mach-shmobile/board-genmai-reference.c +0 -16
@@ -26,21 +26,6 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -/* -* This is a really crude hack to provide clkdev support to platform -* devices until they get moved to DT. -*/ -static const struct clk_name clk_names[] = { - {"mtu2" ,"fck" ,"sh-mtu2" }, -}; - -static void __init genmai_add_standard_devices (void ) -{ -shmobile_clk_workaround (clk_names,ARRAY_SIZE (clk_names), true); -r7s72100_add_dt_devices (); -of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); -} -static const char *const genmai_boards_compat_dt[]__initconst = {"renesas,genmai" ,NULL ,
@@ -48,6 +33,5 @@ static const char * const genmai_boards_compat_dt[] __initconst = {DT_MACHINE_START (GENMAI_DT ,"genmai" ) .init_early = shmobile_init_delay, - .init_machine = genmai_add_standard_devices, .dt_compat = genmai_boards_compat_dt,MACHINE_END
arch/arm/mach-shmobile/board-genmai.c +13 -1
@@ -23,6 +23,7 @@#include <linux/platform_device.h> #include <linux/serial_sci.h> #include <linux/sh_eth.h> +#include <linux/sh_timer.h> #include <linux/spi/rspi.h> #include <linux/spi/spi.h> #include <mach/common.h>
@@ -124,10 +125,21 @@ R7S72100_SCIF(7, 0xe800a800, gic_iid(249)); &scif##index##_platform_data, \ sizeof(scif##index##_platform_data)) +static struct resource mtu2_resources[]__initdata = { +DEFINE_RES_MEM (0xfcff0000 ,0x400 ), +DEFINE_RES_IRQ_NAMED (gic_iid (139 ),"tgi0a" ), +}; + +#define r7s72100_register_mtu2 () \ + platform_device_register_resndata(&platform_bus, "sh-mtu2", \ + -1, mtu2_resources, \ + ARRAY_SIZE(mtu2_resources), \ + NULL, 0) +static void __init genmai_add_standard_devices (void ) {r7s72100_clock_init (); -r7s72100_add_dt_devices (); +r7s72100_register_mtu2 ();platform_device_register_full (ðer_info);
arch/arm/mach-shmobile/include/mach/r7s72100.h +0 -1
@@ -1,7 +1,6 @@#ifndef __ASM_R7S72100_H__#define __ASM_R7S72100_H__ -void r7s72100_add_dt_devices (void );void r7s72100_clock_init (void );#endif /* __ASM_R7S72100_H__ */
arch/arm/mach-shmobile/setup-r7s72100.c +0 -21
@@ -18,31 +18,10 @@* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <linux/irq.h> -#include <linux/kernel.h> #include <linux/of_platform.h> -#include <linux/sh_timer.h> #include <mach/common.h> -#include <mach/irqs.h> -#include <mach/r7s72100.h> #include <asm/mach/arch.h> -static struct resource mtu2_resources[]__initdata = { -DEFINE_RES_MEM (0xfcff0000 ,0x400 ), -DEFINE_RES_IRQ_NAMED (gic_iid (139 ),"tgi0a" ), -}; - -#define r7s72100_register_mtu2 () \ - platform_device_register_resndata(&platform_bus, "sh-mtu2", \ - -1, mtu2_resources, \ - ARRAY_SIZE(mtu2_resources), \ - NULL, 0) - -void __init r7s72100_add_dt_devices (void ) -{ -r7s72100_register_mtu2 (); -} -#ifdef CONFIG_USE_OF static const char *r7s72100_boards_compat_dt[]__initdata = { "renesas,r7s72100",
Signature · 1 line
1.8.5.5
v3 cover Renesas CMT, MTU2 and TMU timers DT support
In reply to Laurent PinchartQuoted 40 lines · Laurent Pinchart
Hello,
This patch set adds DT bindings to the Renesas CMT, MTU2 and TMU timers. Patches 02/19 to 13/19, 16/19 and 17/19 have already been posted in the previous version of this series. Patches 14/19, 15/19, 18/19 and 19/19 are new.
Compared to v2 I've rebased the patches on top of Simon's latest devel branch.
Compared to v1 I've dropped the channel subnodes from the CMT DT bindings and just use a channels mask, as I don't need to specify per-channel properties. I'm slightly uncertain about this change though, as I can't easily predict whether per-channel properties would be needed later for new hardware. It won't be difficult to reintroduce channel subnodes then, so I'd rather not clutter the DT bindings with channel subnodes now. Please feel free to disagree.
The first 11 patches should go through the timers tree while the last 8 patches should go through the Renesas SoC tree. Patches 12/19 to 15/19 have no build time or run time dependency on the drivers changes. Patches 16/19 to 19/19 may have a run time dependency on the drivers changes depending on the kernel configuration. Patches 16/19 and 17/19, for instance, require the driver changes only when architected timer support isn't enabled in the kernel.
Laurent Pinchart (19):
o clocksource:sh_tmu: Fix channel IRQ retrieval in legacy case
o clocksource:sh_cmt: Drop support for legacy platform data
o clocksource:sh_cmt: Replace global spinlock with a per-device spinlock
o clocksource:sh_tmu: Drop support for legacy platform data
o clocksource:sh_tmu: Replace global spinlock with a per-device spinlock
clocksource:sh_mtu2: Drop support for legacy platform data
clocksource:sh_mtu2: Replace global spinlock with a per-device
spinlock
o clocksource: shmobile: Remove unusedsh_timer_configmembers
o clocksource:sh_cmt: Add DT support
clocksource:sh_tmu: Add DT support
clocksource:sh_mtu2: Add DT support
Quoted 8 lines
o ARM: shmobile: r8a7790: Add CMT devices to DT
o ARM: shmobile: r8a7791: Add CMT devices to DT
ARM: shmobile: r8a7779: Add TMU devices to DT
ARM: shmobile: r7s72100: Add MTU2 device to DT
o ARM: shmobile: lager-reference: Enable CMT0 in device tree
o ARM: shmobile: koelsch-reference: Enable CMT0 in device tree
ARM: shmobile: marzen-reference: Enable TMU0 in device tree
ARM: shmobile: genmai-reference: Enable MTU2 in device tree
For the patches marked with a 'o':
Quoted 43 lines
.../devicetree/bindings/timer/renesas,cmt.txt | 49 +++++ .../devicetree/bindings/timer/renesas,mtu2.txt | 40 ++++ .../devicetree/bindings/timer/renesas,tmu.txt | 40 ++++ arch/arm/boot/dts/r7s72100-genmai.dts | 4 + arch/arm/boot/dts/r7s72100.dtsi | 10 + arch/arm/boot/dts/r8a7779-marzen.dts | 4 + arch/arm/boot/dts/r8a7779.dtsi | 42 ++++ arch/arm/boot/dts/r8a7790-lager.dts | 4 + arch/arm/boot/dts/r8a7790.dtsi | 34 +++ arch/arm/boot/dts/r8a7791-koelsch.dts | 4 + arch/arm/boot/dts/r8a7791.dtsi | 34 +++ arch/arm/mach-shmobile/board-genmai-reference.c | 16 -- arch/arm/mach-shmobile/board-genmai.c | 14 +- arch/arm/mach-shmobile/board-koelsch-reference.c | 2 - arch/arm/mach-shmobile/board-lager-reference.c | 2 - arch/arm/mach-shmobile/board-marzen-reference.c | 10 - arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 - arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 21 -- arch/arm/mach-shmobile/setup-r8a7779.c | 17 +- arch/arm/mach-shmobile/setup-r8a7790.c | 7 +- arch/arm/mach-shmobile/setup-r8a7791.c | 7 +- drivers/clocksource/sh_cmt.c | 233 ++++++++------------- drivers/clocksource/sh_mtu2.c | 146 ++++--------- drivers/clocksource/sh_tmu.c | 125 +++++------ include/linux/sh_timer.h | 5 - 28 files changed, 467 insertions(+), 407 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/renesas,cmt.txt create mode 100644 Documentation/devicetree/bindings/timer/renesas,mtu2.txt create mode 100644 Documentation/devicetree/bindings/timer/renesas,tmu.txtSignature · 8 lines
Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html