Skip to content

Commit

Permalink
ARC: [axs101] Fix HDMI frequency divider for v3 motherboard.
Browse files Browse the repository at this point in the history
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 <abrodkin@synopsys.com>
Signed-off-by: Paul Moers <pmoers@synopsys.com>
  • Loading branch information
abrodkin committed Oct 17, 2014
1 parent 941a8b4 commit 08df609
Showing 1 changed file with 32 additions and 12 deletions.
44 changes: 32 additions & 12 deletions arch/arc/plat-axs10x/axs101.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,38 @@ static void axs101_early_init(void)
/* map GPIO 14:10 to ARC 9:5 (IRQ mux change for rev 2 boards) */
iowrite32(0x52, (void __iomem *) AXC001_CREG + 0x114);

/*
* Set clock for PGU, 150 Mhz
* to obtain 75MHz pixel clock, required for 720p60
* (25 * 18) / 3 == 25 * 6 == 150
*/

write_cgu_reg(0x2000,
(void __iomem *) 0xe0010080, (void __iomem *) 0xe0010110);
write_cgu_reg((18 << 6) | 18,
(void __iomem *) 0xe0010084, (void __iomem *) 0xe0010110);
write_cgu_reg((3 << 6) | 3,
(void __iomem *) 0xe0010088, (void __iomem *) 0xe0010110);
/* Set clock divider value depending on mother board version */
if (ioread32((void __iomem *) AXS_MB_CREG + 0x234) & (1 << 28)) {
/*
* 1 => HT-3 (rev3.0)
*
* Set clock for PGU, 74.25 Mhz
* to obtain 74.25MHz pixel clock, required for 720p60
* (27 * 22) / 8 == 74.25
*/
write_cgu_reg(0x2041, (void __iomem *) 0xe0010080,
(void __iomem *) 0xe0010110);
write_cgu_reg((22 << 6) | 22, (void __iomem *) 0xe0010084,
(void __iomem *) 0xe0010110);
write_cgu_reg((8 << 6) | 8, (void __iomem *) 0xe0010088,
(void __iomem *) 0xe0010110);
}
else {
/*
* 0 => HT-2 (rev2.0)
*
* Set clock for PGU, 150 Mhz
* to obtain 75MHz pixel clock, required for 720p60
* (25 * 18) / 3 == 25 * 6 == 150
*/

write_cgu_reg(0x2000, (void __iomem *) 0xe0010080,
(void __iomem *) 0xe0010110);
write_cgu_reg((18 << 6) | 18, (void __iomem *) 0xe0010084,
(void __iomem *) 0xe0010110);
write_cgu_reg((3 << 6) | 3, (void __iomem *) 0xe0010088,
(void __iomem *) 0xe0010110);
}
}

static void axs101_plat_init(void)
Expand Down

0 comments on commit 08df609

Please sign in to comment.