Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1515052 > unrolled thread
| Started by | Erin Lo <erin.lo@mediatek.com> |
|---|---|
| First post | 2016-11-04 08:50 +0100 |
| Last post | 2016-11-09 01:10 +0100 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v15 0/4] Add clock support for Mediatek MT2701 Erin Lo <erin.lo@mediatek.com> - 2016-11-04 08:50 +0100
[PATCH v15 2/4] reset: mediatek: Add MT2701 reset driver Erin Lo <erin.lo@mediatek.com> - 2016-11-04 08:50 +0100
Re: [PATCH v15 2/4] reset: mediatek: Add MT2701 reset driver Stephen Boyd <sboyd@codeaurora.org> - 2016-11-09 01:10 +0100
[PATCH v15 4/4] arm: dts: mt2701: Use real clock for UARTs Erin Lo <erin.lo@mediatek.com> - 2016-11-04 08:50 +0100
Re: [PATCH v15 4/4] arm: dts: mt2701: Use real clock for UARTs Matthias Brugger <matthias.bgg@gmail.com> - 2016-11-09 18:30 +0100
[PATCH v15 3/4] arm: dts: mt2701: Add clock controller device nodes Erin Lo <erin.lo@mediatek.com> - 2016-11-04 08:50 +0100
Re: [PATCH v15 1/4] clk: mediatek: Add MT2701 clock support Stephen Boyd <sboyd@codeaurora.org> - 2016-11-09 01:10 +0100
| From | Erin Lo <erin.lo@mediatek.com> |
|---|---|
| Date | 2016-11-04 08:50 +0100 |
| Subject | [PATCH v15 0/4] Add clock support for Mediatek MT2701 |
| Message-ID | <szHq9-79q-7@gated-at.bofh.it> |
This series is based on v4.9-rc1, add clock and reset controller support for Mediatek MT2701. changes since v14: - Correct commit messages of dts. - Refine style of init/probe functions. - Get reg addresses from platform_get_resouce() and devm_ioremap_resource(). - Minor coding style changes. changes since v13: - Rebase to v4.9-rc1. changes since v12: - Rebase to clk-next. - Use CLK_OF_DECLARE_DRIVER() instead of CLK_OF_DECLARE(). - Use dev_* and devm_* APIs instead of pr_* and ioremap(). - Refine init functions. Share error messages in common probe(). - Fix null pointer checking for clk_data. changes since v11: - Rebase to clk-next. - Return error code from probe() if clock registration fail. changes since v10: - Remove COMMON_CLK dependency from clk/mediatek/Kconfig. changes since v9: - Rebase to v4.8-rc1. - Drop a fix patch of parent clock initial state. It will be replaced by a new patch from Mike/Stephen. - Replace clk.h with clk-provider.h. - Correct register settings of clocks. changes since v8: - Rebase to v4.7-rc1. - Include mt2701-resets.h in mt2701.dtsi. - Remove an unused property from apmixedsys DT node. changes since v7: - Rebase to clk-next. - Implement subsystem clocks in seperated files. - Replace critical clock enabling with CLK_IS_CRITICAL flag. - Reduce most clock registrations in CLK_OF_DECLARE(). - Remove __init and __initconst from most init fucntions and data, and replace driver registration with platform_driver_register(). - Replace some common function or variable names with unique names. - Use real clock for UARTs. changes since v6: - Rebase to v4.6-rc1. - Register subsystem clocks in probe() instead of CLK_OF_DECLARE(). - Add clocks that referred by subsystem clocks. - Fix clk_data size of apmixedsys. - Add config options for each subsystem clock provider. changes since v5: - Rebase to v4.5-rc1 and [1]. - Enable critical clocks for MT2701 - Refine dt-binding documents, add reset controller support for hifsys. changes since v4: - Rebase to v4.5-rc1. - Remove CLK_SET_RATE_PARENT from divider flags. - Add img_jpgdec_smi clock. - Move clk/mediatek/Kconfig into menu section in clk/Kconfig. changes since v3: - Change the parent of mm_mdp_bls_26m from clk26m to pwm_sel. changes since v2: - Fix ethsys definition. - Replace read-modify-write with regmap_update_bits() in clock operations. - Move mt2701-resets.h to include/dt-bindings/reset/. - Add hifsys reset patch from John Crispin. changes since v1: - Document MT2701 compatible strings. [1] https://patchwork.kernel.org/patch/8147901/ Erin Lo (1): arm: dts: mt2701: Use real clock for UARTs James Liao (1): arm: dts: mt2701: Add clock controller device nodes Shunli Wang (2): clk: mediatek: Add MT2701 clock support reset: mediatek: Add MT2701 reset driver arch/arm/boot/dts/mt2701.dtsi | 50 +- drivers/clk/mediatek/Kconfig | 43 ++ drivers/clk/mediatek/Makefile | 7 + drivers/clk/mediatek/clk-gate.c | 52 ++ drivers/clk/mediatek/clk-gate.h | 2 + drivers/clk/mediatek/clk-mt2701-bdp.c | 138 +++++ drivers/clk/mediatek/clk-mt2701-eth.c | 80 +++ drivers/clk/mediatek/clk-mt2701-hif.c | 81 +++ drivers/clk/mediatek/clk-mt2701-img.c | 80 +++ drivers/clk/mediatek/clk-mt2701-mm.c | 123 ++++ drivers/clk/mediatek/clk-mt2701-vdec.c | 91 +++ drivers/clk/mediatek/clk-mt2701.c | 1035 ++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mtk.c | 40 ++ drivers/clk/mediatek/clk-mtk.h | 41 +- drivers/clk/mediatek/clk-pll.c | 1 + 15 files changed, 1854 insertions(+), 10 deletions(-) create mode 100644 drivers/clk/mediatek/clk-mt2701-bdp.c create mode 100644 drivers/clk/mediatek/clk-mt2701-eth.c create mode 100644 drivers/clk/mediatek/clk-mt2701-hif.c create mode 100644 drivers/clk/mediatek/clk-mt2701-img.c create mode 100644 drivers/clk/mediatek/clk-mt2701-mm.c create mode 100644 drivers/clk/mediatek/clk-mt2701-vdec.c create mode 100644 drivers/clk/mediatek/clk-mt2701.c -- 1.9.1
[toc] | [next] | [standalone]
| From | Erin Lo <erin.lo@mediatek.com> |
|---|---|
| Date | 2016-11-04 08:50 +0100 |
| Subject | [PATCH v15 2/4] reset: mediatek: Add MT2701 reset driver |
| Message-ID | <szHq9-79q-5@gated-at.bofh.it> |
| In reply to | #1515052 |
From: Shunli Wang <shunli.wang@mediatek.com>
In infrasys and perifsys, there are many reset
control bits for kinds of modules. These bits are
used as actual reset controllers to be registered
into kernel's generic reset controller framework.
Signed-off-by: Shunli Wang <shunli.wang@mediatek.com>
Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Signed-off-by: Erin Lo <erin.lo@mediatek.com>
Tested-by: John Crispin <blogic@openwrt.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/clk/mediatek/clk-mt2701-hif.c | 8 ++++++--
drivers/clk/mediatek/clk-mt2701.c | 12 ++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/mediatek/clk-mt2701-hif.c b/drivers/clk/mediatek/clk-mt2701-hif.c
index 452581c..18f3723 100644
--- a/drivers/clk/mediatek/clk-mt2701-hif.c
+++ b/drivers/clk/mediatek/clk-mt2701-hif.c
@@ -58,12 +58,16 @@ static int clk_mt2701_hif_probe(struct platform_device *pdev)
clk_data);
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
- if (r)
+ if (r) {
dev_err(&pdev->dev,
"could not register clock provider: %s: %d\n",
pdev->name, r);
+ return r;
+ }
+
+ mtk_register_reset_controller(node, 1, 0x34);
- return r;
+ return 0;
}
static struct platform_driver clk_mt2701_hif_drv = {
diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c
index 6d2f82f..6f26e6a 100644
--- a/drivers/clk/mediatek/clk-mt2701.c
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -787,8 +787,12 @@ static int mtk_infrasys_init(struct platform_device *pdev)
infra_clk_data);
r = of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data);
+ if (r)
+ return r;
- return r;
+ mtk_register_reset_controller(node, 2, 0x30);
+
+ return 0;
}
static const struct mtk_gate_regs peri0_cg_regs = {
@@ -906,8 +910,12 @@ static int mtk_pericfg_init(struct platform_device *pdev)
&mt2701_clk_lock, clk_data);
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+ if (r)
+ return r;
- return r;
+ mtk_register_reset_controller(node, 2, 0x0);
+
+ return 0;
}
#define MT8590_PLL_FMAX (2000 * MHZ)
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Date | 2016-11-09 01:10 +0100 |
| Subject | Re: [PATCH v15 2/4] reset: mediatek: Add MT2701 reset driver |
| Message-ID | <sBoCJ-8eR-9@gated-at.bofh.it> |
| In reply to | #1515053 |
On 11/04, Erin Lo wrote: > From: Shunli Wang <shunli.wang@mediatek.com> > > In infrasys and perifsys, there are many reset > control bits for kinds of modules. These bits are > used as actual reset controllers to be registered > into kernel's generic reset controller framework. > > Signed-off-by: Shunli Wang <shunli.wang@mediatek.com> > Signed-off-by: James Liao <jamesjj.liao@mediatek.com> > Signed-off-by: Erin Lo <erin.lo@mediatek.com> > Tested-by: John Crispin <blogic@openwrt.org> > Acked-by: Philipp Zabel <p.zabel@pengutronix.de> > --- Applied to clk-next -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[toc] | [prev] | [next] | [standalone]
| From | Erin Lo <erin.lo@mediatek.com> |
|---|---|
| Date | 2016-11-04 08:50 +0100 |
| Subject | [PATCH v15 4/4] arm: dts: mt2701: Use real clock for UARTs |
| Message-ID | <szHq9-79q-13@gated-at.bofh.it> |
| In reply to | #1515052 |
We used to use a fixed rate clock for the UARTs. Now that we have clock
support we can associate the correct clocks to the UARTs and drop the
26MHz fixed rate UART clock.
Signed-off-by: Erin Lo <erin.lo@mediatek.com>
---
arch/arm/boot/dts/mt2701.dtsi | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index c9a8dbf..7eab6f4 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -73,12 +73,6 @@
#clock-cells = <0>;
};
- uart_clk: dummy26m {
- compatible = "fixed-clock";
- clock-frequency = <26000000>;
- #clock-cells = <0>;
- };
-
clk26m: oscillator@0 {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -186,7 +180,8 @@
"mediatek,mt6577-uart";
reg = <0 0x11002000 0 0x400>;
interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
- clocks = <&uart_clk>;
+ clocks = <&pericfg CLK_PERI_UART0_SEL>, <&pericfg CLK_PERI_UART0>;
+ clock-names = "baud", "bus";
status = "disabled";
};
@@ -195,7 +190,8 @@
"mediatek,mt6577-uart";
reg = <0 0x11003000 0 0x400>;
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
- clocks = <&uart_clk>;
+ clocks = <&pericfg CLK_PERI_UART1_SEL>, <&pericfg CLK_PERI_UART1>;
+ clock-names = "baud", "bus";
status = "disabled";
};
@@ -204,7 +200,8 @@
"mediatek,mt6577-uart";
reg = <0 0x11004000 0 0x400>;
interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_LOW>;
- clocks = <&uart_clk>;
+ clocks = <&pericfg CLK_PERI_UART2_SEL>, <&pericfg CLK_PERI_UART2>;
+ clock-names = "baud", "bus";
status = "disabled";
};
@@ -213,7 +210,8 @@
"mediatek,mt6577-uart";
reg = <0 0x11005000 0 0x400>;
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_LOW>;
- clocks = <&uart_clk>;
+ clocks = <&pericfg CLK_PERI_UART3_SEL>, <&pericfg CLK_PERI_UART3>;
+ clock-names = "baud", "bus";
status = "disabled";
};
};
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Matthias Brugger <matthias.bgg@gmail.com> |
|---|---|
| Date | 2016-11-09 18:30 +0100 |
| Subject | Re: [PATCH v15 4/4] arm: dts: mt2701: Use real clock for UARTs |
| Message-ID | <sBERc-1R9-27@gated-at.bofh.it> |
| In reply to | #1515054 |
On 11/04/2016 08:43 AM, Erin Lo wrote:
> We used to use a fixed rate clock for the UARTs. Now that we have clock
> support we can associate the correct clocks to the UARTs and drop the
> 26MHz fixed rate UART clock.
>
> Signed-off-by: Erin Lo <erin.lo@mediatek.com>
Applied, thanks.
> ---
> arch/arm/boot/dts/mt2701.dtsi | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
> index c9a8dbf..7eab6f4 100644
> --- a/arch/arm/boot/dts/mt2701.dtsi
> +++ b/arch/arm/boot/dts/mt2701.dtsi
> @@ -73,12 +73,6 @@
> #clock-cells = <0>;
> };
>
> - uart_clk: dummy26m {
> - compatible = "fixed-clock";
> - clock-frequency = <26000000>;
> - #clock-cells = <0>;
> - };
> -
> clk26m: oscillator@0 {
> compatible = "fixed-clock";
> #clock-cells = <0>;
> @@ -186,7 +180,8 @@
> "mediatek,mt6577-uart";
> reg = <0 0x11002000 0 0x400>;
> interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
> - clocks = <&uart_clk>;
> + clocks = <&pericfg CLK_PERI_UART0_SEL>, <&pericfg CLK_PERI_UART0>;
> + clock-names = "baud", "bus";
> status = "disabled";
> };
>
> @@ -195,7 +190,8 @@
> "mediatek,mt6577-uart";
> reg = <0 0x11003000 0 0x400>;
> interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
> - clocks = <&uart_clk>;
> + clocks = <&pericfg CLK_PERI_UART1_SEL>, <&pericfg CLK_PERI_UART1>;
> + clock-names = "baud", "bus";
> status = "disabled";
> };
>
> @@ -204,7 +200,8 @@
> "mediatek,mt6577-uart";
> reg = <0 0x11004000 0 0x400>;
> interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_LOW>;
> - clocks = <&uart_clk>;
> + clocks = <&pericfg CLK_PERI_UART2_SEL>, <&pericfg CLK_PERI_UART2>;
> + clock-names = "baud", "bus";
> status = "disabled";
> };
>
> @@ -213,7 +210,8 @@
> "mediatek,mt6577-uart";
> reg = <0 0x11005000 0 0x400>;
> interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_LOW>;
> - clocks = <&uart_clk>;
> + clocks = <&pericfg CLK_PERI_UART3_SEL>, <&pericfg CLK_PERI_UART3>;
> + clock-names = "baud", "bus";
> status = "disabled";
> };
> };
>
[toc] | [prev] | [next] | [standalone]
| From | Erin Lo <erin.lo@mediatek.com> |
|---|---|
| Date | 2016-11-04 08:50 +0100 |
| Subject | [PATCH v15 3/4] arm: dts: mt2701: Add clock controller device nodes |
| Message-ID | <szHq9-79q-15@gated-at.bofh.it> |
| In reply to | #1515052 |
From: James Liao <jamesjj.liao@mediatek.com>
Add clock controller nodes for MT2701, include topckgen, infracfg,
pericfg and apmixedsys. This patch also add two oscillators that
provide clocks for MT2701.
Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Signed-off-by: Erin Lo <erin.lo@mediatek.com>
---
arch/arm/boot/dts/mt2701.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index 18596a2..c9a8dbf 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -12,8 +12,10 @@
* GNU General Public License for more details.
*/
+#include <dt-bindings/clock/mt2701-clk.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/mt2701-resets.h>
#include "skeleton64.dtsi"
#include "mt2701-pinfunc.h"
@@ -77,6 +79,20 @@
#clock-cells = <0>;
};
+ clk26m: oscillator@0 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <26000000>;
+ clock-output-names = "clk26m";
+ };
+
+ rtc32k: oscillator@1 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32000>;
+ clock-output-names = "rtc32k";
+ };
+
timer {
compatible = "arm,armv7-timer";
interrupt-parent = <&gic>;
@@ -104,6 +120,26 @@
reg = <0 0x10005000 0 0x1000>;
};
+ topckgen: syscon@10000000 {
+ compatible = "mediatek,mt2701-topckgen", "syscon";
+ reg = <0 0x10000000 0 0x1000>;
+ #clock-cells = <1>;
+ };
+
+ infracfg: syscon@10001000 {
+ compatible = "mediatek,mt2701-infracfg", "syscon";
+ reg = <0 0x10001000 0 0x1000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
+ pericfg: syscon@10003000 {
+ compatible = "mediatek,mt2701-pericfg", "syscon";
+ reg = <0 0x10003000 0 0x1000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
watchdog: watchdog@10007000 {
compatible = "mediatek,mt2701-wdt",
"mediatek,mt6589-wdt";
@@ -128,6 +164,12 @@
reg = <0 0x10200100 0 0x1c>;
};
+ apmixedsys: syscon@10209000 {
+ compatible = "mediatek,mt2701-apmixedsys", "syscon";
+ reg = <0 0x10209000 0 0x1000>;
+ #clock-cells = <1>;
+ };
+
gic: interrupt-controller@10211000 {
compatible = "arm,cortex-a7-gic";
interrupt-controller;
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Date | 2016-11-09 01:10 +0100 |
| Subject | Re: [PATCH v15 1/4] clk: mediatek: Add MT2701 clock support |
| Message-ID | <sBoCJ-8eR-3@gated-at.bofh.it> |
| In reply to | #1515052 |
On 11/04, Erin Lo wrote: > From: Shunli Wang <shunli.wang@mediatek.com> > > Add MT2701 clock support, include topckgen, apmixedsys, > infracfg, pericfg and subsystem clocks. > > Signed-off-by: Shunli Wang <shunli.wang@mediatek.com> > Signed-off-by: James Liao <jamesjj.liao@mediatek.com> > Signed-off-by: Erin Lo <erin.lo@mediatek.com> > Tested-by: John Crispin <blogic@openwrt.org> > --- Applied to clk-next -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web