devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC
@ 2014-12-26  8:26 Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 1/4] Document: DT: Add bindings for mediatek MT8173 Soc Platform Eddie Huang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Eddie Huang @ 2014-12-26  8:26 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, Eddie Huang,
	peter.maydell, linux-arm-kernel, yh.chen

MT8173 is a SoC based on 64bit ARMv8 architecture. It contains 2 CA53 + 2 CA57 cores.
MT8173 share many HW IP with MT8135 and other MT65xx series. This patchset was tested
on MT8173 engineer sample, and boot to shell ok.

This series contains document bindings, device tree, defconfig, and one sysirq
modification for MT8173.

Changes in v3:

1. Modify mt8173.dtsi according Mark Rutland review comment, CPU ID, PSCI and GIC address.
2. Include interrupt dt-binding header files, replace interrupt number by enum value.
3. Rebase to 3.19-rc1, create arch/arm64/boot/dts/mediatek folder to put mt8173.dtsi.

This patch base on 3.19-rc1, Joe's sysirq patch [1] and test boot to shell with
Catalin Marinas's arch_timer virtual counter patch [2]

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310335.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/309856.html

Eddie Huang (3):
  Document: DT: Add bindings for mediatek MT8173 Soc Platform
  arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and
    Makefile
  arm64: mediatek: Add MT8173 SoC Kconfig and defconfig

Yingjoe Chen (1):
  irqchip: mtk-sysirq: Get irq number from register resource size

 Documentation/devicetree/bindings/arm/mediatek.txt |   4 +
 arch/arm64/Kconfig                                 |   6 +
 arch/arm64/boot/dts/Makefile                       |   1 +
 arch/arm64/boot/dts/mediatek/Makefile              |   5 +
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts        |  34 +++++
 arch/arm64/boot/dts/mediatek/mt8173.dtsi           | 159 +++++++++++++++++++++
 arch/arm64/configs/defconfig                       |   2 +
 drivers/irqchip/irq-mtk-sysirq.c                   |  18 ++-
 8 files changed, 222 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm64/boot/dts/mediatek/Makefile
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8173-evb.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8173.dtsi

--
1.8.1.1.dirty

************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

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

* [PATCH v3 1/4] Document: DT: Add bindings for mediatek MT8173 Soc Platform
  2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
@ 2014-12-26  8:26 ` Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 2/4] irqchip: mtk-sysirq: Get irq number from register resource size Eddie Huang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Eddie Huang @ 2014-12-26  8:26 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, Eddie Huang,
	peter.maydell, linux-arm-kernel, yh.chen

Add the devicetree binding document for mediatek MT8173 SoC.
This is a 64-bit four core Soc.
And mt8173-evb is a evaluation board based on mt8173.

Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
 Documentation/devicetree/bindings/arm/mediatek.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/mediatek.txt b/Documentation/devicetree/bindings/arm/mediatek.txt
index 3be4013..dd7550a 100644
--- a/Documentation/devicetree/bindings/arm/mediatek.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek.txt
@@ -9,6 +9,7 @@ compatible: Must contain one of
    "mediatek,mt6592"
    "mediatek,mt8127"
    "mediatek,mt8135"
+   "mediatek,mt8173"
 
 
 Supported boards:
@@ -25,3 +26,6 @@ Supported boards:
 - MTK mt8135 tablet EVB:
     Required root node properties:
       - compatible = "mediatek,mt8135-evbp1", "mediatek,mt8135";
+- MTK mt8173 tablet EVB:
+    Required root node properties:
+      - compatible = "mediatek,mt8173-evb", "mediatek,mt8173";
-- 
1.8.1.1

************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

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

* [PATCH v3 2/4] irqchip: mtk-sysirq: Get irq number from register resource size
  2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 1/4] Document: DT: Add bindings for mediatek MT8173 Soc Platform Eddie Huang
@ 2014-12-26  8:26 ` Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile Eddie Huang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Eddie Huang @ 2014-12-26  8:26 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, Eddie Huang,
	peter.maydell, linux-arm-kernel, yh.chen

From: Yingjoe Chen <yingjoe.chen@mediatek.com>

Originally mtk-sysirq hardcoded supported irq number to 224. This
was fine since all SoCs before support the same number of irqs for
intpol.

However MT8173 intpol support 32 more irq pins, changes to get
irq number from register resource size to suppor MT8173 properly.

Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
 drivers/irqchip/irq-mtk-sysirq.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/irqchip/irq-mtk-sysirq.c b/drivers/irqchip/irq-mtk-sysirq.c
