All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] arm: mediatek: Add more basic features
@ 2014-07-31 16:42 ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

This patch set is based on the patches merged for v3.17 in the clock [0] and arm-soc [1] repositories.

The most important patch enables the arm arch timer for mt6589. As already seen on other vendor SoCs, to enable the arch timer we have to enable a SoC timer.
This should be normally done by the bootloader. As up to now no open source bootloader exists for the mt6589, I added the functionality to the init_time function.

Other features are low-level debugging on the mt6589, the addition to the "make dtbs" and multi_v7_defconfig, as well as a small typo in the dtsi file.

[0] http://git.linaro.org/people/daniel.lezcano/linux.git/shortlog/refs/heads/clockevents/3.17
[1] https://git.kernel.org/cgit/linux/kernel/git/arm/arm-soc.git/commit/?h=next/soc&id=60c70c8c58d8cde3813e730d4e753531f292a1f0

Matthias Brugger (7):
  arm: dts: Build dtb for Mediatek board
  arm: multi_v7_defconfig: Enable Mediatek platform
  arm: dts: mt6589: Fix typo in GIC unit address
  arm: mediatek: Add earlyprintk support for mt6589
  arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
  arm: mediatek: enable gpt6 on boot up to make arch timer working
  arm: dts: mt6589: Add arm arch timer node

 arch/arm/Kconfig.debug                |   10 ++++++++++
 arch/arm/boot/dts/Makefile            |    1 +
 arch/arm/boot/dts/mt6589-aquaris5.dts |    4 ++++
 arch/arm/boot/dts/mt6589.dtsi         |   14 +++++++++++---
 arch/arm/configs/multi_v7_defconfig   |    1 +
 arch/arm/mach-mediatek/mediatek.c     |   27 +++++++++++++++++++++++++++
 6 files changed, 54 insertions(+), 3 deletions(-)

-- 
1.7.9.5


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

* [PATCH 0/7] arm: mediatek: Add more basic features
@ 2014-07-31 16:42 ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, olof-nZhT3qVonbNeoWH0uzbU5w,
	arnd-r2nGTMty4D4, jason-NLaQJdtUoK4Be96aLqz0jA,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	swarren-DDmLM1+adcrQT0dZR+AlfA,
	sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w, stefan-XLVq0VzYD2Y,
	maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w, anders.berg-M7mHMAq9Yzo,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	heiko-4mtYJXux2i+zQB+pC5nmwQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This patch set is based on the patches merged for v3.17 in the clock [0] and arm-soc [1] repositories.

The most important patch enables the arm arch timer for mt6589. As already seen on other vendor SoCs, to enable the arch timer we have to enable a SoC timer.
This should be normally done by the bootloader. As up to now no open source bootloader exists for the mt6589, I added the functionality to the init_time function.

Other features are low-level debugging on the mt6589, the addition to the "make dtbs" and multi_v7_defconfig, as well as a small typo in the dtsi file.

[0] http://git.linaro.org/people/daniel.lezcano/linux.git/shortlog/refs/heads/clockevents/3.17
[1] https://git.kernel.org/cgit/linux/kernel/git/arm/arm-soc.git/commit/?h=next/soc&id=60c70c8c58d8cde3813e730d4e753531f292a1f0

Matthias Brugger (7):
  arm: dts: Build dtb for Mediatek board
  arm: multi_v7_defconfig: Enable Mediatek platform
  arm: dts: mt6589: Fix typo in GIC unit address
  arm: mediatek: Add earlyprintk support for mt6589
  arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
  arm: mediatek: enable gpt6 on boot up to make arch timer working
  arm: dts: mt6589: Add arm arch timer node

 arch/arm/Kconfig.debug                |   10 ++++++++++
 arch/arm/boot/dts/Makefile            |    1 +
 arch/arm/boot/dts/mt6589-aquaris5.dts |    4 ++++
 arch/arm/boot/dts/mt6589.dtsi         |   14 +++++++++++---
 arch/arm/configs/multi_v7_defconfig   |    1 +
 arch/arm/mach-mediatek/mediatek.c     |   27 +++++++++++++++++++++++++++
 6 files changed, 54 insertions(+), 3 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 0/7] arm: mediatek: Add more basic features
@ 2014-07-31 16:42 ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

This patch set is based on the patches merged for v3.17 in the clock [0] and arm-soc [1] repositories.

The most important patch enables the arm arch timer for mt6589. As already seen on other vendor SoCs, to enable the arch timer we have to enable a SoC timer.
This should be normally done by the bootloader. As up to now no open source bootloader exists for the mt6589, I added the functionality to the init_time function.

Other features are low-level debugging on the mt6589, the addition to the "make dtbs" and multi_v7_defconfig, as well as a small typo in the dtsi file.

[0] http://git.linaro.org/people/daniel.lezcano/linux.git/shortlog/refs/heads/clockevents/3.17
[1] https://git.kernel.org/cgit/linux/kernel/git/arm/arm-soc.git/commit/?h=next/soc&id=60c70c8c58d8cde3813e730d4e753531f292a1f0

Matthias Brugger (7):
  arm: dts: Build dtb for Mediatek board
  arm: multi_v7_defconfig: Enable Mediatek platform
  arm: dts: mt6589: Fix typo in GIC unit address
  arm: mediatek: Add earlyprintk support for mt6589
  arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
  arm: mediatek: enable gpt6 on boot up to make arch timer working
  arm: dts: mt6589: Add arm arch timer node

 arch/arm/Kconfig.debug                |   10 ++++++++++
 arch/arm/boot/dts/Makefile            |    1 +
 arch/arm/boot/dts/mt6589-aquaris5.dts |    4 ++++
 arch/arm/boot/dts/mt6589.dtsi         |   14 +++++++++++---
 arch/arm/configs/multi_v7_defconfig   |    1 +
 arch/arm/mach-mediatek/mediatek.c     |   27 +++++++++++++++++++++++++++
 6 files changed, 54 insertions(+), 3 deletions(-)

-- 
1.7.9.5

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

