clk: bcm2835: Limit PCM clock to OSC and PLLD_PER
authorPhil Elwell <phil@raspberrypi.org>
Wed, 26 Apr 2017 16:28:47 +0000 (17:28 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:53:34 +0000 (15:53 +0100)
It is unwise to use sources other than the oscillator and PLLD_PER for
the PCM peripheral (and perhaps others - TBD) because their rate can
change and they may even be switched off, so explicitly restrict the
choice using dummy entries in the list of potential parents (item index
is significant).

See: https://github.com/raspberrypi/linux/issues/1949

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/clk/bcm/clk-bcm2835.c

index fe3298b54cdfb96bd90fb4f39e13921d2e1d4356..c24b4defb2b046e4ecdc109befc2b22497060647 100644 (file)
@@ -1562,6 +1562,16 @@ static const char *const bcm2835_clock_per_parents[] = {
        "pllh_aux",
 };
 
+static const char *const bcm2835_pcm_per_parents[] = {
+       "-",
+       "xosc",
+       "-",
+       "-",
+       "-",
+       "-",
+       "plld_per",
+};
+
 #define REGISTER_PER_CLK(...)  REGISTER_CLK(                           \
        .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents),       \
        .parents = bcm2835_clock_per_parents,                           \
@@ -2051,6 +2061,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
                .int_bits = 12,
                .frac_bits = 12,
                .is_mash_clock = true,
+               .parents = bcm2835_pcm_per_parents,
                .tcnt_mux = 23),
        [BCM2835_CLOCK_PWM]     = REGISTER_PER_CLK(
                .name = "pwm",