index 0b0d2c0..fadd865 100644
--- a/drivers/irqchip/irq-mtk-sysirq.c
+++ b/drivers/irqchip/irq-mtk-sysirq.c
@@ -23,8 +23,6 @@
 
 #include "irqchip.h"
 
-#define MT6577_SYS_INTPOL_NUM	(224)
-
 struct mtk_sysirq_chip_data {
 	spinlock_t lock;
 	void __iomem *intpol_base;
@@ -124,7 +122,8 @@ static int __init mtk_sysirq_of_init(struct device_node *node,
 {
 	struct irq_domain *domain, *domain_parent;
 	struct mtk_sysirq_chip_data *chip_data;
-	int ret = 0;
+	struct resource res;
+	int ret, size, intpol_num;
 
 	domain_parent = irq_find_host(parent);
 	if (!domain_parent) {
@@ -132,19 +131,24 @@ static int __init mtk_sysirq_of_init(struct device_node *node,
 		return -EINVAL;
 	}
 
+	ret = of_address_to_resource(node, 0, &res);
+	if (ret)
+		return ret;
+
 	chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL);
 	if (!chip_data)
 		return -ENOMEM;
 
-	chip_data->intpol_base = of_io_request_and_map(node, 0, "intpol");
-	if (IS_ERR(chip_data->intpol_base)) {
+	size = resource_size(&res);
+	intpol_num = size * 8;
+	chip_data->intpol_base = ioremap(res.start, size);
+	if (!chip_data->intpol_base) {
 		pr_err("mtk_sysirq: unable to map sysirq register\n");
 		ret = PTR_ERR(chip_data->intpol_base);
 		goto out_free;
 	}
 
-	domain = irq_domain_add_hierarchy(domain_parent, 0,
-					  MT6577_SYS_INTPOL_NUM, node,
+	domain = irq_domain_add_hierarchy(domain_parent, 0, intpol_num, node,
 					  &sysirq_domain_ops, chip_data);
 	if (!domain) {
 		ret = -ENOMEM;
-- 
1.8.1.1

************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

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

* [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile
  2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 1/4] Document: DT: Add bindings for mediatek MT8173 Soc Platform Eddie Huang
  2014-12-26  8:26 ` [PATCH v3 2/4] irqchip: mtk-sysirq: Get irq number from register resource size Eddie Huang
@ 2014-12-26  8:26 ` Eddie Huang
  2015-01-11 20:12   ` Matthias Brugger
  2014-12-26  8:26 ` [PATCH v3 4/4] arm64: mediatek: Add MT8173 SoC Kconfig and defconfig Eddie Huang
  2014-12-29  1:51 ` [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
  4 siblings, 1 reply; 8+ messages in thread
From: Eddie Huang @ 2014-12-26  8:26 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, Eddie Huang,
	peter.maydell, linux-arm-kernel, yh.chen

Add device tree support for MT8173 SoC and evaluation board based on it.

Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
 arch/arm64/boot/dts/Makefile                |   1 +
 arch/arm64/boot/dts/mediatek/Makefile       |   5 +
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts |  34 ++++++
 arch/arm64/boot/dts/mediatek/mt8173.dtsi    | 159 ++++++++++++++++++++++++++++
 4 files changed, 199 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/Makefile
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8173-evb.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8173.dtsi

diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index 3b8d427..89124e4 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -2,6 +2,7 @@ dts-dirs += amd
 dts-dirs += apm
 dts-dirs += arm
 dts-dirs += cavium
+dts-dirs += mediatek
 
 always		:= $(dtb-y)
 subdir-y	:= $(dts-dirs)
diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
new file mode 100644
index 0000000..3ce2462
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
+
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
new file mode 100644
index 0000000..b8b2621
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014 MediaTek Inc.
+ * Author: Eddie Huang <eddie.huang@mediatek.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+#include "mt8173.dtsi"
+
+/ {
+	model = "mediatek,mt8173-evb";
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+	};
+
+	memory@40000000 {
+		device_type = "memory";
+		reg = <0 0x40000000 0 0x80000000>;
+	};
+
+	chosen { };
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
new file mode 100644
index 0000000..a4ea0b3
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2014 MediaTek Inc.
+ * Author: Eddie Huang <eddie.huang@mediatek.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	compatible = "mediatek,mt8173";
+	interrupt-parent = <&sysirq>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu-map {
+			cluster0 {
+				core0 {
+					cpu = <&cpu0>;
+				};
+				core1 {
+					cpu = <&cpu1>;
+				};
+			};
+
+			cluster1 {
+				core0 {
+					cpu = <&cpu2>;
+				};
+				core1 {
+					cpu = <&cpu3>;
+				};
+			};
+		};
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53";
+			reg = <0x000>;
+		};
+
+		cpu1: cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53";
+			reg = <0x001>;
+			enable-method = "psci";
+		};
+
+		cpu2: cpu@100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57";
+			reg = <0x100>;
+			enable-method = "psci";
+		};
+
+		cpu3: cpu@101 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a57";
+			reg = <0x101>;
+			enable-method = "psci";
+		};
+	};
+
+	psci {
+		compatible = "arm,psci";
+		method = "smc";
+		cpu_suspend   = <0x84000001>;
+		cpu_off	      = <0x84000002>;
+		cpu_on	      = <0x84000003>;
+	};
+
+	uart_clk: dummy26m {
+		compatible = "fixed-clock";
+		clock-frequency = <26000000>;
+		#clock-cells = <0>;
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupt-parent = <&gic>;
+		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)>;
+	};
+
+	soc {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		compatible = "simple-bus";
+		ranges;
+
+		sysirq: intpol-controller@10200620 {
+			compatible = "mediatek,mt8173-sysirq", "mediatek,mt6577-sysirq";
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			interrupt-parent = <&gic>;
+			reg = <0 0x10200620 0 0x20>;
+		};
+
+		gic: interrupt-controller@10220000 {
+			compatible = "arm,gic-400";
+			#interrupt-cells = <3>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			reg = <0 0x10221000 0 0x1000>,
+			      <0 0x10222000 0 0x2000>,
+			      <0 0x10224000 0 0x2000>,
+			      <0 0x10226000 0 0x2000>;
+			interrupts = <GIC_PPI 9
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+		};
+
+		uart0: serial@11002000 {
+			compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
+			reg = <0 0x11002000 0 0x400>;
+			interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+		};
+
+		uart1: serial@11003000 {
+			compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
+			reg = <0 0x11003000 0 0x400>;
+			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+		};
+
+		uart2: serial@11004000 {
+			compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
+			reg = <0 0x11004000 0 0x400>;
+			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+		};
+
+		uart3: serial@11005000 {
+			compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
+			reg = <0 0x11005000 0 0x400>;
+			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+		};
+	};
+
+};
+
-- 
1.8.1.1

************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

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

* [PATCH v3 4/4] arm64: mediatek: Add MT8173 SoC Kconfig and defconfig
  2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
                   ` (2 preceding siblings ...)
  2014-12-26  8:26 ` [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile Eddie Huang
@ 2014-12-26  8:26 ` Eddie Huang
  2014-12-29  1:51 ` [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
  4 siblings, 0 replies; 8+ messages in thread
From: Eddie Huang @ 2014-12-26  8:26 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, Eddie Huang,
	peter.maydell, linux-arm-kernel, yh.chen

Add MT8173 arm64 Kconfig and defconfig files

Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
 arch/arm64/Kconfig           | 6 ++++++
 arch/arm64/configs/defconfig | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index b1f9a20..e627ead 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -148,6 +148,12 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
+config ARCH_MEDIATEK
+	bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
+	select ARM_GIC
+	help
+	  Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
+
 config ARCH_SEATTLE
 	bool "AMD Seattle SoC Family"
 	help
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index dd301be..ed84d21 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -32,6 +32,7 @@ CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_THUNDER=y
 CONFIG_ARCH_VEXPRESS=y
 CONFIG_ARCH_XGENE=y
@@ -87,6 +88,7 @@ CONFIG_SERIO_AMBAKMI=y
 CONFIG_LEGACY_PTY_COUNT=16
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_MT6577=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
-- 
1.8.1.1

************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

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

* Re: [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC
  2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
                   ` (3 preceding siblings ...)
  2014-12-26  8:26 ` [PATCH v3 4/4] arm64: mediatek: Add MT8173 SoC Kconfig and defconfig Eddie Huang
@ 2014-12-29  1:51 ` Eddie Huang
  4 siblings, 0 replies; 8+ messages in thread
From: Eddie Huang @ 2014-12-29  1:51 UTC (permalink / raw)
  To: Matthias Brugger, Rob Herring, Jason Cooper
  Cc: Mark Rutland, devicetree, srv_heupstream, Pawel Moll,
	Ian Campbell, marc.zyngier, Catalin Marinas, Mark Brown,
	Will Deacon, linux-kernel, Robert Richter, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, peter.maydell,
	linux-arm-kernel, yh.chen

Hi,

Sorry for my IT setting issue that accidentally add mediatek
confidential notice in the tail of this mail series.
Please skip it, and if anyone have concern, I can resend it.

> 
>  Documentation/devicetree/bindings/arm/mediatek.txt |   4 +
>  arch/arm64/Kconfig                                 |   6 +
>  arch/arm64/boot/dts/Makefile                       |   1 +
>  arch/arm64/boot/dts/mediatek/Makefile              |   5 +
>  arch/arm64/boot/dts/mediatek/mt8173-evb.dts        |  34 +++++
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi           | 159 +++++++++++++++++++++
>  arch/arm64/configs/defconfig                       |   2 +
>  drivers/irqchip/irq-mtk-sysirq.c                   |  18 ++-
>  8 files changed, 222 insertions(+), 7 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/mediatek/Makefile
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173-evb.dts
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173.dtsi
> 
> --
> 1.8.1.1.dirty
> 
> ************* Email Confidentiality Notice ********************
> The information contained in this e-mail message (including any 
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be 
> conveyed only to the designated recipient(s). Any use, dissemination, 
> distribution, printing, retaining or copying of this e-mail (including its 
> attachments) by unintended recipient(s) is strictly prohibited and may 
> be unlawful. If you are not an intended recipient of this e-mail, or believe 
> that you have received this e-mail in error, please notify the sender 
> immediately (by replying to this e-mail), delete any and all copies of 
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile
  2014-12-26  8:26 ` [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile Eddie Huang
@ 2015-01-11 20:12   ` Matthias Brugger
  2015-01-12  5:39     ` Eddie Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Matthias Brugger @ 2015-01-11 20:12 UTC (permalink / raw)
  To: Eddie Huang
  Cc: Rob Herring, Jason Cooper, srv_heupstream, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala, Catalin Marinas,
	Will Deacon, Thomas Gleixner, Olof Johansson, Joe.C,
	Robert Richter, Mark Brown, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Sascha Hauer, Marc Zyngier,
	peter.maydell

2014-12-26 9:26 GMT+01:00 Eddie Huang <eddie.huang@mediatek.com>:
> Add device tree support for MT8173 SoC and evaluation board based on it.
>
> Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
> ---
>  arch/arm64/boot/dts/Makefile                |   1 +
>  arch/arm64/boot/dts/mediatek/Makefile       |   5 +
>  arch/arm64/boot/dts/mediatek/mt8173-evb.dts |  34 ++++++
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi    | 159 ++++++++++++++++++++++++++++
>  4 files changed, 199 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/mediatek/Makefile
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173-evb.dts
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173.dtsi
>
> diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
> index 3b8d427..89124e4 100644
> --- a/arch/arm64/boot/dts/Makefile
> +++ b/arch/arm64/boot/dts/Makefile
> @@ -2,6 +2,7 @@ dts-dirs += amd
>  dts-dirs += apm
>  dts-dirs += arm
>  dts-dirs += cavium
> +dts-dirs += mediatek
>
>  always         := $(dtb-y)
>  subdir-y       := $(dts-dirs)
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> new file mode 100644
> index 0000000..3ce2462
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -0,0 +1,5 @@
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
> +
> +always         := $(dtb-y)
> +subdir-y       := $(dts-dirs)
> +clean-files    := *.dtb
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
> new file mode 100644
> index 0000000..b8b2621
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (c) 2014 MediaTek Inc.
> + * Author: Eddie Huang <eddie.huang@mediatek.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +/dts-v1/;
> +#include "mt8173.dtsi"
> +
> +/ {
> +       model = "mediatek,mt8173-evb";
> +
> +       aliases {
> +               serial0 = &uart0;
> +               serial1 = &uart1;
> +               serial2 = &uart2;
> +               serial3 = &uart3;
> +       };
> +
> +       memory@40000000 {
> +               device_type = "memory";
> +               reg = <0 0x40000000 0 0x80000000>;
> +       };
> +
> +       chosen { };
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> new file mode 100644
> index 0000000..a4ea0b3
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> @@ -0,0 +1,159 @@
> +/*
> + * Copyright (c) 2014 MediaTek Inc.
> + * Author: Eddie Huang <eddie.huang@mediatek.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +/ {
> +       compatible = "mediatek,mt8173";
> +       interrupt-parent = <&sysirq>;
> +       #address-cells = <2>;
> +       #size-cells = <2>;
> +
> +       cpus {
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +
> +               cpu-map {
> +                       cluster0 {
> +                               core0 {
> +                                       cpu = <&cpu0>;
> +                               };
> +                               core1 {
> +                                       cpu = <&cpu1>;
> +                               };
> +                       };
> +
> +                       cluster1 {
> +                               core0 {
> +                                       cpu = <&cpu2>;
> +                               };
> +                               core1 {
> +                                       cpu = <&cpu3>;
> +                               };
> +                       };
> +               };
> +
> +               cpu0: cpu@0 {
> +                       device_type = "cpu";
> +                       compatible = "arm,cortex-a53";
> +                       reg = <0x000>;
> +               };
> +
> +               cpu1: cpu@1 {
> +                       device_type = "cpu";
> +                       compatible = "arm,cortex-a53";
> +                       reg = <0x001>;
> +                       enable-method = "psci";
> +               };
> +
> +               cpu2: cpu@100 {
> +                       device_type = "cpu";
> +                       compatible = "arm,cortex-a57";
> +                       reg = <0x100>;
> +                       enable-method = "psci";
> +               };
> +
> +               cpu3: cpu@101 {
> +                       device_type = "cpu";
> +                       compatible = "arm,cortex-a57";
> +                       reg = <0x101>;
> +                       enable-method = "psci";
> +               };
> +       };
> +
> +       psci {
> +               compatible = "arm,psci";
> +               method = "smc";
> +               cpu_suspend   = <0x84000001>;
> +               cpu_off       = <0x84000002>;
> +               cpu_on        = <0x84000003>;
> +       };
> +
> +       uart_clk: dummy26m {
> +               compatible = "fixed-clock";
> +               clock-frequency = <26000000>;
> +               #clock-cells = <0>;
> +       };
> +
> +       timer {
> +               compatible = "arm,armv8-timer";
> +               interrupt-parent = <&gic>;
> +               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)>;
> +       };
> +
> +       soc {
> +               #address-cells = <2>;
> +               #size-cells = <2>;
> +               compatible = "simple-bus";
> +               ranges;
> +
> +               sysirq: intpol-controller@10200620 {
> +                       compatible = "mediatek,mt8173-sysirq", "mediatek,mt6577-sysirq";

Please update the dts bindings for sysirq and add mediatek,mt8173-sysirq.
Also check that the lines in this patch does not exceed the 80 character limit.

> +                       interrupt-controller;
> +                       #interrupt-cells = <3>;
> +                       interrupt-parent = <&gic>;
> +                       reg = <0 0x10200620 0 0x20>;
> +               };
> +
> +               gic: interrupt-controller@10220000 {
> +                       compatible = "arm,gic-400";
> +                       #interrupt-cells = <3>;
> +                       interrupt-parent = <&gic>;
> +                       interrupt-controller;
> +                       reg = <0 0x10221000 0 0x1000>,
> +                             <0 0x10222000 0 0x2000>,
> +                             <0 0x10224000 0 0x2000>,
> +                             <0 0x10226000 0 0x2000>;
> +                       interrupts = <GIC_PPI 9
> +                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
> +               };
> +
> +               uart0: serial@11002000 {
> +                       compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";

Please update the dts binding documentation.

> +                       reg = <0 0x11002000 0 0x400>;
> +                       interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
> +                       clocks = <&uart_clk>;
> +               };

Please disable the uart ports in the dtsi and enable the one used by
the board in the dts.
See [0] and [1] on how to do this.

Apart from that, the series looks fine to me.

Thanks,
Matthias

[0] https://github.com/mbgg/linux-mediatek/commit/0714947369cdb2b9b8cc24aa07264d4b61ea4fd9
[1] https://github.com/mbgg/linux-mediatek/commit/ac00aa4dcd085e4cf01761095ec1e2a141f86f38


> +
> +               uart1: serial@11003000 {
> +                       compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
> +                       reg = <0 0x11003000 0 0x400>;
> +                       interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
> +                       clocks = <&uart_clk>;
> +               };
> +
> +               uart2: serial@11004000 {
> +                       compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
> +                       reg = <0 0x11004000 0 0x400>;
> +                       interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
> +                       clocks = <&uart_clk>;
> +               };
> +
> +               uart3: serial@11005000 {
> +                       compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
> +                       reg = <0 0x11005000 0 0x400>;
> +                       interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
> +                       clocks = <&uart_clk>;
> +               };
> +       };
> +
> +};
> +
> --
> 1.8.1.1
>
> ************* Email Confidentiality Notice ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!



-- 
motzblog.wordpress.com

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

* Re: [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile
  2015-01-11 20:12   ` Matthias Brugger
@ 2015-01-12  5:39     ` Eddie Huang
  0 siblings, 0 replies; 8+ messages in thread
From: Eddie Huang @ 2015-01-12  5:39 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Mark Rutland, devicetree@vger.kernel.org, Jason Cooper,
	Pawel Moll, Ian Campbell, Marc Zyngier, Catalin Marinas,
	Mark Brown, Will Deacon, linux-kernel@vger.kernel.org,
	Robert Richter, srv_heupstream, Rob Herring, Sascha Hauer,
	Kumar Gala, Olof Johansson, Joe.C, Thomas Gleixner, peter.maydell,
	linux-arm-kernel@lists.infradead.org

Hi Matthias,

Thanks your review, I will modify in next version.


On Sun, 2015-01-11 at 21:12 +0100, Matthias Brugger wrote:
> 2014-12-26 9:26 GMT+01:00 Eddie Huang <eddie.huang@mediatek.com>:
> > Add device tree support for MT8173 SoC and evaluation board based on it.
> >
> > Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
> > ---
> >  arch/arm64/boot/dts/Makefile                |   1 +
> >  arch/arm64/boot/dts/mediatek/Makefile       |   5 +
> >  arch/arm64/boot/dts/mediatek/mt8173-evb.dts |  34 ++++++
> >  arch/arm64/boot/dts/mediatek/mt8173.dtsi    | 159 ++++++++++++++++++++++++++++
> >  4 files changed, 199 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/mediatek/Makefile
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173-evb.dts
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8173.dtsi
> >
> > +
> > +       soc {
> > +               #address-cells = <2>;
> > +               #size-cells = <2>;
> > +               compatible = "simple-bus";
> > +               ranges;
> > +
> > +               sysirq: intpol-controller@10200620 {
> > +                       compatible = "mediatek,mt8173-sysirq", "mediatek,mt6577-sysirq";
> 
> Please update the dts bindings for sysirq and add mediatek,mt8173-sysirq.
> Also check that the lines in this patch does not exceed the 80 character limit.
> 
> > +
> > +               uart0: serial@11002000 {
> > +                       compatible = "mediatek,mt8173-uart","mediatek,mt6577-uart";
> 
> Please update the dts binding documentation.
> 
> > +                       reg = <0 0x11002000 0 0x400>;
> > +                       interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
> > +                       clocks = <&uart_clk>;
> > +               };
> 
> Please disable the uart ports in the dtsi and enable the one used by
> the board in the dts.
> See [0] and [1] on how to do this.
> 
> Apart from that, the series looks fine to me.
> 
> Thanks,
> Matthias
> 
> [0] https://github.com/mbgg/linux-mediatek/commit/0714947369cdb2b9b8cc24aa07264d4b61ea4fd9
> [1] https://github.com/mbgg/linux-mediatek/commit/ac00aa4dcd085e4cf01761095ec1e2a141f86f38
> 

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

end of thread, other threads:[~2015-01-12  5:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-26  8:26 [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang
2014-12-26  8:26 ` [PATCH v3 1/4] Document: DT: Add bindings for mediatek MT8173 Soc Platform Eddie Huang
2014-12-26  8:26 ` [PATCH v3 2/4] irqchip: mtk-sysirq: Get irq number from register resource size Eddie Huang
2014-12-26  8:26 ` [PATCH v3 3/4] arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile Eddie Huang
2015-01-11 20:12   ` Matthias Brugger
2015-01-12  5:39     ` Eddie Huang
2014-12-26  8:26 ` [PATCH v3 4/4] arm64: mediatek: Add MT8173 SoC Kconfig and defconfig Eddie Huang
2014-12-29  1:51 ` [PATCH v3 0/4] Add basic support for Mediatek MT8173 SoC Eddie Huang

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).