* [PATCH 1/7] arm: dts: Build dtb for Mediatek board
  2014-07-31 16:42 ` Matthias Brugger
  (?)
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

This allows the "make dtbs" to build the aquaris5 dtb for the Mediatek
SoC.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5986ff6..f9567b9 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -445,6 +445,7 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \
 	dove-d2plug.dtb \
 	dove-d3plug.dtb \
 	dove-dove-db.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt6589-aquaris5.dtb
 
 targets += dtbs dtbs_install
 targets += $(dtb-y)
-- 
1.7.9.5


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

* [PATCH 1/7] arm: dts: Build dtb for Mediatek board
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: mark.rutland, thomas.petazzoni, linux, arnd, pawel.moll,
	ijc+devicetree, linus.walleij, heiko, stefan, matthias.bgg,
	devicetree, robh+dt, linux-arm-kernel, galak, olof, swarren,
	maxime.ripard, sebastian.hesselbarth, anders.berg, jason

This allows the "make dtbs" to build the aquaris5 dtb for the Mediatek
SoC.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5986ff6..f9567b9 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -445,6 +445,7 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \
 	dove-d2plug.dtb \
 	dove-d3plug.dtb \
 	dove-dove-db.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt6589-aquaris5.dtb
 
 targets += dtbs dtbs_install
 targets += $(dtb-y)
-- 
1.7.9.5

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

* [PATCH 1/7] arm: dts: Build dtb for Mediatek board
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

This allows the "make dtbs" to build the aquaris5 dtb for the Mediatek
SoC.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5986ff6..f9567b9 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -445,6 +445,7 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \
 	dove-d2plug.dtb \
 	dove-d3plug.dtb \
 	dove-dove-db.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt6589-aquaris5.dtb
 
 targets += dtbs dtbs_install
 targets += $(dtb-y)
-- 
1.7.9.5

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

* [PATCH 2/7] arm: multi_v7_defconfig: Enable Mediatek platform
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

Enable Mediatek platform support for multi_v7_defconfig.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/configs/multi_v7_defconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index e2d6204..a92559f 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -39,6 +39,7 @@ CONFIG_SOC_AM33XX=y
 CONFIG_SOC_AM43XX=y
 CONFIG_SOC_DRA7XX=y
 CONFIG_ARCH_QCOM=y
+CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_MSM8X60=y
 CONFIG_ARCH_MSM8960=y
 CONFIG_ARCH_MSM8974=y
-- 
1.7.9.5


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

* [PATCH 2/7] arm: multi_v7_defconfig: Enable Mediatek platform
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

Enable Mediatek platform support for multi_v7_defconfig.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/configs/multi_v7_defconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index e2d6204..a92559f 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -39,6 +39,7 @@ CONFIG_SOC_AM33XX=y
 CONFIG_SOC_AM43XX=y
 CONFIG_SOC_DRA7XX=y
 CONFIG_ARCH_QCOM=y
+CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_MSM8X60=y
 CONFIG_ARCH_MSM8960=y
 CONFIG_ARCH_MSM8974=y
-- 
1.7.9.5

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

* [PATCH 3/7] arm: dts: mt6589: Fix typo in GIC unit address
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

This changes the unit address of the gic node to it's first register area.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
index d0297a0..742c9bd 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -81,7 +81,7 @@
 			clock-names = "system-clk", "rtc-clk";
 		};
 
-		gic: interrupt-controller@10212000 {
+		gic: interrupt-controller@10211000 {
 			compatible = "arm,cortex-a15-gic";
 			interrupt-controller;
 			#interrupt-cells = <3>;
-- 
1.7.9.5


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

* [PATCH 3/7] arm: dts: mt6589: Fix typo in GIC unit address
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

This changes the unit address of the gic node to it's first register area.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
index d0297a0..742c9bd 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -81,7 +81,7 @@
 			clock-names = "system-clk", "rtc-clk";
 		};
 
-		gic: interrupt-controller at 10212000 {
+		gic: interrupt-controller at 10211000 {
 			compatible = "arm,cortex-a15-gic";
 			interrupt-controller;
 			#interrupt-cells = <3>;
-- 
1.7.9.5

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

* [PATCH 4/7] arm: mediatek: Add earlyprintk support for mt6589
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

Enable low-level debug for Mediatek mt6589 SoC on UART0.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/Kconfig.debug |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8f90595..8ee127e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -818,6 +818,14 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on Ux500 based platforms.
 
+	config DEBUG_MT6589_UART0
+		bool "Mediatek mt6589 UART0"
+		depends on ARCH_MEDIATEK
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  for Mediatek mt6589 based platforms on UART0.
+
 	config DEBUG_VEXPRESS_UART0_DETECT
 		bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
 		depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -1053,6 +1061,7 @@ config DEBUG_UART_PHYS
 	default 0x10126000 if DEBUG_RK3X_UART1
 	default 0x101f1000 if ARCH_VERSATILE
 	default 0x101fb000 if DEBUG_NOMADIK_UART
+	default 0x11006000 if DEBUG_MT6589_UART0
 	default 0x16000000 if ARCH_INTEGRATOR
 	default 0x18000300 if DEBUG_BCM_5301X
 	default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
@@ -1114,6 +1123,7 @@ config DEBUG_UART_VIRT
 	default 0xf01fb000 if DEBUG_NOMADIK_UART
 	default 0xf0201000 if DEBUG_BCM2835
 	default 0xf1000300 if DEBUG_BCM_5301X
+	default 0xf1006000 if DEBUG_MT6589_UART0
 	default 0xf11f1000 if ARCH_VERSATILE
 	default 0xf1600000 if ARCH_INTEGRATOR
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
-- 
1.7.9.5


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

* [PATCH 4/7] arm: mediatek: Add earlyprintk support for mt6589
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

Enable low-level debug for Mediatek mt6589 SoC on UART0.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/Kconfig.debug |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8f90595..8ee127e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -818,6 +818,14 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on Ux500 based platforms.
 
+	config DEBUG_MT6589_UART0
+		bool "Mediatek mt6589 UART0"
+		depends on ARCH_MEDIATEK
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  for Mediatek mt6589 based platforms on UART0.
+
 	config DEBUG_VEXPRESS_UART0_DETECT
 		bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
 		depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -1053,6 +1061,7 @@ config DEBUG_UART_PHYS
 	default 0x10126000 if DEBUG_RK3X_UART1
 	default 0x101f1000 if ARCH_VERSATILE
 	default 0x101fb000 if DEBUG_NOMADIK_UART
+	default 0x11006000 if DEBUG_MT6589_UART0
 	default 0x16000000 if ARCH_INTEGRATOR
 	default 0x18000300 if DEBUG_BCM_5301X
 	default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
@@ -1114,6 +1123,7 @@ config DEBUG_UART_VIRT
 	default 0xf01fb000 if DEBUG_NOMADIK_UART
 	default 0xf0201000 if DEBUG_BCM2835
 	default 0xf1000300 if DEBUG_BCM_5301X
+	default 0xf1006000 if DEBUG_MT6589_UART0
 	default 0xf11f1000 if ARCH_VERSATILE
 	default 0xf1600000 if ARCH_INTEGRATOR
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
-- 
1.7.9.5

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

* [PATCH 5/7] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

Add boot argument for earlyprintk to the aquaris5 device tree file.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589-aquaris5.dts |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/mt6589-aquaris5.dts b/arch/arm/boot/dts/mt6589-aquaris5.dts
index 443b446..74cb1ba 100644
--- a/arch/arm/boot/dts/mt6589-aquaris5.dts
+++ b/arch/arm/boot/dts/mt6589-aquaris5.dts
@@ -19,6 +19,10 @@
 / {
 	model = "bq Aquaris5";
 
+	chosen {
+		bootargs = "earlyprintk";
+	};
+
 	memory {
 		reg = <0x80000000 0x40000000>;
 	};
-- 
1.7.9.5


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

* [PATCH 5/7] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

Add boot argument for earlyprintk to the aquaris5 device tree file.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589-aquaris5.dts |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/mt6589-aquaris5.dts b/arch/arm/boot/dts/mt6589-aquaris5.dts
index 443b446..74cb1ba 100644
--- a/arch/arm/boot/dts/mt6589-aquaris5.dts
+++ b/arch/arm/boot/dts/mt6589-aquaris5.dts
@@ -19,6 +19,10 @@
 / {
 	model = "bq Aquaris5";
 
+	chosen {
+		bootargs = "earlyprintk";
+	};
+
 	memory {
 		reg = <0x80000000 0x40000000>;
 	};
-- 
1.7.9.5

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

We enable GTP6 which ungates the arch timer clock. Apart we write the
frequency with which the timer is running in the CNTFREQ register.
In the future this should be done in the bootloader.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/mach-mediatek/mediatek.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c
index f2acf07..b7c5c60 100644
--- a/arch/arm/mach-mediatek/mediatek.c
+++ b/arch/arm/mach-mediatek/mediatek.c
@@ -16,6 +16,32 @@
  */
 #include <linux/init.h>
 #include <asm/mach/arch.h>
+#include <linux/of.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+
+
+#define GPT6_CON_MT65xx 0x10008060
+
+static void __init mediatek_timer_init(void)
+{
+	static void __iomem *gpt_base;
+
+	if (of_machine_is_compatible("mediatek,mt6589")) {
+		/* set cntfreq register which is not done in bootloader */
+		asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
+
+		/* turn on GPT6 which ungates arch timer clocks */
+		gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
+	}
+
+	/* enabel clock and set to free-run */
+	if (gpt_base)
+		writel(0x31, gpt_base);
+
+	of_clk_init(NULL);
+	clocksource_of_init();
+};
 
 static const char * const mediatek_board_dt_compat[] = {
 	"mediatek,mt6589",
@@ -24,4 +50,5 @@ static const char * const mediatek_board_dt_compat[] = {
 
 DT_MACHINE_START(MEDIATEK_DT, "Mediatek Cortex-A7 (Device Tree)")
 	.dt_compat	= mediatek_board_dt_compat,
+	.init_time	= mediatek_timer_init,
 MACHINE_END
-- 
1.7.9.5


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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

We enable GTP6 which ungates the arch timer clock. Apart we write the
frequency with which the timer is running in the CNTFREQ register.
In the future this should be done in the bootloader.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/mach-mediatek/mediatek.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c
index f2acf07..b7c5c60 100644
--- a/arch/arm/mach-mediatek/mediatek.c
+++ b/arch/arm/mach-mediatek/mediatek.c
@@ -16,6 +16,32 @@
  */
 #include <linux/init.h>
 #include <asm/mach/arch.h>
+#include <linux/of.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+
+
+#define GPT6_CON_MT65xx 0x10008060
+
+static void __init mediatek_timer_init(void)
+{
+	static void __iomem *gpt_base;
+
+	if (of_machine_is_compatible("mediatek,mt6589")) {
+		/* set cntfreq register which is not done in bootloader */
+		asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
+
+		/* turn on GPT6 which ungates arch timer clocks */
+		gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
+	}
+
+	/* enabel clock and set to free-run */
+	if (gpt_base)
+		writel(0x31, gpt_base);
+
+	of_clk_init(NULL);
+	clocksource_of_init();
+};
 
 static const char * const mediatek_board_dt_compat[] = {
 	"mediatek,mt6589",
@@ -24,4 +50,5 @@ static const char * const mediatek_board_dt_compat[] = {
 
 DT_MACHINE_START(MEDIATEK_DT, "Mediatek Cortex-A7 (Device Tree)")
 	.dt_compat	= mediatek_board_dt_compat,
+	.init_time	= mediatek_timer_init,
 MACHINE_END
-- 
1.7.9.5

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

* [PATCH 7/7] arm: dts: mt6589: Add arm arch timer node
  2014-07-31 16:42 ` Matthias Brugger
