Skip to content

Commit b2f471a

Browse files
parakabebarino
authored andcommitted
staging: mt7621-dts: make use of new 'mt7621-clk'
Clocks for SoC mt7621 have been properly integrated so there is no need to declare fixed clocks at all in the device tree. Remove all of them, add new device tree nodes for mt7621-clk and update the rest of the nodes to use them. Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sergio Paracuellos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 48df7a2 commit b2f471a

File tree

2 files changed

+33
-52
lines changed

2 files changed

+33
-52
lines changed

drivers/staging/mt7621-dts/gbpc1.dts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,6 @@
100100
};
101101
};
102102

103-
&sysclock {
104-
compatible = "fixed-clock";
105-
/* This is normally 1/4 of cpuclock */
106-
clock-frequency = <225000000>;
107-
};
108-
109-
&cpuclock {
110-
compatible = "fixed-clock";
111-
clock-frequency = <900000000>;
112-
};
113-
114103
&pcie {
115104
pinctrl-names = "default";
116105
pinctrl-0 = <&pcie_pins>;

drivers/staging/mt7621-dts/mt7621.dtsi

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <dt-bindings/interrupt-controller/mips-gic.h>
22
#include <dt-bindings/gpio/gpio.h>
3+
#include <dt-bindings/clock/mt7621-clk.h>
34

45
/ {
56
#address-cells = <1>;
@@ -27,27 +28,6 @@
2728
serial0 = &uartlite;
2829
};
2930

30-
cpuclock: cpuclock@0 {
31-
#clock-cells = <0>;
32-
compatible = "fixed-clock";
33-
34-
/* FIXME: there should be way to detect this */
35-
clock-frequency = <880000000>;
36-
};
37-
38-
sysclock: sysclock@0 {
39-
#clock-cells = <0>;
40-
compatible = "fixed-clock";
41-
42-
/* This is normally 1/4 of cpuclock */
43-
clock-frequency = <220000000>;
44-
};
45-
46-
mmc_clock: mmc_clock@0 {
47-
#clock-cells = <0>;
48-
compatible = "fixed-clock";
49-
clock-frequency = <48000000>;
50-
};
5131

5232
mmc_fixed_3v3: fixedregulator@0 {
5333
compatible = "regulator-fixed";
@@ -76,8 +56,13 @@
7656
#size-cells = <1>;
7757

7858
sysc: sysc@0 {
79-
compatible = "mtk,mt7621-sysc";
59+
compatible = "mtk,mt7621-sysc", "syscon";
8060
reg = <0x0 0x100>;
61+
#clock-cells = <1>;
62+
ralink,memctl = <&memc>;
63+
clock-output-names = "xtal", "cpu", "bus",
64+
"50m", "125m", "150m",
65+
"250m", "270m";
8166
};
8267

8368
wdt: wdt@100 {
@@ -101,8 +86,8 @@
10186
compatible = "mediatek,mt7621-i2c";
10287
reg = <0x900 0x100>;
10388

104-
clocks = <&sysclock>;
105-
89+
clocks = <&sysc MT7621_CLK_I2C>;
90+
clock-names = "i2c";
10691
resets = <&rstctrl 16>;
10792
reset-names = "i2c";
10893

@@ -119,8 +104,8 @@
119104
compatible = "mediatek,mt7621-i2s";
120105
reg = <0xa00 0x100>;
121106

122-
clocks = <&sysclock>;
123-
107+
clocks = <&sysc MT7621_CLK_I2S>;
108+
clock-names = "i2s";
124109
resets = <&rstctrl 17>;
125110
reset-names = "i2s";
126111

@@ -138,7 +123,7 @@
138123
};
139124

140125
memc: memc@5000 {
141-
compatible = "mtk,mt7621-memc";
126+
compatible = "mtk,mt7621-memc", "syscon";
142127
reg = <0x5000 0x1000>;
143128
};
144129

@@ -156,8 +141,8 @@
156141
compatible = "ns16550a";
157142
reg = <0xc00 0x100>;
158143

159-
clocks = <&sysclock>;
160-
clock-frequency = <50000000>;
144+
clocks = <&sysc MT7621_CLK_UART1>;
145+
clock-names = "uart1";
161146

162147
interrupt-parent = <&gic>;
163148
interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
@@ -173,7 +158,8 @@
173158
compatible = "ralink,mt7621-spi";
174159
reg = <0xb00 0x100>;
175160

176-
clocks = <&sysclock>;
161+
clocks = <&sysc MT7621_CLK_SPI>;
162+
clock-names = "spi";
177163

178164
resets = <&rstctrl 18>;
179165
reset-names = "spi";
@@ -189,6 +175,8 @@
189175
compatible = "ralink,rt3883-gdma";
190176
reg = <0x2800 0x800>;
191177

178+
clocks = <&sysc MT7621_CLK_GDMA>;
179+
clock-names = "gdma";
192180
resets = <&rstctrl 14>;
193181
reset-names = "dma";
194182

@@ -206,6 +194,8 @@
206194
compatible = "mediatek,mt7621-hsdma";
207195
reg = <0x7000 0x1000>;
208196

197+
clocks = <&sysc MT7621_CLK_HSDMA>;
198+
clock-names = "hsdma";
209199
resets = <&rstctrl 5>;
210200
reset-names = "hsdma";
211201

@@ -311,11 +301,6 @@
311301
#reset-cells = <1>;
312302
};
313303

314-
clkctrl: clkctrl {
315-
compatible = "ralink,rt2880-clock";
316-
#clock-cells = <1>;
317-
};
318-
319304
sdhci: sdhci@1E130000 {
320305
status = "disabled";
321306

@@ -334,7 +319,8 @@
334319
pinctrl-0 = <&sdhci_pins>;
335320
pinctrl-1 = <&sdhci_pins>;
336321

337-
clocks = <&mmc_clock &mmc_clock>;
322+
clocks = <&sysc MT7621_CLK_SHXC>,
323+
<&sysc MT7621_CLK_50M>;
338324
clock-names = "source", "hclk";
339325

340326
interrupt-parent = <&gic>;
@@ -349,7 +335,7 @@
349335
0x1e1d0700 0x0100>;
350336
reg-names = "mac", "ippc";
351337

352-
clocks = <&sysclock>;
338+
clocks = <&sysc MT7621_CLK_XTAL>;
353339
clock-names = "sys_ck";
354340

355341
interrupt-parent = <&gic>;
@@ -368,7 +354,7 @@
368354
timer {
369355
compatible = "mti,gic-timer";
370356
interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
371-
clocks = <&cpuclock>;
357+
clocks = <&sysc MT7621_CLK_CPU>;
372358
};
373359
};
374360

@@ -381,6 +367,9 @@
381367
0x1e003800 0x800>;
382368
#address-cells = <1>;
383369
#size-cells = <1>;
370+
371+
clocks = <&sysc MT7621_CLK_NAND>;
372+
clock-names = "nand";
384373
};
385374

386375
ethsys: syscon@1e000000 {
@@ -394,8 +383,9 @@
394383
compatible = "mediatek,mt7621-eth";
395384
reg = <0x1e100000 0x10000>;
396385

397-
clocks = <&sysclock>;
398-
clock-names = "ethif";
386+
clocks = <&sysc MT7621_CLK_FE>,
387+
<&sysc MT7621_CLK_ETH>;
388+
clock-names = "fe", "ethif";
399389

400390
#address-cells = <1>;
401391
#size-cells = <0>;
@@ -521,7 +511,9 @@
521511

522512
resets = <&rstctrl 24 &rstctrl 25 &rstctrl 26>;
523513
reset-names = "pcie0", "pcie1", "pcie2";
524-
clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>;
514+
clocks = <&sysc MT7621_CLK_PCIE0>,
515+
<&sysc MT7621_CLK_PCIE1>,
516+
<&sysc MT7621_CLK_PCIE2>;
525517
clock-names = "pcie0", "pcie1", "pcie2";
526518
phys = <&pcie0_phy 1>, <&pcie2_phy 0>;
527519
phy-names = "pcie-phy0", "pcie-phy2";

0 commit comments

Comments
 (0)