ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
Subsystems (5)
v2 cover ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
This short series enables the CMT1 timer using DT on armadillo800eva-reference.
It is based on "ARM: shmobile: r8a7740: add clocks to DT" applied on top of renesas-devel-v3.16-20140808.
Ulrich, if you end up reposting "ARM: shmobile: r8a7740: add clocks to DT" please consider appending this series to it.
Changes since v1
* Correct typo in change log of
"ARM: shmobile: r8a7740: Add CMT1 device to DT"
Simon Horman (5):
ARM: shmobile: r8a7740: Add CMT1 device to DT
ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
ARM: shmobile: armadillo800eva-reference: Sort includes
ARM: shmobile: armadillo800eva-reference: Do not use
r8a7740_add_standard_devices_dt()
ARM: shmobile: r8a7740: Remove r8a7740_add_standard_devices_dt
.../arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 4 ++++ arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ .../mach-shmobile/board-armadillo800eva-reference.c | 5 +++-- arch/arm/mach-shmobile/r8a7740.h | 1 - arch/arm/mach-shmobile/setup-r8a7740.c | 18 ++---------------- 5 files changed, 21 insertions(+), 19 deletions(-)
Signature · 1 line
2.0.0.rc2
PATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Add the CMT1 counters to the r8a7740 device tree and make it disabled by default.
Based on work by Magnus Damm.
---
v2
* Corrected copy-paste-error: CMT0 -> CMT1
--- arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/boot/dts/r8a7740.dtsi +12 -0
@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; }; + cmt1: timer at e6138000 { + compatible = "renesas,cmt-48"; + reg = <0xe6138000 0x170>; + interrupts = <0 58 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7740_CLK_CMT1>; + clock-names = "fck"; + + renesas,channels-mask = <0x3f>; + + status = "disabled"; + }; + /* irqpin0: IRQ0 - IRQ7 */ irqpin0: irqpin at e6900000 { compatible = "renesas,intc-irqpin-r8a7740", "renesas,intc-irqpin";
Signature · 1 line
2.0.0.rc2
Magnus Damm
maintainerPATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Hi Simon, Laurent,
Quoted 11 lines · Simon Horman
Add the CMT1 counters to the r8a7740 device tree and make it disabled by default.
Based on work by Magnus Damm.
Cc Magnus Damm <[email protected]>Signed-off-by Simon Horman <[email protected]>---
v2
* Corrected copy-paste-error: CMT0 -> CMT1
Thanks for breaking out, brushing up and submitting code based on my earlier hack!
I've got one minor comment (see below ) and I also made sure to CC Laurent that wrote the DT bindings.
Laurent, can you please check if this is the way you want us to use the CMT bindings?
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 13 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +2
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; }; + cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";
Do we want to have the "r8a7740" in the compatible string somewhere?
Cheers,
/ magnus
PATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Quoted 11 lines · Magnus Damm
Quoted 11 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; };
Quoted 4 lines
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/r8a7740.dtsi +2
-0+ cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";Do we want to have the "r8a7740" in the compatible string somewhere?
Documentation/devicetree/bindings/timer/renesas,cmt.txt does not mention compatible properties containing SoC names.
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
Magnus Damm
maintainerPATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Quoted 12 lines · Geert Uytterhoeven
Quoted 11 lines · Magnus Damm
Quoted 11 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; };
Quoted 7 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/r8a7740.dtsi +2
-0+ cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";Do we want to have the "r8a7740" in the compatible string somewhere?
Documentation/devicetree/bindings/timer/renesas,cmt.txtdoes not mention compatible properties containing SoC names.
Right, that seems to be missing from the timers. Is there any reason why we need to treat those in a special way?
In my mind this timer case is similar to various SCIF variants documented in Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
- in the case of SCIF we have SoC name in the binding documentation.
Cheers,
/ magnus
PATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Quoted 22 lines · Magnus Damm
Quoted 12 lines · Geert Uytterhoeven
Quoted 11 lines · Magnus Damm
Quoted 11 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; };Quoted 7 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/r8a7740.dtsi +2
-0+ cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";Do we want to have the "r8a7740" in the compatible string somewhere?
Documentation/devicetree/bindings/timer/renesas,cmt.txtdoes not mention compatible properties containing SoC names.
Quoted 6 lines
Right, that seems to be missing from the timers. Is there any reason why we need to treat those in a special way?
In my mind this timer case is similar to various SCIF variants documented in
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
- in the case of SCIF we have SoC name in the binding documentation.
FWIW, now you mention it I agree with your point.
But I am interested to hear if Laurent had a specific reason for this.
If it is an oversight then I recommend correcting it as a series of add-on patches, even for the r8a7740. That will avoid adding more dependencies to this series.
PATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
Hello,
Quoted 32 lines · On Wednesday 20 August 2014 08:11:50 Simon Horman wrote:
Quoted 23 lines · Magnus Damm
Quoted 14 lines · Geert Uytterhoeven
On Tue, Aug 19, 2014 at 8:39 AM, Magnus Damm:
Quoted 13 lines
Quoted 13 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)(quoted diff) +0
-0
b/arch/arm/boot/dts/r8a7740.dtsiindex 6cd6a46..1067a96 100644arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; };Quoted 7 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/r8a7740.dtsi +2
-0+ cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";Do we want to have the "r8a7740" in the compatible string somewhere?
Documentation/devicetree/bindings/timer/renesas,cmt.txtdoes not mention compatible properties containing SoC names.Quoted 7 lines
Right, that seems to be missing from the timers. Is there any reason why we need to treat those in a special way?
In my mind this timer case is similar to various SCIF variants documented in
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt - in the case of SCIF we have SoC name in the binding documentation.
Quoted 6 lines
FWIW, now you mention it I agree with your point.
But I am interested to hear if Laurent had a specific reason for this.If it is an oversight then I recommend correcting it as a series of add-on patches, even for the r8a7740. That will avoid adding more dependencies to this series.
I believe you all know my position regarding SoC names in compatible strings :-) I still don't agree, but I pretty much gave up on convincing the world so I won't fight and nack patches.
Signature · 3 lines
Regards, Laurent Pinchart
Magnus Damm
maintainerPATCH v2 1/5 ARM: shmobile: r8a7740: Add CMT1 device to DT
In reply to Simon HormanHi Simon,
Quoted 30 lines · Simon Horman
Quoted 22 lines · Magnus Damm
Quoted 12 lines · Geert Uytterhoeven
Quoted 11 lines · Magnus Damm
Quoted 11 lines
arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -41,6 +41,18 @@ interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>; };Quoted 7 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7740.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/r8a7740.dtsi +2
-0+ cmt1: timer at e6138000 { + compatible = "renesas,cmt-48";Do we want to have the "r8a7740" in the compatible string somewhere?
Documentation/devicetree/bindings/timer/renesas,cmt.txtdoes not mention compatible properties containing SoC names.Quoted 6 lines
Right, that seems to be missing from the timers. Is there any reason why we need to treat those in a special way?
In my mind this timer case is similar to various SCIF variants documented in
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
- in the case of SCIF we have SoC name in the binding documentation.
Quoted 6 lines
FWIW, now you mention it I agree with your point.
But I am interested to hear if Laurent had a specific reason for this.If it is an oversight then I recommend correcting it as a series of add-on patches, even for the r8a7740. That will avoid adding more dependencies to this series.
Sure, sounds good. Thanks!
/ magnus
PATCH v2 2/5 ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
In reply to Simon HormanBased on work by Magnus Damm
--- arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 4 ++++ arch/arm/mach-shmobile/setup-r8a7740.c | 11 +---------- 2 files changed, 5 insertions(+), 10 deletions(-)
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +4 -0
@@ -191,6 +191,10 @@ renesas,mode = <0x05>; /* MD_CK0 | MD_CK2 */ }; +&cmt1 { + status = "ok"; +}; + &i2c0 { status = "okay"; touchscreen at 55 {
arch/arm/mach-shmobile/setup-r8a7740.c +1 -10
@@ -311,10 +311,6 @@ static struct platform_device ipmmu_device = { .num_resources = ARRAY_SIZE(ipmmu_resources), }; -static struct platform_device *r8a7740_devices_dt[]__initdata = { - &cmt1_device, -}; -static struct platform_device *r8a7740_early_devices[]__initdata = { &scif0_device, &scif1_device,
@@ -331,6 +327,7 @@ static struct platform_device *r8a7740_early_devices[] __initdata = { &irqpin3_device, &tmu0_device, &ipmmu_device, + &cmt1_device, };/* DMA */
@@ -756,8 +753,6 @@ void __init r8a7740_add_standard_devices(void)/* add devices */ platform_add_devices (r8a7740_early_devices,ARRAY_SIZE (r8a7740_early_devices)); -platform_add_devices (r8a7740_devices_dt, -ARRAY_SIZE (r8a7740_devices_dt));platform_add_devices (r8a7740_late_devices,ARRAY_SIZE (r8a7740_late_devices));
@@ -779,8 +774,6 @@ void __init r8a7740_add_early_devices(void) {early_platform_add_devices (r8a7740_early_devices,ARRAY_SIZE (r8a7740_early_devices)); -early_platform_add_devices (r8a7740_devices_dt, -ARRAY_SIZE (r8a7740_devices_dt));/* setup early console here as well */ shmobile_setup_console ();
@@ -790,8 +783,6 @@ void __init r8a7740_add_early_devices(void)void __init r8a7740_add_standard_devices_dt (void ) { -platform_add_devices (r8a7740_devices_dt, -ARRAY_SIZE (r8a7740_devices_dt));of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); }
Signature · 1 line
2.0.0.rc2
PATCH v2 3/5 ARM: shmobile: armadillo800eva-reference: Sort includes
In reply to Simon HormanSorted includes seems to be the done thing these days.
--- arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/board-armadillo800eva-reference.c +1 -1
@@ -21,9 +21,9 @@#include <linux/clk.h> #include <linux/err.h> -#include <linux/kernel.h> #include <linux/gpio.h> #include <linux/io.h> +#include <linux/kernel.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h>
Signature · 1 line
2.0.0.rc2
PATCH v2 3/5 ARM: shmobile: armadillo800eva-reference: Sort includes
Quoted 3 lines · Simon Horman
Sorted includes seems to be the done thing these days.
Signed-off-by Simon Horman <[email protected]>
I have queued up this patch but I am leaving the rest of the series for now.
Quoted 28 lines
--- arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-shmobile/board-armadillo800eva-reference.c +1
-1@@ -21,9 +21,9 @@#include <linux/clk.h> #include <linux/err.h> -#include <linux/kernel.h> #include <linux/gpio.h> #include <linux/io.h> +#include <linux/kernel.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h> Signature · 7 lines
2.0.0.rc2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 3/5 ARM: shmobile: armadillo800eva-reference: Sort includes
Quoted 7 lines · Simon Horman
Quoted 3 lines · Simon Horman
Sorted includes seems to be the done thing these days.
Signed-off-by Simon Horman <[email protected]>I have queued up this patch but I am leaving the rest of the series for now.
I have dropped this patch as board-armadillo800eva-reference.c is now scheduled for removal.
Quoted 33 lines
Quoted 28 lines
--- arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-shmobile/board-armadillo800eva-reference.c +1
-1@@ -21,9 +21,9 @@#include <linux/clk.h> #include <linux/err.h> -#include <linux/kernel.h> #include <linux/gpio.h> #include <linux/io.h> +#include <linux/kernel.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h> Signature · 7 lines
2.0.0.rc2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel--
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
PATCH v2 4/5 ARM: shmobile: armadillo800eva-reference: Do not use r8a7740_add_standard_devices_dt()
In reply to Simon HormanNow that r8a7740_add_standard_devices_dt() is just a wrapper for of_platform_populate() call the latter directly.
This is in preparation for removing r8a7740_add_standard_devices_dt().
--- arch/arm/mach-shmobile/board-armadillo800eva-reference.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/board-armadillo800eva-reference.c +2 -1
@@ -24,6 +24,7 @@#include <linux/gpio.h> #include <linux/io.h> #include <linux/kernel.h> +#include <linux/of_platform.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h>
@@ -170,7 +171,7 @@ static void __init eva_init(void)l2x0_init (IOMEM (0xf0002000 ),0x00400000 ,0xc20f0fff );#endif -r8a7740_add_standard_devices_dt (); +of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );r8a7740_pm_init (); }
Signature · 1 line
2.0.0.rc2
PATCH v2 5/5 ARM: shmobile: r8a7740: Remove r8a7740_add_standard_devices_dt
In reply to Simon HormanNow that r8a7740_add_standard_devices_dt() is simply a wrapper for a call to of_platform_populate() remove it and call of_platform_populate() directly.
--- arch/arm/mach-shmobile/r8a7740.h | 1 - arch/arm/mach-shmobile/setup-r8a7740.c | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-)
arch/arm/mach-shmobile/r8a7740.h +0 -1
@@ -49,7 +49,6 @@ extern void r8a7740_init_irq_of(void);extern void r8a7740_map_io (void );extern void r8a7740_add_early_devices (void );extern void r8a7740_add_standard_devices (void ); -extern void r8a7740_add_standard_devices_dt (void );extern void r8a7740_clock_init (u8 md_ck);extern void r8a7740_pinmux_init (void );extern void r8a7740_pm_init (void );
arch/arm/mach-shmobile/setup-r8a7740.c +1 -6
@@ -781,11 +781,6 @@ void __init r8a7740_add_early_devices(void)#ifdef CONFIG_USE_OF -void __init r8a7740_add_standard_devices_dt (void ) -{ -of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); -} -void __init r8a7740_init_irq_of (void ) {void __iomem *intc_prio_base =ioremap_nocache (0xe6900010 ,0x10 );
@@ -819,7 +814,7 @@ void __init r8a7740_init_irq_of(void)static void __init r8a7740_generic_init (void ) {r8a7740_clock_init (0 ); -r8a7740_add_standard_devices_dt (); +of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); }static const char *r8a7740_boards_compat_dt[]__initdata = {
Signature · 1 line
2.0.0.rc2
v2 cover ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
In reply to Simon HormanQuoted 8 lines · Simon Horman
This short series enables the CMT1 timer using DT on armadillo800eva-reference.
It is based on "ARM: shmobile: r8a7740: add clocks to DT" applied on top of renesas-devel-v3.16-20140808.
Ulrich, if you end up reposting "ARM: shmobile: r8a7740: add clocks to DT" please consider appending this series to it.
As I have queued up the above series, less the binding change which is for Mike Turquette to handle, I have also queued up this series.
Quoted 22 lines
Changes since v1
* Correct typo in change log of
"ARM: shmobile: r8a7740: Add CMT1 device to DT"Simon Horman (5):
ARM: shmobile: r8a7740: Add CMT1 device to DT
ARM: shmobile: armadillo800eva-reference: Enable CMT1 in device tree
ARM: shmobile: armadillo800eva-reference: Sort includes
ARM: shmobile: armadillo800eva-reference: Do not user8a7740_add_standard_devices_dt()ARM: shmobile: r8a7740: Remove
r8a7740_add_standard_devices_dt.../arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 4 ++++ arch/arm/boot/dts/r8a7740.dtsi | 12 ++++++++++++ .../mach-shmobile/board-armadillo800eva-reference.c | 5 +++-- arch/arm/mach-shmobile/r8a7740.h | 1 - arch/arm/mach-shmobile/setup-r8a7740.c | 18 ++---------------- 5 files changed, 21 insertions(+), 19 deletions(-)Signature · 1 line
2.0.0.rc2