brcm2708: switch to linux 4.9
[lede.git] / target / linux / brcm2708 / patches-4.4 / 0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch
1 From 16a3192294e1c450a9dccb2a808ea159bdbfdb9e Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Tue, 26 Apr 2016 11:44:59 -0700
4 Subject: [PATCH] clk: bcm2835: Mark the VPU clock as critical
5
6 The VPU clock is also the clock for our AXI bus, so we really can't
7 disable it.  This might have happened during boot if, for example,
8 uart1 (aux_uart clock) probed and was then disabled before the other
9 consumers of the VPU clock had probed.
10
11 v2: Rewrite to use a .flags in bcm2835_clock_data, since other clocks
12     will need this too.
13
14 Signed-off-by: Eric Anholt <eric@anholt.net>
15 ---
16  drivers/clk/bcm/clk-bcm2835.c | 5 ++++-
17  1 file changed, 4 insertions(+), 1 deletion(-)
18
19 --- a/drivers/clk/bcm/clk-bcm2835.c
20 +++ b/drivers/clk/bcm/clk-bcm2835.c
21 @@ -446,6 +446,8 @@ struct bcm2835_clock_data {
22         /* Number of fractional bits in the divider */
23         u32 frac_bits;
24  
25 +       u32 flags;
26 +
27         bool is_vpu_clock;
28         bool is_mash_clock;
29  };
30 @@ -1244,7 +1246,7 @@ static struct clk *bcm2835_register_cloc
31         init.parent_names = parents;
32         init.num_parents = data->num_mux_parents;
33         init.name = data->name;
34 -       init.flags = CLK_IGNORE_UNUSED;
35 +       init.flags = data->flags | CLK_IGNORE_UNUSED;
36  
37         if (data->is_vpu_clock) {
38                 init.ops = &bcm2835_vpu_clock_clk_ops;
39 @@ -1663,6 +1665,7 @@ static const struct bcm2835_clk_desc clk
40                 .div_reg = CM_VPUDIV,
41                 .int_bits = 12,
42                 .frac_bits = 8,
43 +               .flags = CLK_IS_CRITICAL,
44                 .is_vpu_clock = true),
45  
46         /* clocks with per parent mux */