Skip to contentSkip to conversation

rockchip: clk: rk3188: update dpll settings to make EMAC work

PATCH In review Alexander Kochetkov 3 participants 6 messages Feb 26, 2018 – Mar 27, 2018

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

PATCH 1/1 rockchip: clk: rk3188: update dpll settings to make EMAC work

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/

    tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin
---
 drivers/clk/rockchip/clk_rk3188.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk_rk3188.c +1 -1
index 6451c95..f674e60 100644
@@ -123,7 +123,7 @@ static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf,
 			       unsigned int hz, bool has_bwadj)
 {
 	static const struct pll_div dpll_cfg[] = {
-		{.nf = 25, .nr = 2, .no = 1},
+		{.nf = 75, .nr = 1, .no = 6},
 		{.nf = 400, .nr = 9, .no = 2},
 		{.nf = 500, .nr = 9, .no = 2},
 		{.nf = 100, .nr = 3, .no = 1},
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 rockchip: clk: rk3188: update dpll settings to make EMAC work

Kever,

please review.

Thanks,
Philipp.

Quoted 35 lines · Alexander Kochetkov

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/
tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin

---
drivers/clk/rockchip/clk_rk3188.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk_rk3188.c +1 -1
index 6451c95..f674e60 100644
@@ -123,7 +123,7 @@ static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf,
 			       unsigned int hz, bool has_bwadj)
 {
 	static const struct pll_div dpll_cfg[] = {
-		{.nf = 25, .nr = 2, .no = 1},
+		{.nf = 75, .nr = 1, .no = 6},
 		{.nf = 400, .nr = 9, .no = 2},
 		{.nf = 500, .nr = 9, .no = 2},
 		{.nf = 100, .nr = 3, .no = 1},
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 rockchip: clk: rk3188: update dpll settings to make EMAC work

Hi Philipp,

    Sorry for reply so late.

Quoted 26 lines · Dr. Philipp Tomsich

Kever,

please review.

Thanks,
Philipp.

Quoted 19 lines · Alexander Kochetkov

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/
tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin

---
drivers/clk/rockchip/clk_rk3188.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines

drivers/clk/rockchip/clk_rk3188.c static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf, · line 126

Quoted 10 lines
drivers/clk/rockchip/clk_rk3188.c +1 -1
index 6451c95..f674e60 100644
@@ -123,7 +123,7 @@ static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf,
 			       unsigned int hz, bool has_bwadj)
 {
 	static const struct pll_div dpll_cfg[] = {
-		{.nf = 25, .nr = 2, .no = 1},
+		{.nf = 75, .nr = 1, .no = 6},

Rockchip always prefer to use nr=1 even if we can only get a frequency close to target frequency,
because this setting can get smaller jitter. Some of IP like jitter may very sensitive to this setting.

Thanks,
- Kever

Quoted 7 lines
Quoted 6 lines
drivers/clk/rockchip/clk_rk3188.c +0 -0
 		{.nf = 400, .nr = 9, .no = 2},
 		{.nf = 500, .nr = 9, .no = 2},
 		{.nf = 100, .nr = 3, .no = 1},
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#3 lore raw
In reply to Alexander Kochetkov
Quoted 9 lines

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

Quoted 8 lines

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/

    tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin
---
 drivers/clk/rockchip/clk_rk3188.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Alexander Kochetkov
Quoted 9 lines

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

Quoted 8 lines

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/

    tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin
---
 drivers/clk/rockchip/clk_rk3188.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#5 lore raw
In reply to Alexander Kochetkov
Quoted 10 lines

The patch set dpll settings for 300MHz to values used by binary blob[1]. With new values dpll still generate 300MHz clock, but EMAC work. Probably with new values dpll generate more stable clock.

dpll on rk3188 provide clocks to DDR and EMAC. With current dpll settings EMAC doesn't work on radxa rock. EMAC sends packets to network, but it doesn't receive anything. ifconfig shows a lot of framing errors.

[1] https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/

Quoted 9 lines
    tools/rk_tools/3188_LPDDR2_300MHz_DDR3_300MHz_20130830.bin
---
 drivers/clk/rockchip/clk_rk3188.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-rockchip, thanks!