diff options
Diffstat (limited to 'arch/arm')
93 files changed, 930 insertions, 326 deletions
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts index 1466580be295..70b1943a86b1 100644 --- a/arch/arm/boot/dts/armada-370-db.dts +++ b/arch/arm/boot/dts/armada-370-db.dts | |||
@@ -203,27 +203,3 @@ | |||
203 | compatible = "linux,spdif-dir"; | 203 | compatible = "linux,spdif-dir"; |
204 | }; | 204 | }; |
205 | }; | 205 | }; |
206 | |||
207 | &pinctrl { | ||
208 | /* | ||
209 | * These pins might be muxed as I2S by | ||
210 | * the bootloader, but it conflicts | ||
211 | * with the real I2S pins that are | ||
212 | * muxed using i2s_pins. We must mux | ||
213 | * those pins to a function other than | ||
214 | * I2S. | ||
215 | */ | ||
216 | pinctrl-0 = <&hog_pins1 &hog_pins2>; | ||
217 | pinctrl-names = "default"; | ||
218 | |||
219 | hog_pins1: hog-pins1 { | ||
220 | marvell,pins = "mpp6", "mpp8", "mpp10", | ||
221 | "mpp12", "mpp13"; | ||
222 | marvell,function = "gpio"; | ||
223 | }; | ||
224 | |||
225 | hog_pins2: hog-pins2 { | ||
226 | marvell,pins = "mpp5", "mpp7", "mpp9"; | ||
227 | marvell,function = "gpo"; | ||
228 | }; | ||
229 | }; | ||
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index 1467750e3377..e8c6c600a5b6 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -953,6 +953,8 @@ | |||
953 | interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>; | 953 | interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>; |
954 | pinctrl-names = "default"; | 954 | pinctrl-names = "default"; |
955 | pinctrl-0 = <&pinctrl_fb>; | 955 | pinctrl-0 = <&pinctrl_fb>; |
956 | clocks = <&lcd_clk>, <&lcd_clk>; | ||
957 | clock-names = "lcdc_clk", "hclk"; | ||
956 | status = "disabled"; | 958 | status = "disabled"; |
957 | }; | 959 | }; |
958 | 960 | ||
diff --git a/arch/arm/boot/dts/berlin2q-marvell-dmp.dts b/arch/arm/boot/dts/berlin2q-marvell-dmp.dts index 28e7e2060c33..a98ac1bd8f65 100644 --- a/arch/arm/boot/dts/berlin2q-marvell-dmp.dts +++ b/arch/arm/boot/dts/berlin2q-marvell-dmp.dts | |||
@@ -65,6 +65,8 @@ | |||
65 | }; | 65 | }; |
66 | 66 | ||
67 | &sdhci2 { | 67 | &sdhci2 { |
68 | broken-cd; | ||
69 | bus-width = <8>; | ||
68 | non-removable; | 70 | non-removable; |
69 | status = "okay"; | 71 | status = "okay"; |
70 | }; | 72 | }; |
diff --git a/arch/arm/boot/dts/berlin2q.dtsi b/arch/arm/boot/dts/berlin2q.dtsi index 35253c947a7c..e2f61f27944e 100644 --- a/arch/arm/boot/dts/berlin2q.dtsi +++ b/arch/arm/boot/dts/berlin2q.dtsi | |||
@@ -83,7 +83,8 @@ | |||
83 | compatible = "mrvl,pxav3-mmc"; | 83 | compatible = "mrvl,pxav3-mmc"; |
84 | reg = <0xab1000 0x200>; | 84 | reg = <0xab1000 0x200>; |
85 | interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; | 85 | interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; |
86 | clocks = <&chip CLKID_SDIO1XIN>; | 86 | clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>; |
87 | clock-names = "io", "core"; | ||
87 | status = "disabled"; | 88 | status = "disabled"; |
88 | }; | 89 | }; |
89 | 90 | ||
@@ -348,36 +349,6 @@ | |||
348 | interrupt-parent = <&gic>; | 349 | interrupt-parent = <&gic>; |
349 | interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; | 350 | interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; |
350 | }; | 351 | }; |
351 | |||
352 | gpio4: gpio@5000 { | ||
353 | compatible = "snps,dw-apb-gpio"; | ||
354 | reg = <0x5000 0x400>; | ||
355 | #address-cells = <1>; | ||
356 | #size-cells = <0>; | ||
357 | |||
358 | porte: gpio-port@4 { | ||
359 | compatible = "snps,dw-apb-gpio-port"; | ||
360 | gpio-controller; | ||
361 | #gpio-cells = <2>; | ||
362 | snps,nr-gpios = <32>; | ||
363 | reg = <0>; | ||
364 | }; | ||
365 | }; | ||
366 | |||
367 | gpio5: gpio@c000 { | ||
368 | compatible = "snps,dw-apb-gpio"; | ||
369 | reg = <0xc000 0x400>; | ||
370 | #address-cells = <1>; | ||
371 | #size-cells = <0>; | ||
372 | |||
373 | portf: gpio-port@5 { | ||
374 | compatible = "snps,dw-apb-gpio-port"; | ||
375 | gpio-controller; | ||
376 | #gpio-cells = <2>; | ||
377 | snps,nr-gpios = <32>; | ||
378 | reg = <0>; | ||
379 | }; | ||
380 | }; | ||
381 | }; | 352 | }; |
382 | 353 | ||
383 | chip: chip-control@ea0000 { | 354 | chip: chip-control@ea0000 { |
@@ -466,6 +437,21 @@ | |||
466 | ranges = <0 0xfc0000 0x10000>; | 437 | ranges = <0 0xfc0000 0x10000>; |
467 | interrupt-parent = <&sic>; | 438 | interrupt-parent = <&sic>; |
468 | 439 | ||
440 | sm_gpio1: gpio@5000 { | ||
441 | compatible = "snps,dw-apb-gpio"; | ||
442 | reg = <0x5000 0x400>; | ||
443 | #address-cells = <1>; | ||
444 | #size-cells = <0>; | ||
445 | |||
446 | portf: gpio-port@5 { | ||
447 | compatible = "snps,dw-apb-gpio-port"; | ||
448 | gpio-controller; | ||
449 | #gpio-cells = <2>; | ||
450 | snps,nr-gpios = <32>; | ||
451 | reg = <0>; | ||
452 | }; | ||
453 | }; | ||
454 | |||
469 | i2c2: i2c@7000 { | 455 | i2c2: i2c@7000 { |
470 | compatible = "snps,designware-i2c"; | 456 | compatible = "snps,designware-i2c"; |
471 | #address-cells = <1>; | 457 | #address-cells = <1>; |
@@ -516,6 +502,21 @@ | |||
516 | status = "disabled"; | 502 | status = "disabled"; |
517 | }; | 503 | }; |
518 | 504 | ||
505 | sm_gpio0: gpio@c000 { | ||
506 | compatible = "snps,dw-apb-gpio"; | ||
507 | reg = <0xc000 0x400>; | ||
508 | #address-cells = <1>; | ||
509 | #size-cells = <0>; | ||
510 | |||
511 | porte: gpio-port@4 { | ||
512 | compatible = "snps,dw-apb-gpio-port"; | ||
513 | gpio-controller; | ||
514 | #gpio-cells = <2>; | ||
515 | snps,nr-gpios = <32>; | ||
516 | reg = <0>; | ||
517 | }; | ||
518 | }; | ||
519 | |||
519 | sysctrl: pin-controller@d000 { | 520 | sysctrl: pin-controller@d000 { |
520 | compatible = "marvell,berlin2q-system-ctrl"; | 521 | compatible = "marvell,berlin2q-system-ctrl"; |
521 | reg = <0xd000 0x100>; | 522 | reg = <0xd000 0x100>; |
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts index 10b725c7bfc0..ad4118f7e1a6 100644 --- a/arch/arm/boot/dts/dra7-evm.dts +++ b/arch/arm/boot/dts/dra7-evm.dts | |||
@@ -499,23 +499,23 @@ | |||
499 | }; | 499 | }; |
500 | partition@5 { | 500 | partition@5 { |
501 | label = "QSPI.u-boot-spl-os"; | 501 | label = "QSPI.u-boot-spl-os"; |
502 | reg = <0x00140000 0x00010000>; | 502 | reg = <0x00140000 0x00080000>; |
503 | }; | 503 | }; |
504 | partition@6 { | 504 | partition@6 { |
505 | label = "QSPI.u-boot-env"; | 505 | label = "QSPI.u-boot-env"; |
506 | reg = <0x00150000 0x00010000>; | 506 | reg = <0x001c0000 0x00010000>; |
507 | }; | 507 | }; |
508 | partition@7 { | 508 | partition@7 { |
509 | label = "QSPI.u-boot-env.backup1"; | 509 | label = "QSPI.u-boot-env.backup1"; |
510 | reg = <0x00160000 0x0010000>; | 510 | reg = <0x001d0000 0x0010000>; |
511 | }; | 511 | }; |
512 | partition@8 { | 512 | partition@8 { |
513 | label = "QSPI.kernel"; | 513 | label = "QSPI.kernel"; |
514 | reg = <0x00170000 0x0800000>; | 514 | reg = <0x001e0000 0x0800000>; |
515 | }; | 515 | }; |
516 | partition@9 { | 516 | partition@9 { |
517 | label = "QSPI.file-system"; | 517 | label = "QSPI.file-system"; |
518 | reg = <0x00970000 0x01690000>; | 518 | reg = <0x009e0000 0x01620000>; |
519 | }; | 519 | }; |
520 | }; | 520 | }; |
521 | }; | 521 | }; |
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index 22771bc1643a..63f8b007bdc5 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi | |||
@@ -1257,6 +1257,8 @@ | |||
1257 | tx-fifo-resize; | 1257 | tx-fifo-resize; |
1258 | maximum-speed = "super-speed"; | 1258 | maximum-speed = "super-speed"; |
1259 | dr_mode = "otg"; | 1259 | dr_mode = "otg"; |
1260 | snps,dis_u3_susphy_quirk; | ||
1261 | snps,dis_u2_susphy_quirk; | ||
1260 | }; | 1262 | }; |
1261 | }; | 1263 | }; |
1262 | 1264 | ||
@@ -1278,6 +1280,8 @@ | |||
1278 | tx-fifo-resize; | 1280 | tx-fifo-resize; |
1279 | maximum-speed = "high-speed"; | 1281 | maximum-speed = "high-speed"; |
1280 | dr_mode = "otg"; | 1282 | dr_mode = "otg"; |
1283 | snps,dis_u3_susphy_quirk; | ||
1284 | snps,dis_u2_susphy_quirk; | ||
1281 | }; | 1285 | }; |
1282 | }; | 1286 | }; |
1283 | 1287 | ||
@@ -1299,6 +1303,8 @@ | |||
1299 | tx-fifo-resize; | 1303 | tx-fifo-resize; |
1300 | maximum-speed = "high-speed"; | 1304 | maximum-speed = "high-speed"; |
1301 | dr_mode = "otg"; | 1305 | dr_mode = "otg"; |
1306 | snps,dis_u3_susphy_quirk; | ||
1307 | snps,dis_u2_susphy_quirk; | ||
1302 | }; | 1308 | }; |
1303 | }; | 1309 | }; |
1304 | 1310 | ||
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index b8168f1f8139..cb6001085f1a 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi | |||
@@ -61,9 +61,12 @@ | |||
61 | reg = <0x03830000 0x100>; | 61 | reg = <0x03830000 0x100>; |
62 | clocks = <&clock_audss EXYNOS_I2S_BUS>; | 62 | clocks = <&clock_audss EXYNOS_I2S_BUS>; |
63 | clock-names = "iis"; | 63 | clock-names = "iis"; |
64 | #clock-cells = <1>; | ||
65 | clock-output-names = "i2s_cdclk0"; | ||
64 | dmas = <&pdma0 12>, <&pdma0 11>, <&pdma0 10>; | 66 | dmas = <&pdma0 12>, <&pdma0 11>, <&pdma0 10>; |
65 | dma-names = "tx", "rx", "tx-sec"; | 67 | dma-names = "tx", "rx", "tx-sec"; |
66 | samsung,idma-addr = <0x03000000>; | 68 | samsung,idma-addr = <0x03000000>; |
69 | #sound-dai-cells = <1>; | ||
67 | status = "disabled"; | 70 | status = "disabled"; |
68 | }; | 71 | }; |
69 | 72 | ||
@@ -368,22 +371,28 @@ | |||
368 | }; | 371 | }; |
369 | 372 | ||
370 | i2s1: i2s@13960000 { | 373 | i2s1: i2s@13960000 { |
371 | compatible = "samsung,s5pv210-i2s"; | 374 | compatible = "samsung,s3c6410-i2s"; |
372 | reg = <0x13960000 0x100>; | 375 | reg = <0x13960000 0x100>; |
373 | clocks = <&clock CLK_I2S1>; | 376 | clocks = <&clock CLK_I2S1>; |
374 | clock-names = "iis"; | 377 | clock-names = "iis"; |
378 | #clock-cells = <1>; | ||
379 | clock-output-names = "i2s_cdclk1"; | ||
375 | dmas = <&pdma1 12>, <&pdma1 11>; | 380 | dmas = <&pdma1 12>, <&pdma1 11>; |
376 | dma-names = "tx", "rx"; | 381 | dma-names = "tx", "rx"; |
382 | #sound-dai-cells = <1>; | ||
377 | status = "disabled"; | 383 | status = "disabled"; |
378 | }; | 384 | }; |
379 | 385 | ||
380 | i2s2: i2s@13970000 { | 386 | i2s2: i2s@13970000 { |
381 | compatible = "samsung,s5pv210-i2s"; | 387 | compatible = "samsung,s3c6410-i2s"; |
382 | reg = <0x13970000 0x100>; | 388 | reg = <0x13970000 0x100>; |
383 | clocks = <&clock CLK_I2S2>; | 389 | clocks = <&clock CLK_I2S2>; |
384 | clock-names = "iis"; | 390 | clock-names = "iis"; |
391 | #clock-cells = <1>; | ||
392 | clock-output-names = "i2s_cdclk2"; | ||
385 | dmas = <&pdma0 14>, <&pdma0 13>; | 393 | dmas = <&pdma0 14>, <&pdma0 13>; |
386 | dma-names = "tx", "rx"; | 394 | dma-names = "tx", "rx"; |
395 | #sound-dai-cells = <1>; | ||
387 | status = "disabled"; | 396 | status = "disabled"; |
388 | }; | 397 | }; |
389 | 398 | ||
diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index 3fbf588682b9..abd63366298a 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi | |||
@@ -7,6 +7,7 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <dt-bindings/sound/samsung-i2s.h> | ||
10 | #include <dt-bindings/input/input.h> | 11 | #include <dt-bindings/input/input.h> |
11 | #include "exynos4412.dtsi" | 12 | #include "exynos4412.dtsi" |
12 | 13 | ||
@@ -37,14 +38,13 @@ | |||
37 | pinctrl-names = "default"; | 38 | pinctrl-names = "default"; |
38 | status = "okay"; | 39 | status = "okay"; |
39 | clocks = <&clock_audss EXYNOS_I2S_BUS>, | 40 | clocks = <&clock_audss EXYNOS_I2S_BUS>, |
40 | <&clock_audss EXYNOS_DOUT_AUD_BUS>; | 41 | <&clock_audss EXYNOS_DOUT_AUD_BUS>, |
41 | clock-names = "iis", "i2s_opclk0"; | 42 | <&clock_audss EXYNOS_SCLK_I2S>; |
43 | clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; | ||
42 | }; | 44 | }; |
43 | 45 | ||
44 | sound: sound { | 46 | sound: sound { |
45 | compatible = "samsung,odroidx2-audio"; | 47 | compatible = "simple-audio-card"; |
46 | samsung,i2s-controller = <&i2s0>; | ||
47 | samsung,audio-codec = <&max98090>; | ||
48 | assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>, | 48 | assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>, |
49 | <&clock_audss EXYNOS_MOUT_I2S>, | 49 | <&clock_audss EXYNOS_MOUT_I2S>, |
50 | <&clock_audss EXYNOS_DOUT_SRP>, | 50 | <&clock_audss EXYNOS_DOUT_SRP>, |
@@ -55,6 +55,20 @@ | |||
55 | <0>, | 55 | <0>, |
56 | <192000000>, | 56 | <192000000>, |
57 | <19200000>; | 57 | <19200000>; |
58 | |||
59 | simple-audio-card,format = "i2s"; | ||
60 | simple-audio-card,bitclock-master = <&link0_codec>; | ||
61 | simple-audio-card,frame-master = <&link0_codec>; | ||
62 | |||
63 | simple-audio-card,cpu { | ||
64 | sound-dai = <&i2s0 0>; | ||
65 | system-clock-frequency = <19200000>; | ||
66 | }; | ||
67 | |||
68 | link0_codec: simple-audio-card,codec { | ||
69 | sound-dai = <&max98090>; | ||
70 | clocks = <&i2s0 CLK_I2S_CDCLK>; | ||
71 | }; | ||
58 | }; | 72 | }; |
59 | 73 | ||
60 | mmc@12550000 { | 74 | mmc@12550000 { |
@@ -373,6 +387,9 @@ | |||
373 | reg = <0x10>; | 387 | reg = <0x10>; |
374 | interrupt-parent = <&gpx0>; | 388 | interrupt-parent = <&gpx0>; |
375 | interrupts = <0 0>; | 389 | interrupts = <0 0>; |
390 | clocks = <&i2s0 CLK_I2S_CDCLK>; | ||
391 | clock-names = "mclk"; | ||
392 | #sound-dai-cells = <0>; | ||
376 | }; | 393 | }; |
377 | }; | 394 | }; |
378 | 395 | ||
diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts index c8a64be55d07..44684e57ead1 100644 --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts | |||
@@ -49,9 +49,11 @@ | |||
49 | }; | 49 | }; |
50 | 50 | ||
51 | &sound { | 51 | &sound { |
52 | compatible = "samsung,odroidu3-audio"; | 52 | simple-audio-card,name = "Odroid-U3"; |
53 | samsung,model = "Odroid-U3"; | 53 | simple-audio-card,widgets = |
54 | samsung,audio-routing = | 54 | "Headphone", "Headphone Jack", |
55 | "Speakers", "Speakers"; | ||
56 | simple-audio-card,routing = | ||
55 | "Headphone Jack", "HPL", | 57 | "Headphone Jack", "HPL", |
56 | "Headphone Jack", "HPR", | 58 | "Headphone Jack", "HPR", |
57 | "Headphone Jack", "MICBIAS", | 59 | "Headphone Jack", "MICBIAS", |
diff --git a/arch/arm/boot/dts/exynos4412-odroidx2.dts b/arch/arm/boot/dts/exynos4412-odroidx2.dts index 96b43f4497cc..6e33678562ae 100644 --- a/arch/arm/boot/dts/exynos4412-odroidx2.dts +++ b/arch/arm/boot/dts/exynos4412-odroidx2.dts | |||
@@ -23,8 +23,12 @@ | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | &sound { | 25 | &sound { |
26 | samsung,model = "Odroid-X2"; | 26 | simple-audio-card,name = "Odroid-X2"; |
27 | samsung,audio-routing = | 27 | simple-audio-card,widgets = |
28 | "Headphone", "Headphone Jack", | ||
29 | "Microphone", "Mic Jack", | ||
30 | "Microphone", "DMIC"; | ||
31 | simple-audio-card,routing = | ||
28 | "Headphone Jack", "HPL", | 32 | "Headphone Jack", "HPL", |
29 | "Headphone Jack", "HPR", | 33 | "Headphone Jack", "HPR", |
30 | "IN1", "Mic Jack", | 34 | "IN1", "Mic Jack", |
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 0a229fcd7acf..d75c89d7666a 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi | |||
@@ -736,7 +736,7 @@ | |||
736 | 736 | ||
737 | dp_phy: video-phy@10040720 { | 737 | dp_phy: video-phy@10040720 { |
738 | compatible = "samsung,exynos5250-dp-video-phy"; | 738 | compatible = "samsung,exynos5250-dp-video-phy"; |
739 | reg = <0x10040720 4>; | 739 | samsung,pmu-syscon = <&pmu_system_controller>; |
740 | #phy-cells = <0>; | 740 | #phy-cells = <0>; |
741 | }; | 741 | }; |
742 | 742 | ||
diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts index aa7a7d727a7e..db2c1c4cd900 100644 --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts | |||
@@ -372,3 +372,7 @@ | |||
372 | &usbdrd_dwc3_1 { | 372 | &usbdrd_dwc3_1 { |
373 | dr_mode = "host"; | 373 | dr_mode = "host"; |
374 | }; | 374 | }; |
375 | |||
376 | &cci { | ||
377 | status = "disabled"; | ||
378 | }; | ||
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index 517e50f6760b..6d38f8bfd0e6 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi | |||
@@ -120,7 +120,7 @@ | |||
120 | }; | 120 | }; |
121 | }; | 121 | }; |
122 | 122 | ||
123 | cci@10d20000 { | 123 | cci: cci@10d20000 { |
124 | compatible = "arm,cci-400"; | 124 | compatible = "arm,cci-400"; |
125 | #address-cells = <1>; | 125 | #address-cells = <1>; |
126 | #size-cells = <1>; | 126 | #size-cells = <1>; |
@@ -503,8 +503,8 @@ | |||
503 | }; | 503 | }; |
504 | 504 | ||
505 | dp_phy: video-phy@10040728 { | 505 | dp_phy: video-phy@10040728 { |
506 | compatible = "samsung,exynos5250-dp-video-phy"; | 506 | compatible = "samsung,exynos5420-dp-video-phy"; |
507 | reg = <0x10040728 4>; | 507 | samsung,pmu-syscon = <&pmu_system_controller>; |
508 | #phy-cells = <0>; | 508 | #phy-cells = <0>; |
509 | }; | 509 | }; |
510 | 510 | ||
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi index 58d3c3cf2923..e4d3aecc4ed2 100644 --- a/arch/arm/boot/dts/imx25.dtsi +++ b/arch/arm/boot/dts/imx25.dtsi | |||
@@ -162,7 +162,7 @@ | |||
162 | #size-cells = <0>; | 162 | #size-cells = <0>; |
163 | compatible = "fsl,imx25-cspi", "fsl,imx35-cspi"; | 163 | compatible = "fsl,imx25-cspi", "fsl,imx35-cspi"; |
164 | reg = <0x43fa4000 0x4000>; | 164 | reg = <0x43fa4000 0x4000>; |
165 | clocks = <&clks 62>, <&clks 62>; | 165 | clocks = <&clks 78>, <&clks 78>; |
166 | clock-names = "ipg", "per"; | 166 | clock-names = "ipg", "per"; |
167 | interrupts = <14>; | 167 | interrupts = <14>; |
168 | status = "disabled"; | 168 | status = "disabled"; |
@@ -369,7 +369,7 @@ | |||
369 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; | 369 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; |
370 | #pwm-cells = <2>; | 370 | #pwm-cells = <2>; |
371 | reg = <0x53fa0000 0x4000>; | 371 | reg = <0x53fa0000 0x4000>; |
372 | clocks = <&clks 106>, <&clks 36>; | 372 | clocks = <&clks 106>, <&clks 52>; |
373 | clock-names = "ipg", "per"; | 373 | clock-names = "ipg", "per"; |
374 | interrupts = <36>; | 374 | interrupts = <36>; |
375 | }; | 375 | }; |
@@ -388,7 +388,7 @@ | |||
388 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; | 388 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; |
389 | #pwm-cells = <2>; | 389 | #pwm-cells = <2>; |
390 | reg = <0x53fa8000 0x4000>; | 390 | reg = <0x53fa8000 0x4000>; |
391 | clocks = <&clks 107>, <&clks 36>; | 391 | clocks = <&clks 107>, <&clks 52>; |
392 | clock-names = "ipg", "per"; | 392 | clock-names = "ipg", "per"; |
393 | interrupts = <41>; | 393 | interrupts = <41>; |
394 | }; | 394 | }; |
@@ -429,7 +429,7 @@ | |||
429 | pwm4: pwm@53fc8000 { | 429 | pwm4: pwm@53fc8000 { |
430 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; | 430 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; |
431 | reg = <0x53fc8000 0x4000>; | 431 | reg = <0x53fc8000 0x4000>; |
432 | clocks = <&clks 108>, <&clks 36>; | 432 | clocks = <&clks 108>, <&clks 52>; |
433 | clock-names = "ipg", "per"; | 433 | clock-names = "ipg", "per"; |
434 | interrupts = <42>; | 434 | interrupts = <42>; |
435 | }; | 435 | }; |
@@ -476,7 +476,7 @@ | |||
476 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; | 476 | compatible = "fsl,imx25-pwm", "fsl,imx27-pwm"; |
477 | #pwm-cells = <2>; | 477 | #pwm-cells = <2>; |
478 | reg = <0x53fe0000 0x4000>; | 478 | reg = <0x53fe0000 0x4000>; |
479 | clocks = <&clks 105>, <&clks 36>; | 479 | clocks = <&clks 105>, <&clks 52>; |
480 | clock-names = "ipg", "per"; | 480 | clock-names = "ipg", "per"; |
481 | interrupts = <26>; | 481 | interrupts = <26>; |
482 | }; | 482 | }; |
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts index 56569cecaa78..649befeb2cf9 100644 --- a/arch/arm/boot/dts/imx51-babbage.dts +++ b/arch/arm/boot/dts/imx51-babbage.dts | |||
@@ -127,24 +127,12 @@ | |||
127 | #address-cells = <1>; | 127 | #address-cells = <1>; |
128 | #size-cells = <0>; | 128 | #size-cells = <0>; |
129 | 129 | ||
130 | reg_usbh1_vbus: regulator@0 { | 130 | reg_hub_reset: regulator@0 { |
131 | compatible = "regulator-fixed"; | ||
132 | pinctrl-names = "default"; | ||
133 | pinctrl-0 = <&pinctrl_usbh1reg>; | ||
134 | reg = <0>; | ||
135 | regulator-name = "usbh1_vbus"; | ||
136 | regulator-min-microvolt = <5000000>; | ||
137 | regulator-max-microvolt = <5000000>; | ||
138 | gpio = <&gpio2 5 GPIO_ACTIVE_HIGH>; | ||
139 | enable-active-high; | ||
140 | }; | ||
141 | |||
142 | reg_usbotg_vbus: regulator@1 { | ||
143 | compatible = "regulator-fixed"; | 131 | compatible = "regulator-fixed"; |
144 | pinctrl-names = "default"; | 132 | pinctrl-names = "default"; |
145 | pinctrl-0 = <&pinctrl_usbotgreg>; | 133 | pinctrl-0 = <&pinctrl_usbotgreg>; |
146 | reg = <1>; | 134 | reg = <0>; |
147 | regulator-name = "usbotg_vbus"; | 135 | regulator-name = "hub_reset"; |
148 | regulator-min-microvolt = <5000000>; | 136 | regulator-min-microvolt = <5000000>; |
149 | regulator-max-microvolt = <5000000>; | 137 | regulator-max-microvolt = <5000000>; |
150 | gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; | 138 | gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; |
@@ -176,6 +164,7 @@ | |||
176 | reg = <0>; | 164 | reg = <0>; |
177 | clocks = <&clks IMX5_CLK_DUMMY>; | 165 | clocks = <&clks IMX5_CLK_DUMMY>; |
178 | clock-names = "main_clk"; | 166 | clock-names = "main_clk"; |
167 | reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; | ||
179 | }; | 168 | }; |
180 | }; | 169 | }; |
181 | }; | 170 | }; |
@@ -419,7 +408,7 @@ | |||
419 | &usbh1 { | 408 | &usbh1 { |
420 | pinctrl-names = "default"; | 409 | pinctrl-names = "default"; |
421 | pinctrl-0 = <&pinctrl_usbh1>; | 410 | pinctrl-0 = <&pinctrl_usbh1>; |
422 | vbus-supply = <®_usbh1_vbus>; | 411 | vbus-supply = <®_hub_reset>; |
423 | fsl,usbphy = <&usbh1phy>; | 412 | fsl,usbphy = <&usbh1phy>; |
424 | phy_type = "ulpi"; | 413 | phy_type = "ulpi"; |
425 | status = "okay"; | 414 | status = "okay"; |
@@ -429,7 +418,6 @@ | |||
429 | dr_mode = "otg"; | 418 | dr_mode = "otg"; |
430 | disable-over-current; | 419 | disable-over-current; |
431 | phy_type = "utmi_wide"; | 420 | phy_type = "utmi_wide"; |
432 | vbus-supply = <®_usbotg_vbus>; | ||
433 | status = "okay"; | 421 | status = "okay"; |
434 | }; | 422 | }; |
435 | 423 | ||
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 4fc03b7f1cee..2109d0763c1b 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi | |||
@@ -335,8 +335,8 @@ | |||
335 | vpu: vpu@02040000 { | 335 | vpu: vpu@02040000 { |
336 | compatible = "cnm,coda960"; | 336 | compatible = "cnm,coda960"; |
337 | reg = <0x02040000 0x3c000>; | 337 | reg = <0x02040000 0x3c000>; |
338 | interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>, | 338 | interrupts = <0 12 IRQ_TYPE_LEVEL_HIGH>, |
339 | <0 12 IRQ_TYPE_LEVEL_HIGH>; | 339 | <0 3 IRQ_TYPE_LEVEL_HIGH>; |
340 | interrupt-names = "bit", "jpeg"; | 340 | interrupt-names = "bit", "jpeg"; |
341 | clocks = <&clks IMX6QDL_CLK_VPU_AXI>, | 341 | clocks = <&clks IMX6QDL_CLK_VPU_AXI>, |
342 | <&clks IMX6QDL_CLK_MMDC_CH0_AXI>, | 342 | <&clks IMX6QDL_CLK_MMDC_CH0_AXI>, |
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts index 1e6e5cc1c14c..c108bb451337 100644 --- a/arch/arm/boot/dts/imx6sx-sdb.dts +++ b/arch/arm/boot/dts/imx6sx-sdb.dts | |||
@@ -159,13 +159,28 @@ | |||
159 | pinctrl-0 = <&pinctrl_enet1>; | 159 | pinctrl-0 = <&pinctrl_enet1>; |
160 | phy-supply = <®_enet_3v3>; | 160 | phy-supply = <®_enet_3v3>; |
161 | phy-mode = "rgmii"; | 161 | phy-mode = "rgmii"; |
162 | phy-handle = <ðphy1>; | ||
162 | status = "okay"; | 163 | status = "okay"; |
164 | |||
165 | mdio { | ||
166 | #address-cells = <1>; | ||
167 | #size-cells = <0>; | ||
168 | |||
169 | ethphy1: ethernet-phy@1 { | ||
170 | reg = <1>; | ||
171 | }; | ||
172 | |||
173 | ethphy2: ethernet-phy@2 { | ||
174 | reg = <2>; | ||
175 | }; | ||
176 | }; | ||
163 | }; | 177 | }; |
164 | 178 | ||
165 | &fec2 { | 179 | &fec2 { |
166 | pinctrl-names = "default"; | 180 | pinctrl-names = "default"; |
167 | pinctrl-0 = <&pinctrl_enet2>; | 181 | pinctrl-0 = <&pinctrl_enet2>; |
168 | phy-mode = "rgmii"; | 182 | phy-mode = "rgmii"; |
183 | phy-handle = <ðphy2>; | ||
169 | status = "okay"; | 184 | status = "okay"; |
170 | }; | 185 | }; |
171 | 186 | ||
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi index 657da14cb4b5..c70bb27ac65a 100644 --- a/arch/arm/boot/dts/ls1021a.dtsi +++ b/arch/arm/boot/dts/ls1021a.dtsi | |||
@@ -142,6 +142,7 @@ | |||
142 | scfg: scfg@1570000 { | 142 | scfg: scfg@1570000 { |
143 | compatible = "fsl,ls1021a-scfg", "syscon"; | 143 | compatible = "fsl,ls1021a-scfg", "syscon"; |
144 | reg = <0x0 0x1570000 0x0 0x10000>; | 144 | reg = <0x0 0x1570000 0x0 0x10000>; |
145 | big-endian; | ||
145 | }; | 146 | }; |
146 | 147 | ||
147 | clockgen: clocking@1ee1000 { | 148 | clockgen: clocking@1ee1000 { |
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 53f3ca064140..b550c41b46f1 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts | |||
@@ -700,11 +700,9 @@ | |||
700 | }; | 700 | }; |
701 | }; | 701 | }; |
702 | 702 | ||
703 | /* Ethernet is on some early development boards and qemu */ | ||
703 | ethernet@gpmc { | 704 | ethernet@gpmc { |
704 | compatible = "smsc,lan91c94"; | 705 | compatible = "smsc,lan91c94"; |
705 | |||
706 | status = "disabled"; | ||
707 | |||
708 | interrupt-parent = <&gpio2>; | 706 | interrupt-parent = <&gpio2>; |
709 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */ | 707 | interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */ |
710 | reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */ | 708 | reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */ |
diff --git a/arch/arm/boot/dts/rk3288-evb.dtsi b/arch/arm/boot/dts/rk3288-evb.dtsi index 3e067dd65d0c..6194d673e80b 100644 --- a/arch/arm/boot/dts/rk3288-evb.dtsi +++ b/arch/arm/boot/dts/rk3288-evb.dtsi | |||
@@ -155,6 +155,15 @@ | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | &pinctrl { | 157 | &pinctrl { |
158 | pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma { | ||
159 | drive-strength = <8>; | ||
160 | }; | ||
161 | |||
162 | pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma { | ||
163 | bias-pull-up; | ||
164 | drive-strength = <8>; | ||
165 | }; | ||
166 | |||
158 | backlight { | 167 | backlight { |
159 | bl_en: bl-en { | 168 | bl_en: bl-en { |
160 | rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>; | 169 | rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>; |
@@ -173,6 +182,27 @@ | |||
173 | }; | 182 | }; |
174 | }; | 183 | }; |
175 | 184 | ||
185 | sdmmc { | ||
186 | /* | ||
187 | * Default drive strength isn't enough to achieve even | ||
188 | * high-speed mode on EVB board so bump up to 8ma. | ||
189 | */ | ||
190 | sdmmc_bus4: sdmmc-bus4 { | ||
191 | rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>, | ||
192 | <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>, | ||
193 | <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>, | ||
194 | <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>; | ||
195 | }; | ||
196 | |||
197 | sdmmc_clk: sdmmc-clk { | ||
198 | rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>; | ||
199 | }; | ||
200 | |||
201 | sdmmc_cmd: sdmmc-cmd { | ||
202 | rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>; | ||
203 | }; | ||
204 | }; | ||
205 | |||
176 | usb { | 206 | usb { |
177 | host_vbus_drv: host-vbus-drv { | 207 | host_vbus_drv: host-vbus-drv { |
178 | rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>; | 208 | rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>; |
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 49c10d33df30..77e03655aca3 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi | |||
@@ -176,7 +176,7 @@ | |||
176 | "Headphone Jack", "HPOUTR", | 176 | "Headphone Jack", "HPOUTR", |
177 | "IN2L", "Line In Jack", | 177 | "IN2L", "Line In Jack", |
178 | "IN2R", "Line In Jack", | 178 | "IN2R", "Line In Jack", |
179 | "MICBIAS", "IN1L", | 179 | "Mic", "MICBIAS", |
180 | "IN1L", "Mic"; | 180 | "IN1L", "Mic"; |
181 | 181 | ||
182 | atmel,ssc-controller = <&ssc0>; | 182 | atmel,ssc-controller = <&ssc0>; |
diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 1b0f30c2c4a5..b94995d1889f 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi | |||
@@ -1008,7 +1008,7 @@ | |||
1008 | 1008 | ||
1009 | pit: timer@fc068630 { | 1009 | pit: timer@fc068630 { |
1010 | compatible = "atmel,at91sam9260-pit"; | 1010 | compatible = "atmel,at91sam9260-pit"; |
1011 | reg = <0xfc068630 0xf>; | 1011 | reg = <0xfc068630 0x10>; |
1012 | interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>; | 1012 | interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>; |
1013 | clocks = <&h32ck>; | 1013 | clocks = <&h32ck>; |
1014 | }; | 1014 | }; |
diff --git a/arch/arm/boot/dts/ste-nomadik-nhk15.dts b/arch/arm/boot/dts/ste-nomadik-nhk15.dts index a8c00ee7522a..3d0b8755caee 100644 --- a/arch/arm/boot/dts/ste-nomadik-nhk15.dts +++ b/arch/arm/boot/dts/ste-nomadik-nhk15.dts | |||
@@ -25,11 +25,11 @@ | |||
25 | stmpe2401_1 { | 25 | stmpe2401_1 { |
26 | stmpe2401_1_nhk_mode: stmpe2401_1_nhk { | 26 | stmpe2401_1_nhk_mode: stmpe2401_1_nhk { |
27 | nhk_cfg1 { | 27 | nhk_cfg1 { |
28 | ste,pins = "GPIO76_B20"; // IRQ line | 28 | pins = "GPIO76_B20"; // IRQ line |
29 | ste,input = <0>; | 29 | ste,input = <0>; |
30 | }; | 30 | }; |
31 | nhk_cfg2 { | 31 | nhk_cfg2 { |
32 | ste,pins = "GPIO77_B8"; // reset line | 32 | pins = "GPIO77_B8"; // reset line |
33 | ste,output = <1>; | 33 | ste,output = <1>; |
34 | }; | 34 | }; |
35 | }; | 35 | }; |
@@ -37,11 +37,11 @@ | |||
37 | stmpe2401_2 { | 37 | stmpe2401_2 { |
38 | stmpe2401_2_nhk_mode: stmpe2401_2_nhk { | 38 | stmpe2401_2_nhk_mode: stmpe2401_2_nhk { |
39 | nhk_cfg1 { | 39 | nhk_cfg1 { |
40 | ste,pins = "GPIO78_A8"; // IRQ line | 40 | pins = "GPIO78_A8"; // IRQ line |
41 | ste,input = <0>; | 41 | ste,input = <0>; |
42 | }; | 42 | }; |
43 | nhk_cfg2 { | 43 | nhk_cfg2 { |
44 | ste,pins = "GPIO79_C9"; // reset line | 44 | pins = "GPIO79_C9"; // reset line |
45 | ste,output = <1>; | 45 | ste,output = <1>; |
46 | }; | 46 | }; |
47 | }; | 47 | }; |
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index 7b4099fcf817..d5c4669224b1 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi | |||
@@ -17,14 +17,6 @@ | |||
17 | 17 | ||
18 | aliases { | 18 | aliases { |
19 | ethernet0 = &emac; | 19 | ethernet0 = &emac; |
20 | serial0 = &uart0; | ||
21 | serial1 = &uart1; | ||
22 | serial2 = &uart2; | ||
23 | serial3 = &uart3; | ||
24 | serial4 = &uart4; | ||
25 | serial5 = &uart5; | ||
26 | serial6 = &uart6; | ||
27 | serial7 = &uart7; | ||
28 | }; | 20 | }; |
29 | 21 | ||
30 | chosen { | 22 | chosen { |
@@ -39,6 +31,14 @@ | |||
39 | <&ahb_gates 44>; | 31 | <&ahb_gates 44>; |
40 | status = "disabled"; | 32 | status = "disabled"; |
41 | }; | 33 | }; |
34 | |||
35 | framebuffer@1 { | ||
36 | compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; | ||
37 | allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; | ||
38 | clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, | ||
39 | <&ahb_gates 44>, <&ahb_gates 46>; | ||
40 | status = "disabled"; | ||
41 | }; | ||
42 | }; | 42 | }; |
43 | 43 | ||
44 | cpus { | 44 | cpus { |
@@ -438,8 +438,8 @@ | |||
438 | reg-names = "phy_ctrl", "pmu1", "pmu2"; | 438 | reg-names = "phy_ctrl", "pmu1", "pmu2"; |
439 | clocks = <&usb_clk 8>; | 439 | clocks = <&usb_clk 8>; |
440 | clock-names = "usb_phy"; | 440 | clock-names = "usb_phy"; |
441 | resets = <&usb_clk 1>, <&usb_clk 2>; | 441 | resets = <&usb_clk 0>, <&usb_clk 1>, <&usb_clk 2>; |
442 | reset-names = "usb1_reset", "usb2_reset"; | 442 | reset-names = "usb0_reset", "usb1_reset", "usb2_reset"; |
443 | status = "disabled"; | 443 | status = "disabled"; |
444 | }; | 444 | }; |
445 | 445 | ||
diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts index fe3c559ca6a8..bfa742817690 100644 --- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | |||
@@ -55,6 +55,12 @@ | |||
55 | model = "Olimex A10s-Olinuxino Micro"; | 55 | model = "Olimex A10s-Olinuxino Micro"; |
56 | compatible = "olimex,a10s-olinuxino-micro", "allwinner,sun5i-a10s"; | 56 | compatible = "olimex,a10s-olinuxino-micro", "allwinner,sun5i-a10s"; |
57 | 57 | ||
58 | aliases { | ||
59 | serial0 = &uart0; | ||
60 | serial1 = &uart2; | ||
61 | serial2 = &uart3; | ||
62 | }; | ||
63 | |||
58 | soc@01c00000 { | 64 | soc@01c00000 { |
59 | emac: ethernet@01c0b000 { | 65 | emac: ethernet@01c0b000 { |
60 | pinctrl-names = "default"; | 66 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi index 1b76667f3182..2e7d8263799d 100644 --- a/arch/arm/boot/dts/sun5i-a10s.dtsi +++ b/arch/arm/boot/dts/sun5i-a10s.dtsi | |||
@@ -18,10 +18,6 @@ | |||
18 | 18 | ||
19 | aliases { | 19 | aliases { |
20 | ethernet0 = &emac; | 20 | ethernet0 = &emac; |
21 | serial0 = &uart0; | ||
22 | serial1 = &uart1; | ||
23 | serial2 = &uart2; | ||
24 | serial3 = &uart3; | ||
25 | }; | 21 | }; |
26 | 22 | ||
27 | chosen { | 23 | chosen { |
@@ -390,8 +386,8 @@ | |||
390 | reg-names = "phy_ctrl", "pmu1"; | 386 | reg-names = "phy_ctrl", "pmu1"; |
391 | clocks = <&usb_clk 8>; | 387 | clocks = <&usb_clk 8>; |
392 | clock-names = "usb_phy"; | 388 | clock-names = "usb_phy"; |
393 | resets = <&usb_clk 1>; | 389 | resets = <&usb_clk 0>, <&usb_clk 1>; |
394 | reset-names = "usb1_reset"; | 390 | reset-names = "usb0_reset", "usb1_reset"; |
395 | status = "disabled"; | 391 | status = "disabled"; |
396 | }; | 392 | }; |
397 | 393 | ||
diff --git a/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts b/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts index eeed1f236ee8..c7be3abd9fcc 100644 --- a/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts +++ b/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts | |||
@@ -53,6 +53,10 @@ | |||
53 | model = "HSG H702"; | 53 | model = "HSG H702"; |
54 | compatible = "hsg,h702", "allwinner,sun5i-a13"; | 54 | compatible = "hsg,h702", "allwinner,sun5i-a13"; |
55 | 55 | ||
56 | aliases { | ||
57 | serial0 = &uart1; | ||
58 | }; | ||
59 | |||
56 | soc@01c00000 { | 60 | soc@01c00000 { |
57 | mmc0: mmc@01c0f000 { | 61 | mmc0: mmc@01c0f000 { |
58 | pinctrl-names = "default"; | 62 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts index 916ee8bb826f..3decefb3c37a 100644 --- a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts | |||
@@ -54,6 +54,10 @@ | |||
54 | model = "Olimex A13-Olinuxino Micro"; | 54 | model = "Olimex A13-Olinuxino Micro"; |
55 | compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13"; | 55 | compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13"; |
56 | 56 | ||
57 | aliases { | ||
58 | serial0 = &uart1; | ||
59 | }; | ||
60 | |||
57 | soc@01c00000 { | 61 | soc@01c00000 { |
58 | mmc0: mmc@01c0f000 { | 62 | mmc0: mmc@01c0f000 { |
59 | pinctrl-names = "default"; | 63 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts index e31d291d14cb..b421f7fa197b 100644 --- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts | |||
@@ -55,6 +55,10 @@ | |||
55 | model = "Olimex A13-Olinuxino"; | 55 | model = "Olimex A13-Olinuxino"; |
56 | compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13"; | 56 | compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13"; |
57 | 57 | ||
58 | aliases { | ||
59 | serial0 = &uart1; | ||
60 | }; | ||
61 | |||
58 | soc@01c00000 { | 62 | soc@01c00000 { |
59 | mmc0: mmc@01c0f000 { | 63 | mmc0: mmc@01c0f000 { |
60 | pinctrl-names = "default"; | 64 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi index c35217ea1f64..c556688f8b8b 100644 --- a/arch/arm/boot/dts/sun5i-a13.dtsi +++ b/arch/arm/boot/dts/sun5i-a13.dtsi | |||
@@ -16,11 +16,6 @@ | |||
16 | / { | 16 | / { |
17 | interrupt-parent = <&intc>; | 17 | interrupt-parent = <&intc>; |
18 | 18 | ||
19 | aliases { | ||
20 | serial0 = &uart1; | ||
21 | serial1 = &uart3; | ||
22 | }; | ||
23 | |||
24 | cpus { | 19 | cpus { |
25 | #address-cells = <1>; | 20 | #address-cells = <1>; |
26 | #size-cells = <0>; | 21 | #size-cells = <0>; |
@@ -349,8 +344,8 @@ | |||
349 | reg-names = "phy_ctrl", "pmu1"; | 344 | reg-names = "phy_ctrl", "pmu1"; |
350 | clocks = <&usb_clk 8>; | 345 | clocks = <&usb_clk 8>; |
351 | clock-names = "usb_phy"; | 346 | clock-names = "usb_phy"; |
352 | resets = <&usb_clk 1>; | 347 | resets = <&usb_clk 0>, <&usb_clk 1>; |
353 | reset-names = "usb1_reset"; | 348 | reset-names = "usb0_reset", "usb1_reset"; |
354 | status = "disabled"; | 349 | status = "disabled"; |
355 | }; | 350 | }; |
356 | 351 | ||
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi index f47156b6572b..1e7e7bcf8307 100644 --- a/arch/arm/boot/dts/sun6i-a31.dtsi +++ b/arch/arm/boot/dts/sun6i-a31.dtsi | |||
@@ -53,12 +53,6 @@ | |||
53 | interrupt-parent = <&gic>; | 53 | interrupt-parent = <&gic>; |
54 | 54 | ||
55 | aliases { | 55 | aliases { |
56 | serial0 = &uart0; | ||
57 | serial1 = &uart1; | ||
58 | serial2 = &uart2; | ||
59 | serial3 = &uart3; | ||
60 | serial4 = &uart4; | ||
61 | serial5 = &uart5; | ||
62 | ethernet0 = &gmac; | 56 | ethernet0 = &gmac; |
63 | }; | 57 | }; |
64 | 58 | ||
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts index 1cf1214cc068..bd7b15add697 100644 --- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts +++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts | |||
@@ -55,6 +55,12 @@ | |||
55 | model = "LeMaker Banana Pi"; | 55 | model = "LeMaker Banana Pi"; |
56 | compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; | 56 | compatible = "lemaker,bananapi", "allwinner,sun7i-a20"; |
57 | 57 | ||
58 | aliases { | ||
59 | serial0 = &uart0; | ||
60 | serial1 = &uart3; | ||
61 | serial2 = &uart7; | ||
62 | }; | ||
63 | |||
58 | soc@01c00000 { | 64 | soc@01c00000 { |
59 | spi0: spi@01c05000 { | 65 | spi0: spi@01c05000 { |
60 | pinctrl-names = "default"; | 66 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun7i-a20-hummingbird.dts b/arch/arm/boot/dts/sun7i-a20-hummingbird.dts index 0e4bfa3b2b85..0bcefcbbb756 100644 --- a/arch/arm/boot/dts/sun7i-a20-hummingbird.dts +++ b/arch/arm/boot/dts/sun7i-a20-hummingbird.dts | |||
@@ -19,6 +19,14 @@ | |||
19 | model = "Merrii A20 Hummingbird"; | 19 | model = "Merrii A20 Hummingbird"; |
20 | compatible = "merrii,a20-hummingbird", "allwinner,sun7i-a20"; | 20 | compatible = "merrii,a20-hummingbird", "allwinner,sun7i-a20"; |
21 | 21 | ||
22 | aliases { | ||
23 | serial0 = &uart0; | ||
24 | serial1 = &uart2; | ||
25 | serial2 = &uart3; | ||
26 | serial3 = &uart4; | ||
27 | serial4 = &uart5; | ||
28 | }; | ||
29 | |||
22 | soc@01c00000 { | 30 | soc@01c00000 { |
23 | mmc0: mmc@01c0f000 { | 31 | mmc0: mmc@01c0f000 { |
24 | pinctrl-names = "default"; | 32 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts index 9d669cdf031d..66cc77707198 100644 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | |||
@@ -20,6 +20,9 @@ | |||
20 | compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20"; | 20 | compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20"; |
21 | 21 | ||
22 | aliases { | 22 | aliases { |
23 | serial0 = &uart0; | ||
24 | serial1 = &uart6; | ||
25 | serial2 = &uart7; | ||
23 | spi0 = &spi1; | 26 | spi0 = &spi1; |
24 | spi1 = &spi2; | 27 | spi1 = &spi2; |
25 | }; | 28 | }; |
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index e21ce5992d56..89749ce34a84 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
@@ -54,14 +54,6 @@ | |||
54 | 54 | ||
55 | aliases { | 55 | aliases { |
56 | ethernet0 = &gmac; | 56 | ethernet0 = &gmac; |
57 | serial0 = &uart0; | ||
58 | serial1 = &uart1; | ||
59 | serial2 = &uart2; | ||
60 | serial3 = &uart3; | ||
61 | serial4 = &uart4; | ||
62 | serial5 = &uart5; | ||
63 | serial6 = &uart6; | ||
64 | serial7 = &uart7; | ||
65 | }; | 57 | }; |
66 | 58 | ||
67 | chosen { | 59 | chosen { |
diff --git a/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts b/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts index 7f2117ce6985..32ad80804dbb 100644 --- a/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts +++ b/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts | |||
@@ -55,6 +55,10 @@ | |||
55 | model = "Ippo Q8H Dual Core Tablet (v5)"; | 55 | model = "Ippo Q8H Dual Core Tablet (v5)"; |
56 | compatible = "ippo,q8h-v5", "allwinner,sun8i-a23"; | 56 | compatible = "ippo,q8h-v5", "allwinner,sun8i-a23"; |
57 | 57 | ||
58 | aliases { | ||
59 | serial0 = &r_uart; | ||
60 | }; | ||
61 | |||
58 | chosen { | 62 | chosen { |
59 | bootargs = "earlyprintk console=ttyS0,115200"; | 63 | bootargs = "earlyprintk console=ttyS0,115200"; |
60 | }; | 64 | }; |
diff --git a/arch/arm/boot/dts/sun8i-a23.dtsi b/arch/arm/boot/dts/sun8i-a23.dtsi index 0746cd1024d7..86584fcf5e32 100644 --- a/arch/arm/boot/dts/sun8i-a23.dtsi +++ b/arch/arm/boot/dts/sun8i-a23.dtsi | |||
@@ -52,15 +52,6 @@ | |||
52 | / { | 52 | / { |
53 | interrupt-parent = <&gic>; | 53 | interrupt-parent = <&gic>; |
54 | 54 | ||
55 | aliases { | ||
56 | serial0 = &uart0; | ||
57 | serial1 = &uart1; | ||
58 | serial2 = &uart2; | ||
59 | serial3 = &uart3; | ||
60 | serial4 = &uart4; | ||
61 | serial5 = &r_uart; | ||
62 | }; | ||
63 | |||
64 | cpus { | 55 | cpus { |
65 | #address-cells = <1>; | 56 | #address-cells = <1>; |
66 | #size-cells = <0>; | 57 | #size-cells = <0>; |
diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts index 506948f582ee..11ec71072e81 100644 --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts | |||
@@ -54,6 +54,11 @@ | |||
54 | model = "Merrii A80 Optimus Board"; | 54 | model = "Merrii A80 Optimus Board"; |
55 | compatible = "merrii,a80-optimus", "allwinner,sun9i-a80"; | 55 | compatible = "merrii,a80-optimus", "allwinner,sun9i-a80"; |
56 | 56 | ||
57 | aliases { | ||
58 | serial0 = &uart0; | ||
59 | serial1 = &uart4; | ||
60 | }; | ||
61 | |||
57 | chosen { | 62 | chosen { |
58 | bootargs = "earlyprintk console=ttyS0,115200"; | 63 | bootargs = "earlyprintk console=ttyS0,115200"; |
59 | }; | 64 | }; |
diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi index 494714f67b57..9ef4438206a9 100644 --- a/arch/arm/boot/dts/sun9i-a80.dtsi +++ b/arch/arm/boot/dts/sun9i-a80.dtsi | |||
@@ -52,16 +52,6 @@ | |||
52 | / { | 52 | / { |
53 | interrupt-parent = <&gic>; | 53 | interrupt-parent = <&gic>; |
54 | 54 | ||
55 | aliases { | ||
56 | serial0 = &uart0; | ||
57 | serial1 = &uart1; | ||
58 | serial2 = &uart2; | ||
59 | serial3 = &uart3; | ||
60 | serial4 = &uart4; | ||
61 | serial5 = &uart5; | ||
62 | serial6 = &r_uart; | ||
63 | }; | ||
64 | |||
65 | cpus { | 55 | cpus { |
66 | #address-cells = <1>; | 56 | #address-cells = <1>; |
67 | #size-cells = <0>; | 57 | #size-cells = <0>; |
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts index ea282c7c0ca5..e2fed2712249 100644 --- a/arch/arm/boot/dts/tegra20-seaboard.dts +++ b/arch/arm/boot/dts/tegra20-seaboard.dts | |||
@@ -406,7 +406,7 @@ | |||
406 | clock-frequency = <400000>; | 406 | clock-frequency = <400000>; |
407 | 407 | ||
408 | magnetometer@c { | 408 | magnetometer@c { |
409 | compatible = "ak,ak8975"; | 409 | compatible = "asahi-kasei,ak8975"; |
410 | reg = <0xc>; | 410 | reg = <0xc>; |
411 | interrupt-parent = <&gpio>; | 411 | interrupt-parent = <&gpio>; |
412 | interrupts = <TEGRA_GPIO(N, 5) IRQ_TYPE_LEVEL_HIGH>; | 412 | interrupts = <TEGRA_GPIO(N, 5) IRQ_TYPE_LEVEL_HIGH>; |
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts index a0f762159cb2..f2b64b1b00fa 100644 --- a/arch/arm/boot/dts/vf610-twr.dts +++ b/arch/arm/boot/dts/vf610-twr.dts | |||
@@ -129,13 +129,28 @@ | |||
129 | 129 | ||
130 | &fec0 { | 130 | &fec0 { |
131 | phy-mode = "rmii"; | 131 | phy-mode = "rmii"; |
132 | phy-handle = <ðphy0>; | ||
132 | pinctrl-names = "default"; | 133 | pinctrl-names = "default"; |
133 | pinctrl-0 = <&pinctrl_fec0>; | 134 | pinctrl-0 = <&pinctrl_fec0>; |
134 | status = "okay"; | 135 | status = "okay"; |
136 | |||
137 | mdio { | ||
138 | #address-cells = <1>; | ||
139 | #size-cells = <0>; | ||
140 | |||
141 | ethphy0: ethernet-phy@0 { | ||
142 | reg = <0>; | ||
143 | }; | ||
144 | |||
145 | ethphy1: ethernet-phy@1 { | ||
146 | reg = <1>; | ||
147 | }; | ||
148 | }; | ||
135 | }; | 149 | }; |
136 | 150 | ||
137 | &fec1 { | 151 | &fec1 { |
138 | phy-mode = "rmii"; | 152 | phy-mode = "rmii"; |
153 | phy-handle = <ðphy1>; | ||
139 | pinctrl-names = "default"; | 154 | pinctrl-names = "default"; |
140 | pinctrl-0 = <&pinctrl_fec1>; | 155 | pinctrl-0 = <&pinctrl_fec1>; |
141 | status = "okay"; | 156 | status = "okay"; |
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig index 5ef14de00a29..3d0c5d65c741 100644 --- a/arch/arm/configs/exynos_defconfig +++ b/arch/arm/configs/exynos_defconfig | |||
@@ -84,7 +84,8 @@ CONFIG_DEBUG_GPIO=y | |||
84 | CONFIG_POWER_SUPPLY=y | 84 | CONFIG_POWER_SUPPLY=y |
85 | CONFIG_BATTERY_SBS=y | 85 | CONFIG_BATTERY_SBS=y |
86 | CONFIG_CHARGER_TPS65090=y | 86 | CONFIG_CHARGER_TPS65090=y |
87 | # CONFIG_HWMON is not set | 87 | CONFIG_HWMON=y |
88 | CONFIG_SENSORS_LM90=y | ||
88 | CONFIG_THERMAL=y | 89 | CONFIG_THERMAL=y |
89 | CONFIG_EXYNOS_THERMAL=y | 90 | CONFIG_EXYNOS_THERMAL=y |
90 | CONFIG_EXYNOS_THERMAL_CORE=y | 91 | CONFIG_EXYNOS_THERMAL_CORE=y |
@@ -109,11 +110,26 @@ CONFIG_REGULATOR_S2MPA01=y | |||
109 | CONFIG_REGULATOR_S2MPS11=y | 110 | CONFIG_REGULATOR_S2MPS11=y |
110 | CONFIG_REGULATOR_S5M8767=y | 111 | CONFIG_REGULATOR_S5M8767=y |
111 | CONFIG_REGULATOR_TPS65090=y | 112 | CONFIG_REGULATOR_TPS65090=y |
113 | CONFIG_DRM=y | ||
114 | CONFIG_DRM_BRIDGE=y | ||
115 | CONFIG_DRM_PTN3460=y | ||
116 | CONFIG_DRM_PS8622=y | ||
117 | CONFIG_DRM_EXYNOS=y | ||
118 | CONFIG_DRM_EXYNOS_FIMD=y | ||
119 | CONFIG_DRM_EXYNOS_DP=y | ||
120 | CONFIG_DRM_PANEL=y | ||
121 | CONFIG_DRM_PANEL_SIMPLE=y | ||
112 | CONFIG_FB=y | 122 | CONFIG_FB=y |
113 | CONFIG_FB_MODE_HELPERS=y | 123 | CONFIG_FB_MODE_HELPERS=y |
114 | CONFIG_FB_SIMPLE=y | 124 | CONFIG_FB_SIMPLE=y |
115 | CONFIG_EXYNOS_VIDEO=y | 125 | CONFIG_EXYNOS_VIDEO=y |
116 | CONFIG_EXYNOS_MIPI_DSI=y | 126 | CONFIG_EXYNOS_MIPI_DSI=y |
127 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
128 | CONFIG_LCD_CLASS_DEVICE=y | ||
129 | CONFIG_LCD_PLATFORM=y | ||
130 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
131 | CONFIG_BACKLIGHT_GENERIC=y | ||
132 | CONFIG_BACKLIGHT_PWM=y | ||
117 | CONFIG_FRAMEBUFFER_CONSOLE=y | 133 | CONFIG_FRAMEBUFFER_CONSOLE=y |
118 | CONFIG_FONTS=y | 134 | CONFIG_FONTS=y |
119 | CONFIG_FONT_7x14=y | 135 | CONFIG_FONT_7x14=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 2328fe752e9c..bc393b7e5ece 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -338,6 +338,7 @@ CONFIG_USB=y | |||
338 | CONFIG_USB_XHCI_HCD=y | 338 | CONFIG_USB_XHCI_HCD=y |
339 | CONFIG_USB_XHCI_MVEBU=y | 339 | CONFIG_USB_XHCI_MVEBU=y |
340 | CONFIG_USB_EHCI_HCD=y | 340 | CONFIG_USB_EHCI_HCD=y |
341 | CONFIG_USB_EHCI_EXYNOS=y | ||
341 | CONFIG_USB_EHCI_TEGRA=y | 342 | CONFIG_USB_EHCI_TEGRA=y |
342 | CONFIG_USB_EHCI_HCD_STI=y | 343 | CONFIG_USB_EHCI_HCD_STI=y |
343 | CONFIG_USB_EHCI_HCD_PLATFORM=y | 344 | CONFIG_USB_EHCI_HCD_PLATFORM=y |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index c2c3a852af9f..667d9d52aa01 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -68,7 +68,7 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y | |||
68 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y | 68 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y |
69 | CONFIG_CPU_FREQ_GOV_USERSPACE=y | 69 | CONFIG_CPU_FREQ_GOV_USERSPACE=y |
70 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y | 70 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y |
71 | CONFIG_GENERIC_CPUFREQ_CPU0=y | 71 | CONFIG_CPUFREQ_DT=y |
72 | # CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set | 72 | # CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set |
73 | CONFIG_CPU_IDLE=y | 73 | CONFIG_CPU_IDLE=y |
74 | CONFIG_BINFMT_MISC=y | 74 | CONFIG_BINFMT_MISC=y |
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 66ce17655bb9..7b0152321b20 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h | |||
@@ -38,6 +38,16 @@ static inline void vcpu_reset_hcr(struct kvm_vcpu *vcpu) | |||
38 | vcpu->arch.hcr = HCR_GUEST_MASK; | 38 | vcpu->arch.hcr = HCR_GUEST_MASK; |
39 | } | 39 | } |
40 | 40 | ||
41 | static inline unsigned long vcpu_get_hcr(struct kvm_vcpu *vcpu) | ||
42 | { | ||
43 | return vcpu->arch.hcr; | ||
44 | } | ||
45 | |||
46 | static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr) | ||
47 | { | ||
48 | vcpu->arch.hcr = hcr; | ||
49 | } | ||
50 | |||
41 | static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu) | 51 | static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu) |
42 | { | 52 | { |
43 | return 1; | 53 | return 1; |
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 254e0650e48b..04b4ea0b550a 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h | |||
@@ -125,9 +125,6 @@ struct kvm_vcpu_arch { | |||
125 | * Anything that is not used directly from assembly code goes | 125 | * Anything that is not used directly from assembly code goes |
126 | * here. | 126 | * here. |
127 | */ | 127 | */ |
128 | /* dcache set/way operation pending */ | ||
129 | int last_pcpu; | ||
130 | cpumask_t require_dcache_flush; | ||
131 | 128 | ||
132 | /* Don't run the guest on this vcpu */ | 129 | /* Don't run the guest on this vcpu */ |
133 | bool pause; | 130 | bool pause; |
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 63e0ecc04901..1bca8f8af442 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
46 | 46 | ||
47 | #include <linux/highmem.h> | ||
47 | #include <asm/cacheflush.h> | 48 | #include <asm/cacheflush.h> |
48 | #include <asm/pgalloc.h> | 49 | #include <asm/pgalloc.h> |
49 | 50 | ||
@@ -161,13 +162,10 @@ static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) | |||
161 | return (vcpu->arch.cp15[c1_SCTLR] & 0b101) == 0b101; | 162 | return (vcpu->arch.cp15[c1_SCTLR] & 0b101) == 0b101; |
162 | } | 163 | } |
163 | 164 | ||
164 | static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, | 165 | static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu, pfn_t pfn, |
165 | unsigned long size, | 166 | unsigned long size, |
166 | bool ipa_uncached) | 167 | bool ipa_uncached) |
167 | { | 168 | { |
168 | if (!vcpu_has_cache_enabled(vcpu) || ipa_uncached) | ||
169 | kvm_flush_dcache_to_poc((void *)hva, size); | ||
170 | |||
171 | /* | 169 | /* |
172 | * If we are going to insert an instruction page and the icache is | 170 | * If we are going to insert an instruction page and the icache is |
173 | * either VIPT or PIPT, there is a potential problem where the host | 171 | * either VIPT or PIPT, there is a potential problem where the host |
@@ -179,18 +177,77 @@ static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, | |||
179 | * | 177 | * |
180 | * VIVT caches are tagged using both the ASID and the VMID and doesn't | 178 | * VIVT caches are tagged using both the ASID and the VMID and doesn't |
181 | * need any kind of flushing (DDI 0406C.b - Page B3-1392). | 179 | * need any kind of flushing (DDI 0406C.b - Page B3-1392). |
180 | * | ||
181 | * We need to do this through a kernel mapping (using the | ||
182 | * user-space mapping has proved to be the wrong | ||
183 | * solution). For that, we need to kmap one page at a time, | ||
184 | * and iterate over the range. | ||
182 | */ | 185 | */ |
183 | if (icache_is_pipt()) { | 186 | |
184 | __cpuc_coherent_user_range(hva, hva + size); | 187 | bool need_flush = !vcpu_has_cache_enabled(vcpu) || ipa_uncached; |
185 | } else if (!icache_is_vivt_asid_tagged()) { | 188 | |
189 | VM_BUG_ON(size & PAGE_MASK); | ||
190 | |||
191 | if (!need_flush && !icache_is_pipt()) | ||
192 | goto vipt_cache; | ||
193 | |||
194 | while (size) { | ||
195 | void *va = kmap_atomic_pfn(pfn); | ||
196 | |||
197 | if (need_flush) | ||
198 | kvm_flush_dcache_to_poc(va, PAGE_SIZE); | ||
199 | |||
200 | if (icache_is_pipt()) | ||
201 | __cpuc_coherent_user_range((unsigned long)va, | ||
202 | (unsigned long)va + PAGE_SIZE); | ||
203 | |||
204 | size -= PAGE_SIZE; | ||
205 | pfn++; | ||
206 | |||
207 | kunmap_atomic(va); | ||
208 | } | ||
209 | |||
210 | vipt_cache: | ||
211 | if (!icache_is_pipt() && !icache_is_vivt_asid_tagged()) { | ||
186 | /* any kind of VIPT cache */ | 212 | /* any kind of VIPT cache */ |
187 | __flush_icache_all(); | 213 | __flush_icache_all(); |
188 | } | 214 | } |
189 | } | 215 | } |
190 | 216 | ||
217 | static inline void __kvm_flush_dcache_pte(pte_t pte) | ||
218 | { | ||
219 | void *va = kmap_atomic(pte_page(pte)); | ||
220 | |||
221 | kvm_flush_dcache_to_poc(va, PAGE_SIZE); | ||
222 | |||
223 | kunmap_atomic(va); | ||
224 | } | ||
225 | |||
226 | static inline void __kvm_flush_dcache_pmd(pmd_t pmd) | ||
227 | { | ||
228 | unsigned long size = PMD_SIZE; | ||
229 | pfn_t pfn = pmd_pfn(pmd); | ||
230 | |||
231 | while (size) { | ||
232 | void *va = kmap_atomic_pfn(pfn); | ||
233 | |||
234 | kvm_flush_dcache_to_poc(va, PAGE_SIZE); | ||
235 | |||
236 | pfn++; | ||
237 | size -= PAGE_SIZE; | ||
238 | |||
239 | kunmap_atomic(va); | ||
240 | } | ||
241 | } | ||
242 | |||
243 | static inline void __kvm_flush_dcache_pud(pud_t pud) | ||
244 | { | ||
245 | } | ||
246 | |||
191 | #define kvm_virt_to_phys(x) virt_to_idmap((unsigned long)(x)) | 247 | #define kvm_virt_to_phys(x) virt_to_idmap((unsigned long)(x)) |
192 | 248 | ||
193 | void stage2_flush_vm(struct kvm *kvm); | 249 | void kvm_set_way_flush(struct kvm_vcpu *vcpu); |
250 | void kvm_toggle_cache(struct kvm_vcpu *vcpu, bool was_enabled); | ||
194 | 251 | ||
195 | #endif /* !__ASSEMBLY__ */ | 252 | #endif /* !__ASSEMBLY__ */ |
196 | 253 | ||
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h index 705bb7620673..0c3f5a0dafd3 100644 --- a/arch/arm/include/uapi/asm/unistd.h +++ b/arch/arm/include/uapi/asm/unistd.h | |||
@@ -413,6 +413,7 @@ | |||
413 | #define __NR_getrandom (__NR_SYSCALL_BASE+384) | 413 | #define __NR_getrandom (__NR_SYSCALL_BASE+384) |
414 | #define __NR_memfd_create (__NR_SYSCALL_BASE+385) | 414 | #define __NR_memfd_create (__NR_SYSCALL_BASE+385) |
415 | #define __NR_bpf (__NR_SYSCALL_BASE+386) | 415 | #define __NR_bpf (__NR_SYSCALL_BASE+386) |
416 | #define __NR_execveat (__NR_SYSCALL_BASE+387) | ||
416 | 417 | ||
417 | /* | 418 | /* |
418 | * The following SWIs are ARM private. | 419 | * The following SWIs are ARM private. |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index e51833f8cc38..05745eb838c5 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -396,6 +396,7 @@ | |||
396 | CALL(sys_getrandom) | 396 | CALL(sys_getrandom) |
397 | /* 385 */ CALL(sys_memfd_create) | 397 | /* 385 */ CALL(sys_memfd_create) |
398 | CALL(sys_bpf) | 398 | CALL(sys_bpf) |
399 | CALL(sys_execveat) | ||
399 | #ifndef syscalls_counted | 400 | #ifndef syscalls_counted |
400 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 401 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
401 | #define syscalls_counted | 402 | #define syscalls_counted |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 4176df721bf0..1a0045abead7 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -253,21 +253,22 @@ | |||
253 | .endm | 253 | .endm |
254 | 254 | ||
255 | .macro restore_user_regs, fast = 0, offset = 0 | 255 | .macro restore_user_regs, fast = 0, offset = 0 |
256 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr | 256 | mov r2, sp |
257 | ldr lr, [sp, #\offset + S_PC]! @ get pc | 257 | ldr r1, [r2, #\offset + S_PSR] @ get calling cpsr |
258 | ldr lr, [r2, #\offset + S_PC]! @ get pc | ||
258 | msr spsr_cxsf, r1 @ save in spsr_svc | 259 | msr spsr_cxsf, r1 @ save in spsr_svc |
259 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) | 260 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) |
260 | @ We must avoid clrex due to Cortex-A15 erratum #830321 | 261 | @ We must avoid clrex due to Cortex-A15 erratum #830321 |
261 | strex r1, r2, [sp] @ clear the exclusive monitor | 262 | strex r1, r2, [r2] @ clear the exclusive monitor |
262 | #endif | 263 | #endif |
263 | .if \fast | 264 | .if \fast |
264 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | 265 | ldmdb r2, {r1 - lr}^ @ get calling r1 - lr |
265 | .else | 266 | .else |
266 | ldmdb sp, {r0 - lr}^ @ get calling r0 - lr | 267 | ldmdb r2, {r0 - lr}^ @ get calling r0 - lr |
267 | .endif | 268 | .endif |
268 | mov r0, r0 @ ARMv5T and earlier require a nop | 269 | mov r0, r0 @ ARMv5T and earlier require a nop |
269 | @ after ldm {}^ | 270 | @ after ldm {}^ |
270 | add sp, sp, #S_FRAME_SIZE - S_PC | 271 | add sp, sp, #\offset + S_FRAME_SIZE |
271 | movs pc, lr @ return & move spsr_svc into cpsr | 272 | movs pc, lr @ return & move spsr_svc into cpsr |
272 | .endm | 273 | .endm |
273 | 274 | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index f7c65adaa428..557e128e4df0 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -116,8 +116,14 @@ int armpmu_event_set_period(struct perf_event *event) | |||
116 | ret = 1; | 116 | ret = 1; |
117 | } | 117 | } |
118 | 118 | ||
119 | if (left > (s64)armpmu->max_period) | 119 | /* |
120 | left = armpmu->max_period; | 120 | * Limit the maximum period to prevent the counter value |
121 | * from overtaking the one we are about to program. In | ||
122 | * effect we are reducing max_period to account for | ||
123 | * interrupt latency (and we are being very conservative). | ||
124 | */ | ||
125 | if (left > (armpmu->max_period >> 1)) | ||
126 | left = armpmu->max_period >> 1; | ||
121 | 127 | ||
122 | local64_set(&hwc->prev_count, (u64)-left); | 128 | local64_set(&hwc->prev_count, (u64)-left); |
123 | 129 | ||
diff --git a/arch/arm/kernel/perf_regs.c b/arch/arm/kernel/perf_regs.c index 6e4379c67cbc..592dda3f21ff 100644 --- a/arch/arm/kernel/perf_regs.c +++ b/arch/arm/kernel/perf_regs.c | |||
@@ -28,3 +28,11 @@ u64 perf_reg_abi(struct task_struct *task) | |||
28 | { | 28 | { |
29 | return PERF_SAMPLE_REGS_ABI_32; | 29 | return PERF_SAMPLE_REGS_ABI_32; |
30 | } | 30 | } |
31 | |||
32 | void perf_get_regs_user(struct perf_regs *regs_user, | ||
33 | struct pt_regs *regs, | ||
34 | struct pt_regs *regs_user_copy) | ||
35 | { | ||
36 | regs_user->regs = task_pt_regs(current); | ||
37 | regs_user->abi = perf_reg_abi(current); | ||
38 | } | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index f9c863911038..e55408e96559 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -657,10 +657,13 @@ int __init arm_add_memory(u64 start, u64 size) | |||
657 | 657 | ||
658 | /* | 658 | /* |
659 | * Ensure that start/size are aligned to a page boundary. | 659 | * Ensure that start/size are aligned to a page boundary. |
660 | * Size is appropriately rounded down, start is rounded up. | 660 | * Size is rounded down, start is rounded up. |
661 | */ | 661 | */ |
662 | size -= start & ~PAGE_MASK; | ||
663 | aligned_start = PAGE_ALIGN(start); | 662 | aligned_start = PAGE_ALIGN(start); |
663 | if (aligned_start > start + size) | ||
664 | size = 0; | ||
665 | else | ||
666 | size -= aligned_start - start; | ||
664 | 667 | ||
665 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT | 668 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT |
666 | if (aligned_start > ULONG_MAX) { | 669 | if (aligned_start > ULONG_MAX) { |
@@ -1046,6 +1049,15 @@ static int c_show(struct seq_file *m, void *v) | |||
1046 | seq_printf(m, "model name\t: %s rev %d (%s)\n", | 1049 | seq_printf(m, "model name\t: %s rev %d (%s)\n", |
1047 | cpu_name, cpuid & 15, elf_platform); | 1050 | cpu_name, cpuid & 15, elf_platform); |
1048 | 1051 | ||
1052 | #if defined(CONFIG_SMP) | ||
1053 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | ||
1054 | per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), | ||
1055 | (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); | ||
1056 | #else | ||
1057 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", | ||
1058 | loops_per_jiffy / (500000/HZ), | ||
1059 | (loops_per_jiffy / (5000/HZ)) % 100); | ||
1060 | #endif | ||
1049 | /* dump out the processor features */ | 1061 | /* dump out the processor features */ |
1050 | seq_puts(m, "Features\t: "); | 1062 | seq_puts(m, "Features\t: "); |
1051 | 1063 | ||
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 5e6052e18850..86ef244c5a24 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -387,6 +387,18 @@ asmlinkage void secondary_start_kernel(void) | |||
387 | 387 | ||
388 | void __init smp_cpus_done(unsigned int max_cpus) | 388 | void __init smp_cpus_done(unsigned int max_cpus) |
389 | { | 389 | { |
390 | int cpu; | ||
391 | unsigned long bogosum = 0; | ||
392 | |||
393 | for_each_online_cpu(cpu) | ||
394 | bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; | ||
395 | |||
396 | printk(KERN_INFO "SMP: Total of %d processors activated " | ||
397 | "(%lu.%02lu BogoMIPS).\n", | ||
398 | num_online_cpus(), | ||
399 | bogosum / (500000/HZ), | ||
400 | (bogosum / (5000/HZ)) % 100); | ||
401 | |||
390 | hyp_mode_check(); | 402 | hyp_mode_check(); |
391 | } | 403 | } |
392 | 404 | ||
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 2d6d91001062..0b0d58a905c4 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -281,15 +281,6 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
281 | vcpu->cpu = cpu; | 281 | vcpu->cpu = cpu; |
282 | vcpu->arch.host_cpu_context = this_cpu_ptr(kvm_host_cpu_state); | 282 | vcpu->arch.host_cpu_context = this_cpu_ptr(kvm_host_cpu_state); |
283 | 283 | ||
284 | /* | ||
285 | * Check whether this vcpu requires the cache to be flushed on | ||
286 | * this physical CPU. This is a consequence of doing dcache | ||
287 | * operations by set/way on this vcpu. We do it here to be in | ||
288 | * a non-preemptible section. | ||
289 | */ | ||
290 | if (cpumask_test_and_clear_cpu(cpu, &vcpu->arch.require_dcache_flush)) | ||
291 | flush_cache_all(); /* We'd really want v7_flush_dcache_all() */ | ||
292 | |||
293 | kvm_arm_set_running_vcpu(vcpu); | 284 | kvm_arm_set_running_vcpu(vcpu); |
294 | } | 285 | } |
295 | 286 | ||
@@ -541,7 +532,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
541 | ret = kvm_call_hyp(__kvm_vcpu_run, vcpu); | 532 | ret = kvm_call_hyp(__kvm_vcpu_run, vcpu); |
542 | 533 | ||
543 | vcpu->mode = OUTSIDE_GUEST_MODE; | 534 | vcpu->mode = OUTSIDE_GUEST_MODE; |
544 | vcpu->arch.last_pcpu = smp_processor_id(); | ||
545 | kvm_guest_exit(); | 535 | kvm_guest_exit(); |
546 | trace_kvm_exit(*vcpu_pc(vcpu)); | 536 | trace_kvm_exit(*vcpu_pc(vcpu)); |
547 | /* | 537 | /* |
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 7928dbdf2102..f3d88dc388bc 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c | |||
@@ -189,82 +189,40 @@ static bool access_l2ectlr(struct kvm_vcpu *vcpu, | |||
189 | return true; | 189 | return true; |
190 | } | 190 | } |
191 | 191 | ||
192 | /* See note at ARM ARM B1.14.4 */ | 192 | /* |
193 | * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized). | ||
194 | */ | ||
193 | static bool access_dcsw(struct kvm_vcpu *vcpu, | 195 | static bool access_dcsw(struct kvm_vcpu *vcpu, |
194 | const struct coproc_params *p, | 196 | const struct coproc_params *p, |
195 | const struct coproc_reg *r) | 197 | const struct coproc_reg *r) |
196 | { | 198 | { |
197 | unsigned long val; | ||
198 | int cpu; | ||
199 | |||
200 | if (!p->is_write) | 199 | if (!p->is_write) |
201 | return read_from_write_only(vcpu, p); | 200 | return read_from_write_only(vcpu, p); |
202 | 201 | ||
203 | cpu = get_cpu(); | 202 | kvm_set_way_flush(vcpu); |
204 | |||
205 | cpumask_setall(&vcpu->arch.require_dcache_flush); | ||
206 | cpumask_clear_cpu(cpu, &vcpu->arch.require_dcache_flush); | ||
207 | |||
208 | /* If we were already preempted, take the long way around */ | ||
209 | if (cpu != vcpu->arch.last_pcpu) { | ||
210 | flush_cache_all(); | ||
211 | goto done; | ||
212 | } | ||
213 | |||
214 | val = *vcpu_reg(vcpu, p->Rt1); | ||
215 | |||
216 | switch (p->CRm) { | ||
217 | case 6: /* Upgrade DCISW to DCCISW, as per HCR.SWIO */ | ||
218 | case 14: /* DCCISW */ | ||
219 | asm volatile("mcr p15, 0, %0, c7, c14, 2" : : "r" (val)); | ||
220 | break; | ||
221 | |||
222 | case 10: /* DCCSW */ | ||
223 | asm volatile("mcr p15, 0, %0, c7, c10, 2" : : "r" (val)); | ||
224 | break; | ||
225 | } | ||
226 | |||
227 | done: | ||
228 | put_cpu(); | ||
229 | |||
230 | return true; | 203 | return true; |
231 | } | 204 | } |
232 | 205 | ||
233 | /* | 206 | /* |
234 | * Generic accessor for VM registers. Only called as long as HCR_TVM | 207 | * Generic accessor for VM registers. Only called as long as HCR_TVM |
235 | * is set. | 208 | * is set. If the guest enables the MMU, we stop trapping the VM |
209 | * sys_regs and leave it in complete control of the caches. | ||
210 | * | ||
211 | * Used by the cpu-specific code. | ||
236 | */ | 212 | */ |
237 | static bool access_vm_reg(struct kvm_vcpu *vcpu, | 213 | bool access_vm_reg(struct kvm_vcpu *vcpu, |
238 | const struct coproc_params *p, | 214 | const struct coproc_params *p, |
239 | const struct coproc_reg *r) | 215 | const struct coproc_reg *r) |
240 | { | 216 | { |
217 | bool was_enabled = vcpu_has_cache_enabled(vcpu); | ||
218 | |||
241 | BUG_ON(!p->is_write); | 219 | BUG_ON(!p->is_write); |
242 | 220 | ||
243 | vcpu->arch.cp15[r->reg] = *vcpu_reg(vcpu, p->Rt1); | 221 | vcpu->arch.cp15[r->reg] = *vcpu_reg(vcpu, p->Rt1); |
244 | if (p->is_64bit) | 222 | if (p->is_64bit) |
245 | vcpu->arch.cp15[r->reg + 1] = *vcpu_reg(vcpu, p->Rt2); | 223 | vcpu->arch.cp15[r->reg + 1] = *vcpu_reg(vcpu, p->Rt2); |
246 | 224 | ||
247 | return true; | 225 | kvm_toggle_cache(vcpu, was_enabled); |
248 | } | ||
249 | |||
250 | /* | ||
251 | * SCTLR accessor. Only called as long as HCR_TVM is set. If the | ||
252 | * guest enables the MMU, we stop trapping the VM sys_regs and leave | ||
253 | * it in complete control of the caches. | ||
254 | * | ||
255 | * Used by the cpu-specific code. | ||
256 | */ | ||
257 | bool access_sctlr(struct kvm_vcpu *vcpu, | ||
258 | const struct coproc_params *p, | ||
259 | const struct coproc_reg *r) | ||
260 | { | ||
261 | access_vm_reg(vcpu, p, r); | ||
262 | |||
263 | if (vcpu_has_cache_enabled(vcpu)) { /* MMU+Caches enabled? */ | ||
264 | vcpu->arch.hcr &= ~HCR_TVM; | ||
265 | stage2_flush_vm(vcpu->kvm); | ||
266 | } | ||
267 | |||
268 | return true; | 226 | return true; |
269 | } | 227 | } |
270 | 228 | ||
diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h index 1a44bbe39643..88d24a3a9778 100644 --- a/arch/arm/kvm/coproc.h +++ b/arch/arm/kvm/coproc.h | |||
@@ -153,8 +153,8 @@ static inline int cmp_reg(const struct coproc_reg *i1, | |||
153 | #define is64 .is_64 = true | 153 | #define is64 .is_64 = true |
154 | #define is32 .is_64 = false | 154 | #define is32 .is_64 = false |
155 | 155 | ||
156 | bool access_sctlr(struct kvm_vcpu *vcpu, | 156 | bool access_vm_reg(struct kvm_vcpu *vcpu, |
157 | const struct coproc_params *p, | 157 | const struct coproc_params *p, |
158 | const struct coproc_reg *r); | 158 | const struct coproc_reg *r); |
159 | 159 | ||
160 | #endif /* __ARM_KVM_COPROC_LOCAL_H__ */ | 160 | #endif /* __ARM_KVM_COPROC_LOCAL_H__ */ |
diff --git a/arch/arm/kvm/coproc_a15.c b/arch/arm/kvm/coproc_a15.c index e6f4ae48bda9..a7136757d373 100644 --- a/arch/arm/kvm/coproc_a15.c +++ b/arch/arm/kvm/coproc_a15.c | |||
@@ -34,7 +34,7 @@ | |||
34 | static const struct coproc_reg a15_regs[] = { | 34 | static const struct coproc_reg a15_regs[] = { |
35 | /* SCTLR: swapped by interrupt.S. */ | 35 | /* SCTLR: swapped by interrupt.S. */ |
36 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, | 36 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, |
37 | access_sctlr, reset_val, c1_SCTLR, 0x00C50078 }, | 37 | access_vm_reg, reset_val, c1_SCTLR, 0x00C50078 }, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static struct kvm_coproc_target_table a15_target_table = { | 40 | static struct kvm_coproc_target_table a15_target_table = { |
diff --git a/arch/arm/kvm/coproc_a7.c b/arch/arm/kvm/coproc_a7.c index 17fc7cd479d3..b19e46d1b2c0 100644 --- a/arch/arm/kvm/coproc_a7.c +++ b/arch/arm/kvm/coproc_a7.c | |||
@@ -37,7 +37,7 @@ | |||
37 | static const struct coproc_reg a7_regs[] = { | 37 | static const struct coproc_reg a7_regs[] = { |
38 | /* SCTLR: swapped by interrupt.S. */ | 38 | /* SCTLR: swapped by interrupt.S. */ |
39 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, | 39 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, |
40 | access_sctlr, reset_val, c1_SCTLR, 0x00C50878 }, | 40 | access_vm_reg, reset_val, c1_SCTLR, 0x00C50878 }, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | static struct kvm_coproc_target_table a7_target_table = { | 43 | static struct kvm_coproc_target_table a7_target_table = { |
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 1dc9778a00af..136662547ca6 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c | |||
@@ -58,6 +58,26 @@ static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) | |||
58 | kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa); | 58 | kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa); |
59 | } | 59 | } |
60 | 60 | ||
61 | /* | ||
62 | * D-Cache management functions. They take the page table entries by | ||
63 | * value, as they are flushing the cache using the kernel mapping (or | ||
64 | * kmap on 32bit). | ||
65 | */ | ||
66 | static void kvm_flush_dcache_pte(pte_t pte) | ||
67 | { | ||
68 | __kvm_flush_dcache_pte(pte); | ||
69 | } | ||
70 | |||
71 | static void kvm_flush_dcache_pmd(pmd_t pmd) | ||
72 | { | ||
73 | __kvm_flush_dcache_pmd(pmd); | ||
74 | } | ||
75 | |||
76 | static void kvm_flush_dcache_pud(pud_t pud) | ||
77 | { | ||
78 | __kvm_flush_dcache_pud(pud); | ||
79 | } | ||
80 | |||
61 | static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache, | 81 | static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache, |
62 | int min, int max) | 82 | int min, int max) |
63 | { | 83 | { |
@@ -119,6 +139,26 @@ static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr) | |||
119 | put_page(virt_to_page(pmd)); | 139 | put_page(virt_to_page(pmd)); |
120 | } | 140 | } |
121 | 141 | ||
142 | /* | ||
143 | * Unmapping vs dcache management: | ||
144 | * | ||
145 | * If a guest maps certain memory pages as uncached, all writes will | ||
146 | * bypass the data cache and go directly to RAM. However, the CPUs | ||
147 | * can still speculate reads (not writes) and fill cache lines with | ||
148 | * data. | ||
149 | * | ||
150 | * Those cache lines will be *clean* cache lines though, so a | ||
151 | * clean+invalidate operation is equivalent to an invalidate | ||
152 | * operation, because no cache lines are marked dirty. | ||
153 | * | ||
154 | * Those clean cache lines could be filled prior to an uncached write | ||
155 | * by the guest, and the cache coherent IO subsystem would therefore | ||
156 | * end up writing old data to disk. | ||
157 | * | ||
158 | * This is why right after unmapping a page/section and invalidating | ||
159 | * the corresponding TLBs, we call kvm_flush_dcache_p*() to make sure | ||
160 | * the IO subsystem will never hit in the cache. | ||
161 | */ | ||
122 | static void unmap_ptes(struct kvm *kvm, pmd_t *pmd, | 162 | static void unmap_ptes(struct kvm *kvm, pmd_t *pmd, |
123 | phys_addr_t addr, phys_addr_t end) | 163 | phys_addr_t addr, phys_addr_t end) |
124 | { | 164 | { |
@@ -128,9 +168,16 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd, | |||
128 | start_pte = pte = pte_offset_kernel(pmd, addr); | 168 | start_pte = pte = pte_offset_kernel(pmd, addr); |
129 | do { | 169 | do { |
130 | if (!pte_none(*pte)) { | 170 | if (!pte_none(*pte)) { |
171 | pte_t old_pte = *pte; | ||
172 | |||
131 | kvm_set_pte(pte, __pte(0)); | 173 | kvm_set_pte(pte, __pte(0)); |
132 | put_page(virt_to_page(pte)); | ||
133 | kvm_tlb_flush_vmid_ipa(kvm, addr); | 174 | kvm_tlb_flush_vmid_ipa(kvm, addr); |
175 | |||
176 | /* No need to invalidate the cache for device mappings */ | ||
177 | if ((pte_val(old_pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE) | ||
178 | kvm_flush_dcache_pte(old_pte); | ||
179 | |||
180 | put_page(virt_to_page(pte)); | ||
134 | } | 181 | } |
135 | } while (pte++, addr += PAGE_SIZE, addr != end); | 182 | } while (pte++, addr += PAGE_SIZE, addr != end); |
136 | 183 | ||
@@ -149,8 +196,13 @@ static void unmap_pmds(struct kvm *kvm, pud_t *pud, | |||
149 | next = kvm_pmd_addr_end(addr, end); | 196 | next = kvm_pmd_addr_end(addr, end); |
150 | if (!pmd_none(*pmd)) { | 197 | if (!pmd_none(*pmd)) { |
151 | if (kvm_pmd_huge(*pmd)) { | 198 | if (kvm_pmd_huge(*pmd)) { |
199 | pmd_t old_pmd = *pmd; | ||
200 | |||
152 | pmd_clear(pmd); | 201 | pmd_clear(pmd); |
153 | kvm_tlb_flush_vmid_ipa(kvm, addr); | 202 | kvm_tlb_flush_vmid_ipa(kvm, addr); |
203 | |||
204 | kvm_flush_dcache_pmd(old_pmd); | ||
205 | |||
154 | put_page(virt_to_page(pmd)); | 206 | put_page(virt_to_page(pmd)); |
155 | } else { | 207 | } else { |
156 | unmap_ptes(kvm, pmd, addr, next); | 208 | unmap_ptes(kvm, pmd, addr, next); |
@@ -173,8 +225,13 @@ static void unmap_puds(struct kvm *kvm, pgd_t *pgd, | |||
173 | next = kvm_pud_addr_end(addr, end); | 225 | next = kvm_pud_addr_end(addr, end); |
174 | if (!pud_none(*pud)) { | 226 | if (!pud_none(*pud)) { |
175 | if (pud_huge(*pud)) { | 227 | if (pud_huge(*pud)) { |
228 | pud_t old_pud = *pud; | ||
229 | |||
176 | pud_clear(pud); | 230 | pud_clear(pud); |
177 | kvm_tlb_flush_vmid_ipa(kvm, addr); | 231 | kvm_tlb_flush_vmid_ipa(kvm, addr); |
232 | |||
233 | kvm_flush_dcache_pud(old_pud); | ||
234 | |||
178 | put_page(virt_to_page(pud)); | 235 | put_page(virt_to_page(pud)); |
179 | } else { | 236 | } else { |
180 | unmap_pmds(kvm, pud, addr, next); | 237 | unmap_pmds(kvm, pud, addr, next); |
@@ -209,10 +266,9 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd, | |||
209 | 266 | ||
210 | pte = pte_offset_kernel(pmd, addr); | 267 | pte = pte_offset_kernel(pmd, addr); |
211 | do { | 268 | do { |
212 | if (!pte_none(*pte)) { | 269 | if (!pte_none(*pte) && |
213 | hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT); | 270 | (pte_val(*pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE) |
214 | kvm_flush_dcache_to_poc((void*)hva, PAGE_SIZE); | 271 | kvm_flush_dcache_pte(*pte); |
215 | } | ||
216 | } while (pte++, addr += PAGE_SIZE, addr != end); | 272 | } while (pte++, addr += PAGE_SIZE, addr != end); |
217 | } | 273 | } |
218 | 274 | ||
@@ -226,12 +282,10 @@ static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud, | |||
226 | do { | 282 | do { |
227 | next = kvm_pmd_addr_end(addr, end); | 283 | next = kvm_pmd_addr_end(addr, end); |
228 | if (!pmd_none(*pmd)) { | 284 | if (!pmd_none(*pmd)) { |
229 | if (kvm_pmd_huge(*pmd)) { | 285 | if (kvm_pmd_huge(*pmd)) |
230 | hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT); | 286 | kvm_flush_dcache_pmd(*pmd); |
231 | kvm_flush_dcache_to_poc((void*)hva, PMD_SIZE); | 287 | else |
232 | } else { | ||
233 | stage2_flush_ptes(kvm, pmd, addr, next); | 288 | stage2_flush_ptes(kvm, pmd, addr, next); |
234 | } | ||
235 | } | 289 | } |
236 | } while (pmd++, addr = next, addr != end); | 290 | } while (pmd++, addr = next, addr != end); |
237 | } | 291 | } |
@@ -246,12 +300,10 @@ static void stage2_flush_puds(struct kvm *kvm, pgd_t *pgd, | |||
246 | do { | 300 | do { |
247 | next = kvm_pud_addr_end(addr, end); | 301 | next = kvm_pud_addr_end(addr, end); |
248 | if (!pud_none(*pud)) { | 302 | if (!pud_none(*pud)) { |
249 | if (pud_huge(*pud)) { | 303 | if (pud_huge(*pud)) |
250 | hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT); | 304 | kvm_flush_dcache_pud(*pud); |
251 | kvm_flush_dcache_to_poc((void*)hva, PUD_SIZE); | 305 | else |
252 | } else { | ||
253 | stage2_flush_pmds(kvm, pud, addr, next); | 306 | stage2_flush_pmds(kvm, pud, addr, next); |
254 | } | ||
255 | } | 307 | } |
256 | } while (pud++, addr = next, addr != end); | 308 | } while (pud++, addr = next, addr != end); |
257 | } | 309 | } |
@@ -278,7 +330,7 @@ static void stage2_flush_memslot(struct kvm *kvm, | |||
278 | * Go through the stage 2 page tables and invalidate any cache lines | 330 | * Go through the stage 2 page tables and invalidate any cache lines |
279 | * backing memory already mapped to the VM. | 331 | * backing memory already mapped to the VM. |
280 | */ | 332 | */ |
281 | void stage2_flush_vm(struct kvm *kvm) | 333 | static void stage2_flush_vm(struct kvm *kvm) |
282 | { | 334 | { |
283 | struct kvm_memslots *slots; | 335 | struct kvm_memslots *slots; |
284 | struct kvm_memory_slot *memslot; | 336 | struct kvm_memory_slot *memslot; |
@@ -905,6 +957,12 @@ static bool kvm_is_device_pfn(unsigned long pfn) | |||
905 | return !pfn_valid(pfn); | 957 | return !pfn_valid(pfn); |
906 | } | 958 | } |
907 | 959 | ||
960 | static void coherent_cache_guest_page(struct kvm_vcpu *vcpu, pfn_t pfn, | ||
961 | unsigned long size, bool uncached) | ||
962 | { | ||
963 | __coherent_cache_guest_page(vcpu, pfn, size, uncached); | ||
964 | } | ||
965 | |||
908 | static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | 966 | static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, |
909 | struct kvm_memory_slot *memslot, unsigned long hva, | 967 | struct kvm_memory_slot *memslot, unsigned long hva, |
910 | unsigned long fault_status) | 968 | unsigned long fault_status) |
@@ -994,8 +1052,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | |||
994 | kvm_set_s2pmd_writable(&new_pmd); | 1052 | kvm_set_s2pmd_writable(&new_pmd); |
995 | kvm_set_pfn_dirty(pfn); | 1053 | kvm_set_pfn_dirty(pfn); |
996 | } | 1054 | } |
997 | coherent_cache_guest_page(vcpu, hva & PMD_MASK, PMD_SIZE, | 1055 | coherent_cache_guest_page(vcpu, pfn, PMD_SIZE, fault_ipa_uncached); |
998 | fault_ipa_uncached); | ||
999 | ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd); | 1056 | ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd); |
1000 | } else { | 1057 | } else { |
1001 | pte_t new_pte = pfn_pte(pfn, mem_type); | 1058 | pte_t new_pte = pfn_pte(pfn, mem_type); |
@@ -1003,8 +1060,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, | |||
1003 | kvm_set_s2pte_writable(&new_pte); | 1060 | kvm_set_s2pte_writable(&new_pte); |
1004 | kvm_set_pfn_dirty(pfn); | 1061 | kvm_set_pfn_dirty(pfn); |
1005 | } | 1062 | } |
1006 | coherent_cache_guest_page(vcpu, hva, PAGE_SIZE, | 1063 | coherent_cache_guest_page(vcpu, pfn, PAGE_SIZE, fault_ipa_uncached); |
1007 | fault_ipa_uncached); | ||
1008 | ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, | 1064 | ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, |
1009 | pgprot_val(mem_type) == pgprot_val(PAGE_S2_DEVICE)); | 1065 | pgprot_val(mem_type) == pgprot_val(PAGE_S2_DEVICE)); |
1010 | } | 1066 | } |
@@ -1411,3 +1467,71 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, | |||
1411 | unmap_stage2_range(kvm, gpa, size); | 1467 | unmap_stage2_range(kvm, gpa, size); |
1412 | spin_unlock(&kvm->mmu_lock); | 1468 | spin_unlock(&kvm->mmu_lock); |
1413 | } | 1469 | } |
1470 | |||
1471 | /* | ||
1472 | * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized). | ||
1473 | * | ||
1474 | * Main problems: | ||
1475 | * - S/W ops are local to a CPU (not broadcast) | ||
1476 | * - We have line migration behind our back (speculation) | ||
1477 | * - System caches don't support S/W at all (damn!) | ||
1478 | * | ||
1479 | * In the face of the above, the best we can do is to try and convert | ||
1480 | * S/W ops to VA ops. Because the guest is not allowed to infer the | ||
1481 | * S/W to PA mapping, it can only use S/W to nuke the whole cache, | ||
1482 | * which is a rather good thing for us. | ||
1483 | * | ||
1484 | * Also, it is only used when turning caches on/off ("The expected | ||
1485 | * usage of the cache maintenance instructions that operate by set/way | ||
1486 | * is associated with the cache maintenance instructions associated | ||
1487 | * with the powerdown and powerup of caches, if this is required by | ||
1488 | * the implementation."). | ||
1489 | * | ||
1490 | * We use the following policy: | ||
1491 | * | ||
1492 | * - If we trap a S/W operation, we enable VM trapping to detect | ||
1493 | * caches being turned on/off, and do a full clean. | ||
1494 | * | ||
1495 | * - We flush the caches on both caches being turned on and off. | ||
1496 | * | ||
1497 | * - Once the caches are enabled, we stop trapping VM ops. | ||
1498 | */ | ||
1499 | void kvm_set_way_flush(struct kvm_vcpu *vcpu) | ||
1500 | { | ||
1501 | unsigned long hcr = vcpu_get_hcr(vcpu); | ||
1502 | |||
1503 | /* | ||
1504 | * If this is the first time we do a S/W operation | ||
1505 | * (i.e. HCR_TVM not set) flush the whole memory, and set the | ||
1506 | * VM trapping. | ||
1507 | * | ||
1508 | * Otherwise, rely on the VM trapping to wait for the MMU + | ||
1509 | * Caches to be turned off. At that point, we'll be able to | ||
1510 | * clean the caches again. | ||
1511 | */ | ||
1512 | if (!(hcr & HCR_TVM)) { | ||
1513 | trace_kvm_set_way_flush(*vcpu_pc(vcpu), | ||
1514 | vcpu_has_cache_enabled(vcpu)); | ||
1515 | stage2_flush_vm(vcpu->kvm); | ||
1516 | vcpu_set_hcr(vcpu, hcr | HCR_TVM); | ||
1517 | } | ||
1518 | } | ||
1519 | |||
1520 | void kvm_toggle_cache(struct kvm_vcpu *vcpu, bool was_enabled) | ||
1521 | { | ||
1522 | bool now_enabled = vcpu_has_cache_enabled(vcpu); | ||
1523 | |||
1524 | /* | ||
1525 | * If switching the MMU+caches on, need to invalidate the caches. | ||
1526 | * If switching it off, need to clean the caches. | ||
1527 | * Clean + invalidate does the trick always. | ||
1528 | */ | ||
1529 | if (now_enabled != was_enabled) | ||
1530 | stage2_flush_vm(vcpu->kvm); | ||
1531 | |||
1532 | /* Caches are now on, stop trapping VM ops (until a S/W op) */ | ||
1533 | if (now_enabled) | ||
1534 | vcpu_set_hcr(vcpu, vcpu_get_hcr(vcpu) & ~HCR_TVM); | ||
1535 | |||
1536 | trace_kvm_toggle_cache(*vcpu_pc(vcpu), was_enabled, now_enabled); | ||
1537 | } | ||
diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h index b1d640f78623..b6a6e7102201 100644 --- a/arch/arm/kvm/trace.h +++ b/arch/arm/kvm/trace.h | |||
@@ -223,6 +223,45 @@ TRACE_EVENT(kvm_hvc, | |||
223 | __entry->vcpu_pc, __entry->r0, __entry->imm) | 223 | __entry->vcpu_pc, __entry->r0, __entry->imm) |
224 | ); | 224 | ); |
225 | 225 | ||
226 | TRACE_EVENT(kvm_set_way_flush, | ||
227 | TP_PROTO(unsigned long vcpu_pc, bool cache), | ||
228 | TP_ARGS(vcpu_pc, cache), | ||
229 | |||
230 | TP_STRUCT__entry( | ||
231 | __field( unsigned long, vcpu_pc ) | ||
232 | __field( bool, cache ) | ||
233 | ), | ||
234 | |||
235 | TP_fast_assign( | ||
236 | __entry->vcpu_pc = vcpu_pc; | ||
237 | __entry->cache = cache; | ||
238 | ), | ||
239 | |||
240 | TP_printk("S/W flush at 0x%016lx (cache %s)", | ||
241 | __entry->vcpu_pc, __entry->cache ? "on" : "off") | ||
242 | ); | ||
243 | |||
244 | TRACE_EVENT(kvm_toggle_cache, | ||
245 | TP_PROTO(unsigned long vcpu_pc, bool was, bool now), | ||
246 | TP_ARGS(vcpu_pc, was, now), | ||
247 | |||
248 | TP_STRUCT__entry( | ||
249 | __field( unsigned long, vcpu_pc ) | ||
250 | __field( bool, was ) | ||
251 | __field( bool, now ) | ||
252 | ), | ||
253 | |||
254 | TP_fast_assign( | ||
255 | __entry->vcpu_pc = vcpu_pc; | ||
256 | __entry->was = was; | ||
257 | __entry->now = now; | ||
258 | ), | ||
259 | |||
260 | TP_printk("VM op at 0x%016lx (cache was %s, now %s)", | ||
261 | __entry->vcpu_pc, __entry->was ? "on" : "off", | ||
262 | __entry->now ? "on" : "off") | ||
263 | ); | ||
264 | |||
226 | #endif /* _TRACE_KVM_H */ | 265 | #endif /* _TRACE_KVM_H */ |
227 | 266 | ||
228 | #undef TRACE_INCLUDE_PATH | 267 | #undef TRACE_INCLUDE_PATH |
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 8fb9ef5333f1..97f7367d32b8 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
18 | #include <linux/phy.h> | 18 | #include <linux/phy.h> |
19 | #include <linux/clk-provider.h> | 19 | #include <linux/clk-provider.h> |
20 | #include <linux/phy.h> | ||
20 | 21 | ||
21 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
@@ -26,8 +27,25 @@ | |||
26 | 27 | ||
27 | #include "generic.h" | 28 | #include "generic.h" |
28 | 29 | ||
30 | static int ksz8081_phy_fixup(struct phy_device *phy) | ||
31 | { | ||
32 | int value; | ||
33 | |||
34 | value = phy_read(phy, 0x16); | ||
35 | value &= ~0x20; | ||
36 | phy_write(phy, 0x16, value); | ||
37 | |||
38 | return 0; | ||
39 | } | ||
40 | |||
29 | static void __init sama5_dt_device_init(void) | 41 | static void __init sama5_dt_device_init(void) |
30 | { | 42 | { |
43 | if (of_machine_is_compatible("atmel,sama5d4ek") && | ||
44 | IS_ENABLED(CONFIG_PHYLIB)) { | ||
45 | phy_register_fixup_for_id("fc028000.etherne:00", | ||
46 | ksz8081_phy_fixup); | ||
47 | } | ||
48 | |||
31 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
32 | } | 50 | } |
33 | 51 | ||
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 5951660d1bd2..2daef619d053 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -144,7 +144,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
144 | post_div_table[1].div = 1; | 144 | post_div_table[1].div = 1; |
145 | post_div_table[2].div = 1; | 145 | post_div_table[2].div = 1; |
146 | video_div_table[1].div = 1; | 146 | video_div_table[1].div = 1; |
147 | video_div_table[2].div = 1; | 147 | video_div_table[3].div = 1; |
148 | } | 148 | } |
149 | 149 | ||
150 | clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); | 150 | clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels)); |
diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index 17354a11356f..5a3e5a159e70 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c | |||
@@ -558,6 +558,9 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) | |||
558 | clk_set_parent(clks[IMX6SX_CLK_GPU_CORE_SEL], clks[IMX6SX_CLK_PLL3_PFD0]); | 558 | clk_set_parent(clks[IMX6SX_CLK_GPU_CORE_SEL], clks[IMX6SX_CLK_PLL3_PFD0]); |
559 | clk_set_parent(clks[IMX6SX_CLK_GPU_AXI_SEL], clks[IMX6SX_CLK_PLL3_PFD0]); | 559 | clk_set_parent(clks[IMX6SX_CLK_GPU_AXI_SEL], clks[IMX6SX_CLK_PLL3_PFD0]); |
560 | 560 | ||
561 | clk_set_parent(clks[IMX6SX_CLK_QSPI1_SEL], clks[IMX6SX_CLK_PLL2_BUS]); | ||
562 | clk_set_parent(clks[IMX6SX_CLK_QSPI2_SEL], clks[IMX6SX_CLK_PLL2_BUS]); | ||
563 | |||
561 | /* Set initial power mode */ | 564 | /* Set initial power mode */ |
562 | imx6q_set_lpm(WAIT_CLOCKED); | 565 | imx6q_set_lpm(WAIT_CLOCKED); |
563 | } | 566 | } |
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 3585cb394e9b..ccef8806bb58 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c | |||
@@ -190,6 +190,13 @@ static void __init armada_375_380_coherency_init(struct device_node *np) | |||
190 | arch_ioremap_caller = armada_pcie_wa_ioremap_caller; | 190 | arch_ioremap_caller = armada_pcie_wa_ioremap_caller; |
191 | 191 | ||
192 | /* | 192 | /* |
193 | * We should switch the PL310 to I/O coherency mode only if | ||
194 | * I/O coherency is actually enabled. | ||
195 | */ | ||
196 | if (!coherency_available()) | ||
197 | return; | ||
198 | |||
199 | /* | ||
193 | * Add the PL310 property "arm,io-coherent". This makes sure the | 200 | * Add the PL310 property "arm,io-coherent". This makes sure the |
194 | * outer sync operation is not used, which allows to | 201 | * outer sync operation is not used, which allows to |
195 | * workaround the system erratum that causes deadlocks when | 202 | * workaround the system erratum that causes deadlocks when |
@@ -246,9 +253,14 @@ static int coherency_type(void) | |||
246 | return type; | 253 | return type; |
247 | } | 254 | } |
248 | 255 | ||
256 | /* | ||
257 | * As a precaution, we currently completely disable hardware I/O | ||
258 | * coherency, until enough testing is done with automatic I/O | ||
259 | * synchronization barriers to validate that it is a proper solution. | ||
260 | */ | ||
249 | int coherency_available(void) | 261 | int coherency_available(void) |
250 | { | 262 | { |
251 | return coherency_type() != COHERENCY_FABRIC_TYPE_NONE; | 263 | return false; |
252 | } | 264 | } |
253 | 265 | ||
254 | int __init coherency_init(void) | 266 | int __init coherency_init(void) |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 608079a1aba6..b61c049f92d6 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -77,6 +77,24 @@ MACHINE_END | |||
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef CONFIG_ARCH_OMAP3 | 79 | #ifdef CONFIG_ARCH_OMAP3 |
80 | /* Some boards need board name for legacy userspace in /proc/cpuinfo */ | ||
81 | static const char *const n900_boards_compat[] __initconst = { | ||
82 | "nokia,omap3-n900", | ||
83 | NULL, | ||
84 | }; | ||
85 | |||
86 | DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board") | ||
87 | .reserve = omap_reserve, | ||
88 | .map_io = omap3_map_io, | ||
89 | .init_early = omap3430_init_early, | ||
90 | .init_machine = omap_generic_init, | ||
91 | .init_late = omap3_init_late, | ||
92 | .init_time = omap3_sync32k_timer_init, | ||
93 | .dt_compat = n900_boards_compat, | ||
94 | .restart = omap3xxx_restart, | ||
95 | MACHINE_END | ||
96 | |||
97 | /* Generic omap3 boards, most boards can use these */ | ||
80 | static const char *const omap3_boards_compat[] __initconst = { | 98 | static const char *const omap3_boards_compat[] __initconst = { |
81 | "ti,omap3430", | 99 | "ti,omap3430", |
82 | "ti,omap3", | 100 | "ti,omap3", |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 377eea849e7b..64e44d6d07c0 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -211,6 +211,7 @@ extern struct device *omap2_get_iva_device(void); | |||
211 | extern struct device *omap2_get_l3_device(void); | 211 | extern struct device *omap2_get_l3_device(void); |
212 | extern struct device *omap4_get_dsp_device(void); | 212 | extern struct device *omap4_get_dsp_device(void); |
213 | 213 | ||
214 | unsigned int omap4_xlate_irq(unsigned int hwirq); | ||
214 | void omap_gic_of_init(void); | 215 | void omap_gic_of_init(void); |
215 | 216 | ||
216 | #ifdef CONFIG_CACHE_L2X0 | 217 | #ifdef CONFIG_CACHE_L2X0 |
@@ -249,6 +250,7 @@ extern void omap4_cpu_die(unsigned int cpu); | |||
249 | extern struct smp_operations omap4_smp_ops; | 250 | extern struct smp_operations omap4_smp_ops; |
250 | 251 | ||
251 | extern void omap5_secondary_startup(void); | 252 | extern void omap5_secondary_startup(void); |
253 | extern void omap5_secondary_hyp_startup(void); | ||
252 | #endif | 254 | #endif |
253 | 255 | ||
254 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) | 256 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) |
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index a3c013345c45..a80ac2d70bb1 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h | |||
@@ -286,6 +286,10 @@ | |||
286 | #define OMAP5XXX_CONTROL_STATUS 0x134 | 286 | #define OMAP5XXX_CONTROL_STATUS 0x134 |
287 | #define OMAP5_DEVICETYPE_MASK (0x7 << 6) | 287 | #define OMAP5_DEVICETYPE_MASK (0x7 << 6) |
288 | 288 | ||
289 | /* DRA7XX CONTROL CORE BOOTSTRAP */ | ||
290 | #define DRA7_CTRL_CORE_BOOTSTRAP 0x6c4 | ||
291 | #define DRA7_SPEEDSELECT_MASK (0x3 << 8) | ||
292 | |||
289 | /* | 293 | /* |
290 | * REVISIT: This list of registers is not comprehensive - there are more | 294 | * REVISIT: This list of registers is not comprehensive - there are more |
291 | * that should be added. | 295 | * that should be added. |
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index 4993d4bfe9b2..6d1dffca6c7b 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | /* Physical address needed since MMU not enabled yet on secondary core */ | 23 | /* Physical address needed since MMU not enabled yet on secondary core */ |
24 | #define AUX_CORE_BOOT0_PA 0x48281800 | 24 | #define AUX_CORE_BOOT0_PA 0x48281800 |
25 | #define API_HYP_ENTRY 0x102 | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * OMAP5 specific entry point for secondary CPU to jump from ROM | 28 | * OMAP5 specific entry point for secondary CPU to jump from ROM |
@@ -41,6 +42,26 @@ wait: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 | |||
41 | b secondary_startup | 42 | b secondary_startup |
42 | ENDPROC(omap5_secondary_startup) | 43 | ENDPROC(omap5_secondary_startup) |
43 | /* | 44 | /* |
45 | * Same as omap5_secondary_startup except we call into the ROM to | ||
46 | * enable HYP mode first. This is called instead of | ||
47 | * omap5_secondary_startup if the primary CPU was put into HYP mode by | ||
48 | * the boot loader. | ||
49 | */ | ||
50 | ENTRY(omap5_secondary_hyp_startup) | ||
51 | wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 | ||
52 | ldr r0, [r2] | ||
53 | mov r0, r0, lsr #5 | ||
54 | mrc p15, 0, r4, c0, c0, 5 | ||
55 | and r4, r4, #0x0f | ||
56 | cmp r0, r4 | ||
57 | bne wait_2 | ||
58 | ldr r12, =API_HYP_ENTRY | ||
59 | adr r0, hyp_boot | ||
60 | smc #0 | ||
61 | hyp_boot: | ||
62 | b secondary_startup | ||
63 | ENDPROC(omap5_secondary_hyp_startup) | ||
64 | /* | ||
44 | * OMAP4 specific entry point for secondary CPU to jump from ROM | 65 | * OMAP4 specific entry point for secondary CPU to jump from ROM |
45 | * code. This routine also provides a holding flag into which | 66 | * code. This routine also provides a holding flag into which |
46 | * secondary core is held until we're ready for it to initialise. | 67 | * secondary core is held until we're ready for it to initialise. |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 256e84ef0f67..5305ec7341ec 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/irqchip/arm-gic.h> | 22 | #include <linux/irqchip/arm-gic.h> |
23 | 23 | ||
24 | #include <asm/smp_scu.h> | 24 | #include <asm/smp_scu.h> |
25 | #include <asm/virt.h> | ||
25 | 26 | ||
26 | #include "omap-secure.h" | 27 | #include "omap-secure.h" |
27 | #include "omap-wakeupgen.h" | 28 | #include "omap-wakeupgen.h" |
@@ -227,8 +228,16 @@ static void __init omap4_smp_prepare_cpus(unsigned int max_cpus) | |||
227 | if (omap_secure_apis_support()) | 228 | if (omap_secure_apis_support()) |
228 | omap_auxcoreboot_addr(virt_to_phys(startup_addr)); | 229 | omap_auxcoreboot_addr(virt_to_phys(startup_addr)); |
229 | else | 230 | else |
230 | writel_relaxed(virt_to_phys(omap5_secondary_startup), | 231 | /* |
231 | base + OMAP_AUX_CORE_BOOT_1); | 232 | * If the boot CPU is in HYP mode then start secondary |
233 | * CPU in HYP mode as well. | ||
234 | */ | ||
235 | if ((__boot_cpu_mode & MODE_MASK) == HYP_MODE) | ||
236 | writel_relaxed(virt_to_phys(omap5_secondary_hyp_startup), | ||
237 | base + OMAP_AUX_CORE_BOOT_1); | ||
238 | else | ||
239 | writel_relaxed(virt_to_phys(omap5_secondary_startup), | ||
240 | base + OMAP_AUX_CORE_BOOT_1); | ||
232 | 241 | ||
233 | } | 242 | } |
234 | 243 | ||
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index b7cb44abe49b..cc30e49a4cc2 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -256,6 +256,38 @@ static int __init omap4_sar_ram_init(void) | |||
256 | } | 256 | } |
257 | omap_early_initcall(omap4_sar_ram_init); | 257 | omap_early_initcall(omap4_sar_ram_init); |
258 | 258 | ||
259 | static struct of_device_id gic_match[] = { | ||
260 | { .compatible = "arm,cortex-a9-gic", }, | ||
261 | { .compatible = "arm,cortex-a15-gic", }, | ||
262 | { }, | ||
263 | }; | ||
264 | |||
265 | static struct device_node *gic_node; | ||
266 | |||
267 | unsigned int omap4_xlate_irq(unsigned int hwirq) | ||
268 | { | ||
269 | struct of_phandle_args irq_data; | ||
270 | unsigned int irq; | ||
271 | |||
272 | if (!gic_node) | ||
273 | gic_node = of_find_matching_node(NULL, gic_match); | ||
274 | |||
275 | if (WARN_ON(!gic_node)) | ||
276 | return hwirq; | ||
277 | |||
278 | irq_data.np = gic_node; | ||
279 | irq_data.args_count = 3; | ||
280 | irq_data.args[0] = 0; | ||
281 | irq_data.args[1] = hwirq - OMAP44XX_IRQ_GIC_START; | ||
282 | irq_data.args[2] = IRQ_TYPE_LEVEL_HIGH; | ||
283 | |||
284 | irq = irq_create_of_mapping(&irq_data); | ||
285 | if (WARN_ON(!irq)) | ||
286 | irq = hwirq; | ||
287 | |||
288 | return irq; | ||
289 | } | ||
290 | |||
259 | void __init omap_gic_of_init(void) | 291 | void __init omap_gic_of_init(void) |
260 | { | 292 | { |
261 | struct device_node *np; | 293 | struct device_node *np; |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index cbb908dc5cf0..9025ffffd2dc 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -3534,9 +3534,15 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) | |||
3534 | 3534 | ||
3535 | mpu_irqs_cnt = _count_mpu_irqs(oh); | 3535 | mpu_irqs_cnt = _count_mpu_irqs(oh); |
3536 | for (i = 0; i < mpu_irqs_cnt; i++) { | 3536 | for (i = 0; i < mpu_irqs_cnt; i++) { |
3537 | unsigned int irq; | ||
3538 | |||
3539 | if (oh->xlate_irq) | ||
3540 | irq = oh->xlate_irq((oh->mpu_irqs + i)->irq); | ||
3541 | else | ||
3542 | irq = (oh->mpu_irqs + i)->irq; | ||
3537 | (res + r)->name = (oh->mpu_irqs + i)->name; | 3543 | (res + r)->name = (oh->mpu_irqs + i)->name; |
3538 | (res + r)->start = (oh->mpu_irqs + i)->irq; | 3544 | (res + r)->start = irq; |
3539 | (res + r)->end = (oh->mpu_irqs + i)->irq; | 3545 | (res + r)->end = irq; |
3540 | (res + r)->flags = IORESOURCE_IRQ; | 3546 | (res + r)->flags = IORESOURCE_IRQ; |
3541 | r++; | 3547 | r++; |
3542 | } | 3548 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h index 35ca6efbec31..5b42fafcaf55 100644 --- a/arch/arm/mach-omap2/omap_hwmod.h +++ b/arch/arm/mach-omap2/omap_hwmod.h | |||
@@ -676,6 +676,7 @@ struct omap_hwmod { | |||
676 | spinlock_t _lock; | 676 | spinlock_t _lock; |
677 | struct list_head node; | 677 | struct list_head node; |
678 | struct omap_hwmod_ocp_if *_mpu_port; | 678 | struct omap_hwmod_ocp_if *_mpu_port; |
679 | unsigned int (*xlate_irq)(unsigned int); | ||
679 | u16 flags; | 680 | u16 flags; |
680 | u8 mpu_rt_idx; | 681 | u8 mpu_rt_idx; |
681 | u8 response_lat; | 682 | u8 response_lat; |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index c314b3c31117..f5e68a782025 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -479,6 +479,7 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = { | |||
479 | .class = &omap44xx_dma_hwmod_class, | 479 | .class = &omap44xx_dma_hwmod_class, |
480 | .clkdm_name = "l3_dma_clkdm", | 480 | .clkdm_name = "l3_dma_clkdm", |
481 | .mpu_irqs = omap44xx_dma_system_irqs, | 481 | .mpu_irqs = omap44xx_dma_system_irqs, |
482 | .xlate_irq = omap4_xlate_irq, | ||
482 | .main_clk = "l3_div_ck", | 483 | .main_clk = "l3_div_ck", |
483 | .prcm = { | 484 | .prcm = { |
484 | .omap4 = { | 485 | .omap4 = { |
@@ -640,6 +641,7 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = { | |||
640 | .class = &omap44xx_dispc_hwmod_class, | 641 | .class = &omap44xx_dispc_hwmod_class, |
641 | .clkdm_name = "l3_dss_clkdm", | 642 | .clkdm_name = "l3_dss_clkdm", |
642 | .mpu_irqs = omap44xx_dss_dispc_irqs, | 643 | .mpu_irqs = omap44xx_dss_dispc_irqs, |
644 | .xlate_irq = omap4_xlate_irq, | ||
643 | .sdma_reqs = omap44xx_dss_dispc_sdma_reqs, | 645 | .sdma_reqs = omap44xx_dss_dispc_sdma_reqs, |
644 | .main_clk = "dss_dss_clk", | 646 | .main_clk = "dss_dss_clk", |
645 | .prcm = { | 647 | .prcm = { |
@@ -693,6 +695,7 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = { | |||
693 | .class = &omap44xx_dsi_hwmod_class, | 695 | .class = &omap44xx_dsi_hwmod_class, |
694 | .clkdm_name = "l3_dss_clkdm", | 696 | .clkdm_name = "l3_dss_clkdm", |
695 | .mpu_irqs = omap44xx_dss_dsi1_irqs, | 697 | .mpu_irqs = omap44xx_dss_dsi1_irqs, |
698 | .xlate_irq = omap4_xlate_irq, | ||
696 | .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs, | 699 | .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs, |
697 | .main_clk = "dss_dss_clk", | 700 | .main_clk = "dss_dss_clk", |
698 | .prcm = { | 701 | .prcm = { |
@@ -726,6 +729,7 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = { | |||
726 | .class = &omap44xx_dsi_hwmod_class, | 729 | .class = &omap44xx_dsi_hwmod_class, |
727 | .clkdm_name = "l3_dss_clkdm", | 730 | .clkdm_name = "l3_dss_clkdm", |
728 | .mpu_irqs = omap44xx_dss_dsi2_irqs, | 731 | .mpu_irqs = omap44xx_dss_dsi2_irqs, |
732 | .xlate_irq = omap4_xlate_irq, | ||
729 | .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs, | 733 | .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs, |
730 | .main_clk = "dss_dss_clk", | 734 | .main_clk = "dss_dss_clk", |
731 | .prcm = { | 735 | .prcm = { |
@@ -784,6 +788,7 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = { | |||
784 | */ | 788 | */ |
785 | .flags = HWMOD_SWSUP_SIDLE, | 789 | .flags = HWMOD_SWSUP_SIDLE, |
786 | .mpu_irqs = omap44xx_dss_hdmi_irqs, | 790 | .mpu_irqs = omap44xx_dss_hdmi_irqs, |
791 | .xlate_irq = omap4_xlate_irq, | ||
787 | .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs, | 792 | .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs, |
788 | .main_clk = "dss_48mhz_clk", | 793 | .main_clk = "dss_48mhz_clk", |
789 | .prcm = { | 794 | .prcm = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c index 3e9523084b2a..7c3fac035e93 100644 --- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c | |||
@@ -288,6 +288,7 @@ static struct omap_hwmod omap54xx_dma_system_hwmod = { | |||
288 | .class = &omap54xx_dma_hwmod_class, | 288 | .class = &omap54xx_dma_hwmod_class, |
289 | .clkdm_name = "dma_clkdm", | 289 | .clkdm_name = "dma_clkdm", |
290 | .mpu_irqs = omap54xx_dma_system_irqs, | 290 | .mpu_irqs = omap54xx_dma_system_irqs, |
291 | .xlate_irq = omap4_xlate_irq, | ||
291 | .main_clk = "l3_iclk_div", | 292 | .main_clk = "l3_iclk_div", |
292 | .prcm = { | 293 | .prcm = { |
293 | .omap4 = { | 294 | .omap4 = { |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index a8e4b582c527..6163d66102a3 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -498,6 +498,7 @@ struct omap_prcm_irq_setup { | |||
498 | u8 nr_irqs; | 498 | u8 nr_irqs; |
499 | const struct omap_prcm_irq *irqs; | 499 | const struct omap_prcm_irq *irqs; |
500 | int irq; | 500 | int irq; |
501 | unsigned int (*xlate_irq)(unsigned int); | ||
501 | void (*read_pending_irqs)(unsigned long *events); | 502 | void (*read_pending_irqs)(unsigned long *events); |
502 | void (*ocp_barrier)(void); | 503 | void (*ocp_barrier)(void); |
503 | void (*save_and_clear_irqen)(u32 *saved_mask); | 504 | void (*save_and_clear_irqen)(u32 *saved_mask); |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index cc170fb81ff7..408c64efb807 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -49,6 +49,7 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = { | |||
49 | .irqs = omap4_prcm_irqs, | 49 | .irqs = omap4_prcm_irqs, |
50 | .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), | 50 | .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), |
51 | .irq = 11 + OMAP44XX_IRQ_GIC_START, | 51 | .irq = 11 + OMAP44XX_IRQ_GIC_START, |
52 | .xlate_irq = omap4_xlate_irq, | ||
52 | .read_pending_irqs = &omap44xx_prm_read_pending_irqs, | 53 | .read_pending_irqs = &omap44xx_prm_read_pending_irqs, |
53 | .ocp_barrier = &omap44xx_prm_ocp_barrier, | 54 | .ocp_barrier = &omap44xx_prm_ocp_barrier, |
54 | .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, | 55 | .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, |
@@ -751,8 +752,10 @@ static int omap44xx_prm_late_init(void) | |||
751 | } | 752 | } |
752 | 753 | ||
753 | /* Once OMAP4 DT is filled as well */ | 754 | /* Once OMAP4 DT is filled as well */ |
754 | if (irq_num >= 0) | 755 | if (irq_num >= 0) { |
755 | omap4_prcm_irq_setup.irq = irq_num; | 756 | omap4_prcm_irq_setup.irq = irq_num; |
757 | omap4_prcm_irq_setup.xlate_irq = NULL; | ||
758 | } | ||
756 | } | 759 | } |
757 | 760 | ||
758 | omap44xx_prm_enable_io_wakeup(); | 761 | omap44xx_prm_enable_io_wakeup(); |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 779940cb6e56..dea2833ca627 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -187,6 +187,7 @@ int omap_prcm_event_to_irq(const char *name) | |||
187 | */ | 187 | */ |
188 | void omap_prcm_irq_cleanup(void) | 188 | void omap_prcm_irq_cleanup(void) |
189 | { | 189 | { |
190 | unsigned int irq; | ||
190 | int i; | 191 | int i; |
191 | 192 | ||
192 | if (!prcm_irq_setup) { | 193 | if (!prcm_irq_setup) { |
@@ -211,7 +212,11 @@ void omap_prcm_irq_cleanup(void) | |||
211 | kfree(prcm_irq_setup->priority_mask); | 212 | kfree(prcm_irq_setup->priority_mask); |
212 | prcm_irq_setup->priority_mask = NULL; | 213 | prcm_irq_setup->priority_mask = NULL; |
213 | 214 | ||
214 | irq_set_chained_handler(prcm_irq_setup->irq, NULL); | 215 | if (prcm_irq_setup->xlate_irq) |
216 | irq = prcm_irq_setup->xlate_irq(prcm_irq_setup->irq); | ||
217 | else | ||
218 | irq = prcm_irq_setup->irq; | ||
219 | irq_set_chained_handler(irq, NULL); | ||
215 | 220 | ||
216 | if (prcm_irq_setup->base_irq > 0) | 221 | if (prcm_irq_setup->base_irq > 0) |
217 | irq_free_descs(prcm_irq_setup->base_irq, | 222 | irq_free_descs(prcm_irq_setup->base_irq, |
@@ -259,6 +264,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
259 | int offset, i; | 264 | int offset, i; |
260 | struct irq_chip_generic *gc; | 265 | struct irq_chip_generic *gc; |
261 | struct irq_chip_type *ct; | 266 | struct irq_chip_type *ct; |
267 | unsigned int irq; | ||
262 | 268 | ||
263 | if (!irq_setup) | 269 | if (!irq_setup) |
264 | return -EINVAL; | 270 | return -EINVAL; |
@@ -298,7 +304,11 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
298 | 1 << (offset & 0x1f); | 304 | 1 << (offset & 0x1f); |
299 | } | 305 | } |
300 | 306 | ||
301 | irq_set_chained_handler(irq_setup->irq, omap_prcm_irq_handler); | 307 | if (irq_setup->xlate_irq) |
308 | irq = irq_setup->xlate_irq(irq_setup->irq); | ||
309 | else | ||
310 | irq = irq_setup->irq; | ||
311 | irq_set_chained_handler(irq, omap_prcm_irq_handler); | ||
302 | 312 | ||
303 | irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32, | 313 | irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32, |
304 | 0); | 314 | 0); |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 4f61148ec168..7d45c84c69ba 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -54,6 +54,7 @@ | |||
54 | 54 | ||
55 | #include "soc.h" | 55 | #include "soc.h" |
56 | #include "common.h" | 56 | #include "common.h" |
57 | #include "control.h" | ||
57 | #include "powerdomain.h" | 58 | #include "powerdomain.h" |
58 | #include "omap-secure.h" | 59 | #include "omap-secure.h" |
59 | 60 | ||
@@ -496,7 +497,8 @@ static void __init realtime_counter_init(void) | |||
496 | void __iomem *base; | 497 | void __iomem *base; |
497 | static struct clk *sys_clk; | 498 | static struct clk *sys_clk; |
498 | unsigned long rate; | 499 | unsigned long rate; |
499 | unsigned int reg, num, den; | 500 | unsigned int reg; |
501 | unsigned long long num, den; | ||
500 | 502 | ||
501 | base = ioremap(REALTIME_COUNTER_BASE, SZ_32); | 503 | base = ioremap(REALTIME_COUNTER_BASE, SZ_32); |
502 | if (!base) { | 504 | if (!base) { |
@@ -511,13 +513,42 @@ static void __init realtime_counter_init(void) | |||
511 | } | 513 | } |
512 | 514 | ||
513 | rate = clk_get_rate(sys_clk); | 515 | rate = clk_get_rate(sys_clk); |
516 | |||
517 | if (soc_is_dra7xx()) { | ||
518 | /* | ||
519 | * Errata i856 says the 32.768KHz crystal does not start at | ||
520 | * power on, so the CPU falls back to an emulated 32KHz clock | ||
521 | * based on sysclk / 610 instead. This causes the master counter | ||
522 | * frequency to not be 6.144MHz but at sysclk / 610 * 375 / 2 | ||
523 | * (OR sysclk * 75 / 244) | ||
524 | * | ||
525 | * This affects at least the DRA7/AM572x 1.0, 1.1 revisions. | ||
526 | * Of course any board built without a populated 32.768KHz | ||
527 | * crystal would also need this fix even if the CPU is fixed | ||
528 | * later. | ||
529 | * | ||
530 | * Either case can be detected by using the two speedselect bits | ||
531 | * If they are not 0, then the 32.768KHz clock driving the | ||
532 | * coarse counter that corrects the fine counter every time it | ||
533 | * ticks is actually rate/610 rather than 32.768KHz and we | ||
534 | * should compensate to avoid the 570ppm (at 20MHz, much worse | ||
535 | * at other rates) too fast system time. | ||
536 | */ | ||
537 | reg = omap_ctrl_readl(DRA7_CTRL_CORE_BOOTSTRAP); | ||
538 | if (reg & DRA7_SPEEDSELECT_MASK) { | ||
539 | num = 75; | ||
540 | den = 244; | ||
541 | goto sysclk1_based; | ||
542 | } | ||
543 | } | ||
544 | |||
514 | /* Numerator/denumerator values refer TRM Realtime Counter section */ | 545 | /* Numerator/denumerator values refer TRM Realtime Counter section */ |
515 | switch (rate) { | 546 | switch (rate) { |
516 | case 1200000: | 547 | case 12000000: |
517 | num = 64; | 548 | num = 64; |
518 | den = 125; | 549 | den = 125; |
519 | break; | 550 | break; |
520 | case 1300000: | 551 | case 13000000: |
521 | num = 768; | 552 | num = 768; |
522 | den = 1625; | 553 | den = 1625; |
523 | break; | 554 | break; |
@@ -529,11 +560,11 @@ static void __init realtime_counter_init(void) | |||
529 | num = 192; | 560 | num = 192; |
530 | den = 625; | 561 | den = 625; |
531 | break; | 562 | break; |
532 | case 2600000: | 563 | case 26000000: |
533 | num = 384; | 564 | num = 384; |
534 | den = 1625; | 565 | den = 1625; |
535 | break; | 566 | break; |
536 | case 2700000: | 567 | case 27000000: |
537 | num = 256; | 568 | num = 256; |
538 | den = 1125; | 569 | den = 1125; |
539 | break; | 570 | break; |
@@ -545,6 +576,7 @@ static void __init realtime_counter_init(void) | |||
545 | break; | 576 | break; |
546 | } | 577 | } |
547 | 578 | ||
579 | sysclk1_based: | ||
548 | /* Program numerator and denumerator registers */ | 580 | /* Program numerator and denumerator registers */ |
549 | reg = readl_relaxed(base + INCREMENTER_NUMERATOR_OFFSET) & | 581 | reg = readl_relaxed(base + INCREMENTER_NUMERATOR_OFFSET) & |
550 | NUMERATOR_DENUMERATOR_MASK; | 582 | NUMERATOR_DENUMERATOR_MASK; |
@@ -556,7 +588,7 @@ static void __init realtime_counter_init(void) | |||
556 | reg |= den; | 588 | reg |= den; |
557 | writel_relaxed(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET); | 589 | writel_relaxed(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET); |
558 | 590 | ||
559 | arch_timer_freq = (rate / den) * num; | 591 | arch_timer_freq = DIV_ROUND_UP_ULL(rate * num, den); |
560 | set_cntfreq(); | 592 | set_cntfreq(); |
561 | 593 | ||
562 | iounmap(base); | 594 | iounmap(base); |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 4457e731f7a4..292eca0e78ed 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -66,19 +66,24 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
66 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); | 66 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); |
67 | } | 67 | } |
68 | 68 | ||
69 | #ifdef CONFIG_ARCH_OMAP4 | ||
69 | void __init omap4_pmic_init(const char *pmic_type, | 70 | void __init omap4_pmic_init(const char *pmic_type, |
70 | struct twl4030_platform_data *pmic_data, | 71 | struct twl4030_platform_data *pmic_data, |
71 | struct i2c_board_info *devices, int nr_devices) | 72 | struct i2c_board_info *devices, int nr_devices) |
72 | { | 73 | { |
73 | /* PMIC part*/ | 74 | /* PMIC part*/ |
75 | unsigned int irq; | ||
76 | |||
74 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); | 77 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); |
75 | omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT); | 78 | omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT); |
76 | omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data); | 79 | irq = omap4_xlate_irq(7 + OMAP44XX_IRQ_GIC_START); |
80 | omap_pmic_init(1, 400, pmic_type, irq, pmic_data); | ||
77 | 81 | ||
78 | /* Register additional devices on i2c1 bus if needed */ | 82 | /* Register additional devices on i2c1 bus if needed */ |
79 | if (devices) | 83 | if (devices) |
80 | i2c_register_board_info(1, devices, nr_devices); | 84 | i2c_register_board_info(1, devices, nr_devices); |
81 | } | 85 | } |
86 | #endif | ||
82 | 87 | ||
83 | void __init omap_pmic_late_init(void) | 88 | void __init omap_pmic_late_init(void) |
84 | { | 89 | { |
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c index d226b71d21d5..a611f4852582 100644 --- a/arch/arm/mach-rockchip/rockchip.c +++ b/arch/arm/mach-rockchip/rockchip.c | |||
@@ -19,11 +19,37 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/of_platform.h> | 20 | #include <linux/of_platform.h> |
21 | #include <linux/irqchip.h> | 21 | #include <linux/irqchip.h> |
22 | #include <linux/clk-provider.h> | ||
23 | #include <linux/clocksource.h> | ||
24 | #include <linux/mfd/syscon.h> | ||
25 | #include <linux/regmap.h> | ||
22 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
24 | #include <asm/hardware/cache-l2x0.h> | 28 | #include <asm/hardware/cache-l2x0.h> |
25 | #include "core.h" | 29 | #include "core.h" |
26 | 30 | ||
31 | #define RK3288_GRF_SOC_CON0 0x244 | ||
32 | |||
33 | static void __init rockchip_timer_init(void) | ||
34 | { | ||
35 | if (of_machine_is_compatible("rockchip,rk3288")) { | ||
36 | struct regmap *grf; | ||
37 | |||
38 | /* | ||
39 | * Disable auto jtag/sdmmc switching that causes issues | ||
40 | * with the mmc controllers making them unreliable | ||
41 | */ | ||
42 | grf = syscon_regmap_lookup_by_compatible("rockchip,rk3288-grf"); | ||
43 | if (!IS_ERR(grf)) | ||
44 | regmap_write(grf, RK3288_GRF_SOC_CON0, 0x10000000); | ||
45 | else | ||
46 | pr_err("rockchip: could not get grf syscon\n"); | ||
47 | } | ||
48 | |||
49 | of_clk_init(NULL); | ||
50 | clocksource_of_init(); | ||
51 | } | ||
52 | |||
27 | static void __init rockchip_dt_init(void) | 53 | static void __init rockchip_dt_init(void) |
28 | { | 54 | { |
29 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 55 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
@@ -42,6 +68,7 @@ static const char * const rockchip_board_dt_compat[] = { | |||
42 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") | 68 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") |
43 | .l2c_aux_val = 0, | 69 | .l2c_aux_val = 0, |
44 | .l2c_aux_mask = ~0, | 70 | .l2c_aux_mask = ~0, |
71 | .init_time = rockchip_timer_init, | ||
45 | .dt_compat = rockchip_board_dt_compat, | 72 | .dt_compat = rockchip_board_dt_compat, |
46 | .init_machine = rockchip_dt_init, | 73 | .init_machine = rockchip_dt_init, |
47 | MACHINE_END | 74 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 66f67816a844..444f22d370f0 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/gpio_keys.h> | 18 | #include <linux/gpio_keys.h> |
19 | #include <linux/input.h> | 19 | #include <linux/input.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/irqchip.h> | ||
22 | #include <linux/irqchip/arm-gic.h> | ||
21 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
22 | #include <linux/mfd/tmio.h> | 24 | #include <linux/mfd/tmio.h> |
23 | #include <linux/mmc/host.h> | 25 | #include <linux/mmc/host.h> |
@@ -273,6 +275,22 @@ static void __init ape6evm_add_standard_devices(void) | |||
273 | sizeof(ape6evm_leds_pdata)); | 275 | sizeof(ape6evm_leds_pdata)); |
274 | } | 276 | } |
275 | 277 | ||
278 | static void __init ape6evm_legacy_init_time(void) | ||
279 | { | ||
280 | /* Do not invoke DT-based timers via clocksource_of_init() */ | ||
281 | } | ||
282 | |||
283 | static void __init ape6evm_legacy_init_irq(void) | ||
284 | { | ||
285 | void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000); | ||
286 | void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000); | ||
287 | |||
288 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | ||
289 | |||
290 | /* Do not invoke DT-based interrupt code via irqchip_init() */ | ||
291 | } | ||
292 | |||
293 | |||
276 | static const char *ape6evm_boards_compat_dt[] __initdata = { | 294 | static const char *ape6evm_boards_compat_dt[] __initdata = { |
277 | "renesas,ape6evm", | 295 | "renesas,ape6evm", |
278 | NULL, | 296 | NULL, |
@@ -280,7 +298,9 @@ static const char *ape6evm_boards_compat_dt[] __initdata = { | |||
280 | 298 | ||
281 | DT_MACHINE_START(APE6EVM_DT, "ape6evm") | 299 | DT_MACHINE_START(APE6EVM_DT, "ape6evm") |
282 | .init_early = shmobile_init_delay, | 300 | .init_early = shmobile_init_delay, |
301 | .init_irq = ape6evm_legacy_init_irq, | ||
283 | .init_machine = ape6evm_add_standard_devices, | 302 | .init_machine = ape6evm_add_standard_devices, |
284 | .init_late = shmobile_init_late, | 303 | .init_late = shmobile_init_late, |
285 | .dt_compat = ape6evm_boards_compat_dt, | 304 | .dt_compat = ape6evm_boards_compat_dt, |
305 | .init_time = ape6evm_legacy_init_time, | ||
286 | MACHINE_END | 306 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index f8197eb6e566..65b128dd4072 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/input.h> | 21 | #include <linux/input.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/irqchip.h> | ||
25 | #include <linux/irqchip/arm-gic.h> | ||
24 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
25 | #include <linux/leds.h> | 27 | #include <linux/leds.h> |
26 | #include <linux/mfd/tmio.h> | 28 | #include <linux/mfd/tmio.h> |
@@ -811,6 +813,16 @@ static void __init lager_init(void) | |||
811 | lager_ksz8041_fixup); | 813 | lager_ksz8041_fixup); |
812 | } | 814 | } |
813 | 815 | ||
816 | static void __init lager_legacy_init_irq(void) | ||
817 | { | ||
818 | void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000); | ||
819 | void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000); | ||
820 | |||
821 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | ||
822 | |||
823 | /* Do not invoke DT-based interrupt code via irqchip_init() */ | ||
824 | } | ||
825 | |||
814 | static const char * const lager_boards_compat_dt[] __initconst = { | 826 | static const char * const lager_boards_compat_dt[] __initconst = { |
815 | "renesas,lager", | 827 | "renesas,lager", |
816 | NULL, | 828 | NULL, |
@@ -819,6 +831,7 @@ static const char * const lager_boards_compat_dt[] __initconst = { | |||
819 | DT_MACHINE_START(LAGER_DT, "lager") | 831 | DT_MACHINE_START(LAGER_DT, "lager") |
820 | .smp = smp_ops(r8a7790_smp_ops), | 832 | .smp = smp_ops(r8a7790_smp_ops), |
821 | .init_early = shmobile_init_delay, | 833 | .init_early = shmobile_init_delay, |
834 | .init_irq = lager_legacy_init_irq, | ||
822 | .init_time = rcar_gen2_timer_init, | 835 | .init_time = rcar_gen2_timer_init, |
823 | .init_machine = lager_init, | 836 | .init_machine = lager_init, |
824 | .init_late = shmobile_init_late, | 837 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 79ad93dfdae4..d191cf419731 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -800,7 +800,14 @@ void __init r8a7740_init_irq_of(void) | |||
800 | void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10); | 800 | void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10); |
801 | void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4); | 801 | void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4); |
802 | 802 | ||
803 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
804 | void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000); | ||
805 | void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000); | ||
806 | |||
807 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | ||
808 | #else | ||
803 | irqchip_init(); | 809 | irqchip_init(); |
810 | #endif | ||
804 | 811 | ||
805 | /* route signals to GIC */ | 812 | /* route signals to GIC */ |
806 | iowrite32(0x0, pfc_inta_ctrl); | 813 | iowrite32(0x0, pfc_inta_ctrl); |
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 170bd146ba17..cef8895a9b82 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -576,11 +576,18 @@ void __init r8a7778_init_irq_extpin(int irlm) | |||
576 | void __init r8a7778_init_irq_dt(void) | 576 | void __init r8a7778_init_irq_dt(void) |
577 | { | 577 | { |
578 | void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000); | 578 | void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000); |
579 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
580 | void __iomem *gic_dist_base = ioremap_nocache(0xfe438000, 0x1000); | ||
581 | void __iomem *gic_cpu_base = ioremap_nocache(0xfe430000, 0x1000); | ||
582 | #endif | ||
579 | 583 | ||
580 | BUG_ON(!base); | 584 | BUG_ON(!base); |
581 | 585 | ||
586 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
587 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | ||
588 | #else | ||
582 | irqchip_init(); | 589 | irqchip_init(); |
583 | 590 | #endif | |
584 | /* route all interrupts to ARM */ | 591 | /* route all interrupts to ARM */ |
585 | __raw_writel(0x73ffffff, base + INT2NTSR0); | 592 | __raw_writel(0x73ffffff, base + INT2NTSR0); |
586 | __raw_writel(0xffffffff, base + INT2NTSR1); | 593 | __raw_writel(0xffffffff, base + INT2NTSR1); |
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 6156d172cf31..27dceaf9e688 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -720,10 +720,17 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on) | |||
720 | 720 | ||
721 | void __init r8a7779_init_irq_dt(void) | 721 | void __init r8a7779_init_irq_dt(void) |
722 | { | 722 | { |
723 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
724 | void __iomem *gic_dist_base = ioremap_nocache(0xf0001000, 0x1000); | ||
725 | void __iomem *gic_cpu_base = ioremap_nocache(0xf0000100, 0x1000); | ||
726 | #endif | ||
723 | gic_arch_extn.irq_set_wake = r8a7779_set_wake; | 727 | gic_arch_extn.irq_set_wake = r8a7779_set_wake; |
724 | 728 | ||
729 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
730 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | ||
731 | #else | ||
725 | irqchip_init(); | 732 | irqchip_init(); |
726 | 733 | #endif | |
727 | /* route all interrupts to ARM */ | 734 | /* route all interrupts to ARM */ |
728 | __raw_writel(0xffffffff, INT2NTSR0); | 735 | __raw_writel(0xffffffff, INT2NTSR0); |
729 | __raw_writel(0x3fffffff, INT2NTSR1); | 736 | __raw_writel(0x3fffffff, INT2NTSR1); |
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 3dd6edd9bd1d..cc9470dfb1ce 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c | |||
@@ -133,7 +133,9 @@ void __init rcar_gen2_timer_init(void) | |||
133 | #ifdef CONFIG_COMMON_CLK | 133 | #ifdef CONFIG_COMMON_CLK |
134 | rcar_gen2_clocks_init(mode); | 134 | rcar_gen2_clocks_init(mode); |
135 | #endif | 135 | #endif |
136 | #ifdef CONFIG_ARCH_SHMOBILE_MULTI | ||
136 | clocksource_of_init(); | 137 | clocksource_of_init(); |
138 | #endif | ||
137 | } | 139 | } |
138 | 140 | ||
139 | struct memory_reserve_config { | 141 | struct memory_reserve_config { |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 93ebe3430bfe..fb5e1bb34be8 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -595,6 +595,7 @@ static struct platform_device ipmmu_device = { | |||
595 | 595 | ||
596 | static struct renesas_intc_irqpin_config irqpin0_platform_data = { | 596 | static struct renesas_intc_irqpin_config irqpin0_platform_data = { |
597 | .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */ | 597 | .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */ |
598 | .control_parent = true, | ||
598 | }; | 599 | }; |
599 | 600 | ||
600 | static struct resource irqpin0_resources[] = { | 601 | static struct resource irqpin0_resources[] = { |
@@ -656,6 +657,7 @@ static struct platform_device irqpin1_device = { | |||
656 | 657 | ||
657 | static struct renesas_intc_irqpin_config irqpin2_platform_data = { | 658 | static struct renesas_intc_irqpin_config irqpin2_platform_data = { |
658 | .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */ | 659 | .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */ |
660 | .control_parent = true, | ||
659 | }; | 661 | }; |
660 | 662 | ||
661 | static struct resource irqpin2_resources[] = { | 663 | static struct resource irqpin2_resources[] = { |
@@ -686,6 +688,7 @@ static struct platform_device irqpin2_device = { | |||
686 | 688 | ||
687 | static struct renesas_intc_irqpin_config irqpin3_platform_data = { | 689 | static struct renesas_intc_irqpin_config irqpin3_platform_data = { |
688 | .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */ | 690 | .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */ |
691 | .control_parent = true, | ||
689 | }; | 692 | }; |
690 | 693 | ||
691 | static struct resource irqpin3_resources[] = { | 694 | static struct resource irqpin3_resources[] = { |
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index f1d027aa7a81..0edf2a6d2bbe 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c | |||
@@ -70,6 +70,18 @@ void __init shmobile_init_delay(void) | |||
70 | if (!max_freq) | 70 | if (!max_freq) |
71 | return; | 71 | return; |
72 | 72 | ||
73 | #ifdef CONFIG_ARCH_SHMOBILE_LEGACY | ||
74 | /* Non-multiplatform r8a73a4 SoC cannot use arch timer due | ||
75 | * to GIC being initialized from C and arch timer via DT */ | ||
76 | if (of_machine_is_compatible("renesas,r8a73a4")) | ||
77 | has_arch_timer = false; | ||
78 | |||
79 | /* Non-multiplatform r8a7790 SoC cannot use arch timer due | ||
80 | * to GIC being initialized from C and arch timer via DT */ | ||
81 | if (of_machine_is_compatible("renesas,r8a7790")) | ||
82 | has_arch_timer = false; | ||
83 | #endif | ||
84 | |||
73 | if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { | 85 | if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { |
74 | if (is_a7_a8_a9) | 86 | if (is_a7_a8_a9) |
75 | shmobile_setup_delay_hz(max_freq, 1, 3); | 87 | shmobile_setup_delay_hz(max_freq, 1, 3); |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 7864797609b3..a673c7f7e208 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -1940,13 +1940,32 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) | |||
1940 | } | 1940 | } |
1941 | EXPORT_SYMBOL_GPL(arm_iommu_release_mapping); | 1941 | EXPORT_SYMBOL_GPL(arm_iommu_release_mapping); |
1942 | 1942 | ||
1943 | static int __arm_iommu_attach_device(struct device *dev, | ||
1944 | struct dma_iommu_mapping *mapping) | ||
1945 | { | ||
1946 | int err; | ||
1947 | |||
1948 | err = iommu_attach_device(mapping->domain, dev); | ||
1949 | if (err) | ||
1950 | return err; | ||
1951 | |||
1952 | kref_get(&mapping->kref); | ||
1953 | dev->archdata.mapping = mapping; | ||
1954 | |||
1955 | pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); | ||
1956 | return 0; | ||
1957 | } | ||
1958 | |||
1943 | /** | 1959 | /** |
1944 | * arm_iommu_attach_device | 1960 | * arm_iommu_attach_device |
1945 | * @dev: valid struct device pointer | 1961 | * @dev: valid struct device pointer |
1946 | * @mapping: io address space mapping structure (returned from | 1962 | * @mapping: io address space mapping structure (returned from |
1947 | * arm_iommu_create_mapping) | 1963 | * arm_iommu_create_mapping) |
1948 | * | 1964 | * |
1949 | * Attaches specified io address space mapping to the provided device, | 1965 | * Attaches specified io address space mapping to the provided device. |
1966 | * This replaces the dma operations (dma_map_ops pointer) with the | ||
1967 | * IOMMU aware version. | ||
1968 | * | ||
1950 | * More than one client might be attached to the same io address space | 1969 | * More than one client might be attached to the same io address space |
1951 | * mapping. | 1970 | * mapping. |
1952 | */ | 1971 | */ |
@@ -1955,25 +1974,16 @@ int arm_iommu_attach_device(struct device *dev, | |||
1955 | { | 1974 | { |
1956 | int err; | 1975 | int err; |
1957 | 1976 | ||
1958 | err = iommu_attach_device(mapping->domain, dev); | 1977 | err = __arm_iommu_attach_device(dev, mapping); |
1959 | if (err) | 1978 | if (err) |
1960 | return err; | 1979 | return err; |
1961 | 1980 | ||
1962 | kref_get(&mapping->kref); | 1981 | set_dma_ops(dev, &iommu_ops); |
1963 | dev->archdata.mapping = mapping; | ||
1964 | |||
1965 | pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); | ||
1966 | return 0; | 1982 | return 0; |
1967 | } | 1983 | } |
1968 | EXPORT_SYMBOL_GPL(arm_iommu_attach_device); | 1984 | EXPORT_SYMBOL_GPL(arm_iommu_attach_device); |
1969 | 1985 | ||
1970 | /** | 1986 | static void __arm_iommu_detach_device(struct device *dev) |
1971 | * arm_iommu_detach_device | ||
1972 | * @dev: valid struct device pointer | ||
1973 | * | ||
1974 | * Detaches the provided device from a previously attached map. | ||
1975 | */ | ||
1976 | void arm_iommu_detach_device(struct device *dev) | ||
1977 | { | 1987 | { |
1978 | struct dma_iommu_mapping *mapping; | 1988 | struct dma_iommu_mapping *mapping; |
1979 | 1989 | ||
@@ -1989,6 +1999,19 @@ void arm_iommu_detach_device(struct device *dev) | |||
1989 | 1999 | ||
1990 | pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev)); | 2000 | pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev)); |
1991 | } | 2001 | } |
2002 | |||
2003 | /** | ||
2004 | * arm_iommu_detach_device | ||
2005 | * @dev: valid struct device pointer | ||
2006 | * | ||
2007 | * Detaches the provided device from a previously attached map. | ||
2008 | * This voids the dma operations (dma_map_ops pointer) | ||
2009 | */ | ||
2010 | void arm_iommu_detach_device(struct device *dev) | ||
2011 | { | ||
2012 | __arm_iommu_detach_device(dev); | ||
2013 | set_dma_ops(dev, NULL); | ||
2014 | } | ||
1992 | EXPORT_SYMBOL_GPL(arm_iommu_detach_device); | 2015 | EXPORT_SYMBOL_GPL(arm_iommu_detach_device); |
1993 | 2016 | ||
1994 | static struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent) | 2017 | static struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent) |
@@ -2011,7 +2034,7 @@ static bool arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size, | |||
2011 | return false; | 2034 | return false; |
2012 | } | 2035 | } |
2013 | 2036 | ||
2014 | if (arm_iommu_attach_device(dev, mapping)) { | 2037 | if (__arm_iommu_attach_device(dev, mapping)) { |
2015 | pr_warn("Failed to attached device %s to IOMMU_mapping\n", | 2038 | pr_warn("Failed to attached device %s to IOMMU_mapping\n", |
2016 | dev_name(dev)); | 2039 | dev_name(dev)); |
2017 | arm_iommu_release_mapping(mapping); | 2040 | arm_iommu_release_mapping(mapping); |
@@ -2025,7 +2048,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) | |||
2025 | { | 2048 | { |
2026 | struct dma_iommu_mapping *mapping = dev->archdata.mapping; | 2049 | struct dma_iommu_mapping *mapping = dev->archdata.mapping; |
2027 | 2050 | ||
2028 | arm_iommu_detach_device(dev); | 2051 | __arm_iommu_detach_device(dev); |
2029 | arm_iommu_release_mapping(mapping); | 2052 | arm_iommu_release_mapping(mapping); |
2030 | } | 2053 | } |
2031 | 2054 | ||
diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c index 59424937e52b..9fe8e241335c 100644 --- a/arch/arm/mm/dump.c +++ b/arch/arm/mm/dump.c | |||
@@ -220,9 +220,6 @@ static void note_page(struct pg_state *st, unsigned long addr, unsigned level, u | |||
220 | static const char units[] = "KMGTPE"; | 220 | static const char units[] = "KMGTPE"; |
221 | u64 prot = val & pg_level[level].mask; | 221 | u64 prot = val & pg_level[level].mask; |
222 | 222 | ||
223 | if (addr < USER_PGTABLES_CEILING) | ||
224 | return; | ||
225 | |||
226 | if (!st->level) { | 223 | if (!st->level) { |
227 | st->level = level; | 224 | st->level = level; |
228 | st->current_prot = prot; | 225 | st->current_prot = prot; |
@@ -308,15 +305,13 @@ static void walk_pgd(struct seq_file *m) | |||
308 | pgd_t *pgd = swapper_pg_dir; | 305 | pgd_t *pgd = swapper_pg_dir; |
309 | struct pg_state st; | 306 | struct pg_state st; |
310 | unsigned long addr; | 307 | unsigned long addr; |
311 | unsigned i, pgdoff = USER_PGTABLES_CEILING / PGDIR_SIZE; | 308 | unsigned i; |
312 | 309 | ||
313 | memset(&st, 0, sizeof(st)); | 310 | memset(&st, 0, sizeof(st)); |
314 | st.seq = m; | 311 | st.seq = m; |
315 | st.marker = address_markers; | 312 | st.marker = address_markers; |
316 | 313 | ||
317 | pgd += pgdoff; | 314 | for (i = 0; i < PTRS_PER_PGD; i++, pgd++) { |
318 | |||
319 | for (i = pgdoff; i < PTRS_PER_PGD; i++, pgd++) { | ||
320 | addr = i * PGDIR_SIZE; | 315 | addr = i * PGDIR_SIZE; |
321 | if (!pgd_none(*pgd)) { | 316 | if (!pgd_none(*pgd)) { |
322 | walk_pud(&st, pgd, addr); | 317 | walk_pud(&st, pgd, addr); |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 98ad9c79ea0e..2495c8cb47ba 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -658,8 +658,8 @@ static struct section_perm ro_perms[] = { | |||
658 | .start = (unsigned long)_stext, | 658 | .start = (unsigned long)_stext, |
659 | .end = (unsigned long)__init_begin, | 659 | .end = (unsigned long)__init_begin, |
660 | #ifdef CONFIG_ARM_LPAE | 660 | #ifdef CONFIG_ARM_LPAE |
661 | .mask = ~PMD_SECT_RDONLY, | 661 | .mask = ~L_PMD_SECT_RDONLY, |
662 | .prot = PMD_SECT_RDONLY, | 662 | .prot = L_PMD_SECT_RDONLY, |
663 | #else | 663 | #else |
664 | .mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE), | 664 | .mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE), |
665 | .prot = PMD_SECT_APX | PMD_SECT_AP_WRITE, | 665 | .prot = PMD_SECT_APX | PMD_SECT_AP_WRITE, |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index cda7c40999b6..4e6ef896c619 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -1329,8 +1329,8 @@ static void __init kmap_init(void) | |||
1329 | static void __init map_lowmem(void) | 1329 | static void __init map_lowmem(void) |
1330 | { | 1330 | { |
1331 | struct memblock_region *reg; | 1331 | struct memblock_region *reg; |
1332 | unsigned long kernel_x_start = round_down(__pa(_stext), SECTION_SIZE); | 1332 | phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE); |
1333 | unsigned long kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE); | 1333 | phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE); |
1334 | 1334 | ||
1335 | /* Map all the lowmem memory banks. */ | 1335 | /* Map all the lowmem memory banks. */ |
1336 | for_each_memblock(memory, reg) { | 1336 | for_each_memblock(memory, reg) { |