@ 2014-07-31 16:42   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	olof, arnd, jason, thomas.petazzoni, swarren,
	sebastian.hesselbarth, stefan, maxime.ripard, matthias.bgg,
	anders.berg, linus.walleij, heiko, devicetree, linux-arm-kernel

This patch adds the device tree node for the arm architecture timer.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589.dtsi |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
index 742c9bd..7bcf031 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -73,14 +73,22 @@
 		compatible = "simple-bus";
 		ranges;
 
-		timer: timer@10008000 {
+		timer1: timer@10008000 {
 			compatible = "mediatek,mt6577-timer";
-			reg = <0x10008000 0x80>;
+			reg = <0x10008000 0x60>;
 			interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&system_clk>, <&rtc_clk>;
 			clock-names = "system-clk", "rtc-clk";
 		};
 
+		timer2: timer {
+			compatible = "arm,armv7-timer";
+			interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+		};
+
 		gic: interrupt-controller@10211000 {
 			compatible = "arm,cortex-a15-gic";
 			interrupt-controller;
-- 
1.7.9.5


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

* [PATCH 7/7] arm: dts: mt6589: Add arm arch timer node
@ 2014-07-31 16:42   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-07-31 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds the device tree node for the arm architecture timer.

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 arch/arm/boot/dts/mt6589.dtsi |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
index 742c9bd..7bcf031 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -73,14 +73,22 @@
 		compatible = "simple-bus";
 		ranges;
 
-		timer: timer at 10008000 {
+		timer1: timer at 10008000 {
 			compatible = "mediatek,mt6577-timer";
-			reg = <0x10008000 0x80>;
+			reg = <0x10008000 0x60>;
 			interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&system_clk>, <&rtc_clk>;
 			clock-names = "system-clk", "rtc-clk";
 		};
 
+		timer2: timer {
+			compatible = "arm,armv7-timer";
+			interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+				     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+		};
+
 		gic: interrupt-controller at 10211000 {
 			compatible = "arm,cortex-a15-gic";
 			interrupt-controller;
-- 
1.7.9.5

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-07-31 16:42   ` Matthias Brugger
@ 2014-08-11  7:15     ` Linus Walleij
  -1 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2014-08-11  7:15 UTC (permalink / raw)
  To: Matthias Brugger, Mike Turquette
  Cc: linux-kernel, Russell King - ARM Linux, Rob Herring, Pawel Moll,
	Mark Rutland, ijc+devicetree, Kumar Gala, Olof Johansson,
	Arnd Bergmann, Jason Cooper, Thomas Petazzoni, Stephen Warren,
	Sebastian Hesselbarth, stefan, Maxime Ripard, Berg, Anders,
	Heiko Stübner, devicetree, linux-arm-kernel

On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:

> We enable GTP6 which ungates the arch timer clock. Apart we write the
> frequency with which the timer is running in the CNTFREQ register.
> In the future this should be done in the bootloader.
>
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
(...)

> +       if (of_machine_is_compatible("mediatek,mt6589")) {
> +               /* set cntfreq register which is not done in bootloader */
> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));

I guess this is for something like the ARM arch timer in
drivers/clocksource/arm_arch_timer.c

Instead of doing this, use the DT property "clock-frequency" on
the ARM arch timer node, as that overrides the CP15 setting.

> +
> +               /* turn on GPT6 which ungates arch timer clocks */
> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
> +       }
> +
> +       /* enabel clock and set to free-run */
> +       if (gpt_base)
> +               writel(0x31, gpt_base);

Why is this not done properly in the GPT driver (I guess
in drivers/clocksource/mtk_timer.c) instead of remapping
it and fiddling around in the machine?

If it only affects the mt6589 just add another compatible string
to that driver like "mediatek,mt6589-timer" as it properly reflects the
fact that this timer is slightly different on the 6589.

Also use a #define for the magic constant 0x31.

Yours,
Linus Walleij

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-11  7:15     ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2014-08-11  7:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:

> We enable GTP6 which ungates the arch timer clock. Apart we write the
> frequency with which the timer is running in the CNTFREQ register.
> In the future this should be done in the bootloader.
>
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
(...)

> +       if (of_machine_is_compatible("mediatek,mt6589")) {
> +               /* set cntfreq register which is not done in bootloader */
> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));

I guess this is for something like the ARM arch timer in
drivers/clocksource/arm_arch_timer.c

Instead of doing this, use the DT property "clock-frequency" on
the ARM arch timer node, as that overrides the CP15 setting.

> +
> +               /* turn on GPT6 which ungates arch timer clocks */
> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
> +       }
> +
> +       /* enabel clock and set to free-run */
> +       if (gpt_base)
> +               writel(0x31, gpt_base);

