Skip to contentSkip to conversation

clk: sunxi-ng: sun50i-h6-r: Fix incorrect W1 clock gate register

PATCH Applied [email protected] 3 participants 5 messages Jun 4, 2019 – Jun 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: sunxi-ng: sun50i-h6-r: Fix incorrect W1 clock gate register

From: Ondrej Jirman <[email protected]>

The current code defines W1 clock gate to be at 0x1cc, overlaying it with the IR gate.

Clock gate for r-apb1-w1 is at 0x1ec. This fixes issues with IR receiver causing interrupt floods on H6 (because interrupt flags can't be cleared, due to IR module's bus being disabled).

Fixes b7c7b05065aa77ae ("clk: sunxi-ng: add support for H6 PRCM CCU")
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +1 -1
index 27554eaf6929..8d05d4f1f8a1 100644
@@ -104,7 +104,7 @@ static SUNXI_CCU_GATE(r_apb2_i2c_clk,	"r-apb2-i2c",	"r-apb2",
 static SUNXI_CCU_GATE(r_apb1_ir_clk,	"r-apb1-ir",	"r-apb1",
 		      0x1cc, BIT(0), 0);
 static SUNXI_CCU_GATE(r_apb1_w1_clk,	"r-apb1-w1",	"r-apb1",
-		      0x1cc, BIT(0), 0);
+		      0x1ec, BIT(0), 0);
 
 /* Information of IR(RX) mod clock is gathered from BSP source code */
 static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
Signature · 1 line
2.21.0
#1 lore raw

Hi Ondrej,

Quoted 21 lines · megous via linux-sunxi

From: Ondrej Jirman <[email protected]>

The current code defines W1 clock gate to be at 0x1cc, overlaying it with the IR gate.

Clock gate for r-apb1-w1 is at 0x1ec. This fixes issues with IR receiver causing interrupt floods on H6 (because interrupt flags can't be cleared, due to IR module's bus being disabled).

