Skip to content

Commit 563ba37

Browse files
committed
clk/bcm2835: Don't allow "osc" as a parent for "dpi"
DPI being a pixel clock needs to be fairly accurate. BCM2711 has changed the oscillator from 19.2MHz to 54MHz, so the current clock manager code thinks that for eg a 32MHz pixel clock it can use the oscillator and a fractional divider. For many displays this isn't acceptable. Add a new option for clock parentage that doesn't permit the oscillator, and use this option for the DPI clock. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 15c0556 commit 563ba37

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/clk/bcm/clk-bcm2835.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,22 @@ static const char *const bcm2835_clock_per_parents[] = {
16371637
.parents = bcm2835_clock_per_parents, \
16381638
__VA_ARGS__)
16391639

1640+
static const char *const bcm2835_clock_per_no_osc_parents[] = {
1641+
"gnd",
1642+
"testdebug0",
1643+
"testdebug1",
1644+
"plla_per",
1645+
"pllc_per",
1646+
"plld_per",
1647+
"pllh_aux",
1648+
};
1649+
1650+
#define REGISTER_PER_NO_OSC_CLK(s, ...) REGISTER_CLK( \
1651+
s, \
1652+
.num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_no_osc_parents), \
1653+
.parents = bcm2835_clock_per_no_osc_parents, \
1654+
__VA_ARGS__)
1655+
16401656
/*
16411657
* Restrict clock sources for the PCM peripheral to the oscillator and
16421658
* PLLD_PER because other source may have varying rates or be switched
@@ -2126,7 +2142,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
21262142
.div_reg = CM_DFTDIV,
21272143
.int_bits = 5,
21282144
.frac_bits = 0),
2129-
[BCM2835_CLOCK_DPI] = REGISTER_PER_CLK(
2145+
[BCM2835_CLOCK_DPI] = REGISTER_PER_NO_OSC_CLK(
21302146
SOC_ALL,
21312147
.name = "dpi",
21322148
.ctl_reg = CM_DPICTL,

0 commit comments

Comments
 (0)