Why is this not done properly in the GPT driver (I guess
in drivers/clocksource/mtk_timer.c) instead of remapping
it and fiddling around in the machine?

If it only affects the mt6589 just add another compatible string
to that driver like "mediatek,mt6589-timer" as it properly reflects the
fact that this timer is slightly different on the 6589.

Also use a #define for the magic constant 0x31.

Yours,
Linus Walleij

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-08-11  7:15     ` Linus Walleij
  (?)
@ 2014-08-12  9:02       ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-12  9:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mike Turquette, linux-kernel, Russell King - ARM Linux,
	Rob Herring, Pawel Moll, Mark Rutland, ijc+devicetree,
	Kumar Gala, Olof Johansson, Arnd Bergmann, Jason Cooper,
	Thomas Petazzoni, Stephen Warren, Sebastian Hesselbarth, stefan,
	Maxime Ripard, Berg, Anders, Heiko Stübner, devicetree,
	linux-arm-kernel

2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>
>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> frequency with which the timer is running in the CNTFREQ register.
>> In the future this should be done in the bootloader.
>>
>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> (...)
>
>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> +               /* set cntfreq register which is not done in bootloader */
>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>
> I guess this is for something like the ARM arch timer in
> drivers/clocksource/arm_arch_timer.c
>
> Instead of doing this, use the DT property "clock-frequency" on
> the ARM arch timer node, as that overrides the CP15 setting.
>
>> +
>> +               /* turn on GPT6 which ungates arch timer clocks */
>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> +       }
>> +
>> +       /* enabel clock and set to free-run */
>> +       if (gpt_base)
>> +               writel(0x31, gpt_base);
>
> Why is this not done properly in the GPT driver (I guess
> in drivers/clocksource/mtk_timer.c) instead of remapping
> it and fiddling around in the machine?

I didn't put it in the GPT driver, because that would mean, that you
need to have the mtk_timer to be able to use the ARM arch timer.
>From my understanding this are two independent blocks in the SoC.
Apart from that, as stated in the commit message, this patch is a
workaround until we have a bootloader which does this for us.
Therefore I thought the init_time function would be the better place to do this.

Thanks,
Matthias

>
> If it only affects the mt6589 just add another compatible string
> to that driver like "mediatek,mt6589-timer" as it properly reflects the
> fact that this timer is slightly different on the 6589.
>
> Also use a #define for the magic constant 0x31.
>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-12  9:02       ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-12  9:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mark Rutland, Thomas Petazzoni, Russell King - ARM Linux,
	Arnd Bergmann, Pawel Moll, ijc+devicetree, Heiko Stübner,
	linux-kernel, stefan, Stephen Warren, devicetree, Rob Herring,
	linux-arm-kernel, Kumar Gala, Olof Johansson, Mike Turquette,
	Maxime Ripard, Sebastian Hesselbarth, Berg, Anders

2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>
>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> frequency with which the timer is running in the CNTFREQ register.
>> In the future this should be done in the bootloader.
>>
>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> (...)
>
>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> +               /* set cntfreq register which is not done in bootloader */
>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>
> I guess this is for something like the ARM arch timer in
> drivers/clocksource/arm_arch_timer.c
>
> Instead of doing this, use the DT property "clock-frequency" on
> the ARM arch timer node, as that overrides the CP15 setting.
>
>> +
>> +               /* turn on GPT6 which ungates arch timer clocks */
>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> +       }
>> +
>> +       /* enabel clock and set to free-run */
>> +       if (gpt_base)
>> +               writel(0x31, gpt_base);
>
> Why is this not done properly in the GPT driver (I guess
> in drivers/clocksource/mtk_timer.c) instead of remapping
> it and fiddling around in the machine?

I didn't put it in the GPT driver, because that would mean, that you
need to have the mtk_timer to be able to use the ARM arch timer.
>From my understanding this are two independent blocks in the SoC.
Apart from that, as stated in the commit message, this patch is a
workaround until we have a bootloader which does this for us.
Therefore I thought the init_time function would be the better place to do this.

Thanks,
Matthias

>
> If it only affects the mt6589 just add another compatible string
> to that driver like "mediatek,mt6589-timer" as it properly reflects the
> fact that this timer is slightly different on the 6589.
>
> Also use a #define for the magic constant 0x31.
>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-12  9:02       ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-12  9:02 UTC (permalink / raw)
  To: linux-arm-kernel

2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>
>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> frequency with which the timer is running in the CNTFREQ register.
>> In the future this should be done in the bootloader.
>>
>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> (...)
>
>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> +               /* set cntfreq register which is not done in bootloader */
>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>
> I guess this is for something like the ARM arch timer in
> drivers/clocksource/arm_arch_timer.c
>
> Instead of doing this, use the DT property "clock-frequency" on
> the ARM arch timer node, as that overrides the CP15 setting.
>
>> +
>> +               /* turn on GPT6 which ungates arch timer clocks */
>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> +       }
>> +
>> +       /* enabel clock and set to free-run */
>> +       if (gpt_base)
>> +               writel(0x31, gpt_base);
>
> Why is this not done properly in the GPT driver (I guess
> in drivers/clocksource/mtk_timer.c) instead of remapping
> it and fiddling around in the machine?

I didn't put it in the GPT driver, because that would mean, that you
need to have the mtk_timer to be able to use the ARM arch timer.
>From my understanding this are two independent blocks in the SoC.
Apart from that, as stated in the commit message, this patch is a
workaround until we have a bootloader which does this for us.
Therefore I thought the init_time function would be the better place to do this.

Thanks,
Matthias

>
> If it only affects the mt6589 just add another compatible string
> to that driver like "mediatek,mt6589-timer" as it properly reflects the
> fact that this timer is slightly different on the 6589.
>
> Also use a #define for the magic constant 0x31.
>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-12 15:03         ` Rob Herring
  0 siblings, 0 replies; 49+ messages in thread