Fixes b7c7b05065aa77ae ("clk: sunxi-ng: add support for H6 PRCM CCU")
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +0 -0
index 27554eaf6929..8d05d4f1f8a1 100644

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c static SUNXI_CCU_GATE(r_apb2_i2c_clk, "r-apb2-i2c", "r-apb2", · line 107

Quoted 5 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +1 -1
@@ -104,7 +104,7 @@ static SUNXI_CCU_GATE(r_apb2_i2c_clk,       "r-apb2-i2c",   "r-apb2",
 static SUNXI_CCU_GATE(r_apb1_ir_clk,   "r-apb1-ir",    "r-apb1",
                      0x1cc, BIT(0), 0);
 static SUNXI_CCU_GATE(r_apb1_w1_clk,   "r-apb1-w1",    "r-apb1",
-                     0x1cc, BIT(0), 0);
+                     0x1ec, BIT(0), 0);

Just for information where did you find this information? Using the vendor kernel or user manual?

Thanks,
Clément

Quoted 11 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +0 -1
 /* Information of IR(RX) mod clock is gathered from BSP source code */
 static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
--

2.21.0

--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190604154036.23211-1-megous%40megous.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw

Hi Clément,

Quoted 20 lines · Clément Péron

Hi Ondrej,

Quoted 16 lines · megous via linux-sunxi

From: Ondrej Jirman <[email protected]>

The current code defines W1 clock gate to be at 0x1cc, overlaying it with the IR gate.

Clock gate for r-apb1-w1 is at 0x1ec. This fixes issues with IR receiver causing interrupt floods on H6 (because interrupt flags can't be cleared, due to IR module's bus being disabled).

Fixes b7c7b05065aa77ae ("clk: sunxi-ng: add support for H6 PRCM CCU")
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c static SUNXI_CCU_GATE(r_apb2_i2c_clk, "r-apb2-i2c", "r-apb2", · line 107

Quoted 10 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +1 -1
index 27554eaf6929..8d05d4f1f8a1 100644
@@ -104,7 +104,7 @@ static SUNXI_CCU_GATE(r_apb2_i2c_clk,       "r-apb2-i2c",   "r-apb2",
 static SUNXI_CCU_GATE(r_apb1_ir_clk,   "r-apb1-ir",    "r-apb1",
                      0x1cc, BIT(0), 0);
 static SUNXI_CCU_GATE(r_apb1_w1_clk,   "r-apb1-w1",    "r-apb1",
-                     0x1cc, BIT(0), 0);
+                     0x1ec, BIT(0), 0);

Just for information where did you find this information? Using the vendor kernel or user manual?

Informed guess. All gates and resets are in the same register. And you can see below that reset register for w1 is 0x1ec. (reset register for ir is 0x1cc)

regards,

	o.
Quoted 14 lines

Thanks,
Clément

Quoted 11 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +0 -1
 /* Information of IR(RX) mod clock is gathered from BSP source code */
 static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
--

2.21.0

--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190604154036.23211-1-megous%40megous.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

Hi Ondrej,

Quoted 37 lines · Ondřej Jirman

Hi Clément,

Quoted 20 lines · Clément Péron

Hi Ondrej,

Quoted 16 lines · megous via linux-sunxi

From: Ondrej Jirman <[email protected]>

The current code defines W1 clock gate to be at 0x1cc, overlaying it with the IR gate.

Clock gate for r-apb1-w1 is at 0x1ec. This fixes issues with IR receiver causing interrupt floods on H6 (because interrupt flags can't be cleared, due to IR module's bus being disabled).

Fixes b7c7b05065aa77ae ("clk: sunxi-ng: add support for H6 PRCM CCU")
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c static SUNXI_CCU_GATE(r_apb2_i2c_clk, "r-apb2-i2c", "r-apb2", · line 107

Quoted 10 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +1 -1
index 27554eaf6929..8d05d4f1f8a1 100644
@@ -104,7 +104,7 @@ static SUNXI_CCU_GATE(r_apb2_i2c_clk,       "r-apb2-i2c",   "r-apb2",
 static SUNXI_CCU_GATE(r_apb1_ir_clk,   "r-apb1-ir",    "r-apb1",
                      0x1cc, BIT(0), 0);
 static SUNXI_CCU_GATE(r_apb1_w1_clk,   "r-apb1-w1",    "r-apb1",
-                     0x1cc, BIT(0), 0);
+                     0x1ec, BIT(0), 0);

Just for information where did you find this information? Using the vendor kernel or user manual?

Quoted 3 lines

Informed guess. All gates and resets are in the same register. And you can see below that reset register for w1 is 0x1ec. (reset register for ir is 0x1cc)

Ok, I thinks this can confirm the value:
https://github.com/orangepi-xunlong/OrangePiH6_Linux4_9/blob/master/drivers/clk/sunxi/clk-sun50iw6.h#L161

Regards,
Clément

Quoted 18 lines

regards,

        o.
Quoted 14 lines

Thanks,
Clément

Quoted 11 lines
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +0 -1
 /* Information of IR(RX) mod clock is gathered from BSP source code */
 static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
--

2.21.0

--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190604154036.23211-1-megous%40megous.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
In reply to [email protected]
Quoted 11 lines · On Tue, Jun 04, 2019 at 05:40:36PM +0200, [email protected] wrote:

From: Ondrej Jirman <[email protected]>

The current code defines W1 clock gate to be at 0x1cc, overlaying it with the IR gate.

Clock gate for r-apb1-w1 is at 0x1ec. This fixes issues with IR receiver causing interrupt floods on H6 (because interrupt flags can't be cleared, due to IR module's bus being disabled).

Fixes b7c7b05065aa77ae ("clk: sunxi-ng: add support for H6 PRCM CCU")

Applied, thanks

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com