Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: dts: pic32: Update dts to reflect new PIC32MZDA clk binding

- now clock nodes definition is merged with core .dtsi file
- only one rootclk is now part of DT
- clock clients also updated based on new binding doc

Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Sandeep Sheriker <sandeepsheriker.mallikarjun@microchip.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-clk@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13248/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Purna Chandra Mandal and committed by
Ralf Baechle
9125f19b ce6e1188

+45 -259
-236
arch/mips/boot/dts/pic32/pic32mzda-clk.dtsi
··· 1 - /* 2 - * Device Tree Source for PIC32MZDA clock data 3 - * 4 - * Purna Chandra Mandal <purna.mandal@microchip.com> 5 - * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. 6 - * 7 - * Licensed under GPLv2 or later. 8 - */ 9 - 10 - /* all fixed rate clocks */ 11 - 12 - / { 13 - POSC:posc_clk { /* On-chip primary oscillator */ 14 - #clock-cells = <0>; 15 - compatible = "fixed-clock"; 16 - clock-frequency = <24000000>; 17 - }; 18 - 19 - FRC:frc_clk { /* internal FRC oscillator */ 20 - #clock-cells = <0>; 21 - compatible = "fixed-clock"; 22 - clock-frequency = <8000000>; 23 - }; 24 - 25 - BFRC:bfrc_clk { /* internal backup FRC oscillator */ 26 - #clock-cells = <0>; 27 - compatible = "fixed-clock"; 28 - clock-frequency = <8000000>; 29 - }; 30 - 31 - LPRC:lprc_clk { /* internal low-power FRC oscillator */ 32 - #clock-cells = <0>; 33 - compatible = "fixed-clock"; 34 - clock-frequency = <32000>; 35 - }; 36 - 37 - /* UPLL provides clock to USBCORE */ 38 - UPLL:usb_phy_clk { 39 - #clock-cells = <0>; 40 - compatible = "fixed-clock"; 41 - clock-frequency = <24000000>; 42 - clock-output-names = "usbphy_clk"; 43 - }; 44 - 45 - TxCKI:txcki_clk { /* external clock input on TxCLKI pin */ 46 - #clock-cells = <0>; 47 - compatible = "fixed-clock"; 48 - clock-frequency = <4000000>; 49 - status = "disabled"; 50 - }; 51 - 52 - /* external clock input on REFCLKIx pin */ 53 - REFIx:refix_clk { 54 - #clock-cells = <0>; 55 - compatible = "fixed-clock"; 56 - clock-frequency = <24000000>; 57 - status = "disabled"; 58 - }; 59 - 60 - /* PIC32 specific clks */ 61 - pic32_clktree { 62 - #address-cells = <1>; 63 - #size-cells = <1>; 64 - reg = <0x1f801200 0x200>; 65 - compatible = "microchip,pic32mzda-clk"; 66 - ranges = <0 0x1f801200 0x200>; 67 - 68 - /* secondary oscillator; external input on SOSCI pin */ 69 - SOSC:sosc_clk@0 { 70 - #clock-cells = <0>; 71 - compatible = "microchip,pic32mzda-sosc"; 72 - clock-frequency = <32768>; 73 - reg = <0x000 0x10>, /* enable reg */ 74 - <0x1d0 0x10>; /* status reg */ 75 - microchip,bit-mask = <0x02>; /* enable mask */ 76 - microchip,status-bit-mask = <0x10>; /* status-mask*/ 77 - }; 78 - 79 - FRCDIV:frcdiv_clk { 80 - #clock-cells = <0>; 81 - compatible = "microchip,pic32mzda-frcdivclk"; 82 - clocks = <&FRC>; 83 - clock-output-names = "frcdiv_clk"; 84 - }; 85 - 86 - /* System PLL clock */ 87 - SYSPLL:spll_clk@020 { 88 - #clock-cells = <0>; 89 - compatible = "microchip,pic32mzda-syspll"; 90 - reg = <0x020 0x10>, /* SPLL register */ 91 - <0x1d0 0x10>; /* CLKSTAT register */ 92 - clocks = <&POSC>, <&FRC>; 93 - clock-output-names = "sys_pll"; 94 - microchip,status-bit-mask = <0x80>; /* SPLLRDY */ 95 - }; 96 - 97 - /* system clock; mux with postdiv & slew */ 98 - SYSCLK:sys_clk@1c0 { 99 - #clock-cells = <0>; 100 - compatible = "microchip,pic32mzda-sysclk-v2"; 101 - reg = <0x1c0 0x04>; /* SLEWCON */ 102 - clocks = <&FRCDIV>, <&SYSPLL>, <&POSC>, <&SOSC>, 103 - <&LPRC>, <&FRCDIV>; 104 - microchip,clock-indices = <0>, <1>, <2>, <4>, 105 - <5>, <7>; 106 - clock-output-names = "sys_clk"; 107 - }; 108 - 109 - /* Peripheral bus1 clock */ 110 - PBCLK1:pb1_clk@140 { 111 - reg = <0x140 0x10>; 112 - #clock-cells = <0>; 113 - compatible = "microchip,pic32mzda-pbclk"; 114 - clocks = <&SYSCLK>; 115 - clock-output-names = "pb1_clk"; 116 - /* used by system modules, not gateable */ 117 - microchip,ignore-unused; 118 - }; 119 - 120 - /* Peripheral bus2 clock */ 121 - PBCLK2:pb2_clk@150 { 122 - reg = <0x150 0x10>; 123 - #clock-cells = <0>; 124 - compatible = "microchip,pic32mzda-pbclk"; 125 - clocks = <&SYSCLK>; 126 - clock-output-names = "pb2_clk"; 127 - /* avoid gating even if unused */ 128 - microchip,ignore-unused; 129 - }; 130 - 131 - /* Peripheral bus3 clock */ 132 - PBCLK3:pb3_clk@160 { 133 - reg = <0x160 0x10>; 134 - #clock-cells = <0>; 135 - compatible = "microchip,pic32mzda-pbclk"; 136 - clocks = <&SYSCLK>; 137 - clock-output-names = "pb3_clk"; 138 - }; 139 - 140 - /* Peripheral bus4 clock(I/O ports, GPIO) */ 141 - PBCLK4:pb4_clk@170 { 142 - reg = <0x170 0x10>; 143 - #clock-cells = <0>; 144 - compatible = "microchip,pic32mzda-pbclk"; 145 - clocks = <&SYSCLK>; 146 - clock-output-names = "pb4_clk"; 147 - }; 148 - 149 - /* Peripheral bus clock */ 150 - PBCLK5:pb5_clk@180 { 151 - reg = <0x180 0x10>; 152 - #clock-cells = <0>; 153 - compatible = "microchip,pic32mzda-pbclk"; 154 - clocks = <&SYSCLK>; 155 - clock-output-names = "pb5_clk"; 156 - }; 157 - 158 - /* Peripheral Bus6 clock; */ 159 - PBCLK6:pb6_clk@190 { 160 - reg = <0x190 0x10>; 161 - compatible = "microchip,pic32mzda-pbclk"; 162 - clocks = <&SYSCLK>; 163 - #clock-cells = <0>; 164 - }; 165 - 166 - /* Peripheral bus7 clock */ 167 - PBCLK7:pb7_clk@1a0 { 168 - reg = <0x1a0 0x10>; 169 - #clock-cells = <0>; 170 - compatible = "microchip,pic32mzda-pbclk"; 171 - /* CPU is driven by this clock; so named */ 172 - clock-output-names = "cpu_clk"; 173 - clocks = <&SYSCLK>; 174 - }; 175 - 176 - /* Reference Oscillator clock for SPI/I2S */ 177 - REFCLKO1:refo1_clk@80 { 178 - reg = <0x080 0x20>; 179 - #clock-cells = <0>; 180 - compatible = "microchip,pic32mzda-refoclk"; 181 - clocks = <&SYSCLK>, <&PBCLK1>, <&POSC>, <&FRC>, <&LPRC>, 182 - <&SOSC>, <&SYSPLL>, <&REFIx>, <&BFRC>; 183 - microchip,clock-indices = <0>, <1>, <2>, <3>, <4>, 184 - <5>, <7>, <8>, <9>; 185 - clock-output-names = "refo1_clk"; 186 - }; 187 - 188 - /* Reference Oscillator clock for SQI */ 189 - REFCLKO2:refo2_clk@a0 { 190 - reg = <0x0a0 0x20>; 191 - #clock-cells = <0>; 192 - compatible = "microchip,pic32mzda-refoclk"; 193 - clocks = <&SYSCLK>, <&PBCLK1>, <&POSC>, <&FRC>, <&LPRC>, 194 - <&SOSC>, <&SYSPLL>, <&REFIx>, <&BFRC>; 195 - microchip,clock-indices = <0>, <1>, <2>, <3>, <4>, 196 - <5>, <7>, <8>, <9>; 197 - clock-output-names = "refo2_clk"; 198 - }; 199 - 200 - /* Reference Oscillator clock, ADC */ 201 - REFCLKO3:refo3_clk@c0 { 202 - reg = <0x0c0 0x20>; 203 - compatible = "microchip,pic32mzda-refoclk"; 204 - clocks = <&SYSCLK>, <&PBCLK1>, <&POSC>, <&FRC>, <&LPRC>, 205 - <&SOSC>, <&SYSPLL>, <&REFIx>, <&BFRC>; 206 - microchip,clock-indices = <0>, <1>, <2>, <3>, <4>, 207 - <5>, <7>, <8>, <9>; 208 - #clock-cells = <0>; 209 - clock-output-names = "refo3_clk"; 210 - }; 211 - 212 - /* Reference Oscillator clock */ 213 - REFCLKO4:refo4_clk@e0 { 214 - reg = <0x0e0 0x20>; 215 - compatible = "microchip,pic32mzda-refoclk"; 216 - clocks = <&SYSCLK>, <&PBCLK1>, <&POSC>, <&FRC>, <&LPRC>, 217 - <&SOSC>, <&SYSPLL>, <&REFIx>, <&BFRC>; 218 - microchip,clock-indices = <0>, <1>, <2>, <3>, <4>, 219 - <5>, <7>, <8>, <9>; 220 - #clock-cells = <0>; 221 - clock-output-names = "refo4_clk"; 222 - }; 223 - 224 - /* Reference Oscillator clock, LCD */ 225 - REFCLKO5:refo5_clk@100 { 226 - reg = <0x100 0x20>; 227 - compatible = "microchip,pic32mzda-refoclk"; 228 - clocks = <&SYSCLK>,<&PBCLK1>,<&POSC>,<&FRC>,<&LPRC>, 229 - <&SOSC>,<&SYSPLL>,<&REFIx>,<&BFRC>; 230 - microchip,clock-indices = <0>, <1>, <2>, <3>, <4>, 231 - <5>, <7>, <8>, <9>; 232 - #clock-cells = <0>; 233 - clock-output-names = "refo5_clk"; 234 - }; 235 - }; 236 - };
+42 -21
arch/mips/boot/dts/pic32/pic32mzda.dtsi
··· 6 6 * published by the Free Software Foundation. 7 7 * 8 8 */ 9 - 9 + #include <dt-bindings/clock/microchip,pic32-clock.h> 10 10 #include <dt-bindings/interrupt-controller/irq.h> 11 - 12 - #include "pic32mzda-clk.dtsi" 13 11 14 12 / { 15 13 #address-cells = <1>; ··· 48 50 interrupts = <0 IRQ_TYPE_EDGE_RISING>; 49 51 }; 50 52 53 + /* external clock input on TxCLKI pin */ 54 + txcki: txcki_clk { 55 + #clock-cells = <0>; 56 + compatible = "fixed-clock"; 57 + clock-frequency = <4000000>; 58 + status = "disabled"; 59 + }; 60 + 61 + /* external input on REFCLKIx pin */ 62 + refix: refix_clk { 63 + #clock-cells = <0>; 64 + compatible = "fixed-clock"; 65 + clock-frequency = <24000000>; 66 + status = "disabled"; 67 + }; 68 + 69 + rootclk: clock-controller@1f801200 { 70 + compatible = "microchip,pic32mzda-clk"; 71 + reg = <0x1f801200 0x200>; 72 + #clock-cells = <1>; 73 + microchip,pic32mzda-sosc; 74 + }; 75 + 51 76 evic: interrupt-controller@1f810000 { 52 77 compatible = "microchip,pic32mzda-evic"; 53 78 interrupt-controller; ··· 84 63 #size-cells = <1>; 85 64 compatible = "microchip,pic32mzda-pinctrl"; 86 65 reg = <0x1f801400 0x400>; 87 - clocks = <&PBCLK1>; 66 + clocks = <&rootclk PB1CLK>; 88 67 }; 89 68 90 69 /* PORTA */ ··· 96 75 gpio-controller; 97 76 interrupt-controller; 98 77 #interrupt-cells = <2>; 99 - clocks = <&PBCLK4>; 78 + clocks = <&rootclk PB4CLK>; 100 79 microchip,gpio-bank = <0>; 101 80 gpio-ranges = <&pic32_pinctrl 0 0 16>; 102 81 }; ··· 110 89 gpio-controller; 111 90 interrupt-controller; 112 91 #interrupt-cells = <2>; 113 - clocks = <&PBCLK4>; 92 + clocks = <&rootclk PB4CLK>; 114 93 microchip,gpio-bank = <1>; 115 94 gpio-ranges = <&pic32_pinctrl 0 16 16>; 116 95 }; ··· 124 103 gpio-controller; 125 104 interrupt-controller; 126 105 #interrupt-cells = <2>; 127 - clocks = <&PBCLK4>; 106 + clocks = <&rootclk PB4CLK>; 128 107 microchip,gpio-bank = <2>; 129 108 gpio-ranges = <&pic32_pinctrl 0 32 16>; 130 109 }; ··· 138 117 gpio-controller; 139 118 interrupt-controller; 140 119 #interrupt-cells = <2>; 141 - clocks = <&PBCLK4>; 120 + clocks = <&rootclk PB4CLK>; 142 121 microchip,gpio-bank = <3>; 143 122 gpio-ranges = <&pic32_pinctrl 0 48 16>; 144 123 }; ··· 152 131 gpio-controller; 153 132 interrupt-controller; 154 133 #interrupt-cells = <2>; 155 - clocks = <&PBCLK4>; 134 + clocks = <&rootclk PB4CLK>; 156 135 microchip,gpio-bank = <4>; 157 136 gpio-ranges = <&pic32_pinctrl 0 64 16>; 158 137 }; ··· 166 145 gpio-controller; 167 146 interrupt-controller; 168 147 #interrupt-cells = <2>; 169 - clocks = <&PBCLK4>; 148 + clocks = <&rootclk PB4CLK>; 170 149 microchip,gpio-bank = <5>; 171 150 gpio-ranges = <&pic32_pinctrl 0 80 16>; 172 151 }; ··· 180 159 gpio-controller; 181 160 interrupt-controller; 182 161 #interrupt-cells = <2>; 183 - clocks = <&PBCLK4>; 162 + clocks = <&rootclk PB4CLK>; 184 163 microchip,gpio-bank = <6>; 185 164 gpio-ranges = <&pic32_pinctrl 0 96 16>; 186 165 }; ··· 194 173 gpio-controller; 195 174 interrupt-controller; 196 175 #interrupt-cells = <2>; 197 - clocks = <&PBCLK4>; 176 + clocks = <&rootclk PB4CLK>; 198 177 microchip,gpio-bank = <7>; 199 178 gpio-ranges = <&pic32_pinctrl 0 112 16>; 200 179 }; ··· 210 189 gpio-controller; 211 190 interrupt-controller; 212 191 #interrupt-cells = <2>; 213 - clocks = <&PBCLK4>; 192 + clocks = <&rootclk PB4CLK>; 214 193 microchip,gpio-bank = <8>; 215 194 gpio-ranges = <&pic32_pinctrl 0 128 16>; 216 195 }; ··· 224 203 gpio-controller; 225 204 interrupt-controller; 226 205 #interrupt-cells = <2>; 227 - clocks = <&PBCLK4>; 206 + clocks = <&rootclk PB4CLK>; 228 207 microchip,gpio-bank = <9>; 229 208 gpio-ranges = <&pic32_pinctrl 0 144 16>; 230 209 }; ··· 233 212 compatible = "microchip,pic32mzda-sdhci"; 234 213 reg = <0x1f8ec000 0x100>; 235 214 interrupts = <191 IRQ_TYPE_LEVEL_HIGH>; 236 - clocks = <&REFCLKO4>, <&PBCLK5>; 215 + clocks = <&rootclk REF4CLK>, <&rootclk PB5CLK>; 237 216 clock-names = "base_clk", "sys_clk"; 238 217 bus-width = <4>; 239 218 cap-sd-highspeed; ··· 246 225 interrupts = <112 IRQ_TYPE_LEVEL_HIGH>, 247 226 <113 IRQ_TYPE_LEVEL_HIGH>, 248 227 <114 IRQ_TYPE_LEVEL_HIGH>; 249 - clocks = <&PBCLK2>; 228 + clocks = <&rootclk PB2CLK>; 250 229 status = "disabled"; 251 230 }; 252 231 ··· 256 235 interrupts = <145 IRQ_TYPE_LEVEL_HIGH>, 257 236 <146 IRQ_TYPE_LEVEL_HIGH>, 258 237 <147 IRQ_TYPE_LEVEL_HIGH>; 259 - clocks = <&PBCLK2>; 238 + clocks = <&rootclk PB2CLK>; 260 239 status = "disabled"; 261 240 }; 262 241 ··· 266 245 interrupts = <157 IRQ_TYPE_LEVEL_HIGH>, 267 246 <158 IRQ_TYPE_LEVEL_HIGH>, 268 247 <159 IRQ_TYPE_LEVEL_HIGH>; 269 - clocks = <&PBCLK2>; 248 + clocks = <&rootclk PB2CLK>; 270 249 status = "disabled"; 271 250 }; 272 251 ··· 276 255 interrupts = <170 IRQ_TYPE_LEVEL_HIGH>, 277 256 <171 IRQ_TYPE_LEVEL_HIGH>, 278 257 <172 IRQ_TYPE_LEVEL_HIGH>; 279 - clocks = <&PBCLK2>; 258 + clocks = <&rootclk PB2CLK>; 280 259 status = "disabled"; 281 260 }; 282 261 ··· 286 265 interrupts = <179 IRQ_TYPE_LEVEL_HIGH>, 287 266 <180 IRQ_TYPE_LEVEL_HIGH>, 288 267 <181 IRQ_TYPE_LEVEL_HIGH>; 289 - clocks = <&PBCLK2>; 268 + clocks = <&rootclk PB2CLK>; 290 269 status = "disabled"; 291 270 }; 292 271 ··· 296 275 interrupts = <188 IRQ_TYPE_LEVEL_HIGH>, 297 276 <189 IRQ_TYPE_LEVEL_HIGH>, 298 277 <190 IRQ_TYPE_LEVEL_HIGH>; 299 - clocks = <&PBCLK2>; 278 + clocks = <&rootclk PB2CLK>; 300 279 status = "disabled"; 301 280 }; 302 281 };
+3 -2
arch/mips/boot/dts/pic32/pic32mzda_sk.dts
··· 95 95 pinctrl-names = "default"; 96 96 pinctrl-0 = <&pinctrl_sdhc1>; 97 97 status = "okay"; 98 - assigned-clocks = <&REFCLKO2>,<&REFCLKO4>,<&REFCLKO5>; 99 - assigned-clock-rates = <50000000>,<25000000>,<40000000>; 98 + assigned-clocks = <&rootclk REF2CLK>, <&rootclk REF4CLK>, 99 + <&rootclk REF5CLK>; 100 + assigned-clock-rates = <50000000>, <25000000>, <40000000>; 100 101 }; 101 102 102 103 &pic32_pinctrl {