From: Rob Herring @ 2014-08-12 15:03 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mike Turquette, linux-kernel,
	Russell King - ARM Linux, Rob Herring, Pawel Moll, Mark Rutland,
	ijc+devicetree, Kumar Gala, Olof Johansson, Arnd Bergmann,
	Jason Cooper, Thomas Petazzoni, Stephen Warren,
	Sebastian Hesselbarth, stefan, Maxime Ripard, Berg, Anders,
	Heiko Stübner, devicetree, linux-arm-kernel

On Tue, Aug 12, 2014 at 4:02 AM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg@gmail.com> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

I agree that the bootloader is the right place, and the fixup in the
machine code until that is in place is the right place for the fixup.

Rob

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-12 15:03         ` Rob Herring
  0 siblings, 0 replies; 49+ messages in thread
From: Rob Herring @ 2014-08-12 15:03 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mike Turquette,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Russell King - ARM Linux,
	Rob Herring, Pawel Moll, Mark Rutland,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, Kumar Gala,
	Olof Johansson, Arnd Bergmann, Jason Cooper, Thomas Petazzoni,
	Stephen Warren, Sebastian Hesselbarth, stefan-XLVq0VzYD2Y,
	Maxime Ripard, Berg, Anders, Heiko Stübner,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Tue, Aug 12, 2014 at 4:02 AM, Matthias Brugger
<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

I agree that the bootloader is the right place, and the fixup in the
machine code until that is in place is the right place for the fixup.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-12 15:03         ` Rob Herring
  0 siblings, 0 replies; 49+ messages in thread
From: Rob Herring @ 2014-08-12 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 12, 2014 at 4:02 AM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg@gmail.com> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

I agree that the bootloader is the right place, and the fixup in the
machine code until that is in place is the right place for the fixup.

Rob

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-13  8:47         ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2014-08-13  8:47 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Mike Turquette, linux-kernel, Russell King - ARM Linux,
	Rob Herring, Pawel Moll, Mark Rutland, ijc+devicetree,
	Kumar Gala, Olof Johansson, Arnd Bergmann, Jason Cooper,
	Thomas Petazzoni, Stephen Warren, Sebastian Hesselbarth, stefan,
	Maxime Ripard, Berg, Anders, Heiko Stübner, devicetree,
	linux-arm-kernel

On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg@gmail.com> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

OK I get the point...

What about the ARM arch timer fixup then, will that also be
fixed in the boot loader eventually?

Yours,
Linus Walleij

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-13  8:47         ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2014-08-13  8:47 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Mike Turquette, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Russell King - ARM Linux, Rob Herring, Pawel Moll, Mark Rutland,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, Kumar Gala,
	Olof Johansson, Arnd Bergmann, Jason Cooper, Thomas Petazzoni,
	Stephen Warren, Sebastian Hesselbarth, stefan-XLVq0VzYD2Y,
	Maxime Ripard, Berg, Anders, Heiko Stübner,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

OK I get the point...

What about the ARM arch timer fixup then, will that also be
fixed in the boot loader eventually?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-13  8:47         ` Linus Walleij
  0 siblings, 0 replies; 49+ messages in thread
From: Linus Walleij @ 2014-08-13  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg@gmail.com> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

OK I get the point...

What about the ARM arch timer fixup then, will that also be
fixed in the boot loader eventually?

Yours,
Linus Walleij

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-08-13  8:47         ` Linus Walleij
  (?)
@ 2014-08-13  9:29           ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-13  9:29 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mike Turquette, linux-kernel, Russell King - ARM Linux,
	Rob Herring, Pawel Moll, Mark Rutland, ijc+devicetree,
	Kumar Gala, Olof Johansson, Arnd Bergmann, Jason Cooper,
	Thomas Petazzoni, Stephen Warren, Sebastian Hesselbarth, stefan,
	Maxime Ripard, Berg, Anders, Heiko Stübner, devicetree,
	linux-arm-kernel

2014-08-13 10:47 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>>> <matthias.bgg@gmail.com> wrote:
>>>
>>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>>> frequency with which the timer is running in the CNTFREQ register.
>>>> In the future this should be done in the bootloader.
>>>>
>>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>>> (...)
>>>
>>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>>> +               /* set cntfreq register which is not done in bootloader */
>>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>>
>>> I guess this is for something like the ARM arch timer in
>>> drivers/clocksource/arm_arch_timer.c
>>>
>>> Instead of doing this, use the DT property "clock-frequency" on
>>> the ARM arch timer node, as that overrides the CP15 setting.
>>>
>>>> +
>>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>>> +       }
>>>> +
>>>> +       /* enabel clock and set to free-run */
>>>> +       if (gpt_base)
>>>> +               writel(0x31, gpt_base);
>>>
>>> Why is this not done properly in the GPT driver (I guess
>>> in drivers/clocksource/mtk_timer.c) instead of remapping
>>> it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> OK I get the point...
>
> What about the ARM arch timer fixup then, will that also be
> fixed in the boot loader eventually?

Do you refer to clock frequency in the cntfreq register? I think that
this should go in the DTS as you said.
Same holds for the magic 0x31, which should be done through defines.

Cheers,
Matthias

>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-13  9:29           ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-13  9:29 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mike Turquette, linux-kernel, Russell King - ARM Linux,
	Rob Herring, Pawel Moll, Mark Rutland, ijc+devicetree,
	Kumar Gala, Olof Johansson, Arnd Bergmann, Jason Cooper,
	Thomas Petazzoni, Stephen Warren, Sebastian Hesselbarth, stefan,
	Maxime Ripard, Berg, Anders, Heiko Stübner, devicetree

2014-08-13 10:47 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>>> <matthias.bgg@gmail.com> wrote:
>>>
>>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>>> frequency with which the timer is running in the CNTFREQ register.
>>>> In the future this should be done in the bootloader.
>>>>
>>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>>> (...)
>>>
>>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>>> +               /* set cntfreq register which is not done in bootloader */
>>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>>
>>> I guess this is for something like the ARM arch timer in
>>> drivers/clocksource/arm_arch_timer.c
>>>
>>> Instead of doing this, use the DT property "clock-frequency" on
>>> the ARM arch timer node, as that overrides the CP15 setting.
>>>
>>>> +
>>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>>> +       }
>>>> +
>>>> +       /* enabel clock and set to free-run */
>>>> +       if (gpt_base)
>>>> +               writel(0x31, gpt_base);
>>>
>>> Why is this not done properly in the GPT driver (I guess
>>> in drivers/clocksource/mtk_timer.c) instead of remapping
>>> it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> OK I get the point...
>
> What about the ARM arch timer fixup then, will that also be
> fixed in the boot loader eventually?

Do you refer to clock frequency in the cntfreq register? I think that
this should go in the DTS as you said.
Same holds for the magic 0x31, which should be done through defines.

Cheers,
Matthias

>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-13  9:29           ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-13  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

