Skip to content

Commit 08df609

Browse files
committed
ARC: [axs101] Fix HDMI frequency divider for v3 motherboard.
On v2 motherboard it was the only clock source for all purposes and for clocking HDMI phy in particular. It was 25MHz. It lead to a fact that HDMI pixel clock was 75MHz instead of 74.25MHz required by spec. Even though on most monitors/TVs we still had normal picture there was a chance in some corner-cases get problems with image display. This problem was resolved on v3 motherboard with addition of another clock source with 27MHz frequency. Now to support both motherboard at once we check its version and do proper divider setup. Signed-off-by: Alexey Brodkin <[email protected]> Signed-off-by: Paul Moers <[email protected]>
1 parent 941a8b4 commit 08df609

File tree

1 file changed

+32
-12
lines changed

1 file changed

+32
-12
lines changed

arch/arc/plat-axs10x/axs101.c

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,38 @@ static void axs101_early_init(void)
178178
/* map GPIO 14:10 to ARC 9:5 (IRQ mux change for rev 2 boards) */
179179
iowrite32(0x52, (void __iomem *) AXC001_CREG + 0x114);
180180

181-
/*
182-
* Set clock for PGU, 150 Mhz
183-
* to obtain 75MHz pixel clock, required for 720p60
184-
* (25 * 18) / 3 == 25 * 6 == 150
185-
*/
186-
187-
write_cgu_reg(0x2000,
188-
(void __iomem *) 0xe0010080, (void __iomem *) 0xe0010110);
189-
write_cgu_reg((18 << 6) | 18,
190-
(void __iomem *) 0xe0010084, (void __iomem *) 0xe0010110);
191-
write_cgu_reg((3 << 6) | 3,
192-
(void __iomem *) 0xe0010088, (void __iomem *) 0xe0010110);
181+
/* Set clock divider value depending on mother board version */
182+
if (ioread32((void __iomem *) AXS_MB_CREG + 0x234) & (1 << 28)) {
183+
/*
184+
* 1 => HT-3 (rev3.0)
185+
*
186+
* Set clock for PGU, 74.25 Mhz
187+
* to obtain 74.25MHz pixel clock, required for 720p60
188+
* (27 * 22) / 8 == 74.25
189+
*/
190+
write_cgu_reg(0x2041, (void __iomem *) 0xe0010080,
191+
(void __iomem *) 0xe0010110);
192+
write_cgu_reg((22 << 6) | 22, (void __iomem *) 0xe0010084,
193+
(void __iomem *) 0xe0010110);
194+
write_cgu_reg((8 << 6) | 8, (void __iomem *) 0xe0010088,
195+
(void __iomem *) 0xe0010110);
196+
}
197+
else {
198+
/*
199+
* 0 => HT-2 (rev2.0)
200+
*
201+
* Set clock for PGU, 150 Mhz
202+
* to obtain 75MHz pixel clock, required for 720p60
203+
* (25 * 18) / 3 == 25 * 6 == 150
204+
*/
205+
206+
write_cgu_reg(0x2000, (void __iomem *) 0xe0010080,
207+
(void __iomem *) 0xe0010110);
208+
write_cgu_reg((18 << 6) | 18, (void __iomem *) 0xe0010084,
209+
(void __iomem *) 0xe0010110);
210+
write_cgu_reg((3 << 6) | 3, (void __iomem *) 0xe0010088,
211+
(void __iomem *) 0xe0010110);
212+
}
193213
}
194214

195215
static void axs101_plat_init(void)

0 commit comments

Comments
 (0)