* [PATCH v2 0/9] arm: mediatek: Add more basic features
@ 2014-08-18 14:58 Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 1/9] arm: dts: Build dtb for Mediatek board Matthias Brugger
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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,
lee.jones-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
srv_yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
This patch set adds some minor changes to the Mediatek mt6589 support.
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.
The patch set is based on v3.17-rc1
Changes for v2:
- rebased on v3.17-rc1
- add patch for the compatible property of aquaris5
- add patch setting GIC compatible string to new "arm,cortex-a7-gic"
- set ARM arch timer frequency in DTS
---
Matthias Brugger (9):
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
arm: dts: mediatek: Add compatible property for aquaris5
arm: dts: mt6589: Change compatible string for GIC
Documentation/devicetree/bindings/arm/mediatek.txt | 6 +++++
arch/arm/Kconfig.debug | 10 ++++++++
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/mt6589-aquaris5.dts | 5 ++++
arch/arm/boot/dts/mt6589.dtsi | 17 ++++++++++---
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm/mach-mediatek/mediatek.c | 26 ++++++++++++++++++++
7 files changed, 62 insertions(+), 4 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] 13+ messages in thread
* [PATCH v2 1/9] arm: dts: Build dtb for Mediatek board
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 2/9] arm: multi_v7_defconfig: Enable Mediatek platform Matthias Brugger
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mark.rutland, heiko, anders.berg, linus.walleij, stefan,
lee.jones, linux, pawel.moll, srv_yingjoe.chen,
sebastian.hesselbarth, devicetree, jason, arnd, ijc+devicetree,
robh+dt, matthias.bgg, swarren, linux-arm-kernel,
thomas.petazzoni, galak, olof, maxime.ripard
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 b8c5cd3..055b20c 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -491,6 +491,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] 13+ messages in thread
* [PATCH v2 2/9] arm: multi_v7_defconfig: Enable Mediatek platform
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 1/9] arm: dts: Build dtb for Mediatek board Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 3/9] arm: dts: mt6589: Fix typo in GIC unit address Matthias Brugger
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mark.rutland, heiko, anders.berg, linus.walleij, stefan,
lee.jones, linux, pawel.moll, srv_yingjoe.chen,
sebastian.hesselbarth, devicetree, jason, arnd, ijc+devicetree,
robh+dt, matthias.bgg, swarren, linux-arm-kernel,
thomas.petazzoni, galak, olof, maxime.ripard
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 5fb95fb..4c08101 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -42,6 +42,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] 13+ messages in thread
* [PATCH v2 3/9] arm: dts: mt6589: Fix typo in GIC unit address
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 1/9] arm: dts: Build dtb for Mediatek board Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 2/9] arm: multi_v7_defconfig: Enable Mediatek platform Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
[not found] ` <1408373917-10002-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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, lee.jones, heiko, srv_yingjoe.chen,
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] 13+ messages in thread
* [PATCH v2 4/9] arm: mediatek: Add earlyprintk support for mt6589
[not found] ` <1408373917-10002-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working Matthias Brugger
1 sibling, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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,
lee.jones-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
srv_yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Enable low-level debug for Mediatek mt6589 SoC on UART0.
Signed-off-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/arm/Kconfig.debug | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index b11ad54..cfdd1c0 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -834,6 +834,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
@@ -1075,6 +1083,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
@@ -1137,6 +1146,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
--
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 related [flat|nested] 13+ messages in thread
* [PATCH v2 5/9] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
` (3 preceding siblings ...)
[not found] ` <1408373917-10002-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 7/9] arm: dts: mt6589: Add arm arch timer node Matthias Brugger
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mark.rutland, heiko, anders.berg, linus.walleij, stefan,
lee.jones, linux, pawel.moll, srv_yingjoe.chen,
sebastian.hesselbarth, devicetree, jason, arnd, ijc+devicetree,
robh+dt, matthias.bgg, swarren, linux-arm-kernel,
thomas.petazzoni, galak, olof, maxime.ripard
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] 13+ messages in thread
* [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working
[not found] ` <1408373917-10002-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-18 14:58 ` [PATCH v2 4/9] arm: mediatek: Add earlyprintk support for mt6589 Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 15:45 ` Mark Rutland
1 sibling, 1 reply; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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,
lee.jones-QSEj5FYQhm4dnm+yROfE0A, heiko-4mtYJXux2i+zQB+pC5nmwQ,
srv_yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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>
---
arch/arm/mach-mediatek/mediatek.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c
index f2acf07..2989f18 100644
--- a/arch/arm/mach-mediatek/mediatek.c
+++ b/arch/arm/mach-mediatek/mediatek.c
@@ -16,6 +16,31 @@
*/
#include <linux/init.h>
#include <asm/mach/arch.h>
+#include <linux/of.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+
+#define TIMER_CTRL_OP_FREERUN 0x30
+#define TIMER_CTRL_ENABLE 0x01
+
+#define GPT6_CON_MT65xx 0x10008060
+
+static void __init mediatek_timer_init(void)
+{
+ static void __iomem *gpt_base;
+
+ if (of_machine_is_compatible("mediatek,mt6589")) {
+ /* 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(TIMER_CTRL_OP_FREERUN | TIMER_CTRL_ENABLE, gpt_base);
+
+ of_clk_init(NULL);
+ clocksource_of_init();
+};
static const char * const mediatek_board_dt_compat[] = {
"mediatek,mt6589",
@@ -24,4 +49,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
--
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 related [flat|nested] 13+ messages in thread
* [PATCH v2 7/9] arm: dts: mt6589: Add arm arch timer node
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
` (4 preceding siblings ...)
2014-08-18 14:58 ` [PATCH v2 5/9] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 8/9] arm: dts: mediatek: Add compatible property for aquaris5 Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 9/9] arm: dts: mt6589: Change compatible string for GIC Matthias Brugger
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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, lee.jones, heiko, srv_yingjoe.chen,
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 | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
index 742c9bd..fb922a6 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -73,14 +73,23 @@
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)>;
+ clock-frequency = <13000000>;
+ };
+
gic: interrupt-controller@10211000 {
compatible = "arm,cortex-a15-gic";
interrupt-controller;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 8/9] arm: dts: mediatek: Add compatible property for aquaris5
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
` (5 preceding siblings ...)
2014-08-18 14:58 ` [PATCH v2 7/9] arm: dts: mt6589: Add arm arch timer node Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 9/9] arm: dts: mt6589: Change compatible string for GIC Matthias Brugger
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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, lee.jones, heiko, srv_yingjoe.chen,
devicetree, linux-arm-kernel
Add the missing 'compatible' property to device tree root node of
- mt6589-aquaris5.dts
and document the new values.
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
Documentation/devicetree/bindings/arm/mediatek.txt | 6 ++++++
arch/arm/boot/dts/mt6589-aquaris5.dts | 1 +
2 files changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/mediatek.txt b/Documentation/devicetree/bindings/arm/mediatek.txt
index d6ac71f..fa25226 100644
--- a/Documentation/devicetree/bindings/arm/mediatek.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek.txt
@@ -6,3 +6,9 @@ Required root node property:
compatible: must contain "mediatek,mt6589"
+
+Supported boards:
+
+- bq Aquaris5 smart phone:
+ Required root node properties:
+ - compatible = "mundoreader,bq-aquaris5", "mediatek,mt6589";
diff --git a/arch/arm/boot/dts/mt6589-aquaris5.dts b/arch/arm/boot/dts/mt6589-aquaris5.dts
index 74cb1ba..0da0470 100644
--- a/arch/arm/boot/dts/mt6589-aquaris5.dts
+++ b/arch/arm/boot/dts/mt6589-aquaris5.dts
@@ -18,6 +18,7 @@
/ {
model = "bq Aquaris5";
+ compatible = "mundoreader,bq-aquaris5", "mediatek,mt6589";
chosen {
bootargs = "earlyprintk";
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 9/9] arm: dts: mt6589: Change compatible string for GIC
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
` (6 preceding siblings ...)
2014-08-18 14:58 ` [PATCH v2 8/9] arm: dts: mediatek: Add compatible property for aquaris5 Matthias Brugger
@ 2014-08-18 14:58 ` Matthias Brugger
7 siblings, 0 replies; 13+ messages in thread
From: Matthias Brugger @ 2014-08-18 14:58 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, lee.jones, heiko, srv_yingjoe.chen,
devicetree, linux-arm-kernel
This patch changes the compatible string of the GIC to the
new "arm,cortex-a7-gic" which does reflect the actual hardware.
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 fb922a6..2534ba5 100644
--- a/arch/arm/boot/dts/mt6589.dtsi
+++ b/arch/arm/boot/dts/mt6589.dtsi
@@ -91,7 +91,7 @@
};
gic: interrupt-controller@10211000 {
- compatible = "arm,cortex-a15-gic";
+ compatible = "arm,cortex-a7-gic";
interrupt-controller;
#interrupt-cells = <3>;
reg = <0x10211000 0x1000>,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working
2014-08-18 14:58 ` [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working Matthias Brugger
@ 2014-08-18 15:45 ` Mark Rutland
2014-08-21 10:38 ` Matthias Brugger
0 siblings, 1 reply; 13+ messages in thread
From: Mark Rutland @ 2014-08-18 15:45 UTC (permalink / raw)
To: Matthias Brugger
Cc: thomas.petazzoni@free-electrons.com, anders.berg@lsi.com,
linux@arm.linux.org.uk, arnd@arndb.de, Pawel Moll,
ijc+devicetree@hellion.org.uk, linus.walleij@linaro.org,
srv_yingjoe.chen@mediatek.com, heiko@sntech.de,
linux-kernel@vger.kernel.org, stefan@agner.ch,
devicetree@vger.kernel.org, robh+dt@kernel.org,
galak@codeaurora.org, olof@lixom.net, swarren@nvidia.com,
maxime.ripard@free-electrons.com, sebastian.hesselbart
Hi Matthias,
On Mon, Aug 18, 2014 at 03:58:34PM +0100, Matthias Brugger 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.
We don't seem to set CNTFRQ below. Does it happen to have a consistent
value on current versions of the bootloader?
> In the future this should be done in the bootloader.
Do we know how far in the future that's likely to be?
What's the plan for this code when such a bootloader becomes available?
Thanks,
Mark.
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> arch/arm/mach-mediatek/mediatek.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c
> index f2acf07..2989f18 100644
> --- a/arch/arm/mach-mediatek/mediatek.c
> +++ b/arch/arm/mach-mediatek/mediatek.c
> @@ -16,6 +16,31 @@
> */
> #include <linux/init.h>
> #include <asm/mach/arch.h>
> +#include <linux/of.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clocksource.h>
> +
> +#define TIMER_CTRL_OP_FREERUN 0x30
> +#define TIMER_CTRL_ENABLE 0x01
> +
> +#define GPT6_CON_MT65xx 0x10008060
> +
> +static void __init mediatek_timer_init(void)
> +{
> + static void __iomem *gpt_base;
> +
> + if (of_machine_is_compatible("mediatek,mt6589")) {
> + /* 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(TIMER_CTRL_OP_FREERUN | TIMER_CTRL_ENABLE, gpt_base);
> +
> + of_clk_init(NULL);
> + clocksource_of_init();
> +};
>
> static const char * const mediatek_board_dt_compat[] = {
> "mediatek,mt6589",
> @@ -24,4 +49,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 [flat|nested] 13+ messages in thread
* Re: [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working
2014-08-18 15:45 ` Mark Rutland
@ 2014-08-21 10:38 ` Matthias Brugger
[not found] ` <CABuKBe+oVzQ9_Q__sULLQt8OvJ1Za_uA5x2aXSSQ6r8myvFqnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Matthias Brugger @ 2014-08-21 10:38 UTC (permalink / raw)
To: Mark Rutland
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
stefan-XLVq0VzYD2Y@public.gmane.org,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
anders.berg-M7mHMAq9Yzo@public.gmane.org,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
heiko-4mtYJXux2i+zQB+pC5nmwQ
2014-08-18 17:45 GMT+02:00 Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>:
> Hi Matthias,
>
> On Mon, Aug 18, 2014 at 03:58:34PM +0100, Matthias Brugger 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.
>
> We don't seem to set CNTFRQ below. Does it happen to have a consistent
> value on current versions of the bootloader?
Oh sorry, my fault. In v2 I moved the frequency to the dts, as this
will make the driver write CNTFRQ.
I forgot to update the commit message.
>
>> In the future this should be done in the bootloader.
>
> Do we know how far in the future that's likely to be?
AFAIK no one right now is working on an open source bootloader for the
mediatek devices.
So I think we won't see an open source bootloader in a reasonable time.
>
> What's the plan for this code when such a bootloader becomes available?
I think when a bootloader becomes available, this code should be
removed. I know that this will lead to a not working ARM arch timer in
devices which don't migrate to the new bootloader, but I think it's
not too critical. Apart from the ARM arch timer, the devices have the
mediatek global porpose timer (drivers/clocksource/mtk_timer.c), which
implement a clock source and a clock event timer. So the system won't
hang.
Cheers,
Matthias
>
> Thanks,
> Mark.
>
>> Signed-off-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> arch/arm/mach-mediatek/mediatek.c | 26 ++++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c
>> index f2acf07..2989f18 100644
>> --- a/arch/arm/mach-mediatek/mediatek.c
>> +++ b/arch/arm/mach-mediatek/mediatek.c
>> @@ -16,6 +16,31 @@
>> */
>> #include <linux/init.h>
>> #include <asm/mach/arch.h>
>> +#include <linux/of.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/clocksource.h>
>> +
>> +#define TIMER_CTRL_OP_FREERUN 0x30
>> +#define TIMER_CTRL_ENABLE 0x01
>> +
>> +#define GPT6_CON_MT65xx 0x10008060
>> +
>> +static void __init mediatek_timer_init(void)
>> +{
>> + static void __iomem *gpt_base;
>> +
>> + if (of_machine_is_compatible("mediatek,mt6589")) {
>> + /* 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(TIMER_CTRL_OP_FREERUN | TIMER_CTRL_ENABLE, gpt_base);
>> +
>> + of_clk_init(NULL);
>> + clocksource_of_init();
>> +};
>>
>> static const char * const mediatek_board_dt_compat[] = {
>> "mediatek,mt6589",
>> @@ -24,4 +49,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
>>
>>
--
motzblog.wordpress.com
--
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] 13+ messages in thread
* Re: [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working
[not found] ` <CABuKBe+oVzQ9_Q__sULLQt8OvJ1Za_uA5x2aXSSQ6r8myvFqnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-08-21 10:56 ` Mark Rutland
0 siblings, 0 replies; 13+ messages in thread
From: Mark Rutland @ 2014-08-21 10:56 UTC (permalink / raw)
To: Matthias Brugger
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
stefan-XLVq0VzYD2Y@public.gmane.org,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
anders.berg-M7mHMAq9Yzo@public.gmane.org,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
heiko-4mtYJXux2i+zQB+pC5nmwQ
On Thu, Aug 21, 2014 at 11:38:20AM +0100, Matthias Brugger wrote:
> 2014-08-18 17:45 GMT+02:00 Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>:
> > Hi Matthias,
> >
> > On Mon, Aug 18, 2014 at 03:58:34PM +0100, Matthias Brugger 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.
> >
> > We don't seem to set CNTFRQ below. Does it happen to have a consistent
> > value on current versions of the bootloader?
>
> Oh sorry, my fault. In v2 I moved the frequency to the dts, as this
> will make the driver write CNTFRQ.
> I forgot to update the commit message.
The arch timer driver does not write CNTFRQ as this can only be done
from the secure side. It simply uses the value provided internally. This
isn't sufficient for virtualization guests (which need to have CNTFRQ
programmed correctly).
For the moment as we're not booting at Hyp that's not necessarily a big
problem, but it is a shame.
> >> In the future this should be done in the bootloader.
> >
> > Do we know how far in the future that's likely to be?
>
> AFAIK no one right now is working on an open source bootloader for the
> mediatek devices.
> So I think we won't see an open source bootloader in a reasonable time.
Ok. :(
> > What's the plan for this code when such a bootloader becomes available?
>
> I think when a bootloader becomes available, this code should be
> removed. I know that this will lead to a not working ARM arch timer in
> devices which don't migrate to the new bootloader, but I think it's
> not too critical. Apart from the ARM arch timer, the devices have the
> mediatek global porpose timer (drivers/clocksource/mtk_timer.c), which
> implement a clock source and a clock event timer. So the system won't
> hang.
I fear that's never going to happen, either because such a bootloader
never becomes available or because there will be hold-outs sticking to
the old loader.
If that's not critical, why not for the moment use the global timer?
Thanks,
Mark.
--
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] 13+ messages in thread
end of thread, other threads:[~2014-08-21 10:56 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 14:58 [PATCH v2 0/9] arm: mediatek: Add more basic features Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 1/9] arm: dts: Build dtb for Mediatek board Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 2/9] arm: multi_v7_defconfig: Enable Mediatek platform Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 3/9] arm: dts: mt6589: Fix typo in GIC unit address Matthias Brugger
[not found] ` <1408373917-10002-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-18 14:58 ` [PATCH v2 4/9] arm: mediatek: Add earlyprintk support for mt6589 Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 6/9] arm: mediatek: enable gpt6 on boot up to make arch timer working Matthias Brugger
2014-08-18 15:45 ` Mark Rutland
2014-08-21 10:38 ` Matthias Brugger
[not found] ` <CABuKBe+oVzQ9_Q__sULLQt8OvJ1Za_uA5x2aXSSQ6r8myvFqnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-21 10:56 ` Mark Rutland
2014-08-18 14:58 ` [PATCH v2 5/9] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 7/9] arm: dts: mt6589: Add arm arch timer node Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 8/9] arm: dts: mediatek: Add compatible property for aquaris5 Matthias Brugger
2014-08-18 14:58 ` [PATCH v2 9/9] arm: dts: mt6589: Change compatible string for GIC Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).