2014-08-13 10:47 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Tue, Aug 12, 2014 at 11:02 AM, Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>>> <matthias.bgg@gmail.com> wrote:
>>>
>>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>>> frequency with which the timer is running in the CNTFREQ register.
>>>> In the future this should be done in the bootloader.
>>>>
>>>> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>>> (...)
>>>
>>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>>> +               /* set cntfreq register which is not done in bootloader */
>>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>>
>>> I guess this is for something like the ARM arch timer in
>>> drivers/clocksource/arm_arch_timer.c
>>>
>>> Instead of doing this, use the DT property "clock-frequency" on
>>> the ARM arch timer node, as that overrides the CP15 setting.
>>>
>>>> +
>>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>>> +       }
>>>> +
>>>> +       /* enabel clock and set to free-run */
>>>> +       if (gpt_base)
>>>> +               writel(0x31, gpt_base);
>>>
>>> Why is this not done properly in the GPT driver (I guess
>>> in drivers/clocksource/mtk_timer.c) instead of remapping
>>> it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> OK I get the point...
>
> What about the ARM arch timer fixup then, will that also be
> fixed in the boot loader eventually?

Do you refer to clock frequency in the cntfreq register? I think that
this should go in the DTS as you said.
Same holds for the magic 0x31, which should be done through defines.

Cheers,
Matthias

>
> Yours,
> Linus Walleij



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-08-12  9:02       ` Matthias Brugger
@ 2014-08-14  2:24         ` Joe.C
  -1 siblings, 0 replies; 49+ messages in thread
From: Joe.C @ 2014-08-14  2:24 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Mark Rutland, Thomas Petazzoni, Berg, Anders, Mike Turquette,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Linus Walleij, linux-kernel, stefan, devicetree,
	Rob Herring, Kumar Gala, Olof Johansson, Stephen Warren,
	Maxime Ripard, Sebastian Hesselbarth, Jason Cooper,
	linux-arm-kernel@lists.infradead.org

On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
> > <matthias.bgg@gmail.com> wrote:
> >
> >> We enable GTP6 which ungates the arch timer clock. Apart we write the
> >> frequency with which the timer is running in the CNTFREQ register.
> >> In the future this should be done in the bootloader.
> >>
> >> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> > (...)
> >
> >> +       if (of_machine_is_compatible("mediatek,mt6589")) {
> >> +               /* set cntfreq register which is not done in bootloader */
> >> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
> >
> > I guess this is for something like the ARM arch timer in
> > drivers/clocksource/arm_arch_timer.c
> >
> > Instead of doing this, use the DT property "clock-frequency" on
> > the ARM arch timer node, as that overrides the CP15 setting.
> >
> >> +
> >> +               /* turn on GPT6 which ungates arch timer clocks */
> >> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
> >> +       }
> >> +
> >> +       /* enabel clock and set to free-run */
> >> +       if (gpt_base)
> >> +               writel(0x31, gpt_base);
> >
> > Why is this not done properly in the GPT driver (I guess
> > in drivers/clocksource/mtk_timer.c) instead of remapping
> > it and fiddling around in the machine?
> 
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

Can we have a separate node like mt6577-timerfixup then?
I'm preparing patch for mt8127 and mt8135. They all need this and use
same address and. In current form, I'll have to make this check against
a compatible string array.

Joe.C

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-14  2:24         ` Joe.C
  0 siblings, 0 replies; 49+ messages in thread
From: Joe.C @ 2014-08-14  2:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
> > <matthias.bgg@gmail.com> wrote:
> >
> >> We enable GTP6 which ungates the arch timer clock. Apart we write the
> >> frequency with which the timer is running in the CNTFREQ register.
> >> In the future this should be done in the bootloader.
> >>
> >> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> > (...)
> >
> >> +       if (of_machine_is_compatible("mediatek,mt6589")) {
> >> +               /* set cntfreq register which is not done in bootloader */
> >> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
> >
> > I guess this is for something like the ARM arch timer in
> > drivers/clocksource/arm_arch_timer.c
> >
> > Instead of doing this, use the DT property "clock-frequency" on
> > the ARM arch timer node, as that overrides the CP15 setting.
> >
> >> +
> >> +               /* turn on GPT6 which ungates arch timer clocks */
> >> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
> >> +       }
> >> +
> >> +       /* enabel clock and set to free-run */
> >> +       if (gpt_base)
> >> +               writel(0x31, gpt_base);
> >
> > Why is this not done properly in the GPT driver (I guess
> > in drivers/clocksource/mtk_timer.c) instead of remapping
> > it and fiddling around in the machine?
> 
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

Can we have a separate node like mt6577-timerfixup then?
I'm preparing patch for mt8127 and mt8135. They all need this and use
same address and. In current form, I'll have to make this check against
a compatible string array.

Joe.C

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-08-14  2:24         ` Joe.C
  (?)
@ 2014-08-14  9:35           ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-14  9:35 UTC (permalink / raw)
  To: Joe.C
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard,
	Sebastian Hesselbarth, Berg, Anders, Jason Cooper

2014-08-14 4:24 GMT+02:00 Joe.C <srv_yingjoe.chen@mediatek.com>:
> On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> > <matthias.bgg@gmail.com> wrote:
>> >
>> >> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> >> frequency with which the timer is running in the CNTFREQ register.
>> >> In the future this should be done in the bootloader.
>> >>
>> >> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> > (...)
>> >
>> >> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> >> +               /* set cntfreq register which is not done in bootloader */
>> >> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>> >
>> > I guess this is for something like the ARM arch timer in
>> > drivers/clocksource/arm_arch_timer.c
>> >
>> > Instead of doing this, use the DT property "clock-frequency" on
>> > the ARM arch timer node, as that overrides the CP15 setting.
>> >
>> >> +
>> >> +               /* turn on GPT6 which ungates arch timer clocks */
>> >> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> >> +       }
>> >> +
>> >> +       /* enabel clock and set to free-run */
>> >> +       if (gpt_base)
>> >> +               writel(0x31, gpt_base);
>> >
>> > Why is this not done properly in the GPT driver (I guess
>> > in drivers/clocksource/mtk_timer.c) instead of remapping
>> > it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> Can we have a separate node like mt6577-timerfixup then?
> I'm preparing patch for mt8127 and mt8135. They all need this and use
> same address and. In current form, I'll have to make this check against
> a compatible string array.

The way to go is to add another of_machine_is_compatible for every
SoC. If the address is the same just use logical or.

Cheers,
Matthias

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-14  9:35           ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-14  9:35 UTC (permalink / raw)
  To: Joe.C
  Cc: Mark Rutland, Thomas Petazzoni, Berg, Anders, Mike Turquette,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Linus Walleij, linux-kernel, stefan, devicetree,
	Rob Herring, Kumar Gala, Olof Johansson, Stephen Warren,
	Maxime Ripard, Sebastian Hesselbarth, Jason Cooper,
	linux-arm-kernel@lists.infradead.org

