* [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
@ 2015-10-18 4:05 Stefan Agner
2015-10-18 4:05 ` [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2 Stefan Agner
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Stefan Agner @ 2015-10-18 4:05 UTC (permalink / raw)
To: shawnguo, kernel, mturquette, sboyd
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel, Stefan Agner
The Synchronous Audio Interface (SAI) instances are clocked by
independent clocks: The bus clock and the audio clock (as shown in
Figure 51-1 in the Vybrid Reference Manual). The clock gates in
CCGR0/CCGR1 for SAI0 through SAI3 are bus clock gates, as access
tests to the registers with/without gating those clocks have shown.
The audio clock is gated by the SAIx_EN gates in CCM_CSCDR1,
followed by a clock divider (SAIx_DIV). Currently, the parent of
the bus clock gates has been assigned to SAIx_DIV, which is not
involved in the bus clock path for the SAI instances (see chapter
9.10.12, SAI clocking in the Vybrid Reference Manual).
Fix this by define the parent clock of VF610_CLK_SAIx to be the bus
clock.
If the driver needs the audio clock (when used in master mode), a
fixed device tree is required which assign the audio clock properly
to VF610_CLK_SAIx_DIV.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
Hi all,
Patch 1 and 2 are actual fixes and should be applied toghether. If
the clock tree changes are applied only, master mode won't work
anymore. With only the device tree changes applied, it probably
will still work but the VF610_CLK_SAIx_DIV will be enabled twice.
Since Patch 3 also uses the fixed clock layout, it should be
applied after the clock tree fix too...
Not sure through which tree these changes should go?
--
Stefan
drivers/clk/imx/clk-vf610.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/imx/clk-vf610.c b/drivers/clk/imx/clk-vf610.c
index bff45ea..42a7a23 100644
--- a/drivers/clk/imx/clk-vf610.c
+++ b/drivers/clk/imx/clk-vf610.c
@@ -335,22 +335,22 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
clk[VF610_CLK_SAI0_SEL] = imx_clk_mux("sai0_sel", CCM_CSCMR1, 0, 2, sai_sels, 4);
clk[VF610_CLK_SAI0_EN] = imx_clk_gate("sai0_en", "sai0_sel", CCM_CSCDR1, 16);
clk[VF610_CLK_SAI0_DIV] = imx_clk_divider("sai0_div", "sai0_en", CCM_CSCDR1, 0, 4);
- clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "sai0_div", CCM_CCGR0, CCM_CCGRx_CGn(15));
+ clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(15));
clk[VF610_CLK_SAI1_SEL] = imx_clk_mux("sai1_sel", CCM_CSCMR1, 2, 2, sai_sels, 4);
clk[VF610_CLK_SAI1_EN] = imx_clk_gate("sai1_en", "sai1_sel", CCM_CSCDR1, 17);
clk[VF610_CLK_SAI1_DIV] = imx_clk_divider("sai1_div", "sai1_en", CCM_CSCDR1, 4, 4);
- clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "sai1_div", CCM_CCGR1, CCM_CCGRx_CGn(0));
+ clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(0));
clk[VF610_CLK_SAI2_SEL] = imx_clk_mux("sai2_sel", CCM_CSCMR1, 4, 2, sai_sels, 4);
clk[VF610_CLK_SAI2_EN] = imx_clk_gate("sai2_en", "sai2_sel", CCM_CSCDR1, 18);
clk[VF610_CLK_SAI2_DIV] = imx_clk_divider("sai2_div", "sai2_en", CCM_CSCDR1, 8, 4);
- clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "sai2_div", CCM_CCGR1, CCM_CCGRx_CGn(1));
+ clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(1));
clk[VF610_CLK_SAI3_SEL] = imx_clk_mux("sai3_sel", CCM_CSCMR1, 6, 2, sai_sels, 4);
clk[VF610_CLK_SAI3_EN] = imx_clk_gate("sai3_en", "sai3_sel", CCM_CSCDR1, 19);
clk[VF610_CLK_SAI3_DIV] = imx_clk_divider("sai3_div", "sai3_en", CCM_CSCDR1, 12, 4);
- clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "sai3_div", CCM_CCGR1, CCM_CCGRx_CGn(2));
+ clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(2));
clk[VF610_CLK_NFC_SEL] = imx_clk_mux("nfc_sel", CCM_CSCMR1, 12, 2, nfc_sels, 4);
clk[VF610_CLK_NFC_EN] = imx_clk_gate("nfc_en", "nfc_sel", CCM_CSCDR2, 9);
--
2.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
@ 2015-10-18 4:05 ` Stefan Agner
[not found] ` <1445141122-14183-2-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>
2015-10-18 4:05 ` [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces Stefan Agner
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Stefan Agner @ 2015-10-18 4:05 UTC (permalink / raw)
To: shawnguo, kernel, mturquette, sboyd
Cc: mark.rutland, devicetree, zidan.wang, pawel.moll, ijc+devicetree,
Li.Xiubo, linux-kernel, Stefan Agner, robh+dt, galak, linux-clk,
linux-arm-kernel
So far, only the bus clock has been assigned, but in reality the
SAI IP has for clock inputs. The driver has been updated to
make use of the additional clock inputs by c3ecef21c3f2 ("ASoC:
fsl_sai: add sai master mode support"). Due to a bug in the
clock tree, the audio clock has been enabled none the less by
the specified bus clock (see "ARM: imx: clk-vf610: fix SAI
clock tree"), which made master mode even without the proper
clock assigned working.
This patch completes the clock definition for SAI2. On Vybrid,
only two MCLK out of the four options are available (the first
being the bus clock itself). See chapter 8.10.1.2.3 of the
Vybrid Reference manual ("SAI transmitter and receiver options
for MCLK selection"). Note: The audio clocks are only required
in master mode.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vfxxx.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
index 6865137..c2a4d1c 100644
--- a/arch/arm/boot/dts/vfxxx.dtsi
+++ b/arch/arm/boot/dts/vfxxx.dtsi
@@ -178,8 +178,10 @@
compatible = "fsl,vf610-sai";
reg = <0x40031000 0x1000>;
interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clks VF610_CLK_SAI2>;
- clock-names = "sai";
+ clocks = <&clks VF610_CLK_SAI2>,
+ <&clks VF610_CLK_SAI2_DIV>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
dma-names = "tx", "rx";
dmas = <&edma0 0 21>,
<&edma0 0 20>;
--
2.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
2015-10-18 4:05 ` [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2 Stefan Agner
@ 2015-10-18 4:05 ` Stefan Agner
2016-01-28 0:31 ` Stefan Agner
2015-11-19 1:58 ` [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
` (3 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Stefan Agner @ 2015-10-18 4:05 UTC (permalink / raw)
To: shawnguo, kernel, mturquette, sboyd
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel, Stefan Agner
This adds the remaining SAI instances SAI0, SAI1 and SAI3. All
instances are very similar, except that the DMA channel of SAI3
is available on MUX1 (compared to MUX0 for SAI0-SAI2). Also,
SAI3 has a slightly different memory map due to a deeper FIFO,
however in practice the current driver works for SAI3 fine.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vfxxx.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
index c2a4d1c..b45bc81 100644
--- a/arch/arm/boot/dts/vfxxx.dtsi
+++ b/arch/arm/boot/dts/vfxxx.dtsi
@@ -174,6 +174,34 @@
status = "disabled";
};
+ sai0: sai@4002f000 {
+ compatible = "fsl,vf610-sai";
+ reg = <0x4002f000 0x1000>;
+ interrupts = <84 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clks VF610_CLK_SAI0>,
+ <&clks VF610_CLK_SAI0_DIV>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
+ dma-names = "tx", "rx";
+ dmas = <&edma0 0 17>,
+ <&edma0 0 16>;
+ status = "disabled";
+ };
+
+ sai1: sai@40030000 {
+ compatible = "fsl,vf610-sai";
+ reg = <0x40030000 0x1000>;
+ interrupts = <85 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clks VF610_CLK_SAI1>,
+ <&clks VF610_CLK_SAI1_DIV>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
+ dma-names = "tx", "rx";
+ dmas = <&edma0 0 19>,
+ <&edma0 0 18>;
+ status = "disabled";
+ };
+
sai2: sai@40031000 {
compatible = "fsl,vf610-sai";
reg = <0x40031000 0x1000>;
@@ -188,6 +216,20 @@
status = "disabled";
};
+ sai3: sai@40032000 {
+ compatible = "fsl,vf610-sai";
+ reg = <0x40032000 0x1000>;
+ interrupts = <87 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clks VF610_CLK_SAI3>,
+ <&clks VF610_CLK_SAI3_DIV>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
+ dma-names = "tx", "rx";
+ dmas = <&edma0 1 9>,
+ <&edma0 1 8>;
+ status = "disabled";
+ };
+
pit: pit@40037000 {
compatible = "fsl,vf610-pit";
reg = <0x40037000 0x1000>;
--
2.6.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
2015-10-18 4:05 ` [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2 Stefan Agner
2015-10-18 4:05 ` [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces Stefan Agner
@ 2015-11-19 1:58 ` Stefan Agner
2015-11-23 1:46 ` Shawn Guo
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Stefan Agner @ 2015-11-19 1:58 UTC (permalink / raw)
To: shawnguo, kernel, mturquette, sboyd
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel
Hi Shawn,
Any thoughts on that patchset? I kind of hoped that it would make it
into 4.4 since it actually fixes issues (at least 1 and 2)... That said,
I don't think it is stable material since it also breaks the device
tree...
--
Stefan
On 2015-10-17 21:05, Stefan Agner wrote:
> The Synchronous Audio Interface (SAI) instances are clocked by
> independent clocks: The bus clock and the audio clock (as shown in
> Figure 51-1 in the Vybrid Reference Manual). The clock gates in
> CCGR0/CCGR1 for SAI0 through SAI3 are bus clock gates, as access
> tests to the registers with/without gating those clocks have shown.
> The audio clock is gated by the SAIx_EN gates in CCM_CSCDR1,
> followed by a clock divider (SAIx_DIV). Currently, the parent of
> the bus clock gates has been assigned to SAIx_DIV, which is not
> involved in the bus clock path for the SAI instances (see chapter
> 9.10.12, SAI clocking in the Vybrid Reference Manual).
>
> Fix this by define the parent clock of VF610_CLK_SAIx to be the bus
> clock.
>
> If the driver needs the audio clock (when used in master mode), a
> fixed device tree is required which assign the audio clock properly
> to VF610_CLK_SAIx_DIV.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> Hi all,
>
> Patch 1 and 2 are actual fixes and should be applied toghether. If
> the clock tree changes are applied only, master mode won't work
> anymore. With only the device tree changes applied, it probably
> will still work but the VF610_CLK_SAIx_DIV will be enabled twice.
>
> Since Patch 3 also uses the fixed clock layout, it should be
> applied after the clock tree fix too...
>
> Not sure through which tree these changes should go?
>
> --
> Stefan
>
> drivers/clk/imx/clk-vf610.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-vf610.c b/drivers/clk/imx/clk-vf610.c
> index bff45ea..42a7a23 100644
> --- a/drivers/clk/imx/clk-vf610.c
> +++ b/drivers/clk/imx/clk-vf610.c
> @@ -335,22 +335,22 @@ static void __init vf610_clocks_init(struct
> device_node *ccm_node)
> clk[VF610_CLK_SAI0_SEL] = imx_clk_mux("sai0_sel", CCM_CSCMR1, 0, 2,
> sai_sels, 4);
> clk[VF610_CLK_SAI0_EN] = imx_clk_gate("sai0_en", "sai0_sel", CCM_CSCDR1, 16);
> clk[VF610_CLK_SAI0_DIV] = imx_clk_divider("sai0_div", "sai0_en",
> CCM_CSCDR1, 0, 4);
> - clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "sai0_div", CCM_CCGR0,
> CCM_CCGRx_CGn(15));
> + clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "ipg_bus", CCM_CCGR0,
> CCM_CCGRx_CGn(15));
>
> clk[VF610_CLK_SAI1_SEL] = imx_clk_mux("sai1_sel", CCM_CSCMR1, 2, 2,
> sai_sels, 4);
> clk[VF610_CLK_SAI1_EN] = imx_clk_gate("sai1_en", "sai1_sel", CCM_CSCDR1, 17);
> clk[VF610_CLK_SAI1_DIV] = imx_clk_divider("sai1_div", "sai1_en",
> CCM_CSCDR1, 4, 4);
> - clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "sai1_div", CCM_CCGR1,
> CCM_CCGRx_CGn(0));
> + clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "ipg_bus", CCM_CCGR1,
> CCM_CCGRx_CGn(0));
>
> clk[VF610_CLK_SAI2_SEL] = imx_clk_mux("sai2_sel", CCM_CSCMR1, 4, 2,
> sai_sels, 4);
> clk[VF610_CLK_SAI2_EN] = imx_clk_gate("sai2_en", "sai2_sel", CCM_CSCDR1, 18);
> clk[VF610_CLK_SAI2_DIV] = imx_clk_divider("sai2_div", "sai2_en",
> CCM_CSCDR1, 8, 4);
> - clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "sai2_div", CCM_CCGR1,
> CCM_CCGRx_CGn(1));
> + clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "ipg_bus", CCM_CCGR1,
> CCM_CCGRx_CGn(1));
>
> clk[VF610_CLK_SAI3_SEL] = imx_clk_mux("sai3_sel", CCM_CSCMR1, 6, 2,
> sai_sels, 4);
> clk[VF610_CLK_SAI3_EN] = imx_clk_gate("sai3_en", "sai3_sel", CCM_CSCDR1, 19);
> clk[VF610_CLK_SAI3_DIV] = imx_clk_divider("sai3_div", "sai3_en",
> CCM_CSCDR1, 12, 4);
> - clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "sai3_div", CCM_CCGR1,
> CCM_CCGRx_CGn(2));
> + clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "ipg_bus", CCM_CCGR1,
> CCM_CCGRx_CGn(2));
>
> clk[VF610_CLK_NFC_SEL] = imx_clk_mux("nfc_sel", CCM_CSCMR1, 12, 2,
> nfc_sels, 4);
> clk[VF610_CLK_NFC_EN] = imx_clk_gate("nfc_en", "nfc_sel", CCM_CSCDR2, 9);
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
` (2 preceding siblings ...)
2015-11-19 1:58 ` [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
@ 2015-11-23 1:46 ` Shawn Guo
2015-11-30 20:55 ` Stephen Boyd
2015-11-30 20:55 ` Stephen Boyd
2015-12-02 5:24 ` Shawn Guo
5 siblings, 1 reply; 12+ messages in thread
From: Shawn Guo @ 2015-11-23 1:46 UTC (permalink / raw)
To: Stefan Agner
Cc: kernel, mturquette, sboyd, galak, ijc+devicetree, mark.rutland,
pawel.moll, robh+dt, Li.Xiubo, zidan.wang, linux-arm-kernel,
devicetree, linux-clk, linux-kernel
On Sat, Oct 17, 2015 at 09:05:20PM -0700, Stefan Agner wrote:
> The Synchronous Audio Interface (SAI) instances are clocked by
> independent clocks: The bus clock and the audio clock (as shown in
> Figure 51-1 in the Vybrid Reference Manual). The clock gates in
> CCGR0/CCGR1 for SAI0 through SAI3 are bus clock gates, as access
> tests to the registers with/without gating those clocks have shown.
> The audio clock is gated by the SAIx_EN gates in CCM_CSCDR1,
> followed by a clock divider (SAIx_DIV). Currently, the parent of
> the bus clock gates has been assigned to SAIx_DIV, which is not
> involved in the bus clock path for the SAI instances (see chapter
> 9.10.12, SAI clocking in the Vybrid Reference Manual).
>
> Fix this by define the parent clock of VF610_CLK_SAIx to be the bus
> clock.
>
> If the driver needs the audio clock (when used in master mode), a
> fixed device tree is required which assign the audio clock properly
> to VF610_CLK_SAIx_DIV.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> Hi all,
>
> Patch 1 and 2 are actual fixes and should be applied toghether. If
> the clock tree changes are applied only, master mode won't work
> anymore. With only the device tree changes applied, it probably
> will still work but the VF610_CLK_SAIx_DIV will be enabled twice.
Though I'm not happy about that the new kernel will break old DTBs which
is actually buggy, I do not see other way around to get it fixed. So I
have no objections.
>
> Since Patch 3 also uses the fixed clock layout, it should be
> applied after the clock tree fix too...
>
> Not sure through which tree these changes should go?
Mike, Stephen,
Can I have your ACK on patch #1 so that I can send it together with
#2 for v4.4-rc inclusion?
Shawn
>
> --
> Stefan
>
> drivers/clk/imx/clk-vf610.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-vf610.c b/drivers/clk/imx/clk-vf610.c
> index bff45ea..42a7a23 100644
> --- a/drivers/clk/imx/clk-vf610.c
> +++ b/drivers/clk/imx/clk-vf610.c
> @@ -335,22 +335,22 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
> clk[VF610_CLK_SAI0_SEL] = imx_clk_mux("sai0_sel", CCM_CSCMR1, 0, 2, sai_sels, 4);
> clk[VF610_CLK_SAI0_EN] = imx_clk_gate("sai0_en", "sai0_sel", CCM_CSCDR1, 16);
> clk[VF610_CLK_SAI0_DIV] = imx_clk_divider("sai0_div", "sai0_en", CCM_CSCDR1, 0, 4);
> - clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "sai0_div", CCM_CCGR0, CCM_CCGRx_CGn(15));
> + clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(15));
>
> clk[VF610_CLK_SAI1_SEL] = imx_clk_mux("sai1_sel", CCM_CSCMR1, 2, 2, sai_sels, 4);
> clk[VF610_CLK_SAI1_EN] = imx_clk_gate("sai1_en", "sai1_sel", CCM_CSCDR1, 17);
> clk[VF610_CLK_SAI1_DIV] = imx_clk_divider("sai1_div", "sai1_en", CCM_CSCDR1, 4, 4);
> - clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "sai1_div", CCM_CCGR1, CCM_CCGRx_CGn(0));
> + clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(0));
>
> clk[VF610_CLK_SAI2_SEL] = imx_clk_mux("sai2_sel", CCM_CSCMR1, 4, 2, sai_sels, 4);
> clk[VF610_CLK_SAI2_EN] = imx_clk_gate("sai2_en", "sai2_sel", CCM_CSCDR1, 18);
> clk[VF610_CLK_SAI2_DIV] = imx_clk_divider("sai2_div", "sai2_en", CCM_CSCDR1, 8, 4);
> - clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "sai2_div", CCM_CCGR1, CCM_CCGRx_CGn(1));
> + clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(1));
>
> clk[VF610_CLK_SAI3_SEL] = imx_clk_mux("sai3_sel", CCM_CSCMR1, 6, 2, sai_sels, 4);
> clk[VF610_CLK_SAI3_EN] = imx_clk_gate("sai3_en", "sai3_sel", CCM_CSCDR1, 19);
> clk[VF610_CLK_SAI3_DIV] = imx_clk_divider("sai3_div", "sai3_en", CCM_CSCDR1, 12, 4);
> - clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "sai3_div", CCM_CCGR1, CCM_CCGRx_CGn(2));
> + clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(2));
>
> clk[VF610_CLK_NFC_SEL] = imx_clk_mux("nfc_sel", CCM_CSCMR1, 12, 2, nfc_sels, 4);
> clk[VF610_CLK_NFC_EN] = imx_clk_gate("nfc_en", "nfc_sel", CCM_CSCDR2, 9);
> --
> 2.6.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2
[not found] ` <1445141122-14183-2-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>
@ 2015-11-23 3:04 ` Shawn Guo
0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2015-11-23 3:04 UTC (permalink / raw)
To: Stefan Agner
Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ, mturquette-rdvid1DuHRBWk0Htik3J/w,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ, galak-sgV2jX0FEOL9JmXXK+q4OQ,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg, mark.rutland-5wv7dgnIgG8,
pawel.moll-5wv7dgnIgG8, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
Li.Xiubo-KZfg59tc24xl57MIdRCFDg,
zidan.wang-KZfg59tc24xl57MIdRCFDg,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-clk-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Sat, Oct 17, 2015 at 09:05:21PM -0700, Stefan Agner wrote:
> So far, only the bus clock has been assigned, but in reality the
> SAI IP has for clock inputs. The driver has been updated to
s/for/four
Will fix it up when applying.
Shawn
> make use of the additional clock inputs by c3ecef21c3f2 ("ASoC:
> fsl_sai: add sai master mode support"). Due to a bug in the
> clock tree, the audio clock has been enabled none the less by
> the specified bus clock (see "ARM: imx: clk-vf610: fix SAI
> clock tree"), which made master mode even without the proper
> clock assigned working.
>
> This patch completes the clock definition for SAI2. On Vybrid,
> only two MCLK out of the four options are available (the first
> being the bus clock itself). See chapter 8.10.1.2.3 of the
> Vybrid Reference manual ("SAI transmitter and receiver options
> for MCLK selection"). Note: The audio clocks are only required
> in master mode.
>
> Signed-off-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
> ---
> arch/arm/boot/dts/vfxxx.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
> index 6865137..c2a4d1c 100644
> --- a/arch/arm/boot/dts/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/vfxxx.dtsi
> @@ -178,8 +178,10 @@
> compatible = "fsl,vf610-sai";
> reg = <0x40031000 0x1000>;
> interrupts = <86 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&clks VF610_CLK_SAI2>;
> - clock-names = "sai";
> + clocks = <&clks VF610_CLK_SAI2>,
> + <&clks VF610_CLK_SAI2_DIV>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> dma-names = "tx", "rx";
> dmas = <&edma0 0 21>,
> <&edma0 0 20>;
> --
> 2.6.1
>
--
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] 12+ messages in thread
* Re: [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
` (3 preceding siblings ...)
2015-11-23 1:46 ` Shawn Guo
@ 2015-11-30 20:55 ` Stephen Boyd
2015-12-02 5:24 ` Shawn Guo
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2015-11-30 20:55 UTC (permalink / raw)
To: Stefan Agner
Cc: shawnguo, kernel, mturquette, galak, ijc+devicetree, mark.rutland,
pawel.moll, robh+dt, Li.Xiubo, zidan.wang, linux-arm-kernel,
devicetree, linux-clk, linux-kernel
On 10/17, Stefan Agner wrote:
> The Synchronous Audio Interface (SAI) instances are clocked by
> independent clocks: The bus clock and the audio clock (as shown in
> Figure 51-1 in the Vybrid Reference Manual). The clock gates in
> CCGR0/CCGR1 for SAI0 through SAI3 are bus clock gates, as access
> tests to the registers with/without gating those clocks have shown.
> The audio clock is gated by the SAIx_EN gates in CCM_CSCDR1,
> followed by a clock divider (SAIx_DIV). Currently, the parent of
> the bus clock gates has been assigned to SAIx_DIV, which is not
> involved in the bus clock path for the SAI instances (see chapter
> 9.10.12, SAI clocking in the Vybrid Reference Manual).
>
> Fix this by define the parent clock of VF610_CLK_SAIx to be the bus
> clock.
>
> If the driver needs the audio clock (when used in master mode), a
> fixed device tree is required which assign the audio clock properly
> to VF610_CLK_SAIx_DIV.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
2015-11-23 1:46 ` Shawn Guo
@ 2015-11-30 20:55 ` Stephen Boyd
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2015-11-30 20:55 UTC (permalink / raw)
To: Shawn Guo
Cc: Stefan Agner, kernel, mturquette, galak, ijc+devicetree,
mark.rutland, pawel.moll, robh+dt, Li.Xiubo, zidan.wang,
linux-arm-kernel, devicetree, linux-clk, linux-kernel
On 11/23, Shawn Guo wrote:
> On Sat, Oct 17, 2015 at 09:05:20PM -0700, Stefan Agner wrote:
> >
> > Since Patch 3 also uses the fixed clock layout, it should be
> > applied after the clock tree fix too...
> >
> > Not sure through which tree these changes should go?
>
> Mike, Stephen,
>
> Can I have your ACK on patch #1 so that I can send it together with
> #2 for v4.4-rc inclusion?
>
Yes that's fine.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
` (4 preceding siblings ...)
2015-11-30 20:55 ` Stephen Boyd
@ 2015-12-02 5:24 ` Shawn Guo
5 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2015-12-02 5:24 UTC (permalink / raw)
To: Stefan Agner
Cc: kernel, mturquette, sboyd, mark.rutland, devicetree, zidan.wang,
pawel.moll, ijc+devicetree, Li.Xiubo, linux-kernel, robh+dt,
galak, linux-clk, linux-arm-kernel
On Sat, Oct 17, 2015 at 09:05:20PM -0700, Stefan Agner wrote:
> The Synchronous Audio Interface (SAI) instances are clocked by
> independent clocks: The bus clock and the audio clock (as shown in
> Figure 51-1 in the Vybrid Reference Manual). The clock gates in
> CCGR0/CCGR1 for SAI0 through SAI3 are bus clock gates, as access
> tests to the registers with/without gating those clocks have shown.
> The audio clock is gated by the SAIx_EN gates in CCM_CSCDR1,
> followed by a clock divider (SAIx_DIV). Currently, the parent of
> the bus clock gates has been assigned to SAIx_DIV, which is not
> involved in the bus clock path for the SAI instances (see chapter
> 9.10.12, SAI clocking in the Vybrid Reference Manual).
>
> Fix this by define the parent clock of VF610_CLK_SAIx to be the bus
> clock.
>
> If the driver needs the audio clock (when used in master mode), a
> fixed device tree is required which assign the audio clock properly
> to VF610_CLK_SAIx_DIV.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> Hi all,
>
> Patch 1 and 2 are actual fixes and should be applied toghether. If
> the clock tree changes are applied only, master mode won't work
> anymore. With only the device tree changes applied, it probably
> will still work but the VF610_CLK_SAIx_DIV will be enabled twice.
>
> Since Patch 3 also uses the fixed clock layout, it should be
> applied after the clock tree fix too...
Applied all 3, thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces
2015-10-18 4:05 ` [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces Stefan Agner
@ 2016-01-28 0:31 ` Stefan Agner
2016-01-28 1:53 ` Shawn Guo
0 siblings, 1 reply; 12+ messages in thread
From: Stefan Agner @ 2016-01-28 0:31 UTC (permalink / raw)
To: shawnguo
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel, kernel, mturquette, sboyd
Hi Shawn,
The rest of the patchset has been applied during rc phase of v4.4, I
guess this one was scheduled for the next release (v4.5). However, I
just realized that this seemed to have slipped through...
--
Stefan
On 2015-10-17 21:05, Stefan Agner wrote:
> This adds the remaining SAI instances SAI0, SAI1 and SAI3. All
> instances are very similar, except that the DMA channel of SAI3
> is available on MUX1 (compared to MUX0 for SAI0-SAI2). Also,
> SAI3 has a slightly different memory map due to a deeper FIFO,
> however in practice the current driver works for SAI3 fine.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> arch/arm/boot/dts/vfxxx.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
> index c2a4d1c..b45bc81 100644
> --- a/arch/arm/boot/dts/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/vfxxx.dtsi
> @@ -174,6 +174,34 @@
> status = "disabled";
> };
>
> + sai0: sai@4002f000 {
> + compatible = "fsl,vf610-sai";
> + reg = <0x4002f000 0x1000>;
> + interrupts = <84 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clks VF610_CLK_SAI0>,
> + <&clks VF610_CLK_SAI0_DIV>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> + dma-names = "tx", "rx";
> + dmas = <&edma0 0 17>,
> + <&edma0 0 16>;
> + status = "disabled";
> + };
> +
> + sai1: sai@40030000 {
> + compatible = "fsl,vf610-sai";
> + reg = <0x40030000 0x1000>;
> + interrupts = <85 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clks VF610_CLK_SAI1>,
> + <&clks VF610_CLK_SAI1_DIV>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> + dma-names = "tx", "rx";
> + dmas = <&edma0 0 19>,
> + <&edma0 0 18>;
> + status = "disabled";
> + };
> +
> sai2: sai@40031000 {
> compatible = "fsl,vf610-sai";
> reg = <0x40031000 0x1000>;
> @@ -188,6 +216,20 @@
> status = "disabled";
> };
>
> + sai3: sai@40032000 {
> + compatible = "fsl,vf610-sai";
> + reg = <0x40032000 0x1000>;
> + interrupts = <87 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clks VF610_CLK_SAI3>,
> + <&clks VF610_CLK_SAI3_DIV>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> + dma-names = "tx", "rx";
> + dmas = <&edma0 1 9>,
> + <&edma0 1 8>;
> + status = "disabled";
> + };
> +
> pit: pit@40037000 {
> compatible = "fsl,vf610-pit";
> reg = <0x40037000 0x1000>;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces
2016-01-28 1:53 ` Shawn Guo
@ 2016-01-28 1:52 ` Stefan Agner
0 siblings, 0 replies; 12+ messages in thread
From: Stefan Agner @ 2016-01-28 1:52 UTC (permalink / raw)
To: Shawn Guo
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel, kernel, mturquette, sboyd
On 2016-01-27 17:53, Shawn Guo wrote:
> On Wed, Jan 27, 2016 at 04:31:48PM -0800, Stefan Agner wrote:
>> Hi Shawn,
>>
>> The rest of the patchset has been applied during rc phase of v4.4, I
>> guess this one was scheduled for the next release (v4.5). However, I
>> just realized that this seemed to have slipped through...
>
> Sorry, Stefan. If I can get a ping from you before v4.5 merge window
> closes, we might be able to catch up with v4.5.
Sure, no problem. Not really a mission critical patch :-)
>
> Queued it up for v4.6.
Thanks
--
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces
2016-01-28 0:31 ` Stefan Agner
@ 2016-01-28 1:53 ` Shawn Guo
2016-01-28 1:52 ` Stefan Agner
0 siblings, 1 reply; 12+ messages in thread
From: Shawn Guo @ 2016-01-28 1:53 UTC (permalink / raw)
To: Stefan Agner
Cc: galak, ijc+devicetree, mark.rutland, pawel.moll, robh+dt,
Li.Xiubo, zidan.wang, linux-arm-kernel, devicetree, linux-clk,
linux-kernel, kernel, mturquette, sboyd
On Wed, Jan 27, 2016 at 04:31:48PM -0800, Stefan Agner wrote:
> Hi Shawn,
>
> The rest of the patchset has been applied during rc phase of v4.4, I
> guess this one was scheduled for the next release (v4.5). However, I
> just realized that this seemed to have slipped through...
Sorry, Stefan. If I can get a ping from you before v4.5 merge window
closes, we might be able to catch up with v4.5.
Queued it up for v4.6.
Shawn
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-01-28 1:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-18 4:05 [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
2015-10-18 4:05 ` [PATCH 2/3] ARM: dts: vf610: fix clock definition for SAI2 Stefan Agner
[not found] ` <1445141122-14183-2-git-send-email-stefan-XLVq0VzYD2Y@public.gmane.org>
2015-11-23 3:04 ` Shawn Guo
2015-10-18 4:05 ` [PATCH 3/3] ARM: dts: vf610: add remaining SAI instaces Stefan Agner
2016-01-28 0:31 ` Stefan Agner
2016-01-28 1:53 ` Shawn Guo
2016-01-28 1:52 ` Stefan Agner
2015-11-19 1:58 ` [PATCH 1/3] ARM: imx: clk-vf610: fix SAI clock tree Stefan Agner
2015-11-23 1:46 ` Shawn Guo
2015-11-30 20:55 ` Stephen Boyd
2015-11-30 20:55 ` Stephen Boyd
2015-12-02 5:24 ` Shawn Guo
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).