2014-08-14 4:24 GMT+02:00 Joe.C <srv_yingjoe.chen@mediatek.com>:
> On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> > <matthias.bgg@gmail.com> wrote:
>> >
>> >> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> >> frequency with which the timer is running in the CNTFREQ register.
>> >> In the future this should be done in the bootloader.
>> >>
>> >> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> > (...)
>> >
>> >> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> >> +               /* set cntfreq register which is not done in bootloader */
>> >> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>> >
>> > I guess this is for something like the ARM arch timer in
>> > drivers/clocksource/arm_arch_timer.c
>> >
>> > Instead of doing this, use the DT property "clock-frequency" on
>> > the ARM arch timer node, as that overrides the CP15 setting.
>> >
>> >> +
>> >> +               /* turn on GPT6 which ungates arch timer clocks */
>> >> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> >> +       }
>> >> +
>> >> +       /* enabel clock and set to free-run */
>> >> +       if (gpt_base)
>> >> +               writel(0x31, gpt_base);
>> >
>> > Why is this not done properly in the GPT driver (I guess
>> > in drivers/clocksource/mtk_timer.c) instead of remapping
>> > it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> Can we have a separate node like mt6577-timerfixup then?
> I'm preparing patch for mt8127 and mt8135. They all need this and use
> same address and. In current form, I'll have to make this check against
> a compatible string array.

The way to go is to add another of_machine_is_compatible for every
SoC. If the address is the same just use logical or.

Cheers,
Matthias

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-08-14  9:35           ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-08-14  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

2014-08-14 4:24 GMT+02:00 Joe.C <srv_yingjoe.chen@mediatek.com>:
> On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
>> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> > <matthias.bgg@gmail.com> wrote:
>> >
>> >> We enable GTP6 which ungates the arch timer clock. Apart we write the
>> >> frequency with which the timer is running in the CNTFREQ register.
>> >> In the future this should be done in the bootloader.
>> >>
>> >> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
>> > (...)
>> >
>> >> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>> >> +               /* set cntfreq register which is not done in bootloader */
>> >> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>> >
>> > I guess this is for something like the ARM arch timer in
>> > drivers/clocksource/arm_arch_timer.c
>> >
>> > Instead of doing this, use the DT property "clock-frequency" on
>> > the ARM arch timer node, as that overrides the CP15 setting.
>> >
>> >> +
>> >> +               /* turn on GPT6 which ungates arch timer clocks */
>> >> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>> >> +       }
>> >> +
>> >> +       /* enabel clock and set to free-run */
>> >> +       if (gpt_base)
>> >> +               writel(0x31, gpt_base);
>> >
>> > Why is this not done properly in the GPT driver (I guess
>> > in drivers/clocksource/mtk_timer.c) instead of remapping
>> > it and fiddling around in the machine?
>>
>> I didn't put it in the GPT driver, because that would mean, that you
>> need to have the mtk_timer to be able to use the ARM arch timer.
>> From my understanding this are two independent blocks in the SoC.
>> Apart from that, as stated in the commit message, this patch is a
>> workaround until we have a bootloader which does this for us.
>> Therefore I thought the init_time function would be the better place to do this.
>
> Can we have a separate node like mt6577-timerfixup then?
> I'm preparing patch for mt8127 and mt8135. They all need this and use
> same address and. In current form, I'll have to make this check against
> a compatible string array.

The way to go is to add another of_machine_is_compatible for every
SoC. If the address is the same just use logical or.

Cheers,
Matthias

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-08-13  9:29           ` Matthias Brugger
  (?)
@ 2014-10-24 13:53             ` Yingjoe Chen
  -1 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-24 13:53 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard,
	Sebastian Hesselbarth, Berg, Anders, Jason Cooper


Hi Matthias,

I didn't saw this in v3.18-rc1, are you working on version 2 of this?
mt8135 and m8127 also need this fixup and we need this to have SMP
working.

Joe.C



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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-24 13:53             ` Yingjoe Chen
  0 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-24 13:53 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard


Hi Matthias,

I didn't saw this in v3.18-rc1, are you working on version 2 of this?
mt8135 and m8127 also need this fixup and we need this to have SMP
working.

Joe.C

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-24 13:53             ` Yingjoe Chen
  0 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-24 13:53 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Matthias,

I didn't saw this in v3.18-rc1, are you working on version 2 of this?
mt8135 and m8127 also need this fixup and we need this to have SMP
working.

Joe.C

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-10-24 13:53             ` Yingjoe Chen
  (?)
@ 2014-10-27 10:28               ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-27 10:28 UTC (permalink / raw)
  To: Yingjoe Chen
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard,
	Sebastian Hesselbarth, Berg, Anders, Jason Cooper

Hi Joe,

2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>
> Hi Matthias,
>
> I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> mt8135 and m8127 also need this fixup and we need this to have SMP
> working.

I had a discussion with Mark Rutland from ARM on this [0].
At that point he convinced me that this was not critical.

If we need this for SMP, things really change here I think.

Cheers,
Matthias

[0] https://lkml.org/lkml/2014/8/21/170

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-27 10:28               ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-27 10:28 UTC (permalink / raw)
  To: Yingjoe Chen
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard

Hi Joe,

2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>
> Hi Matthias,
>
> I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> mt8135 and m8127 also need this fixup and we need this to have SMP
> working.

I had a discussion with Mark Rutland from ARM on this [0].
At that point he convinced me that this was not critical.

If we need this for SMP, things really change here I think.

Cheers,
Matthias

[0] https://lkml.org/lkml/2014/8/21/170

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-27 10:28               ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-27 10:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Joe,

2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>
> Hi Matthias,
>
> I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> mt8135 and m8127 also need this fixup and we need this to have SMP
> working.

I had a discussion with Mark Rutland from ARM on this [0].
At that point he convinced me that this was not critical.

If we need this for SMP, things really change here I think.

Cheers,
Matthias

[0] https://lkml.org/lkml/2014/8/21/170

>
> Joe.C
>
>



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-10-27 10:28               ` Matthias Brugger
  (?)
@ 2014-10-30  3:23                 ` Yingjoe Chen
  -1 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-30  3:23 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard,
	Sebastian Hesselbarth, Berg, Anders, Jason Cooper

Hi Matthias,

On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
> Hi Joe,
> 
> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
> >
> > Hi Matthias,
> >
> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> > mt8135 and m8127 also need this fixup and we need this to have SMP
> > working.
> 
> I had a discussion with Mark Rutland from ARM on this [0].
> At that point he convinced me that this was not critical.
> 
> If we need this for SMP, things really change here I think.

We have some driver now, and we started to implement SMP enable method
internally. I think it is reasonable to discuss this now.
We could include this patch in our SMP patch series. Do you prefer we do
this?

Joe.C




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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-30  3:23                 ` Yingjoe Chen
  0 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-30  3:23 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard

Hi Matthias,

On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
> Hi Joe,
> 
> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
> >
> > Hi Matthias,
> >
> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> > mt8135 and m8127 also need this fixup and we need this to have SMP
> > working.
> 
> I had a discussion with Mark Rutland from ARM on this [0].
> At that point he convinced me that this was not critical.
> 
> If we need this for SMP, things really change here I think.

We have some driver now, and we started to implement SMP enable method
internally. I think it is reasonable to discuss this now.
We could include this patch in our SMP patch series. Do you prefer we do
this?

Joe.C

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-30  3:23                 ` Yingjoe Chen
  0 siblings, 0 replies; 49+ messages in thread
From: Yingjoe Chen @ 2014-10-30  3:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Matthias,

On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
> Hi Joe,
> 
> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
> >
> > Hi Matthias,
> >
> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
> > mt8135 and m8127 also need this fixup and we need this to have SMP
> > working.
> 
> I had a discussion with Mark Rutland from ARM on this [0].
> At that point he convinced me that this was not critical.
> 
> If we need this for SMP, things really change here I think.

We have some driver now, and we started to implement SMP enable method
internally. I think it is reasonable to discuss this now.
We could include this patch in our SMP patch series. Do you prefer we do
this?

Joe.C

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
  2014-10-30  3:23                 ` Yingjoe Chen
  (?)
@ 2014-10-30  9:01                   ` Matthias Brugger
  -1 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-30  9:01 UTC (permalink / raw)
  To: Yingjoe Chen
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard,
	Sebastian Hesselbarth, Berg, Anders, Jason Cooper

2014-10-30 4:23 GMT+01:00 Yingjoe Chen <yingjoe.chen@mediatek.com>:
> Hi Matthias,
>
> On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
>> Hi Joe,
>>
>> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>> >
>> > Hi Matthias,
>> >
>> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
>> > mt8135 and m8127 also need this fixup and we need this to have SMP
>> > working.
>>
>> I had a discussion with Mark Rutland from ARM on this [0].
>> At that point he convinced me that this was not critical.
>>
>> If we need this for SMP, things really change here I think.
>
> We have some driver now, and we started to implement SMP enable method
> internally. I think it is reasonable to discuss this now.
> We could include this patch in our SMP patch series. Do you prefer we do
> this?

Alright. Please remind that we don't need to set the cntfreq register
here but define the clock frequency in the dts.

Thanks,
Matthias

>
> Joe.C
>
>
>



-- 
motzblog.wordpress.com

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

* Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-30  9:01                   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-30  9:01 UTC (permalink / raw)
  To: Yingjoe Chen
  Cc: Linus Walleij, Mark Rutland, Thomas Petazzoni,
	Russell King - ARM Linux, Arnd Bergmann, Pawel Moll,
	ijc+devicetree, Heiko Stübner, linux-kernel, stefan,
	Stephen Warren, devicetree, Rob Herring, linux-arm-kernel,
	Kumar Gala, Olof Johansson, Mike Turquette, Maxime Ripard

2014-10-30 4:23 GMT+01:00 Yingjoe Chen <yingjoe.chen@mediatek.com>:
> Hi Matthias,
>
> On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
>> Hi Joe,
>>
>> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>> >
>> > Hi Matthias,
>> >
>> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
>> > mt8135 and m8127 also need this fixup and we need this to have SMP
>> > working.
>>
>> I had a discussion with Mark Rutland from ARM on this [0].
>> At that point he convinced me that this was not critical.
>>
>> If we need this for SMP, things really change here I think.
>
> We have some driver now, and we started to implement SMP enable method
> internally. I think it is reasonable to discuss this now.
> We could include this patch in our SMP patch series. Do you prefer we do
> this?

Alright. Please remind that we don't need to set the cntfreq register
here but define the clock frequency in the dts.

Thanks,
Matthias

>
> Joe.C
>
>
>



-- 
motzblog.wordpress.com

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

* [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
@ 2014-10-30  9:01                   ` Matthias Brugger
  0 siblings, 0 replies; 49+ messages in thread
From: Matthias Brugger @ 2014-10-30  9:01 UTC (permalink / raw)
  To: linux-arm-kernel

2014-10-30 4:23 GMT+01:00 Yingjoe Chen <yingjoe.chen@mediatek.com>:
> Hi Matthias,
>
> On Mon, 2014-10-27 at 11:28 +0100, Matthias Brugger wrote:
>> Hi Joe,
>>
>> 2014-10-24 15:53 GMT+02:00 Yingjoe Chen <srv_yingjoe.chen@mediatek.com>:
>> >
>> > Hi Matthias,
>> >
>> > I didn't saw this in v3.18-rc1, are you working on version 2 of this?
>> > mt8135 and m8127 also need this fixup and we need this to have SMP
>> > working.
>>
>> I had a discussion with Mark Rutland from ARM on this [0].
>> At that point he convinced me that this was not critical.
>>
>> If we need this for SMP, things really change here I think.
>
> We have some driver now, and we started to implement SMP enable method
> internally. I think it is reasonable to discuss this now.
> We could include this patch in our SMP patch series. Do you prefer we do
> this?

Alright. Please remind that we don't need to set the cntfreq register
here but define the clock frequency in the dts.

Thanks,
Matthias

>
> Joe.C
>
>
>



-- 
motzblog.wordpress.com

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

end of thread, other threads:[~2014-10-30  9:01 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31 16:42 [PATCH 0/7] arm: mediatek: Add more basic features Matthias Brugger
2014-07-31 16:42 ` Matthias Brugger
2014-07-31 16:42 ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 1/7] arm: dts: Build dtb for Mediatek board Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 2/7] arm: multi_v7_defconfig: Enable Mediatek platform Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 3/7] arm: dts: mt6589: Fix typo in GIC unit address Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 4/7] arm: mediatek: Add earlyprintk support for mt6589 Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 5/7] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger
2014-08-11  7:15   ` Linus Walleij
2014-08-11  7:15     ` Linus Walleij
2014-08-12  9:02     ` Matthias Brugger
2014-08-12  9:02       ` Matthias Brugger
2014-08-12  9:02       ` Matthias Brugger
2014-08-12 15:03       ` Rob Herring
2014-08-12 15:03         ` Rob Herring
2014-08-12 15:03         ` Rob Herring
2014-08-13  8:47       ` Linus Walleij
2014-08-13  8:47         ` Linus Walleij
2014-08-13  8:47         ` Linus Walleij
2014-08-13  9:29         ` Matthias Brugger
2014-08-13  9:29           ` Matthias Brugger
2014-08-13  9:29           ` Matthias Brugger
2014-10-24 13:53           ` Yingjoe Chen
2014-10-24 13:53             ` Yingjoe Chen
2014-10-24 13:53             ` Yingjoe Chen
2014-10-27 10:28             ` Matthias Brugger
2014-10-27 10:28               ` Matthias Brugger
2014-10-27 10:28               ` Matthias Brugger
2014-10-30  3:23               ` Yingjoe Chen
2014-10-30  3:23                 ` Yingjoe Chen
2014-10-30  3:23                 ` Yingjoe Chen
2014-10-30  9:01                 ` Matthias Brugger
2014-10-30  9:01                   ` Matthias Brugger
2014-10-30  9:01                   ` Matthias Brugger
2014-08-14  2:24       ` Joe.C
2014-08-14  2:24         ` Joe.C
2014-08-14  9:35         ` Matthias Brugger
2014-08-14  9:35           ` Matthias Brugger
2014-08-14  9:35           ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 7/7] arm: dts: mt6589: Add arm arch timer node Matthias Brugger
2014-07-31 16:42   ` Matthias Brugger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.