aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Documentation/ABI/testing/sysfs-devices-platform-dock39
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu77
-rw-r--r--Documentation/ABI/testing/sysfs-platform-dptf40
-rw-r--r--Documentation/PCI/pci.txt4
-rw-r--r--Documentation/atomic_bitops.txt7
-rw-r--r--Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp42
-rw-r--r--Documentation/devicetree/bindings/arm/cpus.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/mediatek.txt9
-rw-r--r--Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/npcm/npcm.txt6
-rw-r--r--Documentation/devicetree/bindings/arm/omap/ctrl.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/qcom.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt4
-rw-r--r--Documentation/devicetree/bindings/arm/shmobile.txt18
-rw-r--r--Documentation/devicetree/bindings/arm/stm32.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/tegra.txt16
-rw-r--r--Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/xilinx.txt56
-rw-r--r--Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt (renamed from Documentation/devicetree/bindings/misc/arm-charlcd.txt)0
-rw-r--r--Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt6
-rw-r--r--Documentation/devicetree/bindings/crypto/fsl-sec4.txt17
-rw-r--r--Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt4
-rw-r--r--Documentation/devicetree/bindings/eeprom/at24.txt2
-rw-r--r--Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt1
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt1
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/ti/emif.txt13
-rw-r--r--Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt4
-rw-r--r--Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt1
-rw-r--r--Documentation/devicetree/bindings/power/mti,mips-cpc.txt8
-rw-r--r--Documentation/devicetree/bindings/power/wakeup-source.txt2
-rw-r--r--Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt9
-rw-r--r--Documentation/devicetree/bindings/thermal/imx-thermal.txt25
-rw-r--r--Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt6
-rw-r--r--Documentation/features/sched/membarrier-sync-core/arch-support.txt62
-rw-r--r--Documentation/gpu/tve200.rst2
-rw-r--r--Documentation/i2c/busses/i2c-i8012
-rw-r--r--Documentation/locking/mutex-design.txt49
-rw-r--r--Documentation/media/dmx.h.rst.exceptions14
-rw-r--r--Documentation/media/uapi/dvb/dmx-qbuf.rst7
-rw-r--r--Documentation/networking/segmentation-offloads.txt38
-rw-r--r--Documentation/virtual/kvm/api.txt40
-rw-r--r--Documentation/virtual/kvm/cpuid.txt4
-rw-r--r--Documentation/virtual/kvm/msr.txt3
-rw-r--r--Documentation/x86/intel_rdt_ui.txt2
-rw-r--r--Documentation/x86/topology.txt2
-rw-r--r--MAINTAINERS29
-rw-r--r--Makefile19
-rw-r--r--arch/alpha/include/asm/cmpxchg.h6
-rw-r--r--arch/alpha/include/asm/xchg.h38
-rw-r--r--arch/arc/Kconfig1
-rw-r--r--arch/arc/boot/dts/axs101.dts2
-rw-r--r--arch/arc/boot/dts/axs10x_mb.dtsi4
-rw-r--r--arch/arc/boot/dts/haps_hs_idu.dts2
-rw-r--r--arch/arc/boot/dts/nsim_700.dts2
-rw-r--r--arch/arc/boot/dts/nsim_hs.dts2
-rw-r--r--arch/arc/boot/dts/nsim_hs_idu.dts2
-rw-r--r--arch/arc/boot/dts/nsimosci.dts2
-rw-r--r--arch/arc/boot/dts/nsimosci_hs.dts2
-rw-r--r--arch/arc/boot/dts/nsimosci_hs_idu.dts2
-rw-r--r--arch/arc/include/asm/bug.h3
-rw-r--r--arch/arc/include/asm/entry-arcv2.h2
-rw-r--r--arch/arc/kernel/mcip.c74
-rw-r--r--arch/arc/kernel/setup.c4
-rw-r--r--arch/arc/kernel/smp.c50
-rw-r--r--arch/arc/kernel/unwind.c2
-rw-r--r--arch/arc/mm/cache.c5
-rw-r--r--arch/arm/boot/dts/Makefile37
-rw-r--r--arch/arm/boot/dts/am335x-boneblue.dts2
-rw-r--r--arch/arm/boot/dts/am335x-pdu001.dts595
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi21
-rw-r--r--arch/arm/boot/dts/am4372.dtsi30
-rw-r--r--arch/arm/boot/dts/am437x-gp-evm.dts2
-rw-r--r--arch/arm/boot/dts/am437x-sk-evm.dts2
-rw-r--r--arch/arm/boot/dts/am43x-epos-evm.dts2
-rw-r--r--arch/arm/boot/dts/am571x-idk.dts2
-rw-r--r--arch/arm/boot/dts/am572x-idk.dts3
-rw-r--r--arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi1
-rw-r--r--arch/arm/boot/dts/am57xx-idk-common.dtsi12
-rw-r--r--arch/arm/boot/dts/animeo_ip.dts2
-rw-r--r--arch/arm/boot/dts/arm-realview-eb.dtsi64
-rw-r--r--arch/arm/boot/dts/arm-realview-pb1176.dts66
-rw-r--r--arch/arm/boot/dts/arm-realview-pb11mp.dts78
-rw-r--r--arch/arm/boot/dts/arm-realview-pbx.dtsi82
-rw-r--r--arch/arm/boot/dts/artpec6-devboard.dts3
-rw-r--r--arch/arm/boot/dts/artpec6.dtsi163
-rw-r--r--arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts225
-rw-r--r--arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts206
-rw-r--r--arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts16
-rw-r--r--arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts4
-rw-r--r--arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts4
-rw-r--r--arch/arm/boot/dts/aspeed-g4.dtsi18
-rw-r--r--arch/arm/boot/dts/aspeed-g5.dtsi25
-rw-r--r--arch/arm/boot/dts/at91-nattis-2-natte-2.dts60
-rw-r--r--arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts2
-rw-r--r--arch/arm/boot/dts/at91-tse850-3.dts3
-rw-r--r--arch/arm/boot/dts/at91rm9200.dtsi16
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi24
-rw-r--r--arch/arm/boot/dts/at91sam9260ek.dts2
-rw-r--r--arch/arm/boot/dts/at91sam9261.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9263.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9263ek.dts2
-rw-r--r--arch/arm/boot/dts/at91sam9g20ek_common.dtsi2
-rw-r--r--arch/arm/boot/dts/at91sam9g25.dtsi2
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi16
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi4
-rw-r--r--arch/arm/boot/dts/at91sam9rl.dtsi15
-rw-r--r--arch/arm/boot/dts/at91sam9rlek.dts3
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9x5_usart3.dtsi4
-rw-r--r--arch/arm/boot/dts/atlas7-evb.dts2
-rw-r--r--arch/arm/boot/dts/axp209.dtsi5
-rw-r--r--arch/arm/boot/dts/axp22x.dtsi5
-rw-r--r--arch/arm/boot/dts/axp81x.dtsi12
-rw-r--r--arch/arm/boot/dts/bcm11351.dtsi2
-rw-r--r--arch/arm/boot/dts/bcm21664.dtsi2
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi-zero-w.dts16
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi.dtsi4
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi6
-rw-r--r--arch/arm/boot/dts/bcm2836.dtsi12
-rw-r--r--arch/arm/boot/dts/bcm2837-rpi-3-b.dts17
-rw-r--r--arch/arm/boot/dts/bcm2837.dtsi2
-rw-r--r--arch/arm/boot/dts/bcm283x.dtsi22
-rw-r--r--arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts68
-rw-r--r--arch/arm/boot/dts/bcm958622hr.dts6
-rw-r--r--arch/arm/boot/dts/bcm958623hr.dts6
-rw-r--r--arch/arm/boot/dts/bcm958625hr.dts8
-rw-r--r--arch/arm/boot/dts/bcm958625k.dts6
-rw-r--r--arch/arm/boot/dts/bcm988312hr.dts6
-rw-r--r--arch/arm/boot/dts/da850-evm.dts5
-rw-r--r--arch/arm/boot/dts/da850-lego-ev3.dts19
-rw-r--r--arch/arm/boot/dts/dra7-evm.dts28
-rw-r--r--arch/arm/boot/dts/dra7.dtsi2
-rw-r--r--arch/arm/boot/dts/dra71-evm.dts17
-rw-r--r--arch/arm/boot/dts/dra76-evm.dts50
-rw-r--r--arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi285
-rw-r--r--arch/arm/boot/dts/emev2-kzm9d.dts8
-rw-r--r--arch/arm/boot/dts/exynos-mfc-reserved-memory.dtsi5
-rw-r--r--arch/arm/boot/dts/exynos-syscon-restart.dtsi5
-rw-r--r--arch/arm/boot/dts/exynos3250-artik5.dtsi36
-rw-r--r--arch/arm/boot/dts/exynos3250.dtsi15
-rw-r--r--arch/arm/boot/dts/exynos4.dtsi1719
-rw-r--r--arch/arm/boot/dts/exynos4210-pinctrl.dtsi1680
-rw-r--r--arch/arm/boot/dts/exynos4210-trats.dts74
-rw-r--r--arch/arm/boot/dts/exynos4210-universal_c210.dts115
-rw-r--r--arch/arm/boot/dts/exynos4210.dtsi610
-rw-r--r--arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi140
-rw-r--r--arch/arm/boot/dts/exynos4412-i9300.dts22
-rw-r--r--arch/arm/boot/dts/exynos4412-i9305.dts20
-rw-r--r--arch/arm/boot/dts/exynos4412-itop-elite.dts16
-rw-r--r--arch/arm/boot/dts/exynos4412-midas.dtsi1308
-rw-r--r--arch/arm/boot/dts/exynos4412-n710x.dts77
-rw-r--r--arch/arm/boot/dts/exynos4412-odroid-common.dtsi12
-rw-r--r--arch/arm/boot/dts/exynos4412-pinctrl.dtsi1914
-rw-r--r--arch/arm/boot/dts/exynos4412-tiny4412.dts7
-rw-r--r--arch/arm/boot/dts/exynos4412-tmu-sensor-conf.dtsi6
-rw-r--r--arch/arm/boot/dts/exynos4412-trats2.dts1396
-rw-r--r--arch/arm/boot/dts/exynos4412.dtsi868
-rw-r--r--arch/arm/boot/dts/exynos5250-snow-common.dtsi18
-rw-r--r--arch/arm/boot/dts/exynos5250-snow.dts11
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi15
-rw-r--r--arch/arm/boot/dts/exynos5260-xyref5260.dts1
-rw-r--r--arch/arm/boot/dts/exynos5410.dtsi9
-rw-r--r--arch/arm/boot/dts/exynos5420-cpus.dtsi16
-rw-r--r--arch/arm/boot/dts/exynos5420-peach-pit.dts17
-rw-r--r--arch/arm/boot/dts/exynos5422-cpus.dtsi16
-rw-r--r--arch/arm/boot/dts/exynos5440.dtsi514
-rw-r--r--arch/arm/boot/dts/exynos5800-peach-pi.dts22
-rw-r--r--arch/arm/boot/dts/exynos5800.dtsi5
-rw-r--r--arch/arm/boot/dts/gemini-dlink-dns-313.dts4
-rw-r--r--arch/arm/boot/dts/imx1-ads.dts2
-rw-r--r--arch/arm/boot/dts/imx1-apf9328.dts2
-rw-r--r--arch/arm/boot/dts/imx1.dtsi2
-rw-r--r--arch/arm/boot/dts/imx23-evk.dts2
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts2
-rw-r--r--arch/arm/boot/dts/imx23-sansa.dts2
-rw-r--r--arch/arm/boot/dts/imx23-stmp378x_devb.dts2
-rw-r--r--arch/arm/boot/dts/imx23-xfi3.dts2
-rw-r--r--arch/arm/boot/dts/imx23.dtsi8
-rw-r--r--arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi2
-rw-r--r--arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts12
-rw-r--r--arch/arm/boot/dts/imx25-karo-tx25.dts2
-rw-r--r--arch/arm/boot/dts/imx25-pdk.dts14
-rw-r--r--arch/arm/boot/dts/imx25-pinfunc.h72
-rw-r--r--arch/arm/boot/dts/imx25.dtsi4
-rw-r--r--arch/arm/boot/dts/imx27-apf27.dts2
-rw-r--r--arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi17
-rw-r--r--arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts2
-rw-r--r--arch/arm/boot/dts/imx27-pdk.dts2
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi2
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi2
-rw-r--r--arch/arm/boot/dts/imx27.dtsi2
-rw-r--r--arch/arm/boot/dts/imx28-apf28.dts2
-rw-r--r--arch/arm/boot/dts/imx28-apx4devkit.dts6
-rw-r--r--arch/arm/boot/dts/imx28-cfa10036.dts2
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts130
-rw-r--r--arch/arm/boot/dts/imx28-duckbill-2-485.dts2
-rw-r--r--arch/arm/boot/dts/imx28-duckbill-2-enocean.dts2
-rw-r--r--arch/arm/boot/dts/imx28-duckbill-2-spi.dts2
-rw-r--r--arch/arm/boot/dts/imx28-duckbill-2.dts2
-rw-r--r--arch/arm/boot/dts/imx28-duckbill.dts2
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts2
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts2
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi1
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts3
-rw-r--r--arch/arm/boot/dts/imx28-m28.dtsi2
-rw-r--r--arch/arm/boot/dts/imx28-m28cu3.dts2
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts1
-rw-r--r--arch/arm/boot/dts/imx28-sps1.dts2
-rw-r--r--arch/arm/boot/dts/imx28-ts4600.dts2
-rw-r--r--arch/arm/boot/dts/imx28-tx28.dts34
-rw-r--r--arch/arm/boot/dts/imx28.dtsi20
-rw-r--r--arch/arm/boot/dts/imx31-bug.dts2
-rw-r--r--arch/arm/boot/dts/imx31.dtsi2
-rw-r--r--arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi2
-rw-r--r--arch/arm/boot/dts/imx35-pdk.dts2
-rw-r--r--arch/arm/boot/dts/imx35.dtsi2
-rw-r--r--arch/arm/boot/dts/imx50-evk.dts2
-rw-r--r--arch/arm/boot/dts/imx50.dtsi2
-rw-r--r--arch/arm/boot/dts/imx51-apf51.dts2
-rw-r--r--arch/arm/boot/dts/imx51-babbage.dts3
-rw-r--r--arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts2
-rw-r--r--arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi2
-rw-r--r--arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi2
-rw-r--r--arch/arm/boot/dts/imx51-ts4800.dts2
-rw-r--r--arch/arm/boot/dts/imx51-zii-rdu1.dts14
-rw-r--r--arch/arm/boot/dts/imx51.dtsi2
-rw-r--r--arch/arm/boot/dts/imx53-ard.dts2
-rw-r--r--arch/arm/boot/dts/imx53-cx9020.dts2
-rw-r--r--arch/arm/boot/dts/imx53-m53.dtsi2
-rw-r--r--arch/arm/boot/dts/imx53-m53evk.dts1
-rw-r--r--arch/arm/boot/dts/imx53-ppd.dts12
-rw-r--r--arch/arm/boot/dts/imx53-qsb-common.dtsi3
-rw-r--r--arch/arm/boot/dts/imx53-smd.dts2
-rw-r--r--arch/arm/boot/dts/imx53-tqma53.dtsi2
-rw-r--r--arch/arm/boot/dts/imx53-tx53-x03x.dts1
-rw-r--r--arch/arm/boot/dts/imx53-tx53-x13x.dts1
-rw-r--r--arch/arm/boot/dts/imx53-tx53.dtsi5
-rw-r--r--arch/arm/boot/dts/imx53-usbarmory.dts2
-rw-r--r--arch/arm/boot/dts/imx53-voipac-bsb.dts1
-rw-r--r--arch/arm/boot/dts/imx53.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6dl-apf6dev.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-aristainetos2_4.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-aristainetos2_7.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-aristainetos_4.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-aristainetos_7.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts9
-rw-r--r--arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts5
-rw-r--r--arch/arm/boot/dts/imx6dl-icore-rqs.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-phytec-mira-rdk-nand.dts64
-rw-r--r--arch/arm/boot/dts/imx6dl-phytec-pfla02.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6dl-rex-basic.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-riotboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-ts4900.dts5
-rw-r--r--arch/arm/boot/dts/imx6dl-ts7970.dts5
-rw-r--r--arch/arm/boot/dts/imx6dl-wandboard-revb1.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-wandboard-revd1.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl-wandboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6dl.dtsi10
-rw-r--r--arch/arm/boot/dts/imx6q-apf6dev.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-arm2.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-ba16.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6q-bx50v3.dtsi8
-rw-r--r--arch/arm/boot/dts/imx6q-cm-fx6.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts5
-rw-r--r--arch/arm/boot/dts/imx6q-display5.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-dms-ba16.dts139
-rw-r--r--arch/arm/boot/dts/imx6q-evi.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-gk802.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-gw5400-a.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-h100.dts7
-rw-r--r--arch/arm/boot/dts/imx6q-marsboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-mccmon6.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-novena.dts5
-rw-r--r--arch/arm/boot/dts/imx6q-phytec-mira-rdk-emmc.dts72
-rw-r--r--arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts72
-rw-r--r--arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6q-pistachio.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-rex-pro.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-sbc6x.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-tbs2910.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-ts4900.dts5
-rw-r--r--arch/arm/boot/dts/imx6q-ts7970.dts5
-rw-r--r--arch/arm/boot/dts/imx6q-wandboard-revb1.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-wandboard-revd1.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-wandboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-zii-rdu2.dts5
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi5
-rw-r--r--arch/arm/boot/dts/imx6qdl-apalis.dtsi5
-rw-r--r--arch/arm/boot/dts/imx6qdl-cubox-i.dtsi5
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw51xx.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw52xx.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw53xx.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw54xx.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw551x.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw552x.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw553x.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw560x.dtsi1
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw5903.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw5904.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-hummingboard.dtsi10
-rw-r--r--arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi9
-rw-r--r--arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi8
-rw-r--r--arch/arm/boot/dts/imx6qdl-icore.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-phytec-mira.dtsi390
-rw-r--r--arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi279
-rw-r--r--arch/arm/boot/dts/imx6qdl-rex.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabreauto.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabrelite.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabresd.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-tx6.dtsi4
-rw-r--r--arch/arm/boot/dts/imx6qdl-udoo.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-var-dart.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi22
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi4
-rw-r--r--arch/arm/boot/dts/imx6qp-phytec-mira-rdk-nand.dts72
-rw-r--r--arch/arm/boot/dts/imx6qp-wandboard-revd1.dts2
-rw-r--r--arch/arm/boot/dts/imx6qp-zii-rdu2.dts5
-rw-r--r--arch/arm/boot/dts/imx6sl-evk.dts2
-rw-r--r--arch/arm/boot/dts/imx6sl-warp.dts2
-rw-r--r--arch/arm/boot/dts/imx6sl.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6sx-nitrogen6sx.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-sabreauto.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-sdb.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6sx-softing-vining-2000.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-udoo-neo-basic.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-udoo-neo-full.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx.dtsi20
-rw-r--r--arch/arm/boot/dts/imx6ul-14x14-evk.dts480
-rw-r--r--arch/arm/boot/dts/imx6ul-14x14-evk.dtsi499
-rw-r--r--arch/arm/boot/dts/imx6ul-geam.dts3
-rw-r--r--arch/arm/boot/dts/imx6ul-isiot.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6ul-litesom.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6ul-opos6ul.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6ul-pico-hobbit.dts2
-rw-r--r--arch/arm/boot/dts/imx6ul-pinfunc.h169
-rw-r--r--arch/arm/boot/dts/imx6ul-tx6ul.dtsi4
-rw-r--r--arch/arm/boot/dts/imx6ul.dtsi31
-rw-r--r--arch/arm/boot/dts/imx6ull-14x14-evk.dts5
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts14
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi157
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi23
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dts14
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri-wifi.dtsi65
-rw-r--r--arch/arm/boot/dts/imx6ull-colibri.dtsi553
-rw-r--r--arch/arm/boot/dts/imx6ull-pinfunc-snvs.h26
-rw-r--r--arch/arm/boot/dts/imx6ull.dtsi32
-rw-r--r--arch/arm/boot/dts/imx7d-cl-som-imx7.dts54
-rw-r--r--arch/arm/boot/dts/imx7d-colibri-emmc.dtsi2
-rw-r--r--arch/arm/boot/dts/imx7d-colibri.dtsi2
-rw-r--r--arch/arm/boot/dts/imx7d-nitrogen7.dts2
-rw-r--r--arch/arm/boot/dts/imx7d-pico.dtsi2
-rw-r--r--arch/arm/boot/dts/imx7d-sdb.dts7
-rw-r--r--arch/arm/boot/dts/imx7s-colibri.dtsi2
-rw-r--r--arch/arm/boot/dts/imx7s-warp.dts18
-rw-r--r--arch/arm/boot/dts/imx7s.dtsi280
-rw-r--r--arch/arm/boot/dts/keystone-k2e-clocks.dtsi2
-rw-r--r--arch/arm/boot/dts/keystone-k2e.dtsi13
-rw-r--r--arch/arm/boot/dts/keystone-k2g.dtsi82
-rw-r--r--arch/arm/boot/dts/keystone-k2hk.dtsi104
-rw-r--r--arch/arm/boot/dts/keystone-k2l.dtsi52
-rw-r--r--arch/arm/boot/dts/keystone.dtsi42
-rw-r--r--arch/arm/boot/dts/logicpd-som-lv.dtsi25
-rw-r--r--arch/arm/boot/dts/logicpd-torpedo-som.dtsi24
-rw-r--r--arch/arm/boot/dts/ls1021a.dtsi16
-rw-r--r--arch/arm/boot/dts/meson8.dtsi9
-rw-r--r--arch/arm/boot/dts/meson8b-odroidc1.dts88
-rw-r--r--arch/arm/boot/dts/meson8b.dtsi59
-rw-r--r--arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi13
-rw-r--r--arch/arm/boot/dts/mt7623.dtsi126
-rw-r--r--arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts133
-rw-r--r--arch/arm/boot/dts/mt7623n-rfb-nand.dts6
-rw-r--r--arch/arm/boot/dts/nuvoton-npcm750-evb.dts35
-rw-r--r--arch/arm/boot/dts/nuvoton-npcm750.dtsi165
-rw-r--r--arch/arm/boot/dts/omap3-n9.dts7
-rw-r--r--arch/arm/boot/dts/omap3.dtsi1
-rw-r--r--arch/arm/boot/dts/omap4-droid4-xt894.dts203
-rw-r--r--arch/arm/boot/dts/omap443x.dtsi2
-rw-r--r--arch/arm/boot/dts/omap4460.dtsi2
-rw-r--r--arch/arm/boot/dts/omap5-board-common.dtsi4
-rw-r--r--arch/arm/boot/dts/omap5-uevm.dts2
-rw-r--r--arch/arm/boot/dts/omap5.dtsi24
-rw-r--r--arch/arm/boot/dts/omap54xx-clocks.dtsi10
-rw-r--r--arch/arm/boot/dts/orion5x-lacie-d2-network.dts2
-rw-r--r--arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts2
-rw-r--r--arch/arm/boot/dts/orion5x-linkstation.dtsi2
-rw-r--r--arch/arm/boot/dts/orion5x-lswsgl.dts2
-rw-r--r--arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts2
-rw-r--r--arch/arm/boot/dts/orion5x-rd88f5182-nas.dts2
-rw-r--r--arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts2
-rw-r--r--arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts2
-rw-r--r--arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts2
-rw-r--r--arch/arm/boot/dts/qcom-apq8064.dtsi63
-rw-r--r--arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts24
-rw-r--r--arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts4
-rw-r--r--arch/arm/boot/dts/r8a7743-iwg20m.dtsi4
-rw-r--r--arch/arm/boot/dts/r8a7743.dtsi1216
-rw-r--r--arch/arm/boot/dts/r8a7745-iwg22m.dtsi4
-rw-r--r--arch/arm/boot/dts/r8a7745.dtsi1156
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen.dts14
-rw-r--r--arch/arm/boot/dts/r8a7790-lager.dts287
-rw-r--r--arch/arm/boot/dts/r8a7790-stout.dts363
-rw-r--r--arch/arm/boot/dts/r8a7790.dtsi2837
-rw-r--r--arch/arm/boot/dts/r8a7791-koelsch.dts232
-rw-r--r--arch/arm/boot/dts/r8a7791-porter.dts130
-rw-r--r--arch/arm/boot/dts/r8a7791.dtsi2986
-rw-r--r--arch/arm/boot/dts/r8a7792.dtsi498
-rw-r--r--arch/arm/boot/dts/r8a7793-gose.dts252
-rw-r--r--arch/arm/boot/dts/r8a7793.dtsi2392
-rw-r--r--arch/arm/boot/dts/r8a7794-alt.dts53
-rw-r--r--arch/arm/boot/dts/r8a7794-silk.dts189
-rw-r--r--arch/arm/boot/dts/r8a7794.dtsi2421
-rw-r--r--arch/arm/boot/dts/rk3036.dtsi4
-rw-r--r--arch/arm/boot/dts/rk322x.dtsi6
-rw-r--r--arch/arm/boot/dts/rk3288-phycore-som.dtsi20
-rw-r--r--arch/arm/boot/dts/sama5d3.dtsi24
-rw-r--r--arch/arm/boot/dts/sama5d34ek.dts2
-rw-r--r--arch/arm/boot/dts/sama5d3_uart.dtsi8
-rw-r--r--arch/arm/boot/dts/sama5d4.dtsi30
-rw-r--r--arch/arm/boot/dts/samsung_k3pe0e000b.dtsi68
-rw-r--r--arch/arm/boot/dts/socfpga.dtsi2
-rw-r--r--arch/arm/boot/dts/stih407-b2120.dts4
-rw-r--r--arch/arm/boot/dts/stih407-clock.dtsi92
-rw-r--r--arch/arm/boot/dts/stih407-family.dtsi42
-rw-r--r--arch/arm/boot/dts/stih407-pinctrl.dtsi10
-rw-r--r--arch/arm/boot/dts/stih407.dtsi5
-rw-r--r--arch/arm/boot/dts/stih410-b2120.dts10
-rw-r--r--arch/arm/boot/dts/stih410-b2260.dts91
-rw-r--r--arch/arm/boot/dts/stih410-clock.dtsi96
-rw-r--r--arch/arm/boot/dts/stih410-pinctrl.dtsi2
-rw-r--r--arch/arm/boot/dts/stih410.dtsi14
-rw-r--r--arch/arm/boot/dts/stih418-b2199.dts32
-rw-r--r--arch/arm/boot/dts/stih418-clock.dtsi95
-rw-r--r--arch/arm/boot/dts/stih418.dtsi6
-rw-r--r--arch/arm/boot/dts/stihxxx-b2120.dtsi126
-rw-r--r--arch/arm/boot/dts/stm32429i-eval.dts19
-rw-r--r--arch/arm/boot/dts/stm32746g-eval.dts20
-rw-r--r--arch/arm/boot/dts/stm32f4-pinctrl.dtsi31
-rw-r--r--arch/arm/boot/dts/stm32f429.dtsi11
-rw-r--r--arch/arm/boot/dts/stm32f469-disco.dts50
-rw-r--r--arch/arm/boot/dts/stm32f7-pinctrl.dtsi289
-rw-r--r--arch/arm/boot/dts/stm32f746-disco.dts20
-rw-r--r--arch/arm/boot/dts/stm32f746-pinctrl.dtsi11
-rw-r--r--arch/arm/boot/dts/stm32f746.dtsi242
-rw-r--r--arch/arm/boot/dts/stm32f769-disco.dts65
-rw-r--r--arch/arm/boot/dts/stm32f769-pinctrl.dtsi11
-rw-r--r--arch/arm/boot/dts/stm32h743-pinctrl.dtsi44
-rw-r--r--arch/arm/boot/dts/stm32h743.dtsi112
-rw-r--r--arch/arm/boot/dts/stm32h743i-disco.dts2
-rw-r--r--arch/arm/boot/dts/stm32h743i-eval.dts20
-rw-r--r--arch/arm/boot/dts/stm32mp157-pinctrl.dtsi185
-rw-r--r--arch/arm/boot/dts/stm32mp157c-ed1.dts32
-rw-r--r--arch/arm/boot/dts/stm32mp157c-ev1.dts21
-rw-r--r--arch/arm/boot/dts/stm32mp157c.dtsi194
-rw-r--r--arch/arm/boot/dts/sun4i-a10-a1000.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-cubieboard.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-gemei-g9.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-hackberry.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-inet1.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-inet97fv2.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-marsboard.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-mini-xplus.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-mk802.dts28
-rw-r--r--arch/arm/boot/dts/sun4i-a10-mk802ii.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts4
-rw-r--r--arch/arm/boot/dts/sun4i-a10-pcduino.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts3
-rw-r--r--arch/arm/boot/dts/sun4i-a10.dtsi2
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-mk802.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts6
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a13-hsg-h702.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a13-olinuxino.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-a13.dtsi2
-rw-r--r--arch/arm/boot/dts/sun5i-gr8-evb.dts3
-rw-r--r--arch/arm/boot/dts/sun5i-reference-design-tablet.dtsi3
-rw-r--r--arch/arm/boot/dts/sun6i-a31-colombus.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31-hummingbird.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31-i7.dts32
-rw-r--r--arch/arm/boot/dts/sun6i-a31-m9.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31.dtsi2
-rw-r--r--arch/arm/boot/dts/sun6i-a31s-primo81.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31s-sina31s.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts3
-rw-r--r--arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-bananapi.dts28
-rw-r--r--arch/arm/boot/dts/sun7i-a20-bananapro.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-cubieboard2.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-cubietruck.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-hummingbird.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-icnova-swac.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-itead-ibox.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-m3.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-mk808c.dts28
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts31
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olimex-som204-evb-emmc.dts36
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olimex-som204-evb.dts335
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts6
-rw-r--r--arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts31
-rw-r--r--arch/arm/boot/dts/sun7i-a20-orangepi.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-pcduino3.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts3
-rw-r--r--arch/arm/boot/dts/sun7i-a20.dtsi29
-rw-r--r--arch/arm/boot/dts/sun8i-a23-evb.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-a33-olinuxino.dts58
-rw-r--r--arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-a33.dtsi1
-rw-r--r--arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts42
-rw-r--r--arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts12
-rw-r--r--arch/arm/boot/dts/sun8i-a83t.dtsi230
-rw-r--r--arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts121
-rw-r--r--arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts8
-rw-r--r--arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts11
-rw-r--r--arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts32
-rw-r--r--arch/arm/boot/dts/sun8i-h3-beelink-x2.dts32
-rw-r--r--arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts30
-rw-r--r--arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts12
-rw-r--r--arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts25
-rw-r--r--arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts27
-rw-r--r--arch/arm/boot/dts/sun8i-h3-nanopi.dtsi5
-rw-r--r--arch/arm/boot/dts/sun8i-h3-orangepi-2.dts32
-rw-r--r--arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts32
-rw-r--r--arch/arm/boot/dts/sun8i-h3-orangepi-one.dts29
-rw-r--r--arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts2
-rw-r--r--arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts30
-rw-r--r--arch/arm/boot/dts/sun8i-h3.dtsi27
-rw-r--r--arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts3
-rw-r--r--arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi11
-rw-r--r--arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts3
-rw-r--r--arch/arm/boot/dts/sun9i-a80-cubieboard4.dts71
-rw-r--r--arch/arm/boot/dts/sun9i-a80-optimus.dts3
-rw-r--r--arch/arm/boot/dts/sun9i-a80.dtsi475
-rw-r--r--arch/arm/boot/dts/sunxi-h3-h5.dtsi122
-rw-r--r--arch/arm/boot/dts/tegra114-dalmore.dts2
-rw-r--r--arch/arm/boot/dts/tegra124-apalis-eval.dts23
-rw-r--r--arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts250
-rw-r--r--arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi2052
-rw-r--r--arch/arm/boot/dts/tegra124-apalis.dtsi72
-rw-r--r--arch/arm/boot/dts/tegra124-jetson-tk1.dts2
-rw-r--r--arch/arm/boot/dts/tegra124-venice2.dts9
-rw-r--r--arch/arm/boot/dts/tegra20-colibri-512.dtsi16
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi4
-rw-r--r--arch/arm/boot/dts/tegra30-apalis-eval.dts4
-rw-r--r--arch/arm/boot/dts/tegra30-apalis.dtsi7
-rw-r--r--arch/arm/boot/dts/tegra30-beaver.dts32
-rw-r--r--arch/arm/boot/dts/tegra30-colibri-eval-v3.dts6
-rw-r--r--arch/arm/boot/dts/tegra30-colibri.dtsi3
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi35
-rw-r--r--arch/arm/boot/dts/uniphier-ld4-ref.dts14
-rw-r--r--arch/arm/boot/dts/uniphier-ld4.dtsi14
-rw-r--r--arch/arm/boot/dts/uniphier-ld6b-ref.dts25
-rw-r--r--arch/arm/boot/dts/uniphier-ld6b.dtsi14
-rw-r--r--arch/arm/boot/dts/uniphier-pinctrl.dtsi54
-rw-r--r--arch/arm/boot/dts/uniphier-pro4-ace.dts25
-rw-r--r--arch/arm/boot/dts/uniphier-pro4-ref.dts25
-rw-r--r--arch/arm/boot/dts/uniphier-pro4-sanji.dts25
-rw-r--r--arch/arm/boot/dts/uniphier-pro4.dtsi32
-rw-r--r--arch/arm/boot/dts/uniphier-pro5.dtsi14
-rw-r--r--arch/arm/boot/dts/uniphier-pxs2-gentil.dts49
-rw-r--r--arch/arm/boot/dts/uniphier-pxs2-vodka.dts62
-rw-r--r--arch/arm/boot/dts/uniphier-pxs2.dtsi86
-rw-r--r--arch/arm/boot/dts/uniphier-ref-daughter.dtsi14
-rw-r--r--arch/arm/boot/dts/uniphier-sld8-ref.dts14
-rw-r--r--arch/arm/boot/dts/uniphier-sld8.dtsi14
-rw-r--r--arch/arm/boot/dts/uniphier-support-card.dtsi14
-rw-r--r--arch/arm/boot/dts/versatile-ab-ib2.dts26
-rw-r--r--arch/arm/boot/dts/versatile-ab.dts83
-rw-r--r--arch/arm/boot/dts/vf500-colibri.dtsi2
-rw-r--r--arch/arm/boot/dts/vf500.dtsi7
-rw-r--r--arch/arm/boot/dts/vf610-colibri.dtsi2
-rw-r--r--arch/arm/boot/dts/vf610-cosmic.dts2
-rw-r--r--arch/arm/boot/dts/vf610-twr.dts2
-rw-r--r--arch/arm/boot/dts/vf610-zii-dev.dtsi2
-rw-r--r--arch/arm/boot/dts/vf610m4-colibri.dts4
-rw-r--r--arch/arm/boot/dts/vf610m4.dtsi9
-rw-r--r--arch/arm/boot/dts/zx296702.dtsi20
-rw-r--r--arch/arm/boot/dts/zynq-7000.dtsi12
-rw-r--r--arch/arm/boot/dts/zynq-cc108.dts75
-rw-r--r--arch/arm/boot/dts/zynq-microzed.dts12
-rw-r--r--arch/arm/boot/dts/zynq-parallella.dts10
-rw-r--r--arch/arm/boot/dts/zynq-zc702.dts12
-rw-r--r--arch/arm/boot/dts/zynq-zc706.dts12
-rw-r--r--arch/arm/boot/dts/zynq-zc770-xm010.dts95
-rw-r--r--arch/arm/boot/dts/zynq-zc770-xm011.dts64
-rw-r--r--arch/arm/boot/dts/zynq-zc770-xm012.dts64
-rw-r--r--arch/arm/boot/dts/zynq-zc770-xm013.dts78
-rw-r--r--arch/arm/boot/dts/zynq-zed.dts10
-rw-r--r--arch/arm/boot/dts/zynq-zybo-z7.dts58
-rw-r--r--arch/arm/boot/dts/zynq-zybo.dts10
-rw-r--r--arch/arm/configs/multi_v7_defconfig1
-rw-r--r--arch/arm/configs/omap2plus_defconfig5
-rw-r--r--arch/arm/kernel/time.c2
-rw-r--r--arch/arm/kvm/hyp/Makefile5
-rw-r--r--arch/arm/kvm/hyp/banked-sr.c4
-rw-r--r--arch/arm/mach-clps711x/board-dt.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c2
-rw-r--r--arch/arm/mach-mvebu/Kconfig4
-rw-r--r--arch/arm/mach-omap1/clock.c6
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c6
-rw-r--r--arch/arm/mach-omap2/pm.c4
-rw-r--r--arch/arm/mach-omap2/timer.c19
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c35
-rw-r--r--arch/arm/plat-orion/common.c23
-rw-r--r--arch/arm64/Kconfig.platforms12
-rw-r--r--arch/arm64/boot/dts/allwinner/Makefile3
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts3
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts3
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts3
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts3
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts8
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts265
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi99
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts4
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts2
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts27
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts29
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts143
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts29
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts29
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi175
-rw-r--r--arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts5
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-axg-s400.dts18
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-axg.dtsi279
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gx.dtsi50
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts42
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts42
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts82
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts122
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi256
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi50
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi14
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905d.dtsi39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts4
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts4
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts4
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi4
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxl.dtsi40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts9
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-q201.dts39
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts40
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm-vega-s96.dts3
-rw-r--r--arch/arm64/boot/dts/amlogic/meson-gxm.dtsi39
-rw-r--r--arch/arm64/boot/dts/arm/juno-base.dtsi21
-rw-r--r--arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi3
-rw-r--r--arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi90
-rw-r--r--arch/arm64/boot/dts/exynos/exynos5433.dtsi24
-rw-r--r--arch/arm64/boot/dts/exynos/exynos7-espresso.dts2
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi80
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi83
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi66
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi134
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi2
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi8
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi98
-rw-r--r--arch/arm64/boot/dts/freescale/qoriq-bman-portals.dtsi6
-rw-r--r--arch/arm64/boot/dts/freescale/qoriq-qman-portals.dtsi7
-rw-r--r--arch/arm64/boot/dts/hisilicon/hi3660.dtsi32
-rw-r--r--arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts4
-rw-r--r--arch/arm64/boot/dts/hisilicon/hi6220.dtsi10
-rw-r--r--arch/arm64/boot/dts/hisilicon/hip06.dtsi56
-rw-r--r--arch/arm64/boot/dts/hisilicon/hip07.dtsi33
-rw-r--r--arch/arm64/boot/dts/marvell/armada-371x.dtsi38
-rw-r--r--arch/arm64/boot/dts/marvell/armada-3720-db.dts39
-rw-r--r--arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-372x.dtsi38
-rw-r--r--arch/arm64/boot/dts/marvell/armada-37xx.dtsi38
-rw-r--r--arch/arm64/boot/dts/marvell/armada-7020.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-7040-db.dts93
-rw-r--r--arch/arm64/boot/dts/marvell/armada-7040.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-70x0.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8020.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8040-db.dts87
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts65
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8040.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8080-db.dts41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-8080.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-80x0.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-ap806.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-ap810-ap0-octa-core.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-ap810-ap0.dtsi41
-rw-r--r--arch/arm64/boot/dts/marvell/armada-common.dtsi2
-rw-r--r--arch/arm64/boot/dts/marvell/armada-cp110.dtsi118
-rw-r--r--arch/arm64/boot/dts/mediatek/mt2712-evb.dts4
-rw-r--r--arch/arm64/boot/dts/mediatek/mt2712e.dtsi9
-rw-r--r--arch/arm64/boot/dts/mediatek/mt6380.dtsi86
-rw-r--r--arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts469
-rw-r--r--arch/arm64/boot/dts/mediatek/mt7622.dtsi675
-rw-r--r--arch/arm64/boot/dts/mediatek/mt8173.dtsi2
-rw-r--r--arch/arm64/boot/dts/nvidia/Makefile1
-rw-r--r--arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi248
-rw-r--r--arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts16
-rw-r--r--arch/arm64/boot/dts/nvidia/tegra194.dtsi344
-rw-r--r--arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi5
-rw-r--r--arch/arm64/boot/dts/nvidia/tegra210.dtsi16
-rw-r--r--arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi6
-rw-r--r--arch/arm64/boot/dts/qcom/msm8916.dtsi60
-rw-r--r--arch/arm64/boot/dts/qcom/msm8996.dtsi29
-rw-r--r--arch/arm64/boot/dts/renesas/Makefile2
-rw-r--r--arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi3
-rw-r--r--arch/arm64/boot/dts/renesas/r8a7795.dtsi194
-rw-r--r--arch/arm64/boot/dts/renesas/r8a7796.dtsi130
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dts21
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts21
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77965.dtsi878
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77970-eagle.dts33
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts11
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77970.dtsi218
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77980-condor.dts58
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77980.dtsi385
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77995-draak.dts124
-rw-r--r--arch/arm64/boot/dts/renesas/r8a77995.dtsi193
-rw-r--r--arch/arm64/boot/dts/renesas/salvator-common.dtsi8
-rw-r--r--arch/arm64/boot/dts/renesas/ulcb.dtsi1
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3328-rock64.dts7
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3328.dtsi6
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3368.dtsi2
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi2
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3399.dtsi4
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts109
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts25
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi124
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts111
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts25
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi135
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts14
-rw-r--r--arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi14
-rw-r--r--arch/arm64/boot/dts/sprd/sc2731.dtsi169
-rw-r--r--arch/arm64/boot/dts/sprd/sp9860g-1h10.dts2
-rw-r--r--arch/arm64/boot/dts/sprd/whale2.dtsi81
-rw-r--r--arch/arm64/boot/dts/xilinx/Makefile16
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi213
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-ep108-clk.dtsi1
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts13
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dts54
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dts42
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dts42
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dts131
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts168
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dts150
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dts178
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dts125
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts289
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts36
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts548
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dts40
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts195
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts522
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts444
-rw-r--r--arch/arm64/boot/dts/xilinx/zynqmp.dtsi17
-rw-r--r--arch/arm64/include/asm/cputype.h2
-rw-r--r--arch/arm64/include/asm/hugetlb.h2
-rw-r--r--arch/arm64/include/asm/kvm_mmu.h26
-rw-r--r--arch/arm64/include/asm/mmu_context.h4
-rw-r--r--arch/arm64/include/asm/pgalloc.h44
-rw-r--r--arch/arm64/include/asm/pgtable.h23
-rw-r--r--arch/arm64/include/asm/stacktrace.h2
-rw-r--r--arch/arm64/include/asm/uaccess.h12
-rw-r--r--arch/arm64/kernel/armv8_deprecated.c4
-rw-r--r--arch/arm64/kernel/cpu_errata.c9
-rw-r--r--arch/arm64/kernel/cpufeature.c6
-rw-r--r--arch/arm64/kernel/efi.c2
-rw-r--r--arch/arm64/kernel/hibernate.c148
-rw-r--r--arch/arm64/kernel/perf_event.c4
-rw-r--r--arch/arm64/kernel/process.c11
-rw-r--r--arch/arm64/kernel/ptrace.c2
-rw-r--r--arch/arm64/kernel/stacktrace.c5
-rw-r--r--arch/arm64/kernel/sys_compat.c2
-rw-r--r--arch/arm64/kernel/time.c2
-rw-r--r--arch/arm64/kernel/traps.c10
-rw-r--r--arch/arm64/kvm/hyp/switch.c4
-rw-r--r--arch/arm64/mm/dump.c54
-rw-r--r--arch/arm64/mm/fault.c44
-rw-r--r--arch/arm64/mm/hugetlbpage.c94
-rw-r--r--arch/arm64/mm/kasan_init.c70
-rw-r--r--arch/arm64/mm/mmu.c292
-rw-r--r--arch/arm64/mm/pageattr.c32
-rw-r--r--arch/arm64/mm/proc.S14
-rw-r--r--arch/arm64/net/bpf_jit_comp.c5
-rw-r--r--arch/cris/include/arch-v10/arch/bug.h11
-rw-r--r--arch/ia64/include/asm/bug.h6
-rw-r--r--arch/ia64/kernel/Makefile1
-rw-r--r--arch/m68k/include/asm/bug.h3
-rw-r--r--arch/mips/boot/Makefile1
-rw-r--r--arch/mips/include/asm/compat.h1
-rw-r--r--arch/mips/kernel/mips-cpc.c13
-rw-r--r--arch/mips/kernel/setup.c16
-rw-r--r--arch/mips/kernel/smp-bmips.c2
-rw-r--r--arch/parisc/include/asm/cacheflush.h1
-rw-r--r--arch/parisc/include/asm/processor.h2
-rw-r--r--arch/parisc/kernel/cache.c57
-rw-r--r--arch/parisc/kernel/head.S18
-rw-r--r--arch/parisc/kernel/pacache.S22
-rw-r--r--arch/parisc/kernel/smp.c7
-rw-r--r--arch/parisc/kernel/time.c11
-rw-r--r--arch/parisc/mm/init.c7
-rw-r--r--arch/powerpc/include/asm/book3s/32/pgtable.h1
-rw-r--r--arch/powerpc/include/asm/book3s/64/hash-4k.h3
-rw-r--r--arch/powerpc/include/asm/book3s/64/hash-64k.h16
-rw-r--r--arch/powerpc/include/asm/book3s/64/hash.h13
-rw-r--r--arch/powerpc/include/asm/book3s/64/pgalloc.h16
-rw-r--r--arch/powerpc/include/asm/book3s/64/pgtable.h4
-rw-r--r--arch/powerpc/include/asm/exception-64s.h2
-rw-r--r--arch/powerpc/include/asm/firmware.h2
-rw-r--r--arch/powerpc/include/asm/hw_irq.h12
-rw-r--r--arch/powerpc/include/asm/kexec.h6
-rw-r--r--arch/powerpc/include/asm/nohash/32/pgtable.h1
-rw-r--r--arch/powerpc/include/asm/nohash/64/pgtable.h1
-rw-r--r--arch/powerpc/include/asm/topology.h13
-rw-r--r--arch/powerpc/kernel/eeh_driver.c3
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S2
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S6
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/sysfs.c6
-rw-r--r--arch/powerpc/kvm/book3s_xive.c2
-rw-r--r--arch/powerpc/mm/drmem.c14
-rw-r--r--arch/powerpc/mm/hash64_4k.c4
-rw-r--r--arch/powerpc/mm/hash64_64k.c8
-rw-r--r--arch/powerpc/mm/hash_utils_64.c1
-rw-r--r--arch/powerpc/mm/hugetlbpage-hash64.c10
-rw-r--r--arch/powerpc/mm/init-common.c4
-rw-r--r--arch/powerpc/mm/numa.c5
-rw-r--r--arch/powerpc/mm/pgtable-radix.c117
-rw-r--r--arch/powerpc/mm/pgtable_64.c4
-rw-r--r--arch/powerpc/mm/tlb_hash64.c9
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c3
-rw-r--r--arch/powerpc/platforms/powernv/opal-imc.c6
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c2
-rw-r--r--arch/powerpc/platforms/powernv/setup.c4
-rw-r--r--arch/powerpc/platforms/powernv/vas-window.c16
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c4
-rw-r--r--arch/powerpc/platforms/pseries/ras.c31
-rw-r--r--arch/powerpc/platforms/pseries/setup.c3
-rw-r--r--arch/powerpc/sysdev/xive/spapr.c16
-rw-r--r--arch/riscv/Kconfig3
-rw-r--r--arch/riscv/include/asm/barrier.h6
-rw-r--r--arch/riscv/kernel/entry.S5
-rw-r--r--arch/riscv/kernel/head.S2
-rw-r--r--arch/riscv/kernel/setup.c2
-rw-r--r--arch/s390/kvm/intercept.c51
-rw-r--r--arch/s390/kvm/interrupt.c123
-rw-r--r--arch/s390/kvm/kvm-s390.c79
-rw-r--r--arch/s390/kvm/kvm-s390.h7
-rw-r--r--arch/s390/kvm/priv.c192
-rw-r--r--arch/s390/kvm/vsie.c20
-rw-r--r--arch/sh/boot/dts/Makefile4
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/include/asm/bug.h6
-rw-r--r--arch/x86/.gitignore1
-rw-r--r--arch/x86/Kconfig78
-rw-r--r--arch/x86/Kconfig.cpu4
-rw-r--r--arch/x86/Makefile7
-rw-r--r--arch/x86/boot/compressed/eboot.c4
-rw-r--r--arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c10
-rw-r--r--arch/x86/entry/calling.h121
-rw-r--r--arch/x86/entry/entry_32.S3
-rw-r--r--arch/x86/entry/entry_64.S221
-rw-r--r--arch/x86/entry/entry_64_compat.S53
-rw-r--r--arch/x86/events/intel/core.c2
-rw-r--r--arch/x86/events/intel/lbr.c2
-rw-r--r--arch/x86/events/intel/p6.c2
-rw-r--r--arch/x86/include/asm/acpi.h2
-rw-r--r--arch/x86/include/asm/apm.h6
-rw-r--r--arch/x86/include/asm/asm-prototypes.h3
-rw-r--r--arch/x86/include/asm/barrier.h2
-rw-r--r--arch/x86/include/asm/bitops.h29
-rw-r--r--arch/x86/include/asm/bug.h19
-rw-r--r--arch/x86/include/asm/cpufeature.h79
-rw-r--r--arch/x86/include/asm/cpufeatures.h1
-rw-r--r--arch/x86/include/asm/efi.h17
-rw-r--r--arch/x86/include/asm/kvm_host.h6
-rw-r--r--arch/x86/include/asm/microcode.h9
-rw-r--r--arch/x86/include/asm/mmu_context.h1
-rw-r--r--arch/x86/include/asm/nospec-branch.h171
-rw-r--r--arch/x86/include/asm/page_64.h4
-rw-r--r--arch/x86/include/asm/paravirt.h21
-rw-r--r--arch/x86/include/asm/paravirt_types.h7
-rw-r--r--arch/x86/include/asm/percpu.h2
-rw-r--r--arch/x86/include/asm/pgtable.h8
-rw-r--r--arch/x86/include/asm/pgtable_32.h3
-rw-r--r--arch/x86/include/asm/pgtable_64.h1
-rw-r--r--arch/x86/include/asm/pgtable_types.h10
-rw-r--r--arch/x86/include/asm/processor.h8
-rw-r--r--arch/x86/include/asm/refcount.h6
-rw-r--r--arch/x86/include/asm/rmwcc.h16
-rw-r--r--arch/x86/include/asm/smp.h1
-rw-r--r--arch/x86/include/asm/tlbflush.h27
-rw-r--r--arch/x86/include/uapi/asm/hyperv.h18
-rw-r--r--arch/x86/include/uapi/asm/kvm_para.h1
-rw-r--r--arch/x86/kernel/amd_nb.c2
-rw-r--r--arch/x86/kernel/apic/apic.c6
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/apic/vector.c25
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c15
-rw-r--r--arch/x86/kernel/asm-offsets_32.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c28
-rw-r--r--arch/x86/kernel/cpu/bugs.c46
-rw-r--r--arch/x86/kernel/cpu/centaur.c4
-rw-r--r--arch/x86/kernel/cpu/common.c40
-rw-r--r--arch/x86/kernel/cpu/cyrix.c2
-rw-r--r--arch/x86/kernel/cpu/intel.c31
-rw-r--r--arch/x86/kernel/cpu/intel_rdt.c2
-rw-r--r--arch/x86/kernel/cpu/intel_rdt_rdtgroup.c1
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h15
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c19
-rw-r--r--arch/x86/kernel/cpu/microcode/amd.c10
-rw-r--r--arch/x86/kernel/cpu/microcode/core.c39
-rw-r--r--arch/x86/kernel/cpu/microcode/intel.c16
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c4
-rw-r--r--arch/x86/kernel/cpu/proc.c8
-rw-r--r--arch/x86/kernel/head_32.S4
-rw-r--r--arch/x86/kernel/head_64.S2
-rw-r--r--arch/x86/kernel/kvm.c20
-rw-r--r--arch/x86/kernel/machine_kexec_64.c1
-rw-r--r--arch/x86/kernel/module.c1
-rw-r--r--arch/x86/kernel/mpparse.c2
-rw-r--r--arch/x86/kernel/paravirt.c6
-rw-r--r--arch/x86/kernel/setup.c17
-rw-r--r--arch/x86/kernel/setup_percpu.c17
-rw-r--r--arch/x86/kernel/smpboot.c12
-rw-r--r--arch/x86/kernel/traps.c2
-rw-r--r--arch/x86/kernel/unwind_orc.c3
-rw-r--r--arch/x86/kvm/cpuid.c3
-rw-r--r--arch/x86/kvm/lapic.c11
-rw-r--r--arch/x86/kvm/mmu.c12
-rw-r--r--arch/x86/kvm/svm.c90
-rw-r--r--arch/x86/kvm/vmx.c35
-rw-r--r--arch/x86/kvm/x86.c107
-rw-r--r--arch/x86/lib/Makefile1
-rw-r--r--arch/x86/lib/cpu.c2
-rw-r--r--arch/x86/lib/error-inject.c1
-rw-r--r--arch/x86/lib/retpoline.S56
-rw-r--r--arch/x86/mm/cpu_entry_area.c6
-rw-r--r--arch/x86/mm/fault.c4
-rw-r--r--arch/x86/mm/init_32.c15
-rw-r--r--arch/x86/mm/init_64.c6
-rw-r--r--arch/x86/mm/ioremap.c2
-rw-r--r--arch/x86/mm/kmmio.c2
-rw-r--r--arch/x86/mm/mem_encrypt_boot.S2
-rw-r--r--arch/x86/mm/pgtable_32.c2
-rw-r--r--arch/x86/mm/tlb.c6
-rw-r--r--arch/x86/net/bpf_jit_comp.c9
-rw-r--r--arch/x86/oprofile/nmi_int.c2
-rw-r--r--arch/x86/platform/intel-mid/intel-mid.c2
-rw-r--r--arch/x86/platform/uv/tlb_uv.c2
-rw-r--r--arch/x86/realmode/rm/trampoline_64.S2
-rw-r--r--arch/x86/tools/relocs.c3
-rw-r--r--arch/x86/xen/enlighten_pv.c6
-rw-r--r--arch/x86/xen/mmu_pv.c6
-rw-r--r--arch/x86/xen/smp.c2
-rw-r--r--arch/x86/xen/suspend.c16
-rw-r--r--arch/xtensa/kernel/pci-dma.c40
-rw-r--r--arch/xtensa/mm/init.c70
-rw-r--r--block/blk-cgroup.c11
-rw-r--r--block/blk-core.c2
-rw-r--r--block/blk-mq.c5
-rw-r--r--block/genhd.c48
-rw-r--r--block/ioctl.c2
-rw-r--r--block/kyber-iosched.c1
-rw-r--r--block/mq-deadline.c16
-rw-r--r--block/partition-generic.c6
-rw-r--r--block/sed-opal.c2
-rw-r--r--certs/blacklist_nohashes.c2
-rw-r--r--crypto/asymmetric_keys/pkcs7_trust.c1
-rw-r--r--crypto/asymmetric_keys/pkcs7_verify.c12
-rw-r--r--crypto/asymmetric_keys/public_key.c4
-rw-r--r--crypto/asymmetric_keys/restrict.c21
-rw-r--r--crypto/sha3_generic.c218
-rw-r--r--drivers/acpi/bus.c75
-rw-r--r--drivers/acpi/ec.c6
-rw-r--r--drivers/acpi/property.c4
-rw-r--r--drivers/acpi/spcr.c1
-rw-r--r--drivers/android/binder.c29
-rw-r--r--drivers/base/core.c3
-rw-r--r--drivers/base/power/wakeirq.c6
-rw-r--r--drivers/base/property.c5
-rw-r--r--drivers/block/amiflop.c2
-rw-r--r--drivers/block/ataflop.c2
-rw-r--r--drivers/block/brd.c2
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/block/loop.c2
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/block/swim.c2
-rw-r--r--drivers/block/z2ram.c2
-rw-r--r--drivers/bus/ti-sysc.c2
-rw-r--r--drivers/char/hw_random/via-rng.c2
-rw-r--r--drivers/char/tpm/st33zp24/st33zp24.c4
-rw-r--r--drivers/char/tpm/tpm-interface.c4
-rw-r--r--drivers/char/tpm/tpm2-cmd.c4
-rw-r--r--drivers/char/tpm/tpm_i2c_infineon.c5
-rw-r--r--drivers/char/tpm/tpm_i2c_nuvoton.c8
-rw-r--r--drivers/char/tpm/tpm_tis_core.c5
-rw-r--r--drivers/clk/imx/clk-imx7d.c3
-rw-r--r--drivers/clocksource/arc_timer.c11
-rw-r--r--drivers/clocksource/fsl_ftm_timer.c2
-rw-r--r--drivers/clocksource/mips-gic-timer.c6
-rw-r--r--drivers/clocksource/timer-sun5i.c2
-rw-r--r--drivers/cpufreq/Kconfig.arm6
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c2
-rw-r--r--drivers/cpufreq/longhaul.c6
-rw-r--r--drivers/cpufreq/p4-clockmod.c2
-rw-r--r--drivers/cpufreq/powernow-k7.c2
-rw-r--r--drivers/cpufreq/s3c24xx-cpufreq.c8
-rw-r--r--drivers/cpufreq/scpi-cpufreq.c16
-rw-r--r--drivers/cpufreq/speedstep-centrino.c4
-rw-r--r--drivers/cpufreq/speedstep-lib.c6
-rw-r--r--drivers/crypto/caam/ctrl.c8
-rw-r--r--drivers/crypto/ccp/psp-dev.c8
-rw-r--r--drivers/crypto/padlock-aes.c2
-rw-r--r--drivers/crypto/s5p-sss.c12
-rw-r--r--drivers/crypto/sunxi-ss/sun4i-ss-prng.c6
-rw-r--r--drivers/crypto/talitos.c4
-rw-r--r--drivers/dax/super.c6
-rw-r--r--drivers/edac/amd64_edac.c2
-rw-r--r--drivers/edac/sb_edac.c2
-rw-r--r--drivers/extcon/extcon-axp288.c36
-rw-r--r--drivers/extcon/extcon-intel-int3496.c3
-rw-r--r--drivers/gpio/gpiolib-of.c15
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c58
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c26
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c7
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c18
-rw-r--r--drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c2
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c4
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c4
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c18
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c11
-rw-r--r--drivers/gpu/drm/cirrus/cirrus_mode.c40
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c15
-rw-r--r--drivers/gpu/drm/drm_edid.c21
-rw-r--r--drivers/gpu/drm/drm_framebuffer.c4
-rw-r--r--drivers/gpu/drm/drm_mm.c21
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c20
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c12
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_rotator.h19
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c7
-rw-r--r--drivers/gpu/drm/exynos/regs-fimc.h2
-rw-r--r--drivers/gpu/drm/exynos/regs-hdmi.h2
-rw-r--r--drivers/gpu/drm/i915/gvt/kvmgt.c51
-rw-r--r--drivers/gpu/drm/i915/gvt/mmio_context.c1
-rw-r--r--drivers/gpu/drm/i915/gvt/trace.h2
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c14
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c4
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.c4
-rw-r--r--drivers/gpu/drm/i915/i915_oa_cflgt3.c4
-rw-r--r--drivers/gpu/drm/i915/i915_oa_cnl.c4
-rw-r--r--drivers/gpu/drm/i915/i915_pmu.c231
-rw-r--r--drivers/gpu/drm/i915/i915_pmu.h6
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h4
-rw-r--r--drivers/gpu/drm/i915/intel_audio.c6
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c105
-rw-r--r--drivers/gpu/drm/i915/intel_breadcrumbs.c29
-rw-r--r--drivers/gpu/drm/i915/intel_cdclk.c8
-rw-r--r--drivers/gpu/drm/i915/intel_engine_cs.c24
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h14
-rw-r--r--drivers/gpu/drm/meson/meson_crtc.c6
-rw-r--r--drivers/gpu/drm/meson/meson_drv.h3
-rw-r--r--drivers/gpu/drm/meson/meson_plane.c7
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c18
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c1
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c74
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c6
-rw-r--r--drivers/gpu/drm/scheduler/gpu_scheduler.c2
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_tcon.c7
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_ioctl.c17
-rw-r--r--drivers/gpu/ipu-v3/ipu-common.c4
-rw-r--r--drivers/gpu/ipu-v3/ipu-cpmem.c2
-rw-r--r--drivers/gpu/ipu-v3/ipu-csi.c2
-rw-r--r--drivers/gpu/ipu-v3/ipu-pre.c3
-rw-r--r--drivers/gpu/ipu-v3/ipu-prg.c3
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-quirks.c3
-rw-r--r--drivers/hwmon/coretemp.c6
-rw-r--r--drivers/hwmon/hwmon-vid.c2
-rw-r--r--drivers/hwmon/k10temp.c7
-rw-r--r--drivers/hwmon/k8temp.c2
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-bcm2835.c21
-rw-r--r--drivers/i2c/busses/i2c-designware-master.c4
-rw-r--r--drivers/i2c/busses/i2c-i801.c1
-rw-r--r--drivers/i2c/busses/i2c-octeon-core.c1
-rw-r--r--drivers/i2c/busses/i2c-octeon-core.h2
-rw-r--r--drivers/i2c/busses/i2c-sirf.c4
-rw-r--r--drivers/ide/ide-probe.c2
-rw-r--r--drivers/iio/adc/aspeed_adc.c7
-rw-r--r--drivers/iio/adc/stm32-adc.c7
-rw-r--r--drivers/iio/imu/adis_trigger.c7
-rw-r--r--drivers/iio/industrialio-buffer.c2
-rw-r--r--drivers/iio/proximity/Kconfig2
-rw-r--r--drivers/infiniband/core/core_priv.h7
-rw-r--r--drivers/infiniband/core/rdma_core.c38
-rw-r--r--drivers/infiniband/core/restrack.c23
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c50
-rw-r--r--drivers/infiniband/core/uverbs_ioctl.c3
-rw-r--r--drivers/infiniband/core/uverbs_ioctl_merge.c18
-rw-r--r--drivers/infiniband/core/uverbs_main.c29
-rw-r--r--drivers/infiniband/core/uverbs_std_types.c12
-rw-r--r--drivers/infiniband/core/verbs.c3
-rw-r--r--drivers/infiniband/hw/bnxt_re/bnxt_re.h2
-rw-r--r--drivers/infiniband/hw/bnxt_re/ib_verbs.c54
-rw-r--r--drivers/infiniband/hw/bnxt_re/ib_verbs.h2
-rw-r--r--drivers/infiniband/hw/bnxt_re/main.c12
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_fp.c21
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_fp.h4
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_sp.c14
-rw-r--r--drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c4
-rw-r--r--drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c4
-rw-r--r--drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_fs.c2
-rw-r--r--drivers/iommu/intel-svm.c2
-rw-r--r--drivers/irqchip/irq-bcm7038-l1.c3
-rw-r--r--drivers/irqchip/irq-bcm7120-l2.c3
-rw-r--r--drivers/irqchip/irq-brcmstb-l2.c3
-rw-r--r--drivers/irqchip/irq-gic-v2m.c46
-rw-r--r--drivers/irqchip/irq-gic-v3-its-pci-msi.c2
-rw-r--r--drivers/irqchip/irq-gic-v3-its-platform-msi.c2
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c2
-rw-r--r--drivers/irqchip/irq-gic-v3.c4
-rw-r--r--drivers/irqchip/irq-mips-gic.c2
-rw-r--r--drivers/macintosh/macio_asic.c1
-rw-r--r--drivers/md/bcache/request.c2
-rw-r--r--drivers/md/bcache/super.c2
-rw-r--r--drivers/md/dm.c3
-rw-r--r--drivers/md/md-multipath.c2
-rw-r--r--drivers/md/md.c53
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/raid1.c13
-rw-r--r--drivers/md/raid1.h12
-rw-r--r--drivers/md/raid10.c18
-rw-r--r--drivers/md/raid10.h13
-rw-r--r--drivers/md/raid5-log.h3
-rw-r--r--drivers/md/raid5-ppl.c10
-rw-r--r--drivers/md/raid5.c19
-rw-r--r--drivers/md/raid5.h12
-rw-r--r--drivers/media/Kconfig2
-rw-r--r--drivers/media/common/videobuf2/Kconfig3
-rw-r--r--drivers/media/common/videobuf2/Makefile9
-rw-r--r--drivers/media/common/videobuf2/vb2-trace.c (renamed from drivers/media/v4l2-core/vb2-trace.c)0
-rw-r--r--drivers/media/dvb-core/Makefile2
-rw-r--r--drivers/media/dvb-core/dmxdev.c115
-rw-r--r--drivers/media/dvb-core/dvb_demux.c112
-rw-r--r--drivers/media/dvb-core/dvb_net.c5
-rw-r--r--drivers/media/dvb-core/dvb_vb2.c31
-rw-r--r--drivers/media/dvb-frontends/m88ds3103.c7
-rw-r--r--drivers/media/i2c/tvp5150.c88
-rw-r--r--drivers/media/pci/ttpci/av7110.c5
-rw-r--r--drivers/media/pci/ttpci/av7110_av.c6
-rw-r--r--drivers/media/usb/au0828/Kconfig2
-rw-r--r--drivers/media/usb/ttusb-dec/ttusb_dec.c10
-rw-r--r--drivers/media/v4l2-core/Kconfig1
-rw-r--r--drivers/media/v4l2-core/Makefile3
-rw-r--r--drivers/memory/brcmstb_dpfe.c74
-rw-r--r--drivers/message/fusion/mptctl.c2
-rw-r--r--drivers/misc/mei/bus.c6
-rw-r--r--drivers/misc/mei/client.c6
-rw-r--r--drivers/misc/mei/hw-me-regs.h5
-rw-r--r--drivers/misc/mei/pci-me.c5
-rw-r--r--drivers/misc/ocxl/file.c8
-rw-r--r--drivers/mmc/core/mmc_ops.c4
-rw-r--r--drivers/mmc/host/bcm2835.c3
-rw-r--r--drivers/mmc/host/dw_mmc-exynos.c1
-rw-r--r--drivers/mmc/host/dw_mmc-k3.c4
-rw-r--r--drivers/mmc/host/dw_mmc-rockchip.c1
-rw-r--r--drivers/mmc/host/dw_mmc-zx.c1
-rw-r--r--drivers/mmc/host/dw_mmc.c84
-rw-r--r--drivers/mmc/host/dw_mmc.h2
-rw-r--r--drivers/mmc/host/meson-gx-mmc.c19
-rw-r--r--drivers/mmc/host/sdhci-pci-core.c35
-rw-r--r--drivers/mtd/nand/Kconfig2
-rw-r--r--drivers/mtd/nand/vf610_nfc.c6
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-pci.c2
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c14
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c35
-rw-r--r--drivers/net/ethernet/broadcom/tg3.h5
-rw-r--r--drivers/net/ethernet/cavium/common/cavium_ptp.c2
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_main.c110
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_queues.c11
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_queues.h4
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c25
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c10
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c23
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c59
-rw-r--r--drivers/net/ethernet/marvell/mvpp2.c11
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c14
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rx.c49
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tx.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c13
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c1
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/main.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c35
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c68
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c5
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c2
-rw-r--r--drivers/net/ethernet/renesas/ravb_main.c6
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c18
-rw-r--r--drivers/net/ethernet/smsc/Kconfig2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/phy/phy_device.c2
-rw-r--r--drivers/net/thunderbolt.c19
-rw-r--r--drivers/net/tun.c16
-rw-r--r--drivers/net/usb/smsc75xx.c7
-rw-r--r--drivers/net/virtio_net.c58
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c2
-rw-r--r--drivers/net/xen-netfront.c7
-rw-r--r--drivers/nvdimm/pmem.c3
-rw-r--r--drivers/nvme/host/core.c57
-rw-r--r--drivers/nvme/host/fabrics.c2
-rw-r--r--drivers/nvme/host/fabrics.h9
-rw-r--r--drivers/nvme/host/fc.c157
-rw-r--r--drivers/nvme/host/multipath.c15
-rw-r--r--drivers/nvme/host/nvme.h3
-rw-r--r--drivers/nvme/host/pci.c44
-rw-r--r--drivers/nvme/host/rdma.c20
-rw-r--r--drivers/nvme/target/core.c9
-rw-r--r--drivers/nvme/target/io-cmd.c7
-rw-r--r--drivers/nvme/target/loop.c4
-rw-r--r--drivers/of/property.c4
-rw-r--r--drivers/opp/cpu.c2
-rw-r--r--drivers/pci/quirks.c39
-rw-r--r--drivers/pci/setup-res.c4
-rw-r--r--drivers/perf/arm_pmu.c138
-rw-r--r--drivers/perf/arm_pmu_acpi.c61
-rw-r--r--drivers/perf/arm_pmu_platform.c37
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson-axg.c4
-rw-r--r--drivers/platform/x86/dell-laptop.c20
-rw-r--r--drivers/platform/x86/ideapad-laptop.c2
-rw-r--r--drivers/platform/x86/intel-hid.c1
-rw-r--r--drivers/platform/x86/intel-vbtn.c47
-rw-r--r--drivers/platform/x86/wmi.c8
-rw-r--r--drivers/s390/virtio/virtio_ccw.c29
-rw-r--r--drivers/scsi/Makefile1
-rw-r--r--drivers/scsi/aacraid/linit.c4
-rw-r--r--drivers/scsi/aic7xxx/aiclib.c34
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c1
-rw-r--r--drivers/scsi/csiostor/csio_lnode.c2
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c5
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.h2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c5
-rw-r--r--drivers/scsi/qedi/qedi_main.c55
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c23
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c7
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c6
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c2
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h2
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c46
-rw-r--r--drivers/scsi/storvsc_drv.c2
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.c2
-rw-r--r--drivers/scsi/ufs/ufshcd.c2
-rw-r--r--drivers/soc/amlogic/meson-gx-socinfo.c1
-rw-r--r--drivers/soc/imx/gpc.c12
-rw-r--r--drivers/staging/android/ashmem.c19
-rw-r--r--drivers/staging/android/ion/ion_cma_heap.c17
-rw-r--r--drivers/staging/fsl-mc/bus/Kconfig2
-rw-r--r--drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c2
-rw-r--r--drivers/staging/iio/adc/ad7192.c27
-rw-r--r--drivers/staging/iio/impedance-analyzer/ad5933.c4
-rw-r--r--drivers/usb/Kconfig6
-rw-r--r--drivers/usb/class/cdc-acm.c9
-rw-r--r--drivers/usb/core/quirks.c3
-rw-r--r--drivers/usb/dwc2/gadget.c26
-rw-r--r--drivers/usb/dwc3/core.c86
-rw-r--r--drivers/usb/dwc3/core.h21
-rw-r--r--drivers/usb/dwc3/dwc3-of-simple.c1
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c16
-rw-r--r--drivers/usb/dwc3/ep0.c7
-rw-r--r--drivers/usb/dwc3/gadget.c2
-rw-r--r--drivers/usb/gadget/function/f_fs.c44
-rw-r--r--drivers/usb/gadget/function/f_uac2.c2
-rw-r--r--drivers/usb/gadget/udc/Kconfig1
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_pci.c1
-rw-r--r--drivers/usb/gadget/udc/core.c2
-rw-r--r--drivers/usb/gadget/udc/fsl_udc_core.c4
-rw-r--r--drivers/usb/gadget/udc/renesas_usb3.c2
-rw-r--r--drivers/usb/host/Kconfig8
-rw-r--r--drivers/usb/host/ehci-hub.c4
-rw-r--r--drivers/usb/host/ehci-q.c12
-rw-r--r--drivers/usb/host/ohci-hcd.c10
-rw-r--r--drivers/usb/host/ohci-hub.c4
-rw-r--r--drivers/usb/host/ohci-q.c17
-rw-r--r--drivers/usb/host/pci-quirks.c109
-rw-r--r--drivers/usb/host/pci-quirks.h5
-rw-r--r--drivers/usb/host/xhci-debugfs.c4
-rw-r--r--drivers/usb/host/xhci-hub.c25
-rw-r--r--drivers/usb/host/xhci-pci.c11
-rw-r--r--drivers/usb/host/xhci.c10
-rw-r--r--drivers/usb/host/xhci.h2
-rw-r--r--drivers/usb/misc/ldusb.c6
-rw-r--r--drivers/usb/musb/musb_core.c3
-rw-r--r--drivers/usb/musb/musb_host.c8
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c3
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c5
-rw-r--r--drivers/usb/serial/option.c7
-rw-r--r--drivers/usb/usbip/stub_dev.c3
-rw-r--r--drivers/usb/usbip/vhci_hcd.c2
-rw-r--r--drivers/vfio/vfio_iommu_type1.c18
-rw-r--r--drivers/video/fbdev/geode/video_gx.c2
-rw-r--r--drivers/watchdog/Kconfig4
-rw-r--r--drivers/xen/events/events_base.c4
-rw-r--r--drivers/xen/pvcalls-back.c2
-rw-r--r--drivers/xen/pvcalls-front.c208
-rw-r--r--drivers/xen/tmem.c4
-rw-r--r--drivers/xen/xenbus/xenbus.h1
-rw-r--r--drivers/xen/xenbus/xenbus_comms.c1
-rw-r--r--drivers/xen/xenbus/xenbus_xs.c3
-rw-r--r--fs/block_dev.c49
-rw-r--r--fs/btrfs/backref.c11
-rw-r--r--fs/btrfs/ctree.h7
-rw-r--r--fs/btrfs/delayed-ref.c3
-rw-r--r--fs/btrfs/extent-tree.c4
-rw-r--r--fs/btrfs/inode-item.c44
-rw-r--r--fs/btrfs/inode.c52
-rw-r--r--fs/btrfs/qgroup.c9
-rw-r--r--fs/btrfs/relocation.c18
-rw-r--r--fs/btrfs/send.c3
-rw-r--r--fs/btrfs/super.c2
-rw-r--r--fs/btrfs/sysfs.c8
-rw-r--r--fs/btrfs/transaction.c20
-rw-r--r--fs/btrfs/tree-log.c146
-rw-r--r--fs/btrfs/volumes.c12
-rw-r--r--fs/ceph/caps.c26
-rw-r--r--fs/ceph/dir.c28
-rw-r--r--fs/ceph/super.c27
-rw-r--r--fs/ceph/super.h2
-rw-r--r--fs/direct-io.c3
-rw-r--r--fs/efivarfs/file.c6
-rw-r--r--fs/gfs2/bmap.c43
-rw-r--r--fs/nfs/callback_proc.c14
-rw-r--r--fs/nfs/nfs3proc.c2
-rw-r--r--fs/nfs/nfs4client.c6
-rw-r--r--fs/proc/kcore.c4
-rw-r--r--fs/signalfd.c15
-rw-r--r--fs/xfs/scrub/agheader.c3
-rw-r--r--fs/xfs/xfs_refcount_item.c9
-rw-r--r--fs/xfs/xfs_rmap_item.c4
-rw-r--r--fs/xfs/xfs_super.c2
-rw-r--r--include/asm-generic/bitops/lock.h3
-rw-r--r--include/asm-generic/bug.h1
-rw-r--r--include/drm/drm_atomic.h9
-rw-r--r--include/drm/drm_crtc_helper.h1
-rw-r--r--include/drm/drm_drv.h1
-rw-r--r--include/dt-bindings/clock/imx7d-clock.h5
-rw-r--r--include/dt-bindings/clock/tegra194-clock.h321
-rw-r--r--include/dt-bindings/gpio/tegra194-gpio.h61
-rw-r--r--include/dt-bindings/mfd/stm32f7-rcc.h1
-rw-r--r--include/dt-bindings/power/tegra194-powergate.h35
-rw-r--r--include/dt-bindings/reset/tegra194-reset.h152
-rw-r--r--include/linux/acpi.h4
-rw-r--r--include/linux/bio.h4
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/compiler-clang.h5
-rw-r--r--include/linux/compiler-gcc.h26
-rw-r--r--include/linux/compiler.h9
-rw-r--r--include/linux/cpuidle.h2
-rw-r--r--include/linux/cpumask.h2
-rw-r--r--include/linux/dma-mapping.h2
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/fwnode.h4
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/init.h8
-rw-r--r--include/linux/jump_label.h3
-rw-r--r--include/linux/kconfig.h9
-rw-r--r--include/linux/kcore.h1
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kvm_host.h6
-rw-r--r--include/linux/memcontrol.h24
-rw-r--r--include/linux/mm_inline.h6
-rw-r--r--include/linux/mutex.h5
-rw-r--r--include/linux/nospec.h18
-rw-r--r--include/linux/perf/arm_pmu.h26
-rw-r--r--include/linux/property.h2
-rw-r--r--include/linux/ptr_ring.h2
-rw-r--r--include/linux/sched/mm.h13
-rw-r--r--include/linux/sched/user.h4
-rw-r--r--include/linux/semaphore.h2
-rw-r--r--include/linux/skbuff.h2
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/workqueue.h1
-rw-r--r--include/media/demux.h21
-rw-r--r--include/media/dmxdev.h2
-rw-r--r--include/media/dvb_demux.h4
-rw-r--r--include/media/dvb_vb2.h20
-rw-r--r--include/net/mac80211.h2
-rw-r--r--include/net/regulatory.h2
-rw-r--r--include/net/udplite.h1
-rw-r--r--include/rdma/restrack.h4
-rw-r--r--include/rdma/uverbs_ioctl.h43
-rw-r--r--include/soc/arc/mcip.h5
-rw-r--r--include/sound/ac97/regs.h2
-rw-r--r--include/trace/events/xen.h2
-rw-r--r--include/uapi/drm/virtgpu_drm.h1
-rw-r--r--include/uapi/linux/blktrace_api.h2
-rw-r--r--include/uapi/linux/dvb/dmx.h35
-rw-r--r--include/uapi/linux/if_ether.h6
-rw-r--r--include/uapi/linux/kvm.h2
-rw-r--r--include/uapi/linux/libc-compat.h6
-rw-r--r--include/uapi/linux/psp-sev.h2
-rw-r--r--include/uapi/linux/ptrace.h4
-rw-r--r--include/uapi/rdma/rdma_user_ioctl.h4
-rw-r--r--init/main.c2
-rw-r--r--kernel/bpf/arraymap.c33
-rw-r--r--kernel/bpf/core.c2
-rw-r--r--kernel/bpf/cpumap.c2
-rw-r--r--kernel/bpf/lpm_trie.c14
-rw-r--r--kernel/bpf/sockmap.c3
-rw-r--r--kernel/extable.c2
-rw-r--r--kernel/fork.c15
-rw-r--r--kernel/irq/irqdomain.c18
-rw-r--r--kernel/irq/matrix.c23
-rw-r--r--kernel/jump_label.c27
-rw-r--r--kernel/kprobes.c178
-rw-r--r--kernel/locking/qspinlock.c21
-rw-r--r--kernel/memremap.c15
-rw-r--r--kernel/printk/printk.c3
-rw-r--r--kernel/relay.c2
-rw-r--r--kernel/sched/core.c27
-rw-r--r--kernel/sched/cpufreq_schedutil.c2
-rw-r--r--kernel/sched/deadline.c6
-rw-r--r--kernel/sched/rt.c3
-rw-r--r--kernel/seccomp.c6
-rw-r--r--kernel/time/timer.c6
-rw-r--r--kernel/trace/bpf_trace.c2
-rw-r--r--kernel/user.c3
-rw-r--r--kernel/workqueue.c16
-rw-r--r--lib/Kconfig.debug1
-rw-r--r--lib/dma-debug.c10
-rw-r--r--lib/dma-direct.c5
-rw-r--r--lib/idr.c15
-rw-r--r--lib/radix-tree.c2
-rw-r--r--lib/vsprintf.c2
-rw-r--r--mm/memory-failure.c2
-rw-r--r--mm/memory.c2
-rw-r--r--mm/mlock.c6
-rw-r--r--mm/page_alloc.c4
-rw-r--r--mm/swap.c84
-rw-r--r--mm/vmalloc.c10
-rw-r--r--mm/vmscan.c59
-rw-r--r--mm/zpool.c2
-rw-r--r--mm/zswap.c6
-rw-r--r--net/9p/trans_virtio.c3
-rw-r--r--net/bridge/br_sysfs_if.c3
-rw-r--r--net/bridge/netfilter/ebt_among.c10
-rw-r--r--net/bridge/netfilter/ebt_limit.c4
-rw-r--r--net/ceph/ceph_common.c7
-rw-r--r--net/core/dev.c11
-rw-r--r--net/core/filter.c6
-rw-r--r--net/core/gen_estimator.c1
-rw-r--r--net/decnet/af_decnet.c62
-rw-r--r--net/ipv4/fib_semantics.c5
-rw-r--r--net/ipv4/ip_sockglue.c7
-rw-r--r--net/ipv4/netfilter/arp_tables.c4
-rw-r--r--net/ipv4/netfilter/ip_tables.c7
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c20
-rw-r--r--net/ipv4/netfilter/ipt_ECN.c12
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c4
-rw-r--r--net/ipv4/netfilter/ipt_rpfilter.c6
-rw-r--r--net/ipv4/route.c2
-rw-r--r--net/ipv4/tcp_output.c34
-rw-r--r--net/ipv4/udp.c5
-rw-r--r--net/ipv6/ip6_checksum.c5
-rw-r--r--net/ipv6/ipv6_sockglue.c10
-rw-r--r--net/ipv6/netfilter/ip6_tables.c4
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c4
-rw-r--r--net/ipv6/netfilter/ip6t_rpfilter.c6
-rw-r--r--net/ipv6/netfilter/ip6t_srh.c6
-rw-r--r--net/ipv6/sit.c2
-rw-r--r--net/mac80211/agg-rx.c4
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mesh.c17
-rw-r--r--net/mac80211/spectmgmt.c7
-rw-r--r--net/mac80211/sta_info.c3
-rw-r--r--net/netfilter/nf_nat_proto_common.c7
-rw-r--r--net/netfilter/x_tables.c74
-rw-r--r--net/netfilter/xt_AUDIT.c4
-rw-r--r--net/netfilter/xt_CHECKSUM.c8
-rw-r--r--net/netfilter/xt_CONNSECMARK.c10
-rw-r--r--net/netfilter/xt_CT.c25
-rw-r--r--net/netfilter/xt_DSCP.c4
-rw-r--r--net/netfilter/xt_HL.c13
-rw-r--r--net/netfilter/xt_HMARK.c27
-rw-r--r--net/netfilter/xt_IDLETIMER.c9
-rw-r--r--net/netfilter/xt_LED.c16
-rw-r--r--net/netfilter/xt_NFQUEUE.c8
-rw-r--r--net/netfilter/xt_SECMARK.c18
-rw-r--r--net/netfilter/xt_TCPMSS.c10
-rw-r--r--net/netfilter/xt_TPROXY.c6
-rw-r--r--net/netfilter/xt_addrtype.c33
-rw-r--r--net/netfilter/xt_bpf.c4
-rw-r--r--net/netfilter/xt_cgroup.c8
-rw-r--r--net/netfilter/xt_cluster.c8
-rw-r--r--net/netfilter/xt_connbytes.c4
-rw-r--r--net/netfilter/xt_connlabel.c7
-rw-r--r--net/netfilter/xt_connmark.c8
-rw-r--r--net/netfilter/xt_conntrack.c4
-rw-r--r--net/netfilter/xt_dscp.c4
-rw-r--r--net/netfilter/xt_ecn.c4
-rw-r--r--net/netfilter/xt_hashlimit.c26
-rw-r--r--net/netfilter/xt_helper.c4
-rw-r--r--net/netfilter/xt_ipcomp.c2
-rw-r--r--net/netfilter/xt_ipvs.c3
-rw-r--r--net/netfilter/xt_l2tp.c22
-rw-r--r--net/netfilter/xt_limit.c4
-rw-r--r--net/netfilter/xt_nat.c5
-rw-r--r--net/netfilter/xt_nfacct.c6
-rw-r--r--net/netfilter/xt_physdev.c4
-rw-r--r--net/netfilter/xt_policy.c23
-rw-r--r--net/netfilter/xt_recent.c14
-rw-r--r--net/netfilter/xt_set.c50
-rw-r--r--net/netfilter/xt_socket.c10
-rw-r--r--net/netfilter/xt_state.c4
-rw-r--r--net/netfilter/xt_time.c6
-rw-r--r--net/netlink/af_netlink.c4
-rw-r--r--net/nfc/llcp_commands.c4
-rw-r--r--net/nfc/netlink.c3
-rw-r--r--net/rds/connection.c2
-rw-r--r--net/rxrpc/output.c2
-rw-r--r--net/rxrpc/recvmsg.c5
-rw-r--r--net/sched/cls_api.c33
-rw-r--r--net/sched/cls_u32.c24
-rw-r--r--net/sctp/debug.c6
-rw-r--r--net/sctp/input.c5
-rw-r--r--net/sctp/stream.c2
-rw-r--r--net/sctp/stream_interleave.c16
-rw-r--r--net/tipc/bearer.c82
-rw-r--r--net/tipc/bearer.h4
-rw-r--r--net/tipc/net.c15
-rw-r--r--net/tipc/net.h1
-rw-r--r--net/tipc/netlink_compat.c43
-rw-r--r--net/tls/tls_main.c7
-rw-r--r--net/unix/af_unix.c2
-rw-r--r--net/wireless/mesh.c25
-rw-r--r--net/wireless/sme.c2
-rw-r--r--samples/seccomp/Makefile10
-rw-r--r--scripts/Makefile.build8
-rw-r--r--scripts/coccinelle/api/memdup.cocci4
-rw-r--r--scripts/kallsyms.c2
-rw-r--r--scripts/kconfig/confdata.c2
-rw-r--r--scripts/kconfig/kxgettext.c2
-rw-r--r--scripts/kconfig/lkc.h1
-rwxr-xr-xscripts/kconfig/lxdialog/check-lxdialog.sh3
-rw-r--r--scripts/kconfig/menu.c1
-rw-r--r--scripts/kconfig/symbol.c4
-rw-r--r--scripts/kconfig/util.c11
-rw-r--r--scripts/kconfig/zconf.l12
-rw-r--r--scripts/kconfig/zconf.y3
-rwxr-xr-xscripts/link-vmlinux.sh2
-rw-r--r--security/integrity/digsig.c1
-rw-r--r--security/keys/big_key.c110
-rw-r--r--sound/ac97/Kconfig1
-rw-r--r--sound/core/control.c2
-rw-r--r--sound/core/seq/seq_clientmgr.c8
-rw-r--r--sound/pci/hda/hda_intel.c38
-rw-r--r--sound/pci/hda/patch_realtek.c73
-rw-r--r--sound/usb/mixer.c18
-rw-r--r--sound/usb/pcm.c9
-rw-r--r--sound/usb/quirks-table.h47
-rw-r--r--sound/usb/quirks.c7
-rw-r--r--sound/x86/intel_hdmi_audio.c37
-rw-r--r--tools/arch/powerpc/include/uapi/asm/kvm.h2
-rw-r--r--tools/arch/s390/include/uapi/asm/unistd.h412
-rw-r--r--tools/arch/x86/include/asm/cpufeatures.h1
-rw-r--r--tools/bpf/bpftool/main.c2
-rw-r--r--tools/bpf/bpftool/prog.c3
-rw-r--r--tools/cgroup/Makefile1
-rw-r--r--tools/gpio/Makefile2
-rw-r--r--tools/hv/Makefile1
-rw-r--r--tools/iio/Makefile2
-rw-r--r--tools/include/uapi/drm/i915_drm.h77
-rw-r--r--tools/include/uapi/linux/if_link.h1
-rw-r--r--tools/include/uapi/linux/kvm.h90
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat503
-rw-r--r--tools/kvm/kvm_stat/kvm_stat.txt4
-rw-r--r--tools/laptop/freefall/Makefile1
-rw-r--r--tools/leds/Makefile1
-rw-r--r--tools/lib/bpf/libbpf.c5
-rw-r--r--tools/objtool/builtin-check.c6
-rw-r--r--tools/objtool/builtin-orc.c6
-rw-r--r--tools/objtool/builtin.h5
-rw-r--r--tools/objtool/check.c159
-rw-r--r--tools/objtool/check.h4
-rw-r--r--tools/perf/Documentation/perf-data.txt4
-rw-r--r--tools/perf/Makefile.perf6
-rw-r--r--tools/perf/arch/s390/Makefile10
-rwxr-xr-xtools/perf/arch/s390/entry/syscalls/mksyscalltbl18
-rw-r--r--tools/perf/arch/s390/entry/syscalls/syscall.tbl390
-rw-r--r--tools/perf/builtin-c2c.c4
-rw-r--r--tools/perf/builtin-report.c3
-rw-r--r--tools/perf/builtin-top.c150
-rwxr-xr-xtools/perf/check-headers.sh1
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/branch.json27
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/bus.json22
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/cache.json27
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/memory.json22
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/other.json32
-rw-r--r--tools/perf/pmu-events/arch/arm64/cortex-a53/pipeline.json52
-rw-r--r--tools/perf/pmu-events/arch/arm64/mapfile.csv1
-rw-r--r--tools/perf/tests/backward-ring-buffer.c7
-rwxr-xr-xtools/perf/tests/shell/trace+probe_libc_inet_pton.sh23
-rw-r--r--tools/perf/ui/browsers/hists.c38
-rw-r--r--tools/perf/ui/browsers/hists.h3
-rw-r--r--tools/perf/util/evlist.c17
-rw-r--r--tools/perf/util/evlist.h4
-rw-r--r--tools/perf/util/evsel.c12
-rw-r--r--tools/perf/util/evsel.h14
-rw-r--r--tools/perf/util/hist.h6
-rw-r--r--tools/perf/util/mmap.c141
-rw-r--r--tools/perf/util/mmap.h10
-rw-r--r--tools/perf/util/util.c24
-rw-r--r--tools/power/acpi/Makefile.config3
-rw-r--r--tools/scripts/Makefile.include18
-rw-r--r--tools/spi/Makefile2
-rw-r--r--tools/testing/radix-tree/idr-test.c52
-rw-r--r--tools/testing/radix-tree/linux.c11
-rw-r--r--tools/testing/radix-tree/linux/compiler_types.h0
-rw-r--r--tools/testing/radix-tree/linux/gfp.h1
-rw-r--r--tools/testing/radix-tree/linux/slab.h6
-rw-r--r--tools/testing/selftests/android/Makefile8
-rw-r--r--tools/testing/selftests/bpf/.gitignore1
-rw-r--r--tools/testing/selftests/bpf/test_maps.c2
-rw-r--r--tools/testing/selftests/bpf/test_tcpbpf_kern.c1
-rw-r--r--tools/testing/selftests/bpf/test_verifier.c26
-rw-r--r--tools/testing/selftests/futex/Makefile6
-rw-r--r--tools/testing/selftests/memfd/Makefile1
-rw-r--r--tools/testing/selftests/memfd/config1
-rw-r--r--tools/testing/selftests/memory-hotplug/Makefile2
-rw-r--r--tools/testing/selftests/powerpc/alignment/alignment_handler.c2
-rw-r--r--tools/testing/selftests/pstore/config1
-rw-r--r--tools/testing/selftests/seccomp/seccomp_bpf.c61
-rw-r--r--tools/testing/selftests/sync/Makefile2
-rw-r--r--tools/testing/selftests/vDSO/Makefile14
-rw-r--r--tools/testing/selftests/vm/.gitignore1
-rw-r--r--tools/testing/selftests/x86/Makefile24
-rw-r--r--tools/testing/selftests/x86/mpx-mini-test.c32
-rw-r--r--tools/testing/selftests/x86/protection_keys.c28
-rw-r--r--tools/testing/selftests/x86/single_step_syscall.c5
-rw-r--r--tools/testing/selftests/x86/test_mremap_vdso.c4
-rw-r--r--tools/testing/selftests/x86/test_vdso.c55
-rw-r--r--tools/testing/selftests/x86/test_vsyscall.c11
-rw-r--r--tools/usb/Makefile1
-rw-r--r--tools/vm/Makefile1
-rw-r--r--tools/wmi/Makefile1
-rw-r--r--virt/kvm/arm/arch_timer.c116
-rw-r--r--virt/kvm/kvm_main.c3
1717 files changed, 48347 insertions, 23346 deletions
diff --git a/.gitignore b/.gitignore
index 705e09913dc2..1be78fd8163b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,3 +127,7 @@ all.config
127 127
128# Kdevelop4 128# Kdevelop4
129*.kdev4 129*.kdev4
130
131#Automatically generated by ASN.1 compiler
132net/ipv4/netfilter/nf_nat_snmp_basic-asn1.c
133net/ipv4/netfilter/nf_nat_snmp_basic-asn1.h
diff --git a/Documentation/ABI/testing/sysfs-devices-platform-dock b/Documentation/ABI/testing/sysfs-devices-platform-dock
new file mode 100644
index 000000000000..1d8c18f905c7
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-platform-dock
@@ -0,0 +1,39 @@
1What: /sys/devices/platform/dock.N/docked
2Date: Dec, 2006
3KernelVersion: 2.6.19
4Contact: linux-acpi@vger.kernel.org
5Description:
6 (RO) Value 1 or 0 indicates whether the software believes the
7 laptop is docked in a docking station.
8
9What: /sys/devices/platform/dock.N/undock
10Date: Dec, 2006
11KernelVersion: 2.6.19
12Contact: linux-acpi@vger.kernel.org
13Description:
14 (WO) Writing to this file causes the software to initiate an
15 undock request to the firmware.
16
17What: /sys/devices/platform/dock.N/uid
18Date: Feb, 2007
19KernelVersion: v2.6.21
20Contact: linux-acpi@vger.kernel.org
21Description:
22 (RO) Displays the docking station the laptop is docked to.
23
24What: /sys/devices/platform/dock.N/flags
25Date: May, 2007
26KernelVersion: v2.6.21
27Contact: linux-acpi@vger.kernel.org
28Description:
29 (RO) Show dock station flags, useful for checking if undock
30 request has been made by the user (from the immediate_undock
31 option).
32
33What: /sys/devices/platform/dock.N/type
34Date: Aug, 2008
35KernelVersion: v2.6.27
36Contact: linux-acpi@vger.kernel.org
37Description:
38 (RO) Display the dock station type- dock_station, ata_bay or
39 battery_bay.
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index bfd29bc8d37a..4ed63b6cfb15 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -108,6 +108,8 @@ Description: CPU topology files that describe a logical CPU's relationship
108 108
109What: /sys/devices/system/cpu/cpuidle/current_driver 109What: /sys/devices/system/cpu/cpuidle/current_driver
110 /sys/devices/system/cpu/cpuidle/current_governer_ro 110 /sys/devices/system/cpu/cpuidle/current_governer_ro
111 /sys/devices/system/cpu/cpuidle/available_governors
112 /sys/devices/system/cpu/cpuidle/current_governor
111Date: September 2007 113Date: September 2007
112Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 114Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
113Description: Discover cpuidle policy and mechanism 115Description: Discover cpuidle policy and mechanism
@@ -119,13 +121,84 @@ Description: Discover cpuidle policy and mechanism
119 Idle policy (governor) is differentiated from idle mechanism 121 Idle policy (governor) is differentiated from idle mechanism
120 (driver) 122 (driver)
121 123
122 current_driver: displays current idle mechanism 124 current_driver: (RO) displays current idle mechanism
123 125
124 current_governor_ro: displays current idle policy 126 current_governor_ro: (RO) displays current idle policy
127
128 With the cpuidle_sysfs_switch boot option enabled (meant for
129 developer testing), the following three attributes are visible
130 instead:
131
132 current_driver: same as described above
133
134 available_governors: (RO) displays a space separated list of
135 available governors
136
137 current_governor: (RW) displays current idle policy. Users can
138 switch the governor at runtime by writing to this file.
125 139
126 See files in Documentation/cpuidle/ for more information. 140 See files in Documentation/cpuidle/ for more information.
127 141
128 142
143What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/name
144 /sys/devices/system/cpu/cpuX/cpuidle/stateN/latency
145 /sys/devices/system/cpu/cpuX/cpuidle/stateN/power
146 /sys/devices/system/cpu/cpuX/cpuidle/stateN/time
147 /sys/devices/system/cpu/cpuX/cpuidle/stateN/usage
148Date: September 2007
149KernelVersion: v2.6.24
150Contact: Linux power management list <linux-pm@vger.kernel.org>
151Description:
152 The directory /sys/devices/system/cpu/cpuX/cpuidle contains per
153 logical CPU specific cpuidle information for each online cpu X.
154 The processor idle states which are available for use have the
155 following attributes:
156
157 name: (RO) Name of the idle state (string).
158
159 latency: (RO) The latency to exit out of this idle state (in
160 microseconds).
161
162 power: (RO) The power consumed while in this idle state (in
163 milliwatts).
164
165 time: (RO) The total time spent in this idle state (in microseconds).
166
167 usage: (RO) Number of times this state was entered (a count).
168
169
170What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/desc
171Date: February 2008
172KernelVersion: v2.6.25
173Contact: Linux power management list <linux-pm@vger.kernel.org>
174Description:
175 (RO) A small description about the idle state (string).
176
177
178What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/disable
179Date: March 2012
180KernelVersion: v3.10
181Contact: Linux power management list <linux-pm@vger.kernel.org>
182Description:
183 (RW) Option to disable this idle state (bool). The behavior and
184 the effect of the disable variable depends on the implementation
185 of a particular governor. In the ladder governor, for example,
186 it is not coherent, i.e. if one is disabling a light state, then
187 all deeper states are disabled as well, but the disable variable
188 does not reflect it. Likewise, if one enables a deep state but a
189 lighter state still is disabled, then this has no effect.
190
191
192What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/residency
193Date: March 2014
194KernelVersion: v3.15
195Contact: Linux power management list <linux-pm@vger.kernel.org>
196Description:
197 (RO) Display the target residency i.e. the minimum amount of
198 time (in microseconds) this cpu should spend in this idle state
199 to make the transition worth the effort.
200
201
129What: /sys/devices/system/cpu/cpu#/cpufreq/* 202What: /sys/devices/system/cpu/cpu#/cpufreq/*
130Date: pre-git history 203Date: pre-git history
131Contact: linux-pm@vger.kernel.org 204Contact: linux-pm@vger.kernel.org
diff --git a/Documentation/ABI/testing/sysfs-platform-dptf b/Documentation/ABI/testing/sysfs-platform-dptf
new file mode 100644
index 000000000000..325dc0667dbb
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-dptf
@@ -0,0 +1,40 @@
1What: /sys/bus/platform/devices/INT3407:00/dptf_power/charger_type
2Date: Jul, 2016
3KernelVersion: v4.10
4Contact: linux-acpi@vger.kernel.org
5Description:
6 (RO) The charger type - Traditional, Hybrid or NVDC.
7
8What: /sys/bus/platform/devices/INT3407:00/dptf_power/adapter_rating_mw
9Date: Jul, 2016
10KernelVersion: v4.10
11Contact: linux-acpi@vger.kernel.org
12Description:
13 (RO) Adapter rating in milliwatts (the maximum Adapter power).
14 Must be 0 if no AC Adaptor is plugged in.
15
16What: /sys/bus/platform/devices/INT3407:00/dptf_power/max_platform_power_mw
17Date: Jul, 2016
18KernelVersion: v4.10
19Contact: linux-acpi@vger.kernel.org
20Description:
21 (RO) Maximum platform power that can be supported by the battery
22 in milliwatts.
23
24What: /sys/bus/platform/devices/INT3407:00/dptf_power/platform_power_source
25Date: Jul, 2016
26KernelVersion: v4.10
27Contact: linux-acpi@vger.kernel.org
28Description:
29 (RO) Display the platform power source
30 0x00 = DC
31 0x01 = AC
32 0x02 = USB
33 0x03 = Wireless Charger
34
35What: /sys/bus/platform/devices/INT3407:00/dptf_power/battery_steady_power
36Date: Jul, 2016
37KernelVersion: v4.10
38Contact: linux-acpi@vger.kernel.org
39Description:
40 (RO) The maximum sustained power for battery in milliwatts.
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt
index 611a75e4366e..badb26ac33dc 100644
--- a/Documentation/PCI/pci.txt
+++ b/Documentation/PCI/pci.txt
@@ -570,7 +570,9 @@ your driver if they're helpful, or just use plain hex constants.
570The device IDs are arbitrary hex numbers (vendor controlled) and normally used 570The device IDs are arbitrary hex numbers (vendor controlled) and normally used
571only in a single location, the pci_device_id table. 571only in a single location, the pci_device_id table.
572 572
573Please DO submit new vendor/device IDs to http://pciids.sourceforge.net/. 573Please DO submit new vendor/device IDs to http://pci-ids.ucw.cz/.
574There are mirrors of the pci.ids file at http://pciids.sourceforge.net/
575and https://github.com/pciutils/pciids.
574 576
575 577
576 578
diff --git a/Documentation/atomic_bitops.txt b/Documentation/atomic_bitops.txt
index 5550bfdcce5f..be70b32c95d9 100644
--- a/Documentation/atomic_bitops.txt
+++ b/Documentation/atomic_bitops.txt
@@ -58,7 +58,12 @@ Like with atomic_t, the rule of thumb is:
58 58
59 - RMW operations that have a return value are fully ordered. 59 - RMW operations that have a return value are fully ordered.
60 60
61Except for test_and_set_bit_lock() which has ACQUIRE semantics and 61 - RMW operations that are conditional are unordered on FAILURE,
62 otherwise the above rules apply. In the case of test_and_{}_bit() operations,
63 if the bit in memory is unchanged by the operation then it is deemed to have
64 failed.
65
66Except for a successful test_and_set_bit_lock() which has ACQUIRE semantics and
62clear_bit_unlock() which has RELEASE semantics. 67clear_bit_unlock() which has RELEASE semantics.
63 68
64Since a platform only has a single means of achieving atomic operations 69Since a platform only has a single means of achieving atomic operations
diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp
new file mode 100644
index 000000000000..8e043301e28e
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp
@@ -0,0 +1,42 @@
1=========================================================
2Secondary CPU enable-method "nuvoton,npcm750-smp" binding
3=========================================================
4
5To apply to all CPUs, a single "nuvoton,npcm750-smp" enable method should be
6defined in the "cpus" node.
7
8Enable method name: "nuvoton,npcm750-smp"
9Compatible machines: "nuvoton,npcm750"
10Compatible CPUs: "arm,cortex-a9"
11Related properties: (none)
12
13Note:
14This enable method needs valid nodes compatible with "arm,cortex-a9-scu" and
15"nuvoton,npcm750-gcr".
16
17Example:
18
19 cpus {
20 #address-cells = <1>;
21 #size-cells = <0>;
22 enable-method = "nuvoton,npcm750-smp";
23
24 cpu@0 {
25 device_type = "cpu";
26 compatible = "arm,cortex-a9";
27 clocks = <&clk NPCM7XX_CLK_CPU>;
28 clock-names = "clk_cpu";
29 reg = <0>;
30 next-level-cache = <&L2>;
31 };
32
33 cpu@1 {
34 device_type = "cpu";
35 compatible = "arm,cortex-a9";
36 clocks = <&clk NPCM7XX_CLK_CPU>;
37 clock-names = "clk_cpu";
38 reg = <1>;
39 next-level-cache = <&L2>;
40 };
41 };
42
diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
index f4a777039f03..8b0328ff951d 100644
--- a/Documentation/devicetree/bindings/arm/cpus.txt
+++ b/Documentation/devicetree/bindings/arm/cpus.txt
@@ -185,6 +185,7 @@ described below.
185 "nvidia,tegra186-denver" 185 "nvidia,tegra186-denver"
186 "qcom,krait" 186 "qcom,krait"
187 "qcom,kryo" 187 "qcom,kryo"
188 "qcom,kryo385"
188 "qcom,scorpion" 189 "qcom,scorpion"
189 - enable-method 190 - enable-method
190 Value type: <stringlist> 191 Value type: <stringlist>
diff --git a/Documentation/devicetree/bindings/arm/mediatek.txt b/Documentation/devicetree/bindings/arm/mediatek.txt
index 91d517849483..7d21ab37c19c 100644
--- a/Documentation/devicetree/bindings/arm/mediatek.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek.txt
@@ -50,6 +50,15 @@ Supported boards:
50- Reference board variant 1 for MT7622: 50- Reference board variant 1 for MT7622:
51 Required root node properties: 51 Required root node properties:
52 - compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622"; 52 - compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622";
53- Reference board for MT7623a with eMMC:
54 Required root node properties:
55 - compatible = "mediatek,mt7623a-rfb-emmc", "mediatek,mt7623";
56- Reference board for MT7623a with NAND:
57 Required root node properties:
58 - compatible = "mediatek,mt7623a-rfb-nand", "mediatek,mt7623";
59- Reference board for MT7623n with eMMC:
60 Required root node properties:
61 - compatible = "mediatek,mt7623n-rfb-emmc", "mediatek,mt7623";
53- Reference board for MT7623n with NAND: 62- Reference board for MT7623n with NAND:
54 Required root node properties: 63 Required root node properties:
55 - compatible = "mediatek,mt7623n-rfb-nand", "mediatek,mt7623"; 64 - compatible = "mediatek,mt7623n-rfb-nand", "mediatek,mt7623";
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
index 6cc7840ff37a..8f5335b480ac 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
@@ -9,6 +9,7 @@ Required Properties:
9 - "mediatek,mt2701-ethsys", "syscon" 9 - "mediatek,mt2701-ethsys", "syscon"
10 - "mediatek,mt7622-ethsys", "syscon" 10 - "mediatek,mt7622-ethsys", "syscon"
11- #clock-cells: Must be 1 11- #clock-cells: Must be 1
12- #reset-cells: Must be 1
12 13
13The ethsys controller uses the common clk binding from 14The ethsys controller uses the common clk binding from
14Documentation/devicetree/bindings/clock/clock-bindings.txt 15Documentation/devicetree/bindings/clock/clock-bindings.txt
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt
index d5d5f1227665..7fe5dc6097a6 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt
@@ -8,6 +8,7 @@ Required Properties:
8- compatible: Should be: 8- compatible: Should be:
9 - "mediatek,mt7622-pciesys", "syscon" 9 - "mediatek,mt7622-pciesys", "syscon"
10- #clock-cells: Must be 1 10- #clock-cells: Must be 1
11- #reset-cells: Must be 1
11 12
12The PCIESYS controller uses the common clk binding from 13The PCIESYS controller uses the common clk binding from
13Documentation/devicetree/bindings/clock/clock-bindings.txt 14Documentation/devicetree/bindings/clock/clock-bindings.txt
@@ -19,4 +20,5 @@ pciesys: pciesys@1a100800 {
19 compatible = "mediatek,mt7622-pciesys", "syscon"; 20 compatible = "mediatek,mt7622-pciesys", "syscon";
20 reg = <0 0x1a100800 0 0x1000>; 21 reg = <0 0x1a100800 0 0x1000>;
21 #clock-cells = <1>; 22 #clock-cells = <1>;
23 #reset-cells = <1>;
22}; 24};
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt
index 00760019da00..b8184da2508c 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt
@@ -8,6 +8,7 @@ Required Properties:
8- compatible: Should be: 8- compatible: Should be:
9 - "mediatek,mt7622-ssusbsys", "syscon" 9 - "mediatek,mt7622-ssusbsys", "syscon"
10- #clock-cells: Must be 1 10- #clock-cells: Must be 1
11- #reset-cells: Must be 1
11 12
12The SSUSBSYS controller uses the common clk binding from 13The SSUSBSYS controller uses the common clk binding from
13Documentation/devicetree/bindings/clock/clock-bindings.txt 14Documentation/devicetree/bindings/clock/clock-bindings.txt
@@ -19,4 +20,5 @@ ssusbsys: ssusbsys@1a000000 {
19 compatible = "mediatek,mt7622-ssusbsys", "syscon"; 20 compatible = "mediatek,mt7622-ssusbsys", "syscon";
20 reg = <0 0x1a000000 0 0x1000>; 21 reg = <0 0x1a000000 0 0x1000>;
21 #clock-cells = <1>; 22 #clock-cells = <1>;
23 #reset-cells = <1>;
22}; 24};
diff --git a/Documentation/devicetree/bindings/arm/npcm/npcm.txt b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
new file mode 100644
index 000000000000..2d87d9ecea85
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
@@ -0,0 +1,6 @@
1NPCM Platforms Device Tree Bindings
2-----------------------------------
3NPCM750 SoC
4Required root node properties:
5 - compatible = "nuvoton,npcm750";
6
diff --git a/Documentation/devicetree/bindings/arm/omap/ctrl.txt b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
index ce8dabf8c0f9..f35b77920786 100644
--- a/Documentation/devicetree/bindings/arm/omap/ctrl.txt
+++ b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
@@ -25,6 +25,7 @@ Required properties:
25 "ti,omap4-scm-padconf-wkup" 25 "ti,omap4-scm-padconf-wkup"
26 "ti,omap5-scm-core" 26 "ti,omap5-scm-core"
27 "ti,omap5-scm-padconf-core" 27 "ti,omap5-scm-padconf-core"
28 "ti,omap5-scm-wkup-pad-conf"
28 "ti,dra7-scm-core" 29 "ti,dra7-scm-core"
29- reg: Contains Control Module register address range 30- reg: Contains Control Module register address range
30 (base address and length) 31 (base address and length)
diff --git a/Documentation/devicetree/bindings/arm/qcom.txt b/Documentation/devicetree/bindings/arm/qcom.txt
index 0ed4d39d7fe1..ee532e705d6c 100644
--- a/Documentation/devicetree/bindings/arm/qcom.txt
+++ b/Documentation/devicetree/bindings/arm/qcom.txt
@@ -26,6 +26,7 @@ The 'SoC' element must be one of the following strings:
26 msm8996 26 msm8996
27 mdm9615 27 mdm9615
28 ipq8074 28 ipq8074
29 sdm845
29 30
30The 'board' element must be one of the following strings: 31The 'board' element must be one of the following strings:
31 32
diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt
index 469ac98ecf8f..14510b215480 100644
--- a/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt
@@ -9,7 +9,11 @@ Required root node properties:
9 - "samsung,smdkv310" - for Exynos4210-based Samsung SMDKV310 eval board. 9 - "samsung,smdkv310" - for Exynos4210-based Samsung SMDKV310 eval board.
10 - "samsung,trats" - for Exynos4210-based Tizen Reference board. 10 - "samsung,trats" - for Exynos4210-based Tizen Reference board.
11 - "samsung,universal_c210" - for Exynos4210-based Samsung board. 11 - "samsung,universal_c210" - for Exynos4210-based Samsung board.
12 - "samsung,i9300" - for Exynos4412-based Samsung GT-I9300 board.
13 - "samsung,i9305" - for Exynos4412-based Samsung GT-I9305 board.
14 - "samsung,midas" - for Exynos4412-based Samsung Midas board.
12 - "samsung,smdk4412", - for Exynos4412-based Samsung SMDK4412 eval board. 15 - "samsung,smdk4412", - for Exynos4412-based Samsung SMDK4412 eval board.
16 - "samsung,n710x" - for Exynos4412-based Samsung GT-N7100/GT-N7105 board.
13 - "samsung,trats2" - for Exynos4412-based Tizen Reference board. 17 - "samsung,trats2" - for Exynos4412-based Tizen Reference board.
14 - "samsung,smdk5250" - for Exynos5250-based Samsung SMDK5250 eval board. 18 - "samsung,smdk5250" - for Exynos5250-based Samsung SMDK5250 eval board.
15 - "samsung,xyref5260" - for Exynos5260-based Samsung board. 19 - "samsung,xyref5260" - for Exynos5260-based Samsung board.
diff --git a/Documentation/devicetree/bindings/arm/shmobile.txt b/Documentation/devicetree/bindings/arm/shmobile.txt
index 5c3af7ef0761..d3d1df97834f 100644
--- a/Documentation/devicetree/bindings/arm/shmobile.txt
+++ b/Documentation/devicetree/bindings/arm/shmobile.txt
@@ -39,8 +39,12 @@ SoCs:
39 compatible = "renesas,r8a7795" 39 compatible = "renesas,r8a7795"
40 - R-Car M3-W (R8A77960) 40 - R-Car M3-W (R8A77960)
41 compatible = "renesas,r8a7796" 41 compatible = "renesas,r8a7796"
42 - R-Car M3-N (R8A77965)
43 compatible = "renesas,r8a77965"
42 - R-Car V3M (R8A77970) 44 - R-Car V3M (R8A77970)
43 compatible = "renesas,r8a77970" 45 compatible = "renesas,r8a77970"
46 - R-Car V3H (R8A77980)
47 compatible = "renesas,r8a77980"
44 - R-Car D3 (R8A77995) 48 - R-Car D3 (R8A77995)
45 compatible = "renesas,r8a77995" 49 compatible = "renesas,r8a77995"
46 50
@@ -52,11 +56,13 @@ Boards:
52 - APE6-EVM 56 - APE6-EVM
53 compatible = "renesas,ape6evm", "renesas,r8a73a4" 57 compatible = "renesas,ape6evm", "renesas,r8a73a4"
54 - Atmark Techno Armadillo-800 EVA 58 - Atmark Techno Armadillo-800 EVA
55 compatible = "renesas,armadillo800eva" 59 compatible = "renesas,armadillo800eva", "renesas,r8a7740"
56 - Blanche (RTP0RC7792SEB00010S) 60 - Blanche (RTP0RC7792SEB00010S)
57 compatible = "renesas,blanche", "renesas,r8a7792" 61 compatible = "renesas,blanche", "renesas,r8a7792"
58 - BOCK-W 62 - BOCK-W
59 compatible = "renesas,bockw", "renesas,r8a7778" 63 compatible = "renesas,bockw", "renesas,r8a7778"
64 - Condor (RTP0RC77980SEB0010SS/RTP0RC77980SEB0010SA01)
65 compatible = "renesas,condor", "renesas,r8a77980"
60 - Draak (RTP0RC77995SEB0010S) 66 - Draak (RTP0RC77995SEB0010S)
61 compatible = "renesas,draak", "renesas,r8a77995" 67 compatible = "renesas,draak", "renesas,r8a77995"
62 - Eagle (RTP0RC77970SEB0010S) 68 - Eagle (RTP0RC77970SEB0010S)
@@ -102,19 +108,25 @@ Boards:
102 compatible = "renesas,salvator-x", "renesas,r8a7795" 108 compatible = "renesas,salvator-x", "renesas,r8a7795"
103 - Salvator-X (RTP0RC7796SIPB0011S) 109 - Salvator-X (RTP0RC7796SIPB0011S)
104 compatible = "renesas,salvator-x", "renesas,r8a7796" 110 compatible = "renesas,salvator-x", "renesas,r8a7796"
111 - Salvator-X (RTP0RC7796SIPB0011S (M3N))
112 compatible = "renesas,salvator-x", "renesas,r8a77965"
105 - Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S) 113 - Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S)
106 compatible = "renesas,salvator-xs", "renesas,r8a7795" 114 compatible = "renesas,salvator-xs", "renesas,r8a7795"
107 - Salvator-XS (Salvator-X 2nd version, RTP0RC7796SIPB0012S) 115 - Salvator-XS (Salvator-X 2nd version, RTP0RC7796SIPB0012S)
108 compatible = "renesas,salvator-xs", "renesas,r8a7796" 116 compatible = "renesas,salvator-xs", "renesas,r8a7796"
117 - Salvator-XS (Salvator-X 2nd version, RTP0RC77965SIPB012S)
118 compatible = "renesas,salvator-xs", "renesas,r8a77965"
109 - SILK (RTP0RC7794LCB00011S) 119 - SILK (RTP0RC7794LCB00011S)
110 compatible = "renesas,silk", "renesas,r8a7794" 120 compatible = "renesas,silk", "renesas,r8a7794"
111 - SK-RZG1E (YR8A77450S000BE) 121 - SK-RZG1E (YR8A77450S000BE)
112 compatible = "renesas,sk-rzg1e", "renesas,r8a7745" 122 compatible = "renesas,sk-rzg1e", "renesas,r8a7745"
113 - SK-RZG1M (YR8A77430S000BE) 123 - SK-RZG1M (YR8A77430S000BE)
114 compatible = "renesas,sk-rzg1m", "renesas,r8a7743" 124 compatible = "renesas,sk-rzg1m", "renesas,r8a7743"
115 - V3MSK 125 - Stout (ADAS Starterkit, Y-R-CAR-ADAS-SKH2-BOARD)
126 compatible = "renesas,stout", "renesas,r8a7790"
127 - V3MSK (Y-ASK-RCAR-V3M-WS10)
116 compatible = "renesas,v3msk", "renesas,r8a77970" 128 compatible = "renesas,v3msk", "renesas,r8a77970"
117 - Wheat 129 - Wheat (RTP0RC7792ASKB0000JE)
118 compatible = "renesas,wheat", "renesas,r8a7792" 130 compatible = "renesas,wheat", "renesas,r8a7792"
119 131
120 132
diff --git a/Documentation/devicetree/bindings/arm/stm32.txt b/Documentation/devicetree/bindings/arm/stm32.txt
index 05762b08a7bb..6808ed9ddfd5 100644
--- a/Documentation/devicetree/bindings/arm/stm32.txt
+++ b/Documentation/devicetree/bindings/arm/stm32.txt
@@ -7,3 +7,4 @@ using one of the following compatible strings:
7 st,stm32f469 7 st,stm32f469
8 st,stm32f746 8 st,stm32f746
9 st,stm32h743 9 st,stm32h743
10 st,stm32mp157
diff --git a/Documentation/devicetree/bindings/arm/tegra.txt b/Documentation/devicetree/bindings/arm/tegra.txt
index 7f1411bbabf7..32f62bb7006d 100644
--- a/Documentation/devicetree/bindings/arm/tegra.txt
+++ b/Documentation/devicetree/bindings/arm/tegra.txt
@@ -9,6 +9,12 @@ following compatible values:
9 9
10 nvidia,tegra20 10 nvidia,tegra20
11 nvidia,tegra30 11 nvidia,tegra30
12 nvidia,tegra114
13 nvidia,tegra124
14 nvidia,tegra132
15 nvidia,tegra210
16 nvidia,tegra186
17 nvidia,tegra194
12 18
13Boards 19Boards
14------------------------------------------- 20-------------------------------------------
@@ -26,8 +32,18 @@ board-specific compatible values:
26 nvidia,cardhu 32 nvidia,cardhu
27 nvidia,cardhu-a02 33 nvidia,cardhu-a02
28 nvidia,cardhu-a04 34 nvidia,cardhu-a04
35 nvidia,dalmore
29 nvidia,harmony 36 nvidia,harmony
37 nvidia,jetson-tk1
38 nvidia,norrin
39 nvidia,p2371-0000
40 nvidia,p2371-2180
41 nvidia,p2571
42 nvidia,p2771-0000
43 nvidia,p2972-0000
44 nvidia,roth
30 nvidia,seaboard 45 nvidia,seaboard
46 nvidia,tn7
31 nvidia,ventana 47 nvidia,ventana
32 toradex,apalis_t30 48 toradex,apalis_t30
33 toradex,apalis_t30-eval 49 toradex,apalis_t30-eval
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt
index 078a58b0302f..5a3bf7c5a7a0 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.txt
@@ -3,6 +3,7 @@ NVIDIA Tegra Power Management Controller (PMC)
3Required properties: 3Required properties:
4- compatible: Should contain one of the following: 4- compatible: Should contain one of the following:
5 - "nvidia,tegra186-pmc": for Tegra186 5 - "nvidia,tegra186-pmc": for Tegra186
6 - "nvidia,tegra194-pmc": for Tegra194
6- reg: Must contain an (offset, length) pair of the register set for each 7- reg: Must contain an (offset, length) pair of the register set for each
7 entry in reg-names. 8 entry in reg-names.
8- reg-names: Must include the following entries: 9- reg-names: Must include the following entries:
@@ -10,6 +11,7 @@ Required properties:
10 - "wake" 11 - "wake"
11 - "aotag" 12 - "aotag"
12 - "scratch" 13 - "scratch"
14 - "misc" (Only for Tegra194)
13 15
14Optional properties: 16Optional properties:
15- nvidia,invert-interrupt: If present, inverts the PMU interrupt signal. 17- nvidia,invert-interrupt: If present, inverts the PMU interrupt signal.
diff --git a/Documentation/devicetree/bindings/arm/xilinx.txt b/Documentation/devicetree/bindings/arm/xilinx.txt
index 1f7995357888..b9043bc35c14 100644
--- a/Documentation/devicetree/bindings/arm/xilinx.txt
+++ b/Documentation/devicetree/bindings/arm/xilinx.txt
@@ -5,3 +5,59 @@ shall have the following properties.
5 5
6Required root node properties: 6Required root node properties:
7 - compatible = "xlnx,zynq-7000"; 7 - compatible = "xlnx,zynq-7000";
8
9Additional compatible strings:
10
11- Xilinx internal board cc108
12 "xlnx,zynq-cc108"
13
14- Xilinx internal board zc770 with different FMC cards
15 "xlnx,zynq-zc770-xm010"
16 "xlnx,zynq-zc770-xm011"
17 "xlnx,zynq-zc770-xm012"
18 "xlnx,zynq-zc770-xm013"
19
20- Digilent Zybo Z7 board
21 "digilent,zynq-zybo-z7"
22
23---------------------------------------------------------------
24
25Xilinx Zynq UltraScale+ MPSoC Platforms Device Tree Bindings
26
27Boards with ZynqMP SOC based on an ARM Cortex A53 processor
28shall have the following properties.
29
30Required root node properties:
31 - compatible = "xlnx,zynqmp";
32
33
34Additional compatible strings:
35
36- Xilinx internal board zc1232
37 "xlnx,zynqmp-zc1232-revA", "xlnx,zynqmp-zc1232"
38
39- Xilinx internal board zc1254
40 "xlnx,zynqmp-zc1254-revA", "xlnx,zynqmp-zc1254"
41
42- Xilinx internal board zc1275
43 "xlnx,zynqmp-zc1275-revA", "xlnx,zynqmp-zc1275"
44
45- Xilinx internal board zc1751
46 "xlnx,zynqmp-zc1751"
47
48- Xilinx 96boards compatible board zcu100
49 "xlnx,zynqmp-zcu100-revC", "xlnx,zynqmp-zcu100"
50
51- Xilinx evaluation board zcu102
52 "xlnx,zynqmp-zcu102-revA", "xlnx,zynqmp-zcu102"
53 "xlnx,zynqmp-zcu102-revB", "xlnx,zynqmp-zcu102"
54 "xlnx,zynqmp-zcu102-rev1.0", "xlnx,zynqmp-zcu102"
55
56- Xilinx evaluation board zcu104
57 "xlnx,zynqmp-zcu104-revA", "xlnx,zynqmp-zcu104"
58
59- Xilinx evaluation board zcu106
60 "xlnx,zynqmp-zcu106-revA", "xlnx,zynqmp-zcu106"
61
62- Xilinx evaluation board zcu111
63 "xlnx,zynqmp-zcu111-revA", "xlnx,zynqmp-zcu111"
diff --git a/Documentation/devicetree/bindings/misc/arm-charlcd.txt b/Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt
index e28e2aac47f1..e28e2aac47f1 100644
--- a/Documentation/devicetree/bindings/misc/arm-charlcd.txt
+++ b/Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt
diff --git a/Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt b/Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt
index 3e21eb822811..c1e70621799b 100644
--- a/Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt
+++ b/Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt
@@ -73,7 +73,7 @@ Example with two SJA1000 CAN controllers connected to the GMI bus. We wrap the
73controllers with a simple-bus node since they are all connected to the same 73controllers with a simple-bus node since they are all connected to the same
74chip-select (CS4), in this example external address decoding is provided: 74chip-select (CS4), in this example external address decoding is provided:
75 75
76gmi@70090000 { 76gmi@70009000 {
77 compatible = "nvidia,tegra20-gmi"; 77 compatible = "nvidia,tegra20-gmi";
78 reg = <0x70009000 0x1000>; 78 reg = <0x70009000 0x1000>;
79 #address-cells = <2>; 79 #address-cells = <2>;
@@ -84,7 +84,6 @@ gmi@70090000 {
84 reset-names = "gmi"; 84 reset-names = "gmi";
85 ranges = <4 0 0xd0000000 0xfffffff>; 85 ranges = <4 0 0xd0000000 0xfffffff>;
86 86
87
88 bus@4,0 { 87 bus@4,0 {
89 compatible = "simple-bus"; 88 compatible = "simple-bus";
90 #address-cells = <1>; 89 #address-cells = <1>;
@@ -109,7 +108,7 @@ gmi@70090000 {
109Example with one SJA1000 CAN controller connected to the GMI bus 108Example with one SJA1000 CAN controller connected to the GMI bus
110on CS4: 109on CS4:
111 110
112gmi@70090000 { 111gmi@70009000 {
113 compatible = "nvidia,tegra20-gmi"; 112 compatible = "nvidia,tegra20-gmi";
114 reg = <0x70009000 0x1000>; 113 reg = <0x70009000 0x1000>;
115 #address-cells = <2>; 114 #address-cells = <2>;
@@ -120,7 +119,6 @@ gmi@70090000 {
120 reset-names = "gmi"; 119 reset-names = "gmi";
121 ranges = <4 0 0xd0000000 0xfffffff>; 120 ranges = <4 0 0xd0000000 0xfffffff>;
122 121
123
124 can@4,0 { 122 can@4,0 {
125 reg = <4 0 0x100>; 123 reg = <4 0 0x100>;
126 nvidia,snor-mux-mode; 124 nvidia,snor-mux-mode;
diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
index 76aec8a3724d..3c1f3a229eab 100644
--- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
@@ -415,12 +415,27 @@ Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
415 value type: <u32> 415 value type: <u32>
416 Definition: LP register offset. default it is 0x34. 416 Definition: LP register offset. default it is 0x34.
417 417
418 - clocks
419 Usage: optional, required if SNVS LP RTC requires explicit
420 enablement of clocks
421 Value type: <prop_encoded-array>
422 Definition: a clock specifier describing the clock required for
423 enabling and disabling SNVS LP RTC.
424
425 - clock-names
426 Usage: optional, required if SNVS LP RTC requires explicit
427 enablement of clocks
428 Value type: <string>
429 Definition: clock name string should be "snvs-rtc".
430
418EXAMPLE 431EXAMPLE
419 sec_mon_rtc_lp@1 { 432 sec_mon_rtc_lp@1 {
420 compatible = "fsl,sec-v4.0-mon-rtc-lp"; 433 compatible = "fsl,sec-v4.0-mon-rtc-lp";
421 interrupts = <93 2>; 434 interrupts = <93 2>;
422 regmap = <&snvs>; 435 regmap = <&snvs>;
423 offset = <0x34>; 436 offset = <0x34>;
437 clocks = <&clks IMX7D_SNVS_CLK>;
438 clock-names = "snvs-rtc";
424 }; 439 };
425 440
426===================================================================== 441=====================================================================
@@ -543,6 +558,8 @@ FULL EXAMPLE
543 regmap = <&sec_mon>; 558 regmap = <&sec_mon>;
544 offset = <0x34>; 559 offset = <0x34>;
545 interrupts = <93 2>; 560 interrupts = <93 2>;
561 clocks = <&clks IMX7D_SNVS_CLK>;
562 clock-names = "snvs-rtc";
546 }; 563 };
547 564
548 snvs-pwrkey@020cc000 { 565 snvs-pwrkey@020cc000 {
diff --git a/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt b/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
index baf9b34d20bf..b6a8cc0978cd 100644
--- a/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
+++ b/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
@@ -74,8 +74,8 @@ Example:
74 74
75bcm2835_i2s: i2s@7e203000 { 75bcm2835_i2s: i2s@7e203000 {
76 compatible = "brcm,bcm2835-i2s"; 76 compatible = "brcm,bcm2835-i2s";
77 reg = < 0x7e203000 0x20>, 77 reg = < 0x7e203000 0x24>;
78 < 0x7e101098 0x02>; 78 clocks = <&clocks BCM2835_CLOCK_PCM>;
79 79
80 dmas = <&dma 2>, 80 dmas = <&dma 2>,
81 <&dma 3>; 81 <&dma 3>;
diff --git a/Documentation/devicetree/bindings/eeprom/at24.txt b/Documentation/devicetree/bindings/eeprom/at24.txt
index 1812c848e369..abfae1beca2b 100644
--- a/Documentation/devicetree/bindings/eeprom/at24.txt
+++ b/Documentation/devicetree/bindings/eeprom/at24.txt
@@ -38,9 +38,9 @@ Required properties:
38 38
39 "catalyst", 39 "catalyst",
40 "microchip", 40 "microchip",
41 "nxp",
41 "ramtron", 42 "ramtron",
42 "renesas", 43 "renesas",
43 "nxp",
44 "st", 44 "st",
45 45
46 Some vendors use different model names for chips which are just 46 Some vendors use different model names for chips which are just
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
index ad876548ab5d..c1f65d1dac1d 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.txt
@@ -10,6 +10,7 @@ Required properties:
10 * And, optionally, one of the vendor specific compatible: 10 * And, optionally, one of the vendor specific compatible:
11 + allwinner,sun4i-a10-mali 11 + allwinner,sun4i-a10-mali
12 + allwinner,sun7i-a20-mali 12 + allwinner,sun7i-a20-mali
13 + allwinner,sun8i-h3-mali
13 + allwinner,sun50i-h5-mali 14 + allwinner,sun50i-h5-mali
14 + amlogic,meson-gxbb-mali 15 + amlogic,meson-gxbb-mali
15 + amlogic,meson-gxl-mali 16 + amlogic,meson-gxl-mali
diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
index 33c9a10fdc91..20f121daa910 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
@@ -14,6 +14,7 @@ Required properties:
14 - "renesas,irqc-r8a7794" (R-Car E2) 14 - "renesas,irqc-r8a7794" (R-Car E2)
15 - "renesas,intc-ex-r8a7795" (R-Car H3) 15 - "renesas,intc-ex-r8a7795" (R-Car H3)
16 - "renesas,intc-ex-r8a7796" (R-Car M3-W) 16 - "renesas,intc-ex-r8a7796" (R-Car M3-W)
17 - "renesas,intc-ex-r8a77965" (R-Car M3-N)
17 - "renesas,intc-ex-r8a77970" (R-Car V3M) 18 - "renesas,intc-ex-r8a77970" (R-Car V3M)
18 - "renesas,intc-ex-r8a77995" (R-Car D3) 19 - "renesas,intc-ex-r8a77995" (R-Car D3)
19- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in 20- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in
diff --git a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
index 621b41c79faa..44d71469c914 100644
--- a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
@@ -3,7 +3,9 @@
3EMIF - External Memory Interface - is an SDRAM controller used in 3EMIF - External Memory Interface - is an SDRAM controller used in
4TI SoCs. EMIF supports, based on the IP revision, one or more of 4TI SoCs. EMIF supports, based on the IP revision, one or more of
5DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance 5DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance
6of the EMIF IP and memory parts attached to it. 6of the EMIF IP and memory parts attached to it. Certain revisions
7of the EMIF controller also contain optional ECC support, which
8corrects one bit errors and detects two bit errors.
7 9
8Required properties: 10Required properties:
9- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev> 11- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev>
@@ -11,6 +13,8 @@ Required properties:
11 compatible should be one of the following: 13 compatible should be one of the following:
12 "ti,emif-am3352" 14 "ti,emif-am3352"
13 "ti,emif-am4372" 15 "ti,emif-am4372"
16 "ti,emif-dra7xx"
17 "ti,emif-keystone"
14 18
15- phy-type : <u32> indicating the DDR phy type. Following are the 19- phy-type : <u32> indicating the DDR phy type. Following are the
16 allowed values 20 allowed values
@@ -22,6 +26,7 @@ Required properties:
22- ti,hwmods : For TI hwmods processing and omap device creation 26- ti,hwmods : For TI hwmods processing and omap device creation
23 the value shall be "emif<n>" where <n> is the number of the EMIF 27 the value shall be "emif<n>" where <n> is the number of the EMIF
24 instance with base 1. 28 instance with base 1.
29- interrupts : interrupt used by the controller
25 30
26Required only for "ti,emif-am3352" and "ti,emif-am4372": 31Required only for "ti,emif-am3352" and "ti,emif-am4372":
27- sram : Phandles for generic sram driver nodes, 32- sram : Phandles for generic sram driver nodes,
@@ -71,3 +76,9 @@ emif: emif@4c000000 {
71 sram = <&pm_sram_code 76 sram = <&pm_sram_code
72 &pm_sram_data>; 77 &pm_sram_data>;
73}; 78};
79
80emif1: emif@4c000000 {
81 compatible = "ti,emif-dra7xx";
82 reg = <0x4c000000 0x200>;
83 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
84};
diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt
index a9aa79fb90ed..1aa6f2674af5 100644
--- a/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt
+++ b/Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt
@@ -21,7 +21,9 @@ Required properties :
21 - timer: The timeout clock (clk_m). Present if phy_type == utmi. 21 - timer: The timeout clock (clk_m). Present if phy_type == utmi.
22 - utmi-pads: The clock needed to access the UTMI pad control registers. 22 - utmi-pads: The clock needed to access the UTMI pad control registers.
23 Present if phy_type == utmi. 23 Present if phy_type == utmi.
24 - ulpi-link: The clock Tegra provides to the ULPI PHY (cdev2). 24 - ulpi-link: The clock Tegra provides to the ULPI PHY (usually pad DAP_MCLK2
25 with pad group aka "nvidia,pins" cdev2 and pin mux option config aka
26 "nvidia,function" pllp_out4).
25 Present if phy_type == ulpi, and ULPI link mode is in use. 27 Present if phy_type == ulpi, and ULPI link mode is in use.
26 - resets : Must contain an entry for each entry in reset-names. 28 - resets : Must contain an entry for each entry in reset-names.
27 See ../reset/reset.txt for details. 29 See ../reset/reset.txt for details.
diff --git a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt
index 2c46f30b62c5..9a06e1fdbc42 100644
--- a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt
@@ -11,6 +11,7 @@ Required properies:
11 "st,stm32f429-pinctrl" 11 "st,stm32f429-pinctrl"
12 "st,stm32f469-pinctrl" 12 "st,stm32f469-pinctrl"
13 "st,stm32f746-pinctrl" 13 "st,stm32f746-pinctrl"
14 "st,stm32f769-pinctrl"
14 "st,stm32h743-pinctrl" 15 "st,stm32h743-pinctrl"
15 "st,stm32mp157-pinctrl" 16 "st,stm32mp157-pinctrl"
16 "st,stm32mp157-z-pinctrl" 17 "st,stm32mp157-z-pinctrl"
diff --git a/Documentation/devicetree/bindings/power/mti,mips-cpc.txt b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
new file mode 100644
index 000000000000..c6b82511ae8a
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
@@ -0,0 +1,8 @@
1Binding for MIPS Cluster Power Controller (CPC).
2
3This binding allows a system to specify where the CPC registers are
4located.
5
6Required properties:
7compatible : Should be "mti,mips-cpc".
8regs: Should describe the address & size of the CPC register region.
diff --git a/Documentation/devicetree/bindings/power/wakeup-source.txt b/Documentation/devicetree/bindings/power/wakeup-source.txt
index 3c81f78b5c27..5d254ab13ebf 100644
--- a/Documentation/devicetree/bindings/power/wakeup-source.txt
+++ b/Documentation/devicetree/bindings/power/wakeup-source.txt
@@ -60,7 +60,7 @@ Examples
60 #size-cells = <0>; 60 #size-cells = <0>;
61 61
62 button@1 { 62 button@1 {
63 debounce_interval = <50>; 63 debounce-interval = <50>;
64 wakeup-source; 64 wakeup-source;
65 linux,code = <116>; 65 linux,code = <116>;
66 label = "POWER"; 66 label = "POWER";
diff --git a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
index 65783de0aedf..7bb0362828ec 100644
--- a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
+++ b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
@@ -2,9 +2,8 @@
2 2
3Required properties: 3Required properties:
4- compatible: "brcm,bcm2835-i2s" 4- compatible: "brcm,bcm2835-i2s"
5- reg: A list of base address and size entries: 5- reg: Should contain PCM registers location and length.
6 * The first entry should cover the PCM registers 6- clocks: the (PCM) clock to use
7 * The second entry should cover the PCM clock registers
8- dmas: List of DMA controller phandle and DMA request line ordered pairs. 7- dmas: List of DMA controller phandle and DMA request line ordered pairs.
9- dma-names: Identifier string for each DMA request line in the dmas property. 8- dma-names: Identifier string for each DMA request line in the dmas property.
10 These strings correspond 1:1 with the ordered pairs in dmas. 9 These strings correspond 1:1 with the ordered pairs in dmas.
@@ -16,8 +15,8 @@ Example:
16 15
17bcm2835_i2s: i2s@7e203000 { 16bcm2835_i2s: i2s@7e203000 {
18 compatible = "brcm,bcm2835-i2s"; 17 compatible = "brcm,bcm2835-i2s";
19 reg = <0x7e203000 0x20>, 18 reg = <0x7e203000 0x24>;
20 <0x7e101098 0x02>; 19 clocks = <&clocks BCM2835_CLOCK_PCM>;
21 20
22 dmas = <&dma 2>, 21 dmas = <&dma 2>,
23 <&dma 3>; 22 <&dma 3>;
diff --git a/Documentation/devicetree/bindings/thermal/imx-thermal.txt b/Documentation/devicetree/bindings/thermal/imx-thermal.txt
index 28be51afdb6a..379eb763073e 100644
--- a/Documentation/devicetree/bindings/thermal/imx-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/imx-thermal.txt
@@ -22,7 +22,32 @@ Optional properties:
22- clocks : thermal sensor's clock source. 22- clocks : thermal sensor's clock source.
23 23
24Example: 24Example:
25ocotp: ocotp@21bc000 {
26 #address-cells = <1>;
27 #size-cells = <1>;
28 compatible = "fsl,imx6sx-ocotp", "syscon";
29 reg = <0x021bc000 0x4000>;
30 clocks = <&clks IMX6SX_CLK_OCOTP>;
25 31
32 tempmon_calib: calib@38 {
33 reg = <0x38 4>;
34 };
35
36 tempmon_temp_grade: temp-grade@20 {
37 reg = <0x20 4>;
38 };
39};
40
41tempmon: tempmon {
42 compatible = "fsl,imx6sx-tempmon", "fsl,imx6q-tempmon";
43 interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
44 fsl,tempmon = <&anatop>;
45 nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
46 nvmem-cell-names = "calib", "temp_grade";
47 clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>;
48};
49
50Legacy method (Deprecated):
26tempmon { 51tempmon {
27 compatible = "fsl,imx6q-tempmon"; 52 compatible = "fsl,imx6q-tempmon";
28 fsl,tempmon = <&anatop>; 53 fsl,tempmon = <&anatop>;
diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
index 62dd5baad70e..04fc368d828f 100644
--- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
@@ -2,8 +2,10 @@ Allwinner SoCs Watchdog timer
2 2
3Required properties: 3Required properties:
4 4
5- compatible : should be either "allwinner,sun4i-a10-wdt" or 5- compatible : should be one of
6 "allwinner,sun6i-a31-wdt" 6 "allwinner,sun4i-a10-wdt"
7 "allwinner,sun6i-a31-wdt"
8 "allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt"
7- reg : Specifies base physical address and size of the registers. 9- reg : Specifies base physical address and size of the registers.
8 10
9Example: 11Example:
diff --git a/Documentation/features/sched/membarrier-sync-core/arch-support.txt b/Documentation/features/sched/membarrier-sync-core/arch-support.txt
new file mode 100644
index 000000000000..2c815a7f1ba7
--- /dev/null
+++ b/Documentation/features/sched/membarrier-sync-core/arch-support.txt
@@ -0,0 +1,62 @@
1#
2# Feature name: membarrier-sync-core
3# Kconfig: ARCH_HAS_MEMBARRIER_SYNC_CORE
4# description: arch supports core serializing membarrier
5#
6# Architecture requirements
7#
8# * arm64
9#
10# Rely on eret context synchronization when returning from IPI handler, and
11# when returning to user-space.
12#
13# * x86
14#
15# x86-32 uses IRET as return from interrupt, which takes care of the IPI.
16# However, it uses both IRET and SYSEXIT to go back to user-space. The IRET
17# instruction is core serializing, but not SYSEXIT.
18#
19# x86-64 uses IRET as return from interrupt, which takes care of the IPI.
20# However, it can return to user-space through either SYSRETL (compat code),
21# SYSRETQ, or IRET.
22#
23# Given that neither SYSRET{L,Q}, nor SYSEXIT, are core serializing, we rely
24# instead on write_cr3() performed by switch_mm() to provide core serialization
25# after changing the current mm, and deal with the special case of kthread ->
26# uthread (temporarily keeping current mm into active_mm) by issuing a
27# sync_core_before_usermode() in that specific case.
28#
29 -----------------------
30 | arch |status|
31 -----------------------
32 | alpha: | TODO |
33 | arc: | TODO |
34 | arm: | TODO |
35 | arm64: | ok |
36 | blackfin: | TODO |
37 | c6x: | TODO |
38 | cris: | TODO |
39 | frv: | TODO |
40 | h8300: | TODO |
41 | hexagon: | TODO |
42 | ia64: | TODO |
43 | m32r: | TODO |
44 | m68k: | TODO |
45 | metag: | TODO |
46 | microblaze: | TODO |
47 | mips: | TODO |
48 | mn10300: | TODO |
49 | nios2: | TODO |
50 | openrisc: | TODO |
51 | parisc: | TODO |
52 | powerpc: | TODO |
53 | s390: | TODO |
54 | score: | TODO |
55 | sh: | TODO |
56 | sparc: | TODO |
57 | tile: | TODO |
58 | um: | TODO |
59 | unicore32: | TODO |
60 | x86: | ok |
61 | xtensa: | TODO |
62 -----------------------
diff --git a/Documentation/gpu/tve200.rst b/Documentation/gpu/tve200.rst
index 69b17b324e12..152ea9398f7e 100644
--- a/Documentation/gpu/tve200.rst
+++ b/Documentation/gpu/tve200.rst
@@ -3,4 +3,4 @@
3================================== 3==================================
4 4
5.. kernel-doc:: drivers/gpu/drm/tve200/tve200_drv.c 5.. kernel-doc:: drivers/gpu/drm/tve200/tve200_drv.c
6 :doc: Faraday TV Encoder 200 6 :doc: Faraday TV Encoder TVE200 DRM Driver
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index d47702456926..65514c251318 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -28,8 +28,10 @@ Supported adapters:
28 * Intel Wildcat Point (PCH) 28 * Intel Wildcat Point (PCH)
29 * Intel Wildcat Point-LP (PCH) 29 * Intel Wildcat Point-LP (PCH)
30 * Intel BayTrail (SOC) 30 * Intel BayTrail (SOC)
31 * Intel Braswell (SOC)
31 * Intel Sunrise Point-H (PCH) 32 * Intel Sunrise Point-H (PCH)
32 * Intel Sunrise Point-LP (PCH) 33 * Intel Sunrise Point-LP (PCH)
34 * Intel Kaby Lake-H (PCH)
33 * Intel DNV (SOC) 35 * Intel DNV (SOC)
34 * Intel Broxton (SOC) 36 * Intel Broxton (SOC)
35 * Intel Lewisburg (PCH) 37 * Intel Lewisburg (PCH)
diff --git a/Documentation/locking/mutex-design.txt b/Documentation/locking/mutex-design.txt
index 60c482df1a38..818aca19612f 100644
--- a/Documentation/locking/mutex-design.txt
+++ b/Documentation/locking/mutex-design.txt
@@ -21,37 +21,23 @@ Implementation
21-------------- 21--------------
22 22
23Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h 23Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h
24and implemented in kernel/locking/mutex.c. These locks use a three 24and implemented in kernel/locking/mutex.c. These locks use an atomic variable
25state atomic counter (->count) to represent the different possible 25(->owner) to keep track of the lock state during its lifetime. Field owner
26transitions that can occur during the lifetime of a lock: 26actually contains 'struct task_struct *' to the current lock owner and it is
27 27therefore NULL if not currently owned. Since task_struct pointers are aligned
28 1: unlocked 28at at least L1_CACHE_BYTES, low bits (3) are used to store extra state (e.g.,
29 0: locked, no waiters 29if waiter list is non-empty). In its most basic form it also includes a
30 negative: locked, with potential waiters 30wait-queue and a spinlock that serializes access to it. Furthermore,
31 31CONFIG_MUTEX_SPIN_ON_OWNER=y systems use a spinner MCS lock (->osq), described
32In its most basic form it also includes a wait-queue and a spinlock 32below in (ii).
33that serializes access to it. CONFIG_SMP systems can also include
34a pointer to the lock task owner (->owner) as well as a spinner MCS
35lock (->osq), both described below in (ii).
36 33
37When acquiring a mutex, there are three possible paths that can be 34When acquiring a mutex, there are three possible paths that can be
38taken, depending on the state of the lock: 35taken, depending on the state of the lock:
39 36
40(i) fastpath: tries to atomically acquire the lock by decrementing the 37(i) fastpath: tries to atomically acquire the lock by cmpxchg()ing the owner with
41 counter. If it was already taken by another task it goes to the next 38 the current task. This only works in the uncontended case (cmpxchg() checks
42 possible path. This logic is architecture specific. On x86-64, the 39 against 0UL, so all 3 state bits above have to be 0). If the lock is
43 locking fastpath is 2 instructions: 40 contended it goes to the next possible path.
44
45 0000000000000e10 <mutex_lock>:
46 e21: f0 ff 0b lock decl (%rbx)
47 e24: 79 08 jns e2e <mutex_lock+0x1e>
48
49 the unlocking fastpath is equally tight:
50
51 0000000000000bc0 <mutex_unlock>:
52 bc8: f0 ff 07 lock incl (%rdi)
53 bcb: 7f 0a jg bd7 <mutex_unlock+0x17>
54
55 41
56(ii) midpath: aka optimistic spinning, tries to spin for acquisition 42(ii) midpath: aka optimistic spinning, tries to spin for acquisition
57 while the lock owner is running and there are no other tasks ready 43 while the lock owner is running and there are no other tasks ready
@@ -143,11 +129,10 @@ Test if the mutex is taken:
143Disadvantages 129Disadvantages
144------------- 130-------------
145 131
146Unlike its original design and purpose, 'struct mutex' is larger than 132Unlike its original design and purpose, 'struct mutex' is among the largest
147most locks in the kernel. E.g: on x86-64 it is 40 bytes, almost twice 133locks in the kernel. E.g: on x86-64 it is 32 bytes, where 'struct semaphore'
148as large as 'struct semaphore' (24 bytes) and tied, along with rwsems, 134is 24 bytes and rw_semaphore is 40 bytes. Larger structure sizes mean more CPU
149for the largest lock in the kernel. Larger structure sizes mean more 135cache and memory footprint.
150CPU cache and memory footprint.
151 136
152When to use mutexes 137When to use mutexes
153------------------- 138-------------------
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/dmx.h.rst.exceptions
index 63f55a9ae2b1..a8c4239ed95b 100644
--- a/Documentation/media/dmx.h.rst.exceptions
+++ b/Documentation/media/dmx.h.rst.exceptions
@@ -50,9 +50,15 @@ replace typedef dmx_filter_t :c:type:`dmx_filter`
50replace typedef dmx_pes_type_t :c:type:`dmx_pes_type` 50replace typedef dmx_pes_type_t :c:type:`dmx_pes_type`
51replace typedef dmx_input_t :c:type:`dmx_input` 51replace typedef dmx_input_t :c:type:`dmx_input`
52 52
53ignore symbol DMX_OUT_DECODER 53replace symbol DMX_BUFFER_FLAG_HAD_CRC32_DISCARD :c:type:`dmx_buffer_flags`
54ignore symbol DMX_OUT_TAP 54replace symbol DMX_BUFFER_FLAG_TEI :c:type:`dmx_buffer_flags`
55ignore symbol DMX_OUT_TS_TAP 55replace symbol DMX_BUFFER_PKT_COUNTER_MISMATCH :c:type:`dmx_buffer_flags`
56ignore symbol DMX_OUT_TSDEMUX_TAP 56replace symbol DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED :c:type:`dmx_buffer_flags`
57replace symbol DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR :c:type:`dmx_buffer_flags`
58
59replace symbol DMX_OUT_DECODER :c:type:`dmx_output`
60replace symbol DMX_OUT_TAP :c:type:`dmx_output`
61replace symbol DMX_OUT_TS_TAP :c:type:`dmx_output`
62replace symbol DMX_OUT_TSDEMUX_TAP :c:type:`dmx_output`
57 63
58replace ioctl DMX_DQBUF dmx_qbuf 64replace ioctl DMX_DQBUF dmx_qbuf
diff --git a/Documentation/media/uapi/dvb/dmx-qbuf.rst b/Documentation/media/uapi/dvb/dmx-qbuf.rst
index b48c4931658e..be5a4c6f1904 100644
--- a/Documentation/media/uapi/dvb/dmx-qbuf.rst
+++ b/Documentation/media/uapi/dvb/dmx-qbuf.rst
@@ -51,9 +51,10 @@ out to disk. Buffers remain locked until dequeued, until the
51the device is closed. 51the device is closed.
52 52
53Applications call the ``DMX_DQBUF`` ioctl to dequeue a filled 53Applications call the ``DMX_DQBUF`` ioctl to dequeue a filled
54(capturing) buffer from the driver's outgoing queue. They just set the ``reserved`` field array to zero. When ``DMX_DQBUF`` is called with a 54(capturing) buffer from the driver's outgoing queue.
55pointer to this structure, the driver fills the remaining fields or 55They just set the ``index`` field withe the buffer ID to be queued.
56returns an error code. 56When ``DMX_DQBUF`` is called with a pointer to struct :c:type:`dmx_buffer`,
57the driver fills the remaining fields or returns an error code.
57 58
58By default ``DMX_DQBUF`` blocks when no buffer is in the outgoing 59By default ``DMX_DQBUF`` blocks when no buffer is in the outgoing
59queue. When the ``O_NONBLOCK`` flag was given to the 60queue. When the ``O_NONBLOCK`` flag was given to the
diff --git a/Documentation/networking/segmentation-offloads.txt b/Documentation/networking/segmentation-offloads.txt
index 2f09455a993a..d47480b61ac6 100644
--- a/Documentation/networking/segmentation-offloads.txt
+++ b/Documentation/networking/segmentation-offloads.txt
@@ -13,6 +13,7 @@ The following technologies are described:
13 * Generic Segmentation Offload - GSO 13 * Generic Segmentation Offload - GSO
14 * Generic Receive Offload - GRO 14 * Generic Receive Offload - GRO
15 * Partial Generic Segmentation Offload - GSO_PARTIAL 15 * Partial Generic Segmentation Offload - GSO_PARTIAL
16 * SCTP accelleration with GSO - GSO_BY_FRAGS
16 17
17TCP Segmentation Offload 18TCP Segmentation Offload
18======================== 19========================
@@ -49,6 +50,10 @@ datagram into multiple IPv4 fragments. Many of the requirements for UDP
49fragmentation offload are the same as TSO. However the IPv4 ID for 50fragmentation offload are the same as TSO. However the IPv4 ID for
50fragments should not increment as a single IPv4 datagram is fragmented. 51fragments should not increment as a single IPv4 datagram is fragmented.
51 52
53UFO is deprecated: modern kernels will no longer generate UFO skbs, but can
54still receive them from tuntap and similar devices. Offload of UDP-based
55tunnel protocols is still supported.
56
52IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads 57IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads
53======================================================== 58========================================================
54 59
@@ -83,10 +88,10 @@ SKB_GSO_UDP_TUNNEL_CSUM. These two additional tunnel types reflect the
83fact that the outer header also requests to have a non-zero checksum 88fact that the outer header also requests to have a non-zero checksum
84included in the outer header. 89included in the outer header.
85 90
86Finally there is SKB_GSO_REMCSUM which indicates that a given tunnel header 91Finally there is SKB_GSO_TUNNEL_REMCSUM which indicates that a given tunnel
87has requested a remote checksum offload. In this case the inner headers 92header has requested a remote checksum offload. In this case the inner
88will be left with a partial checksum and only the outer header checksum 93headers will be left with a partial checksum and only the outer header
89will be computed. 94checksum will be computed.
90 95
91Generic Segmentation Offload 96Generic Segmentation Offload
92============================ 97============================
@@ -128,3 +133,28 @@ values for if the header was simply duplicated. The one exception to this
128is the outer IPv4 ID field. It is up to the device drivers to guarantee 133is the outer IPv4 ID field. It is up to the device drivers to guarantee
129that the IPv4 ID field is incremented in the case that a given header does 134that the IPv4 ID field is incremented in the case that a given header does
130not have the DF bit set. 135not have the DF bit set.
136
137SCTP accelleration with GSO
138===========================
139
140SCTP - despite the lack of hardware support - can still take advantage of
141GSO to pass one large packet through the network stack, rather than
142multiple small packets.
143
144This requires a different approach to other offloads, as SCTP packets
145cannot be just segmented to (P)MTU. Rather, the chunks must be contained in
146IP segments, padding respected. So unlike regular GSO, SCTP can't just
147generate a big skb, set gso_size to the fragmentation point and deliver it
148to IP layer.
149
150Instead, the SCTP protocol layer builds an skb with the segments correctly
151padded and stored as chained skbs, and skb_segment() splits based on those.
152To signal this, gso_size is set to the special value GSO_BY_FRAGS.
153
154Therefore, any code in the core networking stack must be aware of the
155possibility that gso_size will be GSO_BY_FRAGS and handle that case
156appropriately. (For size checks, the skb_gso_validate_*_len family of
157helpers do this automatically.)
158
159This also affects drivers with the NETIF_F_FRAGLIST & NETIF_F_GSO_SCTP bits
160set. Note also that NETIF_F_GSO_SCTP is included in NETIF_F_GSO_SOFTWARE.
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 792fa8717d13..d6b3ff51a14f 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -123,14 +123,15 @@ memory layout to fit in user mode), check KVM_CAP_MIPS_VZ and use the
123flag KVM_VM_MIPS_VZ. 123flag KVM_VM_MIPS_VZ.
124 124
125 125
1264.3 KVM_GET_MSR_INDEX_LIST 1264.3 KVM_GET_MSR_INDEX_LIST, KVM_GET_MSR_FEATURE_INDEX_LIST
127 127
128Capability: basic 128Capability: basic, KVM_CAP_GET_MSR_FEATURES for KVM_GET_MSR_FEATURE_INDEX_LIST
129Architectures: x86 129Architectures: x86
130Type: system 130Type: system ioctl
131Parameters: struct kvm_msr_list (in/out) 131Parameters: struct kvm_msr_list (in/out)
132Returns: 0 on success; -1 on error 132Returns: 0 on success; -1 on error
133Errors: 133Errors:
134 EFAULT: the msr index list cannot be read from or written to
134 E2BIG: the msr index list is to be to fit in the array specified by 135 E2BIG: the msr index list is to be to fit in the array specified by
135 the user. 136 the user.
136 137
@@ -139,16 +140,23 @@ struct kvm_msr_list {
139 __u32 indices[0]; 140 __u32 indices[0];
140}; 141};
141 142
142This ioctl returns the guest msrs that are supported. The list varies 143The user fills in the size of the indices array in nmsrs, and in return
143by kvm version and host processor, but does not change otherwise. The 144kvm adjusts nmsrs to reflect the actual number of msrs and fills in the
144user fills in the size of the indices array in nmsrs, and in return 145indices array with their numbers.
145kvm adjusts nmsrs to reflect the actual number of msrs and fills in 146
146the indices array with their numbers. 147KVM_GET_MSR_INDEX_LIST returns the guest msrs that are supported. The list
148varies by kvm version and host processor, but does not change otherwise.
147 149
148Note: if kvm indicates supports MCE (KVM_CAP_MCE), then the MCE bank MSRs are 150Note: if kvm indicates supports MCE (KVM_CAP_MCE), then the MCE bank MSRs are
149not returned in the MSR list, as different vcpus can have a different number 151not returned in the MSR list, as different vcpus can have a different number
150of banks, as set via the KVM_X86_SETUP_MCE ioctl. 152of banks, as set via the KVM_X86_SETUP_MCE ioctl.
151 153
154KVM_GET_MSR_FEATURE_INDEX_LIST returns the list of MSRs that can be passed
155to the KVM_GET_MSRS system ioctl. This lets userspace probe host capabilities
156and processor features that are exposed via MSRs (e.g., VMX capabilities).
157This list also varies by kvm version and host processor, but does not change
158otherwise.
159
152 160
1534.4 KVM_CHECK_EXTENSION 1614.4 KVM_CHECK_EXTENSION
154 162
@@ -475,14 +483,22 @@ Support for this has been removed. Use KVM_SET_GUEST_DEBUG instead.
475 483
4764.18 KVM_GET_MSRS 4844.18 KVM_GET_MSRS
477 485
478Capability: basic 486Capability: basic (vcpu), KVM_CAP_GET_MSR_FEATURES (system)
479Architectures: x86 487Architectures: x86
480Type: vcpu ioctl 488Type: system ioctl, vcpu ioctl
481Parameters: struct kvm_msrs (in/out) 489Parameters: struct kvm_msrs (in/out)
482Returns: 0 on success, -1 on error 490Returns: number of msrs successfully returned;
491 -1 on error
492
493When used as a system ioctl:
494Reads the values of MSR-based features that are available for the VM. This
495is similar to KVM_GET_SUPPORTED_CPUID, but it returns MSR indices and values.
496The list of msr-based features can be obtained using KVM_GET_MSR_FEATURE_INDEX_LIST
497in a system ioctl.
483 498
499When used as a vcpu ioctl:
484Reads model-specific registers from the vcpu. Supported msr indices can 500Reads model-specific registers from the vcpu. Supported msr indices can
485be obtained using KVM_GET_MSR_INDEX_LIST. 501be obtained using KVM_GET_MSR_INDEX_LIST in a system ioctl.
486 502
487struct kvm_msrs { 503struct kvm_msrs {
488 __u32 nmsrs; /* number of msrs in entries */ 504 __u32 nmsrs; /* number of msrs in entries */
diff --git a/Documentation/virtual/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt
index dcab6dc11e3b..87a7506f31c2 100644
--- a/Documentation/virtual/kvm/cpuid.txt
+++ b/Documentation/virtual/kvm/cpuid.txt
@@ -58,6 +58,10 @@ KVM_FEATURE_PV_TLB_FLUSH || 9 || guest checks this feature bit
58 || || before enabling paravirtualized 58 || || before enabling paravirtualized
59 || || tlb flush. 59 || || tlb flush.
60------------------------------------------------------------------------------ 60------------------------------------------------------------------------------
61KVM_FEATURE_ASYNC_PF_VMEXIT || 10 || paravirtualized async PF VM exit
62 || || can be enabled by setting bit 2
63 || || when writing to msr 0x4b564d02
64------------------------------------------------------------------------------
61KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side 65KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side
62 || || per-cpu warps are expected in 66 || || per-cpu warps are expected in
63 || || kvmclock. 67 || || kvmclock.
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 1ebecc115dc6..f3f0d57ced8e 100644
--- a/Documentation/virtual/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -170,7 +170,8 @@ MSR_KVM_ASYNC_PF_EN: 0x4b564d02
170 when asynchronous page faults are enabled on the vcpu 0 when 170 when asynchronous page faults are enabled on the vcpu 0 when
171 disabled. Bit 1 is 1 if asynchronous page faults can be injected 171 disabled. Bit 1 is 1 if asynchronous page faults can be injected
172 when vcpu is in cpl == 0. Bit 2 is 1 if asynchronous page faults 172 when vcpu is in cpl == 0. Bit 2 is 1 if asynchronous page faults
173 are delivered to L1 as #PF vmexits. 173 are delivered to L1 as #PF vmexits. Bit 2 can be set only if
174 KVM_FEATURE_ASYNC_PF_VMEXIT is present in CPUID.
174 175
175 First 4 byte of 64 byte memory location will be written to by 176 First 4 byte of 64 byte memory location will be written to by
176 the hypervisor at the time of asynchronous page fault (APF) 177 the hypervisor at the time of asynchronous page fault (APF)
diff --git a/Documentation/x86/intel_rdt_ui.txt b/Documentation/x86/intel_rdt_ui.txt
index 756fd76b78a6..71c30984e94d 100644
--- a/Documentation/x86/intel_rdt_ui.txt
+++ b/Documentation/x86/intel_rdt_ui.txt
@@ -671,7 +671,7 @@ occupancy of the real time threads on these cores.
671# mkdir p1 671# mkdir p1
672 672
673Move the cpus 4-7 over to p1 673Move the cpus 4-7 over to p1
674# echo f0 > p0/cpus 674# echo f0 > p1/cpus
675 675
676View the llc occupancy snapshot 676View the llc occupancy snapshot
677 677
diff --git a/Documentation/x86/topology.txt b/Documentation/x86/topology.txt
index f3e9d7e9ed6c..2953e3ec9a02 100644
--- a/Documentation/x86/topology.txt
+++ b/Documentation/x86/topology.txt
@@ -108,7 +108,7 @@ The topology of a system is described in the units of:
108 108
109 The number of online threads is also printed in /proc/cpuinfo "siblings." 109 The number of online threads is also printed in /proc/cpuinfo "siblings."
110 110
111 - topology_sibling_mask(): 111 - topology_sibling_cpumask():
112 112
113 The cpumask contains all online threads in the core to which a thread 113 The cpumask contains all online threads in the core to which a thread
114 belongs. 114 belongs.
diff --git a/MAINTAINERS b/MAINTAINERS
index 3bdc260e36b7..94e6a62ca60b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1238,7 +1238,7 @@ F: drivers/clk/at91
1238 1238
1239ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT 1239ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT
1240M: Nicolas Ferre <nicolas.ferre@microchip.com> 1240M: Nicolas Ferre <nicolas.ferre@microchip.com>
1241M: Alexandre Belloni <alexandre.belloni@free-electrons.com> 1241M: Alexandre Belloni <alexandre.belloni@bootlin.com>
1242L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1242L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1243W: http://www.linux4sam.org 1243W: http://www.linux4sam.org
1244T: git git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git 1244T: git git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git
@@ -1590,7 +1590,7 @@ ARM/Marvell Dove/MV78xx0/Orion SOC support
1590M: Jason Cooper <jason@lakedaemon.net> 1590M: Jason Cooper <jason@lakedaemon.net>
1591M: Andrew Lunn <andrew@lunn.ch> 1591M: Andrew Lunn <andrew@lunn.ch>
1592M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 1592M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
1593M: Gregory Clement <gregory.clement@free-electrons.com> 1593M: Gregory Clement <gregory.clement@bootlin.com>
1594L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1594L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1595S: Maintained 1595S: Maintained
1596F: Documentation/devicetree/bindings/soc/dove/ 1596F: Documentation/devicetree/bindings/soc/dove/
@@ -1604,7 +1604,7 @@ F: arch/arm/boot/dts/orion5x*
1604ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support 1604ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support
1605M: Jason Cooper <jason@lakedaemon.net> 1605M: Jason Cooper <jason@lakedaemon.net>
1606M: Andrew Lunn <andrew@lunn.ch> 1606M: Andrew Lunn <andrew@lunn.ch>
1607M: Gregory Clement <gregory.clement@free-electrons.com> 1607M: Gregory Clement <gregory.clement@bootlin.com>
1608M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 1608M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
1609L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1609L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1610S: Maintained 1610S: Maintained
@@ -1863,7 +1863,6 @@ Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
1863S: Maintained 1863S: Maintained
1864F: arch/arm/boot/dts/s3c* 1864F: arch/arm/boot/dts/s3c*
1865F: arch/arm/boot/dts/s5p* 1865F: arch/arm/boot/dts/s5p*
1866F: arch/arm/boot/dts/samsung*
1867F: arch/arm/boot/dts/exynos* 1866F: arch/arm/boot/dts/exynos*
1868F: arch/arm64/boot/dts/exynos/ 1867F: arch/arm64/boot/dts/exynos/
1869F: arch/arm/plat-samsung/ 1868F: arch/arm/plat-samsung/
@@ -1999,8 +1998,10 @@ M: Maxime Coquelin <mcoquelin.stm32@gmail.com>
1999M: Alexandre Torgue <alexandre.torgue@st.com> 1998M: Alexandre Torgue <alexandre.torgue@st.com>
2000L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1999L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2001S: Maintained 2000S: Maintained
2002T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git 2001T: git git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
2003N: stm32 2002N: stm32
2003F: arch/arm/boot/dts/stm32*
2004F: arch/arm/mach-stm32/
2004F: drivers/clocksource/armv7m_systick.c 2005F: drivers/clocksource/armv7m_systick.c
2005 2006
2006ARM/TANGO ARCHITECTURE 2007ARM/TANGO ARCHITECTURE
@@ -7600,8 +7601,10 @@ F: mm/kasan/
7600F: scripts/Makefile.kasan 7601F: scripts/Makefile.kasan
7601 7602
7602KCONFIG 7603KCONFIG
7604M: Masahiro Yamada <yamada.masahiro@socionext.com>
7605T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig
7603L: linux-kbuild@vger.kernel.org 7606L: linux-kbuild@vger.kernel.org
7604S: Orphan 7607S: Maintained
7605F: Documentation/kbuild/kconfig-language.txt 7608F: Documentation/kbuild/kconfig-language.txt
7606F: scripts/kconfig/ 7609F: scripts/kconfig/
7607 7610
@@ -7909,7 +7912,6 @@ S: Maintained
7909F: scripts/leaking_addresses.pl 7912F: scripts/leaking_addresses.pl
7910 7913
7911LED SUBSYSTEM 7914LED SUBSYSTEM
7912M: Richard Purdie <rpurdie@rpsys.net>
7913M: Jacek Anaszewski <jacek.anaszewski@gmail.com> 7915M: Jacek Anaszewski <jacek.anaszewski@gmail.com>
7914M: Pavel Machek <pavel@ucw.cz> 7916M: Pavel Machek <pavel@ucw.cz>
7915L: linux-leds@vger.kernel.org 7917L: linux-leds@vger.kernel.org
@@ -9206,6 +9208,7 @@ MIPS GENERIC PLATFORM
9206M: Paul Burton <paul.burton@mips.com> 9208M: Paul Burton <paul.burton@mips.com>
9207L: linux-mips@linux-mips.org 9209L: linux-mips@linux-mips.org
9208S: Supported 9210S: Supported
9211F: Documentation/devicetree/bindings/power/mti,mips-cpc.txt
9209F: arch/mips/generic/ 9212F: arch/mips/generic/
9210F: arch/mips/tools/generic-board-config.sh 9213F: arch/mips/tools/generic-board-config.sh
9211 9214
@@ -9945,6 +9948,7 @@ F: drivers/nfc/nxp-nci
9945 9948
9946OBJTOOL 9949OBJTOOL
9947M: Josh Poimboeuf <jpoimboe@redhat.com> 9950M: Josh Poimboeuf <jpoimboe@redhat.com>
9951M: Peter Zijlstra <peterz@infradead.org>
9948S: Supported 9952S: Supported
9949F: tools/objtool/ 9953F: tools/objtool/
9950 9954
@@ -10925,6 +10929,17 @@ L: linux-gpio@vger.kernel.org
10925S: Supported 10929S: Supported
10926F: drivers/pinctrl/pinctrl-at91-pio4.* 10930F: drivers/pinctrl/pinctrl-at91-pio4.*
10927 10931
10932PIN CONTROLLER - FREESCALE
10933M: Dong Aisheng <aisheng.dong@nxp.com>
10934M: Fabio Estevam <festevam@gmail.com>
10935M: Shawn Guo <shawnguo@kernel.org>
10936M: Stefan Agner <stefan@agner.ch>
10937R: Pengutronix Kernel Team <kernel@pengutronix.de>
10938L: linux-gpio@vger.kernel.org
10939S: Maintained
10940F: drivers/pinctrl/freescale/
10941F: Documentation/devicetree/bindings/pinctrl/fsl,*
10942
10928PIN CONTROLLER - INTEL 10943PIN CONTROLLER - INTEL
10929M: Mika Westerberg <mika.westerberg@linux.intel.com> 10944M: Mika Westerberg <mika.westerberg@linux.intel.com>
10930M: Heikki Krogerus <heikki.krogerus@linux.intel.com> 10945M: Heikki Krogerus <heikki.krogerus@linux.intel.com>
diff --git a/Makefile b/Makefile
index 79ad2bfa24b6..c4322dea3ca2 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
2VERSION = 4 2VERSION = 4
3PATCHLEVEL = 16 3PATCHLEVEL = 16
4SUBLEVEL = 0 4SUBLEVEL = 0
5EXTRAVERSION = -rc1 5EXTRAVERSION = -rc4
6NAME = Fearless Coyote 6NAME = Fearless Coyote
7 7
8# *DOCUMENTATION* 8# *DOCUMENTATION*
@@ -388,7 +388,7 @@ PYTHON = python
388CHECK = sparse 388CHECK = sparse
389 389
390CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ 390CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
391 -Wbitwise -Wno-return-void $(CF) 391 -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
392NOSTDINC_FLAGS = 392NOSTDINC_FLAGS =
393CFLAGS_MODULE = 393CFLAGS_MODULE =
394AFLAGS_MODULE = 394AFLAGS_MODULE =
@@ -489,6 +489,11 @@ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
489KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) 489KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
490endif 490endif
491 491
492RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
493RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
494RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
495export RETPOLINE_CFLAGS
496
492ifeq ($(config-targets),1) 497ifeq ($(config-targets),1)
493# =========================================================================== 498# ===========================================================================
494# *config targets only - make sure prerequisites are updated, and descend 499# *config targets only - make sure prerequisites are updated, and descend
@@ -579,10 +584,9 @@ ifeq ($(KBUILD_EXTMOD),)
579# To avoid any implicit rule to kick in, define an empty command 584# To avoid any implicit rule to kick in, define an empty command
580$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; 585$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
581 586
582# If .config is newer than include/config/auto.conf, someone tinkered 587# The actual configuration files used during the build are stored in
583# with it and forgot to run make oldconfig. 588# include/generated/ and include/config/. Update them if .config is newer than
584# if auto.conf.cmd is missing then we are probably in a cleaned tree so 589# include/config/auto.conf (which mirrors .config).
585# we execute the config step to be sure to catch updated Kconfig files
586include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 590include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
587 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 591 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
588else 592else
@@ -857,8 +861,7 @@ KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
857KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) 861KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
858 862
859# Use --build-id when available. 863# Use --build-id when available.
860LDFLAGS_BUILD_ID := $(patsubst -Wl$(comma)%,%,\ 864LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
861 $(call cc-ldoption, -Wl$(comma)--build-id,))
862KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 865KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
863LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 866LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
864 867
diff --git a/arch/alpha/include/asm/cmpxchg.h b/arch/alpha/include/asm/cmpxchg.h
index 46ebf14aed4e..8a2b331e43fe 100644
--- a/arch/alpha/include/asm/cmpxchg.h
+++ b/arch/alpha/include/asm/cmpxchg.h
@@ -6,7 +6,6 @@
6 * Atomic exchange routines. 6 * Atomic exchange routines.
7 */ 7 */
8 8
9#define __ASM__MB
10#define ____xchg(type, args...) __xchg ## type ## _local(args) 9#define ____xchg(type, args...) __xchg ## type ## _local(args)
11#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args) 10#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
12#include <asm/xchg.h> 11#include <asm/xchg.h>
@@ -33,10 +32,6 @@
33 cmpxchg_local((ptr), (o), (n)); \ 32 cmpxchg_local((ptr), (o), (n)); \
34}) 33})
35 34
36#ifdef CONFIG_SMP
37#undef __ASM__MB
38#define __ASM__MB "\tmb\n"
39#endif
40#undef ____xchg 35#undef ____xchg
41#undef ____cmpxchg 36#undef ____cmpxchg
42#define ____xchg(type, args...) __xchg ##type(args) 37#define ____xchg(type, args...) __xchg ##type(args)
@@ -64,7 +59,6 @@
64 cmpxchg((ptr), (o), (n)); \ 59 cmpxchg((ptr), (o), (n)); \
65}) 60})
66 61
67#undef __ASM__MB
68#undef ____cmpxchg 62#undef ____cmpxchg
69 63
70#endif /* _ALPHA_CMPXCHG_H */ 64#endif /* _ALPHA_CMPXCHG_H */
diff --git a/arch/alpha/include/asm/xchg.h b/arch/alpha/include/asm/xchg.h
index 68dfb3cb7145..e2b59fac5257 100644
--- a/arch/alpha/include/asm/xchg.h
+++ b/arch/alpha/include/asm/xchg.h
@@ -12,6 +12,10 @@
12 * Atomic exchange. 12 * Atomic exchange.
13 * Since it can be used to implement critical sections 13 * Since it can be used to implement critical sections
14 * it must clobber "memory" (also for interrupts in UP). 14 * it must clobber "memory" (also for interrupts in UP).
15 *
16 * The leading and the trailing memory barriers guarantee that these
17 * operations are fully ordered.
18 *
15 */ 19 */
16 20
17static inline unsigned long 21static inline unsigned long
@@ -19,6 +23,7 @@ ____xchg(_u8, volatile char *m, unsigned long val)
19{ 23{
20 unsigned long ret, tmp, addr64; 24 unsigned long ret, tmp, addr64;
21 25
26 smp_mb();
22 __asm__ __volatile__( 27 __asm__ __volatile__(
23 " andnot %4,7,%3\n" 28 " andnot %4,7,%3\n"
24 " insbl %1,%4,%1\n" 29 " insbl %1,%4,%1\n"
@@ -28,12 +33,12 @@ ____xchg(_u8, volatile char *m, unsigned long val)
28 " or %1,%2,%2\n" 33 " or %1,%2,%2\n"
29 " stq_c %2,0(%3)\n" 34 " stq_c %2,0(%3)\n"
30 " beq %2,2f\n" 35 " beq %2,2f\n"
31 __ASM__MB
32 ".subsection 2\n" 36 ".subsection 2\n"
33 "2: br 1b\n" 37 "2: br 1b\n"
34 ".previous" 38 ".previous"
35 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64) 39 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
36 : "r" ((long)m), "1" (val) : "memory"); 40 : "r" ((long)m), "1" (val) : "memory");
41 smp_mb();
37 42
38 return ret; 43 return ret;
39} 44}
@@ -43,6 +48,7 @@ ____xchg(_u16, volatile short *m, unsigned long val)
43{ 48{
44 unsigned long ret, tmp, addr64; 49 unsigned long ret, tmp, addr64;
45 50
51 smp_mb();
46 __asm__ __volatile__( 52 __asm__ __volatile__(
47 " andnot %4,7,%3\n" 53 " andnot %4,7,%3\n"
48 " inswl %1,%4,%1\n" 54 " inswl %1,%4,%1\n"
@@ -52,12 +58,12 @@ ____xchg(_u16, volatile short *m, unsigned long val)
52 " or %1,%2,%2\n" 58 " or %1,%2,%2\n"
53 " stq_c %2,0(%3)\n" 59 " stq_c %2,0(%3)\n"
54 " beq %2,2f\n" 60 " beq %2,2f\n"
55 __ASM__MB
56 ".subsection 2\n" 61 ".subsection 2\n"
57 "2: br 1b\n" 62 "2: br 1b\n"
58 ".previous" 63 ".previous"
59 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64) 64 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
60 : "r" ((long)m), "1" (val) : "memory"); 65 : "r" ((long)m), "1" (val) : "memory");
66 smp_mb();
61 67
62 return ret; 68 return ret;
63} 69}
@@ -67,17 +73,18 @@ ____xchg(_u32, volatile int *m, unsigned long val)
67{ 73{
68 unsigned long dummy; 74 unsigned long dummy;
69 75
76 smp_mb();
70 __asm__ __volatile__( 77 __asm__ __volatile__(
71 "1: ldl_l %0,%4\n" 78 "1: ldl_l %0,%4\n"
72 " bis $31,%3,%1\n" 79 " bis $31,%3,%1\n"
73 " stl_c %1,%2\n" 80 " stl_c %1,%2\n"
74 " beq %1,2f\n" 81 " beq %1,2f\n"
75 __ASM__MB
76 ".subsection 2\n" 82 ".subsection 2\n"
77 "2: br 1b\n" 83 "2: br 1b\n"
78 ".previous" 84 ".previous"
79 : "=&r" (val), "=&r" (dummy), "=m" (*m) 85 : "=&r" (val), "=&r" (dummy), "=m" (*m)
80 : "rI" (val), "m" (*m) : "memory"); 86 : "rI" (val), "m" (*m) : "memory");
87 smp_mb();
81 88
82 return val; 89 return val;
83} 90}
@@ -87,17 +94,18 @@ ____xchg(_u64, volatile long *m, unsigned long val)
87{ 94{
88 unsigned long dummy; 95 unsigned long dummy;
89 96
97 smp_mb();
90 __asm__ __volatile__( 98 __asm__ __volatile__(
91 "1: ldq_l %0,%4\n" 99 "1: ldq_l %0,%4\n"
92 " bis $31,%3,%1\n" 100 " bis $31,%3,%1\n"
93 " stq_c %1,%2\n" 101 " stq_c %1,%2\n"
94 " beq %1,2f\n" 102 " beq %1,2f\n"
95 __ASM__MB
96 ".subsection 2\n" 103 ".subsection 2\n"
97 "2: br 1b\n" 104 "2: br 1b\n"
98 ".previous" 105 ".previous"
99 : "=&r" (val), "=&r" (dummy), "=m" (*m) 106 : "=&r" (val), "=&r" (dummy), "=m" (*m)
100 : "rI" (val), "m" (*m) : "memory"); 107 : "rI" (val), "m" (*m) : "memory");
108 smp_mb();
101 109
102 return val; 110 return val;
103} 111}
@@ -128,10 +136,12 @@ ____xchg(, volatile void *ptr, unsigned long x, int size)
128 * store NEW in MEM. Return the initial value in MEM. Success is 136 * store NEW in MEM. Return the initial value in MEM. Success is
129 * indicated by comparing RETURN with OLD. 137 * indicated by comparing RETURN with OLD.
130 * 138 *
131 * The memory barrier should be placed in SMP only when we actually 139 * The leading and the trailing memory barriers guarantee that these
132 * make the change. If we don't change anything (so if the returned 140 * operations are fully ordered.
133 * prev is equal to old) then we aren't acquiring anything new and 141 *
134 * we don't need any memory barrier as far I can tell. 142 * The trailing memory barrier is placed in SMP unconditionally, in
143 * order to guarantee that dependency ordering is preserved when a
144 * dependency is headed by an unsuccessful operation.
135 */ 145 */
136 146
137static inline unsigned long 147static inline unsigned long
@@ -139,6 +149,7 @@ ____cmpxchg(_u8, volatile char *m, unsigned char old, unsigned char new)
139{ 149{
140 unsigned long prev, tmp, cmp, addr64; 150 unsigned long prev, tmp, cmp, addr64;
141 151
152 smp_mb();
142 __asm__ __volatile__( 153 __asm__ __volatile__(
143 " andnot %5,7,%4\n" 154 " andnot %5,7,%4\n"
144 " insbl %1,%5,%1\n" 155 " insbl %1,%5,%1\n"
@@ -150,13 +161,13 @@ ____cmpxchg(_u8, volatile char *m, unsigned char old, unsigned char new)
150 " or %1,%2,%2\n" 161 " or %1,%2,%2\n"
151 " stq_c %2,0(%4)\n" 162 " stq_c %2,0(%4)\n"
152 " beq %2,3f\n" 163 " beq %2,3f\n"
153 __ASM__MB
154 "2:\n" 164 "2:\n"
155 ".subsection 2\n" 165 ".subsection 2\n"
156 "3: br 1b\n" 166 "3: br 1b\n"
157 ".previous" 167 ".previous"
158 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64) 168 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
159 : "r" ((long)m), "Ir" (old), "1" (new) : "memory"); 169 : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
170 smp_mb();
160 171
161 return prev; 172 return prev;
162} 173}
@@ -166,6 +177,7 @@ ____cmpxchg(_u16, volatile short *m, unsigned short old, unsigned short new)
166{ 177{
167 unsigned long prev, tmp, cmp, addr64; 178 unsigned long prev, tmp, cmp, addr64;
168 179
180 smp_mb();
169 __asm__ __volatile__( 181 __asm__ __volatile__(
170 " andnot %5,7,%4\n" 182 " andnot %5,7,%4\n"
171 " inswl %1,%5,%1\n" 183 " inswl %1,%5,%1\n"
@@ -177,13 +189,13 @@ ____cmpxchg(_u16, volatile short *m, unsigned short old, unsigned short new)
177 " or %1,%2,%2\n" 189 " or %1,%2,%2\n"
178 " stq_c %2,0(%4)\n" 190 " stq_c %2,0(%4)\n"
179 " beq %2,3f\n" 191 " beq %2,3f\n"
180 __ASM__MB
181 "2:\n" 192 "2:\n"
182 ".subsection 2\n" 193 ".subsection 2\n"
183 "3: br 1b\n" 194 "3: br 1b\n"
184 ".previous" 195 ".previous"
185 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64) 196 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
186 : "r" ((long)m), "Ir" (old), "1" (new) : "memory"); 197 : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
198 smp_mb();
187 199
188 return prev; 200 return prev;
189} 201}
@@ -193,6 +205,7 @@ ____cmpxchg(_u32, volatile int *m, int old, int new)
193{ 205{
194 unsigned long prev, cmp; 206 unsigned long prev, cmp;
195 207
208 smp_mb();
196 __asm__ __volatile__( 209 __asm__ __volatile__(
197 "1: ldl_l %0,%5\n" 210 "1: ldl_l %0,%5\n"
198 " cmpeq %0,%3,%1\n" 211 " cmpeq %0,%3,%1\n"
@@ -200,13 +213,13 @@ ____cmpxchg(_u32, volatile int *m, int old, int new)
200 " mov %4,%1\n" 213 " mov %4,%1\n"
201 " stl_c %1,%2\n" 214 " stl_c %1,%2\n"
202 " beq %1,3f\n" 215 " beq %1,3f\n"
203 __ASM__MB
204 "2:\n" 216 "2:\n"
205 ".subsection 2\n" 217 ".subsection 2\n"
206 "3: br 1b\n" 218 "3: br 1b\n"
207 ".previous" 219 ".previous"
208 : "=&r"(prev), "=&r"(cmp), "=m"(*m) 220 : "=&r"(prev), "=&r"(cmp), "=m"(*m)
209 : "r"((long) old), "r"(new), "m"(*m) : "memory"); 221 : "r"((long) old), "r"(new), "m"(*m) : "memory");
222 smp_mb();
210 223
211 return prev; 224 return prev;
212} 225}
@@ -216,6 +229,7 @@ ____cmpxchg(_u64, volatile long *m, unsigned long old, unsigned long new)
216{ 229{
217 unsigned long prev, cmp; 230 unsigned long prev, cmp;
218 231
232 smp_mb();
219 __asm__ __volatile__( 233 __asm__ __volatile__(
220 "1: ldq_l %0,%5\n" 234 "1: ldq_l %0,%5\n"
221 " cmpeq %0,%3,%1\n" 235 " cmpeq %0,%3,%1\n"
@@ -223,13 +237,13 @@ ____cmpxchg(_u64, volatile long *m, unsigned long old, unsigned long new)
223 " mov %4,%1\n" 237 " mov %4,%1\n"
224 " stq_c %1,%2\n" 238 " stq_c %1,%2\n"
225 " beq %1,3f\n" 239 " beq %1,3f\n"
226 __ASM__MB
227 "2:\n" 240 "2:\n"
228 ".subsection 2\n" 241 ".subsection 2\n"
229 "3: br 1b\n" 242 "3: br 1b\n"
230 ".previous" 243 ".previous"
231 : "=&r"(prev), "=&r"(cmp), "=m"(*m) 244 : "=&r"(prev), "=&r"(cmp), "=m"(*m)
232 : "r"((long) old), "r"(new), "m"(*m) : "memory"); 245 : "r"((long) old), "r"(new), "m"(*m) : "memory");
246 smp_mb();
233 247
234 return prev; 248 return prev;
235} 249}
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index f3a80cf164cc..d76bf4a83740 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -484,7 +484,6 @@ config ARC_CURR_IN_REG
484 484
485config ARC_EMUL_UNALIGNED 485config ARC_EMUL_UNALIGNED
486 bool "Emulate unaligned memory access (userspace only)" 486 bool "Emulate unaligned memory access (userspace only)"
487 default N
488 select SYSCTL_ARCH_UNALIGN_NO_WARN 487 select SYSCTL_ARCH_UNALIGN_NO_WARN
489 select SYSCTL_ARCH_UNALIGN_ALLOW 488 select SYSCTL_ARCH_UNALIGN_ALLOW
490 depends on ISA_ARCOMPACT 489 depends on ISA_ARCOMPACT
diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
index 70aec7d6ca60..626b694c7be7 100644
--- a/arch/arc/boot/dts/axs101.dts
+++ b/arch/arc/boot/dts/axs101.dts
@@ -17,6 +17,6 @@
17 compatible = "snps,axs101", "snps,arc-sdp"; 17 compatible = "snps,axs101", "snps,arc-sdp";
18 18
19 chosen { 19 chosen {
20 bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 console=tty0 console=ttyS3,115200n8 consoleblank=0 video=1280x720@60"; 20 bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 console=tty0 console=ttyS3,115200n8 consoleblank=0 video=1280x720@60 print-fatal-signals=1";
21 }; 21 };
22}; 22};
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 74d070cd3c13..47b74fbc403c 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -214,13 +214,13 @@
214 }; 214 };
215 215
216 eeprom@0x54{ 216 eeprom@0x54{
217 compatible = "24c01"; 217 compatible = "atmel,24c01";
218 reg = <0x54>; 218 reg = <0x54>;
219 pagesize = <0x8>; 219 pagesize = <0x8>;
220 }; 220 };
221 221
222 eeprom@0x57{ 222 eeprom@0x57{
223 compatible = "24c04"; 223 compatible = "atmel,24c04";
224 reg = <0x57>; 224 reg = <0x57>;
225 pagesize = <0x8>; 225 pagesize = <0x8>;
226 }; 226 };
diff --git a/arch/arc/boot/dts/haps_hs_idu.dts b/arch/arc/boot/dts/haps_hs_idu.dts
index 215cddd0b63b..0c603308aeb3 100644
--- a/arch/arc/boot/dts/haps_hs_idu.dts
+++ b/arch/arc/boot/dts/haps_hs_idu.dts
@@ -22,7 +22,7 @@
22 }; 22 };
23 23
24 chosen { 24 chosen {
25 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=ttyS0,115200n8 debug"; 25 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";
26 }; 26 };
27 27
28 aliases { 28 aliases {
diff --git a/arch/arc/boot/dts/nsim_700.dts b/arch/arc/boot/dts/nsim_700.dts
index 5ee96b067c08..ff2f2c70c545 100644
--- a/arch/arc/boot/dts/nsim_700.dts
+++ b/arch/arc/boot/dts/nsim_700.dts
@@ -17,7 +17,7 @@
17 interrupt-parent = <&core_intc>; 17 interrupt-parent = <&core_intc>;
18 18
19 chosen { 19 chosen {
20 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8"; 20 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8 print-fatal-signals=1";
21 }; 21 };
22 22
23 aliases { 23 aliases {
diff --git a/arch/arc/boot/dts/nsim_hs.dts b/arch/arc/boot/dts/nsim_hs.dts
index 8d787b251f73..8e2489b16b0a 100644
--- a/arch/arc/boot/dts/nsim_hs.dts
+++ b/arch/arc/boot/dts/nsim_hs.dts
@@ -24,7 +24,7 @@
24 }; 24 };
25 25
26 chosen { 26 chosen {
27 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8"; 27 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8 print-fatal-signals=1";
28 }; 28 };
29 29
30 aliases { 30 aliases {
diff --git a/arch/arc/boot/dts/nsim_hs_idu.dts b/arch/arc/boot/dts/nsim_hs_idu.dts
index 4f98ebf71fd8..ed12f494721d 100644
--- a/arch/arc/boot/dts/nsim_hs_idu.dts
+++ b/arch/arc/boot/dts/nsim_hs_idu.dts
@@ -15,7 +15,7 @@
15 interrupt-parent = <&core_intc>; 15 interrupt-parent = <&core_intc>;
16 16
17 chosen { 17 chosen {
18 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8"; 18 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8 print-fatal-signals=1";
19 }; 19 };
20 20
21 aliases { 21 aliases {
diff --git a/arch/arc/boot/dts/nsimosci.dts b/arch/arc/boot/dts/nsimosci.dts
index 3c391ba565ed..7842e5eb4ab5 100644
--- a/arch/arc/boot/dts/nsimosci.dts
+++ b/arch/arc/boot/dts/nsimosci.dts
@@ -20,7 +20,7 @@
20 /* this is for console on PGU */ 20 /* this is for console on PGU */
21 /* bootargs = "console=tty0 consoleblank=0"; */ 21 /* bootargs = "console=tty0 consoleblank=0"; */
22 /* this is for console on serial */ 22 /* this is for console on serial */
23 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug video=640x480-24"; 23 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug video=640x480-24 print-fatal-signals=1";
24 }; 24 };
25 25
26 aliases { 26 aliases {
diff --git a/arch/arc/boot/dts/nsimosci_hs.dts b/arch/arc/boot/dts/nsimosci_hs.dts
index 14a727cbf4c9..b8838cf2b4ec 100644
--- a/arch/arc/boot/dts/nsimosci_hs.dts
+++ b/arch/arc/boot/dts/nsimosci_hs.dts
@@ -20,7 +20,7 @@
20 /* this is for console on PGU */ 20 /* this is for console on PGU */
21 /* bootargs = "console=tty0 consoleblank=0"; */ 21 /* bootargs = "console=tty0 consoleblank=0"; */
22 /* this is for console on serial */ 22 /* this is for console on serial */
23 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug video=640x480-24"; 23 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblank=0 debug video=640x480-24 print-fatal-signals=1";
24 }; 24 };
25 25
26 aliases { 26 aliases {
diff --git a/arch/arc/boot/dts/nsimosci_hs_idu.dts b/arch/arc/boot/dts/nsimosci_hs_idu.dts
index 5052917d4a99..72a2c723f1f7 100644
--- a/arch/arc/boot/dts/nsimosci_hs_idu.dts
+++ b/arch/arc/boot/dts/nsimosci_hs_idu.dts
@@ -18,7 +18,7 @@
18 18
19 chosen { 19 chosen {
20 /* this is for console on serial */ 20 /* this is for console on serial */
21 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblan=0 debug video=640x480-24"; 21 bootargs = "earlycon=uart8250,mmio32,0xf0000000,115200n8 console=tty0 console=ttyS0,115200n8 consoleblan=0 debug video=640x480-24 print-fatal-signals=1";
22 }; 22 };
23 23
24 aliases { 24 aliases {
diff --git a/arch/arc/include/asm/bug.h b/arch/arc/include/asm/bug.h
index ea022d47896c..21ec82466d62 100644
--- a/arch/arc/include/asm/bug.h
+++ b/arch/arc/include/asm/bug.h
@@ -23,7 +23,8 @@ void die(const char *str, struct pt_regs *regs, unsigned long address);
23 23
24#define BUG() do { \ 24#define BUG() do { \
25 pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ 25 pr_warn("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
26 dump_stack(); \ 26 barrier_before_unreachable(); \
27 __builtin_trap(); \
27} while (0) 28} while (0)
28 29
29#define HAVE_ARCH_BUG 30#define HAVE_ARCH_BUG
diff --git a/arch/arc/include/asm/entry-arcv2.h b/arch/arc/include/asm/entry-arcv2.h
index 257a68f3c2fe..309f4e6721b3 100644
--- a/arch/arc/include/asm/entry-arcv2.h
+++ b/arch/arc/include/asm/entry-arcv2.h
@@ -184,7 +184,7 @@
184.macro FAKE_RET_FROM_EXCPN 184.macro FAKE_RET_FROM_EXCPN
185 lr r9, [status32] 185 lr r9, [status32]
186 bic r9, r9, (STATUS_U_MASK|STATUS_DE_MASK|STATUS_AE_MASK) 186 bic r9, r9, (STATUS_U_MASK|STATUS_DE_MASK|STATUS_AE_MASK)
187 or r9, r9, (STATUS_L_MASK|STATUS_IE_MASK) 187 or r9, r9, STATUS_IE_MASK
188 kflag r9 188 kflag r9
189.endm 189.endm
190 190
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
index f61a52b01625..5fe84e481654 100644
--- a/arch/arc/kernel/mcip.c
+++ b/arch/arc/kernel/mcip.c
@@ -22,10 +22,79 @@ static DEFINE_RAW_SPINLOCK(mcip_lock);
22 22
23static char smp_cpuinfo_buf[128]; 23static char smp_cpuinfo_buf[128];
24 24
25/*
26 * Set mask to halt GFRC if any online core in SMP cluster is halted.
27 * Only works for ARC HS v3.0+, on earlier versions has no effect.
28 */
29static void mcip_update_gfrc_halt_mask(int cpu)
30{
31 struct bcr_generic gfrc;
32 unsigned long flags;
33 u32 gfrc_halt_mask;
34
35 READ_BCR(ARC_REG_GFRC_BUILD, gfrc);
36
37 /*
38 * CMD_GFRC_SET_CORE and CMD_GFRC_READ_CORE commands were added in
39 * GFRC 0x3 version.
40 */
41 if (gfrc.ver < 0x3)
42 return;
43
44 raw_spin_lock_irqsave(&mcip_lock, flags);
45
46 __mcip_cmd(CMD_GFRC_READ_CORE, 0);
47 gfrc_halt_mask = read_aux_reg(ARC_REG_MCIP_READBACK);
48 gfrc_halt_mask |= BIT(cpu);
49 __mcip_cmd_data(CMD_GFRC_SET_CORE, 0, gfrc_halt_mask);
50
51 raw_spin_unlock_irqrestore(&mcip_lock, flags);
52}
53
54static void mcip_update_debug_halt_mask(int cpu)
55{
56 u32 mcip_mask = 0;
57 unsigned long flags;
58
59 raw_spin_lock_irqsave(&mcip_lock, flags);
60
61 /*
62 * mcip_mask is same for CMD_DEBUG_SET_SELECT and CMD_DEBUG_SET_MASK
63 * commands. So read it once instead of reading both CMD_DEBUG_READ_MASK
64 * and CMD_DEBUG_READ_SELECT.
65 */
66 __mcip_cmd(CMD_DEBUG_READ_SELECT, 0);
67 mcip_mask = read_aux_reg(ARC_REG_MCIP_READBACK);
68
69 mcip_mask |= BIT(cpu);
70
71 __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, mcip_mask);
72 /*
73 * Parameter specified halt cause:
74 * STATUS32[H]/actionpoint/breakpoint/self-halt
75 * We choose all of them (0xF).
76 */
77 __mcip_cmd_data(CMD_DEBUG_SET_MASK, 0xF, mcip_mask);
78
79 raw_spin_unlock_irqrestore(&mcip_lock, flags);
80}
81
25static void mcip_setup_per_cpu(int cpu) 82static void mcip_setup_per_cpu(int cpu)
26{ 83{
84 struct mcip_bcr mp;
85
86 READ_BCR(ARC_REG_MCIP_BCR, mp);
87
27 smp_ipi_irq_setup(cpu, IPI_IRQ); 88 smp_ipi_irq_setup(cpu, IPI_IRQ);
28 smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ); 89 smp_ipi_irq_setup(cpu, SOFTIRQ_IRQ);
90
91 /* Update GFRC halt mask as new CPU came online */
92 if (mp.gfrc)
93 mcip_update_gfrc_halt_mask(cpu);
94
95 /* Update MCIP debug mask as new CPU came online */
96 if (mp.dbg)
97 mcip_update_debug_halt_mask(cpu);
29} 98}
30 99
31static void mcip_ipi_send(int cpu) 100static void mcip_ipi_send(int cpu)
@@ -101,11 +170,6 @@ static void mcip_probe_n_setup(void)
101 IS_AVAIL1(mp.gfrc, "GFRC")); 170 IS_AVAIL1(mp.gfrc, "GFRC"));
102 171
103 cpuinfo_arc700[0].extn.gfrc = mp.gfrc; 172 cpuinfo_arc700[0].extn.gfrc = mp.gfrc;
104
105 if (mp.dbg) {
106 __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, 0xf);
107 __mcip_cmd_data(CMD_DEBUG_SET_MASK, 0xf, 0xf);
108 }
109} 173}
110 174
111struct plat_smp_ops plat_smp_ops = { 175struct plat_smp_ops plat_smp_ops = {
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 9d27331fe69a..b2cae79a25d7 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -51,7 +51,7 @@ static const struct id_to_str arc_cpu_rel[] = {
51 { 0x51, "R2.0" }, 51 { 0x51, "R2.0" },
52 { 0x52, "R2.1" }, 52 { 0x52, "R2.1" },
53 { 0x53, "R3.0" }, 53 { 0x53, "R3.0" },
54 { 0x54, "R4.0" }, 54 { 0x54, "R3.10a" },
55#endif 55#endif
56 { 0x00, NULL } 56 { 0x00, NULL }
57}; 57};
@@ -373,7 +373,7 @@ static void arc_chk_core_config(void)
373{ 373{
374 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()]; 374 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
375 int saved = 0, present = 0; 375 int saved = 0, present = 0;
376 char *opt_nm = NULL;; 376 char *opt_nm = NULL;
377 377
378 if (!cpu->extn.timer0) 378 if (!cpu->extn.timer0)
379 panic("Timer0 is not present!\n"); 379 panic("Timer0 is not present!\n");
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index efe8b4200a67..21d86c36692b 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -24,6 +24,7 @@
24#include <linux/reboot.h> 24#include <linux/reboot.h>
25#include <linux/irqdomain.h> 25#include <linux/irqdomain.h>
26#include <linux/export.h> 26#include <linux/export.h>
27#include <linux/of_fdt.h>
27 28
28#include <asm/processor.h> 29#include <asm/processor.h>
29#include <asm/setup.h> 30#include <asm/setup.h>
@@ -47,6 +48,42 @@ void __init smp_prepare_boot_cpu(void)
47{ 48{
48} 49}
49 50
51static int __init arc_get_cpu_map(const char *name, struct cpumask *cpumask)
52{
53 unsigned long dt_root = of_get_flat_dt_root();
54 const char *buf;
55
56 buf = of_get_flat_dt_prop(dt_root, name, NULL);
57 if (!buf)
58 return -EINVAL;
59
60 if (cpulist_parse(buf, cpumask))
61 return -EINVAL;
62
63 return 0;
64}
65
66/*
67 * Read from DeviceTree and setup cpu possible mask. If there is no
68 * "possible-cpus" property in DeviceTree pretend all [0..NR_CPUS-1] exist.
69 */
70static void __init arc_init_cpu_possible(void)
71{
72 struct cpumask cpumask;
73
74 if (arc_get_cpu_map("possible-cpus", &cpumask)) {
75 pr_warn("Failed to get possible-cpus from dtb, pretending all %u cpus exist\n",
76 NR_CPUS);
77
78 cpumask_setall(&cpumask);
79 }
80
81 if (!cpumask_test_cpu(0, &cpumask))
82 panic("Master cpu (cpu[0]) is missed in cpu possible mask!");
83
84 init_cpu_possible(&cpumask);
85}
86
50/* 87/*
51 * Called from setup_arch() before calling setup_processor() 88 * Called from setup_arch() before calling setup_processor()
52 * 89 *
@@ -58,10 +95,7 @@ void __init smp_prepare_boot_cpu(void)
58 */ 95 */
59void __init smp_init_cpus(void) 96void __init smp_init_cpus(void)
60{ 97{
61 unsigned int i; 98 arc_init_cpu_possible();
62
63 for (i = 0; i < NR_CPUS; i++)
64 set_cpu_possible(i, true);
65 99
66 if (plat_smp_ops.init_early_smp) 100 if (plat_smp_ops.init_early_smp)
67 plat_smp_ops.init_early_smp(); 101 plat_smp_ops.init_early_smp();
@@ -70,16 +104,12 @@ void __init smp_init_cpus(void)
70/* called from init ( ) => process 1 */ 104/* called from init ( ) => process 1 */
71void __init smp_prepare_cpus(unsigned int max_cpus) 105void __init smp_prepare_cpus(unsigned int max_cpus)
72{ 106{
73 int i;
74
75 /* 107 /*
76 * if platform didn't set the present map already, do it now 108 * if platform didn't set the present map already, do it now
77 * boot cpu is set to present already by init/main.c 109 * boot cpu is set to present already by init/main.c
78 */ 110 */
79 if (num_present_cpus() <= 1) { 111 if (num_present_cpus() <= 1)
80 for (i = 0; i < max_cpus; i++) 112 init_cpu_present(cpu_possible_mask);
81 set_cpu_present(i, true);
82 }
83} 113}
84 114
85void __init smp_cpus_done(unsigned int max_cpus) 115void __init smp_cpus_done(unsigned int max_cpus)
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index 333daab7def0..183391d4d33a 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -366,7 +366,7 @@ static void init_unwind_hdr(struct unwind_table *table,
366 return; 366 return;
367 367
368ret_err: 368ret_err:
369 panic("Attention !!! Dwarf FDE parsing errors\n");; 369 panic("Attention !!! Dwarf FDE parsing errors\n");
370} 370}
371 371
372#ifdef CONFIG_MODULES 372#ifdef CONFIG_MODULES
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index eee924dfffa6..2072f3451e9c 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -780,7 +780,10 @@ noinline static void slc_entire_op(const int op)
780 780
781 write_aux_reg(r, ctrl); 781 write_aux_reg(r, ctrl);
782 782
783 write_aux_reg(ARC_REG_SLC_INVALIDATE, 1); 783 if (op & OP_INV) /* Inv or flush-n-inv use same cmd reg */
784 write_aux_reg(ARC_REG_SLC_INVALIDATE, 0x1);
785 else
786 write_aux_reg(ARC_REG_SLC_FLUSH, 0x1);
784 787
785 /* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */ 788 /* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */
786 read_aux_reg(r); 789 read_aux_reg(r);
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index ade7a38543dc..8164c1294226 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -163,7 +163,10 @@ dtb-$(CONFIG_ARCH_EXYNOS4) += \
163 exynos4210-smdkv310.dtb \ 163 exynos4210-smdkv310.dtb \
164 exynos4210-trats.dtb \ 164 exynos4210-trats.dtb \
165 exynos4210-universal_c210.dtb \ 165 exynos4210-universal_c210.dtb \
166 exynos4412-i9300.dtb \
167 exynos4412-i9305.dtb \
166 exynos4412-itop-elite.dtb \ 168 exynos4412-itop-elite.dtb \
169 exynos4412-n710x.dtb \
167 exynos4412-odroidu3.dtb \ 170 exynos4412-odroidu3.dtb \
168 exynos4412-odroidx.dtb \ 171 exynos4412-odroidx.dtb \
169 exynos4412-odroidx2.dtb \ 172 exynos4412-odroidx2.dtb \
@@ -304,6 +307,8 @@ dtb-$(CONFIG_ARCH_LPC18XX) += \
304dtb-$(CONFIG_ARCH_LPC32XX) += \ 307dtb-$(CONFIG_ARCH_LPC32XX) += \
305 lpc3250-ea3250.dtb \ 308 lpc3250-ea3250.dtb \
306 lpc3250-phy3250.dtb 309 lpc3250-phy3250.dtb
310dtb-$(CONFIG_ARCH_NPCM750) += \
311 nuvoton-npcm750-evb.dtb
307dtb-$(CONFIG_MACH_MESON6) += \ 312dtb-$(CONFIG_MACH_MESON6) += \
308 meson6-atv1200.dtb 313 meson6-atv1200.dtb
309dtb-$(CONFIG_MACH_MESON8) += \ 314dtb-$(CONFIG_MACH_MESON8) += \
@@ -396,6 +401,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
396 imx6dl-icore-rqs.dtb \ 401 imx6dl-icore-rqs.dtb \
397 imx6dl-nit6xlite.dtb \ 402 imx6dl-nit6xlite.dtb \
398 imx6dl-nitrogen6x.dtb \ 403 imx6dl-nitrogen6x.dtb \
404 imx6dl-phytec-mira-rdk-nand.dtb \
399 imx6dl-phytec-pbab01.dtb \ 405 imx6dl-phytec-pbab01.dtb \
400 imx6dl-rex-basic.dtb \ 406 imx6dl-rex-basic.dtb \
401 imx6dl-riotboard.dtb \ 407 imx6dl-riotboard.dtb \
@@ -435,6 +441,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
435 imx6q-dfi-fs700-m60.dtb \ 441 imx6q-dfi-fs700-m60.dtb \
436 imx6q-display5-tianma-tm070-1280x768.dtb \ 442 imx6q-display5-tianma-tm070-1280x768.dtb \
437 imx6q-dmo-edmqmx6.dtb \ 443 imx6q-dmo-edmqmx6.dtb \
444 imx6q-dms-ba16.dtb \
438 imx6q-evi.dtb \ 445 imx6q-evi.dtb \
439 imx6q-gk802.dtb \ 446 imx6q-gk802.dtb \
440 imx6q-gw51xx.dtb \ 447 imx6q-gw51xx.dtb \
@@ -465,6 +472,8 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
465 imx6q-nitrogen6_max.dtb \ 472 imx6q-nitrogen6_max.dtb \
466 imx6q-nitrogen6_som2.dtb \ 473 imx6q-nitrogen6_som2.dtb \
467 imx6q-novena.dtb \ 474 imx6q-novena.dtb \
475 imx6q-phytec-mira-rdk-emmc.dtb \
476 imx6q-phytec-mira-rdk-nand.dtb \
468 imx6q-phytec-pbab01.dtb \ 477 imx6q-phytec-pbab01.dtb \
469 imx6q-pistachio.dtb \ 478 imx6q-pistachio.dtb \
470 imx6q-rex-pro.dtb \ 479 imx6q-rex-pro.dtb \
@@ -494,6 +503,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
494 imx6q-zii-rdu2.dtb \ 503 imx6q-zii-rdu2.dtb \
495 imx6qp-nitrogen6_max.dtb \ 504 imx6qp-nitrogen6_max.dtb \
496 imx6qp-nitrogen6_som2.dtb \ 505 imx6qp-nitrogen6_som2.dtb \
506 imx6qp-phytec-mira-rdk-nand.dtb \
497 imx6qp-sabreauto.dtb \ 507 imx6qp-sabreauto.dtb \
498 imx6qp-sabresd.dtb \ 508 imx6qp-sabresd.dtb \
499 imx6qp-tx6qp-8037.dtb \ 509 imx6qp-tx6qp-8037.dtb \
@@ -526,7 +536,9 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
526 imx6ul-tx6ul-0010.dtb \ 536 imx6ul-tx6ul-0010.dtb \
527 imx6ul-tx6ul-0011.dtb \ 537 imx6ul-tx6ul-0011.dtb \
528 imx6ul-tx6ul-mainboard.dtb \ 538 imx6ul-tx6ul-mainboard.dtb \
529 imx6ull-14x14-evk.dtb 539 imx6ull-14x14-evk.dtb \
540 imx6ull-colibri-eval-v3.dtb \
541 imx6ull-colibri-wifi-eval-v3.dtb
530dtb-$(CONFIG_SOC_IMX7D) += \ 542dtb-$(CONFIG_SOC_IMX7D) += \
531 imx7d-cl-som-imx7.dtb \ 543 imx7d-cl-som-imx7.dtb \
532 imx7d-colibri-emmc-eval-v3.dtb \ 544 imx7d-colibri-emmc-eval-v3.dtb \
@@ -673,6 +685,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
673 am335x-lxm.dtb \ 685 am335x-lxm.dtb \
674 am335x-moxa-uc-8100-me-t.dtb \ 686 am335x-moxa-uc-8100-me-t.dtb \
675 am335x-nano.dtb \ 687 am335x-nano.dtb \
688 am335x-pdu001.dtb \
676 am335x-pepper.dtb \ 689 am335x-pepper.dtb \
677 am335x-phycore-rdk.dtb \ 690 am335x-phycore-rdk.dtb \
678 am335x-shc.dtb \ 691 am335x-shc.dtb \
@@ -752,6 +765,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
752 qcom-msm8960-cdp.dtb \ 765 qcom-msm8960-cdp.dtb \
753 qcom-msm8974-fairphone-fp2.dtb \ 766 qcom-msm8974-fairphone-fp2.dtb \
754 qcom-msm8974-lge-nexus5-hammerhead.dtb \ 767 qcom-msm8974-lge-nexus5-hammerhead.dtb \
768 qcom-msm8974-samsung-klte.dtb \
755 qcom-msm8974-sony-xperia-castor.dtb \ 769 qcom-msm8974-sony-xperia-castor.dtb \
756 qcom-msm8974-sony-xperia-honami.dtb \ 770 qcom-msm8974-sony-xperia-honami.dtb \
757 qcom-mdm9615-wp8548-mangoh-green.dtb 771 qcom-mdm9615-wp8548-mangoh-green.dtb
@@ -784,6 +798,7 @@ dtb-$(CONFIG_ARCH_RENESAS) += \
784 r8a7778-bockw.dtb \ 798 r8a7778-bockw.dtb \
785 r8a7779-marzen.dtb \ 799 r8a7779-marzen.dtb \
786 r8a7790-lager.dtb \ 800 r8a7790-lager.dtb \
801 r8a7790-stout.dtb \
787 r8a7791-koelsch.dtb \ 802 r8a7791-koelsch.dtb \
788 r8a7791-porter.dtb \ 803 r8a7791-porter.dtb \
789 r8a7792-blanche.dtb \ 804 r8a7792-blanche.dtb \
@@ -863,7 +878,7 @@ dtb-$(CONFIG_ARCH_STI) += \
863 stih410-b2120.dtb \ 878 stih410-b2120.dtb \
864 stih410-b2260.dtb \ 879 stih410-b2260.dtb \
865 stih418-b2199.dtb 880 stih418-b2199.dtb
866dtb-$(CONFIG_ARCH_STM32)+= \ 881dtb-$(CONFIG_ARCH_STM32) += \
867 stm32f429-disco.dtb \ 882 stm32f429-disco.dtb \
868 stm32f469-disco.dtb \ 883 stm32f469-disco.dtb \
869 stm32f746-disco.dtb \ 884 stm32f746-disco.dtb \
@@ -871,7 +886,9 @@ dtb-$(CONFIG_ARCH_STM32)+= \
871 stm32429i-eval.dtb \ 886 stm32429i-eval.dtb \
872 stm32746g-eval.dtb \ 887 stm32746g-eval.dtb \
873 stm32h743i-eval.dtb \ 888 stm32h743i-eval.dtb \
874 stm32h743i-disco.dtb 889 stm32h743i-disco.dtb \
890 stm32mp157c-ed1.dtb \
891 stm32mp157c-ev1.dtb
875dtb-$(CONFIG_MACH_SUN4I) += \ 892dtb-$(CONFIG_MACH_SUN4I) += \
876 sun4i-a10-a1000.dtb \ 893 sun4i-a10-a1000.dtb \
877 sun4i-a10-ba10-tvbox.dtb \ 894 sun4i-a10-ba10-tvbox.dtb \
@@ -942,6 +959,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \
942 sun7i-a20-m3.dtb \ 959 sun7i-a20-m3.dtb \
943 sun7i-a20-mk808c.dtb \ 960 sun7i-a20-mk808c.dtb \
944 sun7i-a20-olimex-som-evb.dtb \ 961 sun7i-a20-olimex-som-evb.dtb \
962 sun7i-a20-olimex-som204-evb.dtb \
963 sun7i-a20-olimex-som204-evb-emmc.dtb \
945 sun7i-a20-olinuxino-lime.dtb \ 964 sun7i-a20-olinuxino-lime.dtb \
946 sun7i-a20-olinuxino-lime2.dtb \ 965 sun7i-a20-olinuxino-lime2.dtb \
947 sun7i-a20-olinuxino-lime2-emmc.dtb \ 966 sun7i-a20-olinuxino-lime2-emmc.dtb \
@@ -974,6 +993,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
974 sun8i-a83t-cubietruck-plus.dtb \ 993 sun8i-a83t-cubietruck-plus.dtb \
975 sun8i-a83t-tbs-a711.dtb \ 994 sun8i-a83t-tbs-a711.dtb \
976 sun8i-h2-plus-orangepi-r1.dtb \ 995 sun8i-h2-plus-orangepi-r1.dtb \
996 sun8i-h2-plus-bananapi-m2-zero.dtb \
977 sun8i-h2-plus-orangepi-zero.dtb \ 997 sun8i-h2-plus-orangepi-zero.dtb \
978 sun8i-h3-bananapi-m2-plus.dtb \ 998 sun8i-h3-bananapi-m2-plus.dtb \
979 sun8i-h3-beelink-x2.dtb \ 999 sun8i-h3-beelink-x2.dtb \
@@ -1022,6 +1042,7 @@ dtb-$(CONFIG_ARCH_TEGRA_114_SOC) += \
1022 tegra114-tn7.dtb 1042 tegra114-tn7.dtb
1023dtb-$(CONFIG_ARCH_TEGRA_124_SOC) += \ 1043dtb-$(CONFIG_ARCH_TEGRA_124_SOC) += \
1024 tegra124-apalis-eval.dtb \ 1044 tegra124-apalis-eval.dtb \
1045 tegra124-apalis-v1.2-eval.dtb \
1025 tegra124-jetson-tk1.dtb \ 1046 tegra124-jetson-tk1.dtb \
1026 tegra124-nyan-big.dtb \ 1047 tegra124-nyan-big.dtb \
1027 tegra124-nyan-blaze.dtb \ 1048 tegra124-nyan-blaze.dtb \
@@ -1047,6 +1068,7 @@ dtb-$(CONFIG_ARCH_UNIPHIER) += \
1047 uniphier-sld8-ref.dtb 1068 uniphier-sld8-ref.dtb
1048dtb-$(CONFIG_ARCH_VERSATILE) += \ 1069dtb-$(CONFIG_ARCH_VERSATILE) += \
1049 versatile-ab.dtb \ 1070 versatile-ab.dtb \
1071 versatile-ab-ib2.dtb \
1050 versatile-pb.dtb 1072 versatile-pb.dtb
1051dtb-$(CONFIG_ARCH_VEXPRESS) += \ 1073dtb-$(CONFIG_ARCH_VEXPRESS) += \
1052 vexpress-v2p-ca5s.dtb \ 1074 vexpress-v2p-ca5s.dtb \
@@ -1062,12 +1084,18 @@ dtb-$(CONFIG_ARCH_VT8500) += \
1062 wm8750-apc8750.dtb \ 1084 wm8750-apc8750.dtb \
1063 wm8850-w70v2.dtb 1085 wm8850-w70v2.dtb
1064dtb-$(CONFIG_ARCH_ZYNQ) += \ 1086dtb-$(CONFIG_ARCH_ZYNQ) += \
1087 zynq-cc108.dtb \
1065 zynq-microzed.dtb \ 1088 zynq-microzed.dtb \
1066 zynq-parallella.dtb \ 1089 zynq-parallella.dtb \
1067 zynq-zc702.dtb \ 1090 zynq-zc702.dtb \
1068 zynq-zc706.dtb \ 1091 zynq-zc706.dtb \
1092 zynq-zc770-xm010.dtb \
1093 zynq-zc770-xm011.dtb \
1094 zynq-zc770-xm012.dtb \
1095 zynq-zc770-xm013.dtb \
1069 zynq-zed.dtb \ 1096 zynq-zed.dtb \
1070 zynq-zybo.dtb 1097 zynq-zybo.dtb \
1098 zynq-zybo-z7.dtb
1071dtb-$(CONFIG_MACH_ARMADA_370) += \ 1099dtb-$(CONFIG_MACH_ARMADA_370) += \
1072 armada-370-db.dtb \ 1100 armada-370-db.dtb \
1073 armada-370-dlink-dns327l.dtb \ 1101 armada-370-dlink-dns327l.dtb \
@@ -1129,6 +1157,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
1129dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb 1157dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
1130dtb-$(CONFIG_ARCH_ASPEED) += \ 1158dtb-$(CONFIG_ARCH_ASPEED) += \
1131 aspeed-ast2500-evb.dtb \ 1159 aspeed-ast2500-evb.dtb \
1160 aspeed-bmc-arm-centriq2400-rep.dtb \
1132 aspeed-bmc-opp-palmetto.dtb \ 1161 aspeed-bmc-opp-palmetto.dtb \
1133 aspeed-bmc-opp-romulus.dtb \ 1162 aspeed-bmc-opp-romulus.dtb \
1134 aspeed-bmc-opp-witherspoon.dtb \ 1163 aspeed-bmc-opp-witherspoon.dtb \
diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts
index 3f2480d05a3b..58baee158e64 100644
--- a/arch/arm/boot/dts/am335x-boneblue.dts
+++ b/arch/arm/boot/dts/am335x-boneblue.dts
@@ -342,7 +342,7 @@
342 }; 342 };
343 343
344 baseboard_eeprom: baseboard_eeprom@50 { 344 baseboard_eeprom: baseboard_eeprom@50 {
345 compatible = "at,24c256"; 345 compatible = "atmel,24c256";
346 reg = <0x50>; 346 reg = <0x50>;
347 347
348 #address-cells = <1>; 348 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/am335x-pdu001.dts b/arch/arm/boot/dts/am335x-pdu001.dts
new file mode 100644
index 000000000000..1ad530a39a95
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-pdu001.dts
@@ -0,0 +1,595 @@
1/*
2 * pdu001.dts
3 *
4 * EETS GmbH PDU001 board device tree file
5 *
6 * Copyright (C) 2018 EETS GmbH - http://www.eets.ch/
7 *
8 * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
9 *
10 * SPDX-License-Identifier: GPL-2.0+
11 */
12
13/dts-v1/;
14
15#include "am33xx.dtsi"
16#include <dt-bindings/interrupt-controller/irq.h>
17#include <dt-bindings/leds/leds-pca9532.h>
18
19/ {
20 model = "EETS,PDU001";
21 compatible = "ti,am33xx";
22
23 chosen {
24 stdout-path = &uart3;
25 };
26
27 cpus {
28 cpu@0 {
29 cpu0-supply = <&vdd1_reg>;
30 };
31 };
32
33 memory {
34 device_type = "memory";
35 reg = <0x80000000 0x10000000>; /* 256 MB */
36 };
37
38 vbat: fixedregulator@0 {
39 compatible = "regulator-fixed";
40 regulator-name = "vbat";
41 regulator-min-microvolt = <3600000>;
42 regulator-max-microvolt = <3600000>;
43 regulator-boot-on;
44 };
45
46 lis3_reg: fixedregulator@1 {
47 compatible = "regulator-fixed";
48 regulator-name = "lis3_reg";
49 regulator-boot-on;
50 };
51
52 panel {
53 compatible = "ti,tilcdc,panel";
54 status = "okay";
55 pinctrl-names = "default";
56 pinctrl-0 = <&lcd_pins_s0>;
57 panel-info {
58 ac-bias = <255>;
59 ac-bias-intrpt = <0>;
60 dma-burst-sz = <16>;
61 bpp = <16>;
62 fdd = <0x80>;
63 sync-edge = <0>;
64 sync-ctrl = <1>;
65 raster-order = <0>;
66 fifo-th = <0>;
67 };
68
69 display-timings {
70 240x320p16 {
71 clock-frequency = <6500000>;
72 hactive = <240>;
73 vactive = <320>;
74 hfront-porch = <6>;
75 hback-porch = <6>;
76 hsync-len = <1>;
77 vback-porch = <6>;
78 vfront-porch = <6>;
79 vsync-len = <1>;
80 hsync-active = <0>;
81 vsync-active = <0>;
82 pixelclk-active = <1>;
83 de-active = <0>;
84 };
85 };
86 };
87};
88
89&am33xx_pinmux {
90 pinctrl-names = "default";
91 pinctrl-0 = <&clkout2_pin>;
92
93 i2c0_pins: pinmux_i2c0_pins {
94 pinctrl-single,pins = <
95 AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
96 AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
97 >;
98 };
99
100 i2c1_pins: pinmux_i2c1_pins {
101 pinctrl-single,pins = <
102 AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
103 AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
104 >;
105 };
106
107 i2c2_pins: pinmux_i2c2_pins {
108 pinctrl-single,pins = <
109 AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_clk.i2c2_sda */
110 AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d0.i2c2_scl */
111 >;
112 };
113
114 spi1_pins: pinmux_spi1_pins {
115 pinctrl-single,pins = <
116 AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_sclk */
117 AM33XX_IOPAD(0x994, PIN_OUTPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */
118 AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */
119 AM33XX_IOPAD(0x99C, PIN_OUTPUT | MUX_MODE3) /* mcasp0_ahclkr.spi1_cs0 */
120 >;
121 };
122
123 uart0_pins: pinmux_uart0_pins {
124 pinctrl-single,pins = <
125 AM33XX_IOPAD(0x96C, PIN_OUTPUT | MUX_MODE7) /* uart0_rtsn.gpio1_9 */
126 AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
127 AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
128 >;
129 };
130
131 uart1_pins: pinmux_uart1_pins {
132 pinctrl-single,pins = <
133 AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
134 AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
135 >;
136 };
137
138 uart3_pins: pinmux_uart3_pins {
139 pinctrl-single,pins = <
140 AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_cs1.uart3_rxd */
141 AM33XX_IOPAD(0x964, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* ecap0_in_pwm0_out.uart3_txd */
142 >;
143 };
144
145 clkout2_pin: pinmux_clkout2_pin {
146 pinctrl-single,pins = <
147 AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
148 >;
149 };
150
151 cpsw_default: cpsw_default {
152 pinctrl-single,pins = <
153 /* Port 1 (emac0) */
154 AM33XX_IOPAD(0x908, PIN_INPUT | MUX_MODE0) /* mii1_col.mii1_col */
155 AM33XX_IOPAD(0x90C, PIN_INPUT | MUX_MODE0) /* mii1_crs.mii1_crs */
156 AM33XX_IOPAD(0x910, PIN_INPUT | MUX_MODE0) /* mii1_rxer.mii1_rxer */
157 AM33XX_IOPAD(0x914, PIN_OUTPUT | MUX_MODE0) /* mii1_txen.mii1_txen */
158 AM33XX_IOPAD(0x918, PIN_INPUT | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */
159 AM33XX_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE0) /* mii1_txd3.mii1_txd3 */
160 AM33XX_IOPAD(0x920, PIN_OUTPUT | MUX_MODE0) /* mii1_txd2.mii1_txd2 */
161 AM33XX_IOPAD(0x924, PIN_OUTPUT | MUX_MODE0) /* mii1_txd1.mii1_txd1 */
162 AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE0) /* mii1_txd0.mii1_txd0 */
163 AM33XX_IOPAD(0x92c, PIN_INPUT | MUX_MODE0) /* mii1_txclk.mii1_txclk */
164 AM33XX_IOPAD(0x930, PIN_INPUT | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */
165 AM33XX_IOPAD(0x934, PIN_INPUT | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */
166 AM33XX_IOPAD(0x938, PIN_INPUT | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */
167 AM33XX_IOPAD(0x93c, PIN_INPUT | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */
168 AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */
169
170 /* Port 2 (emac1) */
171 AM33XX_IOPAD(0x840, PIN_OUTPUT | MUX_MODE1) /* mii2_txen.gpmc_a0 */
172 AM33XX_IOPAD(0x844, PIN_INPUT | MUX_MODE1) /* mii2_rxdv.gpmc_a1 */
173 AM33XX_IOPAD(0x848, PIN_OUTPUT | MUX_MODE1) /* mii2_txd3.gpmc_a2 */
174 AM33XX_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE1) /* mii2_txd2.gpmc_a3 */
175 AM33XX_IOPAD(0x850, PIN_OUTPUT | MUX_MODE1) /* mii2_txd1.gpmc_a4 */
176 AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE1) /* mii2_txd0.gpmc_a5 */
177 AM33XX_IOPAD(0x858, PIN_INPUT | MUX_MODE1) /* mii2_txclk.gpmc_a6 */
178 AM33XX_IOPAD(0x85c, PIN_INPUT | MUX_MODE1) /* mii2_rxclk.gpmc_a7 */
179 AM33XX_IOPAD(0x860, PIN_INPUT | MUX_MODE1) /* mii2_rxd3.gpmc_a8 */
180 AM33XX_IOPAD(0x864, PIN_INPUT | MUX_MODE1) /* mii2_rxd2.gpmc_a9 */
181 AM33XX_IOPAD(0x868, PIN_INPUT | MUX_MODE1) /* mii2_rxd1.gpmc_a10 */
182 AM33XX_IOPAD(0x86C, PIN_INPUT | MUX_MODE1) /* mii2_rxd0.gpmc_a11 */
183 AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE1) /* mii2_crs.gpmc_wait0 */
184 AM33XX_IOPAD(0x874, PIN_INPUT | MUX_MODE1) /* mii2_rxer.gpmc_wpn */
185 AM33XX_IOPAD(0x878, PIN_INPUT | MUX_MODE1) /* mii2_col.gpmc_ben1 */
186 >;
187 };
188
189 davinci_mdio_default: davinci_mdio_default {
190 pinctrl-single,pins = <
191 AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
192 AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
193 >;
194 };
195
196 mmc1_pins: pinmux_mmc1_pins {
197 /* eMMC */
198 pinctrl-single,pins = <
199 AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3 */
200 AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2 */
201 AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1 */
202 AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0 */
203 AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk */
204 AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd */
205 >;
206 };
207
208 mmc2_pins: pinmux_mmc2_pins {
209 /* SD cardcage */
210 pinctrl-single,pins = <
211 AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
212 AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
213 AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
214 AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
215 AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
216 AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
217 /* card change signal for frontpanel SD cardcage */
218 AM33XX_IOPAD(0x890, PIN_INPUT | MUX_MODE7) /* gpmc_advn_ale.gpio2_2 */
219 >;
220 };
221
222 lcd_pins_s0: lcd_pins_s0 {
223 pinctrl-single,pins = <
224 AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 */
225 AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1.lcd_data1 */
226 AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2.lcd_data2 */
227 AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3.lcd_data3 */
228 AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4.lcd_data4 */
229 AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5.lcd_data5 */
230 AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6.lcd_data6 */
231 AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7.lcd_data7 */
232 AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8.lcd_data8 */
233 AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9.lcd_data9 */
234 AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10.lcd_data10 */
235 AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11.lcd_data11 */
236 AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12.lcd_data12 */
237 AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13.lcd_data13 */
238 AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14.lcd_data14 */
239 AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15.lcd_data15 */
240 AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0) /* lcd_vsync.lcd_vsync */
241 AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0) /* lcd_hsync.lcd_hsync */
242 AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0) /* lcd_pclk.lcd_pclk */
243 AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en.lcd_ac_bias_en */
244 >;
245 };
246
247 dcan0_pins: pinmux_dcan0_pins {
248 pinctrl-single,pins = <
249 AM33XX_IOPAD(0x978, PIN_OUTPUT | MUX_MODE2) /* uart1_ctsn.d_can0_tx */
250 AM33XX_IOPAD(0x97c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* uart1_rtsn.d_can0_rx */
251 >;
252 };
253};
254
255&uart0 {
256 pinctrl-names = "default";
257 pinctrl-0 = <&uart0_pins>;
258
259 rts-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
260 rs485-rts-active-high;
261 rs485-rts-delay = <0 0>;
262 linux,rs485-enabled-at-boot-time;
263
264 status = "okay";
265};
266
267&uart1 {
268 pinctrl-names = "default";
269 pinctrl-0 = <&uart1_pins>;
270
271 status = "okay";
272};
273
274&uart3 {
275 pinctrl-names = "default";
276 pinctrl-0 = <&uart3_pins>;
277
278 status = "okay";
279};
280
281&i2c0 {
282 pinctrl-names = "default";
283 pinctrl-0 = <&i2c0_pins>;
284
285 status = "okay";
286 clock-frequency = <400000>;
287
288 tps: tps@2d {
289 reg = <0x2d>;
290 };
291
292 m2_eeprom: m2_eeprom@50 {
293 compatible = "atmel,24c256";
294 reg = <0x50>;
295 status = "okay";
296 };
297};
298
299&i2c1 {
300 pinctrl-names = "default";
301 pinctrl-0 = <&i2c1_pins>;
302
303 status = "okay";
304 clock-frequency = <100000>;
305
306 board_24aa025e48: board_24aa025e48@50 {
307 compatible = "atmel,24c02";
308 reg = <0x50>;
309 };
310
311 backplane_24aa025e48: backplane_24aa025e48@53 {
312 compatible = "atmel,24c02";
313 reg = <0x53>;
314 };
315
316 pca9532: pca9532@60 {
317 compatible = "nxp,pca9532";
318 reg = <0x60>;
319 psc0 = <0x97>;
320 pwm0 = <0x80>;
321 psc1 = <0x97>;
322 pwm1 = <0x10>;
323
324 run.red@0 {
325 type = <PCA9532_TYPE_LED>;
326 };
327 run.green@1 {
328 type = <PCA9532_TYPE_LED>;
329 default-state = "on";
330 };
331 s2.red@2 {
332 type = <PCA9532_TYPE_LED>;
333 };
334 s2.green@3 {
335 type = <PCA9532_TYPE_LED>;
336 };
337 s1.yellow@4 {
338 type = <PCA9532_TYPE_LED>;
339 };
340 s1.green@5 {
341 type = <PCA9532_TYPE_LED>;
342 };
343 };
344
345 pca9530: pca9530@61 {
346 compatible = "nxp,pca9530";
347 reg = <0x61>;
348
349 tft-panel@0 {
350 type = <PCA9532_TYPE_LED>;
351 linux,default-trigger = "backlight";
352 default-state = "on";
353 };
354 };
355
356 mcp79400: mcp79400@6f {
357 compatible = "microchip,mcp7940x";
358 reg = <0x6f>;
359 };
360};
361
362&i2c2 {
363 pinctrl-names = "default";
364 pinctrl-0 = <&i2c2_pins>;
365
366 status = "okay";
367 clock-frequency = <100000>;
368};
369
370&spi1 {
371 pinctrl-names = "default";
372 pinctrl-0 = <&spi1_pins>;
373 ti,pindir-d0-out-d1-in;
374 status = "okay";
375
376 cfaf240320a032t {
377 compatible = "orisetech,otm3225a";
378 reg = <0>;
379 spi-max-frequency = <1000000>;
380 // SPI mode 3
381 spi-cpol;
382 spi-cpha;
383 status = "okay";
384 };
385};
386
387&usb {
388 status = "okay";
389};
390
391&usb_ctrl_mod {
392 status = "okay";
393};
394
395&usb0_phy {
396 status = "okay";
397};
398
399&usb1_phy {
400 status = "okay";
401};
402
403&usb0 {
404 status = "okay";
405};
406
407&usb1 {
408 status = "okay";
409};
410
411&cppi41dma {
412 status = "okay";
413};
414
415/*
416 * Disable soc's rtc as we have no VBAT for it. This makes the board
417 * rtc (Microchip MCP79400) the default rtc device 'rtc0'.
418 */
419&rtc {
420 status = "disabled";
421};
422
423&lcdc {
424 status = "okay";
425};
426
427&elm {
428 status = "okay";
429};
430
431#include "tps65910.dtsi"
432
433&tps {
434 vcc1-supply = <&vbat>;
435 vcc2-supply = <&vbat>;
436 vcc3-supply = <&vbat>;
437 vcc4-supply = <&vbat>;
438 vcc5-supply = <&vbat>;
439 vcc6-supply = <&vbat>;
440 vcc7-supply = <&vbat>;
441 vccio-supply = <&vbat>;
442
443 regulators {
444 vrtc_reg: regulator@0 {
445 regulator-name = "ldo_vrtc";
446 regulator-always-on;
447 };
448
449 vio_reg: regulator@1 {
450 regulator-name = "buck_vdd_ddr";
451 regulator-always-on;
452 };
453
454 vdd1_reg: regulator@2 {
455 /* VDD_MPU voltage limits */
456 regulator-name = "buck_vdd_mpu";
457 regulator-min-microvolt = <912500>;
458 regulator-max-microvolt = <1312500>;
459 regulator-boot-on;
460 regulator-always-on;
461 };
462
463 vdd2_reg: regulator@3 {
464 /* VDD_CORE voltage limits */
465 regulator-name = "buck_vdd_core";
466 regulator-min-microvolt = <912500>;
467 regulator-max-microvolt = <1150000>;
468 regulator-boot-on;
469 regulator-always-on;
470 };
471
472 vdd3_reg: regulator@4 {
473 regulator-name = "boost_res";
474 regulator-always-on;
475 };
476
477 vdig1_reg: regulator@5 {
478 regulator-name = "ldo_vdig1";
479 regulator-always-on;
480 };
481
482 vdig2_reg: regulator@6 {
483 regulator-name = "ldo_vdig2";
484 regulator-always-on;
485 };
486
487 vpll_reg: regulator@7 {
488 regulator-name = "ldo_vpll";
489 regulator-always-on;
490 };
491
492 vdac_reg: regulator@8 {
493 regulator-name = "ldo_vdac";
494 regulator-always-on;
495 };
496
497 vaux1_reg: regulator@9 {
498 regulator-name = "ldo_vaux1";
499 regulator-always-on;
500 };
501
502 vaux2_reg: regulator@10 {
503 regulator-name = "ldo_vaux2";
504 regulator-always-on;
505 };
506
507 vaux33_reg: regulator@11 {
508 regulator-name = "ldo_vaux33";
509 regulator-always-on;
510 };
511
512 vmmc_reg: regulator@12 {
513 regulator-name = "ldo_vmmc";
514 regulator-min-microvolt = <1800000>;
515 regulator-max-microvolt = <3300000>;
516 regulator-always-on;
517 };
518
519 vbb_reg: regulator@13 {
520 regulator-name = "bat_vbb";
521 };
522 };
523};
524
525&mac {
526 pinctrl-names = "default";
527 pinctrl-0 = <&cpsw_default>;
528 dual_emac; /* no switch, two distinct MACs */
529 status = "okay";
530};
531
532&davinci_mdio {
533 pinctrl-names = "default";
534 pinctrl-0 = <&davinci_mdio_default>;
535 status = "okay";
536};
537
538&cpsw_emac0 {
539 phy_id = <&davinci_mdio>, <0>;
540 phy-mode = "mii";
541 dual_emac_res_vlan = <1>;
542};
543
544&cpsw_emac1 {
545 phy_id = <&davinci_mdio>, <1>;
546 phy-mode = "mii";
547 dual_emac_res_vlan = <2>;
548};
549
550&tscadc {
551 status = "okay";
552 tsc {
553 ti,wires = <4>;
554 ti,x-plate-resistance = <200>;
555 ti,coordinate-readouts = <5>;
556 ti,wire-config = <0x01 0x10 0x22 0x33>;
557 ti,charge-delay = <0x400>;
558 };
559
560 adc {
561 ti,adc-channels = <4 5 6 7>;
562 };
563};
564
565&mmc1 {
566 status = "okay";
567 vmmc-supply = <&vmmc_reg>;
568 bus-width = <4>;
569 pinctrl-names = "default";
570 pinctrl-0 = <&mmc1_pins>;
571 non-removable;
572};
573
574&mmc2 {
575 status = "okay";
576 vmmc-supply = <&vmmc_reg>;
577 bus-width = <4>;
578 pinctrl-names = "default";
579 pinctrl-0 = <&mmc2_pins>;
580 cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
581};
582
583&sham {
584 status = "okay";
585};
586
587&aes {
588 status = "okay";
589};
590
591&dcan0 {
592 status = "okay";
593 pinctrl-names = "default";
594 pinctrl-0 = <&dcan0_pins>;
595};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 628c77b0b386..9cd62bc2ca35 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -147,6 +147,8 @@
147 mpu { 147 mpu {
148 compatible = "ti,omap3-mpu"; 148 compatible = "ti,omap3-mpu";
149 ti,hwmods = "mpu"; 149 ti,hwmods = "mpu";
150 pm-sram = <&pm_sram_code
151 &pm_sram_data>;
150 }; 152 };
151 }; 153 };
152 154
@@ -905,6 +907,21 @@
905 ocmcram: ocmcram@40300000 { 907 ocmcram: ocmcram@40300000 {
906 compatible = "mmio-sram"; 908 compatible = "mmio-sram";
907 reg = <0x40300000 0x10000>; /* 64k */ 909 reg = <0x40300000 0x10000>; /* 64k */
910 ranges = <0x0 0x40300000 0x10000>;
911 #address-cells = <1>;
912 #size-cells = <1>;
913
914 pm_sram_code: pm-sram-code@0 {
915 compatible = "ti,sram";
916 reg = <0x0 0x1000>;
917 protect-exec;
918 };
919
920 pm_sram_data: pm-sram-data@1000 {
921 compatible = "ti,sram";
922 reg = <0x1000 0x1000>;
923 pool;
924 };
908 }; 925 };
909 926
910 elm: elm@48080000 { 927 elm: elm@48080000 {
@@ -945,6 +962,10 @@
945 compatible = "ti,emif-am3352"; 962 compatible = "ti,emif-am3352";
946 reg = <0x4c000000 0x1000000>; 963 reg = <0x4c000000 0x1000000>;
947 ti,hwmods = "emif"; 964 ti,hwmods = "emif";
965 interrupts = <101>;
966 sram = <&pm_sram_code
967 &pm_sram_data>;
968 ti,no-idle;
948 }; 969 };
949 970
950 gpmc: gpmc@50000000 { 971 gpmc: gpmc@50000000 {
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 964f3ef79728..f0cbd86312dc 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -92,6 +92,16 @@
92 }; 92 };
93 }; 93 };
94 94
95 soc {
96 compatible = "ti,omap-infra";
97 mpu {
98 compatible = "ti,omap4-mpu";
99 ti,hwmods = "mpu";
100 pm-sram = <&pm_sram_code
101 &pm_sram_data>;
102 };
103 };
104
95 gic: interrupt-controller@48241000 { 105 gic: interrupt-controller@48241000 {
96 compatible = "arm,cortex-a9-gic"; 106 compatible = "arm,cortex-a9-gic";
97 interrupt-controller; 107 interrupt-controller;
@@ -143,6 +153,7 @@
143 #size-cells = <1>; 153 #size-cells = <1>;
144 ranges; 154 ranges;
145 ti,hwmods = "l3_main"; 155 ti,hwmods = "l3_main";
156 ti,no-idle;
146 reg = <0x44000000 0x400000 157 reg = <0x44000000 0x400000
147 0x44800000 0x400000>; 158 0x44800000 0x400000>;
148 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 159 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
@@ -237,6 +248,10 @@
237 compatible = "ti,emif-am4372"; 248 compatible = "ti,emif-am4372";
238 reg = <0x4c000000 0x1000000>; 249 reg = <0x4c000000 0x1000000>;
239 ti,hwmods = "emif"; 250 ti,hwmods = "emif";
251 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
252 ti,no-idle;
253 sram = <&pm_sram_code
254 &pm_sram_data>;
240 }; 255 };
241 256
242 edma: edma@49000000 { 257 edma: edma@49000000 {
@@ -1141,6 +1156,21 @@
1141 ocmcram: ocmcram@40300000 { 1156 ocmcram: ocmcram@40300000 {
1142 compatible = "mmio-sram"; 1157 compatible = "mmio-sram";
1143 reg = <0x40300000 0x40000>; /* 256k */ 1158 reg = <0x40300000 0x40000>; /* 256k */
1159 ranges = <0x0 0x40300000 0x40000>;
1160 #address-cells = <1>;
1161 #size-cells = <1>;
1162
1163 pm_sram_code: pm-sram-code@0 {
1164 compatible = "ti,sram";
1165 reg = <0x0 0x1000>;
1166 protect-exec;
1167 };
1168
1169 pm_sram_data: pm-sram-data@1000 {
1170 compatible = "ti,sram";
1171 reg = <0x1000 0x1000>;
1172 pool;
1173 };
1144 }; 1174 };
1145 1175
1146 dcan0: can@481cc000 { 1176 dcan0: can@481cc000 {
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index c3b1a3fb5a2e..8fe95cd7232a 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -805,7 +805,7 @@
805}; 805};
806 806
807&usb1 { 807&usb1 {
808 dr_mode = "peripheral"; 808 dr_mode = "otg";
809 status = "okay"; 809 status = "okay";
810}; 810};
811 811
diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts
index 3fa3b226995d..4118802b7fea 100644
--- a/arch/arm/boot/dts/am437x-sk-evm.dts
+++ b/arch/arm/boot/dts/am437x-sk-evm.dts
@@ -600,7 +600,7 @@
600}; 600};
601 601
602&usb1 { 602&usb1 {
603 dr_mode = "peripheral"; 603 dr_mode = "otg";
604 status = "okay"; 604 status = "okay";
605 pinctrl-names = "default"; 605 pinctrl-names = "default";
606 pinctrl-0 = <&usb1_pins>; 606 pinctrl-0 = <&usb1_pins>;
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index 00c3d1de384f..a66941885c11 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -856,7 +856,7 @@
856}; 856};
857 857
858&usb1 { 858&usb1 {
859 dr_mode = "peripheral"; 859 dr_mode = "otg";
860 status = "okay"; 860 status = "okay";
861}; 861};
862 862
diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts
index 6d3c83743156..a2555140babc 100644
--- a/arch/arm/boot/dts/am571x-idk.dts
+++ b/arch/arm/boot/dts/am571x-idk.dts
@@ -10,8 +10,8 @@
10#include "dra72x.dtsi" 10#include "dra72x.dtsi"
11#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/interrupt-controller/irq.h> 12#include <dt-bindings/interrupt-controller/irq.h>
13#include "am57xx-idk-common.dtsi"
14#include "dra72x-mmc-iodelay.dtsi" 13#include "dra72x-mmc-iodelay.dtsi"
14#include "am57xx-idk-common.dtsi"
15 15
16/ { 16/ {
17 model = "TI AM5718 IDK"; 17 model = "TI AM5718 IDK";
diff --git a/arch/arm/boot/dts/am572x-idk.dts b/arch/arm/boot/dts/am572x-idk.dts
index 9ab0af5017df..3a02ed720957 100644
--- a/arch/arm/boot/dts/am572x-idk.dts
+++ b/arch/arm/boot/dts/am572x-idk.dts
@@ -9,9 +9,8 @@
9/dts-v1/; 9/dts-v1/;
10 10
11#include "dra74x.dtsi" 11#include "dra74x.dtsi"
12#include "am572x-idk-common.dtsi"
13#include "am57xx-idk-common.dtsi"
14#include "dra74x-mmc-iodelay.dtsi" 12#include "dra74x-mmc-iodelay.dtsi"
13#include "am572x-idk-common.dtsi"
15 14
16/ { 15/ {
17 model = "TI AM5728 IDK"; 16 model = "TI AM5728 IDK";
diff --git a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
index ab60035bc50c..6204a266212a 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
@@ -442,6 +442,7 @@
442 pinctrl-0 = <&mmc2_pins_default>; 442 pinctrl-0 = <&mmc2_pins_default>;
443 443
444 vmmc-supply = <&vdd_3v3>; 444 vmmc-supply = <&vdd_3v3>;
445 vqmmc-supply = <&vdd_3v3>;
445 bus-width = <8>; 446 bus-width = <8>;
446 ti,non-removable; 447 ti,non-removable;
447 cap-mmc-dual-data-rate; 448 cap-mmc-dual-data-rate;
diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi
index 97aa8e6a56da..43cdf523a8a0 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -115,6 +115,17 @@
115 DRA7XX_CORE_IOPAD(0x37d4, MUX_MODE15 | PULL_UP) /* dcan1_rx.off */ 115 DRA7XX_CORE_IOPAD(0x37d4, MUX_MODE15 | PULL_UP) /* dcan1_rx.off */
116 >; 116 >;
117 }; 117 };
118
119 mmc1_pins_default: mmc1_pins_default {
120 pinctrl-single,pins = <
121 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mmc1_clk.clk */
122 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
123 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
124 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
125 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
126 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
127 >;
128 };
118}; 129};
119 130
120&i2c1 { 131&i2c1 {
@@ -410,6 +421,7 @@
410&mmc2 { 421&mmc2 {
411 status = "okay"; 422 status = "okay";
412 vmmc-supply = <&v3_3d>; 423 vmmc-supply = <&v3_3d>;
424 vqmmc-supply = <&v3_3d>;
413 bus-width = <8>; 425 bus-width = <8>;
414 ti,non-removable; 426 ti,non-removable;
415 max-frequency = <96000000>; 427 max-frequency = <96000000>;
diff --git a/arch/arm/boot/dts/animeo_ip.dts b/arch/arm/boot/dts/animeo_ip.dts
index b67a75179784..d7c841932701 100644
--- a/arch/arm/boot/dts/animeo_ip.dts
+++ b/arch/arm/boot/dts/animeo_ip.dts
@@ -24,7 +24,7 @@
24 }; 24 };
25 25
26 chosen { 26 chosen {
27 linux,stdout-path = &usart2; 27 stdout-path = &usart2;
28 }; 28 };
29 29
30 memory { 30 memory {
diff --git a/arch/arm/boot/dts/arm-realview-eb.dtsi b/arch/arm/boot/dts/arm-realview-eb.dtsi
index e2e9599596e2..a917cf8825ca 100644
--- a/arch/arm/boot/dts/arm-realview-eb.dtsi
+++ b/arch/arm/boot/dts/arm-realview-eb.dtsi
@@ -143,6 +143,43 @@
143 port1-otg; 143 port1-otg;
144 }; 144 };
145 145
146 bridge {
147 compatible = "ti,ths8134a", "ti,ths8134";
148 #address-cells = <1>;
149 #size-cells = <0>;
150
151 ports {
152 #address-cells = <1>;
153 #size-cells = <0>;
154
155 port@0 {
156 reg = <0>;
157
158 vga_bridge_in: endpoint {
159 remote-endpoint = <&clcd_pads>;
160 };
161 };
162
163 port@1 {
164 reg = <1>;
165
166 vga_bridge_out: endpoint {
167 remote-endpoint = <&vga_con_in>;
168 };
169 };
170 };
171 };
172
173 vga {
174 compatible = "vga-connector";
175
176 port {
177 vga_con_in: endpoint {
178 remote-endpoint = <&vga_bridge_out>;
179 };
180 };
181 };
182
146 /* These peripherals are inside the FPGA */ 183 /* These peripherals are inside the FPGA */
147 fpga { 184 fpga {
148 #address-cells = <1>; 185 #address-cells = <1>;
@@ -409,36 +446,15 @@
409 interrupt-names = "combined"; 446 interrupt-names = "combined";
410 clocks = <&oscclk0>, <&pclk>; 447 clocks = <&oscclk0>, <&pclk>;
411 clock-names = "clcdclk", "apb_pclk"; 448 clock-names = "clcdclk", "apb_pclk";
449 /* 1024x768 16bpp @65MHz works fine */
450 max-memory-bandwidth = <95000000>;
412 451
413 port { 452 port {
414 clcd_pads: endpoint { 453 clcd_pads: endpoint {
415 remote-endpoint = <&clcd_panel>; 454 remote-endpoint = <&vga_bridge_in>;
416 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 455 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
417 }; 456 };
418 }; 457 };
419
420 panel {
421 compatible = "panel-dpi";
422
423 port {
424 clcd_panel: endpoint {
425 remote-endpoint = <&clcd_pads>;
426 };
427 };
428
429 /* Standard 640x480 VGA timings */
430 panel-timing {
431 clock-frequency = <25175000>;
432 hactive = <640>;
433 hback-porch = <48>;
434 hfront-porch = <16>;
435 hsync-len = <96>;
436 vactive = <480>;
437 vback-porch = <33>;
438 vfront-porch = <10>;
439 vsync-len = <2>;
440 };
441 };
442 }; 458 };
443 }; 459 };
444}; 460};
diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts
index c789564f2803..f935b72d3d96 100644
--- a/arch/arm/boot/dts/arm-realview-pb1176.dts
+++ b/arch/arm/boot/dts/arm-realview-pb1176.dts
@@ -161,6 +161,43 @@
161 port1-otg; 161 port1-otg;
162 }; 162 };
163 163
164 bridge {
165 compatible = "ti,ths8134a", "ti,ths8134";
166 #address-cells = <1>;
167 #size-cells = <0>;
168
169 ports {
170 #address-cells = <1>;
171 #size-cells = <0>;
172
173 port@0 {
174 reg = <0>;
175
176 vga_bridge_in: endpoint {
177 remote-endpoint = <&clcd_pads>;
178 };
179 };
180
181 port@1 {
182 reg = <1>;
183
184 vga_bridge_out: endpoint {
185 remote-endpoint = <&vga_con_in>;
186 };
187 };
188 };
189 };
190
191 vga {
192 compatible = "vga-connector";
193
194 port {
195 vga_con_in: endpoint {
196 remote-endpoint = <&vga_bridge_out>;
197 };
198 };
199 };
200
164 soc { 201 soc {
165 #address-cells = <1>; 202 #address-cells = <1>;
166 #size-cells = <1>; 203 #size-cells = <1>;
@@ -403,36 +440,15 @@
403 interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>; 440 interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>;
404 clocks = <&oscclk0>, <&pclk>; 441 clocks = <&oscclk0>, <&pclk>;
405 clock-names = "clcdclk", "apb_pclk"; 442 clock-names = "clcdclk", "apb_pclk";
443 /* 1024x768 16bpp @65MHz works fine */
444 max-memory-bandwidth = <95000000>;
406 445
407 port { 446 port {
408 clcd_pads: endpoint { 447 clcd_pads: endpoint {
409 remote-endpoint = <&clcd_panel>; 448 remote-endpoint = <&vga_bridge_in>;
410 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 449 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
411 }; 450 };
412 }; 451 };
413
414 panel {
415 compatible = "panel-dpi";
416
417 port {
418 clcd_panel: endpoint {
419 remote-endpoint = <&clcd_pads>;
420 };
421 };
422
423 /* Standard 640x480 VGA timings */
424 panel-timing {
425 clock-frequency = <25175000>;
426 hactive = <640>;
427 hback-porch = <48>;
428 hfront-porch = <16>;
429 hsync-len = <96>;
430 vactive = <480>;
431 vback-porch = <33>;
432 vfront-porch = <10>;
433 vsync-len = <2>;
434 };
435 };
436 }; 452 };
437 }; 453 };
438 454
@@ -564,7 +580,5 @@
564 clocks = <&pclk>; 580 clocks = <&pclk>;
565 clock-names = "apb_pclk"; 581 clock-names = "apb_pclk";
566 }; 582 };
567
568
569 }; 583 };
570}; 584};
diff --git a/arch/arm/boot/dts/arm-realview-pb11mp.dts b/arch/arm/boot/dts/arm-realview-pb11mp.dts
index 3944765ac4b0..36203288de42 100644
--- a/arch/arm/boot/dts/arm-realview-pb11mp.dts
+++ b/arch/arm/boot/dts/arm-realview-pb11mp.dts
@@ -242,6 +242,49 @@
242 bank-width = <4>; 242 bank-width = <4>;
243 }; 243 };
244 244
245 bridge {
246 compatible = "ti,ths8134a", "ti,ths8134";
247 #address-cells = <1>;
248 #size-cells = <0>;
249
250 ports {
251 #address-cells = <1>;
252 #size-cells = <0>;
253
254 port@0 {
255 reg = <0>;
256
257 vga_bridge_in: endpoint {
258 remote-endpoint = <&clcd_pads>;
259 };
260 };
261
262 port@1 {
263 reg = <1>;
264
265 vga_bridge_out: endpoint {
266 remote-endpoint = <&vga_con_in>;
267 };
268 };
269 };
270 };
271
272 vga {
273 /*
274 * This DDC I2C is connected directly to the DVI portions
275 * of the connector, so it's not really working when the
276 * monitor is connected to the VGA connector.
277 */
278 compatible = "vga-connector";
279 ddc-i2c-bus = <&i2c1>;
280
281 port {
282 vga_con_in: endpoint {
283 remote-endpoint = <&vga_bridge_out>;
284 };
285 };
286 };
287
245 soc { 288 soc {
246 #address-cells = <1>; 289 #address-cells = <1>;
247 #size-cells = <1>; 290 #size-cells = <1>;
@@ -575,6 +618,13 @@
575 clock-names = "apb_pclk"; 618 clock-names = "apb_pclk";
576 }; 619 };
577 620
621 i2c1: i2c@10016000 {
622 #address-cells = <1>;
623 #size-cells = <0>;
624 compatible = "arm,versatile-i2c";
625 reg = <0x10016000 0x1000>;
626 };
627
578 rtc: rtc@10017000 { 628 rtc: rtc@10017000 {
579 compatible = "arm,pl031", "arm,primecell"; 629 compatible = "arm,pl031", "arm,primecell";
580 reg = <0x10017000 0x1000>; 630 reg = <0x10017000 0x1000>;
@@ -609,37 +659,15 @@
609 interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>; 659 interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
610 clocks = <&oscclk4>, <&pclk>; 660 clocks = <&oscclk4>, <&pclk>;
611 clock-names = "clcdclk", "apb_pclk"; 661 clock-names = "clcdclk", "apb_pclk";
612 max-memory-bandwidth = <130000000>; /* 16bpp @ 63.5MHz */ 662 /* 1024x768 16bpp @65MHz works fine */
663 max-memory-bandwidth = <95000000>;
613 664
614 port { 665 port {
615 clcd_pads: endpoint { 666 clcd_pads: endpoint {
616 remote-endpoint = <&clcd_panel>; 667 remote-endpoint = <&vga_bridge_in>;
617 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 668 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
618 }; 669 };
619 }; 670 };
620
621 panel {
622 compatible = "panel-dpi";
623
624 port {
625 clcd_panel: endpoint {
626 remote-endpoint = <&clcd_pads>;
627 };
628 };
629
630 /* Standard 640x480 VGA timings */
631 panel-timing {
632 clock-frequency = <25175000>;
633 hactive = <640>;
634 hback-porch = <48>;
635 hfront-porch = <16>;
636 hsync-len = <96>;
637 vactive = <480>;
638 vback-porch = <33>;
639 vfront-porch = <10>;
640 vsync-len = <2>;
641 };
642 };
643 }; 671 };
644 672
645 /* 673 /*
diff --git a/arch/arm/boot/dts/arm-realview-pbx.dtsi b/arch/arm/boot/dts/arm-realview-pbx.dtsi
index aeb49c4bd773..10868ba3277f 100644
--- a/arch/arm/boot/dts/arm-realview-pbx.dtsi
+++ b/arch/arm/boot/dts/arm-realview-pbx.dtsi
@@ -34,7 +34,8 @@
34 serial1 = &serial1; 34 serial1 = &serial1;
35 serial2 = &serial2; 35 serial2 = &serial2;
36 serial3 = &serial3; 36 serial3 = &serial3;
37 i2c0 = &i2c; 37 i2c0 = &i2c0;
38 i2c1 = &i2c1;
38 }; 39 };
39 40
40 memory { 41 memory {
@@ -158,6 +159,49 @@
158 port1-otg; 159 port1-otg;
159 }; 160 };
160 161
162 bridge {
163 compatible = "ti,ths8134a", "ti,ths8134";
164 #address-cells = <1>;
165 #size-cells = <0>;
166
167 ports {
168 #address-cells = <1>;
169 #size-cells = <0>;
170
171 port@0 {
172 reg = <0>;
173
174 vga_bridge_in: endpoint {
175 remote-endpoint = <&clcd_pads>;
176 };
177 };
178
179 port@1 {
180 reg = <1>;
181
182 vga_bridge_out: endpoint {
183 remote-endpoint = <&vga_con_in>;
184 };
185 };
186 };
187 };
188
189 vga {
190 /*
191 * This DDC I2C is connected directly to the DVI portions
192 * of the connector, so it's not really working when the
193 * monitor is connected to the VGA connector.
194 */
195 compatible = "vga-connector";
196 ddc-i2c-bus = <&i2c1>;
197
198 port {
199 vga_con_in: endpoint {
200 remote-endpoint = <&vga_bridge_out>;
201 };
202 };
203 };
204
161 soc: soc@0 { 205 soc: soc@0 {
162 compatible = "arm,realview-pbx-soc", "simple-bus"; 206 compatible = "arm,realview-pbx-soc", "simple-bus";
163 #address-cells = <1>; 207 #address-cells = <1>;
@@ -285,7 +329,7 @@
285 <&timclk>; 329 <&timclk>;
286 }; 330 };
287 331
288 i2c: i2c@10002000 { 332 i2c0: i2c@10002000 {
289 #address-cells = <1>; 333 #address-cells = <1>;
290 #size-cells = <0>; 334 #size-cells = <0>;
291 compatible = "arm,versatile-i2c"; 335 compatible = "arm,versatile-i2c";
@@ -396,7 +440,12 @@
396 clock-names = "apb_pclk"; 440 clock-names = "apb_pclk";
397 }; 441 };
398 442
399 /* DVI serial bus control is at 10016000 */ 443 i2c1: i2c@10016000 {
444 #address-cells = <1>;
445 #size-cells = <0>;
446 compatible = "arm,versatile-i2c";
447 reg = <0x10016000 0x1000>;
448 };
400 449
401 rtc: rtc@10017000 { 450 rtc: rtc@10017000 {
402 compatible = "arm,pl031", "arm,primecell"; 451 compatible = "arm,pl031", "arm,primecell";
@@ -506,36 +555,15 @@
506 interrupt-names = "combined"; 555 interrupt-names = "combined";
507 clocks = <&oscclk4>, <&pclk>; 556 clocks = <&oscclk4>, <&pclk>;
508 clock-names = "clcdclk", "apb_pclk"; 557 clock-names = "clcdclk", "apb_pclk";
558 /* 1024x768 16bpp @65MHz works fine */
559 max-memory-bandwidth = <95000000>;
509 560
510 port { 561 port {
511 clcd_pads: endpoint { 562 clcd_pads: endpoint {
512 remote-endpoint = <&clcd_panel>; 563 remote-endpoint = <&vga_bridge_in>;
513 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 564 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
514 }; 565 };
515 }; 566 };
516
517 panel {
518 compatible = "panel-dpi";
519
520 port {
521 clcd_panel: endpoint {
522 remote-endpoint = <&clcd_pads>;
523 };
524 };
525
526 /* Standard 640x480 VGA timings */
527 panel-timing {
528 clock-frequency = <25175000>;
529 hactive = <640>;
530 hback-porch = <48>;
531 hfront-porch = <16>;
532 hsync-len = <96>;
533 vactive = <480>;
534 vback-porch = <33>;
535 vfront-porch = <10>;
536 vsync-len = <2>;
537 };
538 };
539 }; 567 };
540 }; 568 };
541}; 569};
diff --git a/arch/arm/boot/dts/artpec6-devboard.dts b/arch/arm/boot/dts/artpec6-devboard.dts
index 9dfe845694cf..d20d95359b28 100644
--- a/arch/arm/boot/dts/artpec6-devboard.dts
+++ b/arch/arm/boot/dts/artpec6-devboard.dts
@@ -26,7 +26,7 @@
26 26
27 memory { 27 memory {
28 device_type = "memory"; 28 device_type = "memory";
29 reg = <0x0 0x10000000>; 29 reg = <0x0 0x40000000>;
30 }; 30 };
31}; 31};
32 32
@@ -59,6 +59,7 @@
59 mdio { 59 mdio {
60 #address-cells = <0x1>; 60 #address-cells = <0x1>;
61 #size-cells = <0x0>; 61 #size-cells = <0x0>;
62 compatible = "snps,dwmac-mdio";
62 phy1: phy@0 { 63 phy1: phy@0 {
63 compatible = "ethernet-phy-ieee802.3-c22"; 64 compatible = "ethernet-phy-ieee802.3-c22";
64 device_type = "ethernet-phy"; 65 device_type = "ethernet-phy";
diff --git a/arch/arm/boot/dts/artpec6.dtsi b/arch/arm/boot/dts/artpec6.dtsi
index 2ed11773048d..3e4115c2cd75 100644
--- a/arch/arm/boot/dts/artpec6.dtsi
+++ b/arch/arm/boot/dts/artpec6.dtsi
@@ -41,6 +41,7 @@
41 */ 41 */
42 42
43#include <dt-bindings/interrupt-controller/arm-gic.h> 43#include <dt-bindings/interrupt-controller/arm-gic.h>
44#include <dt-bindings/dma/nbpfaxi.h>
44#include <dt-bindings/clock/axis,artpec6-clkctrl.h> 45#include <dt-bindings/clock/axis,artpec6-clkctrl.h>
45#include "skeleton.dtsi" 46#include "skeleton.dtsi"
46 47
@@ -98,7 +99,7 @@
98 clock-frequency = <125000000>; 99 clock-frequency = <125000000>;
99 }; 100 };
100 101
101 clkctrl: clkctrl@0xf8000000 { 102 clkctrl: clkctrl@f8000000 {
102 #clock-cells = <1>; 103 #clock-cells = <1>;
103 compatible = "axis,artpec6-clkctrl"; 104 compatible = "axis,artpec6-clkctrl";
104 reg = <0xf8000000 0x48>; 105 reg = <0xf8000000 0x48>;
@@ -153,6 +154,10 @@
153 interrupt-affinity = <&cpu0>, <&cpu1>; 154 interrupt-affinity = <&cpu0>, <&cpu1>;
154 }; 155 };
155 156
157 /*
158 * Both pci nodes cannot be enabled at the same time,
159 * leave the unwanted node as disabled.
160 */
156 pcie: pcie@f8050000 { 161 pcie: pcie@f8050000 {
157 compatible = "axis,artpec6-pcie", "snps,dw-pcie"; 162 compatible = "axis,artpec6-pcie", "snps,dw-pcie";
158 reg = <0xf8050000 0x2000 163 reg = <0xf8050000 0x2000
@@ -180,28 +185,146 @@
180 status = "disabled"; 185 status = "disabled";
181 }; 186 };
182 187
188 pcie_ep: pcie_ep@f8050000 {
189 compatible = "axis,artpec6-pcie-ep", "snps,dw-pcie";
190 reg = <0xf8050000 0x2000
191 0xf8051000 0x2000
192 0xf8040000 0x1000
193 0xc0000000 0x20000000>;
194 reg-names = "dbi", "dbi2", "phy", "addr_space";
195 num-ib-windows = <6>;
196 num-ob-windows = <2>;
197 num-lanes = <2>;
198 axis,syscon-pcie = <&syscon>;
199 status = "disabled";
200 };
201
202 pinctrl: pinctrl@f801d000 {
203 compatible = "axis,artpec6-pinctrl";
204 reg = <0xf801d000 0x400>;
205
206 pinctrl_uart0: uart0grp {
207 function = "uart0";
208 groups = "uart0grp2";
209 bias-pull-up;
210 };
211 pinctrl_uart1: uart1grp {
212 function = "uart1";
213 groups = "uart1grp0";
214 bias-pull-up;
215 };
216 pinctrl_uart2: uart2grp {
217 function = "uart2";
218 groups = "uart2grp1";
219 bias-pull-up;
220 };
221 pinctrl_uart3: uart3grp {
222 function = "uart3";
223 groups = "uart3grp0";
224 bias-pull-up;
225 };
226 };
227
183 amba@0 { 228 amba@0 {
184 compatible = "simple-bus"; 229 compatible = "simple-bus";
185 #address-cells = <0x1>; 230 #address-cells = <0x1>;
186 #size-cells = <0x1>; 231 #size-cells = <0x1>;
187 ranges; 232 ranges;
188 dma-ranges = <0x80000000 0x00000000 0x40000000>; 233 dma-ranges;
189 dma-coherent; 234
235 crypto@f4264000 {
236 compatible = "axis,artpec6-crypto";
237 reg = <0xf4264000 0x4000>;
238 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
239 };
240
241 dma0: dma@f8019000 {
242 compatible = "renesas,nbpfaxi64dmac8b16";
243 reg = <0xf8019000 0x400>;
244 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, /* error */
245 <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>,
246 <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>,
247 <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>,
248 <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
249 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
250 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
251 <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
252 <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
253 interrupt-names = "error",
254 "ch0", "ch1", "ch2", "ch3",
255 "ch4", "ch5", "ch6", "ch7",
256 "ch8", "ch9", "ch10", "ch12",
257 "ch12", "ch13", "ch14", "ch15";
258 clocks = <&clkctrl ARTPEC6_CLK_DMA_ACLK>;
259 #dma-cells = <2>;
260 dma-channels = <8>;
261 dma-requests = <8>;
262 };
263 dma1: dma@f8019400 {
264 compatible = "renesas,nbpfaxi64dmac8b16";
265 reg = <0xf8019400 0x400>;
266 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, /* error */
267 <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
268 <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
269 <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
270 <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
271 <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
272 <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
273 <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
274 <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
275 interrupt-names = "error",
276 "ch0", "ch1", "ch2", "ch3",
277 "ch4", "ch5", "ch6", "ch7",
278 "ch8", "ch9", "ch10", "ch12",
279 "ch12", "ch13", "ch14", "ch15";
280 clocks = <&clkctrl ARTPEC6_CLK_DMA_ACLK>;
281 #dma-cells = <2>;
282 dma-channels = <8>;
283 dma-requests = <8>;
284 };
190 285
191 ethernet: ethernet@f8010000 { 286 ethernet: ethernet@f8010000 {
192 clock-names = "phy_ref_clk", "apb_pclk"; 287 clock-names = "stmmaceth", "ptp_ref";
193 clocks = <&eth_phy_ref_clk>, 288 clocks = <&clkctrl ARTPEC6_CLK_ETH_ACLK>,
194 <&clkctrl ARTPEC6_CLK_ETH_ACLK>; 289 <&clkctrl ARTPEC6_CLK_PTP_REF>;
195 compatible = "snps,dwc-qos-ethernet-4.10"; 290 compatible = "snps,dwmac-4.10a", "snps,dwmac";
196 interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; 291 interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
292 <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
293 interrupt-names = "macirq", "eth_lpi";
197 reg = <0xf8010000 0x4000>; 294 reg = <0xf8010000 0x4000>;
198 295
199 snps,write-requests = <2>; 296 snps,axi-config = <&stmmac_axi_setup>;
200 snps,read-requests = <16>; 297 snps,mtl-rx-config = <&mtl_rx_setup>;
298 snps,mtl-tx-config = <&mtl_tx_setup>;
299
201 snps,txpbl = <8>; 300 snps,txpbl = <8>;
202 snps,rxpbl = <2>; 301 snps,rxpbl = <2>;
302 snps,aal;
303 snps,tso;
203 304
204 status = "disabled"; 305 status = "disabled";
306
307 stmmac_axi_setup: stmmac-axi-config {
308 snps,wr_osr_lmt = <1>;
309 snps,rd_osr_lmt = <15>;
310 /* If FB is disabled, the AXI master chooses
311 * a burst length of any value less than the
312 * maximum enabled burst length
313 * (all lesser burst length enables are redundant).
314 */
315 snps,blen = <0 0 0 0 16 0 0>;
316 };
317
318 mtl_rx_setup: rx-queues-config {
319 snps,rx-queues-to-use = <1>;
320 queue0 {};
321 };
322
323 mtl_tx_setup: tx-queues-config {
324 snps,tx-queues-to-use = <2>;
325 queue0 {};
326 queue1 {};
327 };
205 }; 328 };
206 329
207 uart0: serial@f8036000 { 330 uart0: serial@f8036000 {
@@ -211,6 +334,11 @@
211 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>, 334 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>,
212 <&clkctrl ARTPEC6_CLK_UART_PCLK>; 335 <&clkctrl ARTPEC6_CLK_UART_PCLK>;
213 clock-names = "uart_clk", "apb_pclk"; 336 clock-names = "uart_clk", "apb_pclk";
337 pinctrl-names = "default";
338 pinctrl-0 = <&pinctrl_uart0>;
339 dmas = <&dma0 4 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>,
340 <&dma0 5 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>;
341 dma-names = "rx", "tx";
214 status = "disabled"; 342 status = "disabled";
215 }; 343 };
216 uart1: serial@f8037000 { 344 uart1: serial@f8037000 {
@@ -220,6 +348,11 @@
220 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>, 348 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>,
221 <&clkctrl ARTPEC6_CLK_UART_PCLK>; 349 <&clkctrl ARTPEC6_CLK_UART_PCLK>;
222 clock-names = "uart_clk", "apb_pclk"; 350 clock-names = "uart_clk", "apb_pclk";
351 pinctrl-names = "default";
352 pinctrl-0 = <&pinctrl_uart1>;
353 dmas = <&dma0 6 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>,
354 <&dma0 7 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>;
355 dma-names = "rx", "tx";
223 status = "disabled"; 356 status = "disabled";
224 }; 357 };
225 uart2: serial@f8038000 { 358 uart2: serial@f8038000 {
@@ -229,6 +362,11 @@
229 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>, 362 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>,
230 <&clkctrl ARTPEC6_CLK_UART_PCLK>; 363 <&clkctrl ARTPEC6_CLK_UART_PCLK>;
231 clock-names = "uart_clk", "apb_pclk"; 364 clock-names = "uart_clk", "apb_pclk";
365 pinctrl-names = "default";
366 pinctrl-0 = <&pinctrl_uart2>;
367 dmas = <&dma1 0 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>,
368 <&dma1 1 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>;
369 dma-names = "rx", "tx";
232 status = "disabled"; 370 status = "disabled";
233 }; 371 };
234 uart3: serial@f8039000 { 372 uart3: serial@f8039000 {
@@ -238,6 +376,11 @@
238 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>, 376 clocks = <&clkctrl ARTPEC6_CLK_UART_REFCLK>,
239 <&clkctrl ARTPEC6_CLK_UART_PCLK>; 377 <&clkctrl ARTPEC6_CLK_UART_PCLK>;
240 clock-names = "uart_clk", "apb_pclk"; 378 clock-names = "uart_clk", "apb_pclk";
379 pinctrl-names = "default";
380 pinctrl-0 = <&pinctrl_uart3>;
381 dmas = <&dma1 2 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>,
382 <&dma1 3 (NBPF_SLAVE_RQ_HIGH | NBPF_SLAVE_RQ_LEVEL)>;
383 dma-names = "rx", "tx";
241 status = "disabled"; 384 status = "disabled";
242 }; 385 };
243 }; 386 };
diff --git a/arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts b/arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts
new file mode 100644
index 000000000000..df1227613d48
--- /dev/null
+++ b/arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts
@@ -0,0 +1,225 @@
1// SPDX-License-Identifier: GPL-2.0+
2/dts-v1/;
3
4#include "aspeed-g5.dtsi"
5#include <dt-bindings/gpio/aspeed-gpio.h>
6
7/ {
8 model = "Qualcomm Centriq 2400 REP AST2520";
9 compatible = "qualcomm,centriq2400-rep-bmc", "aspeed,ast2500";
10
11 chosen {
12 stdout-path = &uart5;
13 bootargs = "console=ttyS4,115200 earlyprintk";
14 };
15
16 memory {
17 reg = <0x80000000 0x40000000>;
18 };
19
20 iio-hwmon {
21 compatible = "iio-hwmon";
22 io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
23 <&adc 4>, <&adc 5>, <&adc 6>, <&adc 8>;
24 };
25
26 iio-hwmon-battery {
27 compatible = "iio-hwmon";
28 io-channels = <&adc 7>;
29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 uid_led {
35 label = "UID_LED";
36 gpios = <&gpio ASPEED_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
37 };
38
39 ras_error_led {
40 label = "RAS_ERROR_LED";
41 gpios = <&gpio ASPEED_GPIO(F, 6) GPIO_ACTIVE_LOW>;
42 };
43
44 system_fault {
45 label = "System_fault";
46 gpios = <&gpio ASPEED_GPIO(A, 1) GPIO_ACTIVE_LOW>;
47 };
48 };
49};
50
51&fmc {
52 status = "okay";
53 flash@0 {
54 status = "okay";
55 m25p,fast-read;
56 label = "bmc";
57#include "openbmc-flash-layout.dtsi"
58 };
59};
60
61&spi1 {
62 status = "okay";
63 pinctrl-names = "default";
64 pinctrl-0 = <&pinctrl_spi1_default>;
65 flash@0 {
66 status = "okay";
67 };
68};
69
70&spi2 {
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_spi2ck_default
73 &pinctrl_spi2miso_default
74 &pinctrl_spi2mosi_default
75 &pinctrl_spi2cs0_default>;
76};
77
78&uart3 {
79 status = "okay";
80
81 pinctrl-names = "default";
82 pinctrl-0 = <&pinctrl_txd3_default &pinctrl_rxd3_default>;
83 current-speed = <115200>;
84};
85
86&uart5 {
87 status = "okay";
88};
89
90&mac0 {
91 status = "okay";
92
93 pinctrl-names = "default";
94 pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
95};
96
97&i2c0 {
98 status = "okay";
99};
100
101&i2c1 {
102 status = "okay";
103
104 tmp421@1e {
105 compatible = "ti,tmp421";
106 reg = <0x1e>;
107 };
108 tmp421@2a {
109 compatible = "ti,tmp421";
110 reg = <0x2a>;
111 };
112 tmp421@4e {
113 compatible = "ti,tmp421";
114 reg = <0x4e>;
115 };
116 tmp421@1c {
117 compatible = "ti,tmp421";
118 reg = <0x1c>;
119 };
120};
121
122&i2c2 {
123 status = "okay";
124};
125
126&i2c3 {
127 status = "okay";
128};
129
130&i2c4 {
131 status = "okay";
132};
133
134&i2c5 {
135 status = "okay";
136};
137
138&i2c6 {
139 status = "okay";
140
141 tmp421@1d {
142 compatible = "ti,tmp421";
143 reg = <0x1d>;
144 };
145 tmp421@1f {
146 compatible = "ti,tmp421";
147 reg = <0x1f>;
148 };
149 tmp421@4d {
150 compatible = "ti,tmp421";
151 reg = <0x4d>;
152 };
153 tmp421@4f {
154 compatible = "ti,tmp421";
155 reg = <0x4f>;
156 };
157 nvt210@4c {
158 compatible = "nvt210";
159 reg = <0x4c>;
160 };
161 eeprom@50 {
162 compatible = "atmel,24c128";
163 reg = <0x50>;
164 pagesize = <128>;
165 };
166};
167
168&i2c7 {
169 status = "okay";
170};
171
172&i2c8 {
173 status = "okay";
174
175 pca9641@70 {
176 compatible = "nxp,pca9641";
177 reg = <0x70>;
178 i2c-arb {
179 #address-cells = <1>;
180 #size-cells = <0>;
181 tmp421@1d {
182 compatible = "tmp421";
183 reg = <0x1d>;
184 };
185 adm1278@12 {
186 compatible = "adi,adm1278";
187 reg = <0x12>;
188 Rsense = <500>;
189 };
190 eeprom@50 {
191 compatible = "atmel,24c02";
192 reg = <0x50>;
193 };
194 ds1100@58 {
195 compatible = "ds1100";
196 reg = <0x58>;
197 };
198 };
199 };
200};
201
202&i2c9 {
203 status = "okay";
204};
205
206&vuart {
207 status = "okay";
208};
209
210&gfx {
211 status = "okay";
212};
213
214&pinctrl {
215 aspeed,external-nodes = <&gfx &lhc>;
216};
217
218&gpio {
219 pin_gpio_c7 {
220 gpio-hog;
221 gpios = <ASPEED_GPIO(C, 7) GPIO_ACTIVE_HIGH>;
222 output;
223 line-name = "BIOS_SPI_MUX_S";
224 };
225};
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
index 4379d09a261f..c7084a819dc6 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
@@ -2,6 +2,7 @@
2/dts-v1/; 2/dts-v1/;
3 3
4#include "aspeed-g4.dtsi" 4#include "aspeed-g4.dtsi"
5#include <dt-bindings/gpio/aspeed-gpio.h>
5 6
6/ { 7/ {
7 model = "Palmetto BMC"; 8 model = "Palmetto BMC";
@@ -26,6 +27,32 @@
26 reg = <0x5f000000 0x01000000>; /* 16M */ 27 reg = <0x5f000000 0x01000000>; /* 16M */
27 }; 28 };
28 }; 29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 heartbeat {
35 gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_LOW>;
36 };
37
38 power {
39 gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_LOW>;
40 };
41
42 identify {
43 gpios = <&gpio ASPEED_GPIO(A, 2) GPIO_ACTIVE_LOW>;
44 };
45 };
46
47 gpio-keys {
48 compatible = "gpio-keys";
49
50 checkstop {
51 label = "checkstop";
52 gpios = <&gpio ASPEED_GPIO(P, 5) GPIO_ACTIVE_LOW>;
53 linux,code = <ASPEED_GPIO(P, 5)>;
54 };
55 };
29}; 56};
30 57
31&fmc { 58&fmc {
@@ -40,6 +67,9 @@
40 67
41&spi { 68&spi {
42 status = "okay"; 69 status = "okay";
70 pinctrl-names = "default";
71 pinctrl-0 = <&pinctrl_spi1debug_default>;
72
43 flash@0 { 73 flash@0 {
44 status = "okay"; 74 status = "okay";
45 m25p,fast-read; 75 m25p,fast-read;
@@ -47,6 +77,29 @@
47 }; 77 };
48}; 78};
49 79
80&pinctrl {
81 pinctrl-names = "default";
82 pinctrl-0 = <&pinctrl_flbusy_default &pinctrl_flwp_default
83
84 &pinctrl_vgahs_default &pinctrl_vgavs_default
85 &pinctrl_ddcclk_default &pinctrl_ddcdat_default>;
86};
87
88&uart1 {
89 /* Rear RS-232 connector */
90 status = "okay";
91
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_txd1_default
94 &pinctrl_rxd1_default
95 &pinctrl_nrts1_default
96 &pinctrl_ndtr1_default
97 &pinctrl_ndsr1_default
98 &pinctrl_ncts1_default
99 &pinctrl_ndcd1_default
100 &pinctrl_nri1_default>;
101};
102
50&uart5 { 103&uart5 {
51 status = "okay"; 104 status = "okay";
52}; 105};
@@ -111,3 +164,156 @@
111&vuart { 164&vuart {
112 status = "okay"; 165 status = "okay";
113}; 166};
167
168&ibt {
169 status = "okay";
170};
171
172&gpio {
173 pin_func_mode0 {
174 gpio-hog;
175 gpios = <ASPEED_GPIO(C, 4) GPIO_ACTIVE_HIGH>;
176 output-low;
177 line-name = "func_mode0";
178 };
179
180 pin_func_mode1 {
181 gpio-hog;
182 gpios = <ASPEED_GPIO(C, 5) GPIO_ACTIVE_HIGH>;
183 output-low;
184 line-name = "func_mode1";
185 };
186
187 pin_func_mode2 {
188 gpio-hog;
189 gpios = <ASPEED_GPIO(C, 6) GPIO_ACTIVE_HIGH>;
190 output-low;
191 line-name = "func_mode2";
192 };
193
194 pin_gpio_a0 {
195 gpio-hog;
196 gpios = <ASPEED_GPIO(A, 0) GPIO_ACTIVE_HIGH>;
197 input;
198 line-name = "BMC_FAN_RESERVED_N";
199 };
200
201 pin_gpio_a1 {
202 gpio-hog;
203 gpios = <ASPEED_GPIO(A, 1) GPIO_ACTIVE_HIGH>;
204 output-high;
205 line-name = "APSS_WDT_N";
206 };
207
208 pin_gpio_b1 {
209 gpio-hog;
210 gpios = <ASPEED_GPIO(B, 1) GPIO_ACTIVE_HIGH>;
211 output-high;
212 line-name = "APSS_BOOT_MODE";
213 };
214
215 pin_gpio_b2 {
216 gpio-hog;
217 gpios = <ASPEED_GPIO(B, 2) GPIO_ACTIVE_HIGH>;
218 output-high;
219 line-name = "APSS_RESET_N";
220 };
221
222 pin_gpio_b7 {
223 gpio-hog;
224 gpios = <ASPEED_GPIO(B, 7) GPIO_ACTIVE_HIGH>;
225 output-high;
226 line-name = "SPIVID_STBY_RESET_N";
227 };
228
229 pin_gpio_d1 {
230 gpio-hog;
231 gpios = <ASPEED_GPIO(D, 1) GPIO_ACTIVE_HIGH>;
232 output-high;
233 line-name = "BMC_POWER_UP";
234 };
235
236 pin_gpio_f1 {
237 gpio-hog;
238 gpios = <ASPEED_GPIO(F, 1) GPIO_ACTIVE_HIGH>;
239 input;
240 line-name = "BMC_BATTERY_TEST";
241 };
242
243 pin_gpio_f4 {
244 gpio-hog;
245 gpios = <ASPEED_GPIO(F, 4) GPIO_ACTIVE_HIGH>;
246 input;
247 line-name = "AST_HW_FAULT_N";
248 };
249
250 pin_gpio_f5 {
251 gpio-hog;
252 gpios = <ASPEED_GPIO(F, 5) GPIO_ACTIVE_HIGH>;
253 input;
254 line-name = "AST_SYS_FAULT_N";
255 };
256
257 pin_gpio_f7 {
258 gpio-hog;
259 gpios = <ASPEED_GPIO(F, 7) GPIO_ACTIVE_HIGH>;
260 output-high;
261 line-name = "BMC_FULL_SPEED_N";
262 };
263
264 pin_gpio_g3 {
265 gpio-hog;
266 gpios = <ASPEED_GPIO(G, 3) GPIO_ACTIVE_HIGH>;
267 output-high;
268 line-name = "BMC_FAN_ERROR_N";
269 };
270
271 pin_gpio_g4 {
272 gpio-hog;
273 gpios = <ASPEED_GPIO(G, 4) GPIO_ACTIVE_HIGH>;
274 input;
275 line-name = "BMC_WDT_RST1_P";
276 };
277
278 pin_gpio_g5 {
279 gpio-hog;
280 gpios = <ASPEED_GPIO(G, 5) GPIO_ACTIVE_HIGH>;
281 input;
282 line-name = "BMC_WDT_RST2_P";
283 };
284
285 pin_gpio_h0 {
286 gpio-hog;
287 gpios = <ASPEED_GPIO(H, 0) GPIO_ACTIVE_HIGH>;
288 input;
289 line-name = "PE_SLOT_TEST_EN_N";
290 };
291
292 pin_gpio_h1 {
293 gpio-hog;
294 gpios = <ASPEED_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
295 input;
296 line-name = "BMC_RTCRST_N";
297 };
298
299 pin_gpio_h2 {
300 gpio-hog;
301 gpios = <ASPEED_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
302 output-high;
303 line-name = "SYS_PWROK_BMC";
304 };
305
306 pin_gpio_h6 {
307 gpio-hog;
308 gpios = <ASPEED_GPIO(H, 6) GPIO_ACTIVE_HIGH>;
309 output-high;
310 line-name = "SCM1_FSI0_DATA_EN";
311 };
312
313 pin_gpio_h7 {
314 gpio-hog;
315 gpios = <ASPEED_GPIO(H, 7) GPIO_ACTIVE_HIGH>;
316 output-high;
317 line-name = "BMC_TPM_INT_N";
318 };
319};
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 623b6ab42021..51bc6a2e9dd5 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -184,9 +184,9 @@
184&i2c12 { 184&i2c12 {
185 status = "okay"; 185 status = "okay";
186 186
187 max31785@52 { 187 w83773g@4c {
188 compatible = "maxim,max31785"; 188 compatible = "nuvoton,w83773g";
189 reg = <0x52>; 189 reg = <0x4c>;
190 }; 190 };
191}; 191};
192 192
@@ -203,6 +203,12 @@
203 output-low; 203 output-low;
204 line-name = "nic_func_mode1"; 204 line-name = "nic_func_mode1";
205 }; 205 };
206 seq_cont {
207 gpio-hog;
208 gpios = <ASPEED_GPIO(S, 7) GPIO_ACTIVE_HIGH>;
209 output-low;
210 line-name = "seq_cont";
211 };
206}; 212};
207 213
208&vuart { 214&vuart {
@@ -257,3 +263,7 @@
257 aspeed,fan-tach-ch = /bits/ 8 <0x0e>; 263 aspeed,fan-tach-ch = /bits/ 8 <0x0e>;
258 }; 264 };
259}; 265};
266
267&ibt {
268 status = "okay";
269};
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
index 5f9049d2c4c3..7056231cbee6 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
@@ -546,3 +546,7 @@
546 pinctrl-names = "default"; 546 pinctrl-names = "default";
547 pinctrl-0 = <&pinctrl_wdtrst1_default>; 547 pinctrl-0 = <&pinctrl_wdtrst1_default>;
548}; 548};
549
550&ibt {
551 status = "okay";
552};
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
index c881484a85cf..ebe726a0d311 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
@@ -424,3 +424,7 @@
424 aspeed,fan-tach-ch = /bits/ 8 <0x03>; 424 aspeed,fan-tach-ch = /bits/ 8 <0x03>;
425 }; 425 };
426}; 426};
427
428&ibt {
429 status = "okay";
430};
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
index b0d8431a3700..36ae23aa3b48 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -162,6 +162,7 @@
162 reg-shift = <2>; 162 reg-shift = <2>;
163 interrupts = <9>; 163 interrupts = <9>;
164 clocks = <&syscon ASPEED_CLK_GATE_UART1CLK>; 164 clocks = <&syscon ASPEED_CLK_GATE_UART1CLK>;
165 resets = <&lpc_reset 4>;
165 no-loopback-test; 166 no-loopback-test;
166 status = "disabled"; 167 status = "disabled";
167 }; 168 };
@@ -233,6 +234,7 @@
233 lpc_ctrl: lpc-ctrl@0 { 234 lpc_ctrl: lpc-ctrl@0 {
234 compatible = "aspeed,ast2400-lpc-ctrl"; 235 compatible = "aspeed,ast2400-lpc-ctrl";
235 reg = <0x0 0x80>; 236 reg = <0x0 0x80>;
237 clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
236 status = "disabled"; 238 status = "disabled";
237 }; 239 };
238 240
@@ -247,6 +249,19 @@
247 compatible = "aspeed,ast2400-lhc"; 249 compatible = "aspeed,ast2400-lhc";
248 reg = <0x20 0x24 0x48 0x8>; 250 reg = <0x20 0x24 0x48 0x8>;
249 }; 251 };
252
253 lpc_reset: reset-controller@18 {
254 compatible = "aspeed,ast2400-lpc-reset";
255 reg = <0x18 0x4>;
256 #reset-cells = <1>;
257 };
258
259 ibt: ibt@c0 {
260 compatible = "aspeed,ast2400-ibt-bmc";
261 reg = <0xc0 0x18>;
262 interrupts = <8>;
263 status = "disabled";
264 };
250 }; 265 };
251 }; 266 };
252 267
@@ -256,6 +271,7 @@
256 reg-shift = <2>; 271 reg-shift = <2>;
257 interrupts = <32>; 272 interrupts = <32>;
258 clocks = <&syscon ASPEED_CLK_GATE_UART2CLK>; 273 clocks = <&syscon ASPEED_CLK_GATE_UART2CLK>;
274 resets = <&lpc_reset 5>;
259 no-loopback-test; 275 no-loopback-test;
260 status = "disabled"; 276 status = "disabled";
261 }; 277 };
@@ -266,6 +282,7 @@
266 reg-shift = <2>; 282 reg-shift = <2>;
267 interrupts = <33>; 283 interrupts = <33>;
268 clocks = <&syscon ASPEED_CLK_GATE_UART3CLK>; 284 clocks = <&syscon ASPEED_CLK_GATE_UART3CLK>;
285 resets = <&lpc_reset 6>;
269 no-loopback-test; 286 no-loopback-test;
270 status = "disabled"; 287 status = "disabled";
271 }; 288 };
@@ -276,6 +293,7 @@
276 reg-shift = <2>; 293 reg-shift = <2>;
277 interrupts = <34>; 294 interrupts = <34>;
278 clocks = <&syscon ASPEED_CLK_GATE_UART4CLK>; 295 clocks = <&syscon ASPEED_CLK_GATE_UART4CLK>;
296 resets = <&lpc_reset 7>;
279 no-loopback-test; 297 no-loopback-test;
280 status = "disabled"; 298 status = "disabled";
281 }; 299 };
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index 40de3b66c33f..17ee0fa33a14 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -205,6 +205,7 @@
205 reg-shift = <2>; 205 reg-shift = <2>;
206 interrupts = <9>; 206 interrupts = <9>;
207 clocks = <&syscon ASPEED_CLK_GATE_UART1CLK>; 207 clocks = <&syscon ASPEED_CLK_GATE_UART1CLK>;
208 resets = <&lpc_reset 4>;
208 no-loopback-test; 209 no-loopback-test;
209 status = "disabled"; 210 status = "disabled";
210 }; 211 };
@@ -264,7 +265,7 @@
264 265
265 #address-cells = <1>; 266 #address-cells = <1>;
266 #size-cells = <1>; 267 #size-cells = <1>;
267 ranges = <0 0x1e789000 0x1000>; 268 ranges = <0x0 0x1e789000 0x1000>;
268 269
269 lpc_bmc: lpc-bmc@0 { 270 lpc_bmc: lpc-bmc@0 {
270 compatible = "aspeed,ast2500-lpc-bmc"; 271 compatible = "aspeed,ast2500-lpc-bmc";
@@ -274,16 +275,16 @@
274 lpc_host: lpc-host@80 { 275 lpc_host: lpc-host@80 {
275 compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon"; 276 compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon";
276 reg = <0x80 0x1e0>; 277 reg = <0x80 0x1e0>;
278 reg-io-width = <4>;
277 279
278 #address-cells = <1>; 280 #address-cells = <1>;
279 #size-cells = <1>; 281 #size-cells = <1>;
280 ranges = <0 0x80 0x1e0>; 282 ranges = <0x0 0x80 0x1e0>;
281
282 reg-io-width = <4>;
283 283
284 lpc_ctrl: lpc-ctrl@0 { 284 lpc_ctrl: lpc-ctrl@0 {
285 compatible = "aspeed,ast2500-lpc-ctrl"; 285 compatible = "aspeed,ast2500-lpc-ctrl";
286 reg = <0x0 0x80>; 286 reg = <0x0 0x80>;
287 clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
287 status = "disabled"; 288 status = "disabled";
288 }; 289 };
289 290
@@ -298,6 +299,19 @@
298 compatible = "aspeed,ast2500-lhc"; 299 compatible = "aspeed,ast2500-lhc";
299 reg = <0x20 0x24 0x48 0x8>; 300 reg = <0x20 0x24 0x48 0x8>;
300 }; 301 };
302
303 lpc_reset: reset-controller@18 {
304 compatible = "aspeed,ast2500-lpc-reset";
305 reg = <0x18 0x4>;
306 #reset-cells = <1>;
307 };
308
309 ibt: ibt@c0 {
310 compatible = "aspeed,ast2500-ibt-bmc";
311 reg = <0xc0 0x18>;
312 interrupts = <8>;
313 status = "disabled";
314 };
301 }; 315 };
302 }; 316 };
303 317
@@ -307,6 +321,7 @@
307 reg-shift = <2>; 321 reg-shift = <2>;
308 interrupts = <32>; 322 interrupts = <32>;
309 clocks = <&syscon ASPEED_CLK_GATE_UART2CLK>; 323 clocks = <&syscon ASPEED_CLK_GATE_UART2CLK>;
324 resets = <&lpc_reset 5>;
310 no-loopback-test; 325 no-loopback-test;
311 status = "disabled"; 326 status = "disabled";
312 }; 327 };
@@ -317,6 +332,7 @@
317 reg-shift = <2>; 332 reg-shift = <2>;
318 interrupts = <33>; 333 interrupts = <33>;
319 clocks = <&syscon ASPEED_CLK_GATE_UART3CLK>; 334 clocks = <&syscon ASPEED_CLK_GATE_UART3CLK>;
335 resets = <&lpc_reset 6>;
320 no-loopback-test; 336 no-loopback-test;
321 status = "disabled"; 337 status = "disabled";
322 }; 338 };
@@ -327,6 +343,7 @@
327 reg-shift = <2>; 343 reg-shift = <2>;
328 interrupts = <34>; 344 interrupts = <34>;
329 clocks = <&syscon ASPEED_CLK_GATE_UART4CLK>; 345 clocks = <&syscon ASPEED_CLK_GATE_UART4CLK>;
346 resets = <&lpc_reset 7>;
330 no-loopback-test; 347 no-loopback-test;
331 status = "disabled"; 348 status = "disabled";
332 }; 349 };
diff --git a/arch/arm/boot/dts/at91-nattis-2-natte-2.dts b/arch/arm/boot/dts/at91-nattis-2-natte-2.dts
index 3ea1d26e1c68..af9f38456d04 100644
--- a/arch/arm/boot/dts/at91-nattis-2-natte-2.dts
+++ b/arch/arm/boot/dts/at91-nattis-2-natte-2.dts
@@ -109,7 +109,32 @@
109 109
110 port { 110 port {
111 panel_input: endpoint { 111 panel_input: endpoint {
112 remote-endpoint = <&hlcdc_panel_output>; 112 remote-endpoint = <&lvds_encoder_output>;
113 };
114 };
115 };
116
117 lvds-encoder {
118 compatible = "lvds-encoder";
119
120 ports {
121 #address-cells = <1>;
122 #size-cells = <0>;
123
124 port@0 {
125 reg = <0>;
126
127 lvds_encoder_input: endpoint {
128 remote-endpoint = <&hlcdc_output>;
129 };
130 };
131
132 port@1 {
133 reg = <1>;
134
135 lvds_encoder_output: endpoint {
136 remote-endpoint = <&panel_input>;
137 };
113 }; 138 };
114 }; 139 };
115 }; 140 };
@@ -146,7 +171,7 @@
146 }; 171 };
147 172
148 eeprom@50 { 173 eeprom@50 {
149 compatible = "nxp,24c02"; 174 compatible = "nxp,se97b", "atmel,24c02";
150 reg = <0x50>; 175 reg = <0x50>;
151 pagesize = <16>; 176 pagesize = <16>;
152 }; 177 };
@@ -176,8 +201,8 @@
176 &pinctrl_lcd_hipow0>; 201 &pinctrl_lcd_hipow0>;
177 202
178 port@0 { 203 port@0 {
179 hlcdc_panel_output: endpoint { 204 hlcdc_output: endpoint {
180 remote-endpoint = <&panel_input>; 205 remote-endpoint = <&lvds_encoder_input>;
181 }; 206 };
182 }; 207 };
183 }; 208 };
@@ -216,29 +241,34 @@
216 reg = <0x0 0x40000>; 241 reg = <0x0 0x40000>;
217 }; 242 };
218 243
219 bootloader@40000 { 244 barebox@40000 {
220 label = "bootloader"; 245 label = "barebox";
221 reg = <0x40000 0x80000>; 246 reg = <0x40000 0x60000>;
247 };
248
249 bareboxenv@c0000 {
250 label = "bareboxenv";
251 reg = <0xc0000 0x40000>;
222 }; 252 };
223 253
224 bootloaderenv@c0000 { 254 bareboxenv2@100000 {
225 label = "bootloader env"; 255 label = "bareboxenv2";
226 reg = <0xc0000 0xc0000>; 256 reg = <0x100000 0x40000>;
227 }; 257 };
228 258
229 dtb@180000 { 259 oftree@180000 {
230 label = "device tree"; 260 label = "oftree";
231 reg = <0x180000 0x80000>; 261 reg = <0x180000 0x20000>;
232 }; 262 };
233 263
234 kernel@200000 { 264 kernel@200000 {
235 label = "kernel"; 265 label = "kernel";
236 reg = <0x200000 0x600000>; 266 reg = <0x200000 0x500000>;
237 }; 267 };
238 268
239 rootfs@800000 { 269 rootfs@800000 {
240 label = "rootfs"; 270 label = "rootfs";
241 reg = <0x800000 0x0f800000>; 271 reg = <0x800000 0x1f800000>;
242 }; 272 };
243 }; 273 };
244}; 274};
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index e603a267bdf1..b10dccd0958f 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -230,7 +230,7 @@
230 status = "okay"; 230 status = "okay";
231 231
232 at24@50 { 232 at24@50 {
233 compatible = "24c02"; 233 compatible = "atmel,24c02";
234 reg = <0x50>; 234 reg = <0x50>;
235 pagesize = <8>; 235 pagesize = <8>;
236 }; 236 };
diff --git a/arch/arm/boot/dts/at91-tse850-3.dts b/arch/arm/boot/dts/at91-tse850-3.dts
index 9b82cc8843e1..2fbec69d9cd6 100644
--- a/arch/arm/boot/dts/at91-tse850-3.dts
+++ b/arch/arm/boot/dts/at91-tse850-3.dts
@@ -234,6 +234,7 @@
234 compatible = "ti,pcm5142"; 234 compatible = "ti,pcm5142";
235 235
236 reg = <0x4c>; 236 reg = <0x4c>;
237 #sound-dai-cells = <0>;
237 238
238 AVDD-supply = <&reg_3v3>; 239 AVDD-supply = <&reg_3v3>;
239 DVDD-supply = <&reg_3v3>; 240 DVDD-supply = <&reg_3v3>;
@@ -246,7 +247,7 @@
246 }; 247 };
247 248
248 eeprom@50 { 249 eeprom@50 {
249 compatible = "nxp,24c02", "atmel,24c02"; 250 compatible = "nxp,se97b", "atmel,24c02";
250 reg = <0x50>; 251 reg = <0x50>;
251 pagesize = <16>; 252 pagesize = <16>;
252 }; 253 };
diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index ba61893a02a0..2ad69a7fbc00 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -493,8 +493,8 @@
493 uart0 { 493 uart0 {
494 pinctrl_uart0: uart0-0 { 494 pinctrl_uart0: uart0-0 {
495 atmel,pins = 495 atmel,pins =
496 <AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA17 periph A */ 496 <AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE
497 AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA18 periph A */ 497 AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
498 }; 498 };
499 499
500 pinctrl_uart0_cts: uart0_cts-0 { 500 pinctrl_uart0_cts: uart0_cts-0 {
@@ -511,8 +511,8 @@
511 uart1 { 511 uart1 {
512 pinctrl_uart1: uart1-0 { 512 pinctrl_uart1: uart1-0 {
513 atmel,pins = 513 atmel,pins =
514 <AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB20 periph A with pullup */ 514 <AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE
515 AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB21 periph A */ 515 AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
516 }; 516 };
517 517
518 pinctrl_uart1_rts: uart1_rts-0 { 518 pinctrl_uart1_rts: uart1_rts-0 {
@@ -545,8 +545,8 @@
545 uart2 { 545 uart2 {
546 pinctrl_uart2: uart2-0 { 546 pinctrl_uart2: uart2-0 {
547 atmel,pins = 547 atmel,pins =
548 <AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA22 periph A */ 548 <AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
549 AT91_PIOA 23 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA23 periph A with pullup */ 549 AT91_PIOA 23 AT91_PERIPH_A AT91_PINCTRL_NONE>;
550 }; 550 };
551 551
552 pinctrl_uart2_rts: uart2_rts-0 { 552 pinctrl_uart2_rts: uart2_rts-0 {
@@ -563,8 +563,8 @@
563 uart3 { 563 uart3 {
564 pinctrl_uart3: uart3-0 { 564 pinctrl_uart3: uart3-0 {
565 atmel,pins = 565 atmel,pins =
566 <AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* PA5 periph B with pullup */ 566 <AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_NONE
567 AT91_PIOA 6 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PA6 periph B */ 567 AT91_PIOA 6 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
568 }; 568 };
569 569
570 pinctrl_uart3_rts: uart3_rts-0 { 570 pinctrl_uart3_rts: uart3_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index 655f06cd716a..9118e29b6d6a 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -434,8 +434,8 @@
434 usart0 { 434 usart0 {
435 pinctrl_usart0: usart0-0 { 435 pinctrl_usart0: usart0-0 {
436 atmel,pins = 436 atmel,pins =
437 <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB4 periph A */ 437 <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE
438 AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB5 periph A */ 438 AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
439 }; 439 };
440 440
441 pinctrl_usart0_rts: usart0_rts-0 { 441 pinctrl_usart0_rts: usart0_rts-0 {
@@ -468,8 +468,8 @@
468 usart1 { 468 usart1 {
469 pinctrl_usart1: usart1-0 { 469 pinctrl_usart1: usart1-0 {
470 atmel,pins = 470 atmel,pins =
471 <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB6 periph A with pullup */ 471 <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE
472 AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB7 periph A */ 472 AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
473 }; 473 };
474 474
475 pinctrl_usart1_rts: usart1_rts-0 { 475 pinctrl_usart1_rts: usart1_rts-0 {
@@ -486,8 +486,8 @@
486 usart2 { 486 usart2 {
487 pinctrl_usart2: usart2-0 { 487 pinctrl_usart2: usart2-0 {
488 atmel,pins = 488 atmel,pins =
489 <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB8 periph A with pullup */ 489 <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_NONE
490 AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB9 periph A */ 490 AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
491 }; 491 };
492 492
493 pinctrl_usart2_rts: usart2_rts-0 { 493 pinctrl_usart2_rts: usart2_rts-0 {
@@ -504,8 +504,8 @@
504 usart3 { 504 usart3 {
505 pinctrl_usart3: usart3-0 { 505 pinctrl_usart3: usart3-0 {
506 atmel,pins = 506 atmel,pins =
507 <AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB10 periph A with pullup */ 507 <AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE
508 AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB11 periph A */ 508 AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
509 }; 509 };
510 510
511 pinctrl_usart3_rts: usart3_rts-0 { 511 pinctrl_usart3_rts: usart3_rts-0 {
@@ -522,16 +522,16 @@
522 uart0 { 522 uart0 {
523 pinctrl_uart0: uart0-0 { 523 pinctrl_uart0: uart0-0 {
524 atmel,pins = 524 atmel,pins =
525 <AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* PA31 periph B with pullup */ 525 <AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_NONE
526 AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PA30 periph B */ 526 AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
527 }; 527 };
528 }; 528 };
529 529
530 uart1 { 530 uart1 {
531 pinctrl_uart1: uart1-0 { 531 pinctrl_uart1: uart1-0 {
532 atmel,pins = 532 atmel,pins =
533 <AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB12 periph A with pullup */ 533 <AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE
534 AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB13 periph A */ 534 AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
535 }; 535 };
536 }; 536 };
537 537
diff --git a/arch/arm/boot/dts/at91sam9260ek.dts b/arch/arm/boot/dts/at91sam9260ek.dts
index e16c706d91ef..d2b865f60293 100644
--- a/arch/arm/boot/dts/at91sam9260ek.dts
+++ b/arch/arm/boot/dts/at91sam9260ek.dts
@@ -201,7 +201,7 @@
201 status = "okay"; 201 status = "okay";
202 202
203 24c512@50 { 203 24c512@50 {
204 compatible = "24c512"; 204 compatible = "atmel,24c512";
205 reg = <0x50>; 205 reg = <0x50>;
206 }; 206 };
207 }; 207 };
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi
index ddfc63b8fd4e..53c63d0a418a 100644
--- a/arch/arm/boot/dts/at91sam9261.dtsi
+++ b/arch/arm/boot/dts/at91sam9261.dtsi
@@ -328,8 +328,8 @@
328 usart0 { 328 usart0 {
329 pinctrl_usart0: usart0-0 { 329 pinctrl_usart0: usart0-0 {
330 atmel,pins = 330 atmel,pins =
331 <AT91_PIOC 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 331 <AT91_PIOC 8 AT91_PERIPH_A AT91_PINCTRL_NONE>,
332 <AT91_PIOC 9 AT91_PERIPH_A AT91_PINCTRL_NONE>; 332 <AT91_PIOC 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
333 }; 333 };
334 334
335 pinctrl_usart0_rts: usart0_rts-0 { 335 pinctrl_usart0_rts: usart0_rts-0 {
@@ -346,8 +346,8 @@
346 usart1 { 346 usart1 {
347 pinctrl_usart1: usart1-0 { 347 pinctrl_usart1: usart1-0 {
348 atmel,pins = 348 atmel,pins =
349 <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 349 <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_NONE>,
350 <AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_NONE>; 350 <AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
351 }; 351 };
352 352
353 pinctrl_usart1_rts: usart1_rts-0 { 353 pinctrl_usart1_rts: usart1_rts-0 {
@@ -364,8 +364,8 @@
364 usart2 { 364 usart2 {
365 pinctrl_usart2: usart2-0 { 365 pinctrl_usart2: usart2-0 {
366 atmel,pins = 366 atmel,pins =
367 <AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 367 <AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_NONE>,
368 <AT91_PIOC 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; 368 <AT91_PIOC 15 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
369 }; 369 };
370 370
371 pinctrl_usart2_rts: usart2_rts-0 { 371 pinctrl_usart2_rts: usart2_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index f2405671e3bd..87fb0660ab5d 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -437,8 +437,8 @@
437 usart0 { 437 usart0 {
438 pinctrl_usart0: usart0-0 { 438 pinctrl_usart0: usart0-0 {
439 atmel,pins = 439 atmel,pins =
440 <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA26 periph A with pullup */ 440 <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_NONE
441 AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA27 periph A */ 441 AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
442 }; 442 };
443 443
444 pinctrl_usart0_rts: usart0_rts-0 { 444 pinctrl_usart0_rts: usart0_rts-0 {
@@ -455,8 +455,8 @@
455 usart1 { 455 usart1 {
456 pinctrl_usart1: usart1-0 { 456 pinctrl_usart1: usart1-0 {
457 atmel,pins = 457 atmel,pins =
458 <AT91_PIOD 0 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PD0 periph A with pullup */ 458 <AT91_PIOD 0 AT91_PERIPH_A AT91_PINCTRL_NONE
459 AT91_PIOD 1 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD1 periph A */ 459 AT91_PIOD 1 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
460 }; 460 };
461 461
462 pinctrl_usart1_rts: usart1_rts-0 { 462 pinctrl_usart1_rts: usart1_rts-0 {
@@ -473,8 +473,8 @@
473 usart2 { 473 usart2 {
474 pinctrl_usart2: usart2-0 { 474 pinctrl_usart2: usart2-0 {
475 atmel,pins = 475 atmel,pins =
476 <AT91_PIOD 2 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PD2 periph A with pullup */ 476 <AT91_PIOD 2 AT91_PERIPH_A AT91_PINCTRL_NONE
477 AT91_PIOD 3 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD3 periph A */ 477 AT91_PIOD 3 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
478 }; 478 };
479 479
480 pinctrl_usart2_rts: usart2_rts-0 { 480 pinctrl_usart2_rts: usart2_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9263ek.dts b/arch/arm/boot/dts/at91sam9263ek.dts
index e9a7c70830a8..727096f24f7c 100644
--- a/arch/arm/boot/dts/at91sam9263ek.dts
+++ b/arch/arm/boot/dts/at91sam9263ek.dts
@@ -250,7 +250,7 @@
250 status = "okay"; 250 status = "okay";
251 251
252 24c512@50 { 252 24c512@50 {
253 compatible = "24c512"; 253 compatible = "atmel,24c512";
254 reg = <0x50>; 254 reg = <0x50>;
255 pagesize = <128>; 255 pagesize = <128>;
256 }; 256 };
diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
index 50561b7b7939..71df3adfc7ca 100644
--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
+++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
@@ -211,7 +211,7 @@
211 status = "okay"; 211 status = "okay";
212 212
213 24c512@50 { 213 24c512@50 {
214 compatible = "24c512"; 214 compatible = "atmel,24c512";
215 reg = <0x50>; 215 reg = <0x50>;
216 }; 216 };
217 217
diff --git a/arch/arm/boot/dts/at91sam9g25.dtsi b/arch/arm/boot/dts/at91sam9g25.dtsi
index a7da0dd0c98f..0898213f3bb2 100644
--- a/arch/arm/boot/dts/at91sam9g25.dtsi
+++ b/arch/arm/boot/dts/at91sam9g25.dtsi
@@ -21,7 +21,7 @@
21 atmel,mux-mask = < 21 atmel,mux-mask = <
22 /* A B C */ 22 /* A B C */
23 0xffffffff 0xffe0399f 0xc000001c /* pioA */ 23 0xffffffff 0xffe0399f 0xc000001c /* pioA */
24 0x0007ffff 0x8000fe3f 0x00000000 /* pioB */ 24 0x0007ffff 0x00047e3f 0x00000000 /* pioB */
25 0x80000000 0x07c0ffff 0xb83fffff /* pioC */ 25 0x80000000 0x07c0ffff 0xb83fffff /* pioC */
26 0x003fffff 0x003f8000 0x00000000 /* pioD */ 26 0x003fffff 0x003f8000 0x00000000 /* pioD */
27 >; 27 >;
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 3a30eec7f508..1ee25a475be8 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -555,8 +555,8 @@
555 usart0 { 555 usart0 {
556 pinctrl_usart0: usart0-0 { 556 pinctrl_usart0: usart0-0 {
557 atmel,pins = 557 atmel,pins =
558 <AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB19 periph A with pullup */ 558 <AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_NONE
559 AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB18 periph A */ 559 AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
560 }; 560 };
561 561
562 pinctrl_usart0_rts: usart0_rts-0 { 562 pinctrl_usart0_rts: usart0_rts-0 {
@@ -573,8 +573,8 @@
573 uart1 { 573 uart1 {
574 pinctrl_usart1: usart1-0 { 574 pinctrl_usart1: usart1-0 {
575 atmel,pins = 575 atmel,pins =
576 <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB4 periph A with pullup */ 576 <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE
577 AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB5 periph A */ 577 AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
578 }; 578 };
579 579
580 pinctrl_usart1_rts: usart1_rts-0 { 580 pinctrl_usart1_rts: usart1_rts-0 {
@@ -591,8 +591,8 @@
591 usart2 { 591 usart2 {
592 pinctrl_usart2: usart2-0 { 592 pinctrl_usart2: usart2-0 {
593 atmel,pins = 593 atmel,pins =
594 <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB6 periph A with pullup */ 594 <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE
595 AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB7 periph A */ 595 AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
596 }; 596 };
597 597
598 pinctrl_usart2_rts: usart2_rts-0 { 598 pinctrl_usart2_rts: usart2_rts-0 {
@@ -609,8 +609,8 @@
609 usart3 { 609 usart3 {
610 pinctrl_usart3: usart3-0 { 610 pinctrl_usart3: usart3-0 {
611 atmel,pins = 611 atmel,pins =
612 <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB9 periph A with pullup */ 612 <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_NONE
613 AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB8 periph A */ 613 AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
614 }; 614 };
615 615
616 pinctrl_usart3_rts: usart3_rts-0 { 616 pinctrl_usart3_rts: usart3_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 4b62f4f963f6..37cb81f457b5 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -641,8 +641,8 @@
641 uart1 { 641 uart1 {
642 pinctrl_uart1: uart1-0 { 642 pinctrl_uart1: uart1-0 {
643 atmel,pins = 643 atmel,pins =
644 <AT91_PIOC 16 AT91_PERIPH_C AT91_PINCTRL_PULL_UP /* PC17 periph C with pullup */ 644 <AT91_PIOC 16 AT91_PERIPH_C AT91_PINCTRL_NONE
645 AT91_PIOC 17 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC16 periph C */ 645 AT91_PIOC 17 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>;
646 }; 646 };
647 }; 647 };
648 648
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi
index 3cae687dccbd..bd001cca25a4 100644
--- a/arch/arm/boot/dts/at91sam9rl.dtsi
+++ b/arch/arm/boot/dts/at91sam9rl.dtsi
@@ -1,7 +1,8 @@
1/* 1/*
2 * at91sam9rl.dtsi - Device Tree Include file for AT91SAM9RL family SoC 2 * at91sam9rl.dtsi - Device Tree Include file for AT91SAM9RL family SoC
3 * 3 *
4 * Copyright (C) 2014 Alexandre Belloni <alexandre.belloni@free-electrons.com> 4 * Copyright (C) 2014 Microchip
5 * Alexandre Belloni <alexandre.belloni@free-electrons.com>
5 * 6 *
6 * Licensed under GPLv2 or later. 7 * Licensed under GPLv2 or later.
7 */ 8 */
@@ -719,8 +720,8 @@
719 usart1 { 720 usart1 {
720 pinctrl_usart1: usart1-0 { 721 pinctrl_usart1: usart1-0 {
721 atmel,pins = 722 atmel,pins =
722 <AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 723 <AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_NONE>,
723 <AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_NONE>; 724 <AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
724 }; 725 };
725 726
726 pinctrl_usart1_rts: usart1_rts-0 { 727 pinctrl_usart1_rts: usart1_rts-0 {
@@ -742,8 +743,8 @@
742 usart2 { 743 usart2 {
743 pinctrl_usart2: usart2-0 { 744 pinctrl_usart2: usart2-0 {
744 atmel,pins = 745 atmel,pins =
745 <AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 746 <AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_NONE>,
746 <AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_NONE>; 747 <AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
747 }; 748 };
748 749
749 pinctrl_usart2_rts: usart2_rts-0 { 750 pinctrl_usart2_rts: usart2_rts-0 {
@@ -765,8 +766,8 @@
765 usart3 { 766 usart3 {
766 pinctrl_usart3: usart3-0 { 767 pinctrl_usart3: usart3-0 {
767 atmel,pins = 768 atmel,pins =
768 <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>, 769 <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_NONE>,
769 <AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE>; 770 <AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
770 }; 771 };
771 772
772 pinctrl_usart3_rts: usart3_rts-0 { 773 pinctrl_usart3_rts: usart3_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts
index 4bde9f245e61..27d8a1f44233 100644
--- a/arch/arm/boot/dts/at91sam9rlek.dts
+++ b/arch/arm/boot/dts/at91sam9rlek.dts
@@ -1,7 +1,8 @@
1/* 1/*
2 * at91sam9rlek.dts - Device Tree file for Atmel at91sam9rl reference board 2 * at91sam9rlek.dts - Device Tree file for Atmel at91sam9rl reference board
3 * 3 *
4 * Copyright (C) 2014 Alexandre Belloni <alexandre.belloni@free-electrons.com> 4 * Copyright (C) 2014 Microchip
5 * Alexandre Belloni <alexandre.belloni@free-electrons.com>
5 * 6 *
6 * Licensed under GPLv2 only 7 * Licensed under GPLv2 only
7 */ 8 */
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index fee4fe51a97e..a3c3c3128148 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -520,8 +520,8 @@
520 usart0 { 520 usart0 {
521 pinctrl_usart0: usart0-0 { 521 pinctrl_usart0: usart0-0 {
522 atmel,pins = 522 atmel,pins =
523 <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA0 periph A with pullup */ 523 <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE
524 AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA1 periph A */ 524 AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
525 }; 525 };
526 526
527 pinctrl_usart0_rts: usart0_rts-0 { 527 pinctrl_usart0_rts: usart0_rts-0 {
@@ -543,8 +543,8 @@
543 usart1 { 543 usart1 {
544 pinctrl_usart1: usart1-0 { 544 pinctrl_usart1: usart1-0 {
545 atmel,pins = 545 atmel,pins =
546 <AT91_PIOA 5 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA5 periph A with pullup */ 546 <AT91_PIOA 5 AT91_PERIPH_A AT91_PINCTRL_NONE
547 AT91_PIOA 6 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA6 periph A */ 547 AT91_PIOA 6 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
548 }; 548 };
549 549
550 pinctrl_usart1_rts: usart1_rts-0 { 550 pinctrl_usart1_rts: usart1_rts-0 {
@@ -566,8 +566,8 @@
566 usart2 { 566 usart2 {
567 pinctrl_usart2: usart2-0 { 567 pinctrl_usart2: usart2-0 {
568 atmel,pins = 568 atmel,pins =
569 <AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA7 periph A with pullup */ 569 <AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_NONE
570 AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA8 periph A */ 570 AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
571 }; 571 };
572 572
573 pinctrl_usart2_rts: usart2_rts-0 { 573 pinctrl_usart2_rts: usart2_rts-0 {
diff --git a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
index 43bb5b51caa6..a32d12b406a3 100644
--- a/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5_usart3.dtsi
@@ -21,8 +21,8 @@
21 usart3 { 21 usart3 {
22 pinctrl_usart3: usart3-0 { 22 pinctrl_usart3: usart3-0 {
23 atmel,pins = 23 atmel,pins =
24 <AT91_PIOC 22 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* PC22 periph B with pullup */ 24 <AT91_PIOC 22 AT91_PERIPH_B AT91_PINCTRL_NONE
25 AT91_PIOC 23 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC23 periph B */ 25 AT91_PIOC 23 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
26 }; 26 };
27 27
28 pinctrl_usart3_rts: usart3_rts-0 { 28 pinctrl_usart3_rts: usart3_rts-0 {
diff --git a/arch/arm/boot/dts/atlas7-evb.dts b/arch/arm/boot/dts/atlas7-evb.dts
index 1e9cd1a8508e..900e03b7a7b2 100644
--- a/arch/arm/boot/dts/atlas7-evb.dts
+++ b/arch/arm/boot/dts/atlas7-evb.dts
@@ -73,7 +73,7 @@
73 btm { 73 btm {
74 uart6: uart@11000000 { 74 uart6: uart@11000000 {
75 status = "okay"; 75 status = "okay";
76 sirf,uart-has-rtscts; 76 uart-has-rtscts;
77 }; 77 };
78 }; 78 };
79 79
diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
index 897103e0a79b..0d9ff12bdf28 100644
--- a/arch/arm/boot/dts/axp209.dtsi
+++ b/arch/arm/boot/dts/axp209.dtsi
@@ -58,6 +58,11 @@
58 status = "disabled"; 58 status = "disabled";
59 }; 59 };
60 60
61 axp_adc: adc {
62 compatible = "x-powers,axp209-adc";
63 #io-channel-cells = <1>;
64 };
65
61 axp_gpio: gpio { 66 axp_gpio: gpio {
62 compatible = "x-powers,axp209-gpio"; 67 compatible = "x-powers,axp209-gpio";
63 gpio-controller; 68 gpio-controller;
diff --git a/arch/arm/boot/dts/axp22x.dtsi b/arch/arm/boot/dts/axp22x.dtsi
index 87fb08e812ec..65a07a67aca9 100644
--- a/arch/arm/boot/dts/axp22x.dtsi
+++ b/arch/arm/boot/dts/axp22x.dtsi
@@ -57,6 +57,11 @@
57 status = "disabled"; 57 status = "disabled";
58 }; 58 };
59 59
60 axp_adc: adc {
61 compatible = "x-powers,axp221-adc";
62 #io-channel-cells = <1>;
63 };
64
60 battery_power_supply: battery-power-supply { 65 battery_power_supply: battery-power-supply {
61 compatible = "x-powers,axp221-battery-power-supply"; 66 compatible = "x-powers,axp221-battery-power-supply";
62 status = "disabled"; 67 status = "disabled";
diff --git a/arch/arm/boot/dts/axp81x.dtsi b/arch/arm/boot/dts/axp81x.dtsi
index fd55b896afa1..043c717dcef1 100644
--- a/arch/arm/boot/dts/axp81x.dtsi
+++ b/arch/arm/boot/dts/axp81x.dtsi
@@ -48,7 +48,12 @@
48 interrupt-controller; 48 interrupt-controller;
49 #interrupt-cells = <1>; 49 #interrupt-cells = <1>;
50 50
51 axp_gpio: axp-gpio { 51 axp_adc: adc {
52 compatible = "x-powers,axp813-adc";
53 #io-channel-cells = <1>;
54 };
55
56 axp_gpio: gpio {
52 compatible = "x-powers,axp813-gpio"; 57 compatible = "x-powers,axp813-gpio";
53 gpio-controller; 58 gpio-controller;
54 #gpio-cells = <2>; 59 #gpio-cells = <2>;
@@ -64,6 +69,11 @@
64 }; 69 };
65 }; 70 };
66 71
72 battery_power_supply: battery-power-supply {
73 compatible = "x-powers,axp813-battery-power-supply";
74 status = "disabled";
75 };
76
67 regulators { 77 regulators {
68 /* Default work frequency for buck regulators */ 78 /* Default work frequency for buck regulators */
69 x-powers,dcdc-freq = <3000>; 79 x-powers,dcdc-freq = <3000>;
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 18045c38bcf1..db7cded1b7ad 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -55,7 +55,7 @@
55 <0x3ff00100 0x100>; 55 <0x3ff00100 0x100>;
56 }; 56 };
57 57
58 smc@0x3404c000 { 58 smc@3404c000 {
59 compatible = "brcm,bcm11351-smc", "brcm,kona-smc"; 59 compatible = "brcm,bcm11351-smc", "brcm,kona-smc";
60 reg = <0x3404c000 0x400>; /* 1 KiB in SRAM */ 60 reg = <0x3404c000 0x400>; /* 1 KiB in SRAM */
61 }; 61 };
diff --git a/arch/arm/boot/dts/bcm21664.dtsi b/arch/arm/boot/dts/bcm21664.dtsi
index 6dde95f21cef..266f2611dc22 100644
--- a/arch/arm/boot/dts/bcm21664.dtsi
+++ b/arch/arm/boot/dts/bcm21664.dtsi
@@ -55,7 +55,7 @@
55 <0x3ff00100 0x100>; 55 <0x3ff00100 0x100>;
56 }; 56 };
57 57
58 smc@0x3404e000 { 58 smc@3404e000 {
59 compatible = "brcm,bcm21664-smc", "brcm,kona-smc"; 59 compatible = "brcm,bcm21664-smc", "brcm,kona-smc";
60 reg = <0x3404e000 0x400>; /* 1 KiB in SRAM */ 60 reg = <0x3404e000 0x400>; /* 1 KiB in SRAM */
61 }; 61 };
diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
index b8565fc33eea..b7f79f1c431a 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
@@ -12,7 +12,7 @@
12/dts-v1/; 12/dts-v1/;
13#include "bcm2835.dtsi" 13#include "bcm2835.dtsi"
14#include "bcm2835-rpi.dtsi" 14#include "bcm2835-rpi.dtsi"
15#include "bcm283x-rpi-usb-host.dtsi" 15#include "bcm283x-rpi-usb-otg.dtsi"
16 16
17/ { 17/ {
18 compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; 18 compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
@@ -131,6 +131,18 @@
131 131
132&uart0 { 132&uart0 {
133 pinctrl-names = "default"; 133 pinctrl-names = "default";
134 pinctrl-0 = <&uart0_gpio14>; 134 pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>;
135 status = "okay";
136
137 bluetooth {
138 compatible = "brcm,bcm43438-bt";
139 max-speed = <2000000>;
140 shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
141 };
142};
143
144&uart1 {
145 pinctrl-names = "default";
146 pinctrl-0 = <&uart1_gpio14>;
135 status = "okay"; 147 status = "okay";
136}; 148};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index e36c392a2b8f..0198bd46ef7c 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -18,7 +18,9 @@
18 18
19 soc { 19 soc {
20 firmware: firmware { 20 firmware: firmware {
21 compatible = "raspberrypi,bcm2835-firmware"; 21 compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
22 #address-cells = <0>;
23 #size-cells = <0>;
22 mboxes = <&mailbox>; 24 mboxes = <&mailbox>;
23 }; 25 };
24 26
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 0e3d2a5ff208..a5c3824c8056 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -18,10 +18,10 @@
18 soc { 18 soc {
19 ranges = <0x7e000000 0x20000000 0x02000000>; 19 ranges = <0x7e000000 0x20000000 0x02000000>;
20 dma-ranges = <0x40000000 0x00000000 0x20000000>; 20 dma-ranges = <0x40000000 0x00000000 0x20000000>;
21 };
21 22
22 arm-pmu { 23 arm-pmu {
23 compatible = "arm,arm1176-pmu"; 24 compatible = "arm,arm1176-pmu";
24 };
25 }; 25 };
26}; 26};
27 27
diff --git a/arch/arm/boot/dts/bcm2836.dtsi b/arch/arm/boot/dts/bcm2836.dtsi
index 1dfd76442777..c933e8413884 100644
--- a/arch/arm/boot/dts/bcm2836.dtsi
+++ b/arch/arm/boot/dts/bcm2836.dtsi
@@ -9,19 +9,19 @@
9 <0x40000000 0x40000000 0x00001000>; 9 <0x40000000 0x40000000 0x00001000>;
10 dma-ranges = <0xc0000000 0x00000000 0x3f000000>; 10 dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
11 11
12 local_intc: local_intc { 12 local_intc: local_intc@40000000 {
13 compatible = "brcm,bcm2836-l1-intc"; 13 compatible = "brcm,bcm2836-l1-intc";
14 reg = <0x40000000 0x100>; 14 reg = <0x40000000 0x100>;
15 interrupt-controller; 15 interrupt-controller;
16 #interrupt-cells = <2>; 16 #interrupt-cells = <2>;
17 interrupt-parent = <&local_intc>; 17 interrupt-parent = <&local_intc>;
18 }; 18 };
19 };
19 20
20 arm-pmu { 21 arm-pmu {
21 compatible = "arm,cortex-a7-pmu"; 22 compatible = "arm,cortex-a7-pmu";
22 interrupt-parent = <&local_intc>; 23 interrupt-parent = <&local_intc>;
23 interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; 24 interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
24 };
25 }; 25 };
26 26
27 timer { 27 timer {
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
index 3e4ed7c5b0b3..0b31d995a066 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@@ -25,6 +25,23 @@
25 }; 25 };
26}; 26};
27 27
28&firmware {
29 expgpio: gpio {
30 compatible = "raspberrypi,firmware-gpio";
31 gpio-controller;
32 #gpio-cells = <2>;
33 gpio-line-names = "BT_ON",
34 "WL_ON",
35 "STATUS_LED",
36 "LAN_RUN",
37 "HPD_N",
38 "CAM_GPIO0",
39 "CAM_GPIO1",
40 "PWR_LOW_N";
41 status = "okay";
42 };
43};
44
28/* uart0 communicates with the BT module */ 45/* uart0 communicates with the BT module */
29&uart0 { 46&uart0 {
30 pinctrl-names = "default"; 47 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
index efa7d3387ab2..7704bb029605 100644
--- a/arch/arm/boot/dts/bcm2837.dtsi
+++ b/arch/arm/boot/dts/bcm2837.dtsi
@@ -8,7 +8,7 @@
8 <0x40000000 0x40000000 0x00001000>; 8 <0x40000000 0x40000000 0x00001000>;
9 dma-ranges = <0xc0000000 0x00000000 0x3f000000>; 9 dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
10 10
11 local_intc: local_intc { 11 local_intc: local_intc@40000000 {
12 compatible = "brcm,bcm2836-l1-intc"; 12 compatible = "brcm,bcm2836-l1-intc";
13 reg = <0x40000000 0x100>; 13 reg = <0x40000000 0x100>;
14 interrupt-controller; 14 interrupt-controller;
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 18db25a5a66e..ac00e730f898 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -223,6 +223,7 @@
223 gpclk2_gpio43: gpclk2_gpio43 { 223 gpclk2_gpio43: gpclk2_gpio43 {
224 brcm,pins = <43>; 224 brcm,pins = <43>;
225 brcm,function = <BCM2835_FSEL_ALT0>; 225 brcm,function = <BCM2835_FSEL_ALT0>;
226 brcm,pull = <BCM2835_PUD_OFF>;
226 }; 227 };
227 228
228 i2c0_gpio0: i2c0_gpio0 { 229 i2c0_gpio0: i2c0_gpio0 {
@@ -252,7 +253,7 @@
252 253
253 jtag_gpio4: jtag_gpio4 { 254 jtag_gpio4: jtag_gpio4 {
254 brcm,pins = <4 5 6 12 13>; 255 brcm,pins = <4 5 6 12 13>;
255 brcm,function = <BCM2835_FSEL_ALT4>; 256 brcm,function = <BCM2835_FSEL_ALT5>;
256 }; 257 };
257 jtag_gpio22: jtag_gpio22 { 258 jtag_gpio22: jtag_gpio22 {
258 brcm,pins = <22 23 24 25 26 27>; 259 brcm,pins = <22 23 24 25 26 27>;
@@ -335,10 +336,12 @@
335 uart0_ctsrts_gpio30: uart0_ctsrts_gpio30 { 336 uart0_ctsrts_gpio30: uart0_ctsrts_gpio30 {
336 brcm,pins = <30 31>; 337 brcm,pins = <30 31>;
337 brcm,function = <BCM2835_FSEL_ALT3>; 338 brcm,function = <BCM2835_FSEL_ALT3>;
339 brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_OFF>;
338 }; 340 };
339 uart0_gpio32: uart0_gpio32 { 341 uart0_gpio32: uart0_gpio32 {
340 brcm,pins = <32 33>; 342 brcm,pins = <32 33>;
341 brcm,function = <BCM2835_FSEL_ALT3>; 343 brcm,function = <BCM2835_FSEL_ALT3>;
344 brcm,pull = <BCM2835_PUD_OFF BCM2835_PUD_UP>;
342 }; 345 };
343 uart0_gpio36: uart0_gpio36 { 346 uart0_gpio36: uart0_gpio36 {
344 brcm,pins = <36 37>; 347 brcm,pins = <36 37>;
@@ -397,8 +400,8 @@
397 400
398 i2s: i2s@7e203000 { 401 i2s: i2s@7e203000 {
399 compatible = "brcm,bcm2835-i2s"; 402 compatible = "brcm,bcm2835-i2s";
400 reg = <0x7e203000 0x20>, 403 reg = <0x7e203000 0x24>;
401 <0x7e101098 0x02>; 404 clocks = <&clocks BCM2835_CLOCK_PCM>;
402 405
403 dmas = <&dma 2>, 406 dmas = <&dma 2>,
404 <&dma 3>; 407 <&dma 3>;
@@ -438,6 +441,17 @@
438 interrupts = <2 14>; /* pwa1 */ 441 interrupts = <2 14>; /* pwa1 */
439 }; 442 };
440 443
444 dpi: dpi@7e208000 {
445 compatible = "brcm,bcm2835-dpi";
446 reg = <0x7e208000 0x8c>;
447 clocks = <&clocks BCM2835_CLOCK_VPU>,
448 <&clocks BCM2835_CLOCK_DPI>;
449 clock-names = "core", "pixel";
450 #address-cells = <1>;
451 #size-cells = <0>;
452 status = "disabled";
453 };
454
441 dsi0: dsi@7e209000 { 455 dsi0: dsi@7e209000 {
442 compatible = "brcm,bcm2835-dsi0"; 456 compatible = "brcm,bcm2835-dsi0";
443 reg = <0x7e209000 0x78>; 457 reg = <0x7e209000 0x78>;
@@ -465,7 +479,7 @@
465 status = "disabled"; 479 status = "disabled";
466 }; 480 };
467 481
468 aux: aux@0x7e215000 { 482 aux: aux@7e215000 {
469 compatible = "brcm,bcm2835-aux"; 483 compatible = "brcm,bcm2835-aux";
470 #clock-cells = <1>; 484 #clock-cells = <1>;
471 reg = <0x7e215000 0x8>; 485 reg = <0x7e215000 0x8>;
diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
index 8bef6429feee..87ea6ba664f5 100644
--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
+++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
@@ -35,6 +35,74 @@
35 0x88000000 0x08000000>; 35 0x88000000 0x08000000>;
36 }; 36 };
37 37
38 spi {
39 compatible = "spi-gpio";
40 num-chipselects = <1>;
41 gpio-sck = <&chipcommon 7 0>;
42 gpio-mosi = <&chipcommon 4 0>;
43 cs-gpios = <&chipcommon 6 0>;
44 #address-cells = <1>;
45 #size-cells = <0>;
46
47 hc595: gpio_spi@0 {
48 compatible = "fairchild,74hc595";
49 reg = <0>;
50 registers-number = <1>;
51 spi-max-frequency = <100000>;
52
53 gpio-controller;
54 #gpio-cells = <2>;
55
56 };
57 };
58
59 leds {
60 compatible = "gpio-leds";
61
62 usb {
63 label = "bcm53xx:green:usb";
64 gpios = <&hc595 0 GPIO_ACTIVE_HIGH>;
65 };
66
67 power0 {
68 label = "bcm53xx:green:power";
69 gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
70 linux,default-trigger = "default-on";
71 };
72
73 power1 {
74 label = "bcm53xx:red:power";
75 gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
76 };
77
78 router0 {
79 label = "bcm53xx:green:router";
80 gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
81 linux,default-trigger = "default-on";
82 };
83
84 router1 {
85 label = "bcm53xx:amber:router";
86 gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
87 };
88
89 wan {
90 label = "bcm53xx:green:wan";
91 gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
92 linux,default-trigger = "default-on";
93 };
94
95 wireless0 {
96 label = "bcm53xx:green:wireless";
97 gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
98 };
99
100 wireless1 {
101 label = "bcm53xx:amber:wireless";
102 gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
103 };
104 };
105
38 gpio-keys { 106 gpio-keys {
39 compatible = "gpio-keys"; 107 compatible = "gpio-keys";
40 #address-cells = <1>; 108 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/bcm958622hr.dts b/arch/arm/boot/dts/bcm958622hr.dts
index fd8b8c689ffe..ecd05e26c262 100644
--- a/arch/arm/boot/dts/bcm958622hr.dts
+++ b/arch/arm/boot/dts/bcm958622hr.dts
@@ -204,10 +204,10 @@
204 reg = <4>; 204 reg = <4>;
205 }; 205 };
206 206
207 port@5 { 207 port@8 {
208 ethernet = <&amac0>; 208 ethernet = <&amac2>;
209 label = "cpu"; 209 label = "cpu";
210 reg = <5>; 210 reg = <8>;
211 fixed-link { 211 fixed-link {
212 speed = <1000>; 212 speed = <1000>;
213 full-duplex; 213 full-duplex;
diff --git a/arch/arm/boot/dts/bcm958623hr.dts b/arch/arm/boot/dts/bcm958623hr.dts
index b8bde13de90a..f5e85b301497 100644
--- a/arch/arm/boot/dts/bcm958623hr.dts
+++ b/arch/arm/boot/dts/bcm958623hr.dts
@@ -208,10 +208,10 @@
208 reg = <4>; 208 reg = <4>;
209 }; 209 };
210 210
211 port@5 { 211 port@8 {
212 ethernet = <&amac0>; 212 ethernet = <&amac2>;
213 label = "cpu"; 213 label = "cpu";
214 reg = <5>; 214 reg = <8>;
215 fixed-link { 215 fixed-link {
216 speed = <1000>; 216 speed = <1000>;
217 full-duplex; 217 full-duplex;
diff --git a/arch/arm/boot/dts/bcm958625hr.dts b/arch/arm/boot/dts/bcm958625hr.dts
index 6a44b8021702..ea3fc194f8f3 100644
--- a/arch/arm/boot/dts/bcm958625hr.dts
+++ b/arch/arm/boot/dts/bcm958625hr.dts
@@ -49,7 +49,7 @@
49 49
50 memory { 50 memory {
51 device_type = "memory"; 51 device_type = "memory";
52 reg = <0x60000000 0x80000000>; 52 reg = <0x60000000 0x20000000>;
53 }; 53 };
54 54
55 gpio-restart { 55 gpio-restart {
@@ -210,10 +210,10 @@
210 reg = <4>; 210 reg = <4>;
211 }; 211 };
212 212
213 port@5 { 213 port@8 {
214 ethernet = <&amac0>; 214 ethernet = <&amac2>;
215 label = "cpu"; 215 label = "cpu";
216 reg = <5>; 216 reg = <8>;
217 fixed-link { 217 fixed-link {
218 speed = <1000>; 218 speed = <1000>;
219 full-duplex; 219 full-duplex;
diff --git a/arch/arm/boot/dts/bcm958625k.dts b/arch/arm/boot/dts/bcm958625k.dts
index 2cf2392483b2..3ea5f739e90b 100644
--- a/arch/arm/boot/dts/bcm958625k.dts
+++ b/arch/arm/boot/dts/bcm958625k.dts
@@ -245,10 +245,10 @@
245 reg = <4>; 245 reg = <4>;
246 }; 246 };
247 247
248 port@5 { 248 port@8 {
249 ethernet = <&amac0>; 249 ethernet = <&amac2>;
250 label = "cpu"; 250 label = "cpu";
251 reg = <5>; 251 reg = <8>;
252 fixed-link { 252 fixed-link {
253 speed = <1000>; 253 speed = <1000>;
254 full-duplex; 254 full-duplex;
diff --git a/arch/arm/boot/dts/bcm988312hr.dts b/arch/arm/boot/dts/bcm988312hr.dts
index bce251a68591..ea9a0806b446 100644
--- a/arch/arm/boot/dts/bcm988312hr.dts
+++ b/arch/arm/boot/dts/bcm988312hr.dts
@@ -216,10 +216,10 @@
216 reg = <4>; 216 reg = <4>;
217 }; 217 };
218 218
219 port@5 { 219 port@8 {
220 ethernet = <&amac0>; 220 ethernet = <&amac2>;
221 label = "cpu"; 221 label = "cpu";
222 reg = <5>; 222 reg = <8>;
223 fixed-link { 223 fixed-link {
224 speed = <1000>; 224 speed = <1000>;
225 full-duplex; 225 full-duplex;
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index c75507922f7d..3962fa4b07f5 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -15,11 +15,16 @@
15 compatible = "ti,da850-evm", "ti,da850"; 15 compatible = "ti,da850-evm", "ti,da850";
16 model = "DA850/AM1808/OMAP-L138 EVM"; 16 model = "DA850/AM1808/OMAP-L138 EVM";
17 17
18 chosen {
19 stdout-path = &serial2;
20 };
21
18 aliases { 22 aliases {
19 serial0 = &serial0; 23 serial0 = &serial0;
20 serial1 = &serial1; 24 serial1 = &serial1;
21 serial2 = &serial2; 25 serial2 = &serial2;
22 ethernet0 = &eth0; 26 ethernet0 = &eth0;
27 spi0 = &spi1;
23 }; 28 };
24 29
25 soc@1c00000 { 30 soc@1c00000 {
diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts
index 81942ae83e1f..1ffd87796cac 100644
--- a/arch/arm/boot/dts/da850-lego-ev3.dts
+++ b/arch/arm/boot/dts/da850-lego-ev3.dts
@@ -184,6 +184,23 @@
184 io-channel-names = "voltage", "current"; 184 io-channel-names = "voltage", "current";
185 rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>; 185 rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
186 }; 186 };
187
188 /* ARM local RAM */
189 memory@ffff0000 {
190 compatible = "syscon", "simple-mfd";
191 reg = <0xffff0000 0x2000>; /* 8k */
192
193 /*
194 * The I2C bootloader looks for this magic value to either
195 * boot normally or boot into a firmware update mode.
196 */
197 reboot-mode {
198 compatible = "syscon-reboot-mode";
199 offset = <0x1ffc>;
200 mode-normal = <0x00000000>;
201 mode-loader = <0x5555aaaa>;
202 };
203 };
187}; 204};
188 205
189&pmx_core { 206&pmx_core {
@@ -293,7 +310,7 @@
293 * EEPROM contains the first stage bootloader, HW ID and Bluetooth MAC. 310 * EEPROM contains the first stage bootloader, HW ID and Bluetooth MAC.
294 */ 311 */
295 eeprom@50 { 312 eeprom@50 {
296 compatible = "microchip,24c128"; 313 compatible = "microchip,24c128", "atmel,24c128";
297 pagesize = <64>; 314 pagesize = <64>;
298 read-only; 315 read-only;
299 reg = <0x50>; 316 reg = <0x50>;
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index a7385c338ee9..f1425b0f3a54 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -87,33 +87,6 @@
87 DRA7XX_CORE_IOPAD(0x3818, MUX_MODE15 | PULL_UP) /* wakeup0.off */ 87 DRA7XX_CORE_IOPAD(0x3818, MUX_MODE15 | PULL_UP) /* wakeup0.off */
88 >; 88 >;
89 }; 89 };
90
91 mmc1_pins_default: mmc1_pins_default {
92 pinctrl-single,pins = <
93 DRA7XX_CORE_IOPAD(0x376c, PIN_INPUT | MUX_MODE14) /* mmc1sdcd.gpio219 */
94 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */
95 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
96 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
97 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
98 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
99 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
100 >;
101 };
102
103 mmc2_pins_default: mmc2_pins_default {
104 pinctrl-single,pins = <
105 DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */
106 DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */
107 DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */
108 DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */
109 DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */
110 DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */
111 DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */
112 DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */
113 DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */
114 DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */
115 >;
116 };
117}; 90};
118 91
119&i2c1 { 92&i2c1 {
@@ -350,6 +323,7 @@
350&mmc2 { 323&mmc2 {
351 status = "okay"; 324 status = "okay";
352 vmmc-supply = <&evm_1v8_sw>; 325 vmmc-supply = <&evm_1v8_sw>;
326 vqmmc-supply = <&evm_1v8_sw>;
353 bus-width = <8>; 327 bus-width = <8>;
354 pinctrl-names = "default", "hs", "ddr_1_8v-rev11", "ddr_1_8v", "hs200_1_8v-rev11", "hs200_1_8v"; 328 pinctrl-names = "default", "hs", "ddr_1_8v-rev11", "ddr_1_8v", "hs200_1_8v-rev11", "hs200_1_8v";
355 pinctrl-0 = <&mmc2_pins_default>; 329 pinctrl-0 = <&mmc2_pins_default>;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index e4a420f16800..f4ddd86f2c77 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -92,8 +92,6 @@
92 clock-latency = <300000>; /* From omap-cpufreq driver */ 92 clock-latency = <300000>; /* From omap-cpufreq driver */
93 93
94 /* cooling options */ 94 /* cooling options */
95 cooling-min-level = <0>;
96 cooling-max-level = <2>;
97 #cooling-cells = <2>; /* min followed by max */ 95 #cooling-cells = <2>; /* min followed by max */
98 96
99 vbb-supply = <&abb_mpu>; 97 vbb-supply = <&abb_mpu>;
diff --git a/arch/arm/boot/dts/dra71-evm.dts b/arch/arm/boot/dts/dra71-evm.dts
index 41c9132eb550..ebc4bbae981e 100644
--- a/arch/arm/boot/dts/dra71-evm.dts
+++ b/arch/arm/boot/dts/dra71-evm.dts
@@ -24,13 +24,13 @@
24 24
25 regulator-name = "vddshv8"; 25 regulator-name = "vddshv8";
26 regulator-min-microvolt = <1800000>; 26 regulator-min-microvolt = <1800000>;
27 regulator-max-microvolt = <3000000>; 27 regulator-max-microvolt = <3300000>;
28 regulator-boot-on; 28 regulator-boot-on;
29 vin-supply = <&evm_5v0>; 29 vin-supply = <&evm_5v0>;
30 30
31 gpios = <&gpio7 11 GPIO_ACTIVE_HIGH>; 31 gpios = <&gpio7 11 GPIO_ACTIVE_HIGH>;
32 states = <1800000 0x0 32 states = <1800000 0x0
33 3000000 0x1>; 33 3300000 0x1>;
34 }; 34 };
35 35
36 evm_1v8_sw: fixedregulator-evm_1v8 { 36 evm_1v8_sw: fixedregulator-evm_1v8 {
@@ -50,6 +50,19 @@
50 }; 50 };
51}; 51};
52 52
53&dra7_pmx_core {
54 mmc1_pins_default: mmc1_pins_default {
55 pinctrl-single,pins = <
56 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mmc1_clk.clk */
57 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
58 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
59 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
60 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
61 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
62 >;
63 };
64};
65
53&i2c1 { 66&i2c1 {
54 status = "okay"; 67 status = "okay";
55 clock-frequency = <400000>; 68 clock-frequency = <400000>;
diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts
index c4fe7f8ef72a..2deb96405d06 100644
--- a/arch/arm/boot/dts/dra76-evm.dts
+++ b/arch/arm/boot/dts/dra76-evm.dts
@@ -9,6 +9,7 @@
9 9
10#include "dra76x.dtsi" 10#include "dra76x.dtsi"
11#include "dra7-evm-common.dtsi" 11#include "dra7-evm-common.dtsi"
12#include "dra76x-mmc-iodelay.dtsi"
12#include <dt-bindings/net/ti-dp83867.h> 13#include <dt-bindings/net/ti-dp83867.h>
13 14
14/ { 15/ {
@@ -100,46 +101,6 @@
100 }; 101 };
101}; 102};
102 103
103&dra7_pmx_core {
104 mmc1_pins_default: mmc1_pins_default {
105 pinctrl-single,pins = <
106 DRA7XX_CORE_IOPAD(0x376c, PIN_INPUT | MUX_MODE14) /* mmc1sdcd.gpio219 */
107 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */
108 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
109 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
110 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
111 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
112 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
113 >;
114 };
115
116 mmc1_pins_sdr12: pinmux_mmc1_sdr12_pins {
117 pinctrl-single,pins = <
118 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */
119 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
120 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
121 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
122 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
123 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
124 >;
125 };
126
127 mmc2_pins_default: mmc2_pins_default {
128 pinctrl-single,pins = <
129 DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */
130 DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */
131 DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */
132 DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */
133 DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */
134 DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */
135 DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */
136 DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */
137 DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */
138 DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */
139 >;
140 };
141};
142
143&i2c1 { 104&i2c1 {
144 status = "okay"; 105 status = "okay";
145 clock-frequency = <400000>; 106 clock-frequency = <400000>;
@@ -353,16 +314,21 @@
353 * is always hardwired. 314 * is always hardwired.
354 */ 315 */
355 cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; 316 cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>;
356 pinctrl-names = "default"; 317 pinctrl-names = "default", "hs";
357 pinctrl-0 = <&mmc1_pins_default>; 318 pinctrl-0 = <&mmc1_pins_default>;
319 pinctrl-1 = <&mmc1_pins_hs>;
358}; 320};
359 321
360&mmc2 { 322&mmc2 {
361 status = "okay"; 323 status = "okay";
362 vmmc-supply = <&vio_1v8>; 324 vmmc-supply = <&vio_1v8>;
325 vqmmc-supply = <&vio_1v8>;
363 bus-width = <8>; 326 bus-width = <8>;
364 pinctrl-names = "default"; 327 pinctrl-names = "default", "hs", "ddr_1_8v", "hs200_1_8v";
365 pinctrl-0 = <&mmc2_pins_default>; 328 pinctrl-0 = <&mmc2_pins_default>;
329 pinctrl-1 = <&mmc2_pins_default>;
330 pinctrl-2 = <&mmc2_pins_default>;
331 pinctrl-3 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_conf>;
366}; 332};
367 333
368/* No RTC on this device */ 334/* No RTC on this device */
diff --git a/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi b/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi
new file mode 100644
index 000000000000..baba7b00eca7
--- /dev/null
+++ b/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi
@@ -0,0 +1,285 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2018 Texas Instruments
3// MMC IOdelay values for TI's DRA76x and AM576x SoCs.
4// Author: Sekhar Nori <nsekhar@ti.com>
5
6/*
7 * Rules for modifying this file:
8 * a) Update of this file should typically correspond to a datamanual revision.
9 * Datamanual revision that was used should be updated in comment below.
10 * If there is no update to datamanual, do not update the values. If you
11 * need to use values different from that recommended by the datamanual
12 * for your design, then you should consider adding values to the device-
13 * -tree file for your board directly.
14 * b) We keep the mode names as close to the datamanual as possible. So
15 * if the manual calls a mode, DDR50, or DDR or DDR 1.8v or DDR 3.3v,
16 * we follow that in code too.
17 * c) If the values change between multiple revisions of silicon, we add
18 * a revision tag to both the new and old entry. Use 'rev11' for PG 1.1,
19 * 'rev20' for PG 2.0 and so on.
20 * d) The node name and node label should be the exact same string. This is
21 * to curb naming creativity and achieve consistency.
22 *
23 * Datamanual Revisions:
24 *
25 * DRA76x Silicon Revision 1.0: SPRS993A, Revised July 2017
26 *
27 */
28
29&dra7_pmx_core {
30 mmc1_pins_default: mmc1_pins_default {
31 pinctrl-single,pins = <
32 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */
33 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */
34 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */
35 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */
36 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */
37 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */
38 >;
39 };
40
41 mmc1_pins_hs: mmc1_pins_hs {
42 pinctrl-single,pins = <
43 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_clk.clk */
44 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_cmd.cmd */
45 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat0.dat0 */
46 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat1.dat1 */
47 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat2.dat2 */
48 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat3.dat3 */
49 >;
50 };
51
52 mmc1_pins_sdr50: mmc1_pins_sdr50 {
53 pinctrl-single,pins = <
54 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_clk.clk */
55 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_cmd.cmd */
56 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat0.dat0 */
57 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat1.dat1 */
58 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat2.dat2 */
59 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat3.dat3 */
60 >;
61 };
62
63 mmc1_pins_ddr50: mmc1_pins_ddr50 {
64 pinctrl-single,pins = <
65 DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_clk.clk */
66 DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_cmd.cmd */
67 DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat0.dat0 */
68 DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat1.dat1 */
69 DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat2.dat2 */
70 DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat3.dat3 */
71 >;
72 };
73
74 mmc2_pins_default: mmc2_pins_default {
75 pinctrl-single,pins = <
76 DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */
77 DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */
78 DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */
79 DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */
80 DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */
81 DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */
82 DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */
83 DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */
84 DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */
85 DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */
86 >;
87 };
88
89 mmc2_pins_hs200: mmc2_pins_hs200 {
90 pinctrl-single,pins = <
91 DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */
92 DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */
93 DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */
94 DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */
95 DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */
96 DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */
97 DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */
98 DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */
99 DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */
100 DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */
101 >;
102 };
103
104 mmc3_pins_default: mmc3_pins_default {
105 pinctrl-single,pins = <
106 DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_clk.mmc3_clk */
107 DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */
108 DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */
109 DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */
110 DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */
111 DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */
112 >;
113 };
114
115 mmc4_pins_hs: mmc4_pins_hs {
116 pinctrl-single,pins = <
117 DRA7XX_CORE_IOPAD(0x37e8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_ctsn.mmc4_clk */
118 DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */
119 DRA7XX_CORE_IOPAD(0x37f0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */
120 DRA7XX_CORE_IOPAD(0x37f4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_txd.mmc4_dat1 */
121 DRA7XX_CORE_IOPAD(0x37f8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */
122 DRA7XX_CORE_IOPAD(0x37fc, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */
123 >;
124 };
125};
126
127&dra7_iodelay_core {
128
129 /* Corresponds to MMC1_DDR_MANUAL1 in datamanual */
130 mmc1_iodelay_ddr_conf: mmc1_iodelay_ddr_conf {
131 pinctrl-pin-array = <
132 0x618 A_DELAY_PS(489) G_DELAY_PS(0) /* CFG_MMC1_CLK_IN */
133 0x624 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_IN */
134 0x630 A_DELAY_PS(374) G_DELAY_PS(0) /* CFG_MMC1_DAT0_IN */
135 0x63c A_DELAY_PS(31) G_DELAY_PS(0) /* CFG_MMC1_DAT1_IN */
136 0x648 A_DELAY_PS(56) G_DELAY_PS(0) /* CFG_MMC1_DAT2_IN */
137 0x654 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_IN */
138 0x620 A_DELAY_PS(1355) G_DELAY_PS(0) /* CFG_MMC1_CLK_OUT */
139 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */
140 0x62c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */
141 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */
142 0x638 A_DELAY_PS(0) G_DELAY_PS(4) /* CFG_MMC1_DAT0_OUT */
143 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */
144 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */
145 0x64c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */
146 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */
147 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */
148 0x65c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */
149 >;
150 };
151
152 /* Corresponds to MMC1_SDR104_MANUAL1 in datamanual */
153 mmc1_iodelay_sdr104_conf: mmc1_iodelay_sdr104_conf {
154 pinctrl-pin-array = <
155 0x620 A_DELAY_PS(892) G_DELAY_PS(0) /* CFG_MMC1_CLK_OUT */
156 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */
157 0x62c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */
158 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */
159 0x638 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */
160 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */
161 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */
162 0x64c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */
163 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */
164 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */
165 0x65c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */
166 >;
167 };
168
169 /* Corresponds to MMC2_HS200_MANUAL1 in datamanual */
170 mmc2_iodelay_hs200_conf: mmc2_iodelay_hs200_conf {
171 pinctrl-pin-array = <
172 0x190 A_DELAY_PS(384) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */
173 0x194 A_DELAY_PS(0) G_DELAY_PS(174) /* CFG_GPMC_A19_OUT */
174 0x1a8 A_DELAY_PS(410) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */
175 0x1ac A_DELAY_PS(85) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */
176 0x1b4 A_DELAY_PS(468) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */
177 0x1b8 A_DELAY_PS(139) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */
178 0x1c0 A_DELAY_PS(676) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */
179 0x1c4 A_DELAY_PS(69) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */
180 0x1d0 A_DELAY_PS(1062) G_DELAY_PS(154) /* CFG_GPMC_A23_OUT */
181 0x1d8 A_DELAY_PS(640) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */
182 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */
183 0x1e4 A_DELAY_PS(356) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */
184 0x1e8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */
185 0x1f0 A_DELAY_PS(579) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */
186 0x1f4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */
187 0x1fc A_DELAY_PS(435) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */
188 0x200 A_DELAY_PS(36) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */
189 0x364 A_DELAY_PS(759) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */
190 0x368 A_DELAY_PS(72) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */
191 >;
192 };
193
194 /* Corresponds to MMC3_MANUAL1 in datamanual */
195 mmc3_iodelay_manual1_conf: mmc3_iodelay_manual1_conf {
196 pinctrl-pin-array = <
197 0x678 A_DELAY_PS(0) G_DELAY_PS(386) /* CFG_MMC3_CLK_IN */
198 0x680 A_DELAY_PS(605) G_DELAY_PS(0) /* CFG_MMC3_CLK_OUT */
199 0x684 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_IN */
200 0x688 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OEN */
201 0x68c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OUT */
202 0x690 A_DELAY_PS(171) G_DELAY_PS(0) /* CFG_MMC3_DAT0_IN */
203 0x694 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OEN */
204 0x698 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OUT */
205 0x69c A_DELAY_PS(221) G_DELAY_PS(0) /* CFG_MMC3_DAT1_IN */
206 0x6a0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OEN */
207 0x6a4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OUT */
208 0x6a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_IN */
209 0x6ac A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OEN */
210 0x6b0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OUT */
211 0x6b4 A_DELAY_PS(474) G_DELAY_PS(0) /* CFG_MMC3_DAT3_IN */
212 0x6b8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OEN */
213 0x6bc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OUT */
214 >;
215 };
216
217 /* Corresponds to MMC3_MANUAL2 in datamanual */
218 mmc3_iodelay_sdr50_conf: mmc3_iodelay_sdr50_conf {
219 pinctrl-pin-array = <
220 0x678 A_DELAY_PS(852) G_DELAY_PS(0) /* CFG_MMC3_CLK_IN */
221 0x680 A_DELAY_PS(94) G_DELAY_PS(0) /* CFG_MMC3_CLK_OUT */
222 0x684 A_DELAY_PS(122) G_DELAY_PS(0) /* CFG_MMC3_CMD_IN */
223 0x688 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OEN */
224 0x68c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OUT */
225 0x690 A_DELAY_PS(91) G_DELAY_PS(0) /* CFG_MMC3_DAT0_IN */
226 0x694 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OEN */
227 0x698 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OUT */
228 0x69c A_DELAY_PS(57) G_DELAY_PS(0) /* CFG_MMC3_DAT1_IN */
229 0x6a0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OEN */
230 0x6a4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OUT */
231 0x6a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_IN */
232 0x6ac A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OEN */
233 0x6b0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OUT */
234 0x6b4 A_DELAY_PS(375) G_DELAY_PS(0) /* CFG_MMC3_DAT3_IN */
235 0x6b8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OEN */
236 0x6bc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OUT */
237 >;
238 };
239
240 /* Corresponds to MMC4_MANUAL1 in datamanual */
241 mmc4_iodelay_manual1_conf: mmc4_iodelay_manual1_conf {
242 pinctrl-pin-array = <
243 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */
244 0x848 A_DELAY_PS(1147) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */
245 0x84c A_DELAY_PS(1834) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */
246 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */
247 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */
248 0x870 A_DELAY_PS(2165) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */
249 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */
250 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */
251 0x87c A_DELAY_PS(1929) G_DELAY_PS(64) /* CFG_UART2_RTSN_IN */
252 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */
253 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */
254 0x888 A_DELAY_PS(1935) G_DELAY_PS(128) /* CFG_UART2_RXD_IN */
255 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */
256 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */
257 0x894 A_DELAY_PS(2172) G_DELAY_PS(44) /* CFG_UART2_TXD_IN */
258 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */
259 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */
260 >;
261 };
262
263 /* Corresponds to MMC4_DS_MANUAL1 in datamanual */
264 mmc4_iodelay_default_conf: mmc4_iodelay_default_conf {
265 pinctrl-pin-array = <
266 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */
267 0x848 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */
268 0x84c A_DELAY_PS(307) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */
269 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */
270 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */
271 0x870 A_DELAY_PS(785) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */
272 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */
273 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */
274 0x87c A_DELAY_PS(613) G_DELAY_PS(0) /* CFG_UART2_RTSN_IN */
275 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */
276 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */
277 0x888 A_DELAY_PS(683) G_DELAY_PS(0) /* CFG_UART2_RXD_IN */
278 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */
279 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */
280 0x894 A_DELAY_PS(835) G_DELAY_PS(0) /* CFG_UART2_TXD_IN */
281 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */
282 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */
283 >;
284 };
285};
diff --git a/arch/arm/boot/dts/emev2-kzm9d.dts b/arch/arm/boot/dts/emev2-kzm9d.dts
index 60d0a732833a..c238407133bf 100644
--- a/arch/arm/boot/dts/emev2-kzm9d.dts
+++ b/arch/arm/boot/dts/emev2-kzm9d.dts
@@ -38,28 +38,28 @@
38 #size-cells = <0>; 38 #size-cells = <0>;
39 39
40 one { 40 one {
41 debounce_interval = <50>; 41 debounce-interval = <50>;
42 wakeup-source; 42 wakeup-source;
43 label = "DSW2-1"; 43 label = "DSW2-1";
44 linux,code = <KEY_1>; 44 linux,code = <KEY_1>;
45 gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; 45 gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
46 }; 46 };
47 two { 47 two {
48 debounce_interval = <50>; 48 debounce-interval = <50>;
49 wakeup-source; 49 wakeup-source;
50 label = "DSW2-2"; 50 label = "DSW2-2";
51 linux,code = <KEY_2>; 51 linux,code = <KEY_2>;
52 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; 52 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
53 }; 53 };
54 three { 54 three {
55 debounce_interval = <50>; 55 debounce-interval = <50>;
56 wakeup-source; 56 wakeup-source;
57 label = "DSW2-3"; 57 label = "DSW2-3";
58 linux,code = <KEY_3>; 58 linux,code = <KEY_3>;
59 gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; 59 gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
60 }; 60 };
61 four { 61 four {
62 debounce_interval = <50>; 62 debounce-interval = <50>;
63 wakeup-source; 63 wakeup-source;
64 label = "DSW2-4"; 64 label = "DSW2-4";
65 linux,code = <KEY_4>; 65 linux,code = <KEY_4>;
diff --git a/arch/arm/boot/dts/exynos-mfc-reserved-memory.dtsi b/arch/arm/boot/dts/exynos-mfc-reserved-memory.dtsi
index 25186ac4188d..1dbf3bbff8d3 100644
--- a/arch/arm/boot/dts/exynos-mfc-reserved-memory.dtsi
+++ b/arch/arm/boot/dts/exynos-mfc-reserved-memory.dtsi
@@ -1,11 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Samsung's Exynos SoC MFC (Video Codec) reserved memory common definition. 3 * Samsung's Exynos SoC MFC (Video Codec) reserved memory common definition.
3 * 4 *
4 * Copyright (c) 2016 Samsung Electronics Co., Ltd 5 * Copyright (c) 2016 Samsung Electronics Co., Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */ 6 */
10 7
11/ { 8/ {
diff --git a/arch/arm/boot/dts/exynos-syscon-restart.dtsi b/arch/arm/boot/dts/exynos-syscon-restart.dtsi
index 09a2040054ed..4b3dd0549a54 100644
--- a/arch/arm/boot/dts/exynos-syscon-restart.dtsi
+++ b/arch/arm/boot/dts/exynos-syscon-restart.dtsi
@@ -1,9 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Samsung's Exynos SoC syscon reboot/poweroff nodes common definition. 3 * Samsung's Exynos SoC syscon reboot/poweroff nodes common definition.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */ 4 */
8 5
9/ { 6/ {
diff --git a/arch/arm/boot/dts/exynos3250-artik5.dtsi b/arch/arm/boot/dts/exynos3250-artik5.dtsi
index 0aa577fe9f95..620b50c19ead 100644
--- a/arch/arm/boot/dts/exynos3250-artik5.dtsi
+++ b/arch/arm/boot/dts/exynos3250-artik5.dtsi
@@ -245,6 +245,7 @@
245 regulator-name = "VLDO23_1.8V"; 245 regulator-name = "VLDO23_1.8V";
246 regulator-min-microvolt = <1800000>; 246 regulator-min-microvolt = <1800000>;
247 regulator-max-microvolt = <1800000>; 247 regulator-max-microvolt = <1800000>;
248 regulator-always-on;
248 }; 249 };
249 250
250 ldo24_reg: LDO24 { 251 ldo24_reg: LDO24 {
@@ -316,6 +317,41 @@
316 status = "okay"; 317 status = "okay";
317}; 318};
318 319
320&mshc_1 {
321 cap-sd-highspeed;
322 cap-sdio-irq;
323 disable-wp;
324 non-removable;
325 keep-power-in-suspend;
326 fifo-depth = <0x40>;
327 vqmmc-supply = <&ldo11_reg>;
328 /*
329 * Voltage negotiation is broken for the SDIO periph so we
330 * can't actually set the voltage here.
331 * vmmc-supply = <&ldo23_reg>;
332 */
333 card-detect-delay = <500>;
334 clock-frequency = <100000000>;
335 max-frequency = <100000000>;
336 samsung,dw-mshc-ciu-div = <3>;
337 samsung,dw-mshc-sdr-timing = <0 1>;
338 samsung,dw-mshc-ddr-timing = <1 2>;
339 pinctrl-names = "default";
340 pinctrl-0 = <&sd1_cmd &sd1_clk &sd1_bus1 &sd1_bus4 &wlanen>;
341 bus-width = <4>;
342 status = "okay";
343};
344
345&pinctrl_1 {
346 wlanen: wlanen {
347 samsung,pins = "gpx2-3";
348 samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
349 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
350 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV3>;
351 samsung,pin-val = <1>;
352 };
353};
354
319&rtc { 355&rtc {
320 clocks = <&cmu CLK_RTC>, <&s2mps14_osc S2MPS11_CLK_AP>; 356 clocks = <&cmu CLK_RTC>, <&s2mps14_osc S2MPS11_CLK_AP>;
321 clock-names = "rtc", "rtc_src"; 357 clock-names = "rtc", "rtc_src";
diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi
index b8fb94f5daa8..0a5f989d963b 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -161,34 +161,39 @@
161 syscon = <&pmu_system_controller>; 161 syscon = <&pmu_system_controller>;
162 }; 162 };
163 163
164 pd_cam: cam-power-domain@10023c00 { 164 pd_cam: power-domain@10023c00 {
165 compatible = "samsung,exynos4210-pd"; 165 compatible = "samsung,exynos4210-pd";
166 reg = <0x10023C00 0x20>; 166 reg = <0x10023C00 0x20>;
167 #power-domain-cells = <0>; 167 #power-domain-cells = <0>;
168 label = "CAM";
168 }; 169 };
169 170
170 pd_mfc: mfc-power-domain@10023c40 { 171 pd_mfc: power-domain@10023c40 {
171 compatible = "samsung,exynos4210-pd"; 172 compatible = "samsung,exynos4210-pd";
172 reg = <0x10023C40 0x20>; 173 reg = <0x10023C40 0x20>;
173 #power-domain-cells = <0>; 174 #power-domain-cells = <0>;
175 label = "MFC";
174 }; 176 };
175 177
176 pd_g3d: g3d-power-domain@10023c60 { 178 pd_g3d: power-domain@10023c60 {
177 compatible = "samsung,exynos4210-pd"; 179 compatible = "samsung,exynos4210-pd";
178 reg = <0x10023C60 0x20>; 180 reg = <0x10023C60 0x20>;
179 #power-domain-cells = <0>; 181 #power-domain-cells = <0>;
182 label = "G3D";
180 }; 183 };
181 184
182 pd_lcd0: lcd0-power-domain@10023c80 { 185 pd_lcd0: power-domain@10023c80 {
183 compatible = "samsung,exynos4210-pd"; 186 compatible = "samsung,exynos4210-pd";
184 reg = <0x10023C80 0x20>; 187 reg = <0x10023C80 0x20>;
185 #power-domain-cells = <0>; 188 #power-domain-cells = <0>;
189 label = "LCD0";
186 }; 190 };
187 191
188 pd_isp: isp-power-domain@10023ca0 { 192 pd_isp: power-domain@10023ca0 {
189 compatible = "samsung,exynos4210-pd"; 193 compatible = "samsung,exynos4210-pd";
190 reg = <0x10023CA0 0x20>; 194 reg = <0x10023CA0 0x20>;
191 #power-domain-cells = <0>; 195 #power-domain-cells = <0>;
196 label = "ISP";
192 }; 197 };
193 198
194 cmu: clock-controller@10030000 { 199 cmu: clock-controller@10030000 {
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 6d59cc827649..909a9f2bf5be 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -52,961 +52,976 @@
52 serial3 = &serial_3; 52 serial3 = &serial_3;
53 }; 53 };
54 54
55 clock_audss: clock-controller@3810000 { 55 soc: soc {
56 compatible = "samsung,exynos4210-audss-clock"; 56 compatible = "simple-bus";
57 reg = <0x03810000 0x0C>; 57 #address-cells = <1>;
58 #clock-cells = <1>; 58 #size-cells = <1>;
59 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>, 59 ranges;
60 <&clock CLK_SCLK_AUDIO0>, <&clock CLK_SCLK_AUDIO0>;
61 clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
62 };
63
64 i2s0: i2s@3830000 {
65 compatible = "samsung,s5pv210-i2s";
66 reg = <0x03830000 0x100>;
67 clocks = <&clock_audss EXYNOS_I2S_BUS>,
68 <&clock_audss EXYNOS_DOUT_AUD_BUS>,
69 <&clock_audss EXYNOS_SCLK_I2S>;
70 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
71 #clock-cells = <1>;
72 clock-output-names = "i2s_cdclk0";
73 dmas = <&pdma0 12>, <&pdma0 11>, <&pdma0 10>;
74 dma-names = "tx", "rx", "tx-sec";
75 samsung,idma-addr = <0x03000000>;
76 #sound-dai-cells = <1>;
77 status = "disabled";
78 };
79 60
80 chipid@10000000 { 61 clock_audss: clock-controller@3810000 {
81 compatible = "samsung,exynos4210-chipid"; 62 compatible = "samsung,exynos4210-audss-clock";
82 reg = <0x10000000 0x100>; 63 reg = <0x03810000 0x0C>;
83 }; 64 #clock-cells = <1>;
65 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>,
66 <&clock CLK_SCLK_AUDIO0>,
67 <&clock CLK_SCLK_AUDIO0>;
68 clock-names = "pll_ref", "pll_in", "sclk_audio",
69 "sclk_pcm_in";
70 };
84 71
85 scu: snoop-control-unit@10500000 { 72 i2s0: i2s@3830000 {
86 compatible = "arm,cortex-a9-scu"; 73 compatible = "samsung,s5pv210-i2s";
87 reg = <0x10500000 0x2000>; 74 reg = <0x03830000 0x100>;
88 }; 75 clocks = <&clock_audss EXYNOS_I2S_BUS>,
76 <&clock_audss EXYNOS_DOUT_AUD_BUS>,
77 <&clock_audss EXYNOS_SCLK_I2S>;
78 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
79 #clock-cells = <1>;
80 clock-output-names = "i2s_cdclk0";
81 dmas = <&pdma0 12>, <&pdma0 11>, <&pdma0 10>;
82 dma-names = "tx", "rx", "tx-sec";
83 samsung,idma-addr = <0x03000000>;
84 #sound-dai-cells = <1>;
85 status = "disabled";
86 };
89 87
90 memory-controller@12570000 { 88 chipid@10000000 {
91 compatible = "samsung,exynos4210-srom"; 89 compatible = "samsung,exynos4210-chipid";
92 reg = <0x12570000 0x14>; 90 reg = <0x10000000 0x100>;
93 }; 91 };
94 92
95 mipi_phy: video-phy { 93 scu: snoop-control-unit@10500000 {
96 compatible = "samsung,s5pv210-mipi-video-phy"; 94 compatible = "arm,cortex-a9-scu";
97 #phy-cells = <1>; 95 reg = <0x10500000 0x2000>;
98 syscon = <&pmu_system_controller>; 96 };
99 };
100 97
101 pd_mfc: mfc-power-domain@10023c40 { 98 memory-controller@12570000 {
102 compatible = "samsung,exynos4210-pd"; 99 compatible = "samsung,exynos4210-srom";
103 reg = <0x10023C40 0x20>; 100 reg = <0x12570000 0x14>;
104 #power-domain-cells = <0>; 101 };
105 label = "MFC";
106 };
107 102
108 pd_g3d: g3d-power-domain@10023c60 { 103 mipi_phy: video-phy {
109 compatible = "samsung,exynos4210-pd"; 104 compatible = "samsung,s5pv210-mipi-video-phy";
110 reg = <0x10023C60 0x20>; 105 #phy-cells = <1>;
111 #power-domain-cells = <0>; 106 syscon = <&pmu_system_controller>;
112 label = "G3D"; 107 };
113 };
114 108
115 pd_lcd0: lcd0-power-domain@10023c80 { 109 pd_mfc: mfc-power-domain@10023c40 {
116 compatible = "samsung,exynos4210-pd"; 110 compatible = "samsung,exynos4210-pd";
117 reg = <0x10023C80 0x20>; 111 reg = <0x10023C40 0x20>;
118 #power-domain-cells = <0>; 112 #power-domain-cells = <0>;
119 label = "LCD0"; 113 label = "MFC";
120 }; 114 };
121 115
122 pd_tv: tv-power-domain@10023c20 { 116 pd_g3d: g3d-power-domain@10023c60 {
123 compatible = "samsung,exynos4210-pd"; 117 compatible = "samsung,exynos4210-pd";
124 reg = <0x10023C20 0x20>; 118 reg = <0x10023C60 0x20>;
125 #power-domain-cells = <0>; 119 #power-domain-cells = <0>;
126 power-domains = <&pd_lcd0>; 120 label = "G3D";
127 label = "TV"; 121 };
128 };
129 122
130 pd_cam: cam-power-domain@10023c00 { 123 pd_lcd0: lcd0-power-domain@10023c80 {
131 compatible = "samsung,exynos4210-pd"; 124 compatible = "samsung,exynos4210-pd";
132 reg = <0x10023C00 0x20>; 125 reg = <0x10023C80 0x20>;
133 #power-domain-cells = <0>; 126 #power-domain-cells = <0>;
134 label = "CAM"; 127 label = "LCD0";
135 }; 128 };
136 129
137 pd_gps: gps-power-domain@10023ce0 { 130 pd_tv: tv-power-domain@10023c20 {
138 compatible = "samsung,exynos4210-pd"; 131 compatible = "samsung,exynos4210-pd";
139 reg = <0x10023CE0 0x20>; 132 reg = <0x10023C20 0x20>;
140 #power-domain-cells = <0>; 133 #power-domain-cells = <0>;
141 label = "GPS"; 134 power-domains = <&pd_lcd0>;
142 }; 135 label = "TV";
136 };
143 137
144 pd_gps_alive: gps-alive-power-domain@10023d00 { 138 pd_cam: cam-power-domain@10023c00 {
145 compatible = "samsung,exynos4210-pd"; 139 compatible = "samsung,exynos4210-pd";
146 reg = <0x10023D00 0x20>; 140 reg = <0x10023C00 0x20>;
147 #power-domain-cells = <0>; 141 #power-domain-cells = <0>;
148 label = "GPS alive"; 142 label = "CAM";
149 }; 143 };
150 144
151 gic: interrupt-controller@10490000 { 145 pd_gps: gps-power-domain@10023ce0 {
152 compatible = "arm,cortex-a9-gic"; 146 compatible = "samsung,exynos4210-pd";
153 #interrupt-cells = <3>; 147 reg = <0x10023CE0 0x20>;
154 interrupt-controller; 148 #power-domain-cells = <0>;
155 reg = <0x10490000 0x10000>, <0x10480000 0x10000>; 149 label = "GPS";
156 }; 150 };
157 151
158 combiner: interrupt-controller@10440000 { 152 pd_gps_alive: gps-alive-power-domain@10023d00 {
159 compatible = "samsung,exynos4210-combiner"; 153 compatible = "samsung,exynos4210-pd";
160 #interrupt-cells = <2>; 154 reg = <0x10023D00 0x20>;
161 interrupt-controller; 155 #power-domain-cells = <0>;
162 reg = <0x10440000 0x1000>; 156 label = "GPS alive";
163 }; 157 };
164 158
165 pmu { 159 gic: interrupt-controller@10490000 {
166 compatible = "arm,cortex-a9-pmu"; 160 compatible = "arm,cortex-a9-gic";
167 interrupt-parent = <&combiner>; 161 #interrupt-cells = <3>;
168 interrupts = <2 2>, <3 2>; 162 interrupt-controller;
169 }; 163 reg = <0x10490000 0x10000>, <0x10480000 0x10000>;
164 };
170 165
171 sys_reg: syscon@10010000 { 166 combiner: interrupt-controller@10440000 {
172 compatible = "samsung,exynos4-sysreg", "syscon"; 167 compatible = "samsung,exynos4210-combiner";
173 reg = <0x10010000 0x400>; 168 #interrupt-cells = <2>;
174 }; 169 interrupt-controller;
170 reg = <0x10440000 0x1000>;
171 };
175 172
176 pmu_system_controller: system-controller@10020000 { 173 pmu: pmu {
177 compatible = "samsung,exynos4210-pmu", "syscon"; 174 compatible = "arm,cortex-a9-pmu";
178 reg = <0x10020000 0x4000>; 175 interrupt-parent = <&combiner>;
179 interrupt-controller; 176 interrupts = <2 2>, <3 2>;
180 #interrupt-cells = <3>; 177 };
181 interrupt-parent = <&gic>;
182 };
183 178
184 dsi_0: dsi@11c80000 { 179 sys_reg: syscon@10010000 {
185 compatible = "samsung,exynos4210-mipi-dsi"; 180 compatible = "samsung,exynos4-sysreg", "syscon";
186 reg = <0x11C80000 0x10000>; 181 reg = <0x10010000 0x400>;
187 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; 182 };
188 power-domains = <&pd_lcd0>;
189 phys = <&mipi_phy 1>;
190 phy-names = "dsim";
191 clocks = <&clock CLK_DSIM0>, <&clock CLK_SCLK_MIPI0>;
192 clock-names = "bus_clk", "sclk_mipi";
193 status = "disabled";
194 #address-cells = <1>;
195 #size-cells = <0>;
196 };
197 183
198 camera { 184 pmu_system_controller: system-controller@10020000 {
199 compatible = "samsung,fimc", "simple-bus"; 185 compatible = "samsung,exynos4210-pmu", "syscon";
200 status = "disabled"; 186 reg = <0x10020000 0x4000>;
201 #address-cells = <1>; 187 interrupt-controller;
202 #size-cells = <1>; 188 #interrupt-cells = <3>;
203 #clock-cells = <1>; 189 interrupt-parent = <&gic>;
204 clock-output-names = "cam_a_clkout", "cam_b_clkout"; 190 };
205 ranges;
206 191
207 fimc_0: fimc@11800000 { 192 dsi_0: dsi@11c80000 {
208 compatible = "samsung,exynos4210-fimc"; 193 compatible = "samsung,exynos4210-mipi-dsi";
209 reg = <0x11800000 0x1000>; 194 reg = <0x11C80000 0x10000>;
210 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; 195 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
211 clocks = <&clock CLK_FIMC0>, <&clock CLK_SCLK_FIMC0>; 196 power-domains = <&pd_lcd0>;
212 clock-names = "fimc", "sclk_fimc"; 197 phys = <&mipi_phy 1>;
213 power-domains = <&pd_cam>; 198 phy-names = "dsim";
214 samsung,sysreg = <&sys_reg>; 199 clocks = <&clock CLK_DSIM0>, <&clock CLK_SCLK_MIPI0>;
215 iommus = <&sysmmu_fimc0>; 200 clock-names = "bus_clk", "sclk_mipi";
216 status = "disabled"; 201 status = "disabled";
202 #address-cells = <1>;
203 #size-cells = <0>;
217 }; 204 };
218 205
219 fimc_1: fimc@11810000 { 206 camera: camera {
220 compatible = "samsung,exynos4210-fimc"; 207 compatible = "samsung,fimc", "simple-bus";
221 reg = <0x11810000 0x1000>;
222 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
223 clocks = <&clock CLK_FIMC1>, <&clock CLK_SCLK_FIMC1>;
224 clock-names = "fimc", "sclk_fimc";
225 power-domains = <&pd_cam>;
226 samsung,sysreg = <&sys_reg>;
227 iommus = <&sysmmu_fimc1>;
228 status = "disabled"; 208 status = "disabled";
209 #address-cells = <1>;
210 #size-cells = <1>;
211 #clock-cells = <1>;
212 clock-output-names = "cam_a_clkout", "cam_b_clkout";
213 ranges;
214
215 fimc_0: fimc@11800000 {
216 compatible = "samsung,exynos4210-fimc";
217 reg = <0x11800000 0x1000>;
218 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
219 clocks = <&clock CLK_FIMC0>,
220 <&clock CLK_SCLK_FIMC0>;
221 clock-names = "fimc", "sclk_fimc";
222 power-domains = <&pd_cam>;
223 samsung,sysreg = <&sys_reg>;
224 iommus = <&sysmmu_fimc0>;
225 status = "disabled";
226 };
227
228 fimc_1: fimc@11810000 {
229 compatible = "samsung,exynos4210-fimc";
230 reg = <0x11810000 0x1000>;
231 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
232 clocks = <&clock CLK_FIMC1>,
233 <&clock CLK_SCLK_FIMC1>;
234 clock-names = "fimc", "sclk_fimc";
235 power-domains = <&pd_cam>;
236 samsung,sysreg = <&sys_reg>;
237 iommus = <&sysmmu_fimc1>;
238 status = "disabled";
239 };
240
241 fimc_2: fimc@11820000 {
242 compatible = "samsung,exynos4210-fimc";
243 reg = <0x11820000 0x1000>;
244 interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
245 clocks = <&clock CLK_FIMC2>,
246 <&clock CLK_SCLK_FIMC2>;
247 clock-names = "fimc", "sclk_fimc";
248 power-domains = <&pd_cam>;
249 samsung,sysreg = <&sys_reg>;
250 iommus = <&sysmmu_fimc2>;
251 status = "disabled";
252 };
253
254 fimc_3: fimc@11830000 {
255 compatible = "samsung,exynos4210-fimc";
256 reg = <0x11830000 0x1000>;
257 interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
258 clocks = <&clock CLK_FIMC3>,
259 <&clock CLK_SCLK_FIMC3>;
260 clock-names = "fimc", "sclk_fimc";
261 power-domains = <&pd_cam>;
262 samsung,sysreg = <&sys_reg>;
263 iommus = <&sysmmu_fimc3>;
264 status = "disabled";
265 };
266
267 csis_0: csis@11880000 {
268 compatible = "samsung,exynos4210-csis";
269 reg = <0x11880000 0x4000>;
270 interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
271 clocks = <&clock CLK_CSIS0>,
272 <&clock CLK_SCLK_CSIS0>;
273 clock-names = "csis", "sclk_csis";
274 bus-width = <4>;
275 power-domains = <&pd_cam>;
276 phys = <&mipi_phy 0>;
277 phy-names = "csis";
278 status = "disabled";
279 #address-cells = <1>;
280 #size-cells = <0>;
281 };
282
283 csis_1: csis@11890000 {
284 compatible = "samsung,exynos4210-csis";
285 reg = <0x11890000 0x4000>;
286 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
287 clocks = <&clock CLK_CSIS1>,
288 <&clock CLK_SCLK_CSIS1>;
289 clock-names = "csis", "sclk_csis";
290 bus-width = <2>;
291 power-domains = <&pd_cam>;
292 phys = <&mipi_phy 2>;
293 phy-names = "csis";
294 status = "disabled";
295 #address-cells = <1>;
296 #size-cells = <0>;
297 };
229 }; 298 };
230 299
231 fimc_2: fimc@11820000 { 300 rtc: rtc@10070000 {
232 compatible = "samsung,exynos4210-fimc"; 301 compatible = "samsung,s3c6410-rtc";
233 reg = <0x11820000 0x1000>; 302 reg = <0x10070000 0x100>;
234 interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; 303 interrupt-parent = <&pmu_system_controller>;
235 clocks = <&clock CLK_FIMC2>, <&clock CLK_SCLK_FIMC2>; 304 interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
236 clock-names = "fimc", "sclk_fimc"; 305 <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
237 power-domains = <&pd_cam>; 306 clocks = <&clock CLK_RTC>;
238 samsung,sysreg = <&sys_reg>; 307 clock-names = "rtc";
239 iommus = <&sysmmu_fimc2>;
240 status = "disabled"; 308 status = "disabled";
241 }; 309 };
242 310
243 fimc_3: fimc@11830000 { 311 keypad: keypad@100a0000 {
244 compatible = "samsung,exynos4210-fimc"; 312 compatible = "samsung,s5pv210-keypad";
245 reg = <0x11830000 0x1000>; 313 reg = <0x100A0000 0x100>;
246 interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; 314 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
247 clocks = <&clock CLK_FIMC3>, <&clock CLK_SCLK_FIMC3>; 315 clocks = <&clock CLK_KEYIF>;
248 clock-names = "fimc", "sclk_fimc"; 316 clock-names = "keypad";
249 power-domains = <&pd_cam>;
250 samsung,sysreg = <&sys_reg>;
251 iommus = <&sysmmu_fimc3>;
252 status = "disabled"; 317 status = "disabled";
253 }; 318 };
254 319
255 csis_0: csis@11880000 { 320 sdhci_0: sdhci@12510000 {
256 compatible = "samsung,exynos4210-csis"; 321 compatible = "samsung,exynos4210-sdhci";
257 reg = <0x11880000 0x4000>; 322 reg = <0x12510000 0x100>;
258 interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; 323 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
259 clocks = <&clock CLK_CSIS0>, <&clock CLK_SCLK_CSIS0>; 324 clocks = <&clock CLK_SDMMC0>, <&clock CLK_SCLK_MMC0>;
260 clock-names = "csis", "sclk_csis"; 325 clock-names = "hsmmc", "mmc_busclk.2";
261 bus-width = <4>;
262 power-domains = <&pd_cam>;
263 phys = <&mipi_phy 0>;
264 phy-names = "csis";
265 status = "disabled"; 326 status = "disabled";
266 #address-cells = <1>;
267 #size-cells = <0>;
268 }; 327 };
269 328
270 csis_1: csis@11890000 { 329 sdhci_1: sdhci@12520000 {
271 compatible = "samsung,exynos4210-csis"; 330 compatible = "samsung,exynos4210-sdhci";
272 reg = <0x11890000 0x4000>; 331 reg = <0x12520000 0x100>;
273 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>; 332 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
274 clocks = <&clock CLK_CSIS1>, <&clock CLK_SCLK_CSIS1>; 333 clocks = <&clock CLK_SDMMC1>, <&clock CLK_SCLK_MMC1>;
275 clock-names = "csis", "sclk_csis"; 334 clock-names = "hsmmc", "mmc_busclk.2";
276 bus-width = <2>;
277 power-domains = <&pd_cam>;
278 phys = <&mipi_phy 2>;
279 phy-names = "csis";
280 status = "disabled"; 335 status = "disabled";
281 #address-cells = <1>;
282 #size-cells = <0>;
283 }; 336 };
284 };
285
286 rtc: rtc@10070000 {
287 compatible = "samsung,s3c6410-rtc";
288 reg = <0x10070000 0x100>;
289 interrupt-parent = <&pmu_system_controller>;
290 interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
291 <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
292 clocks = <&clock CLK_RTC>;
293 clock-names = "rtc";
294 status = "disabled";
295 };
296
297 keypad: keypad@100a0000 {
298 compatible = "samsung,s5pv210-keypad";
299 reg = <0x100A0000 0x100>;
300 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
301 clocks = <&clock CLK_KEYIF>;
302 clock-names = "keypad";
303 status = "disabled";
304 };
305
306 sdhci_0: sdhci@12510000 {
307 compatible = "samsung,exynos4210-sdhci";
308 reg = <0x12510000 0x100>;
309 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
310 clocks = <&clock CLK_SDMMC0>, <&clock CLK_SCLK_MMC0>;
311 clock-names = "hsmmc", "mmc_busclk.2";
312 status = "disabled";
313 };
314 337
315 sdhci_1: sdhci@12520000 { 338 sdhci_2: sdhci@12530000 {
316 compatible = "samsung,exynos4210-sdhci"; 339 compatible = "samsung,exynos4210-sdhci";
317 reg = <0x12520000 0x100>; 340 reg = <0x12530000 0x100>;
318 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>; 341 interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
319 clocks = <&clock CLK_SDMMC1>, <&clock CLK_SCLK_MMC1>; 342 clocks = <&clock CLK_SDMMC2>, <&clock CLK_SCLK_MMC2>;
320 clock-names = "hsmmc", "mmc_busclk.2"; 343 clock-names = "hsmmc", "mmc_busclk.2";
321 status = "disabled"; 344 status = "disabled";
322 }; 345 };
323
324 sdhci_2: sdhci@12530000 {
325 compatible = "samsung,exynos4210-sdhci";
326 reg = <0x12530000 0x100>;
327 interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
328 clocks = <&clock CLK_SDMMC2>, <&clock CLK_SCLK_MMC2>;
329 clock-names = "hsmmc", "mmc_busclk.2";
330 status = "disabled";
331 };
332
333 sdhci_3: sdhci@12540000 {
334 compatible = "samsung,exynos4210-sdhci";
335 reg = <0x12540000 0x100>;
336 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
337 clocks = <&clock CLK_SDMMC3>, <&clock CLK_SCLK_MMC3>;
338 clock-names = "hsmmc", "mmc_busclk.2";
339 status = "disabled";
340 };
341
342 exynos_usbphy: exynos-usbphy@125b0000 {
343 compatible = "samsung,exynos4210-usb2-phy";
344 reg = <0x125B0000 0x100>;
345 samsung,pmureg-phandle = <&pmu_system_controller>;
346 clocks = <&clock CLK_USB_DEVICE>, <&clock CLK_XUSBXTI>;
347 clock-names = "phy", "ref";
348 #phy-cells = <1>;
349 status = "disabled";
350 };
351
352 hsotg: hsotg@12480000 {
353 compatible = "samsung,s3c6400-hsotg";
354 reg = <0x12480000 0x20000>;
355 interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
356 clocks = <&clock CLK_USB_DEVICE>;
357 clock-names = "otg";
358 phys = <&exynos_usbphy 0>;
359 phy-names = "usb2-phy";
360 status = "disabled";
361 };
362 346
363 ehci: ehci@12580000 { 347 sdhci_3: sdhci@12540000 {
364 compatible = "samsung,exynos4210-ehci"; 348 compatible = "samsung,exynos4210-sdhci";
365 reg = <0x12580000 0x100>; 349 reg = <0x12540000 0x100>;
366 interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; 350 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
367 clocks = <&clock CLK_USB_HOST>; 351 clocks = <&clock CLK_SDMMC3>, <&clock CLK_SCLK_MMC3>;
368 clock-names = "usbhost"; 352 clock-names = "hsmmc", "mmc_busclk.2";
369 status = "disabled";
370 #address-cells = <1>;
371 #size-cells = <0>;
372 port@0 {
373 reg = <0>;
374 phys = <&exynos_usbphy 1>;
375 status = "disabled"; 353 status = "disabled";
376 }; 354 };
377 port@1 { 355
378 reg = <1>; 356 exynos_usbphy: exynos-usbphy@125b0000 {
379 phys = <&exynos_usbphy 2>; 357 compatible = "samsung,exynos4210-usb2-phy";
358 reg = <0x125B0000 0x100>;
359 samsung,pmureg-phandle = <&pmu_system_controller>;
360 clocks = <&clock CLK_USB_DEVICE>, <&clock CLK_XUSBXTI>;
361 clock-names = "phy", "ref";
362 #phy-cells = <1>;
380 status = "disabled"; 363 status = "disabled";
381 }; 364 };
382 port@2 { 365
383 reg = <2>; 366 hsotg: hsotg@12480000 {
384 phys = <&exynos_usbphy 3>; 367 compatible = "samsung,s3c6400-hsotg";
368 reg = <0x12480000 0x20000>;
369 interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
370 clocks = <&clock CLK_USB_DEVICE>;
371 clock-names = "otg";
372 phys = <&exynos_usbphy 0>;
373 phy-names = "usb2-phy";
385 status = "disabled"; 374 status = "disabled";
386 }; 375 };
387 };
388 376
389 ohci: ohci@12590000 { 377 ehci: ehci@12580000 {
390 compatible = "samsung,exynos4210-ohci"; 378 compatible = "samsung,exynos4210-ehci";
391 reg = <0x12590000 0x100>; 379 reg = <0x12580000 0x100>;
392 interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; 380 interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
393 clocks = <&clock CLK_USB_HOST>; 381 clocks = <&clock CLK_USB_HOST>;
394 clock-names = "usbhost"; 382 clock-names = "usbhost";
395 status = "disabled";
396 #address-cells = <1>;
397 #size-cells = <0>;
398 port@0 {
399 reg = <0>;
400 phys = <&exynos_usbphy 1>;
401 status = "disabled"; 383 status = "disabled";
384 #address-cells = <1>;
385 #size-cells = <0>;
386 port@0 {
387 reg = <0>;
388 phys = <&exynos_usbphy 1>;
389 status = "disabled";
390 };
391 port@1 {
392 reg = <1>;
393 phys = <&exynos_usbphy 2>;
394 status = "disabled";
395 };
396 port@2 {
397 reg = <2>;
398 phys = <&exynos_usbphy 3>;
399 status = "disabled";
400 };
402 }; 401 };
403 };
404 402
405 i2s1: i2s@13960000 { 403 ohci: ohci@12590000 {
406 compatible = "samsung,s3c6410-i2s"; 404 compatible = "samsung,exynos4210-ohci";
407 reg = <0x13960000 0x100>; 405 reg = <0x12590000 0x100>;
408 clocks = <&clock CLK_I2S1>; 406 interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
409 clock-names = "iis"; 407 clocks = <&clock CLK_USB_HOST>;
410 #clock-cells = <1>; 408 clock-names = "usbhost";
411 clock-output-names = "i2s_cdclk1"; 409 status = "disabled";
412 dmas = <&pdma1 12>, <&pdma1 11>; 410 #address-cells = <1>;
413 dma-names = "tx", "rx"; 411 #size-cells = <0>;
414 #sound-dai-cells = <1>; 412 port@0 {
415 status = "disabled"; 413 reg = <0>;
416 }; 414 phys = <&exynos_usbphy 1>;
415 status = "disabled";
416 };
417 };
417 418
418 i2s2: i2s@13970000 { 419 i2s1: i2s@13960000 {
419 compatible = "samsung,s3c6410-i2s"; 420 compatible = "samsung,s3c6410-i2s";
420 reg = <0x13970000 0x100>; 421 reg = <0x13960000 0x100>;
421 clocks = <&clock CLK_I2S2>; 422 clocks = <&clock CLK_I2S1>;
422 clock-names = "iis"; 423 clock-names = "iis";
423 #clock-cells = <1>; 424 #clock-cells = <1>;
424 clock-output-names = "i2s_cdclk2"; 425 clock-output-names = "i2s_cdclk1";
425 dmas = <&pdma0 14>, <&pdma0 13>; 426 dmas = <&pdma1 12>, <&pdma1 11>;
426 dma-names = "tx", "rx"; 427 dma-names = "tx", "rx";
427 #sound-dai-cells = <1>; 428 #sound-dai-cells = <1>;
428 status = "disabled"; 429 status = "disabled";
429 }; 430 };
430 431
431 mfc: codec@13400000 { 432 i2s2: i2s@13970000 {
432 compatible = "samsung,mfc-v5"; 433 compatible = "samsung,s3c6410-i2s";
433 reg = <0x13400000 0x10000>; 434 reg = <0x13970000 0x100>;
434 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; 435 clocks = <&clock CLK_I2S2>;
435 power-domains = <&pd_mfc>; 436 clock-names = "iis";
436 clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>; 437 #clock-cells = <1>;
437 clock-names = "mfc", "sclk_mfc"; 438 clock-output-names = "i2s_cdclk2";
438 iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>; 439 dmas = <&pdma0 14>, <&pdma0 13>;
439 iommu-names = "left", "right"; 440 dma-names = "tx", "rx";
440 }; 441 #sound-dai-cells = <1>;
442 status = "disabled";
443 };
441 444
442 serial_0: serial@13800000 { 445 mfc: codec@13400000 {
443 compatible = "samsung,exynos4210-uart"; 446 compatible = "samsung,mfc-v5";
444 reg = <0x13800000 0x100>; 447 reg = <0x13400000 0x10000>;
445 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; 448 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
446 clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>; 449 power-domains = <&pd_mfc>;
447 clock-names = "uart", "clk_uart_baud0"; 450 clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>;
448 dmas = <&pdma0 15>, <&pdma0 16>; 451 clock-names = "mfc", "sclk_mfc";
449 dma-names = "rx", "tx"; 452 iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
450 status = "disabled"; 453 iommu-names = "left", "right";
451 }; 454 };
452 455
453 serial_1: serial@13810000 { 456 serial_0: serial@13800000 {
454 compatible = "samsung,exynos4210-uart"; 457 compatible = "samsung,exynos4210-uart";
455 reg = <0x13810000 0x100>; 458 reg = <0x13800000 0x100>;
456 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; 459 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
457 clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>; 460 clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
458 clock-names = "uart", "clk_uart_baud0"; 461 clock-names = "uart", "clk_uart_baud0";
459 dmas = <&pdma1 15>, <&pdma1 16>; 462 dmas = <&pdma0 15>, <&pdma0 16>;
460 dma-names = "rx", "tx"; 463 dma-names = "rx", "tx";
461 status = "disabled"; 464 status = "disabled";
462 }; 465 };
463 466
464 serial_2: serial@13820000 { 467 serial_1: serial@13810000 {
465 compatible = "samsung,exynos4210-uart"; 468 compatible = "samsung,exynos4210-uart";
466 reg = <0x13820000 0x100>; 469 reg = <0x13810000 0x100>;
467 interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; 470 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
468 clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>; 471 clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
469 clock-names = "uart", "clk_uart_baud0"; 472 clock-names = "uart", "clk_uart_baud0";
470 dmas = <&pdma0 17>, <&pdma0 18>; 473 dmas = <&pdma1 15>, <&pdma1 16>;
471 dma-names = "rx", "tx"; 474 dma-names = "rx", "tx";
472 status = "disabled"; 475 status = "disabled";
473 }; 476 };
474 477
475 serial_3: serial@13830000 { 478 serial_2: serial@13820000 {
476 compatible = "samsung,exynos4210-uart"; 479 compatible = "samsung,exynos4210-uart";
477 reg = <0x13830000 0x100>; 480 reg = <0x13820000 0x100>;
478 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; 481 interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
479 clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>; 482 clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
480 clock-names = "uart", "clk_uart_baud0"; 483 clock-names = "uart", "clk_uart_baud0";
481 dmas = <&pdma1 17>, <&pdma1 18>; 484 dmas = <&pdma0 17>, <&pdma0 18>;
482 dma-names = "rx", "tx"; 485 dma-names = "rx", "tx";
483 status = "disabled"; 486 status = "disabled";
484 }; 487 };
485 488
486 i2c_0: i2c@13860000 { 489 serial_3: serial@13830000 {
487 #address-cells = <1>; 490 compatible = "samsung,exynos4210-uart";
488 #size-cells = <0>; 491 reg = <0x13830000 0x100>;
489 compatible = "samsung,s3c2440-i2c"; 492 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
490 reg = <0x13860000 0x100>; 493 clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
491 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; 494 clock-names = "uart", "clk_uart_baud0";
492 clocks = <&clock CLK_I2C0>; 495 dmas = <&pdma1 17>, <&pdma1 18>;
493 clock-names = "i2c"; 496 dma-names = "rx", "tx";
494 pinctrl-names = "default"; 497 status = "disabled";
495 pinctrl-0 = <&i2c0_bus>; 498 };
496 status = "disabled";
497 };
498 499
499 i2c_1: i2c@13870000 { 500 i2c_0: i2c@13860000 {
500 #address-cells = <1>; 501 #address-cells = <1>;
501 #size-cells = <0>; 502 #size-cells = <0>;
502 compatible = "samsung,s3c2440-i2c"; 503 compatible = "samsung,s3c2440-i2c";
503 reg = <0x13870000 0x100>; 504 reg = <0x13860000 0x100>;
504 interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>; 505 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
505 clocks = <&clock CLK_I2C1>; 506 clocks = <&clock CLK_I2C0>;
506 clock-names = "i2c"; 507 clock-names = "i2c";
507 pinctrl-names = "default"; 508 pinctrl-names = "default";
508 pinctrl-0 = <&i2c1_bus>; 509 pinctrl-0 = <&i2c0_bus>;
509 status = "disabled"; 510 status = "disabled";
510 }; 511 };
511 512
512 i2c_2: i2c@13880000 { 513 i2c_1: i2c@13870000 {
513 #address-cells = <1>; 514 #address-cells = <1>;
514 #size-cells = <0>; 515 #size-cells = <0>;
515 compatible = "samsung,s3c2440-i2c"; 516 compatible = "samsung,s3c2440-i2c";
516 reg = <0x13880000 0x100>; 517 reg = <0x13870000 0x100>;
517 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>; 518 interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
518 clocks = <&clock CLK_I2C2>; 519 clocks = <&clock CLK_I2C1>;
519 clock-names = "i2c"; 520 clock-names = "i2c";
520 pinctrl-names = "default"; 521 pinctrl-names = "default";
521 pinctrl-0 = <&i2c2_bus>; 522 pinctrl-0 = <&i2c1_bus>;
522 status = "disabled"; 523 status = "disabled";
523 }; 524 };
524 525
525 i2c_3: i2c@13890000 { 526 i2c_2: i2c@13880000 {
526 #address-cells = <1>; 527 #address-cells = <1>;
527 #size-cells = <0>; 528 #size-cells = <0>;
528 compatible = "samsung,s3c2440-i2c"; 529 compatible = "samsung,s3c2440-i2c";
529 reg = <0x13890000 0x100>; 530 reg = <0x13880000 0x100>;
530 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; 531 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
531 clocks = <&clock CLK_I2C3>; 532 clocks = <&clock CLK_I2C2>;
532 clock-names = "i2c"; 533 clock-names = "i2c";
533 pinctrl-names = "default"; 534 pinctrl-names = "default";
534 pinctrl-0 = <&i2c3_bus>; 535 pinctrl-0 = <&i2c2_bus>;
535 status = "disabled"; 536 status = "disabled";
536 }; 537 };
537 538
538 i2c_4: i2c@138a0000 { 539 i2c_3: i2c@13890000 {
539 #address-cells = <1>; 540 #address-cells = <1>;
540 #size-cells = <0>; 541 #size-cells = <0>;
541 compatible = "samsung,s3c2440-i2c"; 542 compatible = "samsung,s3c2440-i2c";
542 reg = <0x138A0000 0x100>; 543 reg = <0x13890000 0x100>;
543 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 544 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
544 clocks = <&clock CLK_I2C4>; 545 clocks = <&clock CLK_I2C3>;
545 clock-names = "i2c"; 546 clock-names = "i2c";
546 pinctrl-names = "default"; 547 pinctrl-names = "default";
547 pinctrl-0 = <&i2c4_bus>; 548 pinctrl-0 = <&i2c3_bus>;
548 status = "disabled"; 549 status = "disabled";
549 }; 550 };
550 551
551 i2c_5: i2c@138b0000 { 552 i2c_4: i2c@138a0000 {
552 #address-cells = <1>; 553 #address-cells = <1>;
553 #size-cells = <0>; 554 #size-cells = <0>;
554 compatible = "samsung,s3c2440-i2c"; 555 compatible = "samsung,s3c2440-i2c";
555 reg = <0x138B0000 0x100>; 556 reg = <0x138A0000 0x100>;
556 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; 557 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
557 clocks = <&clock CLK_I2C5>; 558 clocks = <&clock CLK_I2C4>;
558 clock-names = "i2c"; 559 clock-names = "i2c";
559 pinctrl-names = "default"; 560 pinctrl-names = "default";
560 pinctrl-0 = <&i2c5_bus>; 561 pinctrl-0 = <&i2c4_bus>;
561 status = "disabled"; 562 status = "disabled";
562 }; 563 };
563 564
564 i2c_6: i2c@138c0000 { 565 i2c_5: i2c@138b0000 {
565 #address-cells = <1>; 566 #address-cells = <1>;
566 #size-cells = <0>; 567 #size-cells = <0>;
567 compatible = "samsung,s3c2440-i2c"; 568 compatible = "samsung,s3c2440-i2c";
568 reg = <0x138C0000 0x100>; 569 reg = <0x138B0000 0x100>;
569 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; 570 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
570 clocks = <&clock CLK_I2C6>; 571 clocks = <&clock CLK_I2C5>;
571 clock-names = "i2c"; 572 clock-names = "i2c";
572 pinctrl-names = "default"; 573 pinctrl-names = "default";
573 pinctrl-0 = <&i2c6_bus>; 574 pinctrl-0 = <&i2c5_bus>;
574 status = "disabled"; 575 status = "disabled";
575 }; 576 };
576 577
577 i2c_7: i2c@138d0000 { 578 i2c_6: i2c@138c0000 {
578 #address-cells = <1>; 579 #address-cells = <1>;
579 #size-cells = <0>; 580 #size-cells = <0>;
580 compatible = "samsung,s3c2440-i2c"; 581 compatible = "samsung,s3c2440-i2c";
581 reg = <0x138D0000 0x100>; 582 reg = <0x138C0000 0x100>;
582 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; 583 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
583 clocks = <&clock CLK_I2C7>; 584 clocks = <&clock CLK_I2C6>;
584 clock-names = "i2c"; 585 clock-names = "i2c";
585 pinctrl-names = "default"; 586 pinctrl-names = "default";
586 pinctrl-0 = <&i2c7_bus>; 587 pinctrl-0 = <&i2c6_bus>;
587 status = "disabled"; 588 status = "disabled";
588 }; 589 };
589 590
590 i2c_8: i2c@138e0000 { 591 i2c_7: i2c@138d0000 {
591 #address-cells = <1>; 592 #address-cells = <1>;
592 #size-cells = <0>; 593 #size-cells = <0>;
593 compatible = "samsung,s3c2440-hdmiphy-i2c"; 594 compatible = "samsung,s3c2440-i2c";
594 reg = <0x138E0000 0x100>; 595 reg = <0x138D0000 0x100>;
595 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; 596 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
596 clocks = <&clock CLK_I2C_HDMI>; 597 clocks = <&clock CLK_I2C7>;
597 clock-names = "i2c"; 598 clock-names = "i2c";
598 status = "disabled"; 599 pinctrl-names = "default";
599 600 pinctrl-0 = <&i2c7_bus>;
600 hdmi_i2c_phy: hdmiphy@38 { 601 status = "disabled";
601 compatible = "exynos4210-hdmiphy";
602 reg = <0x38>;
603 }; 602 };
604 };
605 603
606 spi_0: spi@13920000 { 604 i2c_8: i2c@138e0000 {
607 compatible = "samsung,exynos4210-spi"; 605 #address-cells = <1>;
608 reg = <0x13920000 0x100>; 606 #size-cells = <0>;
609 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; 607 compatible = "samsung,s3c2440-hdmiphy-i2c";
610 dmas = <&pdma0 7>, <&pdma0 6>; 608 reg = <0x138E0000 0x100>;
611 dma-names = "tx", "rx"; 609 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
612 #address-cells = <1>; 610 clocks = <&clock CLK_I2C_HDMI>;
613 #size-cells = <0>; 611 clock-names = "i2c";
614 clocks = <&clock CLK_SPI0>, <&clock CLK_SCLK_SPI0>; 612 status = "disabled";
615 clock-names = "spi", "spi_busclk0";
616 pinctrl-names = "default";
617 pinctrl-0 = <&spi0_bus>;
618 status = "disabled";
619 };
620 613
621 spi_1: spi@13930000 { 614 hdmi_i2c_phy: hdmiphy@38 {
622 compatible = "samsung,exynos4210-spi"; 615 compatible = "exynos4210-hdmiphy";
623 reg = <0x13930000 0x100>; 616 reg = <0x38>;
624 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>; 617 };
625 dmas = <&pdma1 7>, <&pdma1 6>; 618 };
626 dma-names = "tx", "rx";
627 #address-cells = <1>;
628 #size-cells = <0>;
629 clocks = <&clock CLK_SPI1>, <&clock CLK_SCLK_SPI1>;
630 clock-names = "spi", "spi_busclk0";
631 pinctrl-names = "default";
632 pinctrl-0 = <&spi1_bus>;
633 status = "disabled";
634 };
635 619
636 spi_2: spi@13940000 { 620 spi_0: spi@13920000 {
637 compatible = "samsung,exynos4210-spi"; 621 compatible = "samsung,exynos4210-spi";
638 reg = <0x13940000 0x100>; 622 reg = <0x13920000 0x100>;
639 interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>; 623 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
640 dmas = <&pdma0 9>, <&pdma0 8>; 624 dmas = <&pdma0 7>, <&pdma0 6>;
641 dma-names = "tx", "rx"; 625 dma-names = "tx", "rx";
642 #address-cells = <1>; 626 #address-cells = <1>;
643 #size-cells = <0>; 627 #size-cells = <0>;
644 clocks = <&clock CLK_SPI2>, <&clock CLK_SCLK_SPI2>; 628 clocks = <&clock CLK_SPI0>, <&clock CLK_SCLK_SPI0>;
645 clock-names = "spi", "spi_busclk0"; 629 clock-names = "spi", "spi_busclk0";
646 pinctrl-names = "default"; 630 pinctrl-names = "default";
647 pinctrl-0 = <&spi2_bus>; 631 pinctrl-0 = <&spi0_bus>;
648 status = "disabled"; 632 status = "disabled";
649 }; 633 };
650 634
651 pwm: pwm@139d0000 { 635 spi_1: spi@13930000 {
652 compatible = "samsung,exynos4210-pwm"; 636 compatible = "samsung,exynos4210-spi";
653 reg = <0x139D0000 0x1000>; 637 reg = <0x13930000 0x100>;
654 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 638 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
655 <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 639 dmas = <&pdma1 7>, <&pdma1 6>;
656 <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 640 dma-names = "tx", "rx";
657 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 641 #address-cells = <1>;
658 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>; 642 #size-cells = <0>;
659 clocks = <&clock CLK_PWM>; 643 clocks = <&clock CLK_SPI1>, <&clock CLK_SCLK_SPI1>;
660 clock-names = "timers"; 644 clock-names = "spi", "spi_busclk0";
661 #pwm-cells = <3>; 645 pinctrl-names = "default";
662 status = "disabled"; 646 pinctrl-0 = <&spi1_bus>;
663 }; 647 status = "disabled";
648 };
664 649
665 amba { 650 spi_2: spi@13940000 {
666 #address-cells = <1>; 651 compatible = "samsung,exynos4210-spi";
667 #size-cells = <1>; 652 reg = <0x13940000 0x100>;
668 compatible = "simple-bus"; 653 interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
669 interrupt-parent = <&gic>; 654 dmas = <&pdma0 9>, <&pdma0 8>;
670 ranges; 655 dma-names = "tx", "rx";
656 #address-cells = <1>;
657 #size-cells = <0>;
658 clocks = <&clock CLK_SPI2>, <&clock CLK_SCLK_SPI2>;
659 clock-names = "spi", "spi_busclk0";
660 pinctrl-names = "default";
661 pinctrl-0 = <&spi2_bus>;
662 status = "disabled";
663 };
671 664
672 pdma0: pdma@12680000 { 665 pwm: pwm@139d0000 {
673 compatible = "arm,pl330", "arm,primecell"; 666 compatible = "samsung,exynos4210-pwm";
674 reg = <0x12680000 0x1000>; 667 reg = <0x139D0000 0x1000>;
675 interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; 668 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
676 clocks = <&clock CLK_PDMA0>; 669 <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
677 clock-names = "apb_pclk"; 670 <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
678 #dma-cells = <1>; 671 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
679 #dma-channels = <8>; 672 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
680 #dma-requests = <32>; 673 clocks = <&clock CLK_PWM>;
681 }; 674 clock-names = "timers";
682 675 #pwm-cells = <3>;
683 pdma1: pdma@12690000 { 676 status = "disabled";
684 compatible = "arm,pl330", "arm,primecell";
685 reg = <0x12690000 0x1000>;
686 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
687 clocks = <&clock CLK_PDMA1>;
688 clock-names = "apb_pclk";
689 #dma-cells = <1>;
690 #dma-channels = <8>;
691 #dma-requests = <32>;
692 };
693
694 mdma1: mdma@12850000 {
695 compatible = "arm,pl330", "arm,primecell";
696 reg = <0x12850000 0x1000>;
697 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
698 clocks = <&clock CLK_MDMA>;
699 clock-names = "apb_pclk";
700 #dma-cells = <1>;
701 #dma-channels = <8>;
702 #dma-requests = <1>;
703 }; 677 };
704 };
705 678
706 fimd: fimd@11c00000 { 679 amba {
707 compatible = "samsung,exynos4210-fimd"; 680 #address-cells = <1>;
708 interrupt-parent = <&combiner>; 681 #size-cells = <1>;
709 reg = <0x11c00000 0x20000>; 682 compatible = "simple-bus";
710 interrupt-names = "fifo", "vsync", "lcd_sys"; 683 interrupt-parent = <&gic>;
711 interrupts = <11 0>, <11 1>, <11 2>; 684 ranges;
712 clocks = <&clock CLK_SCLK_FIMD0>, <&clock CLK_FIMD0>; 685
713 clock-names = "sclk_fimd", "fimd"; 686 pdma0: pdma@12680000 {
714 power-domains = <&pd_lcd0>; 687 compatible = "arm,pl330", "arm,primecell";
715 iommus = <&sysmmu_fimd0>; 688 reg = <0x12680000 0x1000>;
716 samsung,sysreg = <&sys_reg>; 689 interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
717 status = "disabled"; 690 clocks = <&clock CLK_PDMA0>;
718 }; 691 clock-names = "apb_pclk";
692 #dma-cells = <1>;
693 #dma-channels = <8>;
694 #dma-requests = <32>;
695 };
696
697 pdma1: pdma@12690000 {
698 compatible = "arm,pl330", "arm,primecell";
699 reg = <0x12690000 0x1000>;
700 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
701 clocks = <&clock CLK_PDMA1>;
702 clock-names = "apb_pclk";
703 #dma-cells = <1>;
704 #dma-channels = <8>;
705 #dma-requests = <32>;
706 };
707
708 mdma1: mdma@12850000 {
709 compatible = "arm,pl330", "arm,primecell";
710 reg = <0x12850000 0x1000>;
711 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
712 clocks = <&clock CLK_MDMA>;
713 clock-names = "apb_pclk";
714 #dma-cells = <1>;
715 #dma-channels = <8>;
716 #dma-requests = <1>;
717 };
718 };
719 719
720 tmu: tmu@100c0000 { 720 fimd: fimd@11c00000 {
721 #include "exynos4412-tmu-sensor-conf.dtsi" 721 compatible = "samsung,exynos4210-fimd";
722 }; 722 interrupt-parent = <&combiner>;
723 reg = <0x11c00000 0x20000>;
724 interrupt-names = "fifo", "vsync", "lcd_sys";
725 interrupts = <11 0>, <11 1>, <11 2>;
726 clocks = <&clock CLK_SCLK_FIMD0>, <&clock CLK_FIMD0>;
727 clock-names = "sclk_fimd", "fimd";
728 power-domains = <&pd_lcd0>;
729 iommus = <&sysmmu_fimd0>;
730 samsung,sysreg = <&sys_reg>;
731 status = "disabled";
732 };
723 733
724 jpeg_codec: jpeg-codec@11840000 { 734 tmu: tmu@100c0000 {
725 compatible = "samsung,exynos4210-jpeg"; 735 interrupt-parent = <&combiner>;
726 reg = <0x11840000 0x1000>; 736 reg = <0x100C0000 0x100>;
727 interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>; 737 interrupts = <2 4>;
728 clocks = <&clock CLK_JPEG>; 738 status = "disabled";
729 clock-names = "jpeg"; 739 #include "exynos4412-tmu-sensor-conf.dtsi"
730 power-domains = <&pd_cam>; 740 };
731 iommus = <&sysmmu_jpeg>;
732 };
733 741
734 rotator: rotator@12810000 { 742 jpeg_codec: jpeg-codec@11840000 {
735 compatible = "samsung,exynos4210-rotator"; 743 compatible = "samsung,exynos4210-jpeg";
736 reg = <0x12810000 0x64>; 744 reg = <0x11840000 0x1000>;
737 interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>; 745 interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
738 clocks = <&clock CLK_ROTATOR>; 746 clocks = <&clock CLK_JPEG>;
739 clock-names = "rotator"; 747 clock-names = "jpeg";
740 iommus = <&sysmmu_rotator>; 748 power-domains = <&pd_cam>;
741 }; 749 iommus = <&sysmmu_jpeg>;
750 };
742 751
743 hdmi: hdmi@12d00000 { 752 rotator: rotator@12810000 {
744 compatible = "samsung,exynos4210-hdmi"; 753 compatible = "samsung,exynos4210-rotator";
745 reg = <0x12D00000 0x70000>; 754 reg = <0x12810000 0x64>;
746 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; 755 interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
747 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy", 756 clocks = <&clock CLK_ROTATOR>;
748 "mout_hdmi"; 757 clock-names = "rotator";
749 clocks = <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>, 758 iommus = <&sysmmu_rotator>;
750 <&clock CLK_SCLK_PIXEL>, <&clock CLK_SCLK_HDMIPHY>, 759 };
751 <&clock CLK_MOUT_HDMI>;
752 phy = <&hdmi_i2c_phy>;
753 power-domains = <&pd_tv>;
754 samsung,syscon-phandle = <&pmu_system_controller>;
755 #sound-dai-cells = <0>;
756 status = "disabled";
757 };
758 760
759 hdmicec: cec@100b0000 { 761 hdmi: hdmi@12d00000 {
760 compatible = "samsung,s5p-cec"; 762 compatible = "samsung,exynos4210-hdmi";
761 reg = <0x100B0000 0x200>; 763 reg = <0x12D00000 0x70000>;
762 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; 764 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
763 clocks = <&clock CLK_HDMI_CEC>; 765 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel",
764 clock-names = "hdmicec"; 766 "sclk_hdmiphy", "mout_hdmi";
765 samsung,syscon-phandle = <&pmu_system_controller>; 767 clocks = <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>,
766 hdmi-phandle = <&hdmi>; 768 <&clock CLK_SCLK_PIXEL>,
767 pinctrl-names = "default"; 769 <&clock CLK_SCLK_HDMIPHY>,
768 pinctrl-0 = <&hdmi_cec>; 770 <&clock CLK_MOUT_HDMI>;
769 status = "disabled"; 771 phy = <&hdmi_i2c_phy>;
770 }; 772 power-domains = <&pd_tv>;
773 samsung,syscon-phandle = <&pmu_system_controller>;
774 #sound-dai-cells = <0>;
775 status = "disabled";
776 };
771 777
772 mixer: mixer@12c10000 { 778 hdmicec: cec@100b0000 {
773 compatible = "samsung,exynos4210-mixer"; 779 compatible = "samsung,s5p-cec";
774 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; 780 reg = <0x100B0000 0x200>;
775 reg = <0x12C10000 0x2100>, <0x12c00000 0x300>; 781 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
776 power-domains = <&pd_tv>; 782 clocks = <&clock CLK_HDMI_CEC>;
777 iommus = <&sysmmu_tv>; 783 clock-names = "hdmicec";
778 status = "disabled"; 784 samsung,syscon-phandle = <&pmu_system_controller>;
779 }; 785 hdmi-phandle = <&hdmi>;
786 pinctrl-names = "default";
787 pinctrl-0 = <&hdmi_cec>;
788 status = "disabled";
789 };
780 790
781 ppmu_dmc0: ppmu_dmc0@106a0000 { 791 mixer: mixer@12c10000 {
782 compatible = "samsung,exynos-ppmu"; 792 compatible = "samsung,exynos4210-mixer";
783 reg = <0x106a0000 0x2000>; 793 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
784 clocks = <&clock CLK_PPMUDMC0>; 794 reg = <0x12C10000 0x2100>, <0x12c00000 0x300>;
785 clock-names = "ppmu"; 795 power-domains = <&pd_tv>;
786 status = "disabled"; 796 iommus = <&sysmmu_tv>;
787 }; 797 status = "disabled";
798 };
788 799
789 ppmu_dmc1: ppmu_dmc1@106b0000 { 800 ppmu_dmc0: ppmu_dmc0@106a0000 {
790 compatible = "samsung,exynos-ppmu"; 801 compatible = "samsung,exynos-ppmu";
791 reg = <0x106b0000 0x2000>; 802 reg = <0x106a0000 0x2000>;
792 clocks = <&clock CLK_PPMUDMC1>; 803 clocks = <&clock CLK_PPMUDMC0>;
793 clock-names = "ppmu"; 804 clock-names = "ppmu";
794 status = "disabled"; 805 status = "disabled";
795 }; 806 };
796 807
797 ppmu_cpu: ppmu_cpu@106c0000 { 808 ppmu_dmc1: ppmu_dmc1@106b0000 {
798 compatible = "samsung,exynos-ppmu"; 809 compatible = "samsung,exynos-ppmu";
799 reg = <0x106c0000 0x2000>; 810 reg = <0x106b0000 0x2000>;
800 clocks = <&clock CLK_PPMUCPU>; 811 clocks = <&clock CLK_PPMUDMC1>;
801 clock-names = "ppmu"; 812 clock-names = "ppmu";
802 status = "disabled"; 813 status = "disabled";
803 }; 814 };
804 815
805 ppmu_acp: ppmu_acp@10ae0000 { 816 ppmu_cpu: ppmu_cpu@106c0000 {
806 compatible = "samsung,exynos-ppmu"; 817 compatible = "samsung,exynos-ppmu";
807 reg = <0x106e0000 0x2000>; 818 reg = <0x106c0000 0x2000>;
808 status = "disabled"; 819 clocks = <&clock CLK_PPMUCPU>;
809 }; 820 clock-names = "ppmu";
821 status = "disabled";
822 };
810 823
811 ppmu_rightbus: ppmu_rightbus@112a0000 { 824 ppmu_rightbus: ppmu_rightbus@112a0000 {
812 compatible = "samsung,exynos-ppmu"; 825 compatible = "samsung,exynos-ppmu";
813 reg = <0x112a0000 0x2000>; 826 reg = <0x112a0000 0x2000>;
814 clocks = <&clock CLK_PPMURIGHT>; 827 clocks = <&clock CLK_PPMURIGHT>;
815 clock-names = "ppmu"; 828 clock-names = "ppmu";
816 status = "disabled"; 829 status = "disabled";
817 }; 830 };
818 831
819 ppmu_leftbus: ppmu_leftbus0@116a0000 { 832 ppmu_leftbus: ppmu_leftbus0@116a0000 {
820 compatible = "samsung,exynos-ppmu"; 833 compatible = "samsung,exynos-ppmu";
821 reg = <0x116a0000 0x2000>; 834 reg = <0x116a0000 0x2000>;
822 clocks = <&clock CLK_PPMULEFT>; 835 clocks = <&clock CLK_PPMULEFT>;
823 clock-names = "ppmu"; 836 clock-names = "ppmu";
824 status = "disabled"; 837 status = "disabled";
825 }; 838 };
826 839
827 ppmu_camif: ppmu_camif@11ac0000 { 840 ppmu_camif: ppmu_camif@11ac0000 {
828 compatible = "samsung,exynos-ppmu"; 841 compatible = "samsung,exynos-ppmu";
829 reg = <0x11ac0000 0x2000>; 842 reg = <0x11ac0000 0x2000>;
830 clocks = <&clock CLK_PPMUCAMIF>; 843 clocks = <&clock CLK_PPMUCAMIF>;
831 clock-names = "ppmu"; 844 clock-names = "ppmu";
832 status = "disabled"; 845 status = "disabled";
833 }; 846 };
834 847
835 ppmu_lcd0: ppmu_lcd0@11e40000 { 848 ppmu_lcd0: ppmu_lcd0@11e40000 {
836 compatible = "samsung,exynos-ppmu"; 849 compatible = "samsung,exynos-ppmu";
837 reg = <0x11e40000 0x2000>; 850 reg = <0x11e40000 0x2000>;
838 clocks = <&clock CLK_PPMULCD0>; 851 clocks = <&clock CLK_PPMULCD0>;
839 clock-names = "ppmu"; 852 clock-names = "ppmu";
840 status = "disabled"; 853 status = "disabled";
841 }; 854 };
842 855
843 ppmu_fsys: ppmu_g3d@12630000 { 856 ppmu_fsys: ppmu_g3d@12630000 {
844 compatible = "samsung,exynos-ppmu"; 857 compatible = "samsung,exynos-ppmu";
845 reg = <0x12630000 0x2000>; 858 reg = <0x12630000 0x2000>;
846 status = "disabled"; 859 status = "disabled";
847 }; 860 };
848 861
849 ppmu_image: ppmu_image@12aa0000 { 862 ppmu_image: ppmu_image@12aa0000 {
850 compatible = "samsung,exynos-ppmu"; 863 compatible = "samsung,exynos-ppmu";
851 reg = <0x12aa0000 0x2000>; 864 reg = <0x12aa0000 0x2000>;
852 clocks = <&clock CLK_PPMUIMAGE>; 865 clocks = <&clock CLK_PPMUIMAGE>;
853 clock-names = "ppmu"; 866 clock-names = "ppmu";
854 status = "disabled"; 867 status = "disabled";
855 }; 868 };
856 869
857 ppmu_tv: ppmu_tv@12e40000 { 870 ppmu_tv: ppmu_tv@12e40000 {
858 compatible = "samsung,exynos-ppmu"; 871 compatible = "samsung,exynos-ppmu";
859 reg = <0x12e40000 0x2000>; 872 reg = <0x12e40000 0x2000>;
860 clocks = <&clock CLK_PPMUTV>; 873 clocks = <&clock CLK_PPMUTV>;
861 clock-names = "ppmu"; 874 clock-names = "ppmu";
862 status = "disabled"; 875 status = "disabled";
863 }; 876 };
864 877
865 ppmu_g3d: ppmu_g3d@13220000 { 878 ppmu_g3d: ppmu_g3d@13220000 {
866 compatible = "samsung,exynos-ppmu"; 879 compatible = "samsung,exynos-ppmu";
867 reg = <0x13220000 0x2000>; 880 reg = <0x13220000 0x2000>;
868 clocks = <&clock CLK_PPMUG3D>; 881 clocks = <&clock CLK_PPMUG3D>;
869 clock-names = "ppmu"; 882 clock-names = "ppmu";
870 status = "disabled"; 883 status = "disabled";
871 }; 884 };
872 885
873 ppmu_mfc_left: ppmu_mfc_left@13660000 { 886 ppmu_mfc_left: ppmu_mfc_left@13660000 {
874 compatible = "samsung,exynos-ppmu"; 887 compatible = "samsung,exynos-ppmu";
875 reg = <0x13660000 0x2000>; 888 reg = <0x13660000 0x2000>;
876 clocks = <&clock CLK_PPMUMFC_L>; 889 clocks = <&clock CLK_PPMUMFC_L>;
877 clock-names = "ppmu"; 890 clock-names = "ppmu";
878 status = "disabled"; 891 status = "disabled";
879 }; 892 };
880 893
881 ppmu_mfc_right: ppmu_mfc_right@13670000 { 894 ppmu_mfc_right: ppmu_mfc_right@13670000 {
882 compatible = "samsung,exynos-ppmu"; 895 compatible = "samsung,exynos-ppmu";
883 reg = <0x13670000 0x2000>; 896 reg = <0x13670000 0x2000>;
884 clocks = <&clock CLK_PPMUMFC_R>; 897 clocks = <&clock CLK_PPMUMFC_R>;
885 clock-names = "ppmu"; 898 clock-names = "ppmu";
886 status = "disabled"; 899 status = "disabled";
887 }; 900 };
888 901
889 sysmmu_mfc_l: sysmmu@13620000 { 902 sysmmu_mfc_l: sysmmu@13620000 {
890 compatible = "samsung,exynos-sysmmu"; 903 compatible = "samsung,exynos-sysmmu";
891 reg = <0x13620000 0x1000>; 904 reg = <0x13620000 0x1000>;
892 interrupt-parent = <&combiner>; 905 interrupt-parent = <&combiner>;
893 interrupts = <5 5>; 906 interrupts = <5 5>;
894 clock-names = "sysmmu", "master"; 907 clock-names = "sysmmu", "master";
895 clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>; 908 clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>;
896 power-domains = <&pd_mfc>; 909 power-domains = <&pd_mfc>;
897 #iommu-cells = <0>; 910 #iommu-cells = <0>;
898 }; 911 };
899 912
900 sysmmu_mfc_r: sysmmu@13630000 { 913 sysmmu_mfc_r: sysmmu@13630000 {
901 compatible = "samsung,exynos-sysmmu"; 914 compatible = "samsung,exynos-sysmmu";
902 reg = <0x13630000 0x1000>; 915 reg = <0x13630000 0x1000>;
903 interrupt-parent = <&combiner>; 916 interrupt-parent = <&combiner>;
904 interrupts = <5 6>; 917 interrupts = <5 6>;
905 clock-names = "sysmmu", "master"; 918 clock-names = "sysmmu", "master";
906 clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>; 919 clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>;
907 power-domains = <&pd_mfc>; 920 power-domains = <&pd_mfc>;
908 #iommu-cells = <0>; 921 #iommu-cells = <0>;
909 }; 922 };
910 923
911 sysmmu_tv: sysmmu@12e20000 { 924 sysmmu_tv: sysmmu@12e20000 {
912 compatible = "samsung,exynos-sysmmu"; 925 compatible = "samsung,exynos-sysmmu";
913 reg = <0x12E20000 0x1000>; 926 reg = <0x12E20000 0x1000>;
914 interrupt-parent = <&combiner>; 927 interrupt-parent = <&combiner>;
915 interrupts = <5 4>; 928 interrupts = <5 4>;
916 clock-names = "sysmmu", "master"; 929 clock-names = "sysmmu", "master";
917 clocks = <&clock CLK_SMMU_TV>, <&clock CLK_MIXER>; 930 clocks = <&clock CLK_SMMU_TV>, <&clock CLK_MIXER>;
918 power-domains = <&pd_tv>; 931 power-domains = <&pd_tv>;
919 #iommu-cells = <0>; 932 #iommu-cells = <0>;
920 }; 933 };
921 934
922 sysmmu_fimc0: sysmmu@11a20000 { 935 sysmmu_fimc0: sysmmu@11a20000 {
923 compatible = "samsung,exynos-sysmmu"; 936 compatible = "samsung,exynos-sysmmu";
924 reg = <0x11A20000 0x1000>; 937 reg = <0x11A20000 0x1000>;
925 interrupt-parent = <&combiner>; 938 interrupt-parent = <&combiner>;
926 interrupts = <4 2>; 939 interrupts = <4 2>;
927 clock-names = "sysmmu", "master"; 940 clock-names = "sysmmu", "master";
928 clocks = <&clock CLK_SMMU_FIMC0>, <&clock CLK_FIMC0>; 941 clocks = <&clock CLK_SMMU_FIMC0>, <&clock CLK_FIMC0>;
929 power-domains = <&pd_cam>; 942 power-domains = <&pd_cam>;
930 #iommu-cells = <0>; 943 #iommu-cells = <0>;
931 }; 944 };
932 945
933 sysmmu_fimc1: sysmmu@11a30000 { 946 sysmmu_fimc1: sysmmu@11a30000 {
934 compatible = "samsung,exynos-sysmmu"; 947 compatible = "samsung,exynos-sysmmu";
935 reg = <0x11A30000 0x1000>; 948 reg = <0x11A30000 0x1000>;
936 interrupt-parent = <&combiner>; 949 interrupt-parent = <&combiner>;
937 interrupts = <4 3>; 950 interrupts = <4 3>;
938 clock-names = "sysmmu", "master"; 951 clock-names = "sysmmu", "master";
939 clocks = <&clock CLK_SMMU_FIMC1>, <&clock CLK_FIMC1>; 952 clocks = <&clock CLK_SMMU_FIMC1>, <&clock CLK_FIMC1>;
940 power-domains = <&pd_cam>; 953 power-domains = <&pd_cam>;
941 #iommu-cells = <0>; 954 #iommu-cells = <0>;
942 }; 955 };
943 956
944 sysmmu_fimc2: sysmmu@11a40000 { 957 sysmmu_fimc2: sysmmu@11a40000 {
945 compatible = "samsung,exynos-sysmmu"; 958 compatible = "samsung,exynos-sysmmu";
946 reg = <0x11A40000 0x1000>; 959 reg = <0x11A40000 0x1000>;
947 interrupt-parent = <&combiner>; 960 interrupt-parent = <&combiner>;
948 interrupts = <4 4>; 961 interrupts = <4 4>;
949 clock-names = "sysmmu", "master"; 962 clock-names = "sysmmu", "master";
950 clocks = <&clock CLK_SMMU_FIMC2>, <&clock CLK_FIMC2>; 963 clocks = <&clock CLK_SMMU_FIMC2>, <&clock CLK_FIMC2>;
951 power-domains = <&pd_cam>; 964 power-domains = <&pd_cam>;
952 #iommu-cells = <0>; 965 #iommu-cells = <0>;
953 }; 966 };
954 967
955 sysmmu_fimc3: sysmmu@11a50000 { 968 sysmmu_fimc3: sysmmu@11a50000 {
956 compatible = "samsung,exynos-sysmmu"; 969 compatible = "samsung,exynos-sysmmu";
957 reg = <0x11A50000 0x1000>; 970 reg = <0x11A50000 0x1000>;
958 interrupt-parent = <&combiner>; 971 interrupt-parent = <&combiner>;
959 interrupts = <4 5>; 972 interrupts = <4 5>;
960 clock-names = "sysmmu", "master"; 973 clock-names = "sysmmu", "master";
961 clocks = <&clock CLK_SMMU_FIMC3>, <&clock CLK_FIMC3>; 974 clocks = <&clock CLK_SMMU_FIMC3>, <&clock CLK_FIMC3>;
962 power-domains = <&pd_cam>; 975 power-domains = <&pd_cam>;
963 #iommu-cells = <0>; 976 #iommu-cells = <0>;
964 }; 977 };
965 978
966 sysmmu_jpeg: sysmmu@11a60000 { 979 sysmmu_jpeg: sysmmu@11a60000 {
967 compatible = "samsung,exynos-sysmmu"; 980 compatible = "samsung,exynos-sysmmu";
968 reg = <0x11A60000 0x1000>; 981 reg = <0x11A60000 0x1000>;
969 interrupt-parent = <&combiner>; 982 interrupt-parent = <&combiner>;
970 interrupts = <4 6>; 983 interrupts = <4 6>;
971 clock-names = "sysmmu", "master"; 984 clock-names = "sysmmu", "master";
972 clocks = <&clock CLK_SMMU_JPEG>, <&clock CLK_JPEG>; 985 clocks = <&clock CLK_SMMU_JPEG>, <&clock CLK_JPEG>;
973 power-domains = <&pd_cam>; 986 power-domains = <&pd_cam>;
974 #iommu-cells = <0>; 987 #iommu-cells = <0>;
975 }; 988 };
976 989
977 sysmmu_rotator: sysmmu@12a30000 { 990 sysmmu_rotator: sysmmu@12a30000 {
978 compatible = "samsung,exynos-sysmmu"; 991 compatible = "samsung,exynos-sysmmu";
979 reg = <0x12A30000 0x1000>; 992 reg = <0x12A30000 0x1000>;
980 interrupt-parent = <&combiner>; 993 interrupt-parent = <&combiner>;
981 interrupts = <5 0>; 994 interrupts = <5 0>;
982 clock-names = "sysmmu", "master"; 995 clock-names = "sysmmu", "master";
983 clocks = <&clock CLK_SMMU_ROTATOR>, <&clock CLK_ROTATOR>; 996 clocks = <&clock CLK_SMMU_ROTATOR>,
984 #iommu-cells = <0>; 997 <&clock CLK_ROTATOR>;
985 }; 998 #iommu-cells = <0>;
999 };
986 1000
987 sysmmu_fimd0: sysmmu@11e20000 { 1001 sysmmu_fimd0: sysmmu@11e20000 {
988 compatible = "samsung,exynos-sysmmu"; 1002 compatible = "samsung,exynos-sysmmu";
989 reg = <0x11E20000 0x1000>; 1003 reg = <0x11E20000 0x1000>;
990 interrupt-parent = <&combiner>; 1004 interrupt-parent = <&combiner>;
991 interrupts = <5 2>; 1005 interrupts = <5 2>;
992 clock-names = "sysmmu", "master"; 1006 clock-names = "sysmmu", "master";
993 clocks = <&clock CLK_SMMU_FIMD0>, <&clock CLK_FIMD0>; 1007 clocks = <&clock CLK_SMMU_FIMD0>, <&clock CLK_FIMD0>;
994 power-domains = <&pd_lcd0>; 1008 power-domains = <&pd_lcd0>;
995 #iommu-cells = <0>; 1009 #iommu-cells = <0>;
996 }; 1010 };
997 1011
998 sss: sss@10830000 { 1012 sss: sss@10830000 {
999 compatible = "samsung,exynos4210-secss"; 1013 compatible = "samsung,exynos4210-secss";
1000 reg = <0x10830000 0x300>; 1014 reg = <0x10830000 0x300>;
1001 interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>; 1015 interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
1002 clocks = <&clock CLK_SSS>; 1016 clocks = <&clock CLK_SSS>;
1003 clock-names = "secss"; 1017 clock-names = "secss";
1004 }; 1018 };
1005 1019
1006 prng: rng@10830400 { 1020 prng: rng@10830400 {
1007 compatible = "samsung,exynos4-rng"; 1021 compatible = "samsung,exynos4-rng";
1008 reg = <0x10830400 0x200>; 1022 reg = <0x10830400 0x200>;
1009 clocks = <&clock CLK_SSS>; 1023 clocks = <&clock CLK_SSS>;
1010 clock-names = "secss"; 1024 clock-names = "secss";
1025 };
1011 }; 1026 };
1012}; 1027};
diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index dbe6c052d8c1..520c5934a8d4 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -13,853 +13,851 @@
13 13
14#include <dt-bindings/pinctrl/samsung.h> 14#include <dt-bindings/pinctrl/samsung.h>
15 15
16/ { 16&pinctrl_0 {
17 pinctrl@11400000 { 17 gpa0: gpa0 {
18 gpa0: gpa0 { 18 gpio-controller;
19 gpio-controller; 19 #gpio-cells = <2>;
20 #gpio-cells = <2>;
21 20
22 interrupt-controller; 21 interrupt-controller;
23 #interrupt-cells = <2>; 22 #interrupt-cells = <2>;
24 }; 23 };
24
25 gpa1: gpa1 {
26 gpio-controller;
27 #gpio-cells = <2>;
28
29 interrupt-controller;
30 #interrupt-cells = <2>;
31 };
32
33 gpb: gpb {
34 gpio-controller;
35 #gpio-cells = <2>;
36
37 interrupt-controller;
38 #interrupt-cells = <2>;
39 };
40
41 gpc0: gpc0 {
42 gpio-controller;
43 #gpio-cells = <2>;
44
45 interrupt-controller;
46 #interrupt-cells = <2>;
47 };
48
49 gpc1: gpc1 {
50 gpio-controller;
51 #gpio-cells = <2>;
52
53 interrupt-controller;
54 #interrupt-cells = <2>;
55 };
56
57 gpd0: gpd0 {
58 gpio-controller;
59 #gpio-cells = <2>;
60
61 interrupt-controller;
62 #interrupt-cells = <2>;
63 };
64
65 gpd1: gpd1 {
66 gpio-controller;
67 #gpio-cells = <2>;
68
69 interrupt-controller;
70 #interrupt-cells = <2>;
71 };
72
73 gpe0: gpe0 {
74 gpio-controller;
75 #gpio-cells = <2>;
76
77 interrupt-controller;
78 #interrupt-cells = <2>;
79 };
80
81 gpe1: gpe1 {
82 gpio-controller;
83 #gpio-cells = <2>;
84
85 interrupt-controller;
86 #interrupt-cells = <2>;
87 };
88
89 gpe2: gpe2 {
90 gpio-controller;
91 #gpio-cells = <2>;
92
93 interrupt-controller;
94 #interrupt-cells = <2>;
95 };
96
97 gpe3: gpe3 {
98 gpio-controller;
99 #gpio-cells = <2>;
100
101 interrupt-controller;
102 #interrupt-cells = <2>;
103 };
104
105 gpe4: gpe4 {
106 gpio-controller;
107 #gpio-cells = <2>;
108
109 interrupt-controller;
110 #interrupt-cells = <2>;
111 };
112
113 gpf0: gpf0 {
114 gpio-controller;
115 #gpio-cells = <2>;
116
117 interrupt-controller;
118 #interrupt-cells = <2>;
119 };
120
121 gpf1: gpf1 {
122 gpio-controller;
123 #gpio-cells = <2>;
124
125 interrupt-controller;
126 #interrupt-cells = <2>;
127 };
128
129 gpf2: gpf2 {
130 gpio-controller;
131 #gpio-cells = <2>;
132
133 interrupt-controller;
134 #interrupt-cells = <2>;
135 };
136
137 gpf3: gpf3 {
138 gpio-controller;
139 #gpio-cells = <2>;
140
141 interrupt-controller;
142 #interrupt-cells = <2>;
143 };
144
145 uart0_data: uart0-data {
146 samsung,pins = "gpa0-0", "gpa0-1";
147 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
148 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
149 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
150 };
151
152 uart0_fctl: uart0-fctl {
153 samsung,pins = "gpa0-2", "gpa0-3";
154 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
155 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
156 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
157 };
158
159 uart1_data: uart1-data {
160 samsung,pins = "gpa0-4", "gpa0-5";
161 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
162 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
163 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
164 };
165
166 uart1_fctl: uart1-fctl {
167 samsung,pins = "gpa0-6", "gpa0-7";
168 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
169 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
170 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
171 };
172
173 i2c2_bus: i2c2-bus {
174 samsung,pins = "gpa0-6", "gpa0-7";
175 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
176 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
177 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
178 };
179
180 uart2_data: uart2-data {
181 samsung,pins = "gpa1-0", "gpa1-1";
182 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
183 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
184 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
185 };
186
187 uart2_fctl: uart2-fctl {
188 samsung,pins = "gpa1-2", "gpa1-3";
189 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
190 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
191 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
192 };
193
194 uart_audio_a: uart-audio-a {
195 samsung,pins = "gpa1-0", "gpa1-1";
196 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
197 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
198 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
199 };
200
201 i2c3_bus: i2c3-bus {
202 samsung,pins = "gpa1-2", "gpa1-3";
203 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
204 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
205 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
206 };
207
208 uart3_data: uart3-data {
209 samsung,pins = "gpa1-4", "gpa1-5";
210 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
211 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
212 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
213 };
214
215 uart_audio_b: uart-audio-b {
216 samsung,pins = "gpa1-4", "gpa1-5";
217 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
218 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
219 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
220 };
221
222 spi0_bus: spi0-bus {
223 samsung,pins = "gpb-0", "gpb-2", "gpb-3";
224 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
225 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
226 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
227 };
228
229 i2c4_bus: i2c4-bus {
230 samsung,pins = "gpb-2", "gpb-3";
231 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
232 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
233 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
234 };
235
236 spi1_bus: spi1-bus {
237 samsung,pins = "gpb-4", "gpb-6", "gpb-7";
238 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
239 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
240 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
241 };
242
243 i2c5_bus: i2c5-bus {
244 samsung,pins = "gpb-6", "gpb-7";
245 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
246 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
247 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
248 };
249
250 i2s1_bus: i2s1-bus {
251 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
252 "gpc0-4";
253 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
254 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
255 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
256 };
257
258 pcm1_bus: pcm1-bus {
259 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
260 "gpc0-4";
261 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
262 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
263 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
264 };
265
266 ac97_bus: ac97-bus {
267 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
268 "gpc0-4";
269 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
270 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
271 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
272 };
273
274 i2s2_bus: i2s2-bus {
275 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
276 "gpc1-4";
277 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
278 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
279 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
280 };
281
282 pcm2_bus: pcm2-bus {
283 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
284 "gpc1-4";
285 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
286 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
287 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
288 };
289
290 spdif_bus: spdif-bus {
291 samsung,pins = "gpc1-0", "gpc1-1";
292 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
293 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
294 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
295 };
296
297 i2c6_bus: i2c6-bus {
298 samsung,pins = "gpc1-3", "gpc1-4";
299 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
300 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
301 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
302 };
303
304 spi2_bus: spi2-bus {
305 samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4";
306 samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
307 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
308 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
309 };
310
311 i2c7_bus: i2c7-bus {
312 samsung,pins = "gpd0-2", "gpd0-3";
313 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
314 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
315 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
316 };
317
318 i2c0_bus: i2c0-bus {
319 samsung,pins = "gpd1-0", "gpd1-1";
320 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
321 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
322 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
323 };
324
325 i2c1_bus: i2c1-bus {
326 samsung,pins = "gpd1-2", "gpd1-3";
327 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
328 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
329 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
330 };
331
332 pwm0_out: pwm0-out {
333 samsung,pins = "gpd0-0";
334 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
335 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
336 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
337 };
338
339 pwm1_out: pwm1-out {
340 samsung,pins = "gpd0-1";
341 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
342 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
343 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
344 };
345
346 pwm2_out: pwm2-out {
347 samsung,pins = "gpd0-2";
348 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
349 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
350 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
351 };
352
353 pwm3_out: pwm3-out {
354 samsung,pins = "gpd0-3";
355 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
356 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
357 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
358 };
359
360 lcd_ctrl: lcd-ctrl {
361 samsung,pins = "gpd0-0", "gpd0-1";
362 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
363 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
364 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
365 };
366
367 lcd_sync: lcd-sync {
368 samsung,pins = "gpf0-0", "gpf0-1";
369 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
370 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
371 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
372 };
373
374 lcd_en: lcd-en {
375 samsung,pins = "gpe3-4";
376 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
377 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
378 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
379 };
380
381 lcd_clk: lcd-clk {
382 samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
383 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
384 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
385 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
386 };
387
388 lcd_data16: lcd-data-width16 {
389 samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
390 "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
391 "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
392 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
393 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
394 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
395 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
396 };
397
398 lcd_data18: lcd-data-width18 {
399 samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
400 "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
401 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
402 "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1",
403 "gpf3-2", "gpf3-3";
404 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
405 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
406 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
407 };
408
409 lcd_data24: lcd-data-width24 {
410 samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
411 "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
412 "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
413 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
414 "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7",
415 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
416 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
417 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
418 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
419 };
420};
421
422&pinctrl_1 {
423 gpj0: gpj0 {
424 gpio-controller;
425 #gpio-cells = <2>;
426
427 interrupt-controller;
428 #interrupt-cells = <2>;
429 };
430
431 gpj1: gpj1 {
432 gpio-controller;
433 #gpio-cells = <2>;
434
435 interrupt-controller;
436 #interrupt-cells = <2>;
437 };
438
439 gpk0: gpk0 {
440 gpio-controller;
441 #gpio-cells = <2>;
442
443 interrupt-controller;
444 #interrupt-cells = <2>;
445 };
446
447 gpk1: gpk1 {
448 gpio-controller;
449 #gpio-cells = <2>;
450
451 interrupt-controller;
452 #interrupt-cells = <2>;
453 };
454
455 gpk2: gpk2 {
456 gpio-controller;
457 #gpio-cells = <2>;
458
459 interrupt-controller;
460 #interrupt-cells = <2>;
461 };
462
463 gpk3: gpk3 {
464 gpio-controller;
465 #gpio-cells = <2>;
466
467 interrupt-controller;
468 #interrupt-cells = <2>;
469 };
470
471 gpl0: gpl0 {
472 gpio-controller;
473 #gpio-cells = <2>;
474
475 interrupt-controller;
476 #interrupt-cells = <2>;
477 };
478
479 gpl1: gpl1 {
480 gpio-controller;
481 #gpio-cells = <2>;
482
483 interrupt-controller;
484 #interrupt-cells = <2>;
485 };
486
487 gpl2: gpl2 {
488 gpio-controller;
489 #gpio-cells = <2>;
490
491 interrupt-controller;
492 #interrupt-cells = <2>;
493 };
494
495 gpy0: gpy0 {
496 gpio-controller;
497 #gpio-cells = <2>;
498 };
499
500 gpy1: gpy1 {
501 gpio-controller;
502 #gpio-cells = <2>;
503 };
504
505 gpy2: gpy2 {
506 gpio-controller;
507 #gpio-cells = <2>;
508 };
25 509
26 gpa1: gpa1 { 510 gpy3: gpy3 {
27 gpio-controller; 511 gpio-controller;
28 #gpio-cells = <2>; 512 #gpio-cells = <2>;
513 };
514
515 gpy4: gpy4 {
516 gpio-controller;
517 #gpio-cells = <2>;
518 };
519
520 gpy5: gpy5 {
521 gpio-controller;
522 #gpio-cells = <2>;
523 };
524
525 gpy6: gpy6 {
526 gpio-controller;
527 #gpio-cells = <2>;
528 };
529
530 gpx0: gpx0 {
531 gpio-controller;
532 #gpio-cells = <2>;
533
534 interrupt-controller;
535 interrupt-parent = <&gic>;
536 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
537 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
538 <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
539 <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
540 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
541 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
542 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
543 <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
544 #interrupt-cells = <2>;
545 };
546
547 gpx1: gpx1 {
548 gpio-controller;
549 #gpio-cells = <2>;
550
551 interrupt-controller;
552 interrupt-parent = <&gic>;
553 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
554 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
555 <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
556 <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
557 <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
558 <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
559 <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
560 <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
561 #interrupt-cells = <2>;
562 };
563
564 gpx2: gpx2 {
565 gpio-controller;
566 #gpio-cells = <2>;
29 567
30 interrupt-controller; 568 interrupt-controller;
31 #interrupt-cells = <2>; 569 #interrupt-cells = <2>;
32 }; 570 };
571
572 gpx3: gpx3 {
573 gpio-controller;
574 #gpio-cells = <2>;
33 575
34 gpb: gpb { 576 interrupt-controller;
35 gpio-controller; 577 #interrupt-cells = <2>;
36 #gpio-cells = <2>; 578 };
37 579
38 interrupt-controller; 580 sd0_clk: sd0-clk {
39 #interrupt-cells = <2>; 581 samsung,pins = "gpk0-0";
40 }; 582 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
583 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
584 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
585 };
41 586
42 gpc0: gpc0 { 587 sd0_cmd: sd0-cmd {
43 gpio-controller; 588 samsung,pins = "gpk0-1";
44 #gpio-cells = <2>; 589 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
590 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
591 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
592 };
593
594 sd0_cd: sd0-cd {
595 samsung,pins = "gpk0-2";
596 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
597 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
598 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
599 };
600
601 sd0_bus1: sd0-bus-width1 {
602 samsung,pins = "gpk0-3";
603 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
604 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
605 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
606 };
607
608 sd0_bus4: sd0-bus-width4 {
609 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
610 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
611 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
612 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
613 };
614
615 sd0_bus8: sd0-bus-width8 {
616 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
617 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
618 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
619 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
620 };
621
622 sd4_clk: sd4-clk {
623 samsung,pins = "gpk0-0";
624 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
625 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
626 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
627 };
628
629 sd4_cmd: sd4-cmd {
630 samsung,pins = "gpk0-1";
631 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
632 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
633 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
634 };
635
636 sd4_cd: sd4-cd {
637 samsung,pins = "gpk0-2";
638 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
639 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
640 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
641 };
642
643 sd4_bus1: sd4-bus-width1 {
644 samsung,pins = "gpk0-3";
645 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
646 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
647 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
648 };
649
650 sd4_bus4: sd4-bus-width4 {
651 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
652 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
653 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
654 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
655 };
656
657 sd4_bus8: sd4-bus-width8 {
658 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
659 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
660 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
661 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
662 };
663
664 sd1_clk: sd1-clk {
665 samsung,pins = "gpk1-0";
666 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
667 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
668 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
669 };
670
671 sd1_cmd: sd1-cmd {
672 samsung,pins = "gpk1-1";
673 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
674 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
675 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
676 };
677
678 sd1_cd: sd1-cd {
679 samsung,pins = "gpk1-2";
680 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
681 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
682 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
683 };
684
685 sd1_bus1: sd1-bus-width1 {
686 samsung,pins = "gpk1-3";
687 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
688 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
689 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
690 };
691
692 sd1_bus4: sd1-bus-width4 {
693 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
694 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
695 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
696 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
697 };
698
699 sd2_clk: sd2-clk {
700 samsung,pins = "gpk2-0";
701 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
702 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
703 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
704 };
705
706 sd2_cmd: sd2-cmd {
707 samsung,pins = "gpk2-1";
708 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
709 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
710 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
711 };
712
713 sd2_cd: sd2-cd {
714 samsung,pins = "gpk2-2";
715 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
716 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
717 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
718 };
719
720 sd2_bus1: sd2-bus-width1 {
721 samsung,pins = "gpk2-3";
722 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
723 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
724 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
725 };
726
727 sd2_bus4: sd2-bus-width4 {
728 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
729 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
730 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
731 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
732 };
733
734 sd2_bus8: sd2-bus-width8 {
735 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
736 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
737 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
738 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
739 };
740
741 sd3_clk: sd3-clk {
742 samsung,pins = "gpk3-0";
743 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
744 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
745 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
746 };
747
748 sd3_cmd: sd3-cmd {
749 samsung,pins = "gpk3-1";
750 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
751 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
752 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
753 };
754
755 sd3_cd: sd3-cd {
756 samsung,pins = "gpk3-2";
757 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
758 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
759 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
760 };
761
762 sd3_bus1: sd3-bus-width1 {
763 samsung,pins = "gpk3-3";
764 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
765 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
766 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
767 };
768
769 sd3_bus4: sd3-bus-width4 {
770 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
771 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
772 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
773 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
774 };
775
776 eint0: ext-int0 {
777 samsung,pins = "gpx0-0";
778 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
779 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
780 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
781 };
782
783 eint8: ext-int8 {
784 samsung,pins = "gpx1-0";
785 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
786 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
787 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
788 };
789
790 eint15: ext-int15 {
791 samsung,pins = "gpx1-7";
792 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
793 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
794 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
795 };
796
797 eint16: ext-int16 {
798 samsung,pins = "gpx2-0";
799 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
800 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
801 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
802 };
803
804 eint31: ext-int31 {
805 samsung,pins = "gpx3-7";
806 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
807 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
808 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
809 };
810
811 cam_port_a_io: cam-port-a-io {
812 samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
813 "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
814 "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
815 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
816 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
817 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
818 };
819
820 cam_port_a_clk_active: cam-port-a-clk-active {
821 samsung,pins = "gpj1-3";
822 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
823 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
824 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
825 };
826
827 cam_port_a_clk_idle: cam-port-a-clk-idle {
828 samsung,pins = "gpj1-3";
829 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
830 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
831 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
832 };
833
834 hdmi_cec: hdmi-cec {
835 samsung,pins = "gpx3-6";
836 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
837 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
838 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
839 };
840};
841
842&pinctrl_2 {
843 gpz: gpz {
844 gpio-controller;
845 #gpio-cells = <2>;
846 };
847
848 i2s0_bus: i2s0-bus {
849 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
850 "gpz-4", "gpz-5", "gpz-6";
851 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
852 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
853 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
854 };
45 855
46 interrupt-controller; 856 pcm0_bus: pcm0-bus {
47 #interrupt-cells = <2>; 857 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
48 }; 858 "gpz-4";
49 859 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
50 gpc1: gpc1 { 860 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
51 gpio-controller; 861 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
52 #gpio-cells = <2>;
53
54 interrupt-controller;
55 #interrupt-cells = <2>;
56 };
57
58 gpd0: gpd0 {
59 gpio-controller;
60 #gpio-cells = <2>;
61
62 interrupt-controller;
63 #interrupt-cells = <2>;
64 };
65
66 gpd1: gpd1 {
67 gpio-controller;
68 #gpio-cells = <2>;
69
70 interrupt-controller;
71 #interrupt-cells = <2>;
72 };
73
74 gpe0: gpe0 {
75 gpio-controller;
76 #gpio-cells = <2>;
77
78 interrupt-controller;
79 #interrupt-cells = <2>;
80 };
81
82 gpe1: gpe1 {
83 gpio-controller;
84 #gpio-cells = <2>;
85
86 interrupt-controller;
87 #interrupt-cells = <2>;
88 };
89
90 gpe2: gpe2 {
91 gpio-controller;
92 #gpio-cells = <2>;
93
94 interrupt-controller;
95 #interrupt-cells = <2>;
96 };
97
98 gpe3: gpe3 {
99 gpio-controller;
100 #gpio-cells = <2>;
101
102 interrupt-controller;
103 #interrupt-cells = <2>;
104 };
105
106 gpe4: gpe4 {
107 gpio-controller;
108 #gpio-cells = <2>;
109
110 interrupt-controller;
111 #interrupt-cells = <2>;
112 };
113
114 gpf0: gpf0 {
115 gpio-controller;
116 #gpio-cells = <2>;
117
118 interrupt-controller;
119 #interrupt-cells = <2>;
120 };
121
122 gpf1: gpf1 {
123 gpio-controller;
124 #gpio-cells = <2>;
125
126 interrupt-controller;
127 #interrupt-cells = <2>;
128 };
129
130 gpf2: gpf2 {
131 gpio-controller;
132 #gpio-cells = <2>;
133
134 interrupt-controller;
135 #interrupt-cells = <2>;
136 };
137
138 gpf3: gpf3 {
139 gpio-controller;
140 #gpio-cells = <2>;
141
142 interrupt-controller;
143 #interrupt-cells = <2>;
144 };
145
146 uart0_data: uart0-data {
147 samsung,pins = "gpa0-0", "gpa0-1";
148 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
149 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
150 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
151 };
152
153 uart0_fctl: uart0-fctl {
154 samsung,pins = "gpa0-2", "gpa0-3";
155 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
156 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
157 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
158 };
159
160 uart1_data: uart1-data {
161 samsung,pins = "gpa0-4", "gpa0-5";
162 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
163 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
164 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
165 };
166
167 uart1_fctl: uart1-fctl {
168 samsung,pins = "gpa0-6", "gpa0-7";
169 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
170 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
171 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
172 };
173
174 i2c2_bus: i2c2-bus {
175 samsung,pins = "gpa0-6", "gpa0-7";
176 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
177 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
178 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
179 };
180
181 uart2_data: uart2-data {
182 samsung,pins = "gpa1-0", "gpa1-1";
183 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
184 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
185 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
186 };
187
188 uart2_fctl: uart2-fctl {
189 samsung,pins = "gpa1-2", "gpa1-3";
190 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
191 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
192 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
193 };
194
195 uart_audio_a: uart-audio-a {
196 samsung,pins = "gpa1-0", "gpa1-1";
197 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
198 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
199 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
200 };
201
202 i2c3_bus: i2c3-bus {
203 samsung,pins = "gpa1-2", "gpa1-3";
204 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
205 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
206 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
207 };
208
209 uart3_data: uart3-data {
210 samsung,pins = "gpa1-4", "gpa1-5";
211 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
212 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
213 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
214 };
215
216 uart_audio_b: uart-audio-b {
217 samsung,pins = "gpa1-4", "gpa1-5";
218 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
219 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
220 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
221 };
222
223 spi0_bus: spi0-bus {
224 samsung,pins = "gpb-0", "gpb-2", "gpb-3";
225 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
226 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
227 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
228 };
229
230 i2c4_bus: i2c4-bus {
231 samsung,pins = "gpb-2", "gpb-3";
232 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
233 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
234 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
235 };
236
237 spi1_bus: spi1-bus {
238 samsung,pins = "gpb-4", "gpb-6", "gpb-7";
239 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
240 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
241 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
242 };
243
244 i2c5_bus: i2c5-bus {
245 samsung,pins = "gpb-6", "gpb-7";
246 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
247 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
248 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
249 };
250
251 i2s1_bus: i2s1-bus {
252 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
253 "gpc0-4";
254 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
255 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
256 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
257 };
258
259 pcm1_bus: pcm1-bus {
260 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
261 "gpc0-4";
262 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
263 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
264 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
265 };
266
267 ac97_bus: ac97-bus {
268 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
269 "gpc0-4";
270 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
271 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
272 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
273 };
274
275 i2s2_bus: i2s2-bus {
276 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
277 "gpc1-4";
278 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
279 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
280 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
281 };
282
283 pcm2_bus: pcm2-bus {
284 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
285 "gpc1-4";
286 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
287 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
288 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
289 };
290
291 spdif_bus: spdif-bus {
292 samsung,pins = "gpc1-0", "gpc1-1";
293 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
294 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
295 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
296 };
297
298 i2c6_bus: i2c6-bus {
299 samsung,pins = "gpc1-3", "gpc1-4";
300 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
301 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
302 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
303 };
304
305 spi2_bus: spi2-bus {
306 samsung,pins = "gpc1-1", "gpc1-2", "gpc1-3", "gpc1-4";
307 samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
308 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
309 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
310 };
311
312 i2c7_bus: i2c7-bus {
313 samsung,pins = "gpd0-2", "gpd0-3";
314 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
315 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
316 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
317 };
318
319 i2c0_bus: i2c0-bus {
320 samsung,pins = "gpd1-0", "gpd1-1";
321 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
322 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
323 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
324 };
325
326 i2c1_bus: i2c1-bus {
327 samsung,pins = "gpd1-2", "gpd1-3";
328 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
329 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
330 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
331 };
332
333 pwm0_out: pwm0-out {
334 samsung,pins = "gpd0-0";
335 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
336 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
337 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
338 };
339
340 pwm1_out: pwm1-out {
341 samsung,pins = "gpd0-1";
342 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
343 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
344 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
345 };
346
347 pwm2_out: pwm2-out {
348 samsung,pins = "gpd0-2";
349 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
350 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
351 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
352 };
353
354 pwm3_out: pwm3-out {
355 samsung,pins = "gpd0-3";
356 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
357 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
358 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
359 };
360
361 lcd_ctrl: lcd-ctrl {
362 samsung,pins = "gpd0-0", "gpd0-1";
363 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
364 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
365 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
366 };
367
368 lcd_sync: lcd-sync {
369 samsung,pins = "gpf0-0", "gpf0-1";
370 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
371 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
372 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
373 };
374
375 lcd_en: lcd-en {
376 samsung,pins = "gpe3-4";
377 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
378 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
379 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
380 };
381
382 lcd_clk: lcd-clk {
383 samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
384 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
385 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
386 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
387 };
388
389 lcd_data16: lcd-data-width16 {
390 samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
391 "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
392 "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
393 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
394 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
395 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
396 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
397 };
398
399 lcd_data18: lcd-data-width18 {
400 samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
401 "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
402 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
403 "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1",
404 "gpf3-2", "gpf3-3";
405 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
406 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
407 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
408 };
409
410 lcd_data24: lcd-data-width24 {
411 samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
412 "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
413 "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
414 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
415 "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7",
416 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
417 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
418 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
419 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
420 };
421 };
422
423 pinctrl@11000000 {
424 gpj0: gpj0 {
425 gpio-controller;
426 #gpio-cells = <2>;
427
428 interrupt-controller;
429 #interrupt-cells = <2>;
430 };
431
432 gpj1: gpj1 {
433 gpio-controller;
434 #gpio-cells = <2>;
435
436 interrupt-controller;
437 #interrupt-cells = <2>;
438 };
439
440 gpk0: gpk0 {
441 gpio-controller;
442 #gpio-cells = <2>;
443
444 interrupt-controller;
445 #interrupt-cells = <2>;
446 };
447
448 gpk1: gpk1 {
449 gpio-controller;
450 #gpio-cells = <2>;
451
452 interrupt-controller;
453 #interrupt-cells = <2>;
454 };
455
456 gpk2: gpk2 {
457 gpio-controller;
458 #gpio-cells = <2>;
459
460 interrupt-controller;
461 #interrupt-cells = <2>;
462 };
463
464 gpk3: gpk3 {
465 gpio-controller;
466 #gpio-cells = <2>;
467
468 interrupt-controller;
469 #interrupt-cells = <2>;
470 };
471
472 gpl0: gpl0 {
473 gpio-controller;
474 #gpio-cells = <2>;
475
476 interrupt-controller;
477 #interrupt-cells = <2>;
478 };
479
480 gpl1: gpl1 {
481 gpio-controller;
482 #gpio-cells = <2>;
483
484 interrupt-controller;
485 #interrupt-cells = <2>;
486 };
487
488 gpl2: gpl2 {
489 gpio-controller;
490 #gpio-cells = <2>;
491
492 interrupt-controller;
493 #interrupt-cells = <2>;
494 };
495
496 gpy0: gpy0 {
497 gpio-controller;
498 #gpio-cells = <2>;
499 };
500
501 gpy1: gpy1 {
502 gpio-controller;
503 #gpio-cells = <2>;
504 };
505
506 gpy2: gpy2 {
507 gpio-controller;
508 #gpio-cells = <2>;
509 };
510
511 gpy3: gpy3 {
512 gpio-controller;
513 #gpio-cells = <2>;
514 };
515
516 gpy4: gpy4 {
517 gpio-controller;
518 #gpio-cells = <2>;
519 };
520
521 gpy5: gpy5 {
522 gpio-controller;
523 #gpio-cells = <2>;
524 };
525
526 gpy6: gpy6 {
527 gpio-controller;
528 #gpio-cells = <2>;
529 };
530
531 gpx0: gpx0 {
532 gpio-controller;
533 #gpio-cells = <2>;
534
535 interrupt-controller;
536 interrupt-parent = <&gic>;
537 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
538 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
539 <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
540 <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
541 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
542 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
543 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
544 <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
545 #interrupt-cells = <2>;
546 };
547
548 gpx1: gpx1 {
549 gpio-controller;
550 #gpio-cells = <2>;
551
552 interrupt-controller;
553 interrupt-parent = <&gic>;
554 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
555 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
556 <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
557 <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
558 <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
559 <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
560 <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
561 <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
562 #interrupt-cells = <2>;
563 };
564
565 gpx2: gpx2 {
566 gpio-controller;
567 #gpio-cells = <2>;
568
569 interrupt-controller;
570 #interrupt-cells = <2>;
571 };
572
573 gpx3: gpx3 {
574 gpio-controller;
575 #gpio-cells = <2>;
576
577 interrupt-controller;
578 #interrupt-cells = <2>;
579 };
580
581 sd0_clk: sd0-clk {
582 samsung,pins = "gpk0-0";
583 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
584 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
585 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
586 };
587
588 sd0_cmd: sd0-cmd {
589 samsung,pins = "gpk0-1";
590 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
591 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
592 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
593 };
594
595 sd0_cd: sd0-cd {
596 samsung,pins = "gpk0-2";
597 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
598 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
599 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
600 };
601
602 sd0_bus1: sd0-bus-width1 {
603 samsung,pins = "gpk0-3";
604 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
605 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
606 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
607 };
608
609 sd0_bus4: sd0-bus-width4 {
610 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
611 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
612 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
613 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
614 };
615
616 sd0_bus8: sd0-bus-width8 {
617 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
618 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
619 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
620 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
621 };
622
623 sd4_clk: sd4-clk {
624 samsung,pins = "gpk0-0";
625 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
626 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
627 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
628 };
629
630 sd4_cmd: sd4-cmd {
631 samsung,pins = "gpk0-1";
632 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
633 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
634 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
635 };
636
637 sd4_cd: sd4-cd {
638 samsung,pins = "gpk0-2";
639 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
640 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
641 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
642 };
643
644 sd4_bus1: sd4-bus-width1 {
645 samsung,pins = "gpk0-3";
646 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
647 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
648 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
649 };
650
651 sd4_bus4: sd4-bus-width4 {
652 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
653 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
654 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
655 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
656 };
657
658 sd4_bus8: sd4-bus-width8 {
659 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
660 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
661 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
662 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
663 };
664
665 sd1_clk: sd1-clk {
666 samsung,pins = "gpk1-0";
667 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
668 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
669 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
670 };
671
672 sd1_cmd: sd1-cmd {
673 samsung,pins = "gpk1-1";
674 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
675 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
676 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
677 };
678
679 sd1_cd: sd1-cd {
680 samsung,pins = "gpk1-2";
681 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
682 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
683 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
684 };
685
686 sd1_bus1: sd1-bus-width1 {
687 samsung,pins = "gpk1-3";
688 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
689 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
690 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
691 };
692
693 sd1_bus4: sd1-bus-width4 {
694 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
695 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
696 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
697 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
698 };
699
700 sd2_clk: sd2-clk {
701 samsung,pins = "gpk2-0";
702 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
703 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
704 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
705 };
706
707 sd2_cmd: sd2-cmd {
708 samsung,pins = "gpk2-1";
709 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
710 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
711 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
712 };
713
714 sd2_cd: sd2-cd {
715 samsung,pins = "gpk2-2";
716 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
717 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
718 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
719 };
720
721 sd2_bus1: sd2-bus-width1 {
722 samsung,pins = "gpk2-3";
723 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
724 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
725 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
726 };
727
728 sd2_bus4: sd2-bus-width4 {
729 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
730 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
731 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
732 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
733 };
734
735 sd2_bus8: sd2-bus-width8 {
736 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
737 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
738 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
739 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
740 };
741
742 sd3_clk: sd3-clk {
743 samsung,pins = "gpk3-0";
744 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
745 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
746 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
747 };
748
749 sd3_cmd: sd3-cmd {
750 samsung,pins = "gpk3-1";
751 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
752 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
753 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
754 };
755
756 sd3_cd: sd3-cd {
757 samsung,pins = "gpk3-2";
758 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
759 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
760 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
761 };
762
763 sd3_bus1: sd3-bus-width1 {
764 samsung,pins = "gpk3-3";
765 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
766 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
767 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
768 };
769
770 sd3_bus4: sd3-bus-width4 {
771 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
772 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
773 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
774 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
775 };
776
777 eint0: ext-int0 {
778 samsung,pins = "gpx0-0";
779 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
780 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
781 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
782 };
783
784 eint8: ext-int8 {
785 samsung,pins = "gpx1-0";
786 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
787 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
788 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
789 };
790
791 eint15: ext-int15 {
792 samsung,pins = "gpx1-7";
793 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
794 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
795 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
796 };
797
798 eint16: ext-int16 {
799 samsung,pins = "gpx2-0";
800 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
801 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
802 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
803 };
804
805 eint31: ext-int31 {
806 samsung,pins = "gpx3-7";
807 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
808 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
809 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
810 };
811
812 cam_port_a_io: cam-port-a-io {
813 samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
814 "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
815 "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
816 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
817 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
818 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
819 };
820
821 cam_port_a_clk_active: cam-port-a-clk-active {
822 samsung,pins = "gpj1-3";
823 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
824 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
825 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
826 };
827
828 cam_port_a_clk_idle: cam-port-a-clk-idle {
829 samsung,pins = "gpj1-3";
830 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
831 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
832 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
833 };
834
835 hdmi_cec: hdmi-cec {
836 samsung,pins = "gpx3-6";
837 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
838 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
839 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
840 };
841 };
842
843 pinctrl@3860000 {
844 gpz: gpz {
845 gpio-controller;
846 #gpio-cells = <2>;
847 };
848
849 i2s0_bus: i2s0-bus {
850 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
851 "gpz-4", "gpz-5", "gpz-6";
852 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
853 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
854 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
855 };
856
857 pcm0_bus: pcm0-bus {
858 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
859 "gpz-4";
860 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
861 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
862 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
863 };
864 }; 862 };
865}; 863};
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
index aaade17b140e..eaeeb4f6b84a 100644
--- a/arch/arm/boot/dts/exynos4210-trats.dts
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -148,43 +148,12 @@
148 }; 148 };
149 }; 149 };
150 150
151 camera { 151};
152 pinctrl-names = "default";
153 pinctrl-0 = <>;
154 status = "okay";
155
156 fimc_0: fimc@11800000 {
157 status = "okay";
158 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
159 <&clock CLK_SCLK_FIMC0>;
160 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
161 assigned-clock-rates = <0>, <160000000>;
162 };
163
164 fimc_1: fimc@11810000 {
165 status = "okay";
166 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
167 <&clock CLK_SCLK_FIMC1>;
168 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
169 assigned-clock-rates = <0>, <160000000>;
170 };
171
172 fimc_2: fimc@11820000 {
173 status = "okay";
174 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
175 <&clock CLK_SCLK_FIMC2>;
176 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
177 assigned-clock-rates = <0>, <160000000>;
178 };
179 152
180 fimc_3: fimc@11830000 { 153&camera {
181 status = "okay"; 154 pinctrl-names = "default";
182 assigned-clocks = <&clock CLK_MOUT_FIMC3>, 155 pinctrl-0 = <>;
183 <&clock CLK_SCLK_FIMC3>; 156 status = "okay";
184 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
185 assigned-clock-rates = <0>, <160000000>;
186 };
187 };
188}; 157};
189 158
190&cpu0 { 159&cpu0 {
@@ -234,6 +203,38 @@
234 vbus-supply = <&safe1_sreg>; 203 vbus-supply = <&safe1_sreg>;
235}; 204};
236 205
206&fimc_0 {
207 status = "okay";
208 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
209 <&clock CLK_SCLK_FIMC0>;
210 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
211 assigned-clock-rates = <0>, <160000000>;
212};
213
214&fimc_1 {
215 status = "okay";
216 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
217 <&clock CLK_SCLK_FIMC1>;
218 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
219 assigned-clock-rates = <0>, <160000000>;
220};
221
222&fimc_2 {
223 status = "okay";
224 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
225 <&clock CLK_SCLK_FIMC2>;
226 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
227 assigned-clock-rates = <0>, <160000000>;
228};
229
230&fimc_3 {
231 status = "okay";
232 assigned-clocks = <&clock CLK_MOUT_FIMC3>,
233 <&clock CLK_SCLK_FIMC3>;
234 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
235 assigned-clock-rates = <0>, <160000000>;
236};
237
237&fimd { 238&fimd {
238 status = "okay"; 239 status = "okay";
239}; 240};
@@ -275,6 +276,7 @@
275 276
276 max8997_pmic@66 { 277 max8997_pmic@66 {
277 compatible = "maxim,max8997-pmic"; 278 compatible = "maxim,max8997-pmic";
279 interrupts-extended = <&gpx0 7 0>, <&gpx2 3 0>;
278 280
279 reg = <0x66>; 281 reg = <0x66>;
280 interrupt-parent = <&gpx0>; 282 interrupt-parent = <&gpx0>;
diff --git a/arch/arm/boot/dts/exynos4210-universal_c210.dts b/arch/arm/boot/dts/exynos4210-universal_c210.dts
index 21fff7cd3aa4..4e6ff97e1ec4 100644
--- a/arch/arm/boot/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/boot/dts/exynos4210-universal_c210.dts
@@ -28,24 +28,6 @@
28 stdout-path = &serial_2; 28 stdout-path = &serial_2;
29 }; 29 };
30 30
31 sysram@2020000 {
32 smp-sysram@0 {
33 status = "disabled";
34 };
35
36 smp-sysram@5000 {
37 compatible = "samsung,exynos4210-sysram";
38 reg = <0x5000 0x1000>;
39 };
40
41 smp-sysram@1f000 {
42 status = "disabled";
43 };
44 };
45
46 mct@10050000 {
47 compatible = "none";
48 };
49 31
50 fixed-rate-clocks { 32 fixed-rate-clocks {
51 xxti { 33 xxti {
@@ -173,45 +155,6 @@
173 }; 155 };
174 }; 156 };
175 157
176 camera {
177 status = "okay";
178
179 pinctrl-names = "default";
180 pinctrl-0 = <>;
181
182 fimc_0: fimc@11800000 {
183 status = "okay";
184 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
185 <&clock CLK_SCLK_FIMC0>;
186 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
187 assigned-clock-rates = <0>, <160000000>;
188 };
189
190 fimc_1: fimc@11810000 {
191 status = "okay";
192 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
193 <&clock CLK_SCLK_FIMC1>;
194 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
195 assigned-clock-rates = <0>, <160000000>;
196 };
197
198 fimc_2: fimc@11820000 {
199 status = "okay";
200 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
201 <&clock CLK_SCLK_FIMC2>;
202 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
203 assigned-clock-rates = <0>, <160000000>;
204 };
205
206 fimc_3: fimc@11830000 {
207 status = "okay";
208 assigned-clocks = <&clock CLK_MOUT_FIMC3>,
209 <&clock CLK_SCLK_FIMC3>;
210 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
211 assigned-clock-rates = <0>, <160000000>;
212 };
213 };
214
215 hdmi_en: voltage-regulator-hdmi-5v { 158 hdmi_en: voltage-regulator-hdmi-5v {
216 compatible = "regulator-fixed"; 159 compatible = "regulator-fixed";
217 regulator-name = "HDMI_5V"; 160 regulator-name = "HDMI_5V";
@@ -234,6 +177,13 @@
234 }; 177 };
235}; 178};
236 179
180&camera {
181 status = "okay";
182
183 pinctrl-names = "default";
184 pinctrl-0 = <>;
185};
186
237&cpu0 { 187&cpu0 {
238 cpu0-supply = <&vdd_arm_reg>; 188 cpu0-supply = <&vdd_arm_reg>;
239}; 189};
@@ -250,6 +200,38 @@
250 vbus-supply = <&safeout1_reg>; 200 vbus-supply = <&safeout1_reg>;
251}; 201};
252 202
203&fimc_0 {
204 status = "okay";
205 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
206 <&clock CLK_SCLK_FIMC0>;
207 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
208 assigned-clock-rates = <0>, <160000000>;
209};
210
211&fimc_1 {
212 status = "okay";
213 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
214 <&clock CLK_SCLK_FIMC1>;
215 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
216 assigned-clock-rates = <0>, <160000000>;
217};
218
219&fimc_2 {
220 status = "okay";
221 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
222 <&clock CLK_SCLK_FIMC2>;
223 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
224 assigned-clock-rates = <0>, <160000000>;
225};
226
227&fimc_3 {
228 status = "okay";
229 assigned-clocks = <&clock CLK_MOUT_FIMC3>,
230 <&clock CLK_SCLK_FIMC3>;
231 assigned-clock-parents = <&clock CLK_SCLK_MPLL>;
232 assigned-clock-rates = <0>, <160000000>;
233};
234
253&fimd { 235&fimd {
254 pinctrl-0 = <&lcd_clk>, <&lcd_data24>; 236 pinctrl-0 = <&lcd_clk>, <&lcd_data24>;
255 pinctrl-names = "default"; 237 pinctrl-names = "default";
@@ -501,6 +483,10 @@
501 status = "okay"; 483 status = "okay";
502}; 484};
503 485
486&mct {
487 compatible = "none";
488};
489
504&mdma1 { 490&mdma1 {
505 reg = <0x12840000 0x1000>; 491 reg = <0x12840000 0x1000>;
506}; 492};
@@ -579,3 +565,18 @@
579 /delete-property/dmas; 565 /delete-property/dmas;
580 /delete-property/dma-names; 566 /delete-property/dma-names;
581}; 567};
568
569&sysram {
570 smp-sysram@0 {
571 status = "disabled";
572 };
573
574 smp-sysram@5000 {
575 compatible = "samsung,exynos4210-sysram";
576 reg = <0x5000 0x1000>;
577 };
578
579 smp-sysram@1f000 {
580 status = "disabled";
581 };
582};
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index cc978cf28267..88fb47cef9a8 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include "exynos4.dtsi" 19#include "exynos4.dtsi"
20#include "exynos4210-pinctrl.dtsi"
21#include "exynos4-cpu-thermal.dtsi" 20#include "exynos4-cpu-thermal.dtsi"
22 21
23/ { 22/ {
@@ -49,8 +48,6 @@
49 400000 975000 48 400000 975000
50 200000 950000 49 200000 950000
51 >; 50 >;
52 cooling-min-level = <4>;
53 cooling-max-level = <2>;
54 #cooling-cells = <2>; /* min followed by max */ 51 #cooling-cells = <2>; /* min followed by max */
55 }; 52 };
56 53
@@ -61,365 +58,323 @@
61 }; 58 };
62 }; 59 };
63 60
64 sysram: sysram@2020000 { 61 soc: soc {
65 compatible = "mmio-sram"; 62 sysram: sysram@2020000 {
66 reg = <0x02020000 0x20000>; 63 compatible = "mmio-sram";
67 #address-cells = <1>; 64 reg = <0x02020000 0x20000>;
68 #size-cells = <1>; 65 #address-cells = <1>;
69 ranges = <0 0x02020000 0x20000>; 66 #size-cells = <1>;
67 ranges = <0 0x02020000 0x20000>;
70 68
71 smp-sysram@0 { 69 smp-sysram@0 {
72 compatible = "samsung,exynos4210-sysram"; 70 compatible = "samsung,exynos4210-sysram";
73 reg = <0x0 0x1000>; 71 reg = <0x0 0x1000>;
74 }; 72 };
75 73
76 smp-sysram@1f000 { 74 smp-sysram@1f000 {
77 compatible = "samsung,exynos4210-sysram-ns"; 75 compatible = "samsung,exynos4210-sysram-ns";
78 reg = <0x1f000 0x1000>; 76 reg = <0x1f000 0x1000>;
77 };
79 }; 78 };
80 };
81 79
82 pd_lcd1: lcd1-power-domain@10023ca0 { 80 pd_lcd1: lcd1-power-domain@10023ca0 {
83 compatible = "samsung,exynos4210-pd"; 81 compatible = "samsung,exynos4210-pd";
84 reg = <0x10023CA0 0x20>; 82 reg = <0x10023CA0 0x20>;
85 #power-domain-cells = <0>; 83 #power-domain-cells = <0>;
86 label = "LCD1"; 84 label = "LCD1";
87 }; 85 };
88 86
89 l2c: l2-cache-controller@10502000 { 87 l2c: l2-cache-controller@10502000 {
90 compatible = "arm,pl310-cache"; 88 compatible = "arm,pl310-cache";
91 reg = <0x10502000 0x1000>; 89 reg = <0x10502000 0x1000>;
92 cache-unified; 90 cache-unified;
93 cache-level = <2>; 91 cache-level = <2>;
94 arm,tag-latency = <2 2 1>; 92 arm,tag-latency = <2 2 1>;
95 arm,data-latency = <2 2 1>; 93 arm,data-latency = <2 2 1>;
96 }; 94 };
97 95
98 mct: mct@10050000 { 96 mct: mct@10050000 {
99 compatible = "samsung,exynos4210-mct"; 97 compatible = "samsung,exynos4210-mct";
100 reg = <0x10050000 0x800>; 98 reg = <0x10050000 0x800>;
101 interrupt-parent = <&mct_map>; 99 interrupt-parent = <&mct_map>;
102 interrupts = <0>, <1>, <2>, <3>, <4>, <5>; 100 interrupts = <0>, <1>, <2>, <3>, <4>, <5>;
103 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>; 101 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
104 clock-names = "fin_pll", "mct"; 102 clock-names = "fin_pll", "mct";
105 103
106 mct_map: mct-map { 104 mct_map: mct-map {
107 #interrupt-cells = <1>; 105 #interrupt-cells = <1>;
108 #address-cells = <0>; 106 #address-cells = <0>;
109 #size-cells = <0>; 107 #size-cells = <0>;
110 interrupt-map = <0 &gic 0 57 IRQ_TYPE_LEVEL_HIGH>, 108 interrupt-map =
109 <0 &gic 0 57 IRQ_TYPE_LEVEL_HIGH>,
111 <1 &gic 0 69 IRQ_TYPE_LEVEL_HIGH>, 110 <1 &gic 0 69 IRQ_TYPE_LEVEL_HIGH>,
112 <2 &combiner 12 6>, 111 <2 &combiner 12 6>,
113 <3 &combiner 12 7>, 112 <3 &combiner 12 7>,
114 <4 &gic 0 42 IRQ_TYPE_LEVEL_HIGH>, 113 <4 &gic 0 42 IRQ_TYPE_LEVEL_HIGH>,
115 <5 &gic 0 48 IRQ_TYPE_LEVEL_HIGH>; 114 <5 &gic 0 48 IRQ_TYPE_LEVEL_HIGH>;
115 };
116 }; 116 };
117 };
118 117
119 watchdog: watchdog@10060000 { 118 watchdog: watchdog@10060000 {
120 compatible = "samsung,s3c6410-wdt"; 119 compatible = "samsung,s3c6410-wdt";
121 reg = <0x10060000 0x100>; 120 reg = <0x10060000 0x100>;
122 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>; 121 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
123 clocks = <&clock CLK_WDT>; 122 clocks = <&clock CLK_WDT>;
124 clock-names = "watchdog"; 123 clock-names = "watchdog";
125 };
126
127 clock: clock-controller@10030000 {
128 compatible = "samsung,exynos4210-clock";
129 reg = <0x10030000 0x20000>;
130 #clock-cells = <1>;
131 };
132
133 pinctrl_0: pinctrl@11400000 {
134 compatible = "samsung,exynos4210-pinctrl";
135 reg = <0x11400000 0x1000>;
136 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
137 };
138
139 pinctrl_1: pinctrl@11000000 {
140 compatible = "samsung,exynos4210-pinctrl";
141 reg = <0x11000000 0x1000>;
142 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
143
144 wakup_eint: wakeup-interrupt-controller {
145 compatible = "samsung,exynos4210-wakeup-eint";
146 interrupt-parent = <&gic>;
147 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
148 }; 124 };
149 };
150 125
151 pinctrl_2: pinctrl@3860000 { 126 clock: clock-controller@10030000 {
152 compatible = "samsung,exynos4210-pinctrl"; 127 compatible = "samsung,exynos4210-clock";
153 reg = <0x03860000 0x1000>; 128 reg = <0x10030000 0x20000>;
154 }; 129 #clock-cells = <1>;
130 };
155 131
156 tmu: tmu@100c0000 { 132 pinctrl_0: pinctrl@11400000 {
157 compatible = "samsung,exynos4210-tmu"; 133 compatible = "samsung,exynos4210-pinctrl";
158 interrupt-parent = <&combiner>; 134 reg = <0x11400000 0x1000>;
159 reg = <0x100C0000 0x100>; 135 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
160 interrupts = <2 4>; 136 };
161 clocks = <&clock CLK_TMU_APBIF>;
162 clock-names = "tmu_apbif";
163 samsung,tmu_gain = <15>;
164 samsung,tmu_reference_voltage = <7>;
165 status = "disabled";
166 };
167 137
168 thermal-zones { 138 pinctrl_1: pinctrl@11000000 {
169 cpu_thermal: cpu-thermal { 139 compatible = "samsung,exynos4210-pinctrl";
170 polling-delay-passive = <0>; 140 reg = <0x11000000 0x1000>;
171 polling-delay = <0>; 141 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
172 thermal-sensors = <&tmu 0>;
173 142
174 trips { 143 wakup_eint: wakeup-interrupt-controller {
175 cpu_alert0: cpu-alert-0 { 144 compatible = "samsung,exynos4210-wakeup-eint";
176 temperature = <85000>; /* millicelsius */ 145 interrupt-parent = <&gic>;
177 }; 146 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
178 cpu_alert1: cpu-alert-1 {
179 temperature = <100000>; /* millicelsius */
180 };
181 cpu_alert2: cpu-alert-2 {
182 temperature = <110000>; /* millicelsius */
183 };
184 }; 147 };
185 }; 148 };
186 };
187
188 g2d: g2d@12800000 {
189 compatible = "samsung,s5pv210-g2d";
190 reg = <0x12800000 0x1000>;
191 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
192 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
193 clock-names = "sclk_fimg2d", "fimg2d";
194 power-domains = <&pd_lcd0>;
195 iommus = <&sysmmu_g2d>;
196 };
197 149
198 camera { 150 pinctrl_2: pinctrl@3860000 {
199 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>, 151 compatible = "samsung,exynos4210-pinctrl";
200 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>; 152 reg = <0x03860000 0x1000>;
201 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1"; 153 };
202 154
203 fimc_0: fimc@11800000 { 155 g2d: g2d@12800000 {
204 samsung,pix-limits = <4224 8192 1920 4224>; 156 compatible = "samsung,s5pv210-g2d";
205 samsung,mainscaler-ext; 157 reg = <0x12800000 0x1000>;
206 samsung,cam-if; 158 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
159 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
160 clock-names = "sclk_fimg2d", "fimg2d";
161 power-domains = <&pd_lcd0>;
162 iommus = <&sysmmu_g2d>;
207 }; 163 };
208 164
209 fimc_1: fimc@11810000 { 165 ppmu_acp: ppmu_acp@10ae0000 {
210 samsung,pix-limits = <4224 8192 1920 4224>; 166 compatible = "samsung,exynos-ppmu";
211 samsung,mainscaler-ext; 167 reg = <0x10ae0000 0x2000>;
212 samsung,cam-if; 168 status = "disabled";
213 }; 169 };
214 170
215 fimc_2: fimc@11820000 { 171 ppmu_lcd1: ppmu_lcd1@12240000 {
216 samsung,pix-limits = <4224 8192 1920 4224>; 172 compatible = "samsung,exynos-ppmu";
217 samsung,mainscaler-ext; 173 reg = <0x12240000 0x2000>;
218 samsung,lcd-wb; 174 clocks = <&clock CLK_PPMULCD1>;
175 clock-names = "ppmu";
176 status = "disabled";
219 }; 177 };
220 178
221 fimc_3: fimc@11830000 { 179 sysmmu_g2d: sysmmu@12a20000 {
222 samsung,pix-limits = <1920 8192 1366 1920>; 180 compatible = "samsung,exynos-sysmmu";
223 samsung,rotators = <0>; 181 reg = <0x12A20000 0x1000>;
224 samsung,mainscaler-ext; 182 interrupt-parent = <&combiner>;
225 samsung,lcd-wb; 183 interrupts = <4 7>;
184 clock-names = "sysmmu", "master";
185 clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
186 power-domains = <&pd_lcd0>;
187 #iommu-cells = <0>;
226 }; 188 };
227 };
228 189
229 mixer: mixer@12c10000 { 190 sysmmu_fimd1: sysmmu@12220000 {
230 clock-names = "mixer", "hdmi", "sclk_hdmi", "vp", "mout_mixer", 191 compatible = "samsung,exynos-sysmmu";
231 "sclk_mixer"; 192 interrupt-parent = <&combiner>;
232 clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>, 193 reg = <0x12220000 0x1000>;
233 <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>, 194 interrupts = <5 3>;
234 <&clock CLK_MOUT_MIXER>, <&clock CLK_SCLK_MIXER>; 195 clock-names = "sysmmu", "master";
235 }; 196 clocks = <&clock CLK_SMMU_FIMD1>, <&clock CLK_FIMD1>;
197 power-domains = <&pd_lcd1>;
198 #iommu-cells = <0>;
199 };
236 200
237 ppmu_lcd1: ppmu_lcd1@12240000 { 201 bus_dmc: bus_dmc {
238 compatible = "samsung,exynos-ppmu"; 202 compatible = "samsung,exynos-bus";
239 reg = <0x12240000 0x2000>; 203 clocks = <&clock CLK_DIV_DMC>;
240 clocks = <&clock CLK_PPMULCD1>; 204 clock-names = "bus";
241 clock-names = "ppmu"; 205 operating-points-v2 = <&bus_dmc_opp_table>;
242 status = "disabled"; 206 status = "disabled";
243 }; 207 };
244 208
245 sysmmu_g2d: sysmmu@12a20000 { 209 bus_acp: bus_acp {
246 compatible = "samsung,exynos-sysmmu"; 210 compatible = "samsung,exynos-bus";
247 reg = <0x12A20000 0x1000>; 211 clocks = <&clock CLK_DIV_ACP>;
248 interrupt-parent = <&combiner>; 212 clock-names = "bus";
249 interrupts = <4 7>; 213 operating-points-v2 = <&bus_acp_opp_table>;
250 clock-names = "sysmmu", "master"; 214 status = "disabled";
251 clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>; 215 };
252 power-domains = <&pd_lcd0>;
253 #iommu-cells = <0>;
254 };
255 216
256 sysmmu_fimd1: sysmmu@12220000 { 217 bus_peri: bus_peri {
257 compatible = "samsung,exynos-sysmmu"; 218 compatible = "samsung,exynos-bus";
258 interrupt-parent = <&combiner>; 219 clocks = <&clock CLK_ACLK100>;
259 reg = <0x12220000 0x1000>; 220 clock-names = "bus";
260 interrupts = <5 3>; 221 operating-points-v2 = <&bus_peri_opp_table>;
261 clock-names = "sysmmu", "master"; 222 status = "disabled";
262 clocks = <&clock CLK_SMMU_FIMD1>, <&clock CLK_FIMD1>; 223 };
263 power-domains = <&pd_lcd1>;
264 #iommu-cells = <0>;
265 };
266 224
267 bus_dmc: bus_dmc { 225 bus_fsys: bus_fsys {
268 compatible = "samsung,exynos-bus"; 226 compatible = "samsung,exynos-bus";
269 clocks = <&clock CLK_DIV_DMC>; 227 clocks = <&clock CLK_ACLK133>;
270 clock-names = "bus"; 228 clock-names = "bus";
271 operating-points-v2 = <&bus_dmc_opp_table>; 229 operating-points-v2 = <&bus_fsys_opp_table>;
272 status = "disabled"; 230 status = "disabled";
273 }; 231 };
274 232
275 bus_acp: bus_acp { 233 bus_display: bus_display {
276 compatible = "samsung,exynos-bus"; 234 compatible = "samsung,exynos-bus";
277 clocks = <&clock CLK_DIV_ACP>; 235 clocks = <&clock CLK_ACLK160>;
278 clock-names = "bus"; 236 clock-names = "bus";
279 operating-points-v2 = <&bus_acp_opp_table>; 237 operating-points-v2 = <&bus_display_opp_table>;
280 status = "disabled"; 238 status = "disabled";
281 }; 239 };
282 240
283 bus_peri: bus_peri { 241 bus_lcd0: bus_lcd0 {
284 compatible = "samsung,exynos-bus"; 242 compatible = "samsung,exynos-bus";
285 clocks = <&clock CLK_ACLK100>; 243 clocks = <&clock CLK_ACLK200>;
286 clock-names = "bus"; 244 clock-names = "bus";
287 operating-points-v2 = <&bus_peri_opp_table>; 245 operating-points-v2 = <&bus_leftbus_opp_table>;
288 status = "disabled"; 246 status = "disabled";
289 }; 247 };
290 248
291 bus_fsys: bus_fsys { 249 bus_leftbus: bus_leftbus {
292 compatible = "samsung,exynos-bus"; 250 compatible = "samsung,exynos-bus";
293 clocks = <&clock CLK_ACLK133>; 251 clocks = <&clock CLK_DIV_GDL>;
294 clock-names = "bus"; 252 clock-names = "bus";
295 operating-points-v2 = <&bus_fsys_opp_table>; 253 operating-points-v2 = <&bus_leftbus_opp_table>;
296 status = "disabled"; 254 status = "disabled";
297 }; 255 };
298 256
299 bus_display: bus_display { 257 bus_rightbus: bus_rightbus {
300 compatible = "samsung,exynos-bus"; 258 compatible = "samsung,exynos-bus";
301 clocks = <&clock CLK_ACLK160>; 259 clocks = <&clock CLK_DIV_GDR>;
302 clock-names = "bus"; 260 clock-names = "bus";
303 operating-points-v2 = <&bus_display_opp_table>; 261 operating-points-v2 = <&bus_leftbus_opp_table>;
304 status = "disabled"; 262 status = "disabled";
305 }; 263 };
306 264
307 bus_lcd0: bus_lcd0 { 265 bus_mfc: bus_mfc {
308 compatible = "samsung,exynos-bus"; 266 compatible = "samsung,exynos-bus";
309 clocks = <&clock CLK_ACLK200>; 267 clocks = <&clock CLK_SCLK_MFC>;
310 clock-names = "bus"; 268 clock-names = "bus";
311 operating-points-v2 = <&bus_leftbus_opp_table>; 269 operating-points-v2 = <&bus_leftbus_opp_table>;
312 status = "disabled"; 270 status = "disabled";
313 }; 271 };
314 272
315 bus_leftbus: bus_leftbus { 273 bus_dmc_opp_table: opp_table1 {
316 compatible = "samsung,exynos-bus"; 274 compatible = "operating-points-v2";
317 clocks = <&clock CLK_DIV_GDL>; 275 opp-shared;
318 clock-names = "bus";
319 operating-points-v2 = <&bus_leftbus_opp_table>;
320 status = "disabled";
321 };
322 276
323 bus_rightbus: bus_rightbus { 277 opp-134000000 {
324 compatible = "samsung,exynos-bus"; 278 opp-hz = /bits/ 64 <134000000>;
325 clocks = <&clock CLK_DIV_GDR>; 279 opp-microvolt = <1025000>;
326 clock-names = "bus"; 280 };
327 operating-points-v2 = <&bus_leftbus_opp_table>; 281 opp-267000000 {
328 status = "disabled"; 282 opp-hz = /bits/ 64 <267000000>;
329 }; 283 opp-microvolt = <1050000>;
330 284 };
331 bus_mfc: bus_mfc { 285 opp-400000000 {
332 compatible = "samsung,exynos-bus"; 286 opp-hz = /bits/ 64 <400000000>;
333 clocks = <&clock CLK_SCLK_MFC>; 287 opp-microvolt = <1150000>;
334 clock-names = "bus"; 288 };
335 operating-points-v2 = <&bus_leftbus_opp_table>; 289 };
336 status = "disabled";
337 };
338 290
339 bus_dmc_opp_table: opp_table1 { 291 bus_acp_opp_table: opp_table2 {
340 compatible = "operating-points-v2"; 292 compatible = "operating-points-v2";
341 opp-shared; 293 opp-shared;
342 294
343 opp-134000000 { 295 opp-134000000 {
344 opp-hz = /bits/ 64 <134000000>; 296 opp-hz = /bits/ 64 <134000000>;
345 opp-microvolt = <1025000>; 297 };
346 }; 298 opp-160000000 {
347 opp-267000000 { 299 opp-hz = /bits/ 64 <160000000>;
348 opp-hz = /bits/ 64 <267000000>; 300 };
349 opp-microvolt = <1050000>; 301 opp-200000000 {
350 }; 302 opp-hz = /bits/ 64 <200000000>;
351 opp-400000000 { 303 };
352 opp-hz = /bits/ 64 <400000000>;
353 opp-microvolt = <1150000>;
354 }; 304 };
355 };
356 305
357 bus_acp_opp_table: opp_table2 { 306 bus_peri_opp_table: opp_table3 {
358 compatible = "operating-points-v2"; 307 compatible = "operating-points-v2";
359 opp-shared; 308 opp-shared;
360 309
361 opp-134000000 { 310 opp-5000000 {
362 opp-hz = /bits/ 64 <134000000>; 311 opp-hz = /bits/ 64 <5000000>;
363 }; 312 };
364 opp-160000000 { 313 opp-100000000 {
365 opp-hz = /bits/ 64 <160000000>; 314 opp-hz = /bits/ 64 <100000000>;
366 }; 315 };
367 opp-200000000 {
368 opp-hz = /bits/ 64 <200000000>;
369 }; 316 };
370 };
371 317
372 bus_peri_opp_table: opp_table3 { 318 bus_fsys_opp_table: opp_table4 {
373 compatible = "operating-points-v2"; 319 compatible = "operating-points-v2";
374 opp-shared; 320 opp-shared;
375 321
376 opp-5000000 { 322 opp-10000000 {
377 opp-hz = /bits/ 64 <5000000>; 323 opp-hz = /bits/ 64 <10000000>;
378 }; 324 };
379 opp-100000000 { 325 opp-134000000 {
380 opp-hz = /bits/ 64 <100000000>; 326 opp-hz = /bits/ 64 <134000000>;
327 };
381 }; 328 };
382 };
383 329
384 bus_fsys_opp_table: opp_table4 { 330 bus_display_opp_table: opp_table5 {
385 compatible = "operating-points-v2"; 331 compatible = "operating-points-v2";
386 opp-shared; 332 opp-shared;
387 333
388 opp-10000000 { 334 opp-100000000 {
389 opp-hz = /bits/ 64 <10000000>; 335 opp-hz = /bits/ 64 <100000000>;
390 }; 336 };
391 opp-134000000 { 337 opp-134000000 {
392 opp-hz = /bits/ 64 <134000000>; 338 opp-hz = /bits/ 64 <134000000>;
339 };
340 opp-160000000 {
341 opp-hz = /bits/ 64 <160000000>;
342 };
393 }; 343 };
394 };
395 344
396 bus_display_opp_table: opp_table5 { 345 bus_leftbus_opp_table: opp_table6 {
397 compatible = "operating-points-v2"; 346 compatible = "operating-points-v2";
398 opp-shared; 347 opp-shared;
399 348
400 opp-100000000 { 349 opp-100000000 {
401 opp-hz = /bits/ 64 <100000000>; 350 opp-hz = /bits/ 64 <100000000>;
402 }; 351 };
403 opp-134000000 { 352 opp-160000000 {
404 opp-hz = /bits/ 64 <134000000>; 353 opp-hz = /bits/ 64 <160000000>;
405 }; 354 };
406 opp-160000000 { 355 opp-200000000 {
407 opp-hz = /bits/ 64 <160000000>; 356 opp-hz = /bits/ 64 <200000000>;
357 };
408 }; 358 };
409 }; 359 };
410 360
411 bus_leftbus_opp_table: opp_table6 { 361 thermal-zones {
412 compatible = "operating-points-v2"; 362 cpu_thermal: cpu-thermal {
413 opp-shared; 363 polling-delay-passive = <0>;
364 polling-delay = <0>;
365 thermal-sensors = <&tmu 0>;
414 366
415 opp-100000000 { 367 trips {
416 opp-hz = /bits/ 64 <100000000>; 368 cpu_alert0: cpu-alert-0 {
417 }; 369 temperature = <85000>; /* millicelsius */
418 opp-160000000 { 370 };
419 opp-hz = /bits/ 64 <160000000>; 371 cpu_alert1: cpu-alert-1 {
420 }; 372 temperature = <100000>; /* millicelsius */
421 opp-200000000 { 373 };
422 opp-hz = /bits/ 64 <200000000>; 374 cpu_alert2: cpu-alert-2 {
375 temperature = <110000>; /* millicelsius */
376 };
377 };
423 }; 378 };
424 }; 379 };
425}; 380};
@@ -428,6 +383,12 @@
428 cpu-offset = <0x8000>; 383 cpu-offset = <0x8000>;
429}; 384};
430 385
386&camera {
387 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
388 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
389 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
390};
391
431&combiner { 392&combiner {
432 samsung,combiner-nr = <16>; 393 samsung,combiner-nr = <16>;
433 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 394 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
@@ -448,10 +409,43 @@
448 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; 409 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
449}; 410};
450 411
412&fimc_0 {
413 samsung,pix-limits = <4224 8192 1920 4224>;
414 samsung,mainscaler-ext;
415 samsung,cam-if;
416};
417
418&fimc_1 {
419 samsung,pix-limits = <4224 8192 1920 4224>;
420 samsung,mainscaler-ext;
421 samsung,cam-if;
422};
423
424&fimc_2 {
425 samsung,pix-limits = <4224 8192 1920 4224>;
426 samsung,mainscaler-ext;
427 samsung,lcd-wb;
428};
429
430&fimc_3 {
431 samsung,pix-limits = <1920 8192 1366 1920>;
432 samsung,rotators = <0>;
433 samsung,mainscaler-ext;
434 samsung,lcd-wb;
435};
436
451&mdma1 { 437&mdma1 {
452 power-domains = <&pd_lcd0>; 438 power-domains = <&pd_lcd0>;
453}; 439};
454 440
441&mixer {
442 clock-names = "mixer", "hdmi", "sclk_hdmi", "vp", "mout_mixer",
443 "sclk_mixer";
444 clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>,
445 <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>,
446 <&clock CLK_MOUT_MIXER>, <&clock CLK_SCLK_MIXER>;
447};
448
455&pmu_system_controller { 449&pmu_system_controller {
456 clock-names = "clkout0", "clkout1", "clkout2", "clkout3", 450 clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
457 "clkout4", "clkout8", "clkout9"; 451 "clkout4", "clkout8", "clkout9";
@@ -468,3 +462,13 @@
468&sysmmu_rotator { 462&sysmmu_rotator {
469 power-domains = <&pd_lcd0>; 463 power-domains = <&pd_lcd0>;
470}; 464};
465
466&tmu {
467 compatible = "samsung,exynos4210-tmu";
468 clocks = <&clock CLK_TMU_APBIF>;
469 clock-names = "tmu_apbif";
470 samsung,tmu_gain = <15>;
471 samsung,tmu_reference_voltage = <7>;
472};
473
474#include "exynos4210-pinctrl.dtsi"
diff --git a/arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi b/arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi
new file mode 100644
index 000000000000..ee8e1f445370
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi
@@ -0,0 +1,140 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Samsung's Exynos4412 based Galaxy S3 board device tree source
4 *
5 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com
7 */
8
9/dts-v1/;
10#include "exynos4412-midas.dtsi"
11
12/ {
13 aliases {
14 i2c9 = &i2c_ak8975;
15 i2c10 = &i2c_cm36651;
16 };
17
18 regulators {
19 lcd_vdd3_reg: voltage-regulator-2 {
20 compatible = "regulator-fixed";
21 regulator-name = "LCD_VDD_2.2V";
22 regulator-min-microvolt = <2200000>;
23 regulator-max-microvolt = <2200000>;
24 gpio = <&gpc0 1 GPIO_ACTIVE_HIGH>;
25 enable-active-high;
26 };
27
28 ps_als_reg: voltage-regulator-5 {
29 compatible = "regulator-fixed";
30 regulator-name = "LED_A_3.0V";
31 regulator-min-microvolt = <3000000>;
32 regulator-max-microvolt = <3000000>;
33 gpio = <&gpj0 5 GPIO_ACTIVE_HIGH>;
34 enable-active-high;
35 };
36 };
37
38 i2c_ak8975: i2c-gpio-0 {
39 compatible = "i2c-gpio";
40 gpios = <&gpy2 4 GPIO_ACTIVE_HIGH>, <&gpy2 5 GPIO_ACTIVE_HIGH>;
41 i2c-gpio,delay-us = <2>;
42 #address-cells = <1>;
43 #size-cells = <0>;
44 status = "okay";
45
46 ak8975@c {
47 compatible = "asahi-kasei,ak8975";
48 reg = <0x0c>;
49 gpios = <&gpj0 7 GPIO_ACTIVE_HIGH>;
50 };
51 };
52
53 i2c_cm36651: i2c-gpio-2 {
54 compatible = "i2c-gpio";
55 gpios = <&gpf0 0 GPIO_ACTIVE_LOW>, <&gpf0 1 GPIO_ACTIVE_LOW>;
56 i2c-gpio,delay-us = <2>;
57 #address-cells = <1>;
58 #size-cells = <0>;
59
60 cm36651@18 {
61 compatible = "capella,cm36651";
62 reg = <0x18>;
63 interrupt-parent = <&gpx0>;
64 interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
65 vled-supply = <&ps_als_reg>;
66 };
67 };
68};
69
70&buck9_reg {
71 maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
72};
73
74&cam_af_reg {
75 gpio = <&gpm0 4 GPIO_ACTIVE_HIGH>;
76 status = "okay";
77};
78
79&cam_io_reg {
80 gpio = <&gpm0 2 GPIO_ACTIVE_HIGH>;
81 status = "okay";
82};
83
84&dsi_0 {
85 status = "okay";
86
87 panel@0 {
88 compatible = "samsung,s6e8aa0";
89 reg = <0>;
90 vdd3-supply = <&lcd_vdd3_reg>;
91 vci-supply = <&ldo25_reg>;
92 reset-gpios = <&gpf2 1 GPIO_ACTIVE_HIGH>;
93 power-on-delay= <50>;
94 reset-delay = <100>;
95 init-delay = <100>;
96 flip-horizontal;
97 flip-vertical;
98 panel-width-mm = <58>;
99 panel-height-mm = <103>;
100
101 display-timings {
102 timing-0 {
103 clock-frequency = <57153600>;
104 hactive = <720>;
105 vactive = <1280>;
106 hfront-porch = <5>;
107 hback-porch = <5>;
108 hsync-len = <5>;
109 vfront-porch = <13>;
110 vback-porch = <1>;
111 vsync-len = <2>;
112 };
113 };
114 };
115};
116
117&i2c_3 {
118 mms114-touchscreen@48 {
119 compatible = "melfas,mms114";
120 reg = <0x48>;
121 interrupt-parent = <&gpm2>;
122 interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
123 x-size = <720>;
124 y-size = <1280>;
125 avdd-supply = <&ldo23_reg>;
126 vdd-supply = <&ldo24_reg>;
127 };
128};
129
130&ldo25_reg {
131 regulator-name = "LCD_VCC_3.3V";
132 regulator-min-microvolt = <2800000>;
133 regulator-max-microvolt = <2800000>;
134};
135
136&s5c73m3 {
137 standby-gpios = <&gpm0 1 GPIO_ACTIVE_LOW>; /* ISP_STANDBY */
138 vdda-supply = <&ldo17_reg>;
139 status = "okay";
140};
diff --git a/arch/arm/boot/dts/exynos4412-i9300.dts b/arch/arm/boot/dts/exynos4412-i9300.dts
new file mode 100644
index 000000000000..f8125a945f8d
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-i9300.dts
@@ -0,0 +1,22 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Samsung's Exynos4412 based M0 (GT-I9300) board device tree source
4 *
5 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com
7 */
8
9/dts-v1/;
10#include "exynos4412-galaxy-s3.dtsi"
11
12/ {
13 model = "Samsung Galaxy S3 (GT-I9300) based on Exynos4412";
14 compatible = "samsung,i9300", "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
15
16 /* bootargs are passed in by bootloader */
17
18 memory@40000000 {
19 device_type = "memory";
20 reg = <0x40000000 0x40000000>;
21 };
22};
diff --git a/arch/arm/boot/dts/exynos4412-i9305.dts b/arch/arm/boot/dts/exynos4412-i9305.dts
new file mode 100644
index 000000000000..54a2a55dbf70
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-i9305.dts
@@ -0,0 +1,20 @@
1// SPDX-License-Identifier: GPL-2.0
2/dts-v1/;
3#include "exynos4412-galaxy-s3.dtsi"
4
5/ {
6 model = "Samsung Galaxy S3 (GT-I9305) based on Exynos4412";
7 compatible = "samsung,i9305", "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
8
9 /* bootargs are passed in by bootloader */
10
11 memory@40000000 {
12 device_type = "memory";
13 reg = <0x40000000 0x80000000>;
14 };
15};
16
17&i2c0_bus {
18 /* SCL and SDA pins are swapped */
19 samsung,pins = "gpd1-1", "gpd1-0";
20};
diff --git a/arch/arm/boot/dts/exynos4412-itop-elite.dts b/arch/arm/boot/dts/exynos4412-itop-elite.dts
index a4cd4939fe9a..0dedeba89b5f 100644
--- a/arch/arm/boot/dts/exynos4412-itop-elite.dts
+++ b/arch/arm/boot/dts/exynos4412-itop-elite.dts
@@ -116,14 +116,6 @@
116 compatible = "pwm-beeper"; 116 compatible = "pwm-beeper";
117 pwms = <&pwm 0 4000000 PWM_POLARITY_INVERTED>; 117 pwms = <&pwm 0 4000000 PWM_POLARITY_INVERTED>;
118 }; 118 };
119
120 camera: camera {
121 pinctrl-0 = <&cam_port_a_clk_active>;
122 pinctrl-names = "default";
123 status = "okay";
124 assigned-clocks = <&clock CLK_MOUT_CAM0>;
125 assigned-clock-parents = <&clock CLK_XUSBXTI>;
126 };
127}; 119};
128 120
129&adc { 121&adc {
@@ -131,6 +123,14 @@
131 status = "okay"; 123 status = "okay";
132}; 124};
133 125
126&camera {
127 pinctrl-0 = <&cam_port_a_clk_active>;
128 pinctrl-names = "default";
129 status = "okay";
130 assigned-clocks = <&clock CLK_MOUT_CAM0>;
131 assigned-clock-parents = <&clock CLK_XUSBXTI>;
132};
133
134&clock_audss { 134&clock_audss {
135 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>, 135 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>,
136 <&clock_audss EXYNOS_MOUT_I2S>, 136 <&clock_audss EXYNOS_MOUT_I2S>,
diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
new file mode 100644
index 000000000000..76f2b30f1731
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -0,0 +1,1308 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Samsung's Exynos4412 based Trats 2 board device tree source
4 *
5 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com
7 *
8 * Device tree source file for Samsung's Trats 2 board which is based on
9 * Samsung's Exynos4412 SoC.
10 */
11
12/dts-v1/;
13#include "exynos4412.dtsi"
14#include "exynos4412-ppmu-common.dtsi"
15#include <dt-bindings/gpio/gpio.h>
16#include <dt-bindings/interrupt-controller/irq.h>
17#include <dt-bindings/clock/maxim,max77686.h>
18#include <dt-bindings/pinctrl/samsung.h>
19
20/ {
21 compatible = "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
22
23 aliases {
24 i2c11 = &i2c_max77693;
25 i2c12 = &i2c_max77693_fuel;
26 };
27
28 chosen {
29 stdout-path = &serial_2;
30 };
31
32 firmware@204f000 {
33 compatible = "samsung,secure-firmware";
34 reg = <0x0204F000 0x1000>;
35 };
36
37 fixed-rate-clocks {
38 xxti {
39 compatible = "samsung,clock-xxti", "fixed-clock";
40 clock-frequency = <0>;
41 };
42
43 xusbxti {
44 compatible = "samsung,clock-xusbxti", "fixed-clock";
45 clock-frequency = <24000000>;
46 };
47 };
48
49 regulators {
50 compatible = "simple-bus";
51 #address-cells = <1>;
52 #size-cells = <0>;
53
54 cam_io_reg: voltage-regulator-1 {
55 compatible = "regulator-fixed";
56 regulator-name = "CAM_SENSOR_A";
57 regulator-min-microvolt = <2800000>;
58 regulator-max-microvolt = <2800000>;
59 enable-active-high;
60 status = "disabled";
61 };
62
63 cam_af_reg: voltage-regulator-3 {
64 compatible = "regulator-fixed";
65 regulator-name = "CAM_AF";
66 regulator-min-microvolt = <2800000>;
67 regulator-max-microvolt = <2800000>;
68 enable-active-high;
69 status = "disabled";
70 };
71
72 vsil12: voltage-regulator-6 {
73 compatible = "regulator-fixed";
74 regulator-name = "VSIL_1.2V";
75 regulator-min-microvolt = <1200000>;
76 regulator-max-microvolt = <1200000>;
77 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
78 enable-active-high;
79 vin-supply = <&buck7_reg>;
80 };
81
82 vcc33mhl: voltage-regulator-7 {
83 compatible = "regulator-fixed";
84 regulator-name = "VCC_3.3_MHL";
85 regulator-min-microvolt = <3300000>;
86 regulator-max-microvolt = <3300000>;
87 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
88 enable-active-high;
89 };
90
91 vcc18mhl: voltage-regulator-8 {
92 compatible = "regulator-fixed";
93 regulator-name = "VCC_1.8_MHL";
94 regulator-min-microvolt = <1800000>;
95 regulator-max-microvolt = <1800000>;
96 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
97 enable-active-high;
98 };
99 };
100
101 gpio-keys {
102 compatible = "gpio-keys";
103
104 key-down {
105 gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
106 linux,code = <114>;
107 label = "volume down";
108 debounce-interval = <10>;
109 };
110
111 key-up {
112 gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
113 linux,code = <115>;
114 label = "volume up";
115 debounce-interval = <10>;
116 };
117
118 key-power {
119 gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
120 linux,code = <116>;
121 label = "power";
122 debounce-interval = <10>;
123 wakeup-source;
124 };
125
126 key-ok {
127 gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
128 linux,code = <139>;
129 label = "ok";
130 debounce-interval = <10>;
131 wakeup-source;
132 };
133 };
134
135 i2c_max77693: i2c-gpio-1 {
136 compatible = "i2c-gpio";
137 gpios = <&gpm2 0 GPIO_ACTIVE_HIGH>, <&gpm2 1 GPIO_ACTIVE_HIGH>;
138 i2c-gpio,delay-us = <2>;
139 #address-cells = <1>;
140 #size-cells = <0>;
141 status = "okay";
142
143 max77693@66 {
144 compatible = "maxim,max77693";
145 interrupt-parent = <&gpx1>;
146 interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
147 reg = <0x66>;
148
149 regulators {
150 esafeout1_reg: ESAFEOUT1 {
151 regulator-name = "ESAFEOUT1";
152 };
153 esafeout2_reg: ESAFEOUT2 {
154 regulator-name = "ESAFEOUT2";
155 };
156 charger_reg: CHARGER {
157 regulator-name = "CHARGER";
158 regulator-min-microamp = <60000>;
159 regulator-max-microamp = <2580000>;
160 };
161 };
162
163 max77693_haptic {
164 compatible = "maxim,max77693-haptic";
165 haptic-supply = <&ldo26_reg>;
166 pwms = <&pwm 0 38022 0>;
167 };
168
169 charger {
170 compatible = "maxim,max77693-charger";
171
172 maxim,constant-microvolt = <4350000>;
173 maxim,min-system-microvolt = <3600000>;
174 maxim,thermal-regulation-celsius = <100>;
175 maxim,battery-overcurrent-microamp = <3500000>;
176 maxim,charge-input-threshold-microvolt = <4300000>;
177 };
178 };
179 };
180
181 i2c_max77693_fuel: i2c-gpio-3 {
182 compatible = "i2c-gpio";
183 gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>, <&gpf1 4 GPIO_ACTIVE_HIGH>;
184 i2c-gpio,delay-us = <2>;
185 #address-cells = <1>;
186 #size-cells = <0>;
187 status = "okay";
188
189 max77693-fuel-gauge@36 {
190 compatible = "maxim,max17047";
191 interrupt-parent = <&gpx2>;
192 interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
193 reg = <0x36>;
194
195 maxim,over-heat-temp = <700>;
196 maxim,over-volt = <4500>;
197 };
198 };
199
200 i2c-mhl {
201 compatible = "i2c-gpio";
202 gpios = <&gpf0 4 GPIO_ACTIVE_HIGH>, <&gpf0 6 GPIO_ACTIVE_HIGH>;
203 i2c-gpio,delay-us = <100>;
204 #address-cells = <1>;
205 #size-cells = <0>;
206
207 pinctrl-0 = <&i2c_mhl_bus>;
208 pinctrl-names = "default";
209 status = "okay";
210
211 sii9234: hdmi-bridge@39 {
212 compatible = "sil,sii9234";
213 avcc33-supply = <&vcc33mhl>;
214 iovcc18-supply = <&vcc18mhl>;
215 avcc12-supply = <&vsil12>;
216 cvcc12-supply = <&vsil12>;
217 reset-gpios = <&gpf3 4 GPIO_ACTIVE_LOW>;
218 interrupt-parent = <&gpf3>;
219 interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
220 reg = <0x39>;
221
222 port {
223 mhl_to_hdmi: endpoint {
224 remote-endpoint = <&hdmi_to_mhl>;
225 };
226 };
227 };
228 };
229
230 wlan_pwrseq: sdhci3-pwrseq {
231 compatible = "mmc-pwrseq-simple";
232 reset-gpios = <&gpj0 0 GPIO_ACTIVE_LOW>;
233 clocks = <&max77686 MAX77686_CLK_PMIC>;
234 clock-names = "ext_clock";
235 };
236
237 sound {
238 compatible = "samsung,trats2-audio";
239 samsung,i2s-controller = <&i2s0>;
240 samsung,model = "Trats2";
241 samsung,audio-codec = <&wm1811>;
242 samsung,audio-routing =
243 "SPK", "SPKOUTLN",
244 "SPK", "SPKOUTLP",
245 "SPK", "SPKOUTRN",
246 "SPK", "SPKOUTRP";
247 };
248
249 thermistor-ap {
250 compatible = "murata,ncp15wb473";
251 pullup-uv = <1800000>; /* VCC_1.8V_AP */
252 pullup-ohm = <100000>; /* 100K */
253 pulldown-ohm = <100000>; /* 100K */
254 io-channels = <&adc 1>; /* AP temperature */
255 };
256
257 thermistor-battery {
258 compatible = "murata,ncp15wb473";
259 pullup-uv = <1800000>; /* VCC_1.8V_AP */
260 pullup-ohm = <100000>; /* 100K */
261 pulldown-ohm = <100000>; /* 100K */
262 io-channels = <&adc 2>; /* Battery temperature */
263 };
264
265 thermal-zones {
266 cpu_thermal: cpu-thermal {
267 cooling-maps {
268 map0 {
269 /* Corresponds to 800MHz at freq_table */
270 cooling-device = <&cpu0 7 7>;
271 };
272 map1 {
273 /* Corresponds to 200MHz at freq_table */
274 cooling-device = <&cpu0 13 13>;
275 };
276 };
277 };
278 };
279};
280
281&adc {
282 vdd-supply = <&ldo3_reg>;
283 status = "okay";
284};
285
286&bus_dmc {
287 devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
288 vdd-supply = <&buck1_reg>;
289 status = "okay";
290};
291
292&bus_acp {
293 devfreq = <&bus_dmc>;
294 status = "okay";
295};
296
297&bus_c2c {
298 devfreq = <&bus_dmc>;
299 status = "okay";
300};
301
302&bus_leftbus {
303 devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
304 vdd-supply = <&buck3_reg>;
305 status = "okay";
306};
307
308&bus_rightbus {
309 devfreq = <&bus_leftbus>;
310 status = "okay";
311};
312
313&bus_display {
314 devfreq = <&bus_leftbus>;
315 status = "okay";
316};
317
318&bus_fsys {
319 devfreq = <&bus_leftbus>;
320 status = "okay";
321};
322
323&bus_peri {
324 devfreq = <&bus_leftbus>;
325 status = "okay";
326};
327
328&bus_mfc {
329 devfreq = <&bus_leftbus>;
330 status = "okay";
331};
332
333&camera {
334 pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>;
335 pinctrl-names = "default";
336 status = "okay";
337 assigned-clocks = <&clock CLK_MOUT_CAM0>,
338 <&clock CLK_MOUT_CAM1>;
339 assigned-clock-parents = <&clock CLK_XUSBXTI>,
340 <&clock CLK_XUSBXTI>;
341};
342
343&cpu0 {
344 cpu0-supply = <&buck2_reg>;
345};
346
347&csis_0 {
348 status = "okay";
349 vddcore-supply = <&ldo8_reg>;
350 vddio-supply = <&ldo10_reg>;
351 assigned-clocks = <&clock CLK_MOUT_CSIS0>,
352 <&clock CLK_SCLK_CSIS0>;
353 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
354 assigned-clock-rates = <0>, <176000000>;
355
356 /* Camera C (3) MIPI CSI-2 (CSIS0) */
357 port@3 {
358 reg = <3>;
359 csis0_ep: endpoint {
360 remote-endpoint = <&s5c73m3_ep>;
361 data-lanes = <1 2 3 4>;
362 samsung,csis-hs-settle = <12>;
363 };
364 };
365};
366
367&csis_1 {
368 status = "okay";
369 vddcore-supply = <&ldo8_reg>;
370 vddio-supply = <&ldo10_reg>;
371 assigned-clocks = <&clock CLK_MOUT_CSIS1>,
372 <&clock CLK_SCLK_CSIS1>;
373 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
374 assigned-clock-rates = <0>, <176000000>;
375
376 /* Camera D (4) MIPI CSI-2 (CSIS1) */
377 port@4 {
378 reg = <4>;
379 csis1_ep: endpoint {
380 remote-endpoint = <&is_s5k6a3_ep>;
381 data-lanes = <1>;
382 samsung,csis-hs-settle = <18>;
383 samsung,csis-wclk;
384 };
385 };
386};
387
388&dsi_0 {
389 vddcore-supply = <&ldo8_reg>;
390 vddio-supply = <&ldo10_reg>;
391 samsung,burst-clock-frequency = <500000000>;
392 samsung,esc-clock-frequency = <20000000>;
393 samsung,pll-clock-frequency = <24000000>;
394};
395
396&exynos_usbphy {
397 vbus-supply = <&esafeout1_reg>;
398 status = "okay";
399};
400
401&fimc_0 {
402 status = "okay";
403 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
404 <&clock CLK_SCLK_FIMC0>;
405 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
406 assigned-clock-rates = <0>, <176000000>;
407};
408
409&fimc_1 {
410 status = "okay";
411 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
412 <&clock CLK_SCLK_FIMC1>;
413 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
414 assigned-clock-rates = <0>, <176000000>;
415};
416
417&fimc_2 {
418 status = "okay";
419 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
420 <&clock CLK_SCLK_FIMC2>;
421 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
422 assigned-clock-rates = <0>, <176000000>;
423};
424
425&fimc_3 {
426 status = "okay";
427 assigned-clocks = <&clock CLK_MOUT_FIMC3>,
428 <&clock CLK_SCLK_FIMC3>;
429 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
430 assigned-clock-rates = <0>, <176000000>;
431};
432
433&fimc_is {
434 pinctrl-0 = <&fimc_is_uart>;
435 pinctrl-names = "default";
436 status = "okay";
437
438 };
439
440&fimc_lite_0 {
441 status = "okay";
442};
443
444&fimc_lite_1 {
445 status = "okay";
446};
447
448&fimd {
449 status = "okay";
450};
451
452&hdmi {
453 hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
454 pinctrl-names = "default";
455 pinctrl-0 = <&hdmi_hpd>;
456 vdd-supply = <&ldo3_reg>;
457 vdd_osc-supply = <&ldo4_reg>;
458 vdd_pll-supply = <&ldo3_reg>;
459 ddc = <&i2c_5>;
460 status = "okay";
461
462 ports {
463 #address-cells = <1>;
464 #size-cells = <0>;
465
466 port@1 {
467 reg = <1>;
468 hdmi_to_mhl: endpoint {
469 remote-endpoint = <&mhl_to_hdmi>;
470 };
471 };
472 };
473};
474
475&hsotg {
476 vusb_d-supply = <&ldo15_reg>;
477 vusb_a-supply = <&ldo12_reg>;
478 dr_mode = "peripheral";
479 status = "okay";
480};
481
482&i2c_0 {
483 samsung,i2c-sda-delay = <100>;
484 samsung,i2c-slave-addr = <0x10>;
485 samsung,i2c-max-bus-freq = <400000>;
486 pinctrl-0 = <&i2c0_bus>;
487 pinctrl-names = "default";
488 status = "okay";
489
490 s5c73m3: s5c73m3@3c {
491 compatible = "samsung,s5c73m3";
492 reg = <0x3c>;
493 xshutdown-gpios = <&gpf1 3 GPIO_ACTIVE_LOW>; /* ISP_RESET */
494 vdd-int-supply = <&buck9_reg>;
495 vddio-cis-supply = <&ldo9_reg>;
496 vddio-host-supply = <&ldo18_reg>;
497 vdd-af-supply = <&cam_af_reg>;
498 vdd-reg-supply = <&cam_io_reg>;
499 clock-frequency = <24000000>;
500 /* CAM_A_CLKOUT */
501 clocks = <&camera 0>;
502 clock-names = "cis_extclk";
503 status = "disabled";
504 port {
505 s5c73m3_ep: endpoint {
506 remote-endpoint = <&csis0_ep>;
507 data-lanes = <1 2 3 4>;
508 };
509 };
510 };
511};
512
513&i2c1_isp {
514 pinctrl-0 = <&fimc_is_i2c1>;
515 pinctrl-names = "default";
516
517 s5k6a3@10 {
518 compatible = "samsung,s5k6a3";
519 reg = <0x10>;
520 svdda-supply = <&cam_io_reg>;
521 svddio-supply = <&ldo19_reg>;
522 afvdd-supply = <&ldo19_reg>;
523 clock-frequency = <24000000>;
524 /* CAM_B_CLKOUT */
525 clocks = <&camera 1>;
526 clock-names = "extclk";
527 samsung,camclk-out = <1>;
528 gpios = <&gpm1 6 GPIO_ACTIVE_HIGH>;
529
530 port {
531 is_s5k6a3_ep: endpoint {
532 remote-endpoint = <&csis1_ep>;
533 data-lanes = <1>;
534 };
535 };
536 };
537};
538
539&i2c_3 {
540 samsung,i2c-sda-delay = <100>;
541 samsung,i2c-slave-addr = <0x10>;
542 samsung,i2c-max-bus-freq = <400000>;
543 pinctrl-0 = <&i2c3_bus>;
544 pinctrl-names = "default";
545 status = "okay";
546};
547
548&i2c_4 {
549 samsung,i2c-sda-delay = <100>;
550 samsung,i2c-slave-addr = <0x10>;
551 samsung,i2c-max-bus-freq = <100000>;
552 pinctrl-0 = <&i2c4_bus>;
553 pinctrl-names = "default";
554 status = "okay";
555
556 wm1811: wm1811@1a {
557 compatible = "wlf,wm1811";
558 reg = <0x1a>;
559 clocks = <&pmu_system_controller 0>;
560 clock-names = "MCLK1";
561 DCVDD-supply = <&ldo3_reg>;
562 DBVDD1-supply = <&ldo3_reg>;
563 wlf,ldo1ena = <&gpj0 4 0>;
564 };
565};
566
567&i2c_5 {
568 status = "okay";
569};
570
571&i2c_7 {
572 samsung,i2c-sda-delay = <100>;
573 samsung,i2c-slave-addr = <0x10>;
574 samsung,i2c-max-bus-freq = <100000>;
575 pinctrl-0 = <&i2c7_bus>;
576 pinctrl-names = "default";
577 status = "okay";
578
579 max77686: max77686_pmic@9 {
580 compatible = "maxim,max77686";
581 interrupt-parent = <&gpx0>;
582 interrupts = <7 IRQ_TYPE_NONE>;
583 reg = <0x09>;
584 #clock-cells = <1>;
585
586 voltage-regulators {
587 ldo1_reg: LDO1 {
588 regulator-name = "VALIVE_1.0V_AP";
589 regulator-min-microvolt = <1000000>;
590 regulator-max-microvolt = <1000000>;
591 regulator-always-on;
592 };
593
594 ldo2_reg: LDO2 {
595 regulator-name = "VM1M2_1.2V_AP";
596 regulator-min-microvolt = <1200000>;
597 regulator-max-microvolt = <1200000>;
598 regulator-always-on;
599 regulator-state-mem {
600 regulator-on-in-suspend;
601 };
602 };
603
604 ldo3_reg: LDO3 {
605 regulator-name = "VCC_1.8V_AP";
606 regulator-min-microvolt = <1800000>;
607 regulator-max-microvolt = <1800000>;
608 regulator-always-on;
609 };
610
611 ldo4_reg: LDO4 {
612 regulator-name = "VCC_2.8V_AP";
613 regulator-min-microvolt = <2800000>;
614 regulator-max-microvolt = <2800000>;
615 regulator-always-on;
616 };
617
618 ldo5_reg: LDO5 {
619 regulator-name = "VCC_1.8V_IO";
620 regulator-min-microvolt = <1800000>;
621 regulator-max-microvolt = <1800000>;
622 regulator-always-on;
623 };
624
625 ldo6_reg: LDO6 {
626 regulator-name = "VMPLL_1.0V_AP";
627 regulator-min-microvolt = <1000000>;
628 regulator-max-microvolt = <1000000>;
629 regulator-always-on;
630 regulator-state-mem {
631 regulator-on-in-suspend;
632 };
633 };
634
635 ldo7_reg: LDO7 {
636 regulator-name = "VPLL_1.0V_AP";
637 regulator-min-microvolt = <1000000>;
638 regulator-max-microvolt = <1000000>;
639 regulator-always-on;
640 regulator-state-mem {
641 regulator-on-in-suspend;
642 };
643 };
644
645 ldo8_reg: LDO8 {
646 regulator-name = "VMIPI_1.0V";
647 regulator-min-microvolt = <1000000>;
648 regulator-max-microvolt = <1000000>;
649 regulator-state-mem {
650 regulator-off-in-suspend;
651 };
652 };
653
654 ldo9_reg: LDO9 {
655 regulator-name = "CAM_ISP_MIPI_1.2V";
656 regulator-min-microvolt = <1200000>;
657 regulator-max-microvolt = <1200000>;
658 };
659
660 ldo10_reg: LDO10 {
661 regulator-name = "VMIPI_1.8V";
662 regulator-min-microvolt = <1800000>;
663 regulator-max-microvolt = <1800000>;
664 regulator-state-mem {
665 regulator-off-in-suspend;
666 };
667 };
668
669 ldo11_reg: LDO11 {
670 regulator-name = "VABB1_1.95V";
671 regulator-min-microvolt = <1950000>;
672 regulator-max-microvolt = <1950000>;
673 regulator-always-on;
674 regulator-state-mem {
675 regulator-off-in-suspend;
676 };
677 };
678
679 ldo12_reg: LDO12 {
680 regulator-name = "VUOTG_3.0V";
681 regulator-min-microvolt = <3000000>;
682 regulator-max-microvolt = <3000000>;
683 regulator-state-mem {
684 regulator-off-in-suspend;
685 };
686 };
687
688 ldo13_reg: LDO13 {
689 regulator-name = "NFC_AVDD_1.8V";
690 regulator-min-microvolt = <1800000>;
691 regulator-max-microvolt = <1800000>;
692 };
693
694 ldo14_reg: LDO14 {
695 regulator-name = "VABB2_1.95V";
696 regulator-min-microvolt = <1950000>;
697 regulator-max-microvolt = <1950000>;
698 regulator-always-on;
699 regulator-state-mem {
700 regulator-off-in-suspend;
701 };
702 };
703
704 ldo15_reg: LDO15 {
705 regulator-name = "VHSIC_1.0V";
706 regulator-min-microvolt = <1000000>;
707 regulator-max-microvolt = <1000000>;
708 regulator-state-mem {
709 regulator-on-in-suspend;
710 };
711 };
712
713 ldo16_reg: LDO16 {
714 regulator-name = "VHSIC_1.8V";
715 regulator-min-microvolt = <1800000>;
716 regulator-max-microvolt = <1800000>;
717 regulator-state-mem {
718 regulator-on-in-suspend;
719 };
720 };
721
722 ldo17_reg: LDO17 {
723 regulator-name = "CAM_SENSOR_CORE_1.2V";
724 regulator-min-microvolt = <1200000>;
725 regulator-max-microvolt = <1200000>;
726 };
727
728 ldo18_reg: LDO18 {
729 regulator-name = "CAM_ISP_SEN_IO_1.8V";
730 regulator-min-microvolt = <1800000>;
731 regulator-max-microvolt = <1800000>;
732 };
733
734 ldo19_reg: LDO19 {
735 regulator-name = "VT_CAM_1.8V";
736 regulator-min-microvolt = <1800000>;
737 regulator-max-microvolt = <1800000>;
738 };
739
740 ldo20_reg: LDO20 {
741 regulator-name = "VDDQ_PRE_1.8V";
742 regulator-min-microvolt = <1800000>;
743 regulator-max-microvolt = <1800000>;
744 };
745
746 ldo21_reg: LDO21 {
747 regulator-name = "VTF_2.8V";
748 regulator-min-microvolt = <2800000>;
749 regulator-max-microvolt = <2800000>;
750 maxim,ena-gpios = <&gpy2 0 GPIO_ACTIVE_HIGH>;
751 };
752
753 ldo22_reg: LDO22 {
754 regulator-name = "VMEM_VDD_2.8V";
755 regulator-min-microvolt = <2800000>;
756 regulator-max-microvolt = <2800000>;
757 maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
758 };
759
760 ldo23_reg: LDO23 {
761 regulator-name = "TSP_AVDD_3.3V";
762 regulator-min-microvolt = <3300000>;
763 regulator-max-microvolt = <3300000>;
764 };
765
766 ldo24_reg: LDO24 {
767 regulator-name = "TSP_VDD_1.8V";
768 regulator-min-microvolt = <1800000>;
769 regulator-max-microvolt = <1800000>;
770 };
771
772 ldo25_reg: LDO25 {
773 regulator-name = "LDO25";
774 };
775
776 ldo26_reg: LDO26 {
777 regulator-name = "MOTOR_VCC_3.0V";
778 regulator-min-microvolt = <3000000>;
779 regulator-max-microvolt = <3000000>;
780 };
781
782 buck1_reg: BUCK1 {
783 regulator-name = "vdd_mif";
784 regulator-min-microvolt = <850000>;
785 regulator-max-microvolt = <1100000>;
786 regulator-always-on;
787 regulator-boot-on;
788 regulator-state-mem {
789 regulator-off-in-suspend;
790 };
791 };
792
793 buck2_reg: BUCK2 {
794 regulator-name = "vdd_arm";
795 regulator-min-microvolt = <850000>;
796 regulator-max-microvolt = <1500000>;
797 regulator-always-on;
798 regulator-boot-on;
799 regulator-state-mem {
800 regulator-on-in-suspend;
801 };
802 };
803
804 buck3_reg: BUCK3 {
805 regulator-name = "vdd_int";
806 regulator-min-microvolt = <850000>;
807 regulator-max-microvolt = <1150000>;
808 regulator-always-on;
809 regulator-boot-on;
810 regulator-state-mem {
811 regulator-off-in-suspend;
812 };
813 };
814
815 buck4_reg: BUCK4 {
816 regulator-name = "vdd_g3d";
817 regulator-min-microvolt = <850000>;
818 regulator-max-microvolt = <1150000>;
819 regulator-boot-on;
820 regulator-state-mem {
821 regulator-off-in-suspend;
822 };
823 };
824
825 buck5_reg: BUCK5 {
826 regulator-name = "VMEM_1.2V_AP";
827 regulator-min-microvolt = <1200000>;
828 regulator-max-microvolt = <1200000>;
829 regulator-always-on;
830 };
831
832 buck6_reg: BUCK6 {
833 regulator-name = "VCC_SUB_1.35V";
834 regulator-min-microvolt = <1350000>;
835 regulator-max-microvolt = <1350000>;
836 regulator-always-on;
837 };
838
839 buck7_reg: BUCK7 {
840 regulator-name = "VCC_SUB_2.0V";
841 regulator-min-microvolt = <2000000>;
842 regulator-max-microvolt = <2000000>;
843 regulator-always-on;
844 };
845
846 buck8_reg: BUCK8 {
847 regulator-name = "VMEM_VDDF_3.0V";
848 regulator-min-microvolt = <2850000>;
849 regulator-max-microvolt = <2850000>;
850 maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
851 };
852
853 buck9_reg: BUCK9 {
854 regulator-name = "CAM_ISP_CORE_1.2V";
855 regulator-min-microvolt = <1000000>;
856 regulator-max-microvolt = <1200000>;
857 };
858 };
859 };
860};
861
862&i2c_8 {
863 status = "okay";
864};
865
866&i2s0 {
867 pinctrl-0 = <&i2s0_bus>;
868 pinctrl-names = "default";
869 status = "okay";
870};
871
872&mixer {
873 status = "okay";
874};
875
876&mshc_0 {
877 broken-cd;
878 non-removable;
879 card-detect-delay = <200>;
880 vmmc-supply = <&ldo22_reg>;
881 clock-frequency = <400000000>;
882 samsung,dw-mshc-ciu-div = <0>;
883 samsung,dw-mshc-sdr-timing = <2 3>;
884 samsung,dw-mshc-ddr-timing = <1 2>;
885 pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
886 pinctrl-names = "default";
887 status = "okay";
888 bus-width = <8>;
889 cap-mmc-highspeed;
890};
891
892&pmu_system_controller {
893 assigned-clocks = <&pmu_system_controller 0>;
894 assigned-clock-parents = <&clock CLK_XUSBXTI>;
895};
896
897&pinctrl_0 {
898 pinctrl-names = "default";
899 pinctrl-0 = <&sleep0>;
900
901 mhl_int: mhl-int {
902 samsung,pins = "gpf3-5";
903 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
904 };
905
906 i2c_mhl_bus: i2c-mhl-bus {
907 samsung,pins = "gpf0-4", "gpf0-6";
908 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
909 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
910 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
911 };
912
913 sleep0: sleep-states {
914 PIN_SLP(gpa0-0, INPUT, NONE);
915 PIN_SLP(gpa0-1, OUT0, NONE);
916 PIN_SLP(gpa0-2, INPUT, NONE);
917 PIN_SLP(gpa0-3, INPUT, UP);
918 PIN_SLP(gpa0-4, INPUT, NONE);
919 PIN_SLP(gpa0-5, INPUT, DOWN);
920 PIN_SLP(gpa0-6, INPUT, DOWN);
921 PIN_SLP(gpa0-7, INPUT, UP);
922
923 PIN_SLP(gpa1-0, INPUT, DOWN);
924 PIN_SLP(gpa1-1, INPUT, DOWN);
925 PIN_SLP(gpa1-2, INPUT, DOWN);
926 PIN_SLP(gpa1-3, INPUT, DOWN);
927 PIN_SLP(gpa1-4, INPUT, DOWN);
928 PIN_SLP(gpa1-5, INPUT, DOWN);
929
930 PIN_SLP(gpb-0, INPUT, NONE);
931 PIN_SLP(gpb-1, INPUT, NONE);
932 PIN_SLP(gpb-2, INPUT, NONE);
933 PIN_SLP(gpb-3, INPUT, NONE);
934 PIN_SLP(gpb-4, INPUT, DOWN);
935 PIN_SLP(gpb-5, INPUT, UP);
936 PIN_SLP(gpb-6, INPUT, DOWN);
937 PIN_SLP(gpb-7, INPUT, DOWN);
938
939 PIN_SLP(gpc0-0, INPUT, DOWN);
940 PIN_SLP(gpc0-1, INPUT, DOWN);
941 PIN_SLP(gpc0-2, INPUT, DOWN);
942 PIN_SLP(gpc0-3, INPUT, DOWN);
943 PIN_SLP(gpc0-4, INPUT, DOWN);
944
945 PIN_SLP(gpc1-0, INPUT, NONE);
946 PIN_SLP(gpc1-1, PREV, NONE);
947 PIN_SLP(gpc1-2, INPUT, NONE);
948 PIN_SLP(gpc1-3, INPUT, NONE);
949 PIN_SLP(gpc1-4, INPUT, NONE);
950
951 PIN_SLP(gpd0-0, INPUT, DOWN);
952 PIN_SLP(gpd0-1, INPUT, DOWN);
953 PIN_SLP(gpd0-2, INPUT, NONE);
954 PIN_SLP(gpd0-3, INPUT, NONE);
955
956 PIN_SLP(gpd1-0, INPUT, DOWN);
957 PIN_SLP(gpd1-1, INPUT, DOWN);
958 PIN_SLP(gpd1-2, INPUT, NONE);
959 PIN_SLP(gpd1-3, INPUT, NONE);
960
961 PIN_SLP(gpf0-0, INPUT, NONE);
962 PIN_SLP(gpf0-1, INPUT, NONE);
963 PIN_SLP(gpf0-2, INPUT, DOWN);
964 PIN_SLP(gpf0-3, INPUT, DOWN);
965 PIN_SLP(gpf0-4, INPUT, NONE);
966 PIN_SLP(gpf0-5, INPUT, DOWN);
967 PIN_SLP(gpf0-6, INPUT, NONE);
968 PIN_SLP(gpf0-7, INPUT, DOWN);
969
970 PIN_SLP(gpf1-0, INPUT, DOWN);
971 PIN_SLP(gpf1-1, INPUT, DOWN);
972 PIN_SLP(gpf1-2, INPUT, DOWN);
973 PIN_SLP(gpf1-3, INPUT, DOWN);
974 PIN_SLP(gpf1-4, INPUT, NONE);
975 PIN_SLP(gpf1-5, INPUT, NONE);
976 PIN_SLP(gpf1-6, INPUT, DOWN);
977 PIN_SLP(gpf1-7, PREV, NONE);
978
979 PIN_SLP(gpf2-0, PREV, NONE);
980 PIN_SLP(gpf2-1, INPUT, DOWN);
981 PIN_SLP(gpf2-2, INPUT, DOWN);
982 PIN_SLP(gpf2-3, INPUT, DOWN);
983 PIN_SLP(gpf2-4, INPUT, DOWN);
984 PIN_SLP(gpf2-5, INPUT, DOWN);
985 PIN_SLP(gpf2-6, INPUT, NONE);
986 PIN_SLP(gpf2-7, INPUT, NONE);
987
988 PIN_SLP(gpf3-0, INPUT, NONE);
989 PIN_SLP(gpf3-1, PREV, NONE);
990 PIN_SLP(gpf3-2, PREV, NONE);
991 PIN_SLP(gpf3-3, PREV, NONE);
992 PIN_SLP(gpf3-4, OUT1, NONE);
993 PIN_SLP(gpf3-5, INPUT, DOWN);
994
995 PIN_SLP(gpj0-0, PREV, NONE);
996 PIN_SLP(gpj0-1, PREV, NONE);
997 PIN_SLP(gpj0-2, PREV, NONE);
998 PIN_SLP(gpj0-3, INPUT, DOWN);
999 PIN_SLP(gpj0-4, PREV, NONE);
1000 PIN_SLP(gpj0-5, PREV, NONE);
1001 PIN_SLP(gpj0-6, INPUT, DOWN);
1002 PIN_SLP(gpj0-7, INPUT, DOWN);
1003
1004 PIN_SLP(gpj1-0, INPUT, DOWN);
1005 PIN_SLP(gpj1-1, PREV, NONE);
1006 PIN_SLP(gpj1-2, PREV, NONE);
1007 PIN_SLP(gpj1-3, INPUT, DOWN);
1008 PIN_SLP(gpj1-4, INPUT, DOWN);
1009 };
1010};
1011
1012&pinctrl_1 {
1013 pinctrl-names = "default";
1014 pinctrl-0 = <&sleep1>;
1015
1016 hdmi_hpd: hdmi-hpd {
1017 samsung,pins = "gpx3-7";
1018 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
1019 };
1020
1021 sleep1: sleep-states {
1022 PIN_SLP(gpk0-0, PREV, NONE);
1023 PIN_SLP(gpk0-1, PREV, NONE);
1024 PIN_SLP(gpk0-2, OUT0, NONE);
1025 PIN_SLP(gpk0-3, PREV, NONE);
1026 PIN_SLP(gpk0-4, PREV, NONE);
1027 PIN_SLP(gpk0-5, PREV, NONE);
1028 PIN_SLP(gpk0-6, PREV, NONE);
1029
1030 PIN_SLP(gpk1-0, INPUT, DOWN);
1031 PIN_SLP(gpk1-1, INPUT, DOWN);
1032 PIN_SLP(gpk1-2, INPUT, DOWN);
1033 PIN_SLP(gpk1-3, PREV, NONE);
1034 PIN_SLP(gpk1-4, PREV, NONE);
1035 PIN_SLP(gpk1-5, PREV, NONE);
1036 PIN_SLP(gpk1-6, PREV, NONE);
1037
1038 PIN_SLP(gpk2-0, INPUT, DOWN);
1039 PIN_SLP(gpk2-1, INPUT, DOWN);
1040 PIN_SLP(gpk2-2, INPUT, DOWN);
1041 PIN_SLP(gpk2-3, INPUT, DOWN);
1042 PIN_SLP(gpk2-4, INPUT, DOWN);
1043 PIN_SLP(gpk2-5, INPUT, DOWN);
1044 PIN_SLP(gpk2-6, INPUT, DOWN);
1045
1046 PIN_SLP(gpk3-0, OUT0, NONE);
1047 PIN_SLP(gpk3-1, INPUT, NONE);
1048 PIN_SLP(gpk3-2, INPUT, DOWN);
1049 PIN_SLP(gpk3-3, INPUT, NONE);
1050 PIN_SLP(gpk3-4, INPUT, NONE);
1051 PIN_SLP(gpk3-5, INPUT, NONE);
1052 PIN_SLP(gpk3-6, INPUT, NONE);
1053
1054 PIN_SLP(gpl0-0, INPUT, DOWN);
1055 PIN_SLP(gpl0-1, INPUT, DOWN);
1056 PIN_SLP(gpl0-2, INPUT, DOWN);
1057 PIN_SLP(gpl0-3, INPUT, DOWN);
1058 PIN_SLP(gpl0-4, PREV, NONE);
1059 PIN_SLP(gpl0-6, PREV, NONE);
1060
1061 PIN_SLP(gpl1-0, INPUT, DOWN);
1062 PIN_SLP(gpl1-1, INPUT, DOWN);
1063 PIN_SLP(gpl2-0, INPUT, DOWN);
1064 PIN_SLP(gpl2-1, INPUT, DOWN);
1065 PIN_SLP(gpl2-2, INPUT, DOWN);
1066 PIN_SLP(gpl2-3, INPUT, DOWN);
1067 PIN_SLP(gpl2-4, INPUT, DOWN);
1068 PIN_SLP(gpl2-5, INPUT, DOWN);
1069 PIN_SLP(gpl2-6, PREV, NONE);
1070 PIN_SLP(gpl2-7, INPUT, DOWN);
1071
1072 PIN_SLP(gpm0-0, INPUT, DOWN);
1073 PIN_SLP(gpm0-1, INPUT, DOWN);
1074 PIN_SLP(gpm0-2, INPUT, DOWN);
1075 PIN_SLP(gpm0-3, INPUT, DOWN);
1076 PIN_SLP(gpm0-4, INPUT, DOWN);
1077 PIN_SLP(gpm0-5, INPUT, DOWN);
1078 PIN_SLP(gpm0-6, INPUT, DOWN);
1079 PIN_SLP(gpm0-7, INPUT, DOWN);
1080
1081 PIN_SLP(gpm1-0, INPUT, DOWN);
1082 PIN_SLP(gpm1-1, INPUT, DOWN);
1083 PIN_SLP(gpm1-2, INPUT, NONE);
1084 PIN_SLP(gpm1-3, INPUT, NONE);
1085 PIN_SLP(gpm1-4, INPUT, NONE);
1086 PIN_SLP(gpm1-5, INPUT, NONE);
1087 PIN_SLP(gpm1-6, INPUT, DOWN);
1088
1089 PIN_SLP(gpm2-0, INPUT, NONE);
1090 PIN_SLP(gpm2-1, INPUT, NONE);
1091 PIN_SLP(gpm2-2, INPUT, DOWN);
1092 PIN_SLP(gpm2-3, INPUT, DOWN);
1093 PIN_SLP(gpm2-4, INPUT, DOWN);
1094
1095 PIN_SLP(gpm3-0, PREV, NONE);
1096 PIN_SLP(gpm3-1, PREV, NONE);
1097 PIN_SLP(gpm3-2, PREV, NONE);
1098 PIN_SLP(gpm3-3, OUT1, NONE);
1099 PIN_SLP(gpm3-4, INPUT, DOWN);
1100 PIN_SLP(gpm3-5, INPUT, DOWN);
1101 PIN_SLP(gpm3-6, INPUT, DOWN);
1102 PIN_SLP(gpm3-7, INPUT, DOWN);
1103
1104 PIN_SLP(gpm4-0, INPUT, DOWN);
1105 PIN_SLP(gpm4-1, INPUT, DOWN);
1106 PIN_SLP(gpm4-2, INPUT, DOWN);
1107 PIN_SLP(gpm4-3, INPUT, DOWN);
1108 PIN_SLP(gpm4-4, INPUT, DOWN);
1109 PIN_SLP(gpm4-5, INPUT, DOWN);
1110 PIN_SLP(gpm4-6, INPUT, DOWN);
1111 PIN_SLP(gpm4-7, INPUT, DOWN);
1112
1113 PIN_SLP(gpy0-0, INPUT, DOWN);
1114 PIN_SLP(gpy0-1, INPUT, DOWN);
1115 PIN_SLP(gpy0-2, INPUT, DOWN);
1116 PIN_SLP(gpy0-3, INPUT, DOWN);
1117 PIN_SLP(gpy0-4, INPUT, DOWN);
1118 PIN_SLP(gpy0-5, INPUT, DOWN);
1119
1120 PIN_SLP(gpy1-0, INPUT, DOWN);
1121 PIN_SLP(gpy1-1, INPUT, DOWN);
1122 PIN_SLP(gpy1-2, INPUT, DOWN);
1123 PIN_SLP(gpy1-3, INPUT, DOWN);
1124
1125 PIN_SLP(gpy2-0, PREV, NONE);
1126 PIN_SLP(gpy2-1, INPUT, DOWN);
1127 PIN_SLP(gpy2-2, INPUT, NONE);
1128 PIN_SLP(gpy2-3, INPUT, NONE);
1129 PIN_SLP(gpy2-4, INPUT, NONE);
1130 PIN_SLP(gpy2-5, INPUT, NONE);
1131
1132 PIN_SLP(gpy3-0, INPUT, DOWN);
1133 PIN_SLP(gpy3-1, INPUT, DOWN);
1134 PIN_SLP(gpy3-2, INPUT, DOWN);
1135 PIN_SLP(gpy3-3, INPUT, DOWN);
1136 PIN_SLP(gpy3-4, INPUT, DOWN);
1137 PIN_SLP(gpy3-5, INPUT, DOWN);
1138 PIN_SLP(gpy3-6, INPUT, DOWN);
1139 PIN_SLP(gpy3-7, INPUT, DOWN);
1140
1141 PIN_SLP(gpy4-0, INPUT, DOWN);
1142 PIN_SLP(gpy4-1, INPUT, DOWN);
1143 PIN_SLP(gpy4-2, INPUT, DOWN);
1144 PIN_SLP(gpy4-3, INPUT, DOWN);
1145 PIN_SLP(gpy4-4, INPUT, DOWN);
1146 PIN_SLP(gpy4-5, INPUT, DOWN);
1147 PIN_SLP(gpy4-6, INPUT, DOWN);
1148 PIN_SLP(gpy4-7, INPUT, DOWN);
1149
1150 PIN_SLP(gpy5-0, INPUT, DOWN);
1151 PIN_SLP(gpy5-1, INPUT, DOWN);
1152 PIN_SLP(gpy5-2, INPUT, DOWN);
1153 PIN_SLP(gpy5-3, INPUT, DOWN);
1154 PIN_SLP(gpy5-4, INPUT, DOWN);
1155 PIN_SLP(gpy5-5, INPUT, DOWN);
1156 PIN_SLP(gpy5-6, INPUT, DOWN);
1157 PIN_SLP(gpy5-7, INPUT, DOWN);
1158
1159 PIN_SLP(gpy6-0, INPUT, DOWN);
1160 PIN_SLP(gpy6-1, INPUT, DOWN);
1161 PIN_SLP(gpy6-2, INPUT, DOWN);
1162 PIN_SLP(gpy6-3, INPUT, DOWN);
1163 PIN_SLP(gpy6-4, INPUT, DOWN);
1164 PIN_SLP(gpy6-5, INPUT, DOWN);
1165 PIN_SLP(gpy6-6, INPUT, DOWN);
1166 PIN_SLP(gpy6-7, INPUT, DOWN);
1167 };
1168};
1169
1170&pinctrl_2 {
1171 pinctrl-names = "default";
1172 pinctrl-0 = <&sleep2>;
1173
1174 sleep2: sleep-states {
1175 PIN_SLP(gpz-0, INPUT, DOWN);
1176 PIN_SLP(gpz-1, INPUT, DOWN);
1177 PIN_SLP(gpz-2, INPUT, DOWN);
1178 PIN_SLP(gpz-3, INPUT, DOWN);
1179 PIN_SLP(gpz-4, INPUT, DOWN);
1180 PIN_SLP(gpz-5, INPUT, DOWN);
1181 PIN_SLP(gpz-6, INPUT, DOWN);
1182 };
1183};
1184
1185&pinctrl_3 {
1186 pinctrl-names = "default";
1187 pinctrl-0 = <&sleep3>;
1188
1189 sleep3: sleep-states {
1190 PIN_SLP(gpv0-0, INPUT, DOWN);
1191 PIN_SLP(gpv0-1, INPUT, DOWN);
1192 PIN_SLP(gpv0-2, INPUT, DOWN);
1193 PIN_SLP(gpv0-3, INPUT, DOWN);
1194 PIN_SLP(gpv0-4, INPUT, DOWN);
1195 PIN_SLP(gpv0-5, INPUT, DOWN);
1196 PIN_SLP(gpv0-6, INPUT, DOWN);
1197 PIN_SLP(gpv0-7, INPUT, DOWN);
1198
1199 PIN_SLP(gpv1-0, INPUT, DOWN);
1200 PIN_SLP(gpv1-1, INPUT, DOWN);
1201 PIN_SLP(gpv1-2, INPUT, DOWN);
1202 PIN_SLP(gpv1-3, INPUT, DOWN);
1203 PIN_SLP(gpv1-4, INPUT, DOWN);
1204 PIN_SLP(gpv1-5, INPUT, DOWN);
1205 PIN_SLP(gpv1-6, INPUT, DOWN);
1206 PIN_SLP(gpv1-7, INPUT, DOWN);
1207
1208 PIN_SLP(gpv2-0, INPUT, DOWN);
1209 PIN_SLP(gpv2-1, INPUT, DOWN);
1210 PIN_SLP(gpv2-2, INPUT, DOWN);
1211 PIN_SLP(gpv2-3, INPUT, DOWN);
1212 PIN_SLP(gpv2-4, INPUT, DOWN);
1213 PIN_SLP(gpv2-5, INPUT, DOWN);
1214 PIN_SLP(gpv2-6, INPUT, DOWN);
1215 PIN_SLP(gpv2-7, INPUT, DOWN);
1216
1217 PIN_SLP(gpv3-0, INPUT, DOWN);
1218 PIN_SLP(gpv3-1, INPUT, DOWN);
1219 PIN_SLP(gpv3-2, INPUT, DOWN);
1220 PIN_SLP(gpv3-3, INPUT, DOWN);
1221 PIN_SLP(gpv3-4, INPUT, DOWN);
1222 PIN_SLP(gpv3-5, INPUT, DOWN);
1223 PIN_SLP(gpv3-6, INPUT, DOWN);
1224 PIN_SLP(gpv3-7, INPUT, DOWN);
1225
1226 PIN_SLP(gpv4-0, INPUT, DOWN);
1227 };
1228};
1229
1230&pwm {
1231 pinctrl-0 = <&pwm0_out>;
1232 pinctrl-names = "default";
1233 samsung,pwm-outputs = <0>;
1234 status = "okay";
1235};
1236
1237&rtc {
1238 status = "okay";
1239 clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
1240 clock-names = "rtc", "rtc_src";
1241};
1242
1243&sdhci_2 {
1244 bus-width = <4>;
1245 cd-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
1246 cd-inverted;
1247 pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
1248 pinctrl-names = "default";
1249 vmmc-supply = <&ldo21_reg>;
1250 status = "okay";
1251};
1252
1253&sdhci_3 {
1254 #address-cells = <1>;
1255 #size-cells = <0>;
1256 non-removable;
1257 bus-width = <4>;
1258
1259 mmc-pwrseq = <&wlan_pwrseq>;
1260 pinctrl-names = "default";
1261 pinctrl-0 = <&sd3_clk &sd3_cmd &sd3_bus4>;
1262 status = "okay";
1263
1264 brcmf: wifi@1 {
1265 reg = <1>;
1266 compatible = "brcm,bcm4329-fmac";
1267 interrupt-parent = <&gpx2>;
1268 interrupts = <5 IRQ_TYPE_NONE>;
1269 interrupt-names = "host-wake";
1270 };
1271};
1272
1273&serial_0 {
1274 status = "okay";
1275};
1276
1277&serial_1 {
1278 status = "okay";
1279};
1280
1281&serial_2 {
1282 status = "okay";
1283};
1284
1285&serial_3 {
1286 status = "okay";
1287};
1288
1289&spi_1 {
1290 pinctrl-names = "default";
1291 pinctrl-0 = <&spi1_bus>;
1292 cs-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
1293 status = "okay";
1294
1295 s5c73m3_spi: s5c73m3@0 {
1296 compatible = "samsung,s5c73m3";
1297 spi-max-frequency = <50000000>;
1298 reg = <0>;
1299 controller-data {
1300 samsung,spi-feedback-delay = <2>;
1301 };
1302 };
1303};
1304
1305&tmu {
1306 vtmu-supply = <&ldo10_reg>;
1307 status = "okay";
1308};
diff --git a/arch/arm/boot/dts/exynos4412-n710x.dts b/arch/arm/boot/dts/exynos4412-n710x.dts
new file mode 100644
index 000000000000..eb402a0d6651
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-n710x.dts
@@ -0,0 +1,77 @@
1// SPDX-License-Identifier: GPL-2.0
2/dts-v1/;
3#include "exynos4412-midas.dtsi"
4
5/ {
6 compatible = "samsung,n710x", "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
7 model = "Samsung Galaxy Note 2 (GT-N7100, GT-N7105) based on Exynos4412";
8
9 memory@40000000 {
10 device_type = "memory";
11 reg = <0x40000000 0x80000000>;
12 };
13
14 /* bootargs are passed in by bootloader */
15
16 regulators {
17 cam_vdda_reg: voltage-regulator-9 {
18 compatible = "regulator-fixed";
19 regulator-name = "CAM_SENSOR_CORE_1.2V";
20 regulator-min-microvolt = <1200000>;
21 regulator-max-microvolt = <1200000>;
22 gpio = <&gpm4 1 GPIO_ACTIVE_HIGH>;
23 enable-active-high;
24 };
25 };
26};
27
28&buck9_reg {
29 maxim,ena-gpios = <&gpm1 0 GPIO_ACTIVE_HIGH>;
30};
31
32&cam_af_reg {
33 gpio = <&gpm1 1 GPIO_ACTIVE_HIGH>;
34 status = "okay";
35};
36
37&cam_io_reg {
38 gpio = <&gpm0 7 GPIO_ACTIVE_HIGH>;
39 status = "okay";
40};
41
42&i2c_3 {
43 samsung,i2c-sda-delay = <100>;
44 samsung,i2c-slave-addr = <0x10>;
45 samsung,i2c-max-bus-freq = <400000>;
46 pinctrl-0 = <&i2c3_bus>;
47 pinctrl-names = "default";
48 status = "okay";
49
50 mms152-touchscreen@48 {
51 compatible = "melfas,mms152";
52 reg = <0x48>;
53 interrupt-parent = <&gpm2>;
54 interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
55 x-size = <720>;
56 y-size = <1280>;
57 avdd-supply = <&ldo23_reg>;
58 vdd-supply = <&ldo24_reg>;
59 };
60};
61
62&ldo13_reg {
63 regulator-name = "VCC_1.8V_LCD";
64 regulator-always-on;
65};
66
67&ldo25_reg {
68 regulator-name = "VCI_3.0V_LCD";
69 regulator-min-microvolt = <3000000>;
70 regulator-max-microvolt = <3000000>;
71};
72
73&s5c73m3 {
74 standby-gpios = <&gpm0 6 GPIO_ACTIVE_LOW>; /* ISP_STANDBY */
75 vdda-supply = <&cam_vdda_reg>;
76 status = "okay";
77};
diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index 556ea78b8e32..d7ad07fd48f9 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -61,12 +61,6 @@
61 reset-gpios = <&gpk1 2 GPIO_ACTIVE_LOW>; 61 reset-gpios = <&gpk1 2 GPIO_ACTIVE_LOW>;
62 }; 62 };
63 63
64 camera {
65 status = "okay";
66 pinctrl-names = "default";
67 pinctrl-0 = <>;
68 };
69
70 fixed-rate-clocks { 64 fixed-rate-clocks {
71 xxti { 65 xxti {
72 compatible = "samsung,clock-xxti"; 66 compatible = "samsung,clock-xxti";
@@ -142,6 +136,12 @@
142 status = "okay"; 136 status = "okay";
143}; 137};
144 138
139&camera {
140 status = "okay";
141 pinctrl-names = "default";
142 pinctrl-0 = <>;
143};
144
145&clock_audss { 145&clock_audss {
146 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>, 146 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>,
147 <&clock_audss EXYNOS_MOUT_I2S>, 147 <&clock_audss EXYNOS_MOUT_I2S>,
diff --git a/arch/arm/boot/dts/exynos4412-pinctrl.dtsi b/arch/arm/boot/dts/exynos4412-pinctrl.dtsi
index e8dd5f2d976f..d7d5fdc230d8 100644
--- a/arch/arm/boot/dts/exynos4412-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4412-pinctrl.dtsi
@@ -18,964 +18,962 @@
18 samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_ ##_pull>; \ 18 samsung,pin-pud-pdn = <EXYNOS_PIN_PULL_ ##_pull>; \
19 } 19 }
20 20
21/ { 21&pinctrl_0 {
22 pinctrl_0: pinctrl@11400000 { 22 gpa0: gpa0 {
23 gpa0: gpa0 { 23 gpio-controller;
24 gpio-controller; 24 #gpio-cells = <2>;
25 #gpio-cells = <2>;
26 25
27 interrupt-controller; 26 interrupt-controller;
28 #interrupt-cells = <2>; 27 #interrupt-cells = <2>;
29 }; 28 };
30 29
31 gpa1: gpa1 { 30 gpa1: gpa1 {
32 gpio-controller; 31 gpio-controller;
33 #gpio-cells = <2>; 32 #gpio-cells = <2>;
34 33
35 interrupt-controller; 34 interrupt-controller;
36 #interrupt-cells = <2>; 35 #interrupt-cells = <2>;
37 }; 36 };
38 37
39 gpb: gpb { 38 gpb: gpb {
40 gpio-controller; 39 gpio-controller;
41 #gpio-cells = <2>; 40 #gpio-cells = <2>;
42 41
43 interrupt-controller; 42 interrupt-controller;
44 #interrupt-cells = <2>; 43 #interrupt-cells = <2>;
45 }; 44 };
46 45
47 gpc0: gpc0 { 46 gpc0: gpc0 {
48 gpio-controller; 47 gpio-controller;
49 #gpio-cells = <2>; 48 #gpio-cells = <2>;
50 49
51 interrupt-controller; 50 interrupt-controller;
52 #interrupt-cells = <2>; 51 #interrupt-cells = <2>;
53 }; 52 };
54 53
55 gpc1: gpc1 { 54 gpc1: gpc1 {
56 gpio-controller; 55 gpio-controller;
57 #gpio-cells = <2>; 56 #gpio-cells = <2>;
58 57
59 interrupt-controller; 58 interrupt-controller;
60 #interrupt-cells = <2>; 59 #interrupt-cells = <2>;
61 }; 60 };
62 61
63 gpd0: gpd0 { 62 gpd0: gpd0 {
64 gpio-controller; 63 gpio-controller;
65 #gpio-cells = <2>; 64 #gpio-cells = <2>;
66 65
67 interrupt-controller; 66 interrupt-controller;
68 #interrupt-cells = <2>; 67 #interrupt-cells = <2>;
69 }; 68 };
70 69
71 gpd1: gpd1 { 70 gpd1: gpd1 {
72 gpio-controller; 71 gpio-controller;
73 #gpio-cells = <2>; 72 #gpio-cells = <2>;
74 73
75 interrupt-controller; 74 interrupt-controller;
76 #interrupt-cells = <2>; 75 #interrupt-cells = <2>;
77 }; 76 };
78 77
79 gpf0: gpf0 { 78 gpf0: gpf0 {
80 gpio-controller; 79 gpio-controller;
81 #gpio-cells = <2>; 80 #gpio-cells = <2>;
82 81
83 interrupt-controller; 82 interrupt-controller;
84 #interrupt-cells = <2>; 83 #interrupt-cells = <2>;
85 }; 84 };
86 85
87 gpf1: gpf1 { 86 gpf1: gpf1 {
88 gpio-controller; 87 gpio-controller;
89 #gpio-cells = <2>; 88 #gpio-cells = <2>;
90 89
91 interrupt-controller; 90 interrupt-controller;
92 #interrupt-cells = <2>; 91 #interrupt-cells = <2>;
93 }; 92 };
94 93
95 gpf2: gpf2 { 94 gpf2: gpf2 {
96 gpio-controller; 95 gpio-controller;
97 #gpio-cells = <2>; 96 #gpio-cells = <2>;
98 97
99 interrupt-controller; 98 interrupt-controller;
100 #interrupt-cells = <2>; 99 #interrupt-cells = <2>;
101 }; 100 };
102 101
103 gpf3: gpf3 { 102 gpf3: gpf3 {
104 gpio-controller; 103 gpio-controller;
105 #gpio-cells = <2>; 104 #gpio-cells = <2>;
106 105
107 interrupt-controller; 106 interrupt-controller;
108 #interrupt-cells = <2>; 107 #interrupt-cells = <2>;
109 }; 108 };
110 109
111 gpj0: gpj0 { 110 gpj0: gpj0 {
112 gpio-controller; 111 gpio-controller;
113 #gpio-cells = <2>; 112 #gpio-cells = <2>;
114 113
115 interrupt-controller; 114 interrupt-controller;
116 #interrupt-cells = <2>; 115 #interrupt-cells = <2>;
117 }; 116 };
118 117
119 gpj1: gpj1 { 118 gpj1: gpj1 {
120 gpio-controller; 119 gpio-controller;
121 #gpio-cells = <2>; 120 #gpio-cells = <2>;
122 121
123 interrupt-controller; 122 interrupt-controller;
124 #interrupt-cells = <2>; 123 #interrupt-cells = <2>;
125 }; 124 };
126 125
127 uart0_data: uart0-data { 126 uart0_data: uart0-data {
128 samsung,pins = "gpa0-0", "gpa0-1"; 127 samsung,pins = "gpa0-0", "gpa0-1";
129 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 128 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
130 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 129 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
131 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 130 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
132 }; 131 };
133 132
134 uart0_fctl: uart0-fctl { 133 uart0_fctl: uart0-fctl {
135 samsung,pins = "gpa0-2", "gpa0-3"; 134 samsung,pins = "gpa0-2", "gpa0-3";
136 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 135 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
137 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 136 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
138 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 137 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
139 }; 138 };
140 139
141 uart1_data: uart1-data { 140 uart1_data: uart1-data {
142 samsung,pins = "gpa0-4", "gpa0-5"; 141 samsung,pins = "gpa0-4", "gpa0-5";
143 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 142 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
144 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 143 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
145 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 144 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
146 }; 145 };
147 146
148 uart1_fctl: uart1-fctl { 147 uart1_fctl: uart1-fctl {
149 samsung,pins = "gpa0-6", "gpa0-7"; 148 samsung,pins = "gpa0-6", "gpa0-7";
150 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 149 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
151 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 150 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
152 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 151 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
153 }; 152 };
154 153
155 i2c2_bus: i2c2-bus { 154 i2c2_bus: i2c2-bus {
156 samsung,pins = "gpa0-6", "gpa0-7"; 155 samsung,pins = "gpa0-6", "gpa0-7";
157 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 156 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
158 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 157 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
159 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 158 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
160 }; 159 };
161 160
162 uart2_data: uart2-data { 161 uart2_data: uart2-data {
163 samsung,pins = "gpa1-0", "gpa1-1"; 162 samsung,pins = "gpa1-0", "gpa1-1";
164 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 163 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
165 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 164 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
166 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 165 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
167 }; 166 };
168 167
169 uart2_fctl: uart2-fctl { 168 uart2_fctl: uart2-fctl {
170 samsung,pins = "gpa1-2", "gpa1-3"; 169 samsung,pins = "gpa1-2", "gpa1-3";
171 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 170 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
172 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 171 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
173 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 172 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
174 }; 173 };
175 174
176 uart_audio_a: uart-audio-a { 175 uart_audio_a: uart-audio-a {
177 samsung,pins = "gpa1-0", "gpa1-1"; 176 samsung,pins = "gpa1-0", "gpa1-1";
178 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 177 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
179 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 178 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
180 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 179 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
181 }; 180 };
182 181
183 i2c3_bus: i2c3-bus { 182 i2c3_bus: i2c3-bus {
184 samsung,pins = "gpa1-2", "gpa1-3"; 183 samsung,pins = "gpa1-2", "gpa1-3";
185 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 184 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
186 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 185 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
187 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 186 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
188 }; 187 };
189 188
190 uart3_data: uart3-data { 189 uart3_data: uart3-data {
191 samsung,pins = "gpa1-4", "gpa1-5"; 190 samsung,pins = "gpa1-4", "gpa1-5";
192 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 191 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
193 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 192 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
194 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 193 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
195 }; 194 };
196 195
197 uart_audio_b: uart-audio-b { 196 uart_audio_b: uart-audio-b {
198 samsung,pins = "gpa1-4", "gpa1-5"; 197 samsung,pins = "gpa1-4", "gpa1-5";
199 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 198 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
200 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 199 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
201 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 200 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
202 }; 201 };
203 202
204 spi0_bus: spi0-bus { 203 spi0_bus: spi0-bus {
205 samsung,pins = "gpb-0", "gpb-2", "gpb-3"; 204 samsung,pins = "gpb-0", "gpb-2", "gpb-3";
206 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 205 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
207 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 206 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
208 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 207 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
209 }; 208 };
210 209
211 i2c4_bus: i2c4-bus { 210 i2c4_bus: i2c4-bus {
212 samsung,pins = "gpb-0", "gpb-1"; 211 samsung,pins = "gpb-0", "gpb-1";
213 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 212 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
214 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 213 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
215 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 214 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
216 }; 215 };
217 216
218 spi1_bus: spi1-bus { 217 spi1_bus: spi1-bus {
219 samsung,pins = "gpb-4", "gpb-6", "gpb-7"; 218 samsung,pins = "gpb-4", "gpb-6", "gpb-7";
220 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 219 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
221 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 220 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
222 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 221 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
223 }; 222 };
224 223
225 i2c5_bus: i2c5-bus { 224 i2c5_bus: i2c5-bus {
226 samsung,pins = "gpb-2", "gpb-3"; 225 samsung,pins = "gpb-2", "gpb-3";
227 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 226 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
228 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 227 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
229 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 228 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
230 }; 229 };
231 230
232 i2s1_bus: i2s1-bus { 231 i2s1_bus: i2s1-bus {
233 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", 232 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
234 "gpc0-4"; 233 "gpc0-4";
235 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 234 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
236 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 235 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
237 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 236 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
238 }; 237 };
239 238
240 pcm1_bus: pcm1-bus { 239 pcm1_bus: pcm1-bus {
241 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", 240 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
242 "gpc0-4"; 241 "gpc0-4";
243 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 242 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
244 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 243 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
245 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 244 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
246 }; 245 };
247 246
248 ac97_bus: ac97-bus { 247 ac97_bus: ac97-bus {
249 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3", 248 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
250 "gpc0-4"; 249 "gpc0-4";
251 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 250 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
252 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 251 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
253 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 252 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
254 }; 253 };
255 254
256 i2s2_bus: i2s2-bus { 255 i2s2_bus: i2s2-bus {
257 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3", 256 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
258 "gpc1-4"; 257 "gpc1-4";
259 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 258 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
260 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 259 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
261 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 260 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
262 }; 261 };
263 262
264 pcm2_bus: pcm2-bus { 263 pcm2_bus: pcm2-bus {
265 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3", 264 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
266 "gpc1-4"; 265 "gpc1-4";
267 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 266 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
268 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 267 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
269 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 268 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
270 }; 269 };
271 270
272 spdif_bus: spdif-bus { 271 spdif_bus: spdif-bus {
273 samsung,pins = "gpc1-0", "gpc1-1"; 272 samsung,pins = "gpc1-0", "gpc1-1";
274 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 273 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
275 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 274 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
276 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 275 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
277 }; 276 };
278 277
279 i2c6_bus: i2c6-bus { 278 i2c6_bus: i2c6-bus {
280 samsung,pins = "gpc1-3", "gpc1-4"; 279 samsung,pins = "gpc1-3", "gpc1-4";
281 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 280 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
282 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 281 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
283 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 282 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
284 }; 283 };
285 284
286 spi2_bus: spi2-bus { 285 spi2_bus: spi2-bus {
287 samsung,pins = "gpc1-1", "gpc1-3", "gpc1-4"; 286 samsung,pins = "gpc1-1", "gpc1-3", "gpc1-4";
288 samsung,pin-function = <EXYNOS_PIN_FUNC_5>; 287 samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
289 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 288 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
290 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 289 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
291 }; 290 };
292 291
293 pwm0_out: pwm0-out { 292 pwm0_out: pwm0-out {
294 samsung,pins = "gpd0-0"; 293 samsung,pins = "gpd0-0";
295 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 294 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
296 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 295 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
297 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 296 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
298 }; 297 };
299 298
300 pwm1_out: pwm1-out { 299 pwm1_out: pwm1-out {
301 samsung,pins = "gpd0-1"; 300 samsung,pins = "gpd0-1";
302 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 301 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
303 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 302 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
304 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 303 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
305 }; 304 };
306 305
307 lcd_ctrl: lcd-ctrl { 306 lcd_ctrl: lcd-ctrl {
308 samsung,pins = "gpd0-0", "gpd0-1"; 307 samsung,pins = "gpd0-0", "gpd0-1";
309 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 308 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
310 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 309 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
311 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 310 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
312 }; 311 };
313 312
314 i2c7_bus: i2c7-bus { 313 i2c7_bus: i2c7-bus {
315 samsung,pins = "gpd0-2", "gpd0-3"; 314 samsung,pins = "gpd0-2", "gpd0-3";
316 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 315 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
317 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 316 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
318 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 317 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
319 }; 318 };
320 319
321 pwm2_out: pwm2-out { 320 pwm2_out: pwm2-out {
322 samsung,pins = "gpd0-2"; 321 samsung,pins = "gpd0-2";
323 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 322 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
324 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 323 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
325 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 324 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
326 }; 325 };
327 326
328 pwm3_out: pwm3-out { 327 pwm3_out: pwm3-out {
329 samsung,pins = "gpd0-3"; 328 samsung,pins = "gpd0-3";
330 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 329 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
331 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 330 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
332 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 331 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
333 }; 332 };
334 333
335 i2c0_bus: i2c0-bus { 334 i2c0_bus: i2c0-bus {
336 samsung,pins = "gpd1-0", "gpd1-1"; 335 samsung,pins = "gpd1-0", "gpd1-1";
337 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 336 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
338 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 337 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
339 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 338 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
340 }; 339 };
341 340
342 mipi0_clk: mipi0-clk { 341 mipi0_clk: mipi0-clk {
343 samsung,pins = "gpd1-0", "gpd1-1"; 342 samsung,pins = "gpd1-0", "gpd1-1";
344 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 343 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
345 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 344 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
346 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 345 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
347 }; 346 };
348 347
349 i2c1_bus: i2c1-bus { 348 i2c1_bus: i2c1-bus {
350 samsung,pins = "gpd1-2", "gpd1-3"; 349 samsung,pins = "gpd1-2", "gpd1-3";
351 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 350 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
352 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 351 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
353 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 352 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
354 }; 353 };
355 354
356 mipi1_clk: mipi1-clk { 355 mipi1_clk: mipi1-clk {
357 samsung,pins = "gpd1-2", "gpd1-3"; 356 samsung,pins = "gpd1-2", "gpd1-3";
358 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 357 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
359 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 358 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
360 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 359 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
361 }; 360 };
362 361
363 lcd_clk: lcd-clk { 362 lcd_clk: lcd-clk {
364 samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3"; 363 samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
365 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 364 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
366 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 365 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
367 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 366 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
368 }; 367 };
369 368
370 lcd_data16: lcd-data-width16 { 369 lcd_data16: lcd-data-width16 {
371 samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2", 370 samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
372 "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0", 371 "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
373 "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7", 372 "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
374 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3"; 373 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
375 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 374 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
376 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 375 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
377 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 376 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
378 }; 377 };
379 378
380 lcd_data18: lcd-data-width18 { 379 lcd_data18: lcd-data-width18 {
381 samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1", 380 samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
382 "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7", 381 "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
383 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3", 382 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
384 "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1", 383 "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1",
385 "gpf3-2", "gpf3-3"; 384 "gpf3-2", "gpf3-3";
386 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 385 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
387 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 386 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
388 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 387 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
389 }; 388 };
390 389
391 lcd_data24: lcd-data-width24 { 390 lcd_data24: lcd-data-width24 {
392 samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7", 391 samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
393 "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3", 392 "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
394 "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7", 393 "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
395 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3", 394 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
396 "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7", 395 "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7",
397 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3"; 396 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
398 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 397 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
399 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 398 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
400 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 399 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
401 }; 400 };
402 401
403 lcd_ldi: lcd-ldi { 402 lcd_ldi: lcd-ldi {
404 samsung,pins = "gpf3-4"; 403 samsung,pins = "gpf3-4";
405 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 404 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
406 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 405 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
407 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 406 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
408 }; 407 };
409 408
410 cam_port_a_io: cam-port-a-io { 409 cam_port_a_io: cam-port-a-io {
411 samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3", 410 samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
412 "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7", 411 "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
413 "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4"; 412 "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
414 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 413 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
415 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 414 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
416 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 415 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
417 }; 416 };
418 417
419 cam_port_a_clk_active: cam-port-a-clk-active { 418 cam_port_a_clk_active: cam-port-a-clk-active {
420 samsung,pins = "gpj1-3"; 419 samsung,pins = "gpj1-3";
421 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 420 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
422 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 421 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
423 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 422 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
424 }; 423 };
425 424
426 cam_port_a_clk_idle: cam-port-a-clk-idle { 425 cam_port_a_clk_idle: cam-port-a-clk-idle {
427 samsung,pins = "gpj1-3"; 426 samsung,pins = "gpj1-3";
428 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>; 427 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
429 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; 428 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
430 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 429 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
431 }; 430 };
432 }; 431};
433 432
434 pinctrl_1: pinctrl@11000000 { 433&pinctrl_1 {
435 gpk0: gpk0 { 434 gpk0: gpk0 {
436 gpio-controller; 435 gpio-controller;
437 #gpio-cells = <2>; 436 #gpio-cells = <2>;
438 437
439 interrupt-controller; 438 interrupt-controller;
440 #interrupt-cells = <2>; 439 #interrupt-cells = <2>;
441 }; 440 };
442 441
443 gpk1: gpk1 { 442 gpk1: gpk1 {
444 gpio-controller; 443 gpio-controller;
445 #gpio-cells = <2>; 444 #gpio-cells = <2>;
446 445
447 interrupt-controller; 446 interrupt-controller;
448 #interrupt-cells = <2>; 447 #interrupt-cells = <2>;
449 }; 448 };
450 449
451 gpk2: gpk2 { 450 gpk2: gpk2 {
452 gpio-controller; 451 gpio-controller;
453 #gpio-cells = <2>; 452 #gpio-cells = <2>;
454 453
455 interrupt-controller; 454 interrupt-controller;
456 #interrupt-cells = <2>; 455 #interrupt-cells = <2>;
457 }; 456 };
458 457
459 gpk3: gpk3 { 458 gpk3: gpk3 {
460 gpio-controller; 459 gpio-controller;
461 #gpio-cells = <2>; 460 #gpio-cells = <2>;
462 461
463 interrupt-controller; 462 interrupt-controller;
464 #interrupt-cells = <2>; 463 #interrupt-cells = <2>;
465 }; 464 };
466 465
467 gpl0: gpl0 { 466 gpl0: gpl0 {
468 gpio-controller; 467 gpio-controller;
469 #gpio-cells = <2>; 468 #gpio-cells = <2>;
470 469
471 interrupt-controller; 470 interrupt-controller;
472 #interrupt-cells = <2>; 471 #interrupt-cells = <2>;
473 }; 472 };
474 473
475 gpl1: gpl1 { 474 gpl1: gpl1 {
476 gpio-controller; 475 gpio-controller;
477 #gpio-cells = <2>; 476 #gpio-cells = <2>;
478 477
479 interrupt-controller; 478 interrupt-controller;
480 #interrupt-cells = <2>; 479 #interrupt-cells = <2>;
481 }; 480 };
482 481
483 gpl2: gpl2 { 482 gpl2: gpl2 {
484 gpio-controller; 483 gpio-controller;
485 #gpio-cells = <2>; 484 #gpio-cells = <2>;
486 485
487 interrupt-controller; 486 interrupt-controller;
488 #interrupt-cells = <2>; 487 #interrupt-cells = <2>;
489 }; 488 };
490 489
491 gpm0: gpm0 { 490 gpm0: gpm0 {
492 gpio-controller; 491 gpio-controller;
493 #gpio-cells = <2>; 492 #gpio-cells = <2>;
494 493
495 interrupt-controller; 494 interrupt-controller;
496 #interrupt-cells = <2>; 495 #interrupt-cells = <2>;
497 }; 496 };
498 497
499 gpm1: gpm1 { 498 gpm1: gpm1 {
500 gpio-controller; 499 gpio-controller;
501 #gpio-cells = <2>; 500 #gpio-cells = <2>;
502 501
503 interrupt-controller; 502 interrupt-controller;
504 #interrupt-cells = <2>; 503 #interrupt-cells = <2>;
505 }; 504 };
506 505
507 gpm2: gpm2 { 506 gpm2: gpm2 {
508 gpio-controller; 507 gpio-controller;
509 #gpio-cells = <2>; 508 #gpio-cells = <2>;
510 509
511 interrupt-controller; 510 interrupt-controller;
512 #interrupt-cells = <2>; 511 #interrupt-cells = <2>;
513 }; 512 };
514 513
515 gpm3: gpm3 { 514 gpm3: gpm3 {
516 gpio-controller; 515 gpio-controller;
517 #gpio-cells = <2>; 516 #gpio-cells = <2>;
518 517
519 interrupt-controller; 518 interrupt-controller;
520 #interrupt-cells = <2>; 519 #interrupt-cells = <2>;
521 }; 520 };
522 521
523 gpm4: gpm4 { 522 gpm4: gpm4 {
524 gpio-controller; 523 gpio-controller;
525 #gpio-cells = <2>; 524 #gpio-cells = <2>;
526 525
527 interrupt-controller; 526 interrupt-controller;
528 #interrupt-cells = <2>; 527 #interrupt-cells = <2>;
529 }; 528 };
530 529
531 gpy0: gpy0 { 530 gpy0: gpy0 {
532 gpio-controller; 531 gpio-controller;
533 #gpio-cells = <2>; 532 #gpio-cells = <2>;
534 }; 533 };
535 534
536 gpy1: gpy1 { 535 gpy1: gpy1 {
537 gpio-controller; 536 gpio-controller;
538 #gpio-cells = <2>; 537 #gpio-cells = <2>;
539 }; 538 };
540 539
541 gpy2: gpy2 { 540 gpy2: gpy2 {
542 gpio-controller; 541 gpio-controller;
543 #gpio-cells = <2>; 542 #gpio-cells = <2>;
544 }; 543 };
545 544
546 gpy3: gpy3 { 545 gpy3: gpy3 {
547 gpio-controller; 546 gpio-controller;
548 #gpio-cells = <2>; 547 #gpio-cells = <2>;
549 }; 548 };
550 549
551 gpy4: gpy4 { 550 gpy4: gpy4 {
552 gpio-controller; 551 gpio-controller;
553 #gpio-cells = <2>; 552 #gpio-cells = <2>;
554 }; 553 };
555 554
556 gpy5: gpy5 { 555 gpy5: gpy5 {
557 gpio-controller; 556 gpio-controller;
558 #gpio-cells = <2>; 557 #gpio-cells = <2>;
559 }; 558 };
560 559
561 gpy6: gpy6 { 560 gpy6: gpy6 {
562 gpio-controller; 561 gpio-controller;
563 #gpio-cells = <2>; 562 #gpio-cells = <2>;
564 }; 563 };
565 564
566 gpx0: gpx0 { 565 gpx0: gpx0 {
567 gpio-controller; 566 gpio-controller;
568 #gpio-cells = <2>; 567 #gpio-cells = <2>;
569 568
570 interrupt-controller; 569 interrupt-controller;
571 interrupt-parent = <&gic>; 570 interrupt-parent = <&gic>;
572 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, 571 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
573 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, 572 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
574 <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, 573 <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
575 <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, 574 <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
576 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, 575 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
577 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, 576 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
578 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, 577 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
579 <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 578 <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
580 #interrupt-cells = <2>; 579 #interrupt-cells = <2>;
581 }; 580 };
582 581
583 gpx1: gpx1 { 582 gpx1: gpx1 {
584 gpio-controller; 583 gpio-controller;
585 #gpio-cells = <2>; 584 #gpio-cells = <2>;
586 585
587 interrupt-controller; 586 interrupt-controller;
588 interrupt-parent = <&gic>; 587 interrupt-parent = <&gic>;
589 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, 588 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
590 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, 589 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
591 <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, 590 <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
592 <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, 591 <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
593 <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, 592 <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
594 <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, 593 <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
595 <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>, 594 <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
596 <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 595 <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
597 #interrupt-cells = <2>; 596 #interrupt-cells = <2>;
598 }; 597 };
599 598
600 gpx2: gpx2 { 599 gpx2: gpx2 {
601 gpio-controller; 600 gpio-controller;
602 #gpio-cells = <2>; 601 #gpio-cells = <2>;
603 602
604 interrupt-controller; 603 interrupt-controller;
605 #interrupt-cells = <2>; 604 #interrupt-cells = <2>;
606 }; 605 };
607 606
608 gpx3: gpx3 { 607 gpx3: gpx3 {
609 gpio-controller; 608 gpio-controller;
610 #gpio-cells = <2>; 609 #gpio-cells = <2>;
611 610
612 interrupt-controller; 611 interrupt-controller;
613 #interrupt-cells = <2>; 612 #interrupt-cells = <2>;
614 }; 613 };
615 614
616 sd0_clk: sd0-clk { 615 sd0_clk: sd0-clk {
617 samsung,pins = "gpk0-0"; 616 samsung,pins = "gpk0-0";
618 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 617 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
619 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 618 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
620 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 619 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
621 }; 620 };
622 621
623 sd0_cmd: sd0-cmd { 622 sd0_cmd: sd0-cmd {
624 samsung,pins = "gpk0-1"; 623 samsung,pins = "gpk0-1";
625 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 624 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
626 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 625 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
627 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 626 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
628 }; 627 };
629 628
630 sd0_cd: sd0-cd { 629 sd0_cd: sd0-cd {
631 samsung,pins = "gpk0-2"; 630 samsung,pins = "gpk0-2";
632 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 631 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
633 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 632 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
634 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 633 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
635 }; 634 };
636 635
637 sd0_bus1: sd0-bus-width1 { 636 sd0_bus1: sd0-bus-width1 {
638 samsung,pins = "gpk0-3"; 637 samsung,pins = "gpk0-3";
639 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 638 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
640 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 639 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
641 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 640 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
642 }; 641 };
643 642
644 sd0_bus4: sd0-bus-width4 { 643 sd0_bus4: sd0-bus-width4 {
645 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; 644 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
646 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 645 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
647 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 646 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
648 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 647 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
649 }; 648 };
650 649
651 sd0_bus8: sd0-bus-width8 { 650 sd0_bus8: sd0-bus-width8 {
652 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 651 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
653 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 652 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
654 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 653 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
655 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 654 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
656 }; 655 };
657 656
658 sd4_clk: sd4-clk { 657 sd4_clk: sd4-clk {
659 samsung,pins = "gpk0-0"; 658 samsung,pins = "gpk0-0";
660 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 659 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
661 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 660 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
662 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 661 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
663 }; 662 };
664 663
665 sd4_cmd: sd4-cmd { 664 sd4_cmd: sd4-cmd {
666 samsung,pins = "gpk0-1"; 665 samsung,pins = "gpk0-1";
667 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 666 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
668 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 667 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
669 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 668 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
670 }; 669 };
671 670
672 sd4_cd: sd4-cd { 671 sd4_cd: sd4-cd {
673 samsung,pins = "gpk0-2"; 672 samsung,pins = "gpk0-2";
674 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 673 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
675 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 674 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
676 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 675 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
677 }; 676 };
678 677
679 sd4_bus1: sd4-bus-width1 { 678 sd4_bus1: sd4-bus-width1 {
680 samsung,pins = "gpk0-3"; 679 samsung,pins = "gpk0-3";
681 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 680 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
682 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 681 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
683 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 682 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
684 }; 683 };
685 684
686 sd4_bus4: sd4-bus-width4 { 685 sd4_bus4: sd4-bus-width4 {
687 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; 686 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
688 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 687 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
689 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 688 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
690 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 689 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
691 }; 690 };
692 691
693 sd4_bus8: sd4-bus-width8 { 692 sd4_bus8: sd4-bus-width8 {
694 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 693 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
695 samsung,pin-function = <EXYNOS_PIN_FUNC_4>; 694 samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
696 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 695 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
697 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 696 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
698 }; 697 };
699 698
700 sd1_clk: sd1-clk { 699 sd1_clk: sd1-clk {
701 samsung,pins = "gpk1-0"; 700 samsung,pins = "gpk1-0";
702 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 701 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
703 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 702 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
704 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 703 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
705 }; 704 };
706 705
707 sd1_cmd: sd1-cmd { 706 sd1_cmd: sd1-cmd {
708 samsung,pins = "gpk1-1"; 707 samsung,pins = "gpk1-1";
709 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 708 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
710 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 709 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
711 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 710 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
712 }; 711 };
713 712
714 sd1_cd: sd1-cd { 713 sd1_cd: sd1-cd {
715 samsung,pins = "gpk1-2"; 714 samsung,pins = "gpk1-2";
716 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 715 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
717 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 716 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
718 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 717 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
719 }; 718 };
720 719
721 sd1_bus1: sd1-bus-width1 { 720 sd1_bus1: sd1-bus-width1 {
722 samsung,pins = "gpk1-3"; 721 samsung,pins = "gpk1-3";
723 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 722 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
724 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 723 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
725 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 724 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
726 }; 725 };
727 726
728 sd1_bus4: sd1-bus-width4 { 727 sd1_bus4: sd1-bus-width4 {
729 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 728 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
730 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 729 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
731 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 730 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
732 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 731 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
733 }; 732 };
734 733
735 sd2_clk: sd2-clk { 734 sd2_clk: sd2-clk {
736 samsung,pins = "gpk2-0"; 735 samsung,pins = "gpk2-0";
737 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 736 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
738 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 737 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
739 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 738 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
740 }; 739 };
741 740
742 sd2_cmd: sd2-cmd { 741 sd2_cmd: sd2-cmd {
743 samsung,pins = "gpk2-1"; 742 samsung,pins = "gpk2-1";
744 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 743 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
745 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 744 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
746 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 745 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
747 }; 746 };
748 747
749 sd2_cd: sd2-cd { 748 sd2_cd: sd2-cd {
750 samsung,pins = "gpk2-2"; 749 samsung,pins = "gpk2-2";
751 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 750 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
752 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 751 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
753 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 752 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
754 }; 753 };
755 754
756 sd2_bus1: sd2-bus-width1 { 755 sd2_bus1: sd2-bus-width1 {
757 samsung,pins = "gpk2-3"; 756 samsung,pins = "gpk2-3";
758 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 757 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
759 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 758 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
760 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 759 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
761 }; 760 };
762 761
763 sd2_bus4: sd2-bus-width4 { 762 sd2_bus4: sd2-bus-width4 {
764 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6"; 763 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
765 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 764 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
766 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 765 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
767 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 766 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
768 }; 767 };
769 768
770 sd2_bus8: sd2-bus-width8 { 769 sd2_bus8: sd2-bus-width8 {
771 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; 770 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
772 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 771 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
773 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 772 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
774 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 773 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
775 }; 774 };
776 775
777 sd3_clk: sd3-clk { 776 sd3_clk: sd3-clk {
778 samsung,pins = "gpk3-0"; 777 samsung,pins = "gpk3-0";
779 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 778 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
780 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 779 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
781 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 780 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
782 }; 781 };
783 782
784 sd3_cmd: sd3-cmd { 783 sd3_cmd: sd3-cmd {
785 samsung,pins = "gpk3-1"; 784 samsung,pins = "gpk3-1";
786 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 785 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
787 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 786 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
788 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 787 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
789 }; 788 };
790 789
791 sd3_cd: sd3-cd { 790 sd3_cd: sd3-cd {
792 samsung,pins = "gpk3-2"; 791 samsung,pins = "gpk3-2";
793 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 792 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
794 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 793 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
795 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 794 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
796 }; 795 };
797 796
798 sd3_bus1: sd3-bus-width1 { 797 sd3_bus1: sd3-bus-width1 {
799 samsung,pins = "gpk3-3"; 798 samsung,pins = "gpk3-3";
800 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 799 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
801 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 800 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
802 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 801 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
803 }; 802 };
804 803
805 sd3_bus4: sd3-bus-width4 { 804 sd3_bus4: sd3-bus-width4 {
806 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; 805 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
807 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 806 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
808 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 807 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
809 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 808 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
810 }; 809 };
811 810
812 cam_port_b_io: cam-port-b-io { 811 cam_port_b_io: cam-port-b-io {
813 samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3", 812 samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
814 "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7", 813 "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
815 "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1"; 814 "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1";
816 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 815 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
817 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; 816 samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
818 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 817 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
819 }; 818 };
820 819
821 cam_port_b_clk_active: cam-port-b-clk-active { 820 cam_port_b_clk_active: cam-port-b-clk-active {
822 samsung,pins = "gpm2-2"; 821 samsung,pins = "gpm2-2";
823 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 822 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
824 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 823 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
825 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>; 824 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
826 }; 825 };
827 826
828 cam_port_b_clk_idle: cam-port-b-clk-idle { 827 cam_port_b_clk_idle: cam-port-b-clk-idle {
829 samsung,pins = "gpm2-2"; 828 samsung,pins = "gpm2-2";
830 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>; 829 samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
831 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; 830 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
832 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 831 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
833 }; 832 };
834 833
835 eint0: ext-int0 { 834 eint0: ext-int0 {
836 samsung,pins = "gpx0-0"; 835 samsung,pins = "gpx0-0";
837 samsung,pin-function = <EXYNOS_PIN_FUNC_F>; 836 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
838 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 837 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
839 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 838 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
840 }; 839 };
841 840
842 eint8: ext-int8 { 841 eint8: ext-int8 {
843 samsung,pins = "gpx1-0"; 842 samsung,pins = "gpx1-0";
844 samsung,pin-function = <EXYNOS_PIN_FUNC_F>; 843 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
845 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 844 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
846 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 845 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
847 }; 846 };
848 847
849 eint15: ext-int15 { 848 eint15: ext-int15 {
850 samsung,pins = "gpx1-7"; 849 samsung,pins = "gpx1-7";
851 samsung,pin-function = <EXYNOS_PIN_FUNC_F>; 850 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
852 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 851 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
853 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 852 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
854 }; 853 };
855 854
856 eint16: ext-int16 { 855 eint16: ext-int16 {
857 samsung,pins = "gpx2-0"; 856 samsung,pins = "gpx2-0";
858 samsung,pin-function = <EXYNOS_PIN_FUNC_F>; 857 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
859 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 858 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
860 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 859 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
861 }; 860 };
862 861
863 eint31: ext-int31 { 862 eint31: ext-int31 {
864 samsung,pins = "gpx3-7"; 863 samsung,pins = "gpx3-7";
865 samsung,pin-function = <EXYNOS_PIN_FUNC_F>; 864 samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
866 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 865 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
867 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 866 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
868 }; 867 };
869 868
870 fimc_is_i2c0: fimc-is-i2c0 { 869 fimc_is_i2c0: fimc-is-i2c0 {
871 samsung,pins = "gpm4-0", "gpm4-1"; 870 samsung,pins = "gpm4-0", "gpm4-1";
872 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 871 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
873 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 872 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
874 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 873 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
875 }; 874 };
876 875
877 fimc_is_i2c1: fimc-is-i2c1 { 876 fimc_is_i2c1: fimc-is-i2c1 {
878 samsung,pins = "gpm4-2", "gpm4-3"; 877 samsung,pins = "gpm4-2", "gpm4-3";
879 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 878 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
880 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 879 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
881 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 880 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
882 }; 881 };
883 882
884 fimc_is_uart: fimc-is-uart { 883 fimc_is_uart: fimc-is-uart {
885 samsung,pins = "gpm3-5", "gpm3-7"; 884 samsung,pins = "gpm3-5", "gpm3-7";
886 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 885 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
887 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 886 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
888 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 887 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
889 }; 888 };
890 889
891 hdmi_cec: hdmi-cec { 890 hdmi_cec: hdmi-cec {
892 samsung,pins = "gpx3-6"; 891 samsung,pins = "gpx3-6";
893 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 892 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
894 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 893 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
895 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 894 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
896 }; 895 };
897 }; 896};
898 897
899 pinctrl_2: pinctrl@3860000 { 898&pinctrl_2 {
900 gpz: gpz { 899 gpz: gpz {
901 gpio-controller; 900 gpio-controller;
902 #gpio-cells = <2>; 901 #gpio-cells = <2>;
903 902
904 interrupt-controller; 903 interrupt-controller;
905 #interrupt-cells = <2>; 904 #interrupt-cells = <2>;
906 }; 905 };
907 906
908 i2s0_bus: i2s0-bus { 907 i2s0_bus: i2s0-bus {
909 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3", 908 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
910 "gpz-4", "gpz-5", "gpz-6"; 909 "gpz-4", "gpz-5", "gpz-6";
911 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 910 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
912 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 911 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
913 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 912 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
914 }; 913 };
915 914
916 pcm0_bus: pcm0-bus { 915 pcm0_bus: pcm0-bus {
917 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3", 916 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
918 "gpz-4"; 917 "gpz-4";
919 samsung,pin-function = <EXYNOS_PIN_FUNC_3>; 918 samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
920 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 919 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
921 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 920 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
922 }; 921 };
923 }; 922};
924 923
925 pinctrl_3: pinctrl@106e0000 { 924&pinctrl_3 {
926 gpv0: gpv0 { 925 gpv0: gpv0 {
927 gpio-controller; 926 gpio-controller;
928 #gpio-cells = <2>; 927 #gpio-cells = <2>;
929 928
930 interrupt-controller; 929 interrupt-controller;
931 #interrupt-cells = <2>; 930 #interrupt-cells = <2>;
932 }; 931 };
933 932
934 gpv1: gpv1 { 933 gpv1: gpv1 {
935 gpio-controller; 934 gpio-controller;
936 #gpio-cells = <2>; 935 #gpio-cells = <2>;
937 936
938 interrupt-controller; 937 interrupt-controller;
939 #interrupt-cells = <2>; 938 #interrupt-cells = <2>;
940 }; 939 };
941 940
942 gpv2: gpv2 { 941 gpv2: gpv2 {
943 gpio-controller; 942 gpio-controller;
944 #gpio-cells = <2>; 943 #gpio-cells = <2>;
945 944
946 interrupt-controller; 945 interrupt-controller;
947 #interrupt-cells = <2>; 946 #interrupt-cells = <2>;
948 }; 947 };
949 948
950 gpv3: gpv3 { 949 gpv3: gpv3 {
951 gpio-controller; 950 gpio-controller;
952 #gpio-cells = <2>; 951 #gpio-cells = <2>;
953 952
954 interrupt-controller; 953 interrupt-controller;
955 #interrupt-cells = <2>; 954 #interrupt-cells = <2>;
956 }; 955 };
957 956
958 gpv4: gpv4 { 957 gpv4: gpv4 {
959 gpio-controller; 958 gpio-controller;
960 #gpio-cells = <2>; 959 #gpio-cells = <2>;
961 960
962 interrupt-controller; 961 interrupt-controller;
963 #interrupt-cells = <2>; 962 #interrupt-cells = <2>;
964 }; 963 };
965 964
966 c2c_bus: c2c-bus { 965 c2c_bus: c2c-bus {
967 samsung,pins = "gpv0-0", "gpv0-1", "gpv0-2", "gpv0-3", 966 samsung,pins = "gpv0-0", "gpv0-1", "gpv0-2", "gpv0-3",
968 "gpv0-4", "gpv0-5", "gpv0-6", "gpv0-7", 967 "gpv0-4", "gpv0-5", "gpv0-6", "gpv0-7",
969 "gpv1-0", "gpv1-1", "gpv1-2", "gpv1-3", 968 "gpv1-0", "gpv1-1", "gpv1-2", "gpv1-3",
970 "gpv1-4", "gpv1-5", "gpv1-6", "gpv1-7", 969 "gpv1-4", "gpv1-5", "gpv1-6", "gpv1-7",
971 "gpv2-0", "gpv2-1", "gpv2-2", "gpv2-3", 970 "gpv2-0", "gpv2-1", "gpv2-2", "gpv2-3",
972 "gpv2-4", "gpv2-5", "gpv2-6", "gpv2-7", 971 "gpv2-4", "gpv2-5", "gpv2-6", "gpv2-7",
973 "gpv3-0", "gpv3-1", "gpv3-2", "gpv3-3", 972 "gpv3-0", "gpv3-1", "gpv3-2", "gpv3-3",
974 "gpv3-4", "gpv3-5", "gpv3-6", "gpv3-7", 973 "gpv3-4", "gpv3-5", "gpv3-6", "gpv3-7",
975 "gpv4-0", "gpv4-1"; 974 "gpv4-0", "gpv4-1";
976 samsung,pin-function = <EXYNOS_PIN_FUNC_2>; 975 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
977 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; 976 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
978 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; 977 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
979 };
980 }; 978 };
981}; 979};
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exynos4412-tiny4412.dts
index 5504398e6e37..01f37b5ac9c4 100644
--- a/arch/arm/boot/dts/exynos4412-tiny4412.dts
+++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * FriendlyARM's Exynos4412 based TINY4412 board device tree source 3 * FriendlyARM's Exynos4412 based TINY4412 board device tree source
3 * 4 *
@@ -5,11 +6,7 @@
5 * 6 *
6 * Device tree source file for FriendlyARM's TINY4412 board which is based on 7 * Device tree source file for FriendlyARM's TINY4412 board which is based on
7 * Samsung's Exynos4412 SoC. 8 * Samsung's Exynos4412 SoC.
8 * 9 */
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13 10
14/dts-v1/; 11/dts-v1/;
15#include "exynos4412.dtsi" 12#include "exynos4412.dtsi"
diff --git a/arch/arm/boot/dts/exynos4412-tmu-sensor-conf.dtsi b/arch/arm/boot/dts/exynos4412-tmu-sensor-conf.dtsi
index e3f7934d19d0..489b58c619ee 100644
--- a/arch/arm/boot/dts/exynos4412-tmu-sensor-conf.dtsi
+++ b/arch/arm/boot/dts/exynos4412-tmu-sensor-conf.dtsi
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Device tree sources for Exynos4412 TMU sensor configuration 3 * Device tree sources for Exynos4412 TMU sensor configuration
3 * 4 *
4 * Copyright (c) 2014 Lukasz Majewski <l.majewski@samsung.com> 5 * Copyright (c) 2014 Lukasz Majewski <l.majewski@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */ 6 */
11 7
12#include <dt-bindings/thermal/thermal_exynos.h> 8#include <dt-bindings/thermal/thermal_exynos.h>
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index f285790e8e04..327ee980d3a5 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Samsung's Exynos4412 based Trats 2 board device tree source 3 * Samsung's Exynos4412 based Trats 2 board device tree source
3 * 4 *
@@ -6,30 +7,14 @@
6 * 7 *
7 * Device tree source file for Samsung's Trats 2 board which is based on 8 * Device tree source file for Samsung's Trats 2 board which is based on
8 * Samsung's Exynos4412 SoC. 9 * Samsung's Exynos4412 SoC.
9 * 10 */
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14 11
15/dts-v1/; 12/dts-v1/;
16#include "exynos4412.dtsi" 13#include "exynos4412-galaxy-s3.dtsi"
17#include "exynos4412-ppmu-common.dtsi"
18#include <dt-bindings/gpio/gpio.h>
19#include <dt-bindings/interrupt-controller/irq.h>
20#include <dt-bindings/clock/maxim,max77686.h>
21#include <dt-bindings/pinctrl/samsung.h>
22 14
23/ { 15/ {
24 model = "Samsung Trats 2 based on Exynos4412"; 16 model = "Samsung Trats 2 based on Exynos4412";
25 compatible = "samsung,trats2", "samsung,exynos4412", "samsung,exynos4"; 17 compatible = "samsung,trats2", "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
26
27 aliases {
28 i2c9 = &i2c_ak8975;
29 i2c10 = &i2c_cm36651;
30 i2c11 = &i2c_max77693;
31 i2c12 = &i2c_max77693_fuel;
32 };
33 18
34 memory@40000000 { 19 memory@40000000 {
35 device_type = "memory"; 20 device_type = "memory";
@@ -38,1378 +23,5 @@
38 23
39 chosen { 24 chosen {
40 bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5"; 25 bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
41 stdout-path = &serial_2;
42 };
43
44 firmware@204f000 {
45 compatible = "samsung,secure-firmware";
46 reg = <0x0204F000 0x1000>;
47 };
48
49 fixed-rate-clocks {
50 xxti {
51 compatible = "samsung,clock-xxti", "fixed-clock";
52 clock-frequency = <0>;
53 };
54
55 xusbxti {
56 compatible = "samsung,clock-xusbxti", "fixed-clock";
57 clock-frequency = <24000000>;
58 };
59 };
60
61 regulators {
62 compatible = "simple-bus";
63 #address-cells = <1>;
64 #size-cells = <0>;
65
66 cam_io_reg: voltage-regulator-1 {
67 compatible = "regulator-fixed";
68 regulator-name = "CAM_SENSOR_A";
69 regulator-min-microvolt = <2800000>;
70 regulator-max-microvolt = <2800000>;
71 gpio = <&gpm0 2 GPIO_ACTIVE_HIGH>;
72 enable-active-high;
73 };
74
75 lcd_vdd3_reg: voltage-regulator-2 {
76 compatible = "regulator-fixed";
77 regulator-name = "LCD_VDD_2.2V";
78 regulator-min-microvolt = <2200000>;
79 regulator-max-microvolt = <2200000>;
80 gpio = <&gpc0 1 GPIO_ACTIVE_HIGH>;
81 enable-active-high;
82 };
83
84 cam_af_reg: voltage-regulator-3 {
85 compatible = "regulator-fixed";
86 regulator-name = "CAM_AF";
87 regulator-min-microvolt = <2800000>;
88 regulator-max-microvolt = <2800000>;
89 gpio = <&gpm0 4 GPIO_ACTIVE_HIGH>;
90 enable-active-high;
91 };
92
93 ps_als_reg: voltage-regulator-5 {
94 compatible = "regulator-fixed";
95 regulator-name = "LED_A_3.0V";
96 regulator-min-microvolt = <3000000>;
97 regulator-max-microvolt = <3000000>;
98 gpio = <&gpj0 5 GPIO_ACTIVE_HIGH>;
99 enable-active-high;
100 };
101
102 vsil12: voltage-regulator-6 {
103 compatible = "regulator-fixed";
104 regulator-name = "VSIL_1.2V";
105 regulator-min-microvolt = <1200000>;
106 regulator-max-microvolt = <1200000>;
107 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
108 enable-active-high;
109 vin-supply = <&buck7_reg>;
110 };
111
112 vcc33mhl: voltage-regulator-7 {
113 compatible = "regulator-fixed";
114 regulator-name = "VCC_3.3_MHL";
115 regulator-min-microvolt = <3300000>;
116 regulator-max-microvolt = <3300000>;
117 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
118 enable-active-high;
119 };
120
121 vcc18mhl: voltage-regulator-8 {
122 compatible = "regulator-fixed";
123 regulator-name = "VCC_1.8_MHL";
124 regulator-min-microvolt = <1800000>;
125 regulator-max-microvolt = <1800000>;
126 gpio = <&gpl0 4 GPIO_ACTIVE_HIGH>;
127 enable-active-high;
128 };
129 };
130
131 gpio-keys {
132 compatible = "gpio-keys";
133
134 key-down {
135 gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
136 linux,code = <114>;
137 label = "volume down";
138 debounce-interval = <10>;
139 };
140
141 key-up {
142 gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
143 linux,code = <115>;
144 label = "volume up";
145 debounce-interval = <10>;
146 };
147
148 key-power {
149 gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
150 linux,code = <116>;
151 label = "power";
152 debounce-interval = <10>;
153 wakeup-source;
154 };
155
156 key-ok {
157 gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
158 linux,code = <139>;
159 label = "ok";
160 debounce-inteval = <10>;
161 wakeup-source;
162 };
163 };
164
165 i2c_max77693: i2c-gpio-1 {
166 compatible = "i2c-gpio";
167 gpios = <&gpm2 0 GPIO_ACTIVE_HIGH>, <&gpm2 1 GPIO_ACTIVE_HIGH>;
168 i2c-gpio,delay-us = <2>;
169 #address-cells = <1>;
170 #size-cells = <0>;
171 status = "okay";
172
173 max77693@66 {
174 compatible = "maxim,max77693";
175 interrupt-parent = <&gpx1>;
176 interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
177 reg = <0x66>;
178
179 regulators {
180 esafeout1_reg: ESAFEOUT1 {
181 regulator-name = "ESAFEOUT1";
182 };
183 esafeout2_reg: ESAFEOUT2 {
184 regulator-name = "ESAFEOUT2";
185 };
186 charger_reg: CHARGER {
187 regulator-name = "CHARGER";
188 regulator-min-microamp = <60000>;
189 regulator-max-microamp = <2580000>;
190 };
191 };
192
193 max77693_haptic {
194 compatible = "maxim,max77693-haptic";
195 haptic-supply = <&ldo26_reg>;
196 pwms = <&pwm 0 38022 0>;
197 };
198
199 charger {
200 compatible = "maxim,max77693-charger";
201
202 maxim,constant-microvolt = <4350000>;
203 maxim,min-system-microvolt = <3600000>;
204 maxim,thermal-regulation-celsius = <100>;
205 maxim,battery-overcurrent-microamp = <3500000>;
206 maxim,charge-input-threshold-microvolt = <4300000>;
207 };
208 };
209 };
210
211 i2c_max77693_fuel: i2c-gpio-3 {
212 compatible = "i2c-gpio";
213 gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>, <&gpf1 4 GPIO_ACTIVE_HIGH>;
214 i2c-gpio,delay-us = <2>;
215 #address-cells = <1>;
216 #size-cells = <0>;
217 status = "okay";
218
219 max77693-fuel-gauge@36 {
220 compatible = "maxim,max17047";
221 interrupt-parent = <&gpx2>;
222 interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
223 reg = <0x36>;
224
225 maxim,over-heat-temp = <700>;
226 maxim,over-volt = <4500>;
227 };
228 };
229
230 i2c_ak8975: i2c-gpio-0 {
231 compatible = "i2c-gpio";
232 gpios = <&gpy2 4 GPIO_ACTIVE_HIGH>, <&gpy2 5 GPIO_ACTIVE_HIGH>;
233 i2c-gpio,delay-us = <2>;
234 #address-cells = <1>;
235 #size-cells = <0>;
236 status = "okay";
237
238 ak8975@c {
239 compatible = "asahi-kasei,ak8975";
240 reg = <0x0c>;
241 gpios = <&gpj0 7 GPIO_ACTIVE_HIGH>;
242 };
243 };
244
245 i2c_cm36651: i2c-gpio-2 {
246 compatible = "i2c-gpio";
247 gpios = <&gpf0 0 GPIO_ACTIVE_LOW>, <&gpf0 1 GPIO_ACTIVE_LOW>;
248 i2c-gpio,delay-us = <2>;
249 #address-cells = <1>;
250 #size-cells = <0>;
251
252 cm36651@18 {
253 compatible = "capella,cm36651";
254 reg = <0x18>;
255 interrupt-parent = <&gpx0>;
256 interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
257 vled-supply = <&ps_als_reg>;
258 };
259 };
260
261 i2c-mhl {
262 compatible = "i2c-gpio";
263 gpios = <&gpf0 4 GPIO_ACTIVE_HIGH>, <&gpf0 6 GPIO_ACTIVE_HIGH>;
264 i2c-gpio,delay-us = <100>;
265 #address-cells = <1>;
266 #size-cells = <0>;
267
268 pinctrl-0 = <&i2c_mhl_bus>;
269 pinctrl-names = "default";
270 status = "okay";
271
272 sii9234: hdmi-bridge@39 {
273 compatible = "sil,sii9234";
274 avcc33-supply = <&vcc33mhl>;
275 iovcc18-supply = <&vcc18mhl>;
276 avcc12-supply = <&vsil12>;
277 cvcc12-supply = <&vsil12>;
278 reset-gpios = <&gpf3 4 GPIO_ACTIVE_LOW>;
279 interrupt-parent = <&gpf3>;
280 interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
281 reg = <0x39>;
282
283 port {
284 mhl_to_hdmi: endpoint {
285 remote-endpoint = <&hdmi_to_mhl>;
286 };
287 };
288 };
289 };
290
291 camera: camera {
292 pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>;
293 pinctrl-names = "default";
294 status = "okay";
295 assigned-clocks = <&clock CLK_MOUT_CAM0>,
296 <&clock CLK_MOUT_CAM1>;
297 assigned-clock-parents = <&clock CLK_XUSBXTI>,
298 <&clock CLK_XUSBXTI>;
299
300
301 };
302
303 wlan_pwrseq: sdhci3-pwrseq {
304 compatible = "mmc-pwrseq-simple";
305 reset-gpios = <&gpj0 0 GPIO_ACTIVE_LOW>;
306 clocks = <&max77686 MAX77686_CLK_PMIC>;
307 clock-names = "ext_clock";
308 };
309
310 sound {
311 compatible = "samsung,trats2-audio";
312 samsung,i2s-controller = <&i2s0>;
313 samsung,model = "Trats2";
314 samsung,audio-codec = <&wm1811>;
315 samsung,audio-routing =
316 "SPK", "SPKOUTLN",
317 "SPK", "SPKOUTLP",
318 "SPK", "SPKOUTRN",
319 "SPK", "SPKOUTRP";
320 };
321
322 thermistor-ap {
323 compatible = "murata,ncp15wb473";
324 pullup-uv = <1800000>; /* VCC_1.8V_AP */
325 pullup-ohm = <100000>; /* 100K */
326 pulldown-ohm = <100000>; /* 100K */
327 io-channels = <&adc 1>; /* AP temperature */
328 };
329
330 thermistor-battery {
331 compatible = "murata,ncp15wb473";
332 pullup-uv = <1800000>; /* VCC_1.8V_AP */
333 pullup-ohm = <100000>; /* 100K */
334 pulldown-ohm = <100000>; /* 100K */
335 io-channels = <&adc 2>; /* Battery temperature */
336 };
337
338 thermal-zones {
339 cpu_thermal: cpu-thermal {
340 cooling-maps {
341 map0 {
342 /* Corresponds to 800MHz at freq_table */
343 cooling-device = <&cpu0 7 7>;
344 };
345 map1 {
346 /* Corresponds to 200MHz at freq_table */
347 cooling-device = <&cpu0 13 13>;
348 };
349 };
350 };
351 };
352};
353
354&adc {
355 vdd-supply = <&ldo3_reg>;
356 status = "okay";
357};
358
359&bus_dmc {
360 devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
361 vdd-supply = <&buck1_reg>;
362 status = "okay";
363};
364
365&bus_acp {
366 devfreq = <&bus_dmc>;
367 status = "okay";
368};
369
370&bus_c2c {
371 devfreq = <&bus_dmc>;
372 status = "okay";
373};
374
375&bus_leftbus {
376 devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
377 vdd-supply = <&buck3_reg>;
378 status = "okay";
379};
380
381&bus_rightbus {
382 devfreq = <&bus_leftbus>;
383 status = "okay";
384};
385
386&bus_display {
387 devfreq = <&bus_leftbus>;
388 status = "okay";
389};
390
391&bus_fsys {
392 devfreq = <&bus_leftbus>;
393 status = "okay";
394};
395
396&bus_peri {
397 devfreq = <&bus_leftbus>;
398 status = "okay";
399};
400
401&bus_mfc {
402 devfreq = <&bus_leftbus>;
403 status = "okay";
404};
405
406&cpu0 {
407 cpu0-supply = <&buck2_reg>;
408};
409
410&csis_0 {
411 status = "okay";
412 vddcore-supply = <&ldo8_reg>;
413 vddio-supply = <&ldo10_reg>;
414 assigned-clocks = <&clock CLK_MOUT_CSIS0>,
415 <&clock CLK_SCLK_CSIS0>;
416 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
417 assigned-clock-rates = <0>, <176000000>;
418
419 /* Camera C (3) MIPI CSI-2 (CSIS0) */
420 port@3 {
421 reg = <3>;
422 csis0_ep: endpoint {
423 remote-endpoint = <&s5c73m3_ep>;
424 data-lanes = <1 2 3 4>;
425 samsung,csis-hs-settle = <12>;
426 };
427 };
428};
429
430&csis_1 {
431 status = "okay";
432 vddcore-supply = <&ldo8_reg>;
433 vddio-supply = <&ldo10_reg>;
434 assigned-clocks = <&clock CLK_MOUT_CSIS1>,
435 <&clock CLK_SCLK_CSIS1>;
436 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
437 assigned-clock-rates = <0>, <176000000>;
438
439 /* Camera D (4) MIPI CSI-2 (CSIS1) */
440 port@4 {
441 reg = <4>;
442 csis1_ep: endpoint {
443 remote-endpoint = <&is_s5k6a3_ep>;
444 data-lanes = <1>;
445 samsung,csis-hs-settle = <18>;
446 samsung,csis-wclk;
447 };
448 };
449};
450
451&dsi_0 {
452 vddcore-supply = <&ldo8_reg>;
453 vddio-supply = <&ldo10_reg>;
454 samsung,burst-clock-frequency = <500000000>;
455 samsung,esc-clock-frequency = <20000000>;
456 samsung,pll-clock-frequency = <24000000>;
457 status = "okay";
458
459 panel@0 {
460 compatible = "samsung,s6e8aa0";
461 reg = <0>;
462 vdd3-supply = <&lcd_vdd3_reg>;
463 vci-supply = <&ldo25_reg>;
464 reset-gpios = <&gpf2 1 GPIO_ACTIVE_HIGH>;
465 power-on-delay= <50>;
466 reset-delay = <100>;
467 init-delay = <100>;
468 flip-horizontal;
469 flip-vertical;
470 panel-width-mm = <58>;
471 panel-height-mm = <103>;
472
473 display-timings {
474 timing-0 {
475 clock-frequency = <57153600>;
476 hactive = <720>;
477 vactive = <1280>;
478 hfront-porch = <5>;
479 hback-porch = <5>;
480 hsync-len = <5>;
481 vfront-porch = <13>;
482 vback-porch = <1>;
483 vsync-len = <2>;
484 };
485 };
486 };
487};
488
489&exynos_usbphy {
490 vbus-supply = <&esafeout1_reg>;
491 status = "okay";
492};
493
494&fimc_0 {
495 status = "okay";
496 assigned-clocks = <&clock CLK_MOUT_FIMC0>,
497 <&clock CLK_SCLK_FIMC0>;
498 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
499 assigned-clock-rates = <0>, <176000000>;
500};
501
502&fimc_1 {
503 status = "okay";
504 assigned-clocks = <&clock CLK_MOUT_FIMC1>,
505 <&clock CLK_SCLK_FIMC1>;
506 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
507 assigned-clock-rates = <0>, <176000000>;
508};
509
510&fimc_2 {
511 status = "okay";
512 assigned-clocks = <&clock CLK_MOUT_FIMC2>,
513 <&clock CLK_SCLK_FIMC2>;
514 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
515 assigned-clock-rates = <0>, <176000000>;
516};
517
518&fimc_3 {
519 status = "okay";
520 assigned-clocks = <&clock CLK_MOUT_FIMC3>,
521 <&clock CLK_SCLK_FIMC3>;
522 assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
523 assigned-clock-rates = <0>, <176000000>;
524};
525
526&fimc_is {
527 pinctrl-0 = <&fimc_is_uart>;
528 pinctrl-names = "default";
529 status = "okay";
530
531 i2c1_isp: i2c-isp@12140000 {
532 pinctrl-0 = <&fimc_is_i2c1>;
533 pinctrl-names = "default";
534
535 s5k6a3@10 {
536 compatible = "samsung,s5k6a3";
537 reg = <0x10>;
538 svdda-supply = <&cam_io_reg>;
539 svddio-supply = <&ldo19_reg>;
540 afvdd-supply = <&ldo19_reg>;
541 clock-frequency = <24000000>;
542 /* CAM_B_CLKOUT */
543 clocks = <&camera 1>;
544 clock-names = "extclk";
545 samsung,camclk-out = <1>;
546 gpios = <&gpm1 6 GPIO_ACTIVE_HIGH>;
547
548 port {
549 is_s5k6a3_ep: endpoint {
550 remote-endpoint = <&csis1_ep>;
551 data-lanes = <1>;
552 };
553 };
554 };
555 };
556};
557
558&fimc_lite_0 {
559 status = "okay";
560};
561
562&fimc_lite_1 {
563 status = "okay";
564};
565
566&fimd {
567 status = "okay";
568};
569
570&hdmi {
571 hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
572 pinctrl-names = "default";
573 pinctrl-0 = <&hdmi_hpd>;
574 vdd-supply = <&ldo3_reg>;
575 vdd_osc-supply = <&ldo4_reg>;
576 vdd_pll-supply = <&ldo3_reg>;
577 ddc = <&i2c_5>;
578 status = "okay";
579
580 ports {
581 #address-cells = <1>;
582 #size-cells = <0>;
583
584 port@1 {
585 reg = <1>;
586 hdmi_to_mhl: endpoint {
587 remote-endpoint = <&mhl_to_hdmi>;
588 };
589 };
590 };
591};
592
593&hsotg {
594 vusb_d-supply = <&ldo15_reg>;
595 vusb_a-supply = <&ldo12_reg>;
596 dr_mode = "peripheral";
597 status = "okay";
598};
599
600&i2c_0 {
601 samsung,i2c-sda-delay = <100>;
602 samsung,i2c-slave-addr = <0x10>;
603 samsung,i2c-max-bus-freq = <400000>;
604 pinctrl-0 = <&i2c0_bus>;
605 pinctrl-names = "default";
606 status = "okay";
607
608 s5c73m3@3c {
609 compatible = "samsung,s5c73m3";
610 reg = <0x3c>;
611 standby-gpios = <&gpm0 1 GPIO_ACTIVE_LOW>; /* ISP_STANDBY */
612 xshutdown-gpios = <&gpf1 3 GPIO_ACTIVE_LOW>; /* ISP_RESET */
613 vdd-int-supply = <&buck9_reg>;
614 vddio-cis-supply = <&ldo9_reg>;
615 vdda-supply = <&ldo17_reg>;
616 vddio-host-supply = <&ldo18_reg>;
617 vdd-af-supply = <&cam_af_reg>;
618 vdd-reg-supply = <&cam_io_reg>;
619 clock-frequency = <24000000>;
620 /* CAM_A_CLKOUT */
621 clocks = <&camera 0>;
622 clock-names = "cis_extclk";
623 port {
624 s5c73m3_ep: endpoint {
625 remote-endpoint = <&csis0_ep>;
626 data-lanes = <1 2 3 4>;
627 };
628 };
629 };
630};
631
632&i2c_3 {
633 samsung,i2c-sda-delay = <100>;
634 samsung,i2c-slave-addr = <0x10>;
635 samsung,i2c-max-bus-freq = <400000>;
636 pinctrl-0 = <&i2c3_bus>;
637 pinctrl-names = "default";
638 status = "okay";
639
640 mms114-touchscreen@48 {
641 compatible = "melfas,mms114";
642 reg = <0x48>;
643 interrupt-parent = <&gpm2>;
644 interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
645 x-size = <720>;
646 y-size = <1280>;
647 avdd-supply = <&ldo23_reg>;
648 vdd-supply = <&ldo24_reg>;
649 };
650};
651
652&i2c_4 {
653 samsung,i2c-sda-delay = <100>;
654 samsung,i2c-slave-addr = <0x10>;
655 samsung,i2c-max-bus-freq = <100000>;
656 pinctrl-0 = <&i2c4_bus>;
657 pinctrl-names = "default";
658 status = "okay";
659
660 wm1811: wm1811@1a {
661 compatible = "wlf,wm1811";
662 reg = <0x1a>;
663 clocks = <&pmu_system_controller 0>;
664 clock-names = "MCLK1";
665 DCVDD-supply = <&ldo3_reg>;
666 DBVDD1-supply = <&ldo3_reg>;
667 wlf,ldo1ena = <&gpj0 4 0>;
668 }; 26 };
669}; 27};
670
671&i2c_5 {
672 status = "okay";
673};
674
675&i2c_7 {
676 samsung,i2c-sda-delay = <100>;
677 samsung,i2c-slave-addr = <0x10>;
678 samsung,i2c-max-bus-freq = <100000>;
679 pinctrl-0 = <&i2c7_bus>;
680 pinctrl-names = "default";
681 status = "okay";
682
683 max77686: max77686_pmic@9 {
684 compatible = "maxim,max77686";
685 interrupt-parent = <&gpx0>;
686 interrupts = <7 IRQ_TYPE_NONE>;
687 reg = <0x09>;
688 #clock-cells = <1>;
689
690 voltage-regulators {
691 ldo1_reg: LDO1 {
692 regulator-name = "VALIVE_1.0V_AP";
693 regulator-min-microvolt = <1000000>;
694 regulator-max-microvolt = <1000000>;
695 regulator-always-on;
696 };
697
698 ldo2_reg: LDO2 {
699 regulator-name = "VM1M2_1.2V_AP";
700 regulator-min-microvolt = <1200000>;
701 regulator-max-microvolt = <1200000>;
702 regulator-always-on;
703 regulator-state-mem {
704 regulator-on-in-suspend;
705 };
706 };
707
708 ldo3_reg: LDO3 {
709 regulator-name = "VCC_1.8V_AP";
710 regulator-min-microvolt = <1800000>;
711 regulator-max-microvolt = <1800000>;
712 regulator-always-on;
713 };
714
715 ldo4_reg: LDO4 {
716 regulator-name = "VCC_2.8V_AP";
717 regulator-min-microvolt = <2800000>;
718 regulator-max-microvolt = <2800000>;
719 regulator-always-on;
720 };
721
722 ldo5_reg: LDO5 {
723 regulator-name = "VCC_1.8V_IO";
724 regulator-min-microvolt = <1800000>;
725 regulator-max-microvolt = <1800000>;
726 regulator-always-on;
727 };
728
729 ldo6_reg: LDO6 {
730 regulator-name = "VMPLL_1.0V_AP";
731 regulator-min-microvolt = <1000000>;
732 regulator-max-microvolt = <1000000>;
733 regulator-always-on;
734 regulator-state-mem {
735 regulator-on-in-suspend;
736 };
737 };
738
739 ldo7_reg: LDO7 {
740 regulator-name = "VPLL_1.0V_AP";
741 regulator-min-microvolt = <1000000>;
742 regulator-max-microvolt = <1000000>;
743 regulator-always-on;
744 regulator-state-mem {
745 regulator-on-in-suspend;
746 };
747 };
748
749 ldo8_reg: LDO8 {
750 regulator-name = "VMIPI_1.0V";
751 regulator-min-microvolt = <1000000>;
752 regulator-max-microvolt = <1000000>;
753 regulator-state-mem {
754 regulator-off-in-suspend;
755 };
756 };
757
758 ldo9_reg: LDO9 {
759 regulator-name = "CAM_ISP_MIPI_1.2V";
760 regulator-min-microvolt = <1200000>;
761 regulator-max-microvolt = <1200000>;
762 };
763
764 ldo10_reg: LDO10 {
765 regulator-name = "VMIPI_1.8V";
766 regulator-min-microvolt = <1800000>;
767 regulator-max-microvolt = <1800000>;
768 regulator-state-mem {
769 regulator-off-in-suspend;
770 };
771 };
772
773 ldo11_reg: LDO11 {
774 regulator-name = "VABB1_1.95V";
775 regulator-min-microvolt = <1950000>;
776 regulator-max-microvolt = <1950000>;
777 regulator-always-on;
778 regulator-state-mem {
779 regulator-off-in-suspend;
780 };
781 };
782
783 ldo12_reg: LDO12 {
784 regulator-name = "VUOTG_3.0V";
785 regulator-min-microvolt = <3000000>;
786 regulator-max-microvolt = <3000000>;
787 regulator-state-mem {
788 regulator-off-in-suspend;
789 };
790 };
791
792 ldo13_reg: LDO13 {
793 regulator-name = "NFC_AVDD_1.8V";
794 regulator-min-microvolt = <1800000>;
795 regulator-max-microvolt = <1800000>;
796 };
797
798 ldo14_reg: LDO14 {
799 regulator-name = "VABB2_1.95V";
800 regulator-min-microvolt = <1950000>;
801 regulator-max-microvolt = <1950000>;
802 regulator-always-on;
803 regulator-state-mem {
804 regulator-off-in-suspend;
805 };
806 };
807
808 ldo15_reg: LDO15 {
809 regulator-name = "VHSIC_1.0V";
810 regulator-min-microvolt = <1000000>;
811 regulator-max-microvolt = <1000000>;
812 regulator-state-mem {
813 regulator-on-in-suspend;
814 };
815 };
816
817 ldo16_reg: LDO16 {
818 regulator-name = "VHSIC_1.8V";
819 regulator-min-microvolt = <1800000>;
820 regulator-max-microvolt = <1800000>;
821 regulator-state-mem {
822 regulator-on-in-suspend;
823 };
824 };
825
826 ldo17_reg: LDO17 {
827 regulator-name = "CAM_SENSOR_CORE_1.2V";
828 regulator-min-microvolt = <1200000>;
829 regulator-max-microvolt = <1200000>;
830 };
831
832 ldo18_reg: LDO18 {
833 regulator-name = "CAM_ISP_SEN_IO_1.8V";
834 regulator-min-microvolt = <1800000>;
835 regulator-max-microvolt = <1800000>;
836 };
837
838 ldo19_reg: LDO19 {
839 regulator-name = "VT_CAM_1.8V";
840 regulator-min-microvolt = <1800000>;
841 regulator-max-microvolt = <1800000>;
842 };
843
844 ldo20_reg: LDO20 {
845 regulator-name = "VDDQ_PRE_1.8V";
846 regulator-min-microvolt = <1800000>;
847 regulator-max-microvolt = <1800000>;
848 };
849
850 ldo21_reg: LDO21 {
851 regulator-name = "VTF_2.8V";
852 regulator-min-microvolt = <2800000>;
853 regulator-max-microvolt = <2800000>;
854 maxim,ena-gpios = <&gpy2 0 GPIO_ACTIVE_HIGH>;
855 };
856
857 ldo22_reg: LDO22 {
858 regulator-name = "VMEM_VDD_2.8V";
859 regulator-min-microvolt = <2800000>;
860 regulator-max-microvolt = <2800000>;
861 maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
862 };
863
864 ldo23_reg: LDO23 {
865 regulator-name = "TSP_AVDD_3.3V";
866 regulator-min-microvolt = <3300000>;
867 regulator-max-microvolt = <3300000>;
868 };
869
870 ldo24_reg: LDO24 {
871 regulator-name = "TSP_VDD_1.8V";
872 regulator-min-microvolt = <1800000>;
873 regulator-max-microvolt = <1800000>;
874 };
875
876 ldo25_reg: LDO25 {
877 regulator-name = "LCD_VCC_3.3V";
878 regulator-min-microvolt = <2800000>;
879 regulator-max-microvolt = <2800000>;
880 };
881
882 ldo26_reg: LDO26 {
883 regulator-name = "MOTOR_VCC_3.0V";
884 regulator-min-microvolt = <3000000>;
885 regulator-max-microvolt = <3000000>;
886 };
887
888 buck1_reg: BUCK1 {
889 regulator-name = "vdd_mif";
890 regulator-min-microvolt = <850000>;
891 regulator-max-microvolt = <1100000>;
892 regulator-always-on;
893 regulator-boot-on;
894 regulator-state-mem {
895 regulator-off-in-suspend;
896 };
897 };
898
899 buck2_reg: BUCK2 {
900 regulator-name = "vdd_arm";
901 regulator-min-microvolt = <850000>;
902 regulator-max-microvolt = <1500000>;
903 regulator-always-on;
904 regulator-boot-on;
905 regulator-state-mem {
906 regulator-on-in-suspend;
907 };
908 };
909
910 buck3_reg: BUCK3 {
911 regulator-name = "vdd_int";
912 regulator-min-microvolt = <850000>;
913 regulator-max-microvolt = <1150000>;
914 regulator-always-on;
915 regulator-boot-on;
916 regulator-state-mem {
917 regulator-off-in-suspend;
918 };
919 };
920
921 buck4_reg: BUCK4 {
922 regulator-name = "vdd_g3d";
923 regulator-min-microvolt = <850000>;
924 regulator-max-microvolt = <1150000>;
925 regulator-boot-on;
926 regulator-state-mem {
927 regulator-off-in-suspend;
928 };
929 };
930
931 buck5_reg: BUCK5 {
932 regulator-name = "VMEM_1.2V_AP";
933 regulator-min-microvolt = <1200000>;
934 regulator-max-microvolt = <1200000>;
935 regulator-always-on;
936 };
937
938 buck6_reg: BUCK6 {
939 regulator-name = "VCC_SUB_1.35V";
940 regulator-min-microvolt = <1350000>;
941 regulator-max-microvolt = <1350000>;
942 regulator-always-on;
943 };
944
945 buck7_reg: BUCK7 {
946 regulator-name = "VCC_SUB_2.0V";
947 regulator-min-microvolt = <2000000>;
948 regulator-max-microvolt = <2000000>;
949 regulator-always-on;
950 };
951
952 buck8_reg: BUCK8 {
953 regulator-name = "VMEM_VDDF_3.0V";
954 regulator-min-microvolt = <2850000>;
955 regulator-max-microvolt = <2850000>;
956 maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
957 };
958
959 buck9_reg: BUCK9 {
960 regulator-name = "CAM_ISP_CORE_1.2V";
961 regulator-min-microvolt = <1000000>;
962 regulator-max-microvolt = <1200000>;
963 maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
964 };
965 };
966 };
967};
968
969&i2c_8 {
970 status = "okay";
971};
972
973&i2s0 {
974 pinctrl-0 = <&i2s0_bus>;
975 pinctrl-names = "default";
976 status = "okay";
977};
978
979&mixer {
980 status = "okay";
981};
982
983&mshc_0 {
984 broken-cd;
985 non-removable;
986 card-detect-delay = <200>;
987 vmmc-supply = <&ldo22_reg>;
988 clock-frequency = <400000000>;
989 samsung,dw-mshc-ciu-div = <0>;
990 samsung,dw-mshc-sdr-timing = <2 3>;
991 samsung,dw-mshc-ddr-timing = <1 2>;
992 pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
993 pinctrl-names = "default";
994 status = "okay";
995 bus-width = <8>;
996 cap-mmc-highspeed;
997};
998
999&pmu_system_controller {
1000 assigned-clocks = <&pmu_system_controller 0>;
1001 assigned-clock-parents = <&clock CLK_XUSBXTI>;
1002};
1003
1004&pinctrl_0 {
1005 pinctrl-names = "default";
1006 pinctrl-0 = <&sleep0>;
1007
1008 mhl_int: mhl-int {
1009 samsung,pins = "gpf3-5";
1010 samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
1011 };
1012
1013 i2c_mhl_bus: i2c-mhl-bus {
1014 samsung,pins = "gpf0-4", "gpf0-6";
1015 samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
1016 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
1017 samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
1018 };
1019
1020 sleep0: sleep-states {
1021 PIN_SLP(gpa0-0, INPUT, NONE);
1022 PIN_SLP(gpa0-1, OUT0, NONE);
1023 PIN_SLP(gpa0-2, INPUT, NONE);
1024 PIN_SLP(gpa0-3, INPUT, UP);
1025 PIN_SLP(gpa0-4, INPUT, NONE);
1026 PIN_SLP(gpa0-5, INPUT, DOWN);
1027 PIN_SLP(gpa0-6, INPUT, DOWN);
1028 PIN_SLP(gpa0-7, INPUT, UP);
1029
1030 PIN_SLP(gpa1-0, INPUT, DOWN);
1031 PIN_SLP(gpa1-1, INPUT, DOWN);
1032 PIN_SLP(gpa1-2, INPUT, DOWN);
1033 PIN_SLP(gpa1-3, INPUT, DOWN);
1034 PIN_SLP(gpa1-4, INPUT, DOWN);
1035 PIN_SLP(gpa1-5, INPUT, DOWN);
1036
1037 PIN_SLP(gpb-0, INPUT, NONE);
1038 PIN_SLP(gpb-1, INPUT, NONE);
1039 PIN_SLP(gpb-2, INPUT, NONE);
1040 PIN_SLP(gpb-3, INPUT, NONE);
1041 PIN_SLP(gpb-4, INPUT, DOWN);
1042 PIN_SLP(gpb-5, INPUT, UP);
1043 PIN_SLP(gpb-6, INPUT, DOWN);
1044 PIN_SLP(gpb-7, INPUT, DOWN);
1045
1046 PIN_SLP(gpc0-0, INPUT, DOWN);
1047 PIN_SLP(gpc0-1, INPUT, DOWN);
1048 PIN_SLP(gpc0-2, INPUT, DOWN);
1049 PIN_SLP(gpc0-3, INPUT, DOWN);
1050 PIN_SLP(gpc0-4, INPUT, DOWN);
1051
1052 PIN_SLP(gpc1-0, INPUT, NONE);
1053 PIN_SLP(gpc1-1, PREV, NONE);
1054 PIN_SLP(gpc1-2, INPUT, NONE);
1055 PIN_SLP(gpc1-3, INPUT, NONE);
1056 PIN_SLP(gpc1-4, INPUT, NONE);
1057
1058 PIN_SLP(gpd0-0, INPUT, DOWN);
1059 PIN_SLP(gpd0-1, INPUT, DOWN);
1060 PIN_SLP(gpd0-2, INPUT, NONE);
1061 PIN_SLP(gpd0-3, INPUT, NONE);
1062
1063 PIN_SLP(gpd1-0, INPUT, DOWN);
1064 PIN_SLP(gpd1-1, INPUT, DOWN);
1065 PIN_SLP(gpd1-2, INPUT, NONE);
1066 PIN_SLP(gpd1-3, INPUT, NONE);
1067
1068 PIN_SLP(gpf0-0, INPUT, NONE);
1069 PIN_SLP(gpf0-1, INPUT, NONE);
1070 PIN_SLP(gpf0-2, INPUT, DOWN);
1071 PIN_SLP(gpf0-3, INPUT, DOWN);
1072 PIN_SLP(gpf0-4, INPUT, NONE);
1073 PIN_SLP(gpf0-5, INPUT, DOWN);
1074 PIN_SLP(gpf0-6, INPUT, NONE);
1075 PIN_SLP(gpf0-7, INPUT, DOWN);
1076
1077 PIN_SLP(gpf1-0, INPUT, DOWN);
1078 PIN_SLP(gpf1-1, INPUT, DOWN);
1079 PIN_SLP(gpf1-2, INPUT, DOWN);
1080 PIN_SLP(gpf1-3, INPUT, DOWN);
1081 PIN_SLP(gpf1-4, INPUT, NONE);
1082 PIN_SLP(gpf1-5, INPUT, NONE);
1083 PIN_SLP(gpf1-6, INPUT, DOWN);
1084 PIN_SLP(gpf1-7, PREV, NONE);
1085
1086 PIN_SLP(gpf2-0, PREV, NONE);
1087 PIN_SLP(gpf2-1, INPUT, DOWN);
1088 PIN_SLP(gpf2-2, INPUT, DOWN);
1089 PIN_SLP(gpf2-3, INPUT, DOWN);
1090 PIN_SLP(gpf2-4, INPUT, DOWN);
1091 PIN_SLP(gpf2-5, INPUT, DOWN);
1092 PIN_SLP(gpf2-6, INPUT, NONE);
1093 PIN_SLP(gpf2-7, INPUT, NONE);
1094
1095 PIN_SLP(gpf3-0, INPUT, NONE);
1096 PIN_SLP(gpf3-1, PREV, NONE);
1097 PIN_SLP(gpf3-2, PREV, NONE);
1098 PIN_SLP(gpf3-3, PREV, NONE);
1099 PIN_SLP(gpf3-4, OUT1, NONE);
1100 PIN_SLP(gpf3-5, INPUT, DOWN);
1101
1102 PIN_SLP(gpj0-0, PREV, NONE);
1103 PIN_SLP(gpj0-1, PREV, NONE);
1104 PIN_SLP(gpj0-2, PREV, NONE);
1105 PIN_SLP(gpj0-3, INPUT, DOWN);
1106 PIN_SLP(gpj0-4, PREV, NONE);
1107 PIN_SLP(gpj0-5, PREV, NONE);
1108 PIN_SLP(gpj0-6, INPUT, DOWN);
1109 PIN_SLP(gpj0-7, INPUT, DOWN);
1110
1111 PIN_SLP(gpj1-0, INPUT, DOWN);
1112 PIN_SLP(gpj1-1, PREV, NONE);
1113 PIN_SLP(gpj1-2, PREV, NONE);
1114 PIN_SLP(gpj1-3, INPUT, DOWN);
1115 PIN_SLP(gpj1-4, INPUT, DOWN);
1116 };
1117};
1118
1119&pinctrl_1 {
1120 pinctrl-names = "default";
1121 pinctrl-0 = <&sleep1>;
1122
1123 hdmi_hpd: hdmi-hpd {
1124 samsung,pins = "gpx3-7";
1125 samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
1126 };
1127
1128 sleep1: sleep-states {
1129 PIN_SLP(gpk0-0, PREV, NONE);
1130 PIN_SLP(gpk0-1, PREV, NONE);
1131 PIN_SLP(gpk0-2, OUT0, NONE);
1132 PIN_SLP(gpk0-3, PREV, NONE);
1133 PIN_SLP(gpk0-4, PREV, NONE);
1134 PIN_SLP(gpk0-5, PREV, NONE);
1135 PIN_SLP(gpk0-6, PREV, NONE);
1136
1137 PIN_SLP(gpk1-0, INPUT, DOWN);
1138 PIN_SLP(gpk1-1, INPUT, DOWN);
1139 PIN_SLP(gpk1-2, INPUT, DOWN);
1140 PIN_SLP(gpk1-3, PREV, NONE);
1141 PIN_SLP(gpk1-4, PREV, NONE);
1142 PIN_SLP(gpk1-5, PREV, NONE);
1143 PIN_SLP(gpk1-6, PREV, NONE);
1144
1145 PIN_SLP(gpk2-0, INPUT, DOWN);
1146 PIN_SLP(gpk2-1, INPUT, DOWN);
1147 PIN_SLP(gpk2-2, INPUT, DOWN);
1148 PIN_SLP(gpk2-3, INPUT, DOWN);
1149 PIN_SLP(gpk2-4, INPUT, DOWN);
1150 PIN_SLP(gpk2-5, INPUT, DOWN);
1151 PIN_SLP(gpk2-6, INPUT, DOWN);
1152
1153 PIN_SLP(gpk3-0, OUT0, NONE);
1154 PIN_SLP(gpk3-1, INPUT, NONE);
1155 PIN_SLP(gpk3-2, INPUT, DOWN);
1156 PIN_SLP(gpk3-3, INPUT, NONE);
1157 PIN_SLP(gpk3-4, INPUT, NONE);
1158 PIN_SLP(gpk3-5, INPUT, NONE);
1159 PIN_SLP(gpk3-6, INPUT, NONE);
1160
1161 PIN_SLP(gpl0-0, INPUT, DOWN);
1162 PIN_SLP(gpl0-1, INPUT, DOWN);
1163 PIN_SLP(gpl0-2, INPUT, DOWN);
1164 PIN_SLP(gpl0-3, INPUT, DOWN);
1165 PIN_SLP(gpl0-4, PREV, NONE);
1166 PIN_SLP(gpl0-6, PREV, NONE);
1167
1168 PIN_SLP(gpl1-0, INPUT, DOWN);
1169 PIN_SLP(gpl1-1, INPUT, DOWN);
1170 PIN_SLP(gpl2-0, INPUT, DOWN);
1171 PIN_SLP(gpl2-1, INPUT, DOWN);
1172 PIN_SLP(gpl2-2, INPUT, DOWN);
1173 PIN_SLP(gpl2-3, INPUT, DOWN);
1174 PIN_SLP(gpl2-4, INPUT, DOWN);
1175 PIN_SLP(gpl2-5, INPUT, DOWN);
1176 PIN_SLP(gpl2-6, PREV, NONE);
1177 PIN_SLP(gpl2-7, INPUT, DOWN);
1178
1179 PIN_SLP(gpm0-0, INPUT, DOWN);
1180 PIN_SLP(gpm0-1, INPUT, DOWN);
1181 PIN_SLP(gpm0-2, INPUT, DOWN);
1182 PIN_SLP(gpm0-3, INPUT, DOWN);
1183 PIN_SLP(gpm0-4, INPUT, DOWN);
1184 PIN_SLP(gpm0-5, INPUT, DOWN);
1185 PIN_SLP(gpm0-6, INPUT, DOWN);
1186 PIN_SLP(gpm0-7, INPUT, DOWN);
1187
1188 PIN_SLP(gpm1-0, INPUT, DOWN);
1189 PIN_SLP(gpm1-1, INPUT, DOWN);
1190 PIN_SLP(gpm1-2, INPUT, NONE);
1191 PIN_SLP(gpm1-3, INPUT, NONE);
1192 PIN_SLP(gpm1-4, INPUT, NONE);
1193 PIN_SLP(gpm1-5, INPUT, NONE);
1194 PIN_SLP(gpm1-6, INPUT, DOWN);
1195
1196 PIN_SLP(gpm2-0, INPUT, NONE);
1197 PIN_SLP(gpm2-1, INPUT, NONE);
1198 PIN_SLP(gpm2-2, INPUT, DOWN);
1199 PIN_SLP(gpm2-3, INPUT, DOWN);
1200 PIN_SLP(gpm2-4, INPUT, DOWN);
1201
1202 PIN_SLP(gpm3-0, PREV, NONE);
1203 PIN_SLP(gpm3-1, PREV, NONE);
1204 PIN_SLP(gpm3-2, PREV, NONE);
1205 PIN_SLP(gpm3-3, OUT1, NONE);
1206 PIN_SLP(gpm3-4, INPUT, DOWN);
1207 PIN_SLP(gpm3-5, INPUT, DOWN);
1208 PIN_SLP(gpm3-6, INPUT, DOWN);
1209 PIN_SLP(gpm3-7, INPUT, DOWN);
1210
1211 PIN_SLP(gpm4-0, INPUT, DOWN);
1212 PIN_SLP(gpm4-1, INPUT, DOWN);
1213 PIN_SLP(gpm4-2, INPUT, DOWN);
1214 PIN_SLP(gpm4-3, INPUT, DOWN);
1215 PIN_SLP(gpm4-4, INPUT, DOWN);
1216 PIN_SLP(gpm4-5, INPUT, DOWN);
1217 PIN_SLP(gpm4-6, INPUT, DOWN);
1218 PIN_SLP(gpm4-7, INPUT, DOWN);
1219
1220 PIN_SLP(gpy0-0, INPUT, DOWN);
1221 PIN_SLP(gpy0-1, INPUT, DOWN);
1222 PIN_SLP(gpy0-2, INPUT, DOWN);
1223 PIN_SLP(gpy0-3, INPUT, DOWN);
1224 PIN_SLP(gpy0-4, INPUT, DOWN);
1225 PIN_SLP(gpy0-5, INPUT, DOWN);
1226
1227 PIN_SLP(gpy1-0, INPUT, DOWN);
1228 PIN_SLP(gpy1-1, INPUT, DOWN);
1229 PIN_SLP(gpy1-2, INPUT, DOWN);
1230 PIN_SLP(gpy1-3, INPUT, DOWN);
1231
1232 PIN_SLP(gpy2-0, PREV, NONE);
1233 PIN_SLP(gpy2-1, INPUT, DOWN);
1234 PIN_SLP(gpy2-2, INPUT, NONE);
1235 PIN_SLP(gpy2-3, INPUT, NONE);
1236 PIN_SLP(gpy2-4, INPUT, NONE);
1237 PIN_SLP(gpy2-5, INPUT, NONE);
1238
1239 PIN_SLP(gpy3-0, INPUT, DOWN);
1240 PIN_SLP(gpy3-1, INPUT, DOWN);
1241 PIN_SLP(gpy3-2, INPUT, DOWN);
1242 PIN_SLP(gpy3-3, INPUT, DOWN);
1243 PIN_SLP(gpy3-4, INPUT, DOWN);
1244 PIN_SLP(gpy3-5, INPUT, DOWN);
1245 PIN_SLP(gpy3-6, INPUT, DOWN);
1246 PIN_SLP(gpy3-7, INPUT, DOWN);
1247
1248 PIN_SLP(gpy4-0, INPUT, DOWN);
1249 PIN_SLP(gpy4-1, INPUT, DOWN);
1250 PIN_SLP(gpy4-2, INPUT, DOWN);
1251 PIN_SLP(gpy4-3, INPUT, DOWN);
1252 PIN_SLP(gpy4-4, INPUT, DOWN);
1253 PIN_SLP(gpy4-5, INPUT, DOWN);
1254 PIN_SLP(gpy4-6, INPUT, DOWN);
1255 PIN_SLP(gpy4-7, INPUT, DOWN);
1256
1257 PIN_SLP(gpy5-0, INPUT, DOWN);
1258 PIN_SLP(gpy5-1, INPUT, DOWN);
1259 PIN_SLP(gpy5-2, INPUT, DOWN);
1260 PIN_SLP(gpy5-3, INPUT, DOWN);
1261 PIN_SLP(gpy5-4, INPUT, DOWN);
1262 PIN_SLP(gpy5-5, INPUT, DOWN);
1263 PIN_SLP(gpy5-6, INPUT, DOWN);
1264 PIN_SLP(gpy5-7, INPUT, DOWN);
1265
1266 PIN_SLP(gpy6-0, INPUT, DOWN);
1267 PIN_SLP(gpy6-1, INPUT, DOWN);
1268 PIN_SLP(gpy6-2, INPUT, DOWN);
1269 PIN_SLP(gpy6-3, INPUT, DOWN);
1270 PIN_SLP(gpy6-4, INPUT, DOWN);
1271 PIN_SLP(gpy6-5, INPUT, DOWN);
1272 PIN_SLP(gpy6-6, INPUT, DOWN);
1273 PIN_SLP(gpy6-7, INPUT, DOWN);
1274 };
1275};
1276
1277&pinctrl_2 {
1278 pinctrl-names = "default";
1279 pinctrl-0 = <&sleep2>;
1280
1281 sleep2: sleep-states {
1282 PIN_SLP(gpz-0, INPUT, DOWN);
1283 PIN_SLP(gpz-1, INPUT, DOWN);
1284 PIN_SLP(gpz-2, INPUT, DOWN);
1285 PIN_SLP(gpz-3, INPUT, DOWN);
1286 PIN_SLP(gpz-4, INPUT, DOWN);
1287 PIN_SLP(gpz-5, INPUT, DOWN);
1288 PIN_SLP(gpz-6, INPUT, DOWN);
1289 };
1290};
1291
1292&pinctrl_3 {
1293 pinctrl-names = "default";
1294 pinctrl-0 = <&sleep3>;
1295
1296 sleep3: sleep-states {
1297 PIN_SLP(gpv0-0, INPUT, DOWN);
1298 PIN_SLP(gpv0-1, INPUT, DOWN);
1299 PIN_SLP(gpv0-2, INPUT, DOWN);
1300 PIN_SLP(gpv0-3, INPUT, DOWN);
1301 PIN_SLP(gpv0-4, INPUT, DOWN);
1302 PIN_SLP(gpv0-5, INPUT, DOWN);
1303 PIN_SLP(gpv0-6, INPUT, DOWN);
1304 PIN_SLP(gpv0-7, INPUT, DOWN);
1305
1306 PIN_SLP(gpv1-0, INPUT, DOWN);
1307 PIN_SLP(gpv1-1, INPUT, DOWN);
1308 PIN_SLP(gpv1-2, INPUT, DOWN);
1309 PIN_SLP(gpv1-3, INPUT, DOWN);
1310 PIN_SLP(gpv1-4, INPUT, DOWN);
1311 PIN_SLP(gpv1-5, INPUT, DOWN);
1312 PIN_SLP(gpv1-6, INPUT, DOWN);
1313 PIN_SLP(gpv1-7, INPUT, DOWN);
1314
1315 PIN_SLP(gpv2-0, INPUT, DOWN);
1316 PIN_SLP(gpv2-1, INPUT, DOWN);
1317 PIN_SLP(gpv2-2, INPUT, DOWN);
1318 PIN_SLP(gpv2-3, INPUT, DOWN);
1319 PIN_SLP(gpv2-4, INPUT, DOWN);
1320 PIN_SLP(gpv2-5, INPUT, DOWN);
1321 PIN_SLP(gpv2-6, INPUT, DOWN);
1322 PIN_SLP(gpv2-7, INPUT, DOWN);
1323
1324 PIN_SLP(gpv3-0, INPUT, DOWN);
1325 PIN_SLP(gpv3-1, INPUT, DOWN);
1326 PIN_SLP(gpv3-2, INPUT, DOWN);
1327 PIN_SLP(gpv3-3, INPUT, DOWN);
1328 PIN_SLP(gpv3-4, INPUT, DOWN);
1329 PIN_SLP(gpv3-5, INPUT, DOWN);
1330 PIN_SLP(gpv3-6, INPUT, DOWN);
1331 PIN_SLP(gpv3-7, INPUT, DOWN);
1332
1333 PIN_SLP(gpv4-0, INPUT, DOWN);
1334 };
1335};
1336
1337&pwm {
1338 pinctrl-0 = <&pwm0_out>;
1339 pinctrl-names = "default";
1340 samsung,pwm-outputs = <0>;
1341 status = "okay";
1342};
1343
1344&rtc {
1345 status = "okay";
1346 clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
1347 clock-names = "rtc", "rtc_src";
1348};
1349
1350&sdhci_2 {
1351 bus-width = <4>;
1352 cd-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
1353 cd-inverted;
1354 pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
1355 pinctrl-names = "default";
1356 vmmc-supply = <&ldo21_reg>;
1357 status = "okay";
1358};
1359
1360&sdhci_3 {
1361 #address-cells = <1>;
1362 #size-cells = <0>;
1363 non-removable;
1364 bus-width = <4>;
1365
1366 mmc-pwrseq = <&wlan_pwrseq>;
1367 pinctrl-names = "default";
1368 pinctrl-0 = <&sd3_clk &sd3_cmd &sd3_bus4>;
1369 status = "okay";
1370
1371 brcmf: wifi@1 {
1372 reg = <1>;
1373 compatible = "brcm,bcm4329-fmac";
1374 interrupt-parent = <&gpx2>;
1375 interrupts = <5 IRQ_TYPE_NONE>;
1376 interrupt-names = "host-wake";
1377 };
1378};
1379
1380&serial_0 {
1381 status = "okay";
1382};
1383
1384&serial_1 {
1385 status = "okay";
1386};
1387
1388&serial_2 {
1389 status = "okay";
1390};
1391
1392&serial_3 {
1393 status = "okay";
1394};
1395
1396&spi_1 {
1397 pinctrl-names = "default";
1398 pinctrl-0 = <&spi1_bus>;
1399 cs-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
1400 status = "okay";
1401
1402 s5c73m3_spi: s5c73m3@0 {
1403 compatible = "samsung,s5c73m3";
1404 spi-max-frequency = <50000000>;
1405 reg = <0>;
1406 controller-data {
1407 samsung,spi-feedback-delay = <2>;
1408 };
1409 };
1410};
1411
1412&tmu {
1413 vtmu-supply = <&ldo10_reg>;
1414 status = "okay";
1415};
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
index e4ad2fc0329e..2ae1ab602f4b 100644
--- a/arch/arm/boot/dts/exynos4412.dtsi
+++ b/arch/arm/boot/dts/exynos4412.dtsi
@@ -15,7 +15,7 @@
15 */ 15 */
16 16
17#include "exynos4.dtsi" 17#include "exynos4.dtsi"
18#include "exynos4412-pinctrl.dtsi" 18
19#include "exynos4-cpu-thermal.dtsi" 19#include "exynos4-cpu-thermal.dtsi"
20 20
21/ { 21/ {
@@ -42,8 +42,6 @@
42 clocks = <&clock CLK_ARM_CLK>; 42 clocks = <&clock CLK_ARM_CLK>;
43 clock-names = "cpu"; 43 clock-names = "cpu";
44 operating-points-v2 = <&cpu0_opp_table>; 44 operating-points-v2 = <&cpu0_opp_table>;
45 cooling-min-level = <13>;
46 cooling-max-level = <7>;
47 #cooling-cells = <2>; /* min followed by max */ 45 #cooling-cells = <2>; /* min followed by max */
48 }; 46 };
49 47
@@ -147,463 +145,410 @@
147 }; 145 };
148 }; 146 };
149 147
150 sysram@2020000 {
151 compatible = "mmio-sram";
152 reg = <0x02020000 0x40000>;
153 #address-cells = <1>;
154 #size-cells = <1>;
155 ranges = <0 0x02020000 0x40000>;
156 148
157 smp-sysram@0 { 149 soc: soc {
158 compatible = "samsung,exynos4210-sysram";
159 reg = <0x0 0x1000>;
160 };
161 150
162 smp-sysram@2f000 { 151 pinctrl_0: pinctrl@11400000 {
163 compatible = "samsung,exynos4210-sysram-ns"; 152 compatible = "samsung,exynos4x12-pinctrl";
164 reg = <0x2f000 0x1000>; 153 reg = <0x11400000 0x1000>;
154 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
165 }; 155 };
166 };
167
168 pd_isp: isp-power-domain@10023ca0 {
169 compatible = "samsung,exynos4210-pd";
170 reg = <0x10023CA0 0x20>;
171 #power-domain-cells = <0>;
172 label = "ISP";
173 };
174
175 l2c: l2-cache-controller@10502000 {
176 compatible = "arm,pl310-cache";
177 reg = <0x10502000 0x1000>;
178 cache-unified;
179 cache-level = <2>;
180 arm,tag-latency = <2 2 1>;
181 arm,data-latency = <3 2 1>;
182 arm,double-linefill = <1>;
183 arm,double-linefill-incr = <0>;
184 arm,double-linefill-wrap = <1>;
185 arm,prefetch-drop = <1>;
186 arm,prefetch-offset = <7>;
187 };
188 156
189 clock: clock-controller@10030000 { 157 pinctrl_1: pinctrl@11000000 {
190 compatible = "samsung,exynos4412-clock"; 158 compatible = "samsung,exynos4x12-pinctrl";
191 reg = <0x10030000 0x18000>; 159 reg = <0x11000000 0x1000>;
192 #clock-cells = <1>; 160 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
193 };
194
195 isp_clock: clock-controller@10048000 {
196 compatible = "samsung,exynos4412-isp-clock";
197 reg = <0x10048000 0x1000>;
198 #clock-cells = <1>;
199 power-domains = <&pd_isp>;
200 clocks = <&clock CLK_ACLK200>, <&clock CLK_ACLK400_MCUISP>;
201 clock-names = "aclk200", "aclk400_mcuisp";
202 };
203 161
204 mct@10050000 { 162 wakup_eint: wakeup-interrupt-controller {
205 compatible = "samsung,exynos4412-mct"; 163 compatible = "samsung,exynos4210-wakeup-eint";
206 reg = <0x10050000 0x800>; 164 interrupt-parent = <&gic>;
207 interrupt-parent = <&mct_map>; 165 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
208 interrupts = <0>, <1>, <2>, <3>, <4>; 166 };
209 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
210 clock-names = "fin_pll", "mct";
211
212 mct_map: mct-map {
213 #interrupt-cells = <1>;
214 #address-cells = <0>;
215 #size-cells = <0>;
216 interrupt-map = <0 &gic 0 57 IRQ_TYPE_LEVEL_HIGH>,
217 <1 &combiner 12 5>,
218 <2 &combiner 12 6>,
219 <3 &combiner 12 7>,
220 <4 &gic 1 12 IRQ_TYPE_LEVEL_HIGH>;
221 }; 167 };
222 };
223
224 watchdog: watchdog@10060000 {
225 compatible = "samsung,exynos5250-wdt";
226 reg = <0x10060000 0x100>;
227 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
228 clocks = <&clock CLK_WDT>;
229 clock-names = "watchdog";
230 samsung,syscon-phandle = <&pmu_system_controller>;
231 };
232
233 adc: adc@126c0000 {
234 compatible = "samsung,exynos-adc-v1";
235 reg = <0x126C0000 0x100>;
236 interrupt-parent = <&combiner>;
237 interrupts = <10 3>;
238 clocks = <&clock CLK_TSADC>;
239 clock-names = "adc";
240 #io-channel-cells = <1>;
241 io-channel-ranges;
242 samsung,syscon-phandle = <&pmu_system_controller>;
243 status = "disabled";
244 };
245
246 g2d: g2d@10800000 {
247 compatible = "samsung,exynos4212-g2d";
248 reg = <0x10800000 0x1000>;
249 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
250 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
251 clock-names = "sclk_fimg2d", "fimg2d";
252 iommus = <&sysmmu_g2d>;
253 };
254
255 camera {
256 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
257 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
258 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
259 168
260 /* fimc_[0-3] are configured outside, under phandles */ 169 pinctrl_2: pinctrl@3860000 {
261 fimc_lite_0: fimc-lite@12390000 { 170 compatible = "samsung,exynos4x12-pinctrl";
262 compatible = "samsung,exynos4212-fimc-lite"; 171 reg = <0x03860000 0x1000>;
263 reg = <0x12390000 0x1000>; 172 interrupt-parent = <&combiner>;
264 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; 173 interrupts = <10 0>;
265 power-domains = <&pd_isp>;
266 clocks = <&isp_clock CLK_ISP_FIMC_LITE0>;
267 clock-names = "flite";
268 iommus = <&sysmmu_fimc_lite0>;
269 status = "disabled";
270 }; 174 };
271 175
272 fimc_lite_1: fimc-lite@123a0000 { 176 pinctrl_3: pinctrl@106e0000 {
273 compatible = "samsung,exynos4212-fimc-lite"; 177 compatible = "samsung,exynos4x12-pinctrl";
274 reg = <0x123A0000 0x1000>; 178 reg = <0x106E0000 0x1000>;
275 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; 179 interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
276 power-domains = <&pd_isp>;
277 clocks = <&isp_clock CLK_ISP_FIMC_LITE1>;
278 clock-names = "flite";
279 iommus = <&sysmmu_fimc_lite1>;
280 status = "disabled";
281 }; 180 };
282 181
283 fimc_is: fimc-is@12000000 { 182 sysram@2020000 {
284 compatible = "samsung,exynos4212-fimc-is"; 183 compatible = "mmio-sram";
285 reg = <0x12000000 0x260000>; 184 reg = <0x02020000 0x40000>;
286 interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
287 <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
288 power-domains = <&pd_isp>;
289 clocks = <&isp_clock CLK_ISP_FIMC_LITE0>,
290 <&isp_clock CLK_ISP_FIMC_LITE1>,
291 <&isp_clock CLK_ISP_PPMUISPX>,
292 <&isp_clock CLK_ISP_PPMUISPMX>,
293 <&isp_clock CLK_ISP_FIMC_ISP>,
294 <&isp_clock CLK_ISP_FIMC_DRC>,
295 <&isp_clock CLK_ISP_FIMC_FD>,
296 <&isp_clock CLK_ISP_MCUISP>,
297 <&isp_clock CLK_ISP_GICISP>,
298 <&isp_clock CLK_ISP_MCUCTL_ISP>,
299 <&isp_clock CLK_ISP_PWM_ISP>,
300 <&isp_clock CLK_ISP_DIV_ISP0>,
301 <&isp_clock CLK_ISP_DIV_ISP1>,
302 <&isp_clock CLK_ISP_DIV_MCUISP0>,
303 <&isp_clock CLK_ISP_DIV_MCUISP1>,
304 <&clock CLK_MOUT_MPLL_USER_T>,
305 <&clock CLK_ACLK200>,
306 <&clock CLK_ACLK400_MCUISP>,
307 <&clock CLK_DIV_ACLK200>,
308 <&clock CLK_DIV_ACLK400_MCUISP>,
309 <&clock CLK_UART_ISP_SCLK>;
310 clock-names = "lite0", "lite1", "ppmuispx",
311 "ppmuispmx", "isp",
312 "drc", "fd", "mcuisp",
313 "gicisp", "mcuctl_isp", "pwm_isp",
314 "ispdiv0", "ispdiv1", "mcuispdiv0",
315 "mcuispdiv1", "mpll", "aclk200",
316 "aclk400mcuisp", "div_aclk200",
317 "div_aclk400mcuisp", "uart";
318 iommus = <&sysmmu_fimc_isp>, <&sysmmu_fimc_drc>,
319 <&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>;
320 iommu-names = "isp", "drc", "fd", "mcuctl";
321 #address-cells = <1>; 185 #address-cells = <1>;
322 #size-cells = <1>; 186 #size-cells = <1>;
323 ranges; 187 ranges = <0 0x02020000 0x40000>;
324 status = "disabled";
325 188
326 pmu@10020000 { 189 smp-sysram@0 {
327 reg = <0x10020000 0x3000>; 190 compatible = "samsung,exynos4210-sysram";
191 reg = <0x0 0x1000>;
328 }; 192 };
329 193
330 i2c1_isp: i2c-isp@12140000 { 194 smp-sysram@2f000 {
331 compatible = "samsung,exynos4212-i2c-isp"; 195 compatible = "samsung,exynos4210-sysram-ns";
332 reg = <0x12140000 0x100>; 196 reg = <0x2f000 0x1000>;
333 clocks = <&isp_clock CLK_ISP_I2C1_ISP>;
334 clock-names = "i2c_isp";
335 #address-cells = <1>;
336 #size-cells = <0>;
337 }; 197 };
338 }; 198 };
339 };
340
341 mshc_0: mmc@12550000 {
342 compatible = "samsung,exynos4412-dw-mshc";
343 reg = <0x12550000 0x1000>;
344 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
345 #address-cells = <1>;
346 #size-cells = <0>;
347 fifo-depth = <0x80>;
348 clocks = <&clock CLK_SDMMC4>, <&clock CLK_SCLK_MMC4>;
349 clock-names = "biu", "ciu";
350 status = "disabled";
351 };
352
353 sysmmu_g2d: sysmmu@10A40000{
354 compatible = "samsung,exynos-sysmmu";
355 reg = <0x10A40000 0x1000>;
356 interrupt-parent = <&combiner>;
357 interrupts = <4 7>;
358 clock-names = "sysmmu", "master";
359 clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
360 #iommu-cells = <0>;
361 };
362
363 sysmmu_fimc_isp: sysmmu@12260000 {
364 compatible = "samsung,exynos-sysmmu";
365 reg = <0x12260000 0x1000>;
366 interrupt-parent = <&combiner>;
367 interrupts = <16 2>;
368 power-domains = <&pd_isp>;
369 clock-names = "sysmmu";
370 clocks = <&isp_clock CLK_ISP_SMMU_ISP>;
371 #iommu-cells = <0>;
372 };
373
374 sysmmu_fimc_drc: sysmmu@12270000 {
375 compatible = "samsung,exynos-sysmmu";
376 reg = <0x12270000 0x1000>;
377 interrupt-parent = <&combiner>;
378 interrupts = <16 3>;
379 power-domains = <&pd_isp>;
380 clock-names = "sysmmu";
381 clocks = <&isp_clock CLK_ISP_SMMU_DRC>;
382 #iommu-cells = <0>;
383 };
384
385 sysmmu_fimc_fd: sysmmu@122a0000 {
386 compatible = "samsung,exynos-sysmmu";
387 reg = <0x122A0000 0x1000>;
388 interrupt-parent = <&combiner>;
389 interrupts = <16 4>;
390 power-domains = <&pd_isp>;
391 clock-names = "sysmmu";
392 clocks = <&isp_clock CLK_ISP_SMMU_FD>;
393 #iommu-cells = <0>;
394 };
395
396 sysmmu_fimc_mcuctl: sysmmu@122b0000 {
397 compatible = "samsung,exynos-sysmmu";
398 reg = <0x122B0000 0x1000>;
399 interrupt-parent = <&combiner>;
400 interrupts = <16 5>;
401 power-domains = <&pd_isp>;
402 clock-names = "sysmmu";
403 clocks = <&isp_clock CLK_ISP_SMMU_ISPCX>;
404 #iommu-cells = <0>;
405 };
406 199
407 sysmmu_fimc_lite0: sysmmu@123b0000 { 200 pd_isp: isp-power-domain@10023ca0 {
408 compatible = "samsung,exynos-sysmmu"; 201 compatible = "samsung,exynos4210-pd";
409 reg = <0x123B0000 0x1000>; 202 reg = <0x10023CA0 0x20>;
410 interrupt-parent = <&combiner>; 203 #power-domain-cells = <0>;
411 interrupts = <16 0>; 204 label = "ISP";
412 power-domains = <&pd_isp>; 205 };
413 clock-names = "sysmmu", "master";
414 clocks = <&isp_clock CLK_ISP_SMMU_LITE0>,
415 <&isp_clock CLK_ISP_FIMC_LITE0>;
416 #iommu-cells = <0>;
417 };
418 206
419 sysmmu_fimc_lite1: sysmmu@123c0000 { 207 l2c: l2-cache-controller@10502000 {
420 compatible = "samsung,exynos-sysmmu"; 208 compatible = "arm,pl310-cache";
421 reg = <0x123C0000 0x1000>; 209 reg = <0x10502000 0x1000>;
422 interrupt-parent = <&combiner>; 210 cache-unified;
423 interrupts = <16 1>; 211 cache-level = <2>;
424 power-domains = <&pd_isp>; 212 arm,tag-latency = <2 2 1>;
425 clock-names = "sysmmu", "master"; 213 arm,data-latency = <3 2 1>;
426 clocks = <&isp_clock CLK_ISP_SMMU_LITE1>, 214 arm,double-linefill = <1>;
427 <&isp_clock CLK_ISP_FIMC_LITE1>; 215 arm,double-linefill-incr = <0>;
428 #iommu-cells = <0>; 216 arm,double-linefill-wrap = <1>;
429 }; 217 arm,prefetch-drop = <1>;
218 arm,prefetch-offset = <7>;
219 };
430 220
431 bus_dmc: bus_dmc { 221 clock: clock-controller@10030000 {
432 compatible = "samsung,exynos-bus"; 222 compatible = "samsung,exynos4412-clock";
433 clocks = <&clock CLK_DIV_DMC>; 223 reg = <0x10030000 0x18000>;
434 clock-names = "bus"; 224 #clock-cells = <1>;
435 operating-points-v2 = <&bus_dmc_opp_table>; 225 };
436 status = "disabled";
437 };
438 226
439 bus_acp: bus_acp { 227 isp_clock: clock-controller@10048000 {
440 compatible = "samsung,exynos-bus"; 228 compatible = "samsung,exynos4412-isp-clock";
441 clocks = <&clock CLK_DIV_ACP>; 229 reg = <0x10048000 0x1000>;
442 clock-names = "bus"; 230 #clock-cells = <1>;
443 operating-points-v2 = <&bus_acp_opp_table>; 231 power-domains = <&pd_isp>;
444 status = "disabled"; 232 clocks = <&clock CLK_ACLK200>,
445 }; 233 <&clock CLK_ACLK400_MCUISP>;
234 clock-names = "aclk200", "aclk400_mcuisp";
235 };
236
237 mct@10050000 {
238 compatible = "samsung,exynos4412-mct";
239 reg = <0x10050000 0x800>;
240 interrupt-parent = <&mct_map>;
241 interrupts = <0>, <1>, <2>, <3>, <4>;
242 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
243 clock-names = "fin_pll", "mct";
244
245 mct_map: mct-map {
246 #interrupt-cells = <1>;
247 #address-cells = <0>;
248 #size-cells = <0>;
249 interrupt-map =
250 <0 &gic 0 57 IRQ_TYPE_LEVEL_HIGH>,
251 <1 &combiner 12 5>,
252 <2 &combiner 12 6>,
253 <3 &combiner 12 7>,
254 <4 &gic 1 12 IRQ_TYPE_LEVEL_HIGH>;
255 };
256 };
446 257
447 bus_c2c: bus_c2c { 258 watchdog: watchdog@10060000 {
448 compatible = "samsung,exynos-bus"; 259 compatible = "samsung,exynos5250-wdt";
449 clocks = <&clock CLK_DIV_C2C>; 260 reg = <0x10060000 0x100>;
450 clock-names = "bus"; 261 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
451 operating-points-v2 = <&bus_dmc_opp_table>; 262 clocks = <&clock CLK_WDT>;
452 status = "disabled"; 263 clock-names = "watchdog";
453 }; 264 samsung,syscon-phandle = <&pmu_system_controller>;
265 };
266
267 adc: adc@126c0000 {
268 compatible = "samsung,exynos-adc-v1";
269 reg = <0x126C0000 0x100>;
270 interrupt-parent = <&combiner>;
271 interrupts = <10 3>;
272 clocks = <&clock CLK_TSADC>;
273 clock-names = "adc";
274 #io-channel-cells = <1>;
275 io-channel-ranges;
276 samsung,syscon-phandle = <&pmu_system_controller>;
277 status = "disabled";
278 };
454 279
455 bus_dmc_opp_table: opp_table1 { 280 g2d: g2d@10800000 {
456 compatible = "operating-points-v2"; 281 compatible = "samsung,exynos4212-g2d";
457 opp-shared; 282 reg = <0x10800000 0x1000>;
283 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
284 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
285 clock-names = "sclk_fimg2d", "fimg2d";
286 iommus = <&sysmmu_g2d>;
287 };
458 288
459 opp-100000000 { 289 mshc_0: mmc@12550000 {
460 opp-hz = /bits/ 64 <100000000>; 290 compatible = "samsung,exynos4412-dw-mshc";
461 opp-microvolt = <900000>; 291 reg = <0x12550000 0x1000>;
292 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
293 #address-cells = <1>;
294 #size-cells = <0>;
295 fifo-depth = <0x80>;
296 clocks = <&clock CLK_SDMMC4>, <&clock CLK_SCLK_MMC4>;
297 clock-names = "biu", "ciu";
298 status = "disabled";
462 }; 299 };
463 opp-134000000 { 300
464 opp-hz = /bits/ 64 <134000000>; 301 sysmmu_g2d: sysmmu@10A40000{
465 opp-microvolt = <900000>; 302 compatible = "samsung,exynos-sysmmu";
303 reg = <0x10A40000 0x1000>;
304 interrupt-parent = <&combiner>;
305 interrupts = <4 7>;
306 clock-names = "sysmmu", "master";
307 clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
308 #iommu-cells = <0>;
466 }; 309 };
467 opp-160000000 { 310
468 opp-hz = /bits/ 64 <160000000>; 311 sysmmu_fimc_isp: sysmmu@12260000 {
469 opp-microvolt = <900000>; 312 compatible = "samsung,exynos-sysmmu";
313 reg = <0x12260000 0x1000>;
314 interrupt-parent = <&combiner>;
315 interrupts = <16 2>;
316 power-domains = <&pd_isp>;
317 clock-names = "sysmmu";
318 clocks = <&isp_clock CLK_ISP_SMMU_ISP>;
319 #iommu-cells = <0>;
470 }; 320 };
471 opp-267000000 { 321
472 opp-hz = /bits/ 64 <267000000>; 322 sysmmu_fimc_drc: sysmmu@12270000 {
473 opp-microvolt = <950000>; 323 compatible = "samsung,exynos-sysmmu";
324 reg = <0x12270000 0x1000>;
325 interrupt-parent = <&combiner>;
326 interrupts = <16 3>;
327 power-domains = <&pd_isp>;
328 clock-names = "sysmmu";
329 clocks = <&isp_clock CLK_ISP_SMMU_DRC>;
330 #iommu-cells = <0>;
474 }; 331 };
475 opp-400000000 { 332
476 opp-hz = /bits/ 64 <400000000>; 333 sysmmu_fimc_fd: sysmmu@122a0000 {
477 opp-microvolt = <1050000>; 334 compatible = "samsung,exynos-sysmmu";
335 reg = <0x122A0000 0x1000>;
336 interrupt-parent = <&combiner>;
337 interrupts = <16 4>;
338 power-domains = <&pd_isp>;
339 clock-names = "sysmmu";
340 clocks = <&isp_clock CLK_ISP_SMMU_FD>;
341 #iommu-cells = <0>;
478 }; 342 };
479 };
480 343
481 bus_acp_opp_table: opp_table2 { 344 sysmmu_fimc_mcuctl: sysmmu@122b0000 {
482 compatible = "operating-points-v2"; 345 compatible = "samsung,exynos-sysmmu";
483 opp-shared; 346 reg = <0x122B0000 0x1000>;
347 interrupt-parent = <&combiner>;
348 interrupts = <16 5>;
349 power-domains = <&pd_isp>;
350 clock-names = "sysmmu";
351 clocks = <&isp_clock CLK_ISP_SMMU_ISPCX>;
352 #iommu-cells = <0>;
353 };
484 354
485 opp-100000000 { 355 sysmmu_fimc_lite0: sysmmu@123b0000 {
486 opp-hz = /bits/ 64 <100000000>; 356 compatible = "samsung,exynos-sysmmu";
357 reg = <0x123B0000 0x1000>;
358 interrupt-parent = <&combiner>;
359 interrupts = <16 0>;
360 power-domains = <&pd_isp>;
361 clock-names = "sysmmu", "master";
362 clocks = <&isp_clock CLK_ISP_SMMU_LITE0>,
363 <&isp_clock CLK_ISP_FIMC_LITE0>;
364 #iommu-cells = <0>;
487 }; 365 };
488 opp-134000000 { 366
489 opp-hz = /bits/ 64 <134000000>; 367 sysmmu_fimc_lite1: sysmmu@123c0000 {
368 compatible = "samsung,exynos-sysmmu";
369 reg = <0x123C0000 0x1000>;
370 interrupt-parent = <&combiner>;
371 interrupts = <16 1>;
372 power-domains = <&pd_isp>;
373 clock-names = "sysmmu", "master";
374 clocks = <&isp_clock CLK_ISP_SMMU_LITE1>,
375 <&isp_clock CLK_ISP_FIMC_LITE1>;
376 #iommu-cells = <0>;
490 }; 377 };
491 opp-160000000 { 378
492 opp-hz = /bits/ 64 <160000000>; 379 bus_dmc: bus_dmc {
380 compatible = "samsung,exynos-bus";
381 clocks = <&clock CLK_DIV_DMC>;
382 clock-names = "bus";
383 operating-points-v2 = <&bus_dmc_opp_table>;
384 status = "disabled";
493 }; 385 };
494 opp-267000000 { 386
495 opp-hz = /bits/ 64 <267000000>; 387 bus_acp: bus_acp {
388 compatible = "samsung,exynos-bus";
389 clocks = <&clock CLK_DIV_ACP>;
390 clock-names = "bus";
391 operating-points-v2 = <&bus_acp_opp_table>;
392 status = "disabled";
496 }; 393 };
497 };
498 394
499 bus_leftbus: bus_leftbus { 395 bus_c2c: bus_c2c {
500 compatible = "samsung,exynos-bus"; 396 compatible = "samsung,exynos-bus";
501 clocks = <&clock CLK_DIV_GDL>; 397 clocks = <&clock CLK_DIV_C2C>;
502 clock-names = "bus"; 398 clock-names = "bus";
503 operating-points-v2 = <&bus_leftbus_opp_table>; 399 operating-points-v2 = <&bus_dmc_opp_table>;
504 status = "disabled"; 400 status = "disabled";
505 }; 401 };
506 402
507 bus_rightbus: bus_rightbus { 403 bus_dmc_opp_table: opp_table1 {
508 compatible = "samsung,exynos-bus"; 404 compatible = "operating-points-v2";
509 clocks = <&clock CLK_DIV_GDR>; 405 opp-shared;
510 clock-names = "bus";
511 operating-points-v2 = <&bus_leftbus_opp_table>;
512 status = "disabled";
513 };
514 406
515 bus_display: bus_display { 407 opp-100000000 {
516 compatible = "samsung,exynos-bus"; 408 opp-hz = /bits/ 64 <100000000>;
517 clocks = <&clock CLK_ACLK160>; 409 opp-microvolt = <900000>;
518 clock-names = "bus"; 410 };
519 operating-points-v2 = <&bus_display_opp_table>; 411 opp-134000000 {
520 status = "disabled"; 412 opp-hz = /bits/ 64 <134000000>;
521 }; 413 opp-microvolt = <900000>;
414 };
415 opp-160000000 {
416 opp-hz = /bits/ 64 <160000000>;
417 opp-microvolt = <900000>;
418 };
419 opp-267000000 {
420 opp-hz = /bits/ 64 <267000000>;
421 opp-microvolt = <950000>;
422 };
423 opp-400000000 {
424 opp-hz = /bits/ 64 <400000000>;
425 opp-microvolt = <1050000>;
426 };
427 };
522 428
523 bus_fsys: bus_fsys { 429 bus_acp_opp_table: opp_table2 {
524 compatible = "samsung,exynos-bus"; 430 compatible = "operating-points-v2";
525 clocks = <&clock CLK_ACLK133>; 431 opp-shared;
526 clock-names = "bus";
527 operating-points-v2 = <&bus_fsys_opp_table>;
528 status = "disabled";
529 };
530 432
531 bus_peri: bus_peri { 433 opp-100000000 {
532 compatible = "samsung,exynos-bus"; 434 opp-hz = /bits/ 64 <100000000>;
533 clocks = <&clock CLK_ACLK100>; 435 };
534 clock-names = "bus"; 436 opp-134000000 {
535 operating-points-v2 = <&bus_peri_opp_table>; 437 opp-hz = /bits/ 64 <134000000>;
536 status = "disabled"; 438 };
537 }; 439 opp-160000000 {
440 opp-hz = /bits/ 64 <160000000>;
441 };
442 opp-267000000 {
443 opp-hz = /bits/ 64 <267000000>;
444 };
445 };
538 446
539 bus_mfc: bus_mfc { 447 bus_leftbus: bus_leftbus {
540 compatible = "samsung,exynos-bus"; 448 compatible = "samsung,exynos-bus";
541 clocks = <&clock CLK_SCLK_MFC>; 449 clocks = <&clock CLK_DIV_GDL>;
542 clock-names = "bus"; 450 clock-names = "bus";
543 operating-points-v2 = <&bus_leftbus_opp_table>; 451 operating-points-v2 = <&bus_leftbus_opp_table>;
544 status = "disabled"; 452 status = "disabled";
545 }; 453 };
546 454
547 bus_leftbus_opp_table: opp_table3 { 455 bus_rightbus: bus_rightbus {
548 compatible = "operating-points-v2"; 456 compatible = "samsung,exynos-bus";
549 opp-shared; 457 clocks = <&clock CLK_DIV_GDR>;
458 clock-names = "bus";
459 operating-points-v2 = <&bus_leftbus_opp_table>;
460 status = "disabled";
461 };
550 462
551 opp-100000000 { 463 bus_display: bus_display {
552 opp-hz = /bits/ 64 <100000000>; 464 compatible = "samsung,exynos-bus";
553 opp-microvolt = <900000>; 465 clocks = <&clock CLK_ACLK160>;
466 clock-names = "bus";
467 operating-points-v2 = <&bus_display_opp_table>;
468 status = "disabled";
554 }; 469 };
555 opp-134000000 { 470
556 opp-hz = /bits/ 64 <134000000>; 471 bus_fsys: bus_fsys {
557 opp-microvolt = <925000>; 472 compatible = "samsung,exynos-bus";
473 clocks = <&clock CLK_ACLK133>;
474 clock-names = "bus";
475 operating-points-v2 = <&bus_fsys_opp_table>;
476 status = "disabled";
558 }; 477 };
559 opp-160000000 { 478
560 opp-hz = /bits/ 64 <160000000>; 479 bus_peri: bus_peri {
561 opp-microvolt = <950000>; 480 compatible = "samsung,exynos-bus";
481 clocks = <&clock CLK_ACLK100>;
482 clock-names = "bus";
483 operating-points-v2 = <&bus_peri_opp_table>;
484 status = "disabled";
562 }; 485 };
563 opp-200000000 { 486
564 opp-hz = /bits/ 64 <200000000>; 487 bus_mfc: bus_mfc {
565 opp-microvolt = <1000000>; 488 compatible = "samsung,exynos-bus";
489 clocks = <&clock CLK_SCLK_MFC>;
490 clock-names = "bus";
491 operating-points-v2 = <&bus_leftbus_opp_table>;
492 status = "disabled";
566 }; 493 };
567 };
568 494
569 bus_display_opp_table: opp_table4 { 495 bus_leftbus_opp_table: opp_table3 {
570 compatible = "operating-points-v2"; 496 compatible = "operating-points-v2";
571 opp-shared; 497 opp-shared;
572 498
573 opp-160000000 { 499 opp-100000000 {
574 opp-hz = /bits/ 64 <160000000>; 500 opp-hz = /bits/ 64 <100000000>;
575 }; 501 opp-microvolt = <900000>;
576 opp-200000000 { 502 };
577 opp-hz = /bits/ 64 <200000000>; 503 opp-134000000 {
504 opp-hz = /bits/ 64 <134000000>;
505 opp-microvolt = <925000>;
506 };
507 opp-160000000 {
508 opp-hz = /bits/ 64 <160000000>;
509 opp-microvolt = <950000>;
510 };
511 opp-200000000 {
512 opp-hz = /bits/ 64 <200000000>;
513 opp-microvolt = <1000000>;
514 };
578 }; 515 };
579 };
580 516
581 bus_fsys_opp_table: opp_table5 { 517 bus_display_opp_table: opp_table4 {
582 compatible = "operating-points-v2"; 518 compatible = "operating-points-v2";
583 opp-shared; 519 opp-shared;
584 520
585 opp-100000000 { 521 opp-160000000 {
586 opp-hz = /bits/ 64 <100000000>; 522 opp-hz = /bits/ 64 <160000000>;
587 }; 523 };
588 opp-134000000 { 524 opp-200000000 {
589 opp-hz = /bits/ 64 <134000000>; 525 opp-hz = /bits/ 64 <200000000>;
526 };
590 }; 527 };
591 };
592 528
593 bus_peri_opp_table: opp_table6 { 529 bus_fsys_opp_table: opp_table5 {
594 compatible = "operating-points-v2"; 530 compatible = "operating-points-v2";
595 opp-shared; 531 opp-shared;
596 532
597 opp-50000000 { 533 opp-100000000 {
598 opp-hz = /bits/ 64 <50000000>; 534 opp-hz = /bits/ 64 <100000000>;
599 }; 535 };
600 opp-100000000 { 536 opp-134000000 {
601 opp-hz = /bits/ 64 <100000000>; 537 opp-hz = /bits/ 64 <134000000>;
538 };
602 }; 539 };
603 };
604 540
605 pmu { 541 bus_peri_opp_table: opp_table6 {
606 interrupts = <2 2>, <3 2>, <18 2>, <19 2>; 542 compatible = "operating-points-v2";
543 opp-shared;
544
545 opp-50000000 {
546 opp-hz = /bits/ 64 <50000000>;
547 };
548 opp-100000000 {
549 opp-hz = /bits/ 64 <100000000>;
550 };
551 };
607 }; 552 };
608}; 553};
609 554
@@ -631,6 +576,92 @@
631 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; 576 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
632}; 577};
633 578
579&camera {
580 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
581 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
582 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
583
584 /* fimc_[0-3] are configured outside, under phandles */
585 fimc_lite_0: fimc-lite@12390000 {
586 compatible = "samsung,exynos4212-fimc-lite";
587 reg = <0x12390000 0x1000>;
588 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
589 power-domains = <&pd_isp>;
590 clocks = <&isp_clock CLK_ISP_FIMC_LITE0>;
591 clock-names = "flite";
592 iommus = <&sysmmu_fimc_lite0>;
593 status = "disabled";
594 };
595
596 fimc_lite_1: fimc-lite@123a0000 {
597 compatible = "samsung,exynos4212-fimc-lite";
598 reg = <0x123A0000 0x1000>;
599 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
600 power-domains = <&pd_isp>;
601 clocks = <&isp_clock CLK_ISP_FIMC_LITE1>;
602 clock-names = "flite";
603 iommus = <&sysmmu_fimc_lite1>;
604 status = "disabled";
605 };
606
607 fimc_is: fimc-is@12000000 {
608 compatible = "samsung,exynos4212-fimc-is";
609 reg = <0x12000000 0x260000>;
610 interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
611 <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
612 power-domains = <&pd_isp>;
613 clocks = <&isp_clock CLK_ISP_FIMC_LITE0>,
614 <&isp_clock CLK_ISP_FIMC_LITE1>,
615 <&isp_clock CLK_ISP_PPMUISPX>,
616 <&isp_clock CLK_ISP_PPMUISPMX>,
617 <&isp_clock CLK_ISP_FIMC_ISP>,
618 <&isp_clock CLK_ISP_FIMC_DRC>,
619 <&isp_clock CLK_ISP_FIMC_FD>,
620 <&isp_clock CLK_ISP_MCUISP>,
621 <&isp_clock CLK_ISP_GICISP>,
622 <&isp_clock CLK_ISP_MCUCTL_ISP>,
623 <&isp_clock CLK_ISP_PWM_ISP>,
624 <&isp_clock CLK_ISP_DIV_ISP0>,
625 <&isp_clock CLK_ISP_DIV_ISP1>,
626 <&isp_clock CLK_ISP_DIV_MCUISP0>,
627 <&isp_clock CLK_ISP_DIV_MCUISP1>,
628 <&clock CLK_MOUT_MPLL_USER_T>,
629 <&clock CLK_ACLK200>,
630 <&clock CLK_ACLK400_MCUISP>,
631 <&clock CLK_DIV_ACLK200>,
632 <&clock CLK_DIV_ACLK400_MCUISP>,
633 <&clock CLK_UART_ISP_SCLK>;
634 clock-names = "lite0", "lite1", "ppmuispx",
635 "ppmuispmx", "isp",
636 "drc", "fd", "mcuisp",
637 "gicisp", "mcuctl_isp", "pwm_isp",
638 "ispdiv0", "ispdiv1", "mcuispdiv0",
639 "mcuispdiv1", "mpll", "aclk200",
640 "aclk400mcuisp", "div_aclk200",
641 "div_aclk400mcuisp", "uart";
642 iommus = <&sysmmu_fimc_isp>, <&sysmmu_fimc_drc>,
643 <&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>;
644 iommu-names = "isp", "drc", "fd", "mcuctl";
645 #address-cells = <1>;
646 #size-cells = <1>;
647 ranges;
648 status = "disabled";
649
650 pmu@10020000 {
651 reg = <0x10020000 0x3000>;
652 };
653
654 i2c1_isp: i2c-isp@12140000 {
655 compatible = "samsung,exynos4212-i2c-isp";
656 reg = <0x12140000 0x100>;
657 clocks = <&isp_clock CLK_ISP_I2C1_ISP>;
658 clock-names = "i2c_isp";
659 #address-cells = <1>;
660 #size-cells = <0>;
661 };
662 };
663};
664
634&exynos_usbphy { 665&exynos_usbphy {
635 compatible = "samsung,exynos4x12-usb2-phy"; 666 compatible = "samsung,exynos4x12-usb2-phy";
636 samsung,sysreg-phandle = <&sys_reg>; 667 samsung,sysreg-phandle = <&sys_reg>;
@@ -693,35 +724,8 @@
693 <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>; 724 <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>;
694}; 725};
695 726
696&pinctrl_0 { 727&pmu {
697 compatible = "samsung,exynos4x12-pinctrl"; 728 interrupts = <2 2>, <3 2>, <18 2>, <19 2>;
698 reg = <0x11400000 0x1000>;
699 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
700};
701
702&pinctrl_1 {
703 compatible = "samsung,exynos4x12-pinctrl";
704 reg = <0x11000000 0x1000>;
705 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
706
707 wakup_eint: wakeup-interrupt-controller {
708 compatible = "samsung,exynos4210-wakeup-eint";
709 interrupt-parent = <&gic>;
710 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
711 };
712};
713
714&pinctrl_2 {
715 compatible = "samsung,exynos4x12-pinctrl";
716 reg = <0x03860000 0x1000>;
717 interrupt-parent = <&combiner>;
718 interrupts = <10 0>;
719};
720
721&pinctrl_3 {
722 compatible = "samsung,exynos4x12-pinctrl";
723 reg = <0x106E0000 0x1000>;
724 interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
725}; 729};
726 730
727&pmu_system_controller { 731&pmu_system_controller {
@@ -743,3 +747,5 @@
743 clock-names = "tmu_apbif"; 747 clock-names = "tmu_apbif";
744 status = "disabled"; 748 status = "disabled";
745}; 749};
750
751#include "exynos4412-pinctrl.dtsi"
diff --git a/arch/arm/boot/dts/exynos5250-snow-common.dtsi b/arch/arm/boot/dts/exynos5250-snow-common.dtsi
index 59cf1b202849..fd9226d3b207 100644
--- a/arch/arm/boot/dts/exynos5250-snow-common.dtsi
+++ b/arch/arm/boot/dts/exynos5250-snow-common.dtsi
@@ -9,6 +9,7 @@
9#include <dt-bindings/clock/maxim,max77686.h> 9#include <dt-bindings/clock/maxim,max77686.h>
10#include <dt-bindings/interrupt-controller/irq.h> 10#include <dt-bindings/interrupt-controller/irq.h>
11#include <dt-bindings/input/input.h> 11#include <dt-bindings/input/input.h>
12#include <dt-bindings/sound/samsung-i2s.h>
12#include "exynos5250.dtsi" 13#include "exynos5250.dtsi"
13 14
14/ { 15/ {
@@ -225,6 +226,16 @@
225 }; 226 };
226}; 227};
227 228
229&clock {
230 assigned-clocks = <&clock CLK_FOUT_EPLL>;
231 assigned-clock-rates = <49152000>;
232};
233
234&clock_audss {
235 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>;
236 assigned-clock-parents = <&clock CLK_FOUT_EPLL>;
237};
238
228&cpu0 { 239&cpu0 {
229 cpu0-supply = <&buck2_reg>; 240 cpu0-supply = <&buck2_reg>;
230}; 241};
@@ -513,6 +524,8 @@
513}; 524};
514 525
515&i2s0 { 526&i2s0 {
527 assigned-clocks = <&i2s0 CLK_I2S_RCLK_SRC>;
528 assigned-clock-parents = <&clock_audss EXYNOS_I2S_BUS>;
516 status = "okay"; 529 status = "okay";
517}; 530};
518 531
@@ -649,6 +662,11 @@
649 }; 662 };
650}; 663};
651 664
665&pmu_system_controller {
666 assigned-clocks = <&pmu_system_controller 0>;
667 assigned-clock-parents = <&clock CLK_FIN_PLL>;
668};
669
652&rtc { 670&rtc {
653 status = "okay"; 671 status = "okay";
654 clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>; 672 clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
index 4827cb506fa3..75fdc5e6d423 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -18,6 +18,14 @@
18 18
19 samsung,model = "Snow-I2S-MAX98095"; 19 samsung,model = "Snow-I2S-MAX98095";
20 samsung,audio-codec = <&max98095>; 20 samsung,audio-codec = <&max98095>;
21
22 cpu {
23 sound-dai = <&i2s0 0>;
24 };
25
26 codec {
27 sound-dai = <&max98095 0>, <&hdmi>;
28 };
21 }; 29 };
22}; 30};
23 31
@@ -27,6 +35,9 @@
27 reg = <0x11>; 35 reg = <0x11>;
28 pinctrl-names = "default"; 36 pinctrl-names = "default";
29 pinctrl-0 = <&max98095_en>; 37 pinctrl-0 = <&max98095_en>;
38 clocks = <&pmu_system_controller 0>;
39 clock-names = "mclk";
40 #sound-dai-cells = <1>;
30 }; 41 };
31}; 42};
32 43
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 56626d1a4235..45283a6c5eee 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -77,8 +77,6 @@
77 300000 937500 77 300000 937500
78 200000 925000 78 200000 925000
79 >; 79 >;
80 cooling-min-level = <15>;
81 cooling-max-level = <9>;
82 #cooling-cells = <2>; /* min followed by max */ 80 #cooling-cells = <2>; /* min followed by max */
83 }; 81 };
84 cpu@1 { 82 cpu@1 {
@@ -500,6 +498,8 @@
500 pinctrl-names = "default"; 498 pinctrl-names = "default";
501 pinctrl-0 = <&i2s0_bus>; 499 pinctrl-0 = <&i2s0_bus>;
502 power-domains = <&pd_mau>; 500 power-domains = <&pd_mau>;
501 #clock-cells = <1>;
502 #sound-dai-cells = <1>;
503 }; 503 };
504 504
505 i2s1: i2s@12d60000 { 505 i2s1: i2s@12d60000 {
@@ -514,6 +514,7 @@
514 pinctrl-names = "default"; 514 pinctrl-names = "default";
515 pinctrl-0 = <&i2s1_bus>; 515 pinctrl-0 = <&i2s1_bus>;
516 power-domains = <&pd_mau>; 516 power-domains = <&pd_mau>;
517 #sound-dai-cells = <1>;
517 }; 518 };
518 519
519 i2s2: i2s@12d70000 { 520 i2s2: i2s@12d70000 {
@@ -528,6 +529,7 @@
528 pinctrl-names = "default"; 529 pinctrl-names = "default";
529 pinctrl-0 = <&i2s2_bus>; 530 pinctrl-0 = <&i2s2_bus>;
530 power-domains = <&pd_mau>; 531 power-domains = <&pd_mau>;
532 #sound-dai-cells = <1>;
531 }; 533 };
532 534
533 usb_dwc3 { 535 usb_dwc3 {
@@ -655,7 +657,7 @@
655 power-domains = <&pd_gsc>; 657 power-domains = <&pd_gsc>;
656 clocks = <&clock CLK_GSCL0>; 658 clocks = <&clock CLK_GSCL0>;
657 clock-names = "gscl"; 659 clock-names = "gscl";
658 iommu = <&sysmmu_gsc0>; 660 iommus = <&sysmmu_gsc0>;
659 }; 661 };
660 662
661 gsc_1: gsc@13e10000 { 663 gsc_1: gsc@13e10000 {
@@ -665,7 +667,7 @@
665 power-domains = <&pd_gsc>; 667 power-domains = <&pd_gsc>;
666 clocks = <&clock CLK_GSCL1>; 668 clocks = <&clock CLK_GSCL1>;
667 clock-names = "gscl"; 669 clock-names = "gscl";
668 iommu = <&sysmmu_gsc1>; 670 iommus = <&sysmmu_gsc1>;
669 }; 671 };
670 672
671 gsc_2: gsc@13e20000 { 673 gsc_2: gsc@13e20000 {
@@ -675,7 +677,7 @@
675 power-domains = <&pd_gsc>; 677 power-domains = <&pd_gsc>;
676 clocks = <&clock CLK_GSCL2>; 678 clocks = <&clock CLK_GSCL2>;
677 clock-names = "gscl"; 679 clock-names = "gscl";
678 iommu = <&sysmmu_gsc2>; 680 iommus = <&sysmmu_gsc2>;
679 }; 681 };
680 682
681 gsc_3: gsc@13e30000 { 683 gsc_3: gsc@13e30000 {
@@ -685,7 +687,7 @@
685 power-domains = <&pd_gsc>; 687 power-domains = <&pd_gsc>;
686 clocks = <&clock CLK_GSCL3>; 688 clocks = <&clock CLK_GSCL3>;
687 clock-names = "gscl"; 689 clock-names = "gscl";
688 iommu = <&sysmmu_gsc3>; 690 iommus = <&sysmmu_gsc3>;
689 }; 691 };
690 692
691 hdmi: hdmi@14530000 { 693 hdmi: hdmi@14530000 {
@@ -700,6 +702,7 @@
700 "sclk_hdmiphy", "mout_hdmi"; 702 "sclk_hdmiphy", "mout_hdmi";
701 samsung,syscon-phandle = <&pmu_system_controller>; 703 samsung,syscon-phandle = <&pmu_system_controller>;
702 phy = <&hdmiphy>; 704 phy = <&hdmiphy>;
705 #sound-dai-cells = <0>;
703 status = "disabled"; 706 status = "disabled";
704 }; 707 };
705 708
diff --git a/arch/arm/boot/dts/exynos5260-xyref5260.dts b/arch/arm/boot/dts/exynos5260-xyref5260.dts
index 442eb0353f29..fa19c59b2fb6 100644
--- a/arch/arm/boot/dts/exynos5260-xyref5260.dts
+++ b/arch/arm/boot/dts/exynos5260-xyref5260.dts
@@ -65,7 +65,6 @@
65&mmc_0 { 65&mmc_0 {
66 status = "okay"; 66 status = "okay";
67 broken-cd; 67 broken-cd;
68 bypass-smu;
69 cap-mmc-highspeed; 68 cap-mmc-highspeed;
70 supports-hs200-mode; /* 200 MHz */ 69 supports-hs200-mode; /* 200 MHz */
71 card-detect-delay = <200>; 70 card-detect-delay = <200>;
diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi
index 1886aa00b2db..55509c690328 100644
--- a/arch/arm/boot/dts/exynos5410.dtsi
+++ b/arch/arm/boot/dts/exynos5410.dtsi
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include "exynos54xx.dtsi" 13#include "exynos54xx.dtsi"
14#include "exynos-syscon-restart.dtsi"
15#include <dt-bindings/clock/exynos5410.h> 14#include <dt-bindings/clock/exynos5410.h>
16#include <dt-bindings/clock/exynos-audss-clk.h> 15#include <dt-bindings/clock/exynos-audss-clk.h>
17#include <dt-bindings/interrupt-controller/arm-gic.h> 16#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -197,9 +196,9 @@
197 interrupt-parent = <&gic>; 196 interrupt-parent = <&gic>;
198 ranges; 197 ranges;
199 198
200 pdma0: pdma@12680000 { 199 pdma0: pdma@121a0000 {
201 compatible = "arm,pl330", "arm,primecell"; 200 compatible = "arm,pl330", "arm,primecell";
202 reg = <0x121A0000 0x1000>; 201 reg = <0x121a0000 0x1000>;
203 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; 202 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
204 clocks = <&clock CLK_PDMA0>; 203 clocks = <&clock CLK_PDMA0>;
205 clock-names = "apb_pclk"; 204 clock-names = "apb_pclk";
@@ -208,9 +207,9 @@
208 #dma-requests = <32>; 207 #dma-requests = <32>;
209 }; 208 };
210 209
211 pdma1: pdma@12690000 { 210 pdma1: pdma@121b0000 {
212 compatible = "arm,pl330", "arm,primecell"; 211 compatible = "arm,pl330", "arm,primecell";
213 reg = <0x121B0000 0x1000>; 212 reg = <0x121b0000 0x1000>;
214 interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; 213 interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
215 clocks = <&clock CLK_PDMA1>; 214 clocks = <&clock CLK_PDMA1>;
216 clock-names = "apb_pclk"; 215 clock-names = "apb_pclk";
diff --git a/arch/arm/boot/dts/exynos5420-cpus.dtsi b/arch/arm/boot/dts/exynos5420-cpus.dtsi
index 123f0cef658d..a8e449471304 100644
--- a/arch/arm/boot/dts/exynos5420-cpus.dtsi
+++ b/arch/arm/boot/dts/exynos5420-cpus.dtsi
@@ -30,8 +30,6 @@
30 clock-frequency = <1800000000>; 30 clock-frequency = <1800000000>;
31 cci-control-port = <&cci_control1>; 31 cci-control-port = <&cci_control1>;
32 operating-points-v2 = <&cluster_a15_opp_table>; 32 operating-points-v2 = <&cluster_a15_opp_table>;
33 cooling-min-level = <0>;
34 cooling-max-level = <11>;
35 #cooling-cells = <2>; /* min followed by max */ 33 #cooling-cells = <2>; /* min followed by max */
36 capacity-dmips-mhz = <1024>; 34 capacity-dmips-mhz = <1024>;
37 }; 35 };
@@ -43,8 +41,6 @@
43 clock-frequency = <1800000000>; 41 clock-frequency = <1800000000>;
44 cci-control-port = <&cci_control1>; 42 cci-control-port = <&cci_control1>;
45 operating-points-v2 = <&cluster_a15_opp_table>; 43 operating-points-v2 = <&cluster_a15_opp_table>;
46 cooling-min-level = <0>;
47 cooling-max-level = <11>;
48 #cooling-cells = <2>; /* min followed by max */ 44 #cooling-cells = <2>; /* min followed by max */
49 capacity-dmips-mhz = <1024>; 45 capacity-dmips-mhz = <1024>;
50 }; 46 };
@@ -56,8 +52,6 @@
56 clock-frequency = <1800000000>; 52 clock-frequency = <1800000000>;
57 cci-control-port = <&cci_control1>; 53 cci-control-port = <&cci_control1>;
58 operating-points-v2 = <&cluster_a15_opp_table>; 54 operating-points-v2 = <&cluster_a15_opp_table>;
59 cooling-min-level = <0>;
60 cooling-max-level = <11>;
61 #cooling-cells = <2>; /* min followed by max */ 55 #cooling-cells = <2>; /* min followed by max */
62 capacity-dmips-mhz = <1024>; 56 capacity-dmips-mhz = <1024>;
63 }; 57 };
@@ -69,8 +63,6 @@
69 clock-frequency = <1800000000>; 63 clock-frequency = <1800000000>;
70 cci-control-port = <&cci_control1>; 64 cci-control-port = <&cci_control1>;
71 operating-points-v2 = <&cluster_a15_opp_table>; 65 operating-points-v2 = <&cluster_a15_opp_table>;
72 cooling-min-level = <0>;
73 cooling-max-level = <11>;
74 #cooling-cells = <2>; /* min followed by max */ 66 #cooling-cells = <2>; /* min followed by max */
75 capacity-dmips-mhz = <1024>; 67 capacity-dmips-mhz = <1024>;
76 }; 68 };
@@ -83,8 +75,6 @@
83 clock-frequency = <1000000000>; 75 clock-frequency = <1000000000>;
84 cci-control-port = <&cci_control0>; 76 cci-control-port = <&cci_control0>;
85 operating-points-v2 = <&cluster_a7_opp_table>; 77 operating-points-v2 = <&cluster_a7_opp_table>;
86 cooling-min-level = <0>;
87 cooling-max-level = <7>;
88 #cooling-cells = <2>; /* min followed by max */ 78 #cooling-cells = <2>; /* min followed by max */
89 capacity-dmips-mhz = <539>; 79 capacity-dmips-mhz = <539>;
90 }; 80 };
@@ -96,8 +86,6 @@
96 clock-frequency = <1000000000>; 86 clock-frequency = <1000000000>;
97 cci-control-port = <&cci_control0>; 87 cci-control-port = <&cci_control0>;
98 operating-points-v2 = <&cluster_a7_opp_table>; 88 operating-points-v2 = <&cluster_a7_opp_table>;
99 cooling-min-level = <0>;
100 cooling-max-level = <7>;
101 #cooling-cells = <2>; /* min followed by max */ 89 #cooling-cells = <2>; /* min followed by max */
102 capacity-dmips-mhz = <539>; 90 capacity-dmips-mhz = <539>;
103 }; 91 };
@@ -109,8 +97,6 @@
109 clock-frequency = <1000000000>; 97 clock-frequency = <1000000000>;
110 cci-control-port = <&cci_control0>; 98 cci-control-port = <&cci_control0>;
111 operating-points-v2 = <&cluster_a7_opp_table>; 99 operating-points-v2 = <&cluster_a7_opp_table>;
112 cooling-min-level = <0>;
113 cooling-max-level = <7>;
114 #cooling-cells = <2>; /* min followed by max */ 100 #cooling-cells = <2>; /* min followed by max */
115 capacity-dmips-mhz = <539>; 101 capacity-dmips-mhz = <539>;
116 }; 102 };
@@ -122,8 +108,6 @@
122 clock-frequency = <1000000000>; 108 clock-frequency = <1000000000>;
123 cci-control-port = <&cci_control0>; 109 cci-control-port = <&cci_control0>;
124 operating-points-v2 = <&cluster_a7_opp_table>; 110 operating-points-v2 = <&cluster_a7_opp_table>;
125 cooling-min-level = <0>;
126 cooling-max-level = <7>;
127 #cooling-cells = <2>; /* min followed by max */ 111 #cooling-cells = <2>; /* min followed by max */
128 capacity-dmips-mhz = <539>; 112 capacity-dmips-mhz = <539>;
129 }; 113 };
diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index 5a76ed77dda1..244f0091c21f 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -11,6 +11,7 @@
11#include <dt-bindings/interrupt-controller/irq.h> 11#include <dt-bindings/interrupt-controller/irq.h>
12#include <dt-bindings/clock/maxim,max77802.h> 12#include <dt-bindings/clock/maxim,max77802.h>
13#include <dt-bindings/regulator/maxim,max77802.h> 13#include <dt-bindings/regulator/maxim,max77802.h>
14#include <dt-bindings/sound/samsung-i2s.h>
14#include "exynos5420.dtsi" 15#include "exynos5420.dtsi"
15#include "exynos5420-cpus.dtsi" 16#include "exynos5420-cpus.dtsi"
16 17
@@ -86,6 +87,14 @@
86 samsung,model = "Peach-Pit-I2S-MAX98090"; 87 samsung,model = "Peach-Pit-I2S-MAX98090";
87 samsung,i2s-controller = <&i2s0>; 88 samsung,i2s-controller = <&i2s0>;
88 samsung,audio-codec = <&max98090>; 89 samsung,audio-codec = <&max98090>;
90
91 cpu {
92 sound-dai = <&i2s0 0>;
93 };
94
95 codec {
96 sound-dai = <&max98090>, <&hdmi>;
97 };
89 }; 98 };
90 99
91 usb300_vbus_reg: regulator-usb300 { 100 usb300_vbus_reg: regulator-usb300 {
@@ -142,6 +151,11 @@
142 vdd-supply = <&ldo9_reg>; 151 vdd-supply = <&ldo9_reg>;
143}; 152};
144 153
154&clock_audss {
155 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>;
156 assigned-clock-parents = <&clock CLK_FOUT_EPLL>;
157};
158
145&cpu0 { 159&cpu0 {
146 cpu-supply = <&buck2_reg>; 160 cpu-supply = <&buck2_reg>;
147}; 161};
@@ -606,6 +620,7 @@
606 pinctrl-0 = <&max98090_irq>; 620 pinctrl-0 = <&max98090_irq>;
607 clocks = <&pmu_system_controller 0>; 621 clocks = <&pmu_system_controller 0>;
608 clock-names = "mclk"; 622 clock-names = "mclk";
623 #sound-dai-cells = <0>;
609 }; 624 };
610 625
611 light-sensor@44 { 626 light-sensor@44 {
@@ -690,6 +705,8 @@
690}; 705};
691 706
692&i2s0 { 707&i2s0 {
708 assigned-clocks = <&i2s0 CLK_I2S_RCLK_SRC>;
709 assigned-clock-parents = <&clock_audss EXYNOS_I2S_BUS>;
693 status = "okay"; 710 status = "okay";
694}; 711};
695 712
diff --git a/arch/arm/boot/dts/exynos5422-cpus.dtsi b/arch/arm/boot/dts/exynos5422-cpus.dtsi
index c593809c7f08..7c130a00d1a8 100644
--- a/arch/arm/boot/dts/exynos5422-cpus.dtsi
+++ b/arch/arm/boot/dts/exynos5422-cpus.dtsi
@@ -29,8 +29,6 @@
29 clock-frequency = <1000000000>; 29 clock-frequency = <1000000000>;
30 cci-control-port = <&cci_control0>; 30 cci-control-port = <&cci_control0>;
31 operating-points-v2 = <&cluster_a7_opp_table>; 31 operating-points-v2 = <&cluster_a7_opp_table>;
32 cooling-min-level = <0>;
33 cooling-max-level = <11>;
34 #cooling-cells = <2>; /* min followed by max */ 32 #cooling-cells = <2>; /* min followed by max */
35 capacity-dmips-mhz = <539>; 33 capacity-dmips-mhz = <539>;
36 }; 34 };
@@ -42,8 +40,6 @@
42 clock-frequency = <1000000000>; 40 clock-frequency = <1000000000>;
43 cci-control-port = <&cci_control0>; 41 cci-control-port = <&cci_control0>;
44 operating-points-v2 = <&cluster_a7_opp_table>; 42 operating-points-v2 = <&cluster_a7_opp_table>;
45 cooling-min-level = <0>;
46 cooling-max-level = <11>;
47 #cooling-cells = <2>; /* min followed by max */ 43 #cooling-cells = <2>; /* min followed by max */
48 capacity-dmips-mhz = <539>; 44 capacity-dmips-mhz = <539>;
49 }; 45 };
@@ -55,8 +51,6 @@
55 clock-frequency = <1000000000>; 51 clock-frequency = <1000000000>;
56 cci-control-port = <&cci_control0>; 52 cci-control-port = <&cci_control0>;
57 operating-points-v2 = <&cluster_a7_opp_table>; 53 operating-points-v2 = <&cluster_a7_opp_table>;
58 cooling-min-level = <0>;
59 cooling-max-level = <11>;
60 #cooling-cells = <2>; /* min followed by max */ 54 #cooling-cells = <2>; /* min followed by max */
61 capacity-dmips-mhz = <539>; 55 capacity-dmips-mhz = <539>;
62 }; 56 };
@@ -68,8 +62,6 @@
68 clock-frequency = <1000000000>; 62 clock-frequency = <1000000000>;
69 cci-control-port = <&cci_control0>; 63 cci-control-port = <&cci_control0>;
70 operating-points-v2 = <&cluster_a7_opp_table>; 64 operating-points-v2 = <&cluster_a7_opp_table>;
71 cooling-min-level = <0>;
72 cooling-max-level = <11>;
73 #cooling-cells = <2>; /* min followed by max */ 65 #cooling-cells = <2>; /* min followed by max */
74 capacity-dmips-mhz = <539>; 66 capacity-dmips-mhz = <539>;
75 }; 67 };
@@ -82,8 +74,6 @@
82 clock-frequency = <1800000000>; 74 clock-frequency = <1800000000>;
83 cci-control-port = <&cci_control1>; 75 cci-control-port = <&cci_control1>;
84 operating-points-v2 = <&cluster_a15_opp_table>; 76 operating-points-v2 = <&cluster_a15_opp_table>;
85 cooling-min-level = <0>;
86 cooling-max-level = <15>;
87 #cooling-cells = <2>; /* min followed by max */ 77 #cooling-cells = <2>; /* min followed by max */
88 capacity-dmips-mhz = <1024>; 78 capacity-dmips-mhz = <1024>;
89 }; 79 };
@@ -95,8 +85,6 @@
95 clock-frequency = <1800000000>; 85 clock-frequency = <1800000000>;
96 cci-control-port = <&cci_control1>; 86 cci-control-port = <&cci_control1>;
97 operating-points-v2 = <&cluster_a15_opp_table>; 87 operating-points-v2 = <&cluster_a15_opp_table>;
98 cooling-min-level = <0>;
99 cooling-max-level = <15>;
100 #cooling-cells = <2>; /* min followed by max */ 88 #cooling-cells = <2>; /* min followed by max */
101 capacity-dmips-mhz = <1024>; 89 capacity-dmips-mhz = <1024>;
102 }; 90 };
@@ -108,8 +96,6 @@
108 clock-frequency = <1800000000>; 96 clock-frequency = <1800000000>;
109 cci-control-port = <&cci_control1>; 97 cci-control-port = <&cci_control1>;
110 operating-points-v2 = <&cluster_a15_opp_table>; 98 operating-points-v2 = <&cluster_a15_opp_table>;
111 cooling-min-level = <0>;
112 cooling-max-level = <15>;
113 #cooling-cells = <2>; /* min followed by max */ 99 #cooling-cells = <2>; /* min followed by max */
114 capacity-dmips-mhz = <1024>; 100 capacity-dmips-mhz = <1024>;
115 }; 101 };
@@ -121,8 +107,6 @@
121 clock-frequency = <1800000000>; 107 clock-frequency = <1800000000>;
122 cci-control-port = <&cci_control1>; 108 cci-control-port = <&cci_control1>;
123 operating-points-v2 = <&cluster_a15_opp_table>; 109 operating-points-v2 = <&cluster_a15_opp_table>;
124 cooling-min-level = <0>;
125 cooling-max-level = <15>;
126 #cooling-cells = <2>; /* min followed by max */ 110 #cooling-cells = <2>; /* min followed by max */
127 capacity-dmips-mhz = <1024>; 111 capacity-dmips-mhz = <1024>;
128 }; 112 };
diff --git a/arch/arm/boot/dts/exynos5440.dtsi b/arch/arm/boot/dts/exynos5440.dtsi
index fce9e26b5930..f3abecc44657 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -26,24 +26,6 @@
26 tmuctrl2 = &tmuctrl_2; 26 tmuctrl2 = &tmuctrl_2;
27 }; 27 };
28 28
29 clock: clock-controller@160000 {
30 compatible = "samsung,exynos5440-clock";
31 reg = <0x160000 0x1000>;
32 #clock-cells = <1>;
33 };
34
35 gic: interrupt-controller@2e0000 {
36 compatible = "arm,cortex-a15-gic";
37 #interrupt-cells = <3>;
38 interrupt-controller;
39 reg = <0x2E1000 0x1000>,
40 <0x2E2000 0x2000>,
41 <0x2E4000 0x2000>,
42 <0x2E6000 0x2000>;
43 interrupts = <GIC_PPI 9
44 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
45 };
46
47 cpus { 29 cpus {
48 #address-cells = <1>; 30 #address-cells = <1>;
49 #size-cells = <0>; 31 #size-cells = <0>;
@@ -70,182 +52,290 @@
70 }; 52 };
71 }; 53 };
72 54
73 arm-pmu { 55 soc: soc {
74 compatible = "arm,cortex-a15-pmu", "arm,cortex-a9-pmu"; 56 compatible = "simple-bus";
75 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>, 57 #address-cells = <1>;
76 <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, 58 #size-cells = <1>;
77 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>, 59 ranges;
78 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
79 };
80 60
81 timer { 61 clock: clock-controller@160000 {
82 compatible = "arm,cortex-a15-timer", 62 compatible = "samsung,exynos5440-clock";
83 "arm,armv7-timer"; 63 reg = <0x160000 0x1000>;
84 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 64 #clock-cells = <1>;
85 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 65 };
86 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
87 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
88 clock-frequency = <50000000>;
89 };
90 66
91 cpufreq@160000 { 67 gic: interrupt-controller@2e0000 {
92 compatible = "samsung,exynos5440-cpufreq"; 68 compatible = "arm,cortex-a15-gic";
93 reg = <0x160000 0x1000>; 69 #interrupt-cells = <3>;
94 interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>; 70 interrupt-controller;
95 operating-points = < 71 reg = <0x2E1000 0x1000>,
96 /* KHz uV */ 72 <0x2E2000 0x2000>,
97 1500000 1100000 73 <0x2E4000 0x2000>,
98 1400000 1075000 74 <0x2E6000 0x2000>;
99 1300000 1050000 75 interrupts = <GIC_PPI 9
100 1200000 1025000 76 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
101 1100000 1000000 77 };
102 1000000 975000
103 900000 950000
104 800000 925000
105 >;
106 };
107 78
108 serial_0: serial@b0000 {
109 compatible = "samsung,exynos4210-uart";
110 reg = <0xB0000 0x1000>;
111 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
112 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>;
113 clock-names = "uart", "clk_uart_baud0";
114 };
115 79
116 serial_1: serial@c0000 { 80 arm-pmu {
117 compatible = "samsung,exynos4210-uart"; 81 compatible = "arm,cortex-a15-pmu", "arm,cortex-a9-pmu";
118 reg = <0xC0000 0x1000>; 82 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
119 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; 83 <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
120 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>; 84 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
121 clock-names = "uart", "clk_uart_baud0"; 85 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
122 }; 86 };
123 87
124 spi_0: spi@d0000 { 88 timer {
125 compatible = "samsung,exynos5440-spi"; 89 compatible = "arm,cortex-a15-timer",
126 reg = <0xD0000 0x100>; 90 "arm,armv7-timer";
127 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; 91 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
128 #address-cells = <1>; 92 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
129 #size-cells = <0>; 93 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
130 samsung,spi-src-clk = <0>; 94 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
131 num-cs = <1>; 95 clock-frequency = <50000000>;
132 clocks = <&clock CLK_B_125>, <&clock CLK_SPI_BAUD>; 96 };
133 clock-names = "spi", "spi_busclk0";
134 };
135 97
136 pin_ctrl: pinctrl@e0000 { 98 cpufreq@160000 {
137 compatible = "samsung,exynos5440-pinctrl"; 99 compatible = "samsung,exynos5440-cpufreq";
138 reg = <0xE0000 0x1000>; 100 reg = <0x160000 0x1000>;
139 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 101 interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
140 <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 102 operating-points = <
141 <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 103 /* KHz uV */
142 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 104 1500000 1100000
143 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 105 1400000 1075000
144 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>, 106 1300000 1050000
145 <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>, 107 1200000 1025000
146 <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; 108 1100000 1000000
147 interrupt-controller; 109 1000000 975000
148 #interrupt-cells = <2>; 110 900000 950000
149 #gpio-cells = <2>; 111 800000 925000
112 >;
113 };
150 114
151 fan: fan { 115 serial_0: serial@b0000 {
152 samsung,exynos5440-pin-function = <1>; 116 compatible = "samsung,exynos4210-uart";
117 reg = <0xB0000 0x1000>;
118 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
119 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>;
120 clock-names = "uart", "clk_uart_baud0";
153 }; 121 };
154 122
155 hdd_led0: hdd_led0 { 123 serial_1: serial@c0000 {
156 samsung,exynos5440-pin-function = <2>; 124 compatible = "samsung,exynos4210-uart";
125 reg = <0xC0000 0x1000>;
126 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
127 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>;
128 clock-names = "uart", "clk_uart_baud0";
157 }; 129 };
158 130
159 hdd_led1: hdd_led1 { 131 spi_0: spi@d0000 {
160 samsung,exynos5440-pin-function = <3>; 132 compatible = "samsung,exynos5440-spi";
133 reg = <0xD0000 0x100>;
134 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
135 #address-cells = <1>;
136 #size-cells = <0>;
137 samsung,spi-src-clk = <0>;
138 num-cs = <1>;
139 clocks = <&clock CLK_B_125>, <&clock CLK_SPI_BAUD>;
140 clock-names = "spi", "spi_busclk0";
161 }; 141 };
162 142
163 uart1: uart1 { 143 pin_ctrl: pinctrl@e0000 {
164 samsung,exynos5440-pin-function = <4>; 144 compatible = "samsung,exynos5440-pinctrl";
145 reg = <0xE0000 0x1000>;
146 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
147 <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
148 <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
149 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
150 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
151 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
152 <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
153 <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
154 interrupt-controller;
155 #interrupt-cells = <2>;
156 #gpio-cells = <2>;
157
158 fan: fan {
159 samsung,exynos5440-pin-function = <1>;
160 };
161
162 hdd_led0: hdd_led0 {
163 samsung,exynos5440-pin-function = <2>;
164 };
165
166 hdd_led1: hdd_led1 {
167 samsung,exynos5440-pin-function = <3>;
168 };
169
170 uart1: uart1 {
171 samsung,exynos5440-pin-function = <4>;
172 };
165 }; 173 };
166 };
167 174
168 i2c@f0000 { 175 i2c@f0000 {
169 compatible = "samsung,exynos5440-i2c"; 176 compatible = "samsung,exynos5440-i2c";
170 reg = <0xF0000 0x1000>; 177 reg = <0xF0000 0x1000>;
171 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; 178 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
172 #address-cells = <1>; 179 #address-cells = <1>;
173 #size-cells = <0>; 180 #size-cells = <0>;
174 clocks = <&clock CLK_B_125>; 181 clocks = <&clock CLK_B_125>;
175 clock-names = "i2c"; 182 clock-names = "i2c";
176 }; 183 };
177 184
178 i2c@100000 { 185 i2c@100000 {
179 compatible = "samsung,exynos5440-i2c"; 186 compatible = "samsung,exynos5440-i2c";
180 reg = <0x100000 0x1000>; 187 reg = <0x100000 0x1000>;
181 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; 188 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
182 #address-cells = <1>; 189 #address-cells = <1>;
183 #size-cells = <0>; 190 #size-cells = <0>;
184 clocks = <&clock CLK_B_125>; 191 clocks = <&clock CLK_B_125>;
185 clock-names = "i2c"; 192 clock-names = "i2c";
186 }; 193 };
187 194
188 watchdog@110000 { 195 watchdog@110000 {
189 compatible = "samsung,s3c6410-wdt"; 196 compatible = "samsung,s3c6410-wdt";
190 reg = <0x110000 0x1000>; 197 reg = <0x110000 0x1000>;
191 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; 198 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
192 clocks = <&clock CLK_B_125>; 199 clocks = <&clock CLK_B_125>;
193 clock-names = "watchdog"; 200 clock-names = "watchdog";
194 }; 201 };
195 202
196 gmac: ethernet@230000 { 203 gmac: ethernet@230000 {
197 compatible = "snps,dwmac-3.70a", "snps,dwmac"; 204 compatible = "snps,dwmac-3.70a", "snps,dwmac";
198 reg = <0x00230000 0x8000>; 205 reg = <0x00230000 0x8000>;
199 interrupt-parent = <&gic>; 206 interrupt-parent = <&gic>;
200 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 207 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
201 interrupt-names = "macirq"; 208 interrupt-names = "macirq";
202 phy-mode = "sgmii"; 209 phy-mode = "sgmii";
203 clocks = <&clock CLK_GMAC0>; 210 clocks = <&clock CLK_GMAC0>;
204 clock-names = "stmmaceth"; 211 clock-names = "stmmaceth";
205 }; 212 };
206 213
207 amba { 214 amba {
208 #address-cells = <1>; 215 #address-cells = <1>;
209 #size-cells = <1>; 216 #size-cells = <1>;
210 compatible = "simple-bus"; 217 compatible = "simple-bus";
211 interrupt-parent = <&gic>; 218 interrupt-parent = <&gic>;
212 ranges; 219 ranges;
213 }; 220 };
214 221
215 rtc@130000 { 222 rtc@130000 {
216 compatible = "samsung,s3c6410-rtc"; 223 compatible = "samsung,s3c6410-rtc";
217 reg = <0x130000 0x1000>; 224 reg = <0x130000 0x1000>;
218 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, 225 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
219 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; 226 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
220 clocks = <&clock CLK_B_125>; 227 clocks = <&clock CLK_B_125>;
221 clock-names = "rtc"; 228 clock-names = "rtc";
222 }; 229 };
223 230
224 tmuctrl_0: tmuctrl@160118 { 231 tmuctrl_0: tmuctrl@160118 {
225 compatible = "samsung,exynos5440-tmu"; 232 compatible = "samsung,exynos5440-tmu";
226 reg = <0x160118 0x230>, <0x160368 0x10>; 233 reg = <0x160118 0x230>, <0x160368 0x10>;
227 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; 234 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
228 clocks = <&clock CLK_B_125>; 235 clocks = <&clock CLK_B_125>;
229 clock-names = "tmu_apbif"; 236 clock-names = "tmu_apbif";
230 #include "exynos5440-tmu-sensor-conf.dtsi" 237 #include "exynos5440-tmu-sensor-conf.dtsi"
231 }; 238 };
232 239
233 tmuctrl_1: tmuctrl@16011c { 240 tmuctrl_1: tmuctrl@16011c {
234 compatible = "samsung,exynos5440-tmu"; 241 compatible = "samsung,exynos5440-tmu";
235 reg = <0x16011C 0x230>, <0x160368 0x10>; 242 reg = <0x16011C 0x230>, <0x160368 0x10>;
236 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; 243 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
237 clocks = <&clock CLK_B_125>; 244 clocks = <&clock CLK_B_125>;
238 clock-names = "tmu_apbif"; 245 clock-names = "tmu_apbif";
239 #include "exynos5440-tmu-sensor-conf.dtsi" 246 #include "exynos5440-tmu-sensor-conf.dtsi"
240 }; 247 };
248
249 tmuctrl_2: tmuctrl@160120 {
250 compatible = "samsung,exynos5440-tmu";
251 reg = <0x160120 0x230>, <0x160368 0x10>;
252 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
253 clocks = <&clock CLK_B_125>;
254 clock-names = "tmu_apbif";
255 #include "exynos5440-tmu-sensor-conf.dtsi"
256 };
241 257
242 tmuctrl_2: tmuctrl@160120 { 258 sata@210000 {
243 compatible = "samsung,exynos5440-tmu"; 259 compatible = "snps,exynos5440-ahci";
244 reg = <0x160120 0x230>, <0x160368 0x10>; 260 reg = <0x210000 0x10000>;
245 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; 261 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
246 clocks = <&clock CLK_B_125>; 262 clocks = <&clock CLK_SATA>;
247 clock-names = "tmu_apbif"; 263 clock-names = "sata";
248 #include "exynos5440-tmu-sensor-conf.dtsi" 264 };
265
266 ohci@220000 {
267 compatible = "samsung,exynos5440-ohci";
268 reg = <0x220000 0x1000>;
269 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
270 clocks = <&clock CLK_USB>;
271 clock-names = "usbhost";
272 };
273
274 ehci@221000 {
275 compatible = "samsung,exynos5440-ehci";
276 reg = <0x221000 0x1000>;
277 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
278 clocks = <&clock CLK_USB>;
279 clock-names = "usbhost";
280 };
281
282 pcie_phy0: pcie-phy@270000 {
283 #phy-cells = <0>;
284 compatible = "samsung,exynos5440-pcie-phy";
285 reg = <0x270000 0x1000>, <0x271000 0x40>;
286 };
287
288 pcie_phy1: pcie-phy@272000 {
289 #phy-cells = <0>;
290 compatible = "samsung,exynos5440-pcie-phy";
291 reg = <0x272000 0x1000>, <0x271040 0x40>;
292 };
293
294 pcie_0: pcie@290000 {
295 compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
296 reg = <0x290000 0x1000>, <0x40000000 0x1000>;
297 reg-names = "elbi", "config";
298 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
299 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
300 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
301 clocks = <&clock CLK_PR0_250_O>, <&clock CLK_PB0_250_O>;
302 clock-names = "pcie", "pcie_bus";
303 #address-cells = <3>;
304 #size-cells = <2>;
305 device_type = "pci";
306 phys = <&pcie_phy0>;
307 ranges = <0x81000000 0 0 0x40001000 0 0x00010000 /* downstream I/O */
308 0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */
309 bus-range = <0x00 0xff>;
310 #interrupt-cells = <1>;
311 interrupt-map-mask = <0 0 0 0>;
312 interrupt-map = <0x0 0 &gic 53>;
313 num-lanes = <4>;
314 status = "disabled";
315 };
316
317 pcie_1: pcie@2a0000 {
318 compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
319 reg = <0x2a0000 0x1000>, <0x60000000 0x1000>;
320 reg-names = "elbi", "config";
321 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
322 <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
323 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
324 clocks = <&clock CLK_PR1_250_O>, <&clock CLK_PB0_250_O>;
325 clock-names = "pcie", "pcie_bus";
326 #address-cells = <3>;
327 #size-cells = <2>;
328 device_type = "pci";
329 phys = <&pcie_phy1>;
330 ranges = <0x81000000 0 0 0x60001000 0 0x00010000 /* downstream I/O */
331 0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */
332 bus-range = <0x00 0xff>;
333 #interrupt-cells = <1>;
334 interrupt-map-mask = <0 0 0 0>;
335 interrupt-map = <0x0 0 &gic 56>;
336 num-lanes = <4>;
337 status = "disabled";
338 };
249 }; 339 };
250 340
251 thermal-zones { 341 thermal-zones {
@@ -262,86 +352,4 @@
262 #include "exynos5440-trip-points.dtsi" 352 #include "exynos5440-trip-points.dtsi"
263 }; 353 };
264 }; 354 };
265
266 sata@210000 {
267 compatible = "snps,exynos5440-ahci";
268 reg = <0x210000 0x10000>;
269 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
270 clocks = <&clock CLK_SATA>;
271 clock-names = "sata";
272 };
273
274 ohci@220000 {
275 compatible = "samsung,exynos5440-ohci";
276 reg = <0x220000 0x1000>;
277 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
278 clocks = <&clock CLK_USB>;
279 clock-names = "usbhost";
280 };
281
282 ehci@221000 {
283 compatible = "samsung,exynos5440-ehci";
284 reg = <0x221000 0x1000>;
285 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
286 clocks = <&clock CLK_USB>;
287 clock-names = "usbhost";
288 };
289
290 pcie_phy0: pcie-phy@270000 {
291 #phy-cells = <0>;
292 compatible = "samsung,exynos5440-pcie-phy";
293 reg = <0x270000 0x1000>, <0x271000 0x40>;
294 };
295
296 pcie_phy1: pcie-phy@272000 {
297 #phy-cells = <0>;
298 compatible = "samsung,exynos5440-pcie-phy";
299 reg = <0x272000 0x1000>, <0x271040 0x40>;
300 };
301
302 pcie_0: pcie@290000 {
303 compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
304 reg = <0x290000 0x1000>, <0x40000000 0x1000>;
305 reg-names = "elbi", "config";
306 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
307 <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
308 <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
309 clocks = <&clock CLK_PR0_250_O>, <&clock CLK_PB0_250_O>;
310 clock-names = "pcie", "pcie_bus";
311 #address-cells = <3>;
312 #size-cells = <2>;
313 device_type = "pci";
314 phys = <&pcie_phy0>;
315 ranges = <0x81000000 0 0 0x40001000 0 0x00010000 /* downstream I/O */
316 0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */
317 bus-range = <0x00 0xff>;
318 #interrupt-cells = <1>;
319 interrupt-map-mask = <0 0 0 0>;
320 interrupt-map = <0x0 0 &gic 53>;
321 num-lanes = <4>;
322 status = "disabled";
323 };
324
325 pcie_1: pcie@2a0000 {
326 compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
327 reg = <0x2a0000 0x1000>, <0x60000000 0x1000>;
328 reg-names = "elbi", "config";
329 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
330 <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
331 <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
332 clocks = <&clock CLK_PR1_250_O>, <&clock CLK_PB0_250_O>;
333 clock-names = "pcie", "pcie_bus";
334 #address-cells = <3>;
335 #size-cells = <2>;
336 device_type = "pci";
337 phys = <&pcie_phy1>;
338 ranges = <0x81000000 0 0 0x60001000 0 0x00010000 /* downstream I/O */
339 0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */
340 bus-range = <0x00 0xff>;
341 #interrupt-cells = <1>;
342 interrupt-map-mask = <0 0 0 0>;
343 interrupt-map = <0x0 0 &gic 56>;
344 num-lanes = <4>;
345 status = "disabled";
346 };
347}; 355};
diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts
index 0029ec27819c..2f8df9244f72 100644
--- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
+++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
@@ -1,11 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Google Peach Pi Rev 10+ board device tree source 3 * Google Peach Pi Rev 10+ board device tree source
3 * 4 *
4 * Copyright (c) 2014 Google, Inc 5 * Copyright (c) 2014 Google, Inc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */ 6 */
10 7
11/dts-v1/; 8/dts-v1/;
@@ -14,6 +11,7 @@
14#include <dt-bindings/interrupt-controller/irq.h> 11#include <dt-bindings/interrupt-controller/irq.h>
15#include <dt-bindings/clock/maxim,max77802.h> 12#include <dt-bindings/clock/maxim,max77802.h>
16#include <dt-bindings/regulator/maxim,max77802.h> 13#include <dt-bindings/regulator/maxim,max77802.h>
14#include <dt-bindings/sound/samsung-i2s.h>
17#include "exynos5800.dtsi" 15#include "exynos5800.dtsi"
18#include "exynos5420-cpus.dtsi" 16#include "exynos5420-cpus.dtsi"
19 17
@@ -89,6 +87,14 @@
89 samsung,model = "Peach-Pi-I2S-MAX98091"; 87 samsung,model = "Peach-Pi-I2S-MAX98091";
90 samsung,i2s-controller = <&i2s0>; 88 samsung,i2s-controller = <&i2s0>;
91 samsung,audio-codec = <&max98091>; 89 samsung,audio-codec = <&max98091>;
90
91 cpu {
92 sound-dai = <&i2s0 0>;
93 };
94
95 codec {
96 sound-dai = <&max98091>, <&hdmi>;
97 };
92 }; 98 };
93 99
94 usb300_vbus_reg: regulator-usb300 { 100 usb300_vbus_reg: regulator-usb300 {
@@ -145,6 +151,11 @@
145 vdd-supply = <&ldo9_reg>; 151 vdd-supply = <&ldo9_reg>;
146}; 152};
147 153
154&clock_audss {
155 assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>;
156 assigned-clock-parents = <&clock CLK_FOUT_EPLL>;
157};
158
148&cpu0 { 159&cpu0 {
149 cpu-supply = <&buck2_reg>; 160 cpu-supply = <&buck2_reg>;
150}; 161};
@@ -609,6 +620,7 @@
609 pinctrl-0 = <&max98091_irq>; 620 pinctrl-0 = <&max98091_irq>;
610 clocks = <&pmu_system_controller 0>; 621 clocks = <&pmu_system_controller 0>;
611 clock-names = "mclk"; 622 clock-names = "mclk";
623 #sound-dai-cells = <0>;
612 }; 624 };
613 625
614 light-sensor@44 { 626 light-sensor@44 {
@@ -661,6 +673,8 @@
661}; 673};
662 674
663&i2s0 { 675&i2s0 {
676 assigned-clocks = <&i2s0 CLK_I2S_RCLK_SRC>;
677 assigned-clock-parents = <&clock_audss EXYNOS_I2S_BUS>;
664 status = "okay"; 678 status = "okay";
665}; 679};
666 680
diff --git a/arch/arm/boot/dts/exynos5800.dtsi b/arch/arm/boot/dts/exynos5800.dtsi
index 9ddb6bacac5a..57d3b319fd65 100644
--- a/arch/arm/boot/dts/exynos5800.dtsi
+++ b/arch/arm/boot/dts/exynos5800.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * SAMSUNG EXYNOS5800 SoC device tree source 3 * SAMSUNG EXYNOS5800 SoC device tree source
3 * 4 *
@@ -7,10 +8,6 @@
7 * SAMSUNG EXYNOS5800 SoC device nodes are listed in this file. 8 * SAMSUNG EXYNOS5800 SoC device nodes are listed in this file.
8 * EXYNOS5800 based board files can include this file and provide 9 * EXYNOS5800 based board files can include this file and provide
9 * values for board specfic bindings. 10 * values for board specfic bindings.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */ 11 */
15 12
16#include "exynos5420.dtsi" 13#include "exynos5420.dtsi"
diff --git a/arch/arm/boot/dts/gemini-dlink-dns-313.dts b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
index 08568ce24d06..403364a7aab9 100644
--- a/arch/arm/boot/dts/gemini-dlink-dns-313.dts
+++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
@@ -78,8 +78,6 @@
78 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>, 78 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
79 <&gpio0 12 GPIO_ACTIVE_HIGH>; 79 <&gpio0 12 GPIO_ACTIVE_HIGH>;
80 gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>; 80 gpio-fan,speed-map = <0 0>, <3000 1>, <6000 2>;
81 cooling-min-level = <0>;
82 cooling-max-level = <2>;
83 #cooling-cells = <2>; 81 #cooling-cells = <2>;
84 }; 82 };
85 83
@@ -269,7 +267,7 @@
269 267
270 sata: sata@46000000 { 268 sata: sata@46000000 {
271 /* The ROM uses this muxmode */ 269 /* The ROM uses this muxmode */
272 cortina,gemini-ata-muxmode = <3>; 270 cortina,gemini-ata-muxmode = <0>;
273 cortina,gemini-enable-sata-bridge; 271 cortina,gemini-enable-sata-bridge;
274 status = "okay"; 272 status = "okay";
275 }; 273 };
diff --git a/arch/arm/boot/dts/imx1-ads.dts b/arch/arm/boot/dts/imx1-ads.dts
index 5ea28ee07cf4..6354e4c87313 100644
--- a/arch/arm/boot/dts/imx1-ads.dts
+++ b/arch/arm/boot/dts/imx1-ads.dts
@@ -20,7 +20,7 @@
20 stdout-path = &uart1; 20 stdout-path = &uart1;
21 }; 21 };
22 22
23 memory { 23 memory@8000000 {
24 reg = <0x08000000 0x04000000>; 24 reg = <0x08000000 0x04000000>;
25 }; 25 };
26 26
diff --git a/arch/arm/boot/dts/imx1-apf9328.dts b/arch/arm/boot/dts/imx1-apf9328.dts
index e8b4b52c2418..11515c0cb195 100644
--- a/arch/arm/boot/dts/imx1-apf9328.dts
+++ b/arch/arm/boot/dts/imx1-apf9328.dts
@@ -20,7 +20,7 @@
20 stdout-path = &uart1; 20 stdout-path = &uart1;
21 }; 21 };
22 22
23 memory { 23 memory@8000000 {
24 reg = <0x08000000 0x00800000>; 24 reg = <0x08000000 0x00800000>;
25 }; 25 };
26}; 26};
diff --git a/arch/arm/boot/dts/imx1.dtsi b/arch/arm/boot/dts/imx1.dtsi
index 20f6565c337d..f7b9edf93f5e 100644
--- a/arch/arm/boot/dts/imx1.dtsi
+++ b/arch/arm/boot/dts/imx1.dtsi
@@ -25,7 +25,7 @@
25 * Also for U-Boot there must be a pre-existing /memory node. 25 * Also for U-Boot there must be a pre-existing /memory node.
26 */ 26 */
27 chosen {}; 27 chosen {};
28 memory { device_type = "memory"; reg = <0 0>; }; 28 memory { device_type = "memory"; };
29 29
30 aliases { 30 aliases {
31 gpio0 = &gpio1; 31 gpio0 = &gpio1;
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index 57e29977ba06..9d92ece82560 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -16,7 +16,7 @@
16 model = "Freescale i.MX23 Evaluation Kit"; 16 model = "Freescale i.MX23 Evaluation Kit";
17 compatible = "fsl,imx23-evk", "fsl,imx23"; 17 compatible = "fsl,imx23-evk", "fsl,imx23";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index a8b1c53ebe46..e9351774c619 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -19,7 +19,7 @@
19 model = "i.MX23 Olinuxino Low Cost Board"; 19 model = "i.MX23 Olinuxino Low Cost Board";
20 compatible = "olimex,imx23-olinuxino", "fsl,imx23"; 20 compatible = "olimex,imx23-olinuxino", "fsl,imx23";
21 21
22 memory { 22 memory@40000000 {
23 reg = <0x40000000 0x04000000>; 23 reg = <0x40000000 0x04000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx23-sansa.dts b/arch/arm/boot/dts/imx23-sansa.dts
index 221fd55e967e..67de7863ad79 100644
--- a/arch/arm/boot/dts/imx23-sansa.dts
+++ b/arch/arm/boot/dts/imx23-sansa.dts
@@ -49,7 +49,7 @@
49 model = "SanDisk Sansa Fuze+"; 49 model = "SanDisk Sansa Fuze+";
50 compatible = "sandisk,sansa_fuze_plus", "fsl,imx23"; 50 compatible = "sandisk,sansa_fuze_plus", "fsl,imx23";
51 51
52 memory { 52 memory@40000000 {
53 reg = <0x40000000 0x04000000>; 53 reg = <0x40000000 0x04000000>;
54 }; 54 };
55 55
diff --git a/arch/arm/boot/dts/imx23-stmp378x_devb.dts b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
index 455169e99d49..95c7b918f6d6 100644
--- a/arch/arm/boot/dts/imx23-stmp378x_devb.dts
+++ b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
@@ -16,7 +16,7 @@
16 model = "Freescale STMP378x Development Board"; 16 model = "Freescale STMP378x Development Board";
17 compatible = "fsl,stmp378x-devb", "fsl,imx23"; 17 compatible = "fsl,stmp378x-devb", "fsl,imx23";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x04000000>; 20 reg = <0x40000000 0x04000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx23-xfi3.dts b/arch/arm/boot/dts/imx23-xfi3.dts
index 025cf949662d..9616e500b996 100644
--- a/arch/arm/boot/dts/imx23-xfi3.dts
+++ b/arch/arm/boot/dts/imx23-xfi3.dts
@@ -48,7 +48,7 @@
48 model = "Creative ZEN X-Fi3"; 48 model = "Creative ZEN X-Fi3";
49 compatible = "creative,x-fi3", "fsl,imx23"; 49 compatible = "creative,x-fi3", "fsl,imx23";
50 50
51 memory { 51 memory@40000000 {
52 reg = <0x40000000 0x04000000>; 52 reg = <0x40000000 0x04000000>;
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 10d57f9cbb42..cb0a3fe32718 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -23,7 +23,7 @@
23 * Also for U-Boot there must be a pre-existing /memory node. 23 * Also for U-Boot there must be a pre-existing /memory node.
24 */ 24 */
25 chosen {}; 25 chosen {};
26 memory { device_type = "memory"; reg = <0 0>; }; 26 memory { device_type = "memory"; };
27 27
28 aliases { 28 aliases {
29 gpio0 = &gpio0; 29 gpio0 = &gpio0;
@@ -222,7 +222,8 @@
222 fsl,pull-up = <MXS_PULL_DISABLE>; 222 fsl,pull-up = <MXS_PULL_DISABLE>;
223 }; 223 };
224 224
225 gpmi_pins_fixup: gpmi-pins-fixup { 225 gpmi_pins_fixup: gpmi-pins-fixup@0 {
226 reg = <0>;
226 fsl,pinmux-ids = < 227 fsl,pinmux-ids = <
227 MX23_PAD_GPMI_WPN__GPMI_WPN 228 MX23_PAD_GPMI_WPN__GPMI_WPN
228 MX23_PAD_GPMI_WRN__GPMI_WRN 229 MX23_PAD_GPMI_WRN__GPMI_WRN
@@ -266,7 +267,8 @@
266 fsl,pull-up = <MXS_PULL_ENABLE>; 267 fsl,pull-up = <MXS_PULL_ENABLE>;
267 }; 268 };
268 269
269 mmc0_pins_fixup: mmc0-pins-fixup { 270 mmc0_pins_fixup: mmc0-pins-fixup@0 {
271 reg = <0>;
270 fsl,pinmux-ids = < 272 fsl,pinmux-ids = <
271 MX23_PAD_SSP1_DETECT__SSP1_DETECT 273 MX23_PAD_SSP1_DETECT__SSP1_DETECT
272 MX23_PAD_SSP1_SCK__SSP1_SCK 274 MX23_PAD_SSP1_SCK__SSP1_SCK
diff --git a/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi b/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi
index d6f27641c0ef..e316fe08837a 100644
--- a/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi
+++ b/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi
@@ -17,7 +17,7 @@
17 model = "Eukrea CPUIMX25"; 17 model = "Eukrea CPUIMX25";
18 compatible = "eukrea,cpuimx25", "fsl,imx25"; 18 compatible = "eukrea,cpuimx25", "fsl,imx25";
19 19
20 memory { 20 memory@80000000 {
21 reg = <0x80000000 0x4000000>; /* 64M */ 21 reg = <0x80000000 0x4000000>; /* 64M */
22 }; 22 };
23}; 23};
diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
index 0f053721d80f..6273a1f243ed 100644
--- a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
@@ -88,12 +88,12 @@
88 88
89 pinctrl_esdhc1: esdhc1grp { 89 pinctrl_esdhc1: esdhc1grp {
90 fsl,pins = < 90 fsl,pins = <
91 MX25_PAD_SD1_CMD__SD1_CMD 0x400000c0 91 MX25_PAD_SD1_CMD__ESDHC1_CMD 0x400000c0
92 MX25_PAD_SD1_CLK__SD1_CLK 0x400000c0 92 MX25_PAD_SD1_CLK__ESDHC1_CLK 0x400000c0
93 MX25_PAD_SD1_DATA0__SD1_DATA0 0x400000c0 93 MX25_PAD_SD1_DATA0__ESDHC1_DAT0 0x400000c0
94 MX25_PAD_SD1_DATA1__SD1_DATA1 0x400000c0 94 MX25_PAD_SD1_DATA1__ESDHC1_DAT1 0x400000c0
95 MX25_PAD_SD1_DATA2__SD1_DATA2 0x400000c0 95 MX25_PAD_SD1_DATA2__ESDHC1_DAT2 0x400000c0
96 MX25_PAD_SD1_DATA3__SD1_DATA3 0x400000c0 96 MX25_PAD_SD1_DATA3__ESDHC1_DAT3 0x400000c0
97 >; 97 >;
98 }; 98 };
99 99
diff --git a/arch/arm/boot/dts/imx25-karo-tx25.dts b/arch/arm/boot/dts/imx25-karo-tx25.dts
index 30a62d4be8d9..5cb6967866c0 100644
--- a/arch/arm/boot/dts/imx25-karo-tx25.dts
+++ b/arch/arm/boot/dts/imx25-karo-tx25.dts
@@ -36,7 +36,7 @@
36 }; 36 };
37 }; 37 };
38 38
39 memory { 39 memory@80000000 {
40 reg = <0x80000000 0x02000000 0x90000000 0x02000000>; 40 reg = <0x80000000 0x02000000 0x90000000 0x02000000>;
41 }; 41 };
42}; 42};
diff --git a/arch/arm/boot/dts/imx25-pdk.dts b/arch/arm/boot/dts/imx25-pdk.dts
index 2d15ce72d006..7f9bd052b84e 100644
--- a/arch/arm/boot/dts/imx25-pdk.dts
+++ b/arch/arm/boot/dts/imx25-pdk.dts
@@ -18,7 +18,7 @@
18 model = "Freescale i.MX25 Product Development Kit"; 18 model = "Freescale i.MX25 Product Development Kit";
19 compatible = "fsl,imx25-pdk", "fsl,imx25"; 19 compatible = "fsl,imx25-pdk", "fsl,imx25";
20 20
21 memory { 21 memory@80000000 {
22 reg = <0x80000000 0x4000000>; 22 reg = <0x80000000 0x4000000>;
23 }; 23 };
24 24
@@ -165,12 +165,12 @@
165 165
166 pinctrl_esdhc1: esdhc1grp { 166 pinctrl_esdhc1: esdhc1grp {
167 fsl,pins = < 167 fsl,pins = <
168 MX25_PAD_SD1_CMD__SD1_CMD 0x80000000 168 MX25_PAD_SD1_CMD__ESDHC1_CMD 0x80000000
169 MX25_PAD_SD1_CLK__SD1_CLK 0x80000000 169 MX25_PAD_SD1_CLK__ESDHC1_CLK 0x80000000
170 MX25_PAD_SD1_DATA0__SD1_DATA0 0x80000000 170 MX25_PAD_SD1_DATA0__ESDHC1_DAT0 0x80000000
171 MX25_PAD_SD1_DATA1__SD1_DATA1 0x80000000 171 MX25_PAD_SD1_DATA1__ESDHC1_DAT1 0x80000000
172 MX25_PAD_SD1_DATA2__SD1_DATA2 0x80000000 172 MX25_PAD_SD1_DATA2__ESDHC1_DAT2 0x80000000
173 MX25_PAD_SD1_DATA3__SD1_DATA3 0x80000000 173 MX25_PAD_SD1_DATA3__ESDHC1_DAT3 0x80000000
174 MX25_PAD_A14__GPIO_2_0 0x80000000 174 MX25_PAD_A14__GPIO_2_0 0x80000000
175 MX25_PAD_A15__GPIO_2_1 0x80000000 175 MX25_PAD_A15__GPIO_2_1 0x80000000
176 >; 176 >;
diff --git a/arch/arm/boot/dts/imx25-pinfunc.h b/arch/arm/boot/dts/imx25-pinfunc.h
index 6c63dca1b9b8..a4807062a90f 100644
--- a/arch/arm/boot/dts/imx25-pinfunc.h
+++ b/arch/arm/boot/dts/imx25-pinfunc.h
@@ -151,21 +151,21 @@
151#define MX25_PAD_D15__D15 0x088 0x280 0x000 0x00 0x000 151#define MX25_PAD_D15__D15 0x088 0x280 0x000 0x00 0x000
152#define MX25_PAD_D15__LD16 0x088 0x280 0x000 0x01 0x000 152#define MX25_PAD_D15__LD16 0x088 0x280 0x000 0x01 0x000
153#define MX25_PAD_D15__GPIO_4_5 0x088 0x280 0x000 0x05 0x000 153#define MX25_PAD_D15__GPIO_4_5 0x088 0x280 0x000 0x05 0x000
154#define MX25_PAD_D15__SDHC1_DAT7 0x088 0x280 0x4d8 0x06 0x000 154#define MX25_PAD_D15__ESDHC1_DAT7 0x088 0x280 0x4d8 0x06 0x000
155 155
156#define MX25_PAD_D14__D14 0x08c 0x284 0x000 0x00 0x000 156#define MX25_PAD_D14__D14 0x08c 0x284 0x000 0x00 0x000
157#define MX25_PAD_D14__LD17 0x08c 0x284 0x000 0x01 0x000 157#define MX25_PAD_D14__LD17 0x08c 0x284 0x000 0x01 0x000
158#define MX25_PAD_D14__GPIO_4_6 0x08c 0x284 0x000 0x05 0x000 158#define MX25_PAD_D14__GPIO_4_6 0x08c 0x284 0x000 0x05 0x000
159#define MX25_PAD_D14__SDHC1_DAT6 0x08c 0x284 0x4d4 0x06 0x000 159#define MX25_PAD_D14__ESDHC1_DAT6 0x08c 0x284 0x4d4 0x06 0x000
160 160
161#define MX25_PAD_D13__D13 0x090 0x288 0x000 0x00 0x000 161#define MX25_PAD_D13__D13 0x090 0x288 0x000 0x00 0x000
162#define MX25_PAD_D13__LD18 0x090 0x288 0x000 0x01 0x000 162#define MX25_PAD_D13__LD18 0x090 0x288 0x000 0x01 0x000
163#define MX25_PAD_D13__GPIO_4_7 0x090 0x288 0x000 0x05 0x000 163#define MX25_PAD_D13__GPIO_4_7 0x090 0x288 0x000 0x05 0x000
164#define MX25_PAD_D13__SDHC1_DAT5 0x090 0x288 0x4d0 0x06 0x000 164#define MX25_PAD_D13__ESDHC1_DAT5 0x090 0x288 0x4d0 0x06 0x000
165 165
166#define MX25_PAD_D12__D12 0x094 0x28c 0x000 0x00 0x000 166#define MX25_PAD_D12__D12 0x094 0x28c 0x000 0x00 0x000
167#define MX25_PAD_D12__GPIO_4_8 0x094 0x28c 0x000 0x05 0x000 167#define MX25_PAD_D12__GPIO_4_8 0x094 0x28c 0x000 0x05 0x000
168#define MX25_PAD_D12__SDHC1_DAT4 0x094 0x28c 0x4cc 0x06 0x000 168#define MX25_PAD_D12__ESDHC1_DAT4 0x094 0x28c 0x4cc 0x06 0x000
169 169
170#define MX25_PAD_D11__D11 0x098 0x290 0x000 0x00 0x000 170#define MX25_PAD_D11__D11 0x098 0x290 0x000 0x00 0x000
171#define MX25_PAD_D11__GPIO_4_9 0x098 0x290 0x000 0x05 0x000 171#define MX25_PAD_D11__GPIO_4_9 0x098 0x290 0x000 0x05 0x000
@@ -236,12 +236,13 @@
236#define MX25_PAD_LD8__LD8 0x0e8 0x2e0 0x000 0x00 0x000 236#define MX25_PAD_LD8__LD8 0x0e8 0x2e0 0x000 0x00 0x000
237#define MX25_PAD_LD8__UART4_RXD 0x0e8 0x2e0 0x570 0x02 0x000 237#define MX25_PAD_LD8__UART4_RXD 0x0e8 0x2e0 0x570 0x02 0x000
238#define MX25_PAD_LD8__FEC_TX_ERR 0x0e8 0x2e0 0x000 0x05 0x000 238#define MX25_PAD_LD8__FEC_TX_ERR 0x0e8 0x2e0 0x000 0x05 0x000
239#define MX25_PAD_LD8__SDHC2_CMD 0x0e8 0x2e0 0x4e0 0x06 0x000 239/* SION must be set; see the comment for MX25_PAD_SD1_CMD__ESDHC1_CMD. */
240#define MX25_PAD_LD8__ESDHC2_CMD 0x0e8 0x2e0 0x4e0 0x16 0x000
240 241
241#define MX25_PAD_LD9__LD9 0x0ec 0x2e4 0x000 0x00 0x000 242#define MX25_PAD_LD9__LD9 0x0ec 0x2e4 0x000 0x00 0x000
242#define MX25_PAD_LD9__UART4_TXD 0x0ec 0x2e4 0x000 0x02 0x000 243#define MX25_PAD_LD9__UART4_TXD 0x0ec 0x2e4 0x000 0x02 0x000
243#define MX25_PAD_LD9__FEC_COL 0x0ec 0x2e4 0x504 0x05 0x001 244#define MX25_PAD_LD9__FEC_COL 0x0ec 0x2e4 0x504 0x05 0x001
244#define MX25_PAD_LD9__SDHC2_CLK 0x0ec 0x2e4 0x4dc 0x06 0x000 245#define MX25_PAD_LD9__ESDHC2_CLK 0x0ec 0x2e4 0x4dc 0x06 0x000
245 246
246#define MX25_PAD_LD10__LD10 0x0f0 0x2e8 0x000 0x00 0x000 247#define MX25_PAD_LD10__LD10 0x0f0 0x2e8 0x000 0x00 0x000
247#define MX25_PAD_LD10__UART4_RTS 0x0f0 0x2e8 0x56c 0x02 0x000 248#define MX25_PAD_LD10__UART4_RTS 0x0f0 0x2e8 0x56c 0x02 0x000
@@ -250,7 +251,7 @@
250#define MX25_PAD_LD11__LD11 0x0f4 0x2ec 0x000 0x00 0x000 251#define MX25_PAD_LD11__LD11 0x0f4 0x2ec 0x000 0x00 0x000
251#define MX25_PAD_LD11__UART4_CTS 0x0f4 0x2ec 0x000 0x02 0x000 252#define MX25_PAD_LD11__UART4_CTS 0x0f4 0x2ec 0x000 0x02 0x000
252#define MX25_PAD_LD11__FEC_RDATA2 0x0f4 0x2ec 0x50c 0x05 0x001 253#define MX25_PAD_LD11__FEC_RDATA2 0x0f4 0x2ec 0x50c 0x05 0x001
253#define MX25_PAD_LD11__SDHC2_DAT1 0x0f4 0x2ec 0x4e8 0x06 0x000 254#define MX25_PAD_LD11__ESDHC2_DAT1 0x0f4 0x2ec 0x4e8 0x06 0x000
254 255
255#define MX25_PAD_LD12__LD12 0x0f8 0x2f0 0x000 0x00 0x000 256#define MX25_PAD_LD12__LD12 0x0f8 0x2f0 0x000 0x00 0x000
256#define MX25_PAD_LD12__CSPI2_MOSI 0x0f8 0x2f0 0x4a0 0x02 0x000 257#define MX25_PAD_LD12__CSPI2_MOSI 0x0f8 0x2f0 0x4a0 0x02 0x000
@@ -316,12 +317,13 @@
316#define MX25_PAD_CSI_D5__CSPI3_RDY 0x12c 0x324 0x000 0x07 0x000 317#define MX25_PAD_CSI_D5__CSPI3_RDY 0x12c 0x324 0x000 0x07 0x000
317 318
318#define MX25_PAD_CSI_D6__CSI_D6 0x130 0x328 0x000 0x00 0x000 319#define MX25_PAD_CSI_D6__CSI_D6 0x130 0x328 0x000 0x00 0x000
319#define MX25_PAD_CSI_D6__SDHC2_CMD 0x130 0x328 0x4e0 0x02 0x001 320/* SION must be set; see the comment for MX25_PAD_SD1_CMD__ESDHC1_CMD. */
321#define MX25_PAD_CSI_D6__ESDHC2_CMD 0x130 0x328 0x4e0 0x12 0x001
320#define MX25_PAD_CSI_D6__SIM1_PD0 0x130 0x328 0x000 0x04 0x000 322#define MX25_PAD_CSI_D6__SIM1_PD0 0x130 0x328 0x000 0x04 0x000
321#define MX25_PAD_CSI_D6__GPIO_1_31 0x130 0x328 0x000 0x05 0x000 323#define MX25_PAD_CSI_D6__GPIO_1_31 0x130 0x328 0x000 0x05 0x000
322 324
323#define MX25_PAD_CSI_D7__CSI_D7 0x134 0x32c 0x000 0x00 0x000 325#define MX25_PAD_CSI_D7__CSI_D7 0x134 0x32c 0x000 0x00 0x000
324#define MX25_PAD_CSI_D7__SDHC2_DAT_CLK 0x134 0x32C 0x4dc 0x02 0x001 326#define MX25_PAD_CSI_D7__ESDHC2_CLK 0x134 0x32C 0x4dc 0x02 0x001
325#define MX25_PAD_CSI_D7__GPIO_1_6 0x134 0x32c 0x000 0x05 0x000 327#define MX25_PAD_CSI_D7__GPIO_1_6 0x134 0x32c 0x000 0x05 0x000
326 328
327#define MX25_PAD_CSI_D8__CSI_D8 0x138 0x330 0x000 0x00 0x000 329#define MX25_PAD_CSI_D8__CSI_D8 0x138 0x330 0x000 0x00 0x000
@@ -336,22 +338,22 @@
336 338
337#define MX25_PAD_CSI_MCLK__CSI_MCLK 0x140 0x338 0x000 0x00 0x000 339#define MX25_PAD_CSI_MCLK__CSI_MCLK 0x140 0x338 0x000 0x00 0x000
338#define MX25_PAD_CSI_MCLK__AUD6_TXD 0x140 0x338 0x000 0x01 0x000 340#define MX25_PAD_CSI_MCLK__AUD6_TXD 0x140 0x338 0x000 0x01 0x000
339#define MX25_PAD_CSI_MCLK__SDHC2_DAT0 0x140 0x338 0x4e4 0x02 0x001 341#define MX25_PAD_CSI_MCLK__ESDHC2_DAT0 0x140 0x338 0x4e4 0x02 0x001
340#define MX25_PAD_CSI_MCLK__GPIO_1_8 0x140 0x338 0x000 0x05 0x000 342#define MX25_PAD_CSI_MCLK__GPIO_1_8 0x140 0x338 0x000 0x05 0x000
341 343
342#define MX25_PAD_CSI_VSYNC__CSI_VSYNC 0x144 0x33c 0x000 0x00 0x000 344#define MX25_PAD_CSI_VSYNC__CSI_VSYNC 0x144 0x33c 0x000 0x00 0x000
343#define MX25_PAD_CSI_VSYNC__AUD6_RXD 0x144 0x33c 0x000 0x01 0x000 345#define MX25_PAD_CSI_VSYNC__AUD6_RXD 0x144 0x33c 0x000 0x01 0x000
344#define MX25_PAD_CSI_VSYNC__SDHC2_DAT1 0x144 0x33c 0x4e8 0x02 0x001 346#define MX25_PAD_CSI_VSYNC__ESDHC2_DAT1 0x144 0x33c 0x4e8 0x02 0x001
345#define MX25_PAD_CSI_VSYNC__GPIO_1_9 0x144 0x33c 0x000 0x05 0x000 347#define MX25_PAD_CSI_VSYNC__GPIO_1_9 0x144 0x33c 0x000 0x05 0x000
346 348
347#define MX25_PAD_CSI_HSYNC__CSI_HSYNC 0x148 0x340 0x000 0x00 0x000 349#define MX25_PAD_CSI_HSYNC__CSI_HSYNC 0x148 0x340 0x000 0x00 0x000
348#define MX25_PAD_CSI_HSYNC__AUD6_TXC 0x148 0x340 0x000 0x01 0x000 350#define MX25_PAD_CSI_HSYNC__AUD6_TXC 0x148 0x340 0x000 0x01 0x000
349#define MX25_PAD_CSI_HSYNC__SDHC2_DAT2 0x148 0x340 0x4ec 0x02 0x001 351#define MX25_PAD_CSI_HSYNC__ESDHC2_DAT2 0x148 0x340 0x4ec 0x02 0x001
350#define MX25_PAD_CSI_HSYNC__GPIO_1_10 0x148 0x340 0x000 0x05 0x000 352#define MX25_PAD_CSI_HSYNC__GPIO_1_10 0x148 0x340 0x000 0x05 0x000
351 353
352#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK 0x14c 0x344 0x000 0x00 0x000 354#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK 0x14c 0x344 0x000 0x00 0x000
353#define MX25_PAD_CSI_PIXCLK__AUD6_TXFS 0x14c 0x344 0x000 0x01 0x000 355#define MX25_PAD_CSI_PIXCLK__AUD6_TXFS 0x14c 0x344 0x000 0x01 0x000
354#define MX25_PAD_CSI_PIXCLK__SDHC2_DAT3 0x14c 0x344 0x4f0 0x02 0x001 356#define MX25_PAD_CSI_PIXCLK__ESDHC2_DAT3 0x14c 0x344 0x4f0 0x02 0x001
355#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 0x14c 0x344 0x000 0x05 0x000 357#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 0x14c 0x344 0x000 0x05 0x000
356 358
357#define MX25_PAD_I2C1_CLK__I2C1_CLK 0x150 0x348 0x000 0x00 0x000 359#define MX25_PAD_I2C1_CLK__I2C1_CLK 0x150 0x348 0x000 0x00 0x000
@@ -419,37 +421,37 @@
419#define MX25_PAD_UART2_CTS__GPIO_4_29 0x18c 0x384 0x000 0x05 0x000 421#define MX25_PAD_UART2_CTS__GPIO_4_29 0x18c 0x384 0x000 0x05 0x000
420 422
421/* 423/*
422 * Removing the SION bit from MX25_PAD_SD1_CMD__SD1_CMD breaks detecting an SD 424 * Removing the SION bit from MX25_PAD_*__ESDHCn_CMD breaks detecting an SD
423 * card. According to the i.MX25 reference manual (e.g. Figure 23-2 in IMX25RM 425 * card. According to the i.MX25 reference manual (e.g. Figure 23-2 in IMX25RM
424 * Rev. 2 from 01/2011) this pin is bidirectional. So it seems to be a silicon 426 * Rev. 2 from 01/2011) this pin is bidirectional. So it seems to be a silicon
425 * bug that configuring the SD1_CMD function doesn't enable the input path for 427 * bug that configuring the ESDHCn_CMD function doesn't enable the input path
426 * this pin. 428 * for this pin.
427 * This might have side effects for other hardware units that are connected to 429 * This might have side effects for other hardware units that are connected to
428 * that pin and use the respective function as input. 430 * that pin and use the respective function as input.
429 */ 431 */
430#define MX25_PAD_SD1_CMD__SD1_CMD 0x190 0x388 0x000 0x10 0x000 432#define MX25_PAD_SD1_CMD__ESDHC1_CMD 0x190 0x388 0x000 0x10 0x000
431#define MX25_PAD_SD1_CMD__CSPI2_MOSI 0x190 0x388 0x4a0 0x01 0x001 433#define MX25_PAD_SD1_CMD__CSPI2_MOSI 0x190 0x388 0x4a0 0x01 0x001
432#define MX25_PAD_SD1_CMD__FEC_RDATA2 0x190 0x388 0x50c 0x02 0x002 434#define MX25_PAD_SD1_CMD__FEC_RDATA2 0x190 0x388 0x50c 0x02 0x002
433#define MX25_PAD_SD1_CMD__GPIO_2_23 0x190 0x388 0x000 0x05 0x000 435#define MX25_PAD_SD1_CMD__GPIO_2_23 0x190 0x388 0x000 0x05 0x000
434 436
435#define MX25_PAD_SD1_CLK__SD1_CLK 0x194 0x38c 0x000 0x00 0x000 437#define MX25_PAD_SD1_CLK__ESDHC1_CLK 0x194 0x38c 0x000 0x00 0x000
436#define MX25_PAD_SD1_CLK__CSPI2_MISO 0x194 0x38c 0x49c 0x01 0x001 438#define MX25_PAD_SD1_CLK__CSPI2_MISO 0x194 0x38c 0x49c 0x01 0x001
437#define MX25_PAD_SD1_CLK__FEC_RDATA3 0x194 0x38c 0x510 0x02 0x002 439#define MX25_PAD_SD1_CLK__FEC_RDATA3 0x194 0x38c 0x510 0x02 0x002
438#define MX25_PAD_SD1_CLK__GPIO_2_24 0x194 0x38c 0x000 0x05 0x000 440#define MX25_PAD_SD1_CLK__GPIO_2_24 0x194 0x38c 0x000 0x05 0x000
439 441
440#define MX25_PAD_SD1_DATA0__SD1_DATA0 0x198 0x390 0x000 0x00 0x000 442#define MX25_PAD_SD1_DATA0__ESDHC1_DAT0 0x198 0x390 0x000 0x00 0x000
441#define MX25_PAD_SD1_DATA0__CSPI2_SCLK 0x198 0x390 0x494 0x01 0x001 443#define MX25_PAD_SD1_DATA0__CSPI2_SCLK 0x198 0x390 0x494 0x01 0x001
442#define MX25_PAD_SD1_DATA0__GPIO_2_25 0x198 0x390 0x000 0x05 0x000 444#define MX25_PAD_SD1_DATA0__GPIO_2_25 0x198 0x390 0x000 0x05 0x000
443 445
444#define MX25_PAD_SD1_DATA1__SD1_DATA1 0x19c 0x394 0x000 0x00 0x000 446#define MX25_PAD_SD1_DATA1__ESDHC1_DAT1 0x19c 0x394 0x000 0x00 0x000
445#define MX25_PAD_SD1_DATA1__AUD7_RXD 0x19c 0x394 0x478 0x03 0x000 447#define MX25_PAD_SD1_DATA1__AUD7_RXD 0x19c 0x394 0x478 0x03 0x000
446#define MX25_PAD_SD1_DATA1__GPIO_2_26 0x19c 0x394 0x000 0x05 0x000 448#define MX25_PAD_SD1_DATA1__GPIO_2_26 0x19c 0x394 0x000 0x05 0x000
447 449
448#define MX25_PAD_SD1_DATA2__SD1_DATA2 0x1a0 0x398 0x000 0x00 0x000 450#define MX25_PAD_SD1_DATA2__ESDHC1_DAT2 0x1a0 0x398 0x000 0x00 0x000
449#define MX25_PAD_SD1_DATA2__FEC_RX_CLK 0x1a0 0x398 0x514 0x02 0x002 451#define MX25_PAD_SD1_DATA2__FEC_RX_CLK 0x1a0 0x398 0x514 0x02 0x002
450#define MX25_PAD_SD1_DATA2__GPIO_2_27 0x1a0 0x398 0x000 0x05 0x000 452#define MX25_PAD_SD1_DATA2__GPIO_2_27 0x1a0 0x398 0x000 0x05 0x000
451 453
452#define MX25_PAD_SD1_DATA3__SD1_DATA3 0x1a4 0x39c 0x000 0x00 0x000 454#define MX25_PAD_SD1_DATA3__ESDHC1_DAT3 0x1a4 0x39c 0x000 0x00 0x000
453#define MX25_PAD_SD1_DATA3__FEC_CRS 0x1a4 0x39c 0x508 0x02 0x002 455#define MX25_PAD_SD1_DATA3__FEC_CRS 0x1a4 0x39c 0x508 0x02 0x002
454#define MX25_PAD_SD1_DATA3__GPIO_2_28 0x1a4 0x39c 0x000 0x05 0x000 456#define MX25_PAD_SD1_DATA3__GPIO_2_28 0x1a4 0x39c 0x000 0x05 0x000
455 457
@@ -496,6 +498,8 @@
496#define MX25_PAD_KPP_COL3__GPIO_3_4 0x1c4 0x3bc 0x000 0x05 0x000 498#define MX25_PAD_KPP_COL3__GPIO_3_4 0x1c4 0x3bc 0x000 0x05 0x000
497 499
498#define MX25_PAD_FEC_MDC__FEC_MDC 0x1c8 0x3c0 0x000 0x00 0x000 500#define MX25_PAD_FEC_MDC__FEC_MDC 0x1c8 0x3c0 0x000 0x00 0x000
501/* SION must be set; see the comment for MX25_PAD_SD1_CMD__ESDHC1_CMD. */
502#define MX25_PAD_FEC_MDC__ESDHC2_CMD 0x1c8 0x3c0 0x4e0 0x11 0x002
499#define MX25_PAD_FEC_MDC__AUD4_TXD 0x1c8 0x3c0 0x464 0x02 0x001 503#define MX25_PAD_FEC_MDC__AUD4_TXD 0x1c8 0x3c0 0x464 0x02 0x001
500#define MX25_PAD_FEC_MDC__GPIO_3_5 0x1c8 0x3c0 0x000 0x05 0x000 504#define MX25_PAD_FEC_MDC__GPIO_3_5 0x1c8 0x3c0 0x000 0x05 0x000
501 505
@@ -601,4 +605,28 @@
601#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 0x228 0x000 0x000 0x00 0x000 605#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 0x228 0x000 0x000 0x00 0x000
602#define MX25_PAD_BOOT_MODE1__GPIO_4_31 0x228 0x000 0x000 0x05 0x000 606#define MX25_PAD_BOOT_MODE1__GPIO_4_31 0x228 0x000 0x000 0x05 0x000
603 607
608/*
609 * Compatibility defines for out-of-tree users. You should update if you make
610 * use of one of them.
611 */
612#define MX25_PAD_D15__SDHC1_DAT7 MX25_PAD_D15__ESDHC1_DAT7
613#define MX25_PAD_D14__SDHC1_DAT6 MX25_PAD_D14__ESDHC1_DAT6
614#define MX25_PAD_D13__SDHC1_DAT5 MX25_PAD_D13__ESDHC1_DAT5
615#define MX25_PAD_D12__SDHC1_DAT4 MX25_PAD_D12__ESDHC1_DAT4
616#define MX25_PAD_LD8__SDHC2_CMD MX25_PAD_LD8__ESDHC2_CMD
617#define MX25_PAD_LD9__SDHC2_CLK MX25_PAD_LD9__ESDHC2_CLK
618#define MX25_PAD_LD11__SDHC2_DAT1 MX25_PAD_LD11__ESDHC2_DAT1
619#define MX25_PAD_CSI_D6__SDHC2_CMD MX25_PAD_CSI_D6__ESDHC2_CMD
620#define MX25_PAD_CSI_D7__SDHC2_DAT_CLK MX25_PAD_CSI_D7__ESDHC2_CLK
621#define MX25_PAD_CSI_MCLK__SDHC2_DAT0 MX25_PAD_CSI_MCLK__ESDHC2_DAT0
622#define MX25_PAD_CSI_VSYNC__SDHC2_DAT1 MX25_PAD_CSI_VSYNC__ESDHC2_DAT1
623#define MX25_PAD_CSI_HSYNC__SDHC2_DAT2 MX25_PAD_CSI_HSYNC__ESDHC2_DAT2
624#define MX25_PAD_CSI_PIXCLK__SDHC2_DAT3 MX25_PAD_CSI_PIXCLK__ESDHC2_DAT3
625#define MX25_PAD_SD1_CMD__SD1_CMD MX25_PAD_SD1_CMD__ESDHC1_CMD
626#define MX25_PAD_SD1_CLK__SD1_CLK MX25_PAD_SD1_CLK__ESDHC1_CLK
627#define MX25_PAD_SD1_DATA0__SD1_DATA0 MX25_PAD_SD1_DATA0__ESDHC1_DAT0
628#define MX25_PAD_SD1_DATA1__SD1_DATA1 MX25_PAD_SD1_DATA1__ESDHC1_DAT1
629#define MX25_PAD_SD1_DATA2__SD1_DATA2 MX25_PAD_SD1_DATA2__ESDHC1_DAT2
630#define MX25_PAD_SD1_DATA3__SD1_DATA3 MX25_PAD_SD1_DATA3__ESDHC1_DAT3
631
604#endif /* __DTS_IMX25_PINFUNC_H */ 632#endif /* __DTS_IMX25_PINFUNC_H */
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index 9445f8e1473c..cf70df20b19c 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -22,7 +22,7 @@
22 * Also for U-Boot there must be a pre-existing /memory node. 22 * Also for U-Boot there must be a pre-existing /memory node.
23 */ 23 */
24 chosen {}; 24 chosen {};
25 memory { device_type = "memory"; reg = <0 0>; }; 25 memory { device_type = "memory"; };
26 26
27 aliases { 27 aliases {
28 ethernet0 = &fec; 28 ethernet0 = &fec;
@@ -269,6 +269,7 @@
269 dmas = <&sdma 24 1 0>, 269 dmas = <&sdma 24 1 0>,
270 <&sdma 25 1 0>; 270 <&sdma 25 1 0>;
271 dma-names = "rx", "tx"; 271 dma-names = "rx", "tx";
272 fsl,fifo-depth = <15>;
272 status = "disabled"; 273 status = "disabled";
273 }; 274 };
274 275
@@ -329,6 +330,7 @@
329 dmas = <&sdma 28 1 0>, 330 dmas = <&sdma 28 1 0>,
330 <&sdma 29 1 0>; 331 <&sdma 29 1 0>;
331 dma-names = "rx", "tx"; 332 dma-names = "rx", "tx";
333 fsl,fifo-depth = <15>;
332 status = "disabled"; 334 status = "disabled";
333 }; 335 };
334 336
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts
index 73aae4f5e539..66941cdbf244 100644
--- a/arch/arm/boot/dts/imx27-apf27.dts
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -19,7 +19,7 @@
19 model = "Armadeus Systems APF27 module"; 19 model = "Armadeus Systems APF27 module";
20 compatible = "armadeus,imx27-apf27", "fsl,imx27"; 20 compatible = "armadeus,imx27-apf27", "fsl,imx27";
21 21
22 memory { 22 memory@a0000000 {
23 reg = <0xa0000000 0x04000000>; 23 reg = <0xa0000000 0x04000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi b/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
index 2cf896c505f9..9c455dcbe6eb 100644
--- a/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
+++ b/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
@@ -16,21 +16,14 @@
16 model = "Eukrea CPUIMX27"; 16 model = "Eukrea CPUIMX27";
17 compatible = "eukrea,cpuimx27", "fsl,imx27"; 17 compatible = "eukrea,cpuimx27", "fsl,imx27";
18 18
19 memory { 19 memory@a0000000 {
20 reg = <0xa0000000 0x04000000>; 20 reg = <0xa0000000 0x04000000>;
21 }; 21 };
22 22
23 clocks { 23 clk14745600: clk-uart {
24 #address-cells = <1>; 24 compatible = "fixed-clock";
25 #size-cells = <0>; 25 #clock-cells = <0>;
26 compatible = "simple-bus"; 26 clock-frequency = <14745600>;
27
28 clk14745600: clock@0 {
29 #clock-cells = <0>;
30 compatible = "fixed-clock";
31 clock-frequency = <14745600>;
32 reg = <0>;
33 };
34 }; 27 };
35}; 28};
36 29
diff --git a/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts b/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
index f56535768ee8..15145e7f9778 100644
--- a/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
+++ b/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
@@ -84,7 +84,7 @@
84 cs-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>; 84 cs-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
85 status = "okay"; 85 status = "okay";
86 86
87 ads7846 { 87 ads7846@0 {
88 compatible = "ti,ads7846"; 88 compatible = "ti,ads7846";
89 pinctrl-names = "default"; 89 pinctrl-names = "default";
90 pinctrl-0 = <&pinctrl_touch>; 90 pinctrl-0 = <&pinctrl_touch>;
diff --git a/arch/arm/boot/dts/imx27-pdk.dts b/arch/arm/boot/dts/imx27-pdk.dts
index 2a140c8ae6d2..924b90c9985d 100644
--- a/arch/arm/boot/dts/imx27-pdk.dts
+++ b/arch/arm/boot/dts/imx27-pdk.dts
@@ -16,7 +16,7 @@
16 model = "Freescale i.MX27 Product Development Kit"; 16 model = "Freescale i.MX27 Product Development Kit";
17 compatible = "fsl,imx27-pdk", "fsl,imx27"; 17 compatible = "fsl,imx27-pdk", "fsl,imx27";
18 18
19 memory { 19 memory@a0000000 {
20 reg = <0xa0000000 0x08000000>; 20 reg = <0xa0000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi
index 0b8490b21a38..cbad7c88c58c 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi
+++ b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi
@@ -17,7 +17,7 @@
17 model = "Phytec pca100"; 17 model = "Phytec pca100";
18 compatible = "phytec,imx27-pca100", "fsl,imx27"; 18 compatible = "phytec,imx27-pca100", "fsl,imx27";
19 19
20 memory { 20 memory@a0000000 {
21 reg = <0xa0000000 0x08000000>; /* 128MB */ 21 reg = <0xa0000000 0x08000000>; /* 128MB */
22 }; 22 };
23}; 23};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
index c9095b7654c6..ec466b4bfd41 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
+++ b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
@@ -16,7 +16,7 @@
16 model = "Phytec pcm038"; 16 model = "Phytec pcm038";
17 compatible = "phytec,imx27-pcm038", "fsl,imx27"; 17 compatible = "phytec,imx27-pcm038", "fsl,imx27";
18 18
19 memory { 19 memory@a0000000 {
20 reg = <0xa0000000 0x08000000>; 20 reg = <0xa0000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 15d85f1f85fd..6585b00c3917 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -26,7 +26,7 @@
26 * Also for U-Boot there must be a pre-existing /memory node. 26 * Also for U-Boot there must be a pre-existing /memory node.
27 */ 27 */
28 chosen {}; 28 chosen {};
29 memory { device_type = "memory"; reg = <0 0>; }; 29 memory { device_type = "memory"; };
30 30
31 aliases { 31 aliases {
32 ethernet0 = &fec; 32 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx28-apf28.dts b/arch/arm/boot/dts/imx28-apf28.dts
index 070e59cbdd8b..bab78346fa9f 100644
--- a/arch/arm/boot/dts/imx28-apf28.dts
+++ b/arch/arm/boot/dts/imx28-apf28.dts
@@ -16,7 +16,7 @@
16 model = "Armadeus Systems APF28 module"; 16 model = "Armadeus Systems APF28 module";
17 compatible = "armadeus,imx28-apf28", "fsl,imx28"; 17 compatible = "armadeus,imx28-apf28", "fsl,imx28";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index ae078341fb60..96faa53ba44c 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -6,7 +6,7 @@
6 model = "Bluegiga APX4 Development Kit"; 6 model = "Bluegiga APX4 Development Kit";
7 compatible = "bluegiga,apx4devkit", "fsl,imx28"; 7 compatible = "bluegiga,apx4devkit", "fsl,imx28";
8 8
9 memory { 9 memory@40000000 {
10 reg = <0x40000000 0x04000000>; 10 reg = <0x40000000 0x04000000>;
11 }; 11 };
12 12
@@ -82,7 +82,8 @@
82 fsl,pull-up = <MXS_PULL_ENABLE>; 82 fsl,pull-up = <MXS_PULL_ENABLE>;
83 }; 83 };
84 84
85 mmc2_sck_cfg_apx4: mmc2-sck-cfg-apx4 { 85 mmc2_sck_cfg_apx4: mmc2-sck-cfg-apx4@0 {
86 reg = <0>;
86 fsl,pinmux-ids = < 87 fsl,pinmux-ids = <
87 MX28_PAD_SSP0_DATA7__SSP2_SCK 88 MX28_PAD_SSP0_DATA7__SSP2_SCK
88 >; 89 >;
@@ -146,6 +147,7 @@
146 sgtl5000: codec@a { 147 sgtl5000: codec@a {
147 compatible = "fsl,sgtl5000"; 148 compatible = "fsl,sgtl5000";
148 reg = <0x0a>; 149 reg = <0x0a>;
150 #sound-dai-cells = <0>;
149 VDDA-supply = <&reg_3p3v>; 151 VDDA-supply = <&reg_3p3v>;
150 VDDIO-supply = <&reg_3p3v>; 152 VDDIO-supply = <&reg_3p3v>;
151 clocks = <&saif0>; 153 clocks = <&saif0>;
diff --git a/arch/arm/boot/dts/imx28-cfa10036.dts b/arch/arm/boot/dts/imx28-cfa10036.dts
index 570aa339a05e..e54f5aba7091 100644
--- a/arch/arm/boot/dts/imx28-cfa10036.dts
+++ b/arch/arm/boot/dts/imx28-cfa10036.dts
@@ -16,7 +16,7 @@
16 model = "Crystalfontz CFA-10036 Board"; 16 model = "Crystalfontz CFA-10036 Board";
17 compatible = "crystalfontz,cfa10036", "fsl,imx28"; 17 compatible = "crystalfontz,cfa10036", "fsl,imx28";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index 4cd52d53cf00..60e5c7fd5035 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -19,6 +19,71 @@
19 model = "Crystalfontz CFA-10049 Board"; 19 model = "Crystalfontz CFA-10049 Board";
20 compatible = "crystalfontz,cfa10049", "crystalfontz,cfa10036", "fsl,imx28"; 20 compatible = "crystalfontz,cfa10049", "crystalfontz,cfa10036", "fsl,imx28";
21 21
22 i2cmux {
23 compatible = "i2c-mux-gpio";
24 #address-cells = <1>;
25 #size-cells = <0>;
26 pinctrl-names = "default";
27 pinctrl-0 = <&i2cmux_pins_cfa10049>;
28 mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
29 i2c-parent = <&i2c1>;
30
31 i2c@0 {
32 #address-cells = <1>;
33 #size-cells = <0>;
34 reg = <0>;
35
36 adc0: nau7802@2a {
37 compatible = "nuvoton,nau7802";
38 reg = <0x2a>;
39 nuvoton,vldo = <3000>;
40 };
41 };
42
43 i2c@1 {
44 #address-cells = <1>;
45 #size-cells = <0>;
46 reg = <1>;
47
48 adc1: nau7802@2a {
49 compatible = "nuvoton,nau7802";
50 reg = <0x2a>;
51 nuvoton,vldo = <3000>;
52 };
53 };
54
55 i2c@2 {
56 #address-cells = <1>;
57 #size-cells = <0>;
58 reg = <2>;
59
60 adc2: nau7802@2a {
61 compatible = "nuvoton,nau7802";
62 reg = <0x2a>;
63 nuvoton,vldo = <3000>;
64 };
65 };
66
67 i2c@3 {
68 reg = <3>;
69 #address-cells = <1>;
70 #size-cells = <0>;
71
72 pca9555: pca9555@20 {
73 compatible = "nxp,pca9555";
74 pinctrl-names = "default";
75 pinctrl-0 = <&pca_pins_cfa10049>;
76 interrupt-parent = <&gpio2>;
77 interrupts = <19 0x2>;
78 gpio-controller;
79 #gpio-cells = <2>;
80 interrupt-controller;
81 #interrupt-cells = <2>;
82 reg = <0x20>;
83 };
84 };
85 };
86
22 apb@80000000 { 87 apb@80000000 {
23 apbh@80000000 { 88 apbh@80000000 {
24 pinctrl@80018000 { 89 pinctrl@80018000 {
@@ -219,71 +284,6 @@
219 status = "okay"; 284 status = "okay";
220 }; 285 };
221 286
222 i2cmux {
223 compatible = "i2c-mux-gpio";
224 #address-cells = <1>;
225 #size-cells = <0>;
226 pinctrl-names = "default";
227 pinctrl-0 = <&i2cmux_pins_cfa10049>;
228 mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
229 i2c-parent = <&i2c1>;
230
231 i2c@0 {
232 #address-cells = <1>;
233 #size-cells = <0>;
234 reg = <0>;
235
236 adc0: nau7802@2a {
237 compatible = "nuvoton,nau7802";
238 reg = <0x2a>;
239 nuvoton,vldo = <3000>;
240 };
241 };
242
243 i2c@1 {
244 #address-cells = <1>;
245 #size-cells = <0>;
246 reg = <1>;
247
248 adc1: nau7802@2a {
249 compatible = "nuvoton,nau7802";
250 reg = <0x2a>;
251 nuvoton,vldo = <3000>;
252 };
253 };
254
255 i2c@2 {
256 #address-cells = <1>;
257 #size-cells = <0>;
258 reg = <2>;
259
260 adc2: nau7802@2a {
261 compatible = "nuvoton,nau7802";
262 reg = <0x2a>;
263 nuvoton,vldo = <3000>;
264 };
265 };
266
267 i2c@3 {
268 reg = <3>;
269 #address-cells = <1>;
270 #size-cells = <0>;
271
272 pca9555: pca9555@20 {
273 compatible = "nxp,pca9555";
274 pinctrl-names = "default";
275 pinctrl-0 = <&pca_pins_cfa10049>;
276 interrupt-parent = <&gpio2>;
277 interrupts = <19 0x2>;
278 gpio-controller;
279 #gpio-cells = <2>;
280 interrupt-controller;
281 #interrupt-cells = <2>;
282 reg = <0x20>;
283 };
284 };
285 };
286
287 usbphy1: usbphy@8007e000 { 287 usbphy1: usbphy@8007e000 {
288 status = "okay"; 288 status = "okay";
289 }; 289 };
diff --git a/arch/arm/boot/dts/imx28-duckbill-2-485.dts b/arch/arm/boot/dts/imx28-duckbill-2-485.dts
index bd3fd470f9c3..97084e463d7c 100644
--- a/arch/arm/boot/dts/imx28-duckbill-2-485.dts
+++ b/arch/arm/boot/dts/imx28-duckbill-2-485.dts
@@ -19,7 +19,7 @@
19 model = "I2SE Duckbill 2 485"; 19 model = "I2SE Duckbill 2 485";
20 compatible = "i2se,duckbill-2-485", "i2se,duckbill-2", "fsl,imx28"; 20 compatible = "i2se,duckbill-2-485", "i2se,duckbill-2", "fsl,imx28";
21 21
22 memory { 22 memory@40000000 {
23 reg = <0x40000000 0x08000000>; 23 reg = <0x40000000 0x08000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx28-duckbill-2-enocean.dts b/arch/arm/boot/dts/imx28-duckbill-2-enocean.dts
index 4450047885eb..7f8d40a9c67e 100644
--- a/arch/arm/boot/dts/imx28-duckbill-2-enocean.dts
+++ b/arch/arm/boot/dts/imx28-duckbill-2-enocean.dts
@@ -20,7 +20,7 @@
20 model = "I2SE Duckbill 2 EnOcean"; 20 model = "I2SE Duckbill 2 EnOcean";
21 compatible = "i2se,duckbill-2-enocean", "i2se,duckbill-2", "fsl,imx28"; 21 compatible = "i2se,duckbill-2-enocean", "i2se,duckbill-2", "fsl,imx28";
22 22
23 memory { 23 memory@40000000 {
24 reg = <0x40000000 0x08000000>; 24 reg = <0x40000000 0x08000000>;
25 }; 25 };
26 26
diff --git a/arch/arm/boot/dts/imx28-duckbill-2-spi.dts b/arch/arm/boot/dts/imx28-duckbill-2-spi.dts
index 927732efca98..13e7b134da9e 100644
--- a/arch/arm/boot/dts/imx28-duckbill-2-spi.dts
+++ b/arch/arm/boot/dts/imx28-duckbill-2-spi.dts
@@ -23,7 +23,7 @@
23 ethernet1 = &qca7000; 23 ethernet1 = &qca7000;
24 }; 24 };
25 25
26 memory { 26 memory@40000000 {
27 reg = <0x40000000 0x08000000>; 27 reg = <0x40000000 0x08000000>;
28 }; 28 };
29 29
diff --git a/arch/arm/boot/dts/imx28-duckbill-2.dts b/arch/arm/boot/dts/imx28-duckbill-2.dts
index 7fa3d759505c..88556c93b00f 100644
--- a/arch/arm/boot/dts/imx28-duckbill-2.dts
+++ b/arch/arm/boot/dts/imx28-duckbill-2.dts
@@ -19,7 +19,7 @@
19 model = "I2SE Duckbill 2"; 19 model = "I2SE Duckbill 2";
20 compatible = "i2se,duckbill-2", "fsl,imx28"; 20 compatible = "i2se,duckbill-2", "fsl,imx28";
21 21
22 memory { 22 memory@40000000 {
23 reg = <0x40000000 0x08000000>; 23 reg = <0x40000000 0x08000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx28-duckbill.dts b/arch/arm/boot/dts/imx28-duckbill.dts
index 3e4385d4ed78..f286bfe699be 100644
--- a/arch/arm/boot/dts/imx28-duckbill.dts
+++ b/arch/arm/boot/dts/imx28-duckbill.dts
@@ -18,7 +18,7 @@
18 model = "I2SE Duckbill"; 18 model = "I2SE Duckbill";
19 compatible = "i2se,duckbill", "fsl,imx28"; 19 compatible = "i2se,duckbill", "fsl,imx28";
20 20
21 memory { 21 memory@40000000 {
22 reg = <0x40000000 0x08000000>; 22 reg = <0x40000000 0x08000000>;
23 }; 23 };
24 24
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts b/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts
index 7c1572c5a4fb..b70f3349c350 100644
--- a/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts
@@ -23,7 +23,7 @@
23 model = "Eukrea Electromatique MBMX283LC"; 23 model = "Eukrea Electromatique MBMX283LC";
24 compatible = "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28"; 24 compatible = "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28";
25 25
26 memory { 26 memory@40000000 {
27 reg = <0x40000000 0x04000000>; 27 reg = <0x40000000 0x04000000>;
28 }; 28 };
29}; 29};
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts b/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts
index b61fd61eb1c7..65efb78ac040 100644
--- a/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts
@@ -22,7 +22,7 @@
22 model = "Eukrea Electromatique MBMX287LC"; 22 model = "Eukrea Electromatique MBMX287LC";
23 compatible = "eukrea,mbmx287lc", "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28"; 23 compatible = "eukrea,mbmx287lc", "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28";
24 24
25 memory { 25 memory@40000000 {
26 reg = <0x40000000 0x08000000>; 26 reg = <0x40000000 0x08000000>;
27 }; 27 };
28}; 28};
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi b/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi
index 49ab40838e69..ff1328ce7d37 100644
--- a/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi
@@ -151,6 +151,7 @@
151 sgtl5000: codec@a { 151 sgtl5000: codec@a {
152 compatible = "fsl,sgtl5000"; 152 compatible = "fsl,sgtl5000";
153 reg = <0x0a>; 153 reg = <0x0a>;
154 #sound-dai-cells = <0>;
154 VDDA-supply = <&reg_3p3v>; 155 VDDA-supply = <&reg_3p3v>;
155 VDDIO-supply = <&reg_3p3v>; 156 VDDIO-supply = <&reg_3p3v>;
156 clocks = <&saif0>; 157 clocks = <&saif0>;
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 7f5b80402c54..b0d39654aeb3 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -16,7 +16,7 @@
16 model = "Freescale i.MX28 Evaluation Kit"; 16 model = "Freescale i.MX28 Evaluation Kit";
17 compatible = "fsl,imx28-evk", "fsl,imx28"; 17 compatible = "fsl,imx28-evk", "fsl,imx28";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
@@ -197,6 +197,7 @@
197 sgtl5000: codec@a { 197 sgtl5000: codec@a {
198 compatible = "fsl,sgtl5000"; 198 compatible = "fsl,sgtl5000";
199 reg = <0x0a>; 199 reg = <0x0a>;
200 #sound-dai-cells = <0>;
200 VDDA-supply = <&reg_3p3v>; 201 VDDA-supply = <&reg_3p3v>;
201 VDDIO-supply = <&reg_3p3v>; 202 VDDIO-supply = <&reg_3p3v>;
202 clocks = <&saif0>; 203 clocks = <&saif0>;
diff --git a/arch/arm/boot/dts/imx28-m28.dtsi b/arch/arm/boot/dts/imx28-m28.dtsi
index a69856e41ba4..0ec415e1ff58 100644
--- a/arch/arm/boot/dts/imx28-m28.dtsi
+++ b/arch/arm/boot/dts/imx28-m28.dtsi
@@ -15,7 +15,7 @@
15 model = "Aries/DENX M28"; 15 model = "Aries/DENX M28";
16 compatible = "aries,m28", "denx,m28", "fsl,imx28"; 16 compatible = "aries,m28", "denx,m28", "fsl,imx28";
17 17
18 memory { 18 memory@40000000 {
19 reg = <0x40000000 0x08000000>; 19 reg = <0x40000000 0x08000000>;
20 }; 20 };
21 21
diff --git a/arch/arm/boot/dts/imx28-m28cu3.dts b/arch/arm/boot/dts/imx28-m28cu3.dts
index 9d6c8fe28d74..3bb5ffc644d6 100644
--- a/arch/arm/boot/dts/imx28-m28cu3.dts
+++ b/arch/arm/boot/dts/imx28-m28cu3.dts
@@ -16,7 +16,7 @@
16 model = "MSR M28CU3"; 16 model = "MSR M28CU3";
17 compatible = "msr,m28cu3", "fsl,imx28"; 17 compatible = "msr,m28cu3", "fsl,imx28";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index 22aa025cab1e..7d97a0ce74a3 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -140,6 +140,7 @@
140 sgtl5000: codec@a { 140 sgtl5000: codec@a {
141 compatible = "fsl,sgtl5000"; 141 compatible = "fsl,sgtl5000";
142 reg = <0x0a>; 142 reg = <0x0a>;
143 #sound-dai-cells = <0>;
143 VDDA-supply = <&reg_3p3v>; 144 VDDA-supply = <&reg_3p3v>;
144 VDDIO-supply = <&reg_3p3v>; 145 VDDIO-supply = <&reg_3p3v>;
145 clocks = <&saif0>; 146 clocks = <&saif0>;
diff --git a/arch/arm/boot/dts/imx28-sps1.dts b/arch/arm/boot/dts/imx28-sps1.dts
index 0ce3cb8e7914..2393e83979e0 100644
--- a/arch/arm/boot/dts/imx28-sps1.dts
+++ b/arch/arm/boot/dts/imx28-sps1.dts
@@ -16,7 +16,7 @@
16 model = "SchulerControl GmbH, SC SPS 1"; 16 model = "SchulerControl GmbH, SC SPS 1";
17 compatible = "schulercontrol,imx28-sps1", "fsl,imx28"; 17 compatible = "schulercontrol,imx28-sps1", "fsl,imx28";
18 18
19 memory { 19 memory@40000000 {
20 reg = <0x40000000 0x08000000>; 20 reg = <0x40000000 0x08000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx28-ts4600.dts b/arch/arm/boot/dts/imx28-ts4600.dts
index 1e391c9f1b7a..f8a09a8c2c36 100644
--- a/arch/arm/boot/dts/imx28-ts4600.dts
+++ b/arch/arm/boot/dts/imx28-ts4600.dts
@@ -19,7 +19,7 @@
19 model = "Technologic Systems i.MX28 TS-4600"; 19 model = "Technologic Systems i.MX28 TS-4600";
20 compatible = "technologic,imx28-ts4600", "fsl,imx28"; 20 compatible = "technologic,imx28-ts4600", "fsl,imx28";
21 21
22 memory { 22 memory@40000000 {
23 reg = <0x40000000 0x10000000>; /* 256MB */ 23 reg = <0x40000000 0x10000000>; /* 256MB */
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index 152621ea37db..687186358c18 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -65,8 +65,8 @@
65 usbotg = &usb0; 65 usbotg = &usb0;
66 }; 66 };
67 67
68 memory { 68 memory@40000000 {
69 reg = <0 0>; /* will be filled in by U-Boot */ 69 reg = <0x40000000 0>; /* will be filled in by U-Boot */
70 }; 70 };
71 71
72 onewire { 72 onewire {
@@ -531,7 +531,8 @@
531 fsl,pull-up = <MXS_PULL_DISABLE>; 531 fsl,pull-up = <MXS_PULL_DISABLE>;
532 }; 532 };
533 533
534 tx28_edt_ft5x06_pins: tx28-edt-ft5x06-pins { 534 tx28_edt_ft5x06_pins: tx28-edt-ft5x06-pins@0 {
535 reg = <0>;
535 fsl,pinmux-ids = < 536 fsl,pinmux-ids = <
536 MX28_PAD_SSP0_DATA6__GPIO_2_6 /* RESET */ 537 MX28_PAD_SSP0_DATA6__GPIO_2_6 /* RESET */
537 MX28_PAD_SSP0_DATA5__GPIO_2_5 /* IRQ */ 538 MX28_PAD_SSP0_DATA5__GPIO_2_5 /* IRQ */
@@ -542,7 +543,8 @@
542 fsl,pull-up = <MXS_PULL_DISABLE>; 543 fsl,pull-up = <MXS_PULL_DISABLE>;
543 }; 544 };
544 545
545 tx28_flexcan_xcvr_pins: tx28-flexcan-xcvr-pins { 546 tx28_flexcan_xcvr_pins: tx28-flexcan-xcvr-pins@0 {
547 reg = <0>;
546 fsl,pinmux-ids = < 548 fsl,pinmux-ids = <
547 MX28_PAD_LCD_D00__GPIO_1_0 549 MX28_PAD_LCD_D00__GPIO_1_0
548 >; 550 >;
@@ -551,7 +553,8 @@
551 fsl,pull-up = <MXS_PULL_DISABLE>; 553 fsl,pull-up = <MXS_PULL_DISABLE>;
552 }; 554 };
553 555
554 tx28_lcdif_23bit_pins: tx28-lcdif-23bit { 556 tx28_lcdif_23bit_pins: tx28-lcdif-23bit@0 {
557 reg = <0>;
555 fsl,pinmux-ids = < 558 fsl,pinmux-ids = <
556 /* LCD_D00 may be used as Flexcan Transceiver Enable on STK5-V5 */ 559 /* LCD_D00 may be used as Flexcan Transceiver Enable on STK5-V5 */
557 MX28_PAD_LCD_D01__LCD_D1 560 MX28_PAD_LCD_D01__LCD_D1
@@ -583,7 +586,8 @@
583 fsl,pull-up = <MXS_PULL_DISABLE>; 586 fsl,pull-up = <MXS_PULL_DISABLE>;
584 }; 587 };
585 588
586 tx28_lcdif_ctrl_pins: tx28-lcdif-ctrl { 589 tx28_lcdif_ctrl_pins: tx28-lcdif-ctrl@0 {
590 reg = <0>;
587 fsl,pinmux-ids = < 591 fsl,pinmux-ids = <
588 MX28_PAD_LCD_ENABLE__GPIO_1_31 /* Enable */ 592 MX28_PAD_LCD_ENABLE__GPIO_1_31 /* Enable */
589 MX28_PAD_LCD_RESET__GPIO_3_30 /* Reset */ 593 MX28_PAD_LCD_RESET__GPIO_3_30 /* Reset */
@@ -593,7 +597,8 @@
593 fsl,pull-up = <MXS_PULL_DISABLE>; 597 fsl,pull-up = <MXS_PULL_DISABLE>;
594 }; 598 };
595 599
596 tx28_mac0_pins_gpio: tx28-mac0-gpio-pins { 600 tx28_mac0_pins_gpio: tx28-mac0-gpio-pins@0 {
601 reg = <0>;
597 fsl,pinmux-ids = < 602 fsl,pinmux-ids = <
598 MX28_PAD_ENET0_MDC__GPIO_4_0 603 MX28_PAD_ENET0_MDC__GPIO_4_0
599 MX28_PAD_ENET0_MDIO__GPIO_4_1 604 MX28_PAD_ENET0_MDIO__GPIO_4_1
@@ -610,7 +615,8 @@
610 fsl,pull-up = <MXS_PULL_DISABLE>; 615 fsl,pull-up = <MXS_PULL_DISABLE>;
611 }; 616 };
612 617
613 tx28_pca9554_pins: tx28-pca9554-pins { 618 tx28_pca9554_pins: tx28-pca9554-pins@0 {
619 reg = <0>;
614 fsl,pinmux-ids = < 620 fsl,pinmux-ids = <
615 MX28_PAD_PWM3__GPIO_3_28 621 MX28_PAD_PWM3__GPIO_3_28
616 >; 622 >;
@@ -619,7 +625,8 @@
619 fsl,pull-up = <MXS_PULL_DISABLE>; 625 fsl,pull-up = <MXS_PULL_DISABLE>;
620 }; 626 };
621 627
622 tx28_spi_gpio_pins: spi-gpiogrp { 628 tx28_spi_gpio_pins: spi-gpiogrp@0 {
629 reg = <0>;
623 fsl,pinmux-ids = < 630 fsl,pinmux-ids = <
624 MX28_PAD_AUART2_RX__GPIO_3_8 631 MX28_PAD_AUART2_RX__GPIO_3_8
625 MX28_PAD_AUART2_TX__GPIO_3_9 632 MX28_PAD_AUART2_TX__GPIO_3_9
@@ -633,7 +640,8 @@
633 fsl,pull-up = <MXS_PULL_DISABLE>; 640 fsl,pull-up = <MXS_PULL_DISABLE>;
634 }; 641 };
635 642
636 tx28_tsc2007_pins: tx28-tsc2007-pins { 643 tx28_tsc2007_pins: tx28-tsc2007-pins@0 {
644 reg = <0>;
637 fsl,pinmux-ids = < 645 fsl,pinmux-ids = <
638 MX28_PAD_SAIF0_MCLK__GPIO_3_20 /* TSC2007 IRQ */ 646 MX28_PAD_SAIF0_MCLK__GPIO_3_20 /* TSC2007 IRQ */
639 >; 647 >;
@@ -643,7 +651,8 @@
643 }; 651 };
644 652
645 653
646 tx28_usbphy0_pins: tx28-usbphy0-pins { 654 tx28_usbphy0_pins: tx28-usbphy0-pins@0 {
655 reg = <0>;
647 fsl,pinmux-ids = < 656 fsl,pinmux-ids = <
648 MX28_PAD_GPMI_CE2N__GPIO_0_18 /* USBOTG_VBUSEN */ 657 MX28_PAD_GPMI_CE2N__GPIO_0_18 /* USBOTG_VBUSEN */
649 MX28_PAD_GPMI_CE3N__GPIO_0_19 /* USBOTH_OC */ 658 MX28_PAD_GPMI_CE3N__GPIO_0_19 /* USBOTH_OC */
@@ -653,7 +662,8 @@
653 fsl,pull-up = <MXS_PULL_DISABLE>; 662 fsl,pull-up = <MXS_PULL_DISABLE>;
654 }; 663 };
655 664
656 tx28_usbphy1_pins: tx28-usbphy1-pins { 665 tx28_usbphy1_pins: tx28-usbphy1-pins@0 {
666 reg = <0>;
657 fsl,pinmux-ids = < 667 fsl,pinmux-ids = <
658 MX28_PAD_SPDIF__GPIO_3_27 /* USBH_VBUSEN */ 668 MX28_PAD_SPDIF__GPIO_3_27 /* USBH_VBUSEN */
659 MX28_PAD_JTAG_RTCK__GPIO_4_20 /* USBH_OC */ 669 MX28_PAD_JTAG_RTCK__GPIO_4_20 /* USBH_OC */
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index e52e05c0fe56..9ad8d3556859 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -24,7 +24,7 @@
24 * Also for U-Boot there must be a pre-existing /memory node. 24 * Also for U-Boot there must be a pre-existing /memory node.
25 */ 25 */
26 chosen {}; 26 chosen {};
27 memory { device_type = "memory"; reg = <0 0>; }; 27 memory { device_type = "memory"; };
28 28
29 aliases { 29 aliases {
30 ethernet0 = &mac0; 30 ethernet0 = &mac0;
@@ -283,7 +283,8 @@
283 fsl,pull-up = <MXS_PULL_DISABLE>; 283 fsl,pull-up = <MXS_PULL_DISABLE>;
284 }; 284 };
285 285
286 gpmi_status_cfg: gpmi-status-cfg { 286 gpmi_status_cfg: gpmi-status-cfg@0 {
287 reg = <0>;
287 fsl,pinmux-ids = < 288 fsl,pinmux-ids = <
288 MX28_PAD_GPMI_RDN__GPMI_RDN 289 MX28_PAD_GPMI_RDN__GPMI_RDN
289 MX28_PAD_GPMI_WRN__GPMI_WRN 290 MX28_PAD_GPMI_WRN__GPMI_WRN
@@ -527,14 +528,16 @@
527 fsl,pull-up = <MXS_PULL_ENABLE>; 528 fsl,pull-up = <MXS_PULL_ENABLE>;
528 }; 529 };
529 530
530 mmc0_cd_cfg: mmc0-cd-cfg { 531 mmc0_cd_cfg: mmc0-cd-cfg@0 {
532 reg = <0>;
531 fsl,pinmux-ids = < 533 fsl,pinmux-ids = <
532 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT 534 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT
533 >; 535 >;
534 fsl,pull-up = <MXS_PULL_DISABLE>; 536 fsl,pull-up = <MXS_PULL_DISABLE>;
535 }; 537 };
536 538
537 mmc0_sck_cfg: mmc0-sck-cfg { 539 mmc0_sck_cfg: mmc0-sck-cfg@0 {
540 reg = <0>;
538 fsl,pinmux-ids = < 541 fsl,pinmux-ids = <
539 MX28_PAD_SSP0_SCK__SSP0_SCK 542 MX28_PAD_SSP0_SCK__SSP0_SCK
540 >; 543 >;
@@ -558,14 +561,16 @@
558 fsl,pull-up = <MXS_PULL_ENABLE>; 561 fsl,pull-up = <MXS_PULL_ENABLE>;
559 }; 562 };
560 563
561 mmc1_cd_cfg: mmc1-cd-cfg { 564 mmc1_cd_cfg: mmc1-cd-cfg@0 {
565 reg = <0>;
562 fsl,pinmux-ids = < 566 fsl,pinmux-ids = <
563 MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT 567 MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT
564 >; 568 >;
565 fsl,pull-up = <MXS_PULL_DISABLE>; 569 fsl,pull-up = <MXS_PULL_DISABLE>;
566 }; 570 };
567 571
568 mmc1_sck_cfg: mmc1-sck-cfg { 572 mmc1_sck_cfg: mmc1-sck-cfg@0 {
573 reg = <0>;
569 fsl,pinmux-ids = < 574 fsl,pinmux-ids = <
570 MX28_PAD_GPMI_WRN__SSP1_SCK 575 MX28_PAD_GPMI_WRN__SSP1_SCK
571 >; 576 >;
@@ -606,7 +611,8 @@
606 fsl,pull-up = <MXS_PULL_ENABLE>; 611 fsl,pull-up = <MXS_PULL_ENABLE>;
607 }; 612 };
608 613
609 mmc2_cd_cfg: mmc2-cd-cfg { 614 mmc2_cd_cfg: mmc2-cd-cfg@0 {
615 reg = <0>;
610 fsl,pinmux-ids = < 616 fsl,pinmux-ids = <
611 MX28_PAD_AUART1_RX__SSP2_CARD_DETECT 617 MX28_PAD_AUART1_RX__SSP2_CARD_DETECT
612 >; 618 >;
diff --git a/arch/arm/boot/dts/imx31-bug.dts b/arch/arm/boot/dts/imx31-bug.dts
index ae6cebbed84b..6ee4ff8e4e8f 100644
--- a/arch/arm/boot/dts/imx31-bug.dts
+++ b/arch/arm/boot/dts/imx31-bug.dts
@@ -16,7 +16,7 @@
16 model = "Buglabs i.MX31 Bug 1.x"; 16 model = "Buglabs i.MX31 Bug 1.x";
17 compatible = "buglabs,imx31-bug", "fsl,imx31"; 17 compatible = "buglabs,imx31-bug", "fsl,imx31";
18 18
19 memory { 19 memory@80000000 {
20 reg = <0x80000000 0x8000000>; /* 128M */ 20 reg = <0x80000000 0x8000000>; /* 128M */
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi
index a72031407ebd..ebc3f2dbb6fd 100644
--- a/arch/arm/boot/dts/imx31.dtsi
+++ b/arch/arm/boot/dts/imx31.dtsi
@@ -19,7 +19,7 @@
19 * Also for U-Boot there must be a pre-existing /memory node. 19 * Also for U-Boot there must be a pre-existing /memory node.
20 */ 20 */
21 chosen {}; 21 chosen {};
22 memory { device_type = "memory"; reg = <0 0>; }; 22 memory { device_type = "memory"; };
23 23
24 aliases { 24 aliases {
25 serial0 = &uart1; 25 serial0 = &uart1;
diff --git a/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
index 9c2b715ab8bf..ba39d938f289 100644
--- a/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
+++ b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
@@ -17,7 +17,7 @@
17 model = "Eukrea CPUIMX35"; 17 model = "Eukrea CPUIMX35";
18 compatible = "eukrea,cpuimx35", "fsl,imx35"; 18 compatible = "eukrea,cpuimx35", "fsl,imx35";
19 19
20 memory { 20 memory@80000000 {
21 reg = <0x80000000 0x8000000>; /* 128M */ 21 reg = <0x80000000 0x8000000>; /* 128M */
22 }; 22 };
23}; 23};
diff --git a/arch/arm/boot/dts/imx35-pdk.dts b/arch/arm/boot/dts/imx35-pdk.dts
index 9bb628f22502..646b1257bba2 100644
--- a/arch/arm/boot/dts/imx35-pdk.dts
+++ b/arch/arm/boot/dts/imx35-pdk.dts
@@ -17,7 +17,7 @@
17 model = "Freescale i.MX35 Product Development Kit"; 17 model = "Freescale i.MX35 Product Development Kit";
18 compatible = "fsl,imx35-pdk", "fsl,imx35"; 18 compatible = "fsl,imx35-pdk", "fsl,imx35";
19 19
20 memory { 20 memory@80000000 {
21 reg = <0x80000000 0x8000000>, 21 reg = <0x80000000 0x8000000>,
22 <0x90000000 0x8000000>; 22 <0x90000000 0x8000000>;
23 }; 23 };
diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
index e08c0c193767..bf343195697e 100644
--- a/arch/arm/boot/dts/imx35.dtsi
+++ b/arch/arm/boot/dts/imx35.dtsi
@@ -20,7 +20,7 @@
20 * Also for U-Boot there must be a pre-existing /memory node. 20 * Also for U-Boot there must be a pre-existing /memory node.
21 */ 21 */
22 chosen {}; 22 chosen {};
23 memory { device_type = "memory"; reg = <0 0>; }; 23 memory { device_type = "memory"; };
24 24
25 aliases { 25 aliases {
26 ethernet0 = &fec; 26 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx50-evk.dts b/arch/arm/boot/dts/imx50-evk.dts
index 98b5faa06e27..23f1833e23fa 100644
--- a/arch/arm/boot/dts/imx50-evk.dts
+++ b/arch/arm/boot/dts/imx50-evk.dts
@@ -18,7 +18,7 @@
18 model = "Freescale i.MX50 Evaluation Kit"; 18 model = "Freescale i.MX50 Evaluation Kit";
19 compatible = "fsl,imx50-evk", "fsl,imx50"; 19 compatible = "fsl,imx50-evk", "fsl,imx50";
20 20
21 memory { 21 memory@70000000 {
22 reg = <0x70000000 0x80000000>; 22 reg = <0x70000000 0x80000000>;
23 }; 23 };
24}; 24};
diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi
index 35955e63d6c5..7954e79d0a16 100644
--- a/arch/arm/boot/dts/imx50.dtsi
+++ b/arch/arm/boot/dts/imx50.dtsi
@@ -25,7 +25,7 @@
25 * Also for U-Boot there must be a pre-existing /memory node. 25 * Also for U-Boot there must be a pre-existing /memory node.
26 */ 26 */
27 chosen {}; 27 chosen {};
28 memory { device_type = "memory"; reg = <0 0>; }; 28 memory { device_type = "memory"; };
29 29
30 aliases { 30 aliases {
31 ethernet0 = &fec; 31 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx51-apf51.dts b/arch/arm/boot/dts/imx51-apf51.dts
index c83ac1600322..79d80036f74d 100644
--- a/arch/arm/boot/dts/imx51-apf51.dts
+++ b/arch/arm/boot/dts/imx51-apf51.dts
@@ -21,7 +21,7 @@
21 model = "Armadeus Systems APF51 module"; 21 model = "Armadeus Systems APF51 module";
22 compatible = "armadeus,imx51-apf51", "fsl,imx51"; 22 compatible = "armadeus,imx51-apf51", "fsl,imx51";
23 23
24 memory { 24 memory@90000000 {
25 reg = <0x90000000 0x20000000>; 25 reg = <0x90000000 0x20000000>;
26 }; 26 };
27 27
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 4ac5ab614a7f..cf7a1963df25 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -21,7 +21,7 @@
21 stdout-path = &uart1; 21 stdout-path = &uart1;
22 }; 22 };
23 23
24 memory { 24 memory@90000000 {
25 reg = <0x90000000 0x20000000>; 25 reg = <0x90000000 0x20000000>;
26 }; 26 };
27 27
@@ -369,6 +369,7 @@
369 sgtl5000: codec@a { 369 sgtl5000: codec@a {
370 compatible = "fsl,sgtl5000"; 370 compatible = "fsl,sgtl5000";
371 reg = <0x0a>; 371 reg = <0x0a>;
372 #sound-dai-cells = <0>;
372 clocks = <&clk_audio>; 373 clocks = <&clk_audio>;
373 VDDA-supply = <&vdig_reg>; 374 VDDA-supply = <&vdig_reg>;
374 VDDIO-supply = <&vvideo_reg>; 375 VDDIO-supply = <&vvideo_reg>;
diff --git a/arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts b/arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts
index 1db517d3d497..2967a748d859 100644
--- a/arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts
+++ b/arch/arm/boot/dts/imx51-digi-connectcore-jsk.dts
@@ -17,7 +17,7 @@
17 "digi,connectcore-ccxmx51-som", "fsl,imx51"; 17 "digi,connectcore-ccxmx51-som", "fsl,imx51";
18 18
19 chosen { 19 chosen {
20 linux,stdout-path = &uart1; 20 stdout-path = &uart1;
21 }; 21 };
22}; 22};
23 23
diff --git a/arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi b/arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi
index b821066a0d2a..5761a66e8a0d 100644
--- a/arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi
+++ b/arch/arm/boot/dts/imx51-digi-connectcore-som.dtsi
@@ -16,7 +16,7 @@
16 model = "Digi ConnectCore CC(W)-MX51"; 16 model = "Digi ConnectCore CC(W)-MX51";
17 compatible = "digi,connectcore-ccxmx51-som", "fsl,imx51"; 17 compatible = "digi,connectcore-ccxmx51-som", "fsl,imx51";
18 18
19 memory { 19 memory@90000000 {
20 reg = <0x90000000 0x08000000>; 20 reg = <0x90000000 0x08000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi b/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi
index 63164266af83..f8902a338e49 100644
--- a/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi
+++ b/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi
@@ -22,7 +22,7 @@
22 model = "Eukrea CPUIMX51"; 22 model = "Eukrea CPUIMX51";
23 compatible = "eukrea,cpuimx51", "fsl,imx51"; 23 compatible = "eukrea,cpuimx51", "fsl,imx51";
24 24
25 memory { 25 memory@90000000 {
26 reg = <0x90000000 0x10000000>; /* 256M */ 26 reg = <0x90000000 0x10000000>; /* 256M */
27 }; 27 };
28}; 28};
diff --git a/arch/arm/boot/dts/imx51-ts4800.dts b/arch/arm/boot/dts/imx51-ts4800.dts
index f59b02bae68d..39eb067904c3 100644
--- a/arch/arm/boot/dts/imx51-ts4800.dts
+++ b/arch/arm/boot/dts/imx51-ts4800.dts
@@ -17,7 +17,7 @@
17 stdout-path = &uart1; 17 stdout-path = &uart1;
18 }; 18 };
19 19
20 memory { 20 memory@90000000 {
21 reg = <0x90000000 0x10000000>; 21 reg = <0x90000000 0x10000000>;
22 }; 22 };
23 23
diff --git a/arch/arm/boot/dts/imx51-zii-rdu1.dts b/arch/arm/boot/dts/imx51-zii-rdu1.dts
index 5306b78de0ca..0c99ac04ad08 100644
--- a/arch/arm/boot/dts/imx51-zii-rdu1.dts
+++ b/arch/arm/boot/dts/imx51-zii-rdu1.dts
@@ -51,6 +51,11 @@
51 stdout-path = &uart1; 51 stdout-path = &uart1;
52 }; 52 };
53 53
54 /* Will be filled by the bootloader */
55 memory@90000000 {
56 reg = <0x90000000 0>;
57 };
58
54 aliases { 59 aliases {
55 mdio-gpio0 = &mdio_gpio; 60 mdio-gpio0 = &mdio_gpio;
56 rtc0 = &ds1341; 61 rtc0 = &ds1341;
@@ -568,6 +573,15 @@
568 pinctrl-names = "default"; 573 pinctrl-names = "default";
569 pinctrl-0 = <&pinctrl_uart3>; 574 pinctrl-0 = <&pinctrl_uart3>;
570 status = "okay"; 575 status = "okay";
576
577 rave-sp {
578 compatible = "zii,rave-sp-rdu1";
579 current-speed = <38400>;
580
581 watchdog {
582 compatible = "zii,rave-sp-watchdog";
583 };
584 };
571}; 585};
572 586
573&usbh1 { 587&usbh1 {
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 00d30bd70068..5d390a64e976 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -26,7 +26,7 @@
26 * Also for U-Boot there must be a pre-existing /memory node. 26 * Also for U-Boot there must be a pre-existing /memory node.
27 */ 27 */
28 chosen {}; 28 chosen {};
29 memory { device_type = "memory"; reg = <0 0>; }; 29 memory { device_type = "memory"; };
30 30
31 aliases { 31 aliases {
32 ethernet0 = &fec; 32 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts
index 4486bc47d140..80fc00705d92 100644
--- a/arch/arm/boot/dts/imx53-ard.dts
+++ b/arch/arm/boot/dts/imx53-ard.dts
@@ -17,7 +17,7 @@
17 model = "Freescale i.MX53 Automotive Reference Design Board"; 17 model = "Freescale i.MX53 Automotive Reference Design Board";
18 compatible = "fsl,imx53-ard", "fsl,imx53"; 18 compatible = "fsl,imx53-ard", "fsl,imx53";
19 19
20 memory { 20 memory@70000000 {
21 reg = <0x70000000 0x40000000>; 21 reg = <0x70000000 0x40000000>;
22 }; 22 };
23 23
diff --git a/arch/arm/boot/dts/imx53-cx9020.dts b/arch/arm/boot/dts/imx53-cx9020.dts
index 5e67e43004e7..cf70ebc4399a 100644
--- a/arch/arm/boot/dts/imx53-cx9020.dts
+++ b/arch/arm/boot/dts/imx53-cx9020.dts
@@ -21,7 +21,7 @@
21 stdout-path = &uart2; 21 stdout-path = &uart2;
22 }; 22 };
23 23
24 memory { 24 memory@70000000 {
25 reg = <0x70000000 0x20000000>, 25 reg = <0x70000000 0x20000000>,
26 <0xb0000000 0x20000000>; 26 <0xb0000000 0x20000000>;
27 }; 27 };
diff --git a/arch/arm/boot/dts/imx53-m53.dtsi b/arch/arm/boot/dts/imx53-m53.dtsi
index 7ce69c63510c..3da6dd5edb79 100644
--- a/arch/arm/boot/dts/imx53-m53.dtsi
+++ b/arch/arm/boot/dts/imx53-m53.dtsi
@@ -15,7 +15,7 @@
15 model = "Aries/DENX M53"; 15 model = "Aries/DENX M53";
16 compatible = "aries,imx53-m53", "denx,imx53-m53", "fsl,imx53"; 16 compatible = "aries,imx53-m53", "denx,imx53-m53", "fsl,imx53";
17 17
18 memory { 18 memory@70000000 {
19 reg = <0x70000000 0x20000000>, 19 reg = <0x70000000 0x20000000>,
20 <0xb0000000 0x20000000>; 20 <0xb0000000 0x20000000>;
21 }; 21 };
diff --git a/arch/arm/boot/dts/imx53-m53evk.dts b/arch/arm/boot/dts/imx53-m53evk.dts
index e48525763b1b..3935fe6490ed 100644
--- a/arch/arm/boot/dts/imx53-m53evk.dts
+++ b/arch/arm/boot/dts/imx53-m53evk.dts
@@ -153,6 +153,7 @@
153 sgtl5000: codec@a { 153 sgtl5000: codec@a {
154 compatible = "fsl,sgtl5000"; 154 compatible = "fsl,sgtl5000";
155 reg = <0x0a>; 155 reg = <0x0a>;
156 #sound-dai-cells = <0>;
156 VDDA-supply = <&reg_3p2v>; 157 VDDA-supply = <&reg_3p2v>;
157 VDDIO-supply = <&reg_3p2v>; 158 VDDIO-supply = <&reg_3p2v>;
158 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>; 159 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>;
diff --git a/arch/arm/boot/dts/imx53-ppd.dts b/arch/arm/boot/dts/imx53-ppd.dts
index cce959438a79..d5628af2e301 100644
--- a/arch/arm/boot/dts/imx53-ppd.dts
+++ b/arch/arm/boot/dts/imx53-ppd.dts
@@ -132,6 +132,14 @@
132 enable-active-high; 132 enable-active-high;
133 }; 133 };
134 134
135 reg_tsiref: regulator-tsiref {
136 compatible = "regulator-fixed";
137 regulator-name = "tsiref";
138 regulator-min-microvolt = <2500000>;
139 regulator-max-microvolt = <2500000>;
140 regulator-always-on;
141 };
142
135 pwm_bl: backlight { 143 pwm_bl: backlight {
136 compatible = "pwm-backlight"; 144 compatible = "pwm-backlight";
137 pwms = <&pwm2 0 50000>; 145 pwms = <&pwm2 0 50000>;
@@ -294,6 +302,8 @@
294 interrupt-parent = <&gpio3>; 302 interrupt-parent = <&gpio3>;
295 interrupts = <12 0x8>; 303 interrupts = <12 0x8>;
296 spi-max-frequency = <1000000>; 304 spi-max-frequency = <1000000>;
305 dlg,tsi-as-adc;
306 tsiref-supply = <&reg_tsiref>;
297 307
298 regulators { 308 regulators {
299 buck1_reg: buck1 { 309 buck1_reg: buck1 {
@@ -436,6 +446,7 @@
436 sgtl5000: codec@a { 446 sgtl5000: codec@a {
437 compatible = "fsl,sgtl5000"; 447 compatible = "fsl,sgtl5000";
438 reg = <0xa>; 448 reg = <0xa>;
449 #sound-dai-cells = <0>;
439 VDDA-supply = <&reg_sgtl5k>; 450 VDDA-supply = <&reg_sgtl5k>;
440 VDDIO-supply = <&reg_sgtl5k>; 451 VDDIO-supply = <&reg_sgtl5k>;
441 clocks = <&cko2_11M>; 452 clocks = <&cko2_11M>;
@@ -525,6 +536,7 @@
525 536
526 touchscreen@4b { 537 touchscreen@4b {
527 compatible = "atmel,maxtouch"; 538 compatible = "atmel,maxtouch";
539 reset-gpio = <&gpio5 19 GPIO_ACTIVE_HIGH>;
528 reg = <0x4b>; 540 reg = <0x4b>;
529 interrupt-parent = <&gpio5>; 541 interrupt-parent = <&gpio5>;
530 interrupts = <4 0x8>; 542 interrupts = <4 0x8>;
diff --git a/arch/arm/boot/dts/imx53-qsb-common.dtsi b/arch/arm/boot/dts/imx53-qsb-common.dtsi
index 41a2e2a2b079..485a69d45e1c 100644
--- a/arch/arm/boot/dts/imx53-qsb-common.dtsi
+++ b/arch/arm/boot/dts/imx53-qsb-common.dtsi
@@ -17,7 +17,7 @@
17 stdout-path = &uart1; 17 stdout-path = &uart1;
18 }; 18 };
19 19
20 memory { 20 memory@70000000 {
21 reg = <0x70000000 0x20000000>, 21 reg = <0x70000000 0x20000000>,
22 <0xb0000000 0x20000000>; 22 <0xb0000000 0x20000000>;
23 }; 23 };
@@ -317,6 +317,7 @@
317 sgtl5000: codec@a { 317 sgtl5000: codec@a {
318 compatible = "fsl,sgtl5000"; 318 compatible = "fsl,sgtl5000";
319 reg = <0x0a>; 319 reg = <0x0a>;
320 #sound-dai-cells = <0>;
320 VDDA-supply = <&reg_3p2v>; 321 VDDA-supply = <&reg_3p2v>;
321 VDDIO-supply = <&reg_3p2v>; 322 VDDIO-supply = <&reg_3p2v>;
322 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>; 323 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>;
diff --git a/arch/arm/boot/dts/imx53-smd.dts b/arch/arm/boot/dts/imx53-smd.dts
index 51f4a42a55e2..fd030128666c 100644
--- a/arch/arm/boot/dts/imx53-smd.dts
+++ b/arch/arm/boot/dts/imx53-smd.dts
@@ -17,7 +17,7 @@
17 model = "Freescale i.MX53 Smart Mobile Reference Design Board"; 17 model = "Freescale i.MX53 Smart Mobile Reference Design Board";
18 compatible = "fsl,imx53-smd", "fsl,imx53"; 18 compatible = "fsl,imx53-smd", "fsl,imx53";
19 19
20 memory { 20 memory@70000000 {
21 reg = <0x70000000 0x40000000>; 21 reg = <0x70000000 0x40000000>;
22 }; 22 };
23 23
diff --git a/arch/arm/boot/dts/imx53-tqma53.dtsi b/arch/arm/boot/dts/imx53-tqma53.dtsi
index eecdc1c55eef..a72b8981fc3b 100644
--- a/arch/arm/boot/dts/imx53-tqma53.dtsi
+++ b/arch/arm/boot/dts/imx53-tqma53.dtsi
@@ -16,7 +16,7 @@
16 model = "TQ TQMa53"; 16 model = "TQ TQMa53";
17 compatible = "tq,tqma53", "fsl,imx53"; 17 compatible = "tq,tqma53", "fsl,imx53";
18 18
19 memory { 19 memory@70000000 {
20 reg = <0x70000000 0x40000000>; /* Up to 1GiB */ 20 reg = <0x70000000 0x40000000>; /* Up to 1GiB */
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx53-tx53-x03x.dts b/arch/arm/boot/dts/imx53-tx53-x03x.dts
index fe15c9555d6e..af8ec5e4417b 100644
--- a/arch/arm/boot/dts/imx53-tx53-x03x.dts
+++ b/arch/arm/boot/dts/imx53-tx53-x03x.dts
@@ -230,6 +230,7 @@
230 sgtl5000: codec@a { 230 sgtl5000: codec@a {
231 compatible = "fsl,sgtl5000"; 231 compatible = "fsl,sgtl5000";
232 reg = <0x0a>; 232 reg = <0x0a>;
233 #sound-dai-cells = <0>;
233 VDDA-supply = <&reg_2v5>; 234 VDDA-supply = <&reg_2v5>;
234 VDDIO-supply = <&reg_3v3>; 235 VDDIO-supply = <&reg_3v3>;
235 clocks = <&mclk>; 236 clocks = <&mclk>;
diff --git a/arch/arm/boot/dts/imx53-tx53-x13x.dts b/arch/arm/boot/dts/imx53-tx53-x13x.dts
index f2b2ad3ce9e5..6cdf2082c742 100644
--- a/arch/arm/boot/dts/imx53-tx53-x13x.dts
+++ b/arch/arm/boot/dts/imx53-tx53-x13x.dts
@@ -131,6 +131,7 @@
131 sgtl5000: codec@a { 131 sgtl5000: codec@a {
132 compatible = "fsl,sgtl5000"; 132 compatible = "fsl,sgtl5000";
133 reg = <0x0a>; 133 reg = <0x0a>;
134 #sound-dai-cells = <0>;
134 VDDA-supply = <&reg_2v5>; 135 VDDA-supply = <&reg_2v5>;
135 VDDIO-supply = <&reg_3v3>; 136 VDDIO-supply = <&reg_3v3>;
136 clocks = <&mclk>; 137 clocks = <&mclk>;
diff --git a/arch/arm/boot/dts/imx53-tx53.dtsi b/arch/arm/boot/dts/imx53-tx53.dtsi
index a22e461fc168..69a2af7d6c11 100644
--- a/arch/arm/boot/dts/imx53-tx53.dtsi
+++ b/arch/arm/boot/dts/imx53-tx53.dtsi
@@ -49,6 +49,11 @@
49 model = "Ka-Ro electronics TX53 module"; 49 model = "Ka-Ro electronics TX53 module";
50 compatible = "karo,tx53", "fsl,imx53"; 50 compatible = "karo,tx53", "fsl,imx53";
51 51
52 /* Will be filled by the bootloader */
53 memory@70000000 {
54 reg = <0x70000000 0>;
55 };
56
52 aliases { 57 aliases {
53 can0 = &can2; /* Make the can interface indices consistent with TX28/TX48 modules */ 58 can0 = &can2; /* Make the can interface indices consistent with TX28/TX48 modules */
54 can1 = &can1; 59 can1 = &can1;
diff --git a/arch/arm/boot/dts/imx53-usbarmory.dts b/arch/arm/boot/dts/imx53-usbarmory.dts
index 6782d7fc5961..f6268d0ded29 100644
--- a/arch/arm/boot/dts/imx53-usbarmory.dts
+++ b/arch/arm/boot/dts/imx53-usbarmory.dts
@@ -57,7 +57,7 @@
57 stdout-path = &uart1; 57 stdout-path = &uart1;
58 }; 58 };
59 59
60 memory { 60 memory@70000000 {
61 reg = <0x70000000 0x20000000>; 61 reg = <0x70000000 0x20000000>;
62 }; 62 };
63 63
diff --git a/arch/arm/boot/dts/imx53-voipac-bsb.dts b/arch/arm/boot/dts/imx53-voipac-bsb.dts
index 25c78f19826c..957053755c3c 100644
--- a/arch/arm/boot/dts/imx53-voipac-bsb.dts
+++ b/arch/arm/boot/dts/imx53-voipac-bsb.dts
@@ -133,6 +133,7 @@
133 sgtl5000: codec@a { 133 sgtl5000: codec@a {
134 compatible = "fsl,sgtl5000"; 134 compatible = "fsl,sgtl5000";
135 reg = <0x0a>; 135 reg = <0x0a>;
136 #sound-dai-cells = <0>;
136 VDDA-supply = <&reg_3p3v>; 137 VDDA-supply = <&reg_3p3v>;
137 VDDIO-supply = <&reg_3p3v>; 138 VDDIO-supply = <&reg_3p3v>;
138 clocks = <&clks 150>; 139 clocks = <&clks 150>;
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 1040251f2951..7d647d043f52 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -26,7 +26,7 @@
26 * Also for U-Boot there must be a pre-existing /memory node. 26 * Also for U-Boot there must be a pre-existing /memory node.
27 */ 27 */
28 chosen {}; 28 chosen {};
29 memory { device_type = "memory"; reg = <0 0>; }; 29 memory { device_type = "memory"; };
30 30
31 aliases { 31 aliases {
32 ethernet0 = &fec; 32 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx6dl-apf6dev.dts b/arch/arm/boot/dts/imx6dl-apf6dev.dts
index df26e542ab3a..4a7f86de6c39 100644
--- a/arch/arm/boot/dts/imx6dl-apf6dev.dts
+++ b/arch/arm/boot/dts/imx6dl-apf6dev.dts
@@ -54,7 +54,7 @@
54 model = "Armadeus APF6 Solo Module on APF6Dev Board"; 54 model = "Armadeus APF6 Solo Module on APF6Dev Board";
55 compatible = "armadeus,imx6dl-apf6dev", "armadeus,imx6dl-apf6", "fsl,imx6dl"; 55 compatible = "armadeus,imx6dl-apf6dev", "armadeus,imx6dl-apf6", "fsl,imx6dl";
56 56
57 memory { 57 memory@10000000 {
58 reg = <0x10000000 0x20000000>; 58 reg = <0x10000000 0x20000000>;
59 }; 59 };
60}; 60};
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
index 5f0d196495d0..7128c76d5721 100644
--- a/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
+++ b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
@@ -48,7 +48,7 @@
48 model = "aristainetos2 i.MX6 Dual Lite Board 4"; 48 model = "aristainetos2 i.MX6 Dual Lite Board 4";
49 compatible = "fsl,imx6dl"; 49 compatible = "fsl,imx6dl";
50 50
51 memory { 51 memory@10000000 {
52 reg = <0x10000000 0x40000000>; 52 reg = <0x10000000 0x40000000>;
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts b/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts
index 805b1318b7f7..240f3661469f 100644
--- a/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts
+++ b/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts
@@ -48,7 +48,7 @@
48 model = "aristainetos2 i.MX6 Dual Lite Board 7"; 48 model = "aristainetos2 i.MX6 Dual Lite Board 7";
49 compatible = "fsl,imx6dl"; 49 compatible = "fsl,imx6dl";
50 50
51 memory { 51 memory@10000000 {
52 reg = <0x10000000 0x40000000>; 52 reg = <0x10000000 0x40000000>;
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos_4.dts b/arch/arm/boot/dts/imx6dl-aristainetos_4.dts
index 3c9f4af9e9ff..ad7733662fe5 100644
--- a/arch/arm/boot/dts/imx6dl-aristainetos_4.dts
+++ b/arch/arm/boot/dts/imx6dl-aristainetos_4.dts
@@ -27,7 +27,7 @@
27 status = "okay"; 27 status = "okay";
28 }; 28 };
29 29
30 memory { 30 memory@10000000 {
31 reg = <0x10000000 0x40000000>; 31 reg = <0x10000000 0x40000000>;
32 }; 32 };
33 33
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos_7.dts b/arch/arm/boot/dts/imx6dl-aristainetos_7.dts
index 96cd835ccbf6..64ed84e3c512 100644
--- a/arch/arm/boot/dts/imx6dl-aristainetos_7.dts
+++ b/arch/arm/boot/dts/imx6dl-aristainetos_7.dts
@@ -16,7 +16,7 @@
16 model = "aristainetos i.MX6 Dual Lite Board 7"; 16 model = "aristainetos i.MX6 Dual Lite Board 7";
17 compatible = "fsl,imx6dl"; 17 compatible = "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x40000000>; 20 reg = <0x10000000 0x40000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
index dcf9206f3e0d..ea184d108491 100644
--- a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
+++ b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
@@ -53,6 +53,11 @@
53 compatible = "toradex,colibri_imx6dl-eval-v3", "toradex,colibri_imx6dl", 53 compatible = "toradex,colibri_imx6dl-eval-v3", "toradex,colibri_imx6dl",
54 "fsl,imx6dl"; 54 "fsl,imx6dl";
55 55
56 /* Will be filled by the bootloader */
57 memory@10000000 {
58 reg = <0x10000000 0>;
59 };
60
56 aliases { 61 aliases {
57 i2c0 = &i2c2; 62 i2c0 = &i2c2;
58 i2c1 = &i2c3; 63 i2c1 = &i2c3;
@@ -63,6 +68,10 @@
63 rtc1 = &snvs_rtc; 68 rtc1 = &snvs_rtc;
64 }; 69 };
65 70
71 chosen {
72 stdout-path = "serial0:115200n8";
73 };
74
66 clocks { 75 clocks {
67 /* Fixed crystal dedicated to mcp251x */ 76 /* Fixed crystal dedicated to mcp251x */
68 clk16m: clk@1 { 77 clk16m: clk@1 {
diff --git a/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts b/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts
index 994f96a3fb54..89384cb618f6 100644
--- a/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts
+++ b/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts
@@ -20,4 +20,9 @@
20/ { 20/ {
21 model = "DFI FS700-M60-6DL i.MX6dl Q7 Board"; 21 model = "DFI FS700-M60-6DL i.MX6dl Q7 Board";
22 compatible = "dfi,fs700-m60-6dl", "dfi,fs700e-m60", "fsl,imx6dl"; 22 compatible = "dfi,fs700-m60-6dl", "dfi,fs700e-m60", "fsl,imx6dl";
23
24 /* Will be filled by the bootloader */
25 memory@10000000 {
26 reg = <0x10000000 0>;
27 };
23}; 28};
diff --git a/arch/arm/boot/dts/imx6dl-icore-rqs.dts b/arch/arm/boot/dts/imx6dl-icore-rqs.dts
index cf42c2f5cdc7..1281bc39b7ab 100644
--- a/arch/arm/boot/dts/imx6dl-icore-rqs.dts
+++ b/arch/arm/boot/dts/imx6dl-icore-rqs.dts
@@ -42,7 +42,7 @@
42 42
43/dts-v1/; 43/dts-v1/;
44 44
45#include "imx6q.dtsi" 45#include "imx6dl.dtsi"
46#include "imx6qdl-icore-rqs.dtsi" 46#include "imx6qdl-icore-rqs.dtsi"
47 47
48/ { 48/ {
diff --git a/arch/arm/boot/dts/imx6dl-phytec-mira-rdk-nand.dts b/arch/arm/boot/dts/imx6dl-phytec-mira-rdk-nand.dts
new file mode 100644
index 000000000000..a8adcb2ec3fd
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-phytec-mira-rdk-nand.dts
@@ -0,0 +1,64 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Christian Hemp <c.hemp@phytec.de>
5 */
6
7/dts-v1/;
8#include "imx6dl.dtsi"
9#include "imx6qdl-phytec-phycore-som.dtsi"
10#include "imx6qdl-phytec-mira.dtsi"
11
12/ {
13 model = "PHYTEC phyBOARD-Mira DualLite/Solo Carrier-Board with NAND";
14 compatible = "phytec,imx6dl-pbac06-nand", "phytec,imx6dl-pbac06",
15 "phytec,imx6qdl-pcm058", "fsl,imx6dl";
16
17 chosen {
18 linux,stdout-path = &uart2;
19 };
20};
21
22&ethphy {
23 max-speed = <100>;
24};
25
26&fec {
27 status = "okay";
28};
29
30&gpmi {
31 status = "okay";
32};
33
34&hdmi {
35 status = "okay";
36};
37
38&i2c1 {
39 status = "okay";
40};
41
42&i2c2 {
43 status = "okay";
44};
45
46&i2c_rtc {
47 status = "okay";
48};
49
50&uart3 {
51 status = "okay";
52};
53
54&usbh1 {
55 status = "okay";
56};
57
58&usbotg {
59 status = "okay";
60};
61
62&usdhc1 {
63 status = "okay";
64};
diff --git a/arch/arm/boot/dts/imx6dl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6dl-phytec-pfla02.dtsi
index 964bc2ad3c5d..7d9888937f12 100644
--- a/arch/arm/boot/dts/imx6dl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6dl-phytec-pfla02.dtsi
@@ -16,7 +16,7 @@
16 model = "Phytec phyFLEX-i.MX6 DualLite/Solo"; 16 model = "Phytec phyFLEX-i.MX6 DualLite/Solo";
17 compatible = "phytec,imx6dl-pfla02", "fsl,imx6dl"; 17 compatible = "phytec,imx6dl-pfla02", "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x20000000>; 20 reg = <0x10000000 0x20000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6dl-rex-basic.dts b/arch/arm/boot/dts/imx6dl-rex-basic.dts
index c3a14a4330a2..3fb7f4ee2496 100644
--- a/arch/arm/boot/dts/imx6dl-rex-basic.dts
+++ b/arch/arm/boot/dts/imx6dl-rex-basic.dts
@@ -16,7 +16,7 @@
16 model = "Rex Basic i.MX6 Dual Lite Board"; 16 model = "Rex Basic i.MX6 Dual Lite Board";
17 compatible = "rex,imx6dl-rex-basic", "fsl,imx6dl"; 17 compatible = "rex,imx6dl-rex-basic", "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x20000000>; 20 reg = <0x10000000 0x20000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6dl-riotboard.dts b/arch/arm/boot/dts/imx6dl-riotboard.dts
index 23e108204e1e..2e98c92adff7 100644
--- a/arch/arm/boot/dts/imx6dl-riotboard.dts
+++ b/arch/arm/boot/dts/imx6dl-riotboard.dts
@@ -15,7 +15,7 @@
15 model = "RIoTboard i.MX6S"; 15 model = "RIoTboard i.MX6S";
16 compatible = "riot,imx6s-riotboard", "fsl,imx6dl"; 16 compatible = "riot,imx6s-riotboard", "fsl,imx6dl";
17 17
18 memory { 18 memory@10000000 {
19 reg = <0x10000000 0x40000000>; 19 reg = <0x10000000 0x40000000>;
20 }; 20 };
21 21
diff --git a/arch/arm/boot/dts/imx6dl-ts4900.dts b/arch/arm/boot/dts/imx6dl-ts4900.dts
index 6ea0b780677d..cc01a7a22e30 100644
--- a/arch/arm/boot/dts/imx6dl-ts4900.dts
+++ b/arch/arm/boot/dts/imx6dl-ts4900.dts
@@ -46,4 +46,9 @@
46/ { 46/ {
47 model = "Technologic Systems i.MX6 Solo/DualLite TS-4900 (Default Device Tree)"; 47 model = "Technologic Systems i.MX6 Solo/DualLite TS-4900 (Default Device Tree)";
48 compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl"; 48 compatible = "technologic,imx6dl-ts4900", "fsl,imx6dl";
49
50 /* Will be filled by the bootloader */
51 memory@10000000 {
52 reg = <0x10000000 0>;
53 };
49}; 54};
diff --git a/arch/arm/boot/dts/imx6dl-ts7970.dts b/arch/arm/boot/dts/imx6dl-ts7970.dts
index d104daf305d9..82435d5bf33f 100644
--- a/arch/arm/boot/dts/imx6dl-ts7970.dts
+++ b/arch/arm/boot/dts/imx6dl-ts7970.dts
@@ -47,4 +47,9 @@
47/ { 47/ {
48 model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default Device Tree)"; 48 model = "Technologic Systems i.MX6 Solo/DualLite TS-7970 (Default Device Tree)";
49 compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl"; 49 compatible = "technologic,imx6dl-ts7970", "fsl,imx6dl";
50
51 /* Will be filled by the bootloader */
52 memory@10000000 {
53 reg = <0x10000000 0>;
54 };
50}; 55};
diff --git a/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts b/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
index 8c314eee4fdd..5727fa48cfd5 100644
--- a/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
+++ b/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Dual Lite Board rev B1"; 16 model = "Wandboard i.MX6 Dual Lite Board rev B1";
17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl"; 17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x40000000>; 20 reg = <0x10000000 0x40000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6dl-wandboard-revd1.dts b/arch/arm/boot/dts/imx6dl-wandboard-revd1.dts
index aa4d4faaaec4..a72c07db7dda 100644
--- a/arch/arm/boot/dts/imx6dl-wandboard-revd1.dts
+++ b/arch/arm/boot/dts/imx6dl-wandboard-revd1.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Dual Lite Board revD1"; 16 model = "Wandboard i.MX6 Dual Lite Board revD1";
17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl"; 17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x40000000>; 20 reg = <0x10000000 0x40000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6dl-wandboard.dts b/arch/arm/boot/dts/imx6dl-wandboard.dts
index bbb616723097..a09f274cd1f4 100644
--- a/arch/arm/boot/dts/imx6dl-wandboard.dts
+++ b/arch/arm/boot/dts/imx6dl-wandboard.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Dual Lite Board"; 16 model = "Wandboard i.MX6 Dual Lite Board";
17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl"; 17 compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x40000000>; 20 reg = <0x10000000 0x40000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
index c01674fa098a..558bce81209d 100644
--- a/arch/arm/boot/dts/imx6dl.dtsi
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -80,11 +80,6 @@
80 reg = <0x020f4000 0x4000>; 80 reg = <0x020f4000 0x4000>;
81 interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>; 81 interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
82 }; 82 };
83
84 lcdif: lcdif@20f8000 {
85 reg = <0x020f8000 0x4000>;
86 interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
87 };
88 }; 83 };
89 84
90 aips2: aips-bus@2100000 { 85 aips2: aips-bus@2100000 {
@@ -109,11 +104,6 @@
109 compatible = "fsl,imx-display-subsystem"; 104 compatible = "fsl,imx-display-subsystem";
110 ports = <&ipu1_di0>, <&ipu1_di1>; 105 ports = <&ipu1_di0>, <&ipu1_di1>;
111 }; 106 };
112
113 gpu-subsystem {
114 compatible = "fsl,imx-gpu-subsystem";
115 cores = <&gpu_2d>, <&gpu_3d>;
116 };
117}; 107};
118 108
119&gpio1 { 109&gpio1 {
diff --git a/arch/arm/boot/dts/imx6q-apf6dev.dts b/arch/arm/boot/dts/imx6q-apf6dev.dts
index 4e4de821d9e5..5e72f81cdf8b 100644
--- a/arch/arm/boot/dts/imx6q-apf6dev.dts
+++ b/arch/arm/boot/dts/imx6q-apf6dev.dts
@@ -54,7 +54,7 @@
54 model = "Armadeus APF6 Quad / Dual Module on APF6Dev Board"; 54 model = "Armadeus APF6 Quad / Dual Module on APF6Dev Board";
55 compatible = "armadeus,imx6q-apf6dev", "armadeus,imx6q-apf6", "fsl,imx6q"; 55 compatible = "armadeus,imx6q-apf6dev", "armadeus,imx6q-apf6", "fsl,imx6q";
56 56
57 memory { 57 memory@10000000 {
58 reg = <0x10000000 0x40000000>; 58 reg = <0x10000000 0x40000000>;
59 }; 59 };
60}; 60};
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index 4989d0bff10f..953a5b5a8ea4 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -18,7 +18,7 @@
18 model = "Freescale i.MX6 Quad Armadillo2 Board"; 18 model = "Freescale i.MX6 Quad Armadillo2 Board";
19 compatible = "fsl,imx6q-arm2", "fsl,imx6q"; 19 compatible = "fsl,imx6q-arm2", "fsl,imx6q";
20 20
21 memory { 21 memory@10000000 {
22 reg = <0x10000000 0x80000000>; 22 reg = <0x10000000 0x80000000>;
23 }; 23 };
24 24
diff --git a/arch/arm/boot/dts/imx6q-ba16.dtsi b/arch/arm/boot/dts/imx6q-ba16.dtsi
index 5fcb0372d58b..bf4bdb385de9 100644
--- a/arch/arm/boot/dts/imx6q-ba16.dtsi
+++ b/arch/arm/boot/dts/imx6q-ba16.dtsi
@@ -46,7 +46,7 @@
46#include <dt-bindings/gpio/gpio.h> 46#include <dt-bindings/gpio/gpio.h>
47 47
48/ { 48/ {
49 memory { 49 memory@10000000 {
50 reg = <0x10000000 0x40000000>; 50 reg = <0x10000000 0x40000000>;
51 }; 51 };
52 52
diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
index 916ea94d75ca..990e411cbca0 100644
--- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi
+++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
@@ -353,6 +353,14 @@
353 }; 353 };
354}; 354};
355 355
356&pmu {
357 secure-reg-access;
358};
359
360&usdhc2 {
361 status = "disabled";
362};
363
356&usdhc4 { 364&usdhc4 {
357 pinctrl-names = "default"; 365 pinctrl-names = "default";
358 pinctrl-0 = <&pinctrl_usdhc4>; 366 pinctrl-0 = <&pinctrl_usdhc4>;
diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index bc7587c383f6..65ef4cacbc71 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -50,7 +50,7 @@
50 model = "CompuLab CM-FX6"; 50 model = "CompuLab CM-FX6";
51 compatible = "compulab,cm-fx6", "fsl,imx6q"; 51 compatible = "compulab,cm-fx6", "fsl,imx6q";
52 52
53 memory { 53 memory@10000000 {
54 reg = <0x10000000 0x80000000>; 54 reg = <0x10000000 0x80000000>;
55 }; 55 };
56 56
diff --git a/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts b/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts
index fd0ad9a8866c..ad12d76bbb89 100644
--- a/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts
+++ b/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts
@@ -20,4 +20,9 @@
20/ { 20/ {
21 model = "DFI FS700-M60-6QD i.MX6qd Q7 Board"; 21 model = "DFI FS700-M60-6QD i.MX6qd Q7 Board";
22 compatible = "dfi,fs700-m60-6qd", "dfi,fs700e-m60", "fsl,imx6q"; 22 compatible = "dfi,fs700-m60-6qd", "dfi,fs700e-m60", "fsl,imx6q";
23
24 /* Will be filled by the bootloader */
25 memory@10000000 {
26 reg = <0x10000000 0>;
27 };
23}; 28};
diff --git a/arch/arm/boot/dts/imx6q-display5.dtsi b/arch/arm/boot/dts/imx6q-display5.dtsi
index 09085fde3341..85232c7c36a0 100644
--- a/arch/arm/boot/dts/imx6q-display5.dtsi
+++ b/arch/arm/boot/dts/imx6q-display5.dtsi
@@ -47,7 +47,7 @@
47 model = "Liebherr (LWN) display5 i.MX6 Quad Board"; 47 model = "Liebherr (LWN) display5 i.MX6 Quad Board";
48 compatible = "lwn,display5", "fsl,imx6q"; 48 compatible = "lwn,display5", "fsl,imx6q";
49 49
50 memory { 50 memory@10000000 {
51 reg = <0x10000000 0x40000000>; 51 reg = <0x10000000 0x40000000>;
52 }; 52 };
53 53
diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
index f0316ea96898..b3c6a4a7897d 100644
--- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
+++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
@@ -29,7 +29,7 @@
29 stmpe-i2c1 = &stmpe2; 29 stmpe-i2c1 = &stmpe2;
30 }; 30 };
31 31
32 memory { 32 memory@10000000 {
33 reg = <0x10000000 0x80000000>; 33 reg = <0x10000000 0x80000000>;
34 }; 34 };
35 35
diff --git a/arch/arm/boot/dts/imx6q-dms-ba16.dts b/arch/arm/boot/dts/imx6q-dms-ba16.dts
new file mode 100644
index 000000000000..57761f3172fa
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-dms-ba16.dts
@@ -0,0 +1,139 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/gpio/gpio.h>
6#include "imx6q-ba16.dtsi"
7
8/ {
9 model = "Advantech DMS-BA16";
10 compatible = "advantech,imx6q-dms-ba16", "advantech,imx6q-ba16", "fsl,imx6q";
11
12 reg_usb_otg_vbus: regulator-usbotgvbus {
13 compatible = "regulator-fixed";
14 regulator-name = "usb_otg_vbus";
15 regulator-min-microvolt = <5000000>;
16 regulator-max-microvolt = <5000000>;
17 pinctrl-names = "default";
18 pinctrl-0 = <&pinctrl_usbotgvbus>;
19 gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>;
20 enable-active-high;
21 };
22
23 sys_mclk: clock-sys-mclk {
24 compatible = "fixed-clock";
25 #clock-cells = <0>;
26 clock-frequency = <22000000>;
27 };
28
29 sound {
30 compatible = "fsl,imx6q-ba16-sgtl5000",
31 "fsl,imx-audio-sgtl5000";
32 model = "imx6q-ba16-sgtl5000";
33 ssi-controller = <&ssi1>;
34 audio-codec = <&sgtl5000>;
35 audio-routing =
36 "MIC_IN", "Mic Jack",
37 "Mic Jack", "Mic Bias",
38 "Headphone Jack", "HP_OUT";
39 mux-int-port = <1>;
40 mux-ext-port = <4>;
41 };
42};
43
44&ecspi5 {
45 cs-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
46 pinctrl-names = "default";
47 pinctrl-0 = <&pinctrl_ecspi5>;
48 status = "okay";
49
50 m25_eeprom: m25p80@0 {
51 compatible = "atmel,at25256B", "atmel,at25";
52 spi-max-frequency = <20000000>;
53 size = <0x8000>;
54 pagesize = <64>;
55 reg = <0>;
56 address-width = <16>;
57 };
58};
59
60&iomuxc {
61 pinctrl_i2c1_gpio: i2c1gpiogrp {
62 fsl,pins = <
63 MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26 0x1b0b0
64 MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27 0x1b0b0
65 >;
66 };
67
68 pinctrl_i2c2_gpio: i2c2gpiogrp {
69 fsl,pins = <
70 MX6QDL_PAD_KEY_COL3__GPIO4_IO12 0x1b0b0
71 MX6QDL_PAD_KEY_ROW3__GPIO4_IO13 0x1b0b0
72 >;
73 };
74
75 pinctrl_i2c3_gpio: i2c3gpiogrp {
76 fsl,pins = <
77 MX6QDL_PAD_GPIO_3__GPIO1_IO03 0x1b0b0
78 MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x1b0b0
79 >;
80 };
81
82 pinctrl_usbotgvbus: usbotgvbusgrp {
83 fsl,pins = <
84 MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
85 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x000b0
86 >;
87 };
88};
89
90&i2c1 {
91 clock-frequency = <100000>;
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_i2c1>;
94 status = "okay";
95
96 sgtl5000: codec@a {
97 compatible = "fsl,sgtl5000";
98 reg = <0x0a>;
99 clocks = <&sys_mclk>;
100 lrclk-strength = <0x3>;
101 VDDA-supply = <&reg_1p8v>;
102 VDDIO-supply = <&reg_3p3v>;
103 };
104};
105
106&pwm2 {
107 pinctrl-names = "default";
108 pinctrl-0 = <&pinctrl_pwm2>;
109 status = "okay";
110};
111
112&sata {
113 fsl,no-spread-spectrum;
114 fsl,transmit-atten-16ths = <12>;
115 fsl,transmit-boost-mdB = <3330>;
116 fsl,transmit-level-mV = <1133>;
117 fsl,receive-dpll-mode = <1>;
118 status = "okay";
119};
120
121&usbotg {
122 vbus-supply = <&reg_usb_otg_vbus>;
123 pinctrl-names = "default";
124 pinctrl-0 = <&pinctrl_usbotg>;
125 dr_mode = "otg";
126 disable-over-current;
127 status = "okay";
128};
129
130&usdhc4 {
131 pinctrl-names = "default";
132 pinctrl-0 = <&pinctrl_usdhc4>;
133 bus-width = <8>;
134 cd-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
135 no-1-8-v;
136 keep-power-in-suspend;
137 wakeup-source;
138 status = "okay";
139};
diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts
index e0aea782c666..fcd257bc5ac3 100644
--- a/arch/arm/boot/dts/imx6q-evi.dts
+++ b/arch/arm/boot/dts/imx6q-evi.dts
@@ -50,7 +50,7 @@
50 model = "Uniwest Evi"; 50 model = "Uniwest Evi";
51 compatible = "uniwest,imx6q-evi", "fsl,imx6q"; 51 compatible = "uniwest,imx6q-evi", "fsl,imx6q";
52 52
53 memory { 53 memory@10000000 {
54 reg = <0x10000000 0x40000000>; 54 reg = <0x10000000 0x40000000>;
55 }; 55 };
56 56
diff --git a/arch/arm/boot/dts/imx6q-gk802.dts b/arch/arm/boot/dts/imx6q-gk802.dts
index b715deb4ea46..0be375611382 100644
--- a/arch/arm/boot/dts/imx6q-gk802.dts
+++ b/arch/arm/boot/dts/imx6q-gk802.dts
@@ -18,7 +18,7 @@
18 stdout-path = &uart4; 18 stdout-path = &uart4;
19 }; 19 };
20 20
21 memory { 21 memory@10000000 {
22 reg = <0x10000000 0x40000000>; 22 reg = <0x10000000 0x40000000>;
23 }; 23 };
24 24
diff --git a/arch/arm/boot/dts/imx6q-gw5400-a.dts b/arch/arm/boot/dts/imx6q-gw5400-a.dts
index 29adaa7c72f8..a8f70b4266ef 100644
--- a/arch/arm/boot/dts/imx6q-gw5400-a.dts
+++ b/arch/arm/boot/dts/imx6q-gw5400-a.dts
@@ -60,7 +60,7 @@
60 }; 60 };
61 }; 61 };
62 62
63 memory { 63 memory@10000000 {
64 reg = <0x10000000 0x40000000>; 64 reg = <0x10000000 0x40000000>;
65 }; 65 };
66 66
diff --git a/arch/arm/boot/dts/imx6q-h100.dts b/arch/arm/boot/dts/imx6q-h100.dts
index 8a2ea6c58902..714e09e04dcb 100644
--- a/arch/arm/boot/dts/imx6q-h100.dts
+++ b/arch/arm/boot/dts/imx6q-h100.dts
@@ -49,6 +49,11 @@
49 model = "Auvidea H100"; 49 model = "Auvidea H100";
50 compatible = "auvidea,h100", "fsl,imx6q"; 50 compatible = "auvidea,h100", "fsl,imx6q";
51 51
52 /* Will be filled by the bootloader */
53 memory@10000000 {
54 reg = <0x10000000 0>;
55 };
56
52 aliases { 57 aliases {
53 rtc0 = &rtc; 58 rtc0 = &rtc;
54 rtc1 = &snvs_rtc; 59 rtc1 = &snvs_rtc;
@@ -161,7 +166,7 @@
161 status = "okay"; 166 status = "okay";
162 167
163 eeprom: 24c02@51 { 168 eeprom: 24c02@51 {
164 compatible = "microchip,24c02", "at24"; 169 compatible = "microchip,24c02", "atmel,24c02";
165 reg = <0x51>; 170 reg = <0x51>;
166 }; 171 };
167 172
diff --git a/arch/arm/boot/dts/imx6q-marsboard.dts b/arch/arm/boot/dts/imx6q-marsboard.dts
index 432291bedcf1..dd763f205819 100644
--- a/arch/arm/boot/dts/imx6q-marsboard.dts
+++ b/arch/arm/boot/dts/imx6q-marsboard.dts
@@ -47,7 +47,7 @@
47 model = "Embest MarS Board i.MX6Dual"; 47 model = "Embest MarS Board i.MX6Dual";
48 compatible = "embest,imx6q-marsboard", "fsl,imx6q"; 48 compatible = "embest,imx6q-marsboard", "fsl,imx6q";
49 49
50 memory { 50 memory@10000000 {
51 reg = <0x10000000 0x40000000>; 51 reg = <0x10000000 0x40000000>;
52 }; 52 };
53 53
diff --git a/arch/arm/boot/dts/imx6q-mccmon6.dts b/arch/arm/boot/dts/imx6q-mccmon6.dts
index cab36f48d5f1..b7e9f38cec72 100644
--- a/arch/arm/boot/dts/imx6q-mccmon6.dts
+++ b/arch/arm/boot/dts/imx6q-mccmon6.dts
@@ -19,7 +19,7 @@
19 model = "Liebherr (LWN) monitor6 i.MX6 Quad Board"; 19 model = "Liebherr (LWN) monitor6 i.MX6 Quad Board";
20 compatible = "lwn,mccmon6", "fsl,imx6q"; 20 compatible = "lwn,mccmon6", "fsl,imx6q";
21 21
22 memory { 22 memory@10000000 {
23 reg = <0x10000000 0x80000000>; 23 reg = <0x10000000 0x80000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx6q-novena.dts b/arch/arm/boot/dts/imx6q-novena.dts
index 7d7dc59507cf..52f39371188d 100644
--- a/arch/arm/boot/dts/imx6q-novena.dts
+++ b/arch/arm/boot/dts/imx6q-novena.dts
@@ -55,6 +55,11 @@
55 model = "Kosagi Novena Dual/Quad"; 55 model = "Kosagi Novena Dual/Quad";
56 compatible = "kosagi,imx6q-novena", "fsl,imx6q"; 56 compatible = "kosagi,imx6q-novena", "fsl,imx6q";
57 57
58 /* Will be filled by the bootloader */
59 memory@10000000 {
60 reg = <0x10000000 0>;
61 };
62
58 chosen { 63 chosen {
59 stdout-path = &uart2; 64 stdout-path = &uart2;
60 }; 65 };
diff --git a/arch/arm/boot/dts/imx6q-phytec-mira-rdk-emmc.dts b/arch/arm/boot/dts/imx6q-phytec-mira-rdk-emmc.dts
new file mode 100644
index 000000000000..8fdce3c8e5fa
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-phytec-mira-rdk-emmc.dts
@@ -0,0 +1,72 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Christian Hemp <c.hemp@phytec.de>
5 */
6
7/dts-v1/;
8#include "imx6q.dtsi"
9#include "imx6qdl-phytec-phycore-som.dtsi"
10#include "imx6qdl-phytec-mira.dtsi"
11
12/ {
13 model = "PHYTEC phyBOARD-Mira Quad Carrier-Board with eMMC";
14 compatible = "phytec,imx6q-pbac06-emmc", "phytec,imx6q-pbac06",
15 "phytec,imx6qdl-pcm058", "fsl,imx6q";
16
17 chosen {
18 linux,stdout-path = &uart2;
19 };
20};
21
22&can1 {
23 status = "okay";
24};
25
26&fec {
27 status = "okay";
28};
29
30&hdmi {
31 status = "okay";
32};
33
34&i2c1 {
35 status = "okay";
36};
37
38&i2c2 {
39 status = "okay";
40};
41
42&i2c_rtc {
43 status = "okay";
44};
45
46&m25p80 {
47 status = "okay";
48};
49
50&pcie {
51 status = "okay";
52};
53
54&uart3 {
55 status = "okay";
56};
57
58&usbh1 {
59 status = "okay";
60};
61
62&usbotg {
63 status = "okay";
64};
65
66&usdhc1 {
67 status = "okay";
68};
69
70&usdhc4 {
71 status = "okay";
72};
diff --git a/arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts b/arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts
new file mode 100644
index 000000000000..8afa5ceb7d7c
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts
@@ -0,0 +1,72 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Christian Hemp <c.hemp@phytec.de>
5 */
6
7/dts-v1/;
8#include "imx6q.dtsi"
9#include "imx6qdl-phytec-phycore-som.dtsi"
10#include "imx6qdl-phytec-mira.dtsi"
11
12/ {
13 model = "PHYTEC phyBOARD-Mira Quad Carrier-Board with NAND";
14 compatible = "phytec,imx6q-pbac06-nand", "phytec,imx6q-pbac06",
15 "phytec,imx6qdl-pcm058", "fsl,imx6q";
16
17 chosen {
18 linux,stdout-path = &uart2;
19 };
20};
21
22&can1 {
23 status = "okay";
24};
25
26&fec {
27 status = "okay";
28};
29
30&gpmi {
31 status = "okay";
32};
33
34&hdmi {
35 status = "okay";
36};
37
38&i2c1 {
39 status = "okay";
40};
41
42&i2c2 {
43 status = "okay";
44};
45
46&i2c_rtc {
47 status = "okay";
48};
49
50&m25p80 {
51 status = "okay";
52};
53
54&pcie {
55 status = "okay";
56};
57
58&uart3 {
59 status = "okay";
60};
61
62&usbh1 {
63 status = "okay";
64};
65
66&usbotg {
67 status = "okay";
68};
69
70&usdhc1 {
71 status = "okay";
72};
diff --git a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
index cd20d0a948de..fad858c30fe9 100644
--- a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
@@ -16,7 +16,7 @@
16 model = "Phytec phyFLEX-i.MX6 Quad"; 16 model = "Phytec phyFLEX-i.MX6 Quad";
17 compatible = "phytec,imx6q-pfla02", "fsl,imx6q"; 17 compatible = "phytec,imx6q-pfla02", "fsl,imx6q";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6q-pistachio.dts b/arch/arm/boot/dts/imx6q-pistachio.dts
index 1effb58f304c..bd57b3b74db7 100644
--- a/arch/arm/boot/dts/imx6q-pistachio.dts
+++ b/arch/arm/boot/dts/imx6q-pistachio.dts
@@ -56,7 +56,7 @@
56 stdout-path = &uart4; 56 stdout-path = &uart4;
57 }; 57 };
58 58
59 memory: memory { 59 memory@10000000 {
60 reg = <0x10000000 0x80000000>; 60 reg = <0x10000000 0x80000000>;
61 }; 61 };
62 62
diff --git a/arch/arm/boot/dts/imx6q-rex-pro.dts b/arch/arm/boot/dts/imx6q-rex-pro.dts
index 90ea61ae04e9..d6cae73b1927 100644
--- a/arch/arm/boot/dts/imx6q-rex-pro.dts
+++ b/arch/arm/boot/dts/imx6q-rex-pro.dts
@@ -16,7 +16,7 @@
16 model = "Rex Pro i.MX6 Quad Board"; 16 model = "Rex Pro i.MX6 Quad Board";
17 compatible = "rex,imx6q-rex-pro", "fsl,imx6q"; 17 compatible = "rex,imx6q-rex-pro", "fsl,imx6q";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6q-sbc6x.dts b/arch/arm/boot/dts/imx6q-sbc6x.dts
index 255733063ea4..b7aa2f0b9f53 100644
--- a/arch/arm/boot/dts/imx6q-sbc6x.dts
+++ b/arch/arm/boot/dts/imx6q-sbc6x.dts
@@ -12,7 +12,7 @@
12 model = "MicroSys sbc6x board"; 12 model = "MicroSys sbc6x board";
13 compatible = "microsys,sbc6x", "fsl,imx6q"; 13 compatible = "microsys,sbc6x", "fsl,imx6q";
14 14
15 memory { 15 memory@10000000 {
16 reg = <0x10000000 0x80000000>; 16 reg = <0x10000000 0x80000000>;
17 }; 17 };
18}; 18};
diff --git a/arch/arm/boot/dts/imx6q-tbs2910.dts b/arch/arm/boot/dts/imx6q-tbs2910.dts
index a3cd7afac20a..505cba776a2d 100644
--- a/arch/arm/boot/dts/imx6q-tbs2910.dts
+++ b/arch/arm/boot/dts/imx6q-tbs2910.dts
@@ -59,7 +59,7 @@
59 stdout-path = &uart1; 59 stdout-path = &uart1;
60 }; 60 };
61 61
62 memory { 62 memory@10000000 {
63 reg = <0x10000000 0x80000000>; 63 reg = <0x10000000 0x80000000>;
64 }; 64 };
65 65
diff --git a/arch/arm/boot/dts/imx6q-ts4900.dts b/arch/arm/boot/dts/imx6q-ts4900.dts
index fab76f8cd076..e655107edc56 100644
--- a/arch/arm/boot/dts/imx6q-ts4900.dts
+++ b/arch/arm/boot/dts/imx6q-ts4900.dts
@@ -46,6 +46,11 @@
46/ { 46/ {
47 model = "Technologic Systems i.MX6 Quad TS-4900 (Default Device Tree)"; 47 model = "Technologic Systems i.MX6 Quad TS-4900 (Default Device Tree)";
48 compatible = "technologic,imx6q-ts4900", "fsl,imx6q"; 48 compatible = "technologic,imx6q-ts4900", "fsl,imx6q";
49
50 /* Will be filled by the bootloader */
51 memory@10000000 {
52 reg = <0x10000000 0>;
53 };
49}; 54};
50 55
51&sata { 56&sata {
diff --git a/arch/arm/boot/dts/imx6q-ts7970.dts b/arch/arm/boot/dts/imx6q-ts7970.dts
index f19e18995e68..c615ac4feede 100644
--- a/arch/arm/boot/dts/imx6q-ts7970.dts
+++ b/arch/arm/boot/dts/imx6q-ts7970.dts
@@ -47,6 +47,11 @@
47/ { 47/ {
48 model = "Technologic Systems i.MX6 Quad TS-7970 (Default Device Tree)"; 48 model = "Technologic Systems i.MX6 Quad TS-7970 (Default Device Tree)";
49 compatible = "technologic,imx6q-ts7970", "fsl,imx6q"; 49 compatible = "technologic,imx6q-ts7970", "fsl,imx6q";
50
51 /* Will be filled by the bootloader */
52 memory@10000000 {
53 reg = <0x10000000 0>;
54 };
50}; 55};
51 56
52&sata { 57&sata {
diff --git a/arch/arm/boot/dts/imx6q-wandboard-revb1.dts b/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
index 9207d80f9cfb..b763352cddae 100644
--- a/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
+++ b/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Quad Board rev B1"; 16 model = "Wandboard i.MX6 Quad Board rev B1";
17 compatible = "wand,imx6q-wandboard", "fsl,imx6q"; 17 compatible = "wand,imx6q-wandboard", "fsl,imx6q";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6q-wandboard-revd1.dts b/arch/arm/boot/dts/imx6q-wandboard-revd1.dts
index e87ddb168669..8691fab21058 100644
--- a/arch/arm/boot/dts/imx6q-wandboard-revd1.dts
+++ b/arch/arm/boot/dts/imx6q-wandboard-revd1.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Quad Board revD1"; 16 model = "Wandboard i.MX6 Quad Board revD1";
17 compatible = "wand,imx6q-wandboard", "fsl,imx6q"; 17 compatible = "wand,imx6q-wandboard", "fsl,imx6q";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6q-wandboard.dts b/arch/arm/boot/dts/imx6q-wandboard.dts
index 4a8a6ee13e9f..2a3d98c1489a 100644
--- a/arch/arm/boot/dts/imx6q-wandboard.dts
+++ b/arch/arm/boot/dts/imx6q-wandboard.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 Quad Board"; 16 model = "Wandboard i.MX6 Quad Board";
17 compatible = "wand,imx6q-wandboard", "fsl,imx6q"; 17 compatible = "wand,imx6q-wandboard", "fsl,imx6q";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6q-zii-rdu2.dts b/arch/arm/boot/dts/imx6q-zii-rdu2.dts
index 6be8a1eea895..7da6dde9c857 100644
--- a/arch/arm/boot/dts/imx6q-zii-rdu2.dts
+++ b/arch/arm/boot/dts/imx6q-zii-rdu2.dts
@@ -47,4 +47,9 @@
47/ { 47/ {
48 model = "ZII RDU2 Board"; 48 model = "ZII RDU2 Board";
49 compatible = "zii,imx6q-zii-rdu2", "fsl,imx6q"; 49 compatible = "zii,imx6q-zii-rdu2", "fsl,imx6q";
50
51 /* Will be filled by the bootloader */
52 memory@10000000 {
53 reg = <0x10000000 0>;
54 };
50}; 55};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index bc581aa5cf17..ae7b3f107893 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -215,11 +215,6 @@
215 compatible = "fsl,imx-display-subsystem"; 215 compatible = "fsl,imx-display-subsystem";
216 ports = <&ipu1_di0>, <&ipu1_di1>, <&ipu2_di0>, <&ipu2_di1>; 216 ports = <&ipu1_di0>, <&ipu1_di1>, <&ipu2_di0>, <&ipu2_di1>;
217 }; 217 };
218
219 gpu-subsystem {
220 compatible = "fsl,imx-gpu-subsystem";
221 cores = <&gpu_2d>, <&gpu_3d>, <&gpu_vg>;
222 };
223}; 218};
224 219
225&gpio1 { 220&gpio1 {
diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
index 4e776e036cbc..8206683172d2 100644
--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -47,6 +47,11 @@
47 model = "Toradex Apalis iMX6Q/D Module"; 47 model = "Toradex Apalis iMX6Q/D Module";
48 compatible = "toradex,apalis_imx6q", "fsl,imx6q"; 48 compatible = "toradex,apalis_imx6q", "fsl,imx6q";
49 49
50 /* Will be filled by the bootloader */
51 memory@10000000 {
52 reg = <0x10000000 0>;
53 };
54
50 backlight: backlight { 55 backlight: backlight {
51 compatible = "pwm-backlight"; 56 compatible = "pwm-backlight";
52 pinctrl-names = "default"; 57 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
index d1cfdc264126..9332a31e6c8b 100644
--- a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
@@ -42,6 +42,11 @@
42#include <dt-bindings/gpio/gpio.h> 42#include <dt-bindings/gpio/gpio.h>
43 43
44/ { 44/ {
45 /* Will be filled by the bootloader */
46 memory@10000000 {
47 reg = <0x10000000 0>;
48 };
49
45 ir_recv: ir-receiver { 50 ir_recv: ir-receiver {
46 compatible = "gpio-ir-receiver"; 51 compatible = "gpio-ir-receiver";
47 gpios = <&gpio3 9 1>; 52 gpios = <&gpio3 9 1>;
diff --git a/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi
index dea8fc43c692..17a7b9c083d0 100644
--- a/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi
@@ -44,7 +44,7 @@
44 }; 44 };
45 }; 45 };
46 46
47 memory { 47 memory@10000000 {
48 reg = <0x10000000 0x20000000>; 48 reg = <0x10000000 0x20000000>;
49 }; 49 };
50 50
diff --git a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
index 363a44394dad..b8044681006c 100644
--- a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
@@ -59,7 +59,7 @@
59 }; 59 };
60 }; 60 };
61 61
62 memory { 62 memory@10000000 {
63 reg = <0x10000000 0x20000000>; 63 reg = <0x10000000 0x20000000>;
64 }; 64 };
65 65
diff --git a/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi
index c75385c0cad0..629908fbaa32 100644
--- a/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi
@@ -59,7 +59,7 @@
59 }; 59 };
60 }; 60 };
61 61
62 memory { 62 memory@10000000 {
63 reg = <0x10000000 0x40000000>; 63 reg = <0x10000000 0x40000000>;
64 }; 64 };
65 65
diff --git a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi
index eab75f3dbaf3..a1a6fb5541e1 100644
--- a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi
@@ -59,7 +59,7 @@
59 }; 59 };
60 }; 60 };
61 61
62 memory { 62 memory@10000000 {
63 reg = <0x10000000 0x40000000>; 63 reg = <0x10000000 0x40000000>;
64 }; 64 };
65 65
diff --git a/arch/arm/boot/dts/imx6qdl-gw551x.dtsi b/arch/arm/boot/dts/imx6qdl-gw551x.dtsi
index 30d4662d4480..4e21b3849394 100644
--- a/arch/arm/boot/dts/imx6qdl-gw551x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw551x.dtsi
@@ -74,7 +74,7 @@
74 }; 74 };
75 }; 75 };
76 76
77 memory { 77 memory@10000000 {
78 reg = <0x10000000 0x20000000>; 78 reg = <0x10000000 0x20000000>;
79 }; 79 };
80 80
diff --git a/arch/arm/boot/dts/imx6qdl-gw552x.dtsi b/arch/arm/boot/dts/imx6qdl-gw552x.dtsi
index c67c10605070..81dae5b5bc87 100644
--- a/arch/arm/boot/dts/imx6qdl-gw552x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw552x.dtsi
@@ -51,7 +51,7 @@
51 }; 51 };
52 }; 52 };
53 53
54 memory { 54 memory@10000000 {
55 reg = <0x10000000 0x20000000>; 55 reg = <0x10000000 0x20000000>;
56 }; 56 };
57 57
diff --git a/arch/arm/boot/dts/imx6qdl-gw553x.dtsi b/arch/arm/boot/dts/imx6qdl-gw553x.dtsi
index 1a0faa1a14c8..c5d95e8d2e09 100644
--- a/arch/arm/boot/dts/imx6qdl-gw553x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw553x.dtsi
@@ -80,7 +80,7 @@
80 }; 80 };
81 }; 81 };
82 82
83 memory { 83 memory@10000000 {
84 reg = <0x10000000 0x20000000>; 84 reg = <0x10000000 0x20000000>;
85 }; 85 };
86 86
diff --git a/arch/arm/boot/dts/imx6qdl-gw560x.dtsi b/arch/arm/boot/dts/imx6qdl-gw560x.dtsi
index d894dde6e85d..b5986efe1090 100644
--- a/arch/arm/boot/dts/imx6qdl-gw560x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw560x.dtsi
@@ -288,6 +288,7 @@
288 sgtl5000: codec@a { 288 sgtl5000: codec@a {
289 compatible = "fsl,sgtl5000"; 289 compatible = "fsl,sgtl5000";
290 reg = <0x0a>; 290 reg = <0x0a>;
291 #sound-dai-cells = <0>;
291 clocks = <&clks IMX6QDL_CLK_CKO>; 292 clocks = <&clks IMX6QDL_CLK_CKO>;
292 VDDA-supply = <&reg_1p8v>; 293 VDDA-supply = <&reg_1p8v>;
293 VDDIO-supply = <&reg_3p3v>; 294 VDDIO-supply = <&reg_3p3v>;
diff --git a/arch/arm/boot/dts/imx6qdl-gw5903.dtsi b/arch/arm/boot/dts/imx6qdl-gw5903.dtsi
index 444425153fc7..368132274a91 100644
--- a/arch/arm/boot/dts/imx6qdl-gw5903.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw5903.dtsi
@@ -83,7 +83,7 @@
83 }; 83 };
84 }; 84 };
85 85
86 memory { 86 memory@10000000 {
87 reg = <0x10000000 0x40000000>; 87 reg = <0x10000000 0x40000000>;
88 }; 88 };
89 89
diff --git a/arch/arm/boot/dts/imx6qdl-gw5904.dtsi b/arch/arm/boot/dts/imx6qdl-gw5904.dtsi
index fd4b68be9fe9..58124adfd65b 100644
--- a/arch/arm/boot/dts/imx6qdl-gw5904.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-gw5904.dtsi
@@ -93,7 +93,7 @@
93 }; 93 };
94 }; 94 };
95 95
96 memory { 96 memory@10000000 {
97 reg = <0x10000000 0x40000000>; 97 reg = <0x10000000 0x40000000>;
98 }; 98 };
99 99
diff --git a/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi b/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi
index 92583238ca4a..7e20b47de839 100644
--- a/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-hummingboard.dtsi
@@ -40,6 +40,11 @@
40 */ 40 */
41 41
42/ { 42/ {
43 /* Will be filled by the bootloader */
44 memory@10000000 {
45 reg = <0x10000000 0>;
46 };
47
43 chosen { 48 chosen {
44 stdout-path = &uart1; 49 stdout-path = &uart1;
45 }; 50 };
@@ -239,10 +244,9 @@
239 244
240 pinctrl_hummingboard_usbotg_id: hummingboard-usbotg-id { 245 pinctrl_hummingboard_usbotg_id: hummingboard-usbotg-id {
241 /* 246 /*
242 * Similar to pinctrl_usbotg_2, but we want it 247 * We want it pulled down for a fixed host connection.
243 * pulled down for a fixed host connection.
244 */ 248 */
245 fsl,pins = <MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x13059>; 249 fsl,pins = <MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x13059>;
246 }; 250 };
247 251
248 pinctrl_hummingboard_usbotg_vbus: hummingboard-usbotg-vbus { 252 pinctrl_hummingboard_usbotg_vbus: hummingboard-usbotg-vbus {
diff --git a/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi b/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi
index dffbc92e0023..98241acb08a6 100644
--- a/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-hummingboard2.dtsi
@@ -40,6 +40,11 @@
40 */ 40 */
41 41
42/ { 42/ {
43 /* Will be filled by the bootloader */
44 memory@10000000 {
45 reg = <0x10000000 0>;
46 };
47
43 chosen { 48 chosen {
44 stdout-path = &uart1; 49 stdout-path = &uart1;
45 }; 50 };
@@ -191,6 +196,7 @@
191 sgtl5000: codec@a { 196 sgtl5000: codec@a {
192 clocks = <&clks IMX6QDL_CLK_CKO>; 197 clocks = <&clks IMX6QDL_CLK_CKO>;
193 compatible = "fsl,sgtl5000"; 198 compatible = "fsl,sgtl5000";
199 #sound-dai-cells = <0>;
194 pinctrl-names = "default"; 200 pinctrl-names = "default";
195 pinctrl-0 = <&pinctrl_hummingboard2_sgtl5000>; 201 pinctrl-0 = <&pinctrl_hummingboard2_sgtl5000>;
196 reg = <0x0a>; 202 reg = <0x0a>;
@@ -409,8 +415,7 @@
409 415
410 pinctrl_hummingboard2_usbotg_id: hummingboard2-usbotg-id { 416 pinctrl_hummingboard2_usbotg_id: hummingboard2-usbotg-id {
411 /* 417 /*
412 * Similar to pinctrl_usbotg_2, but we want it 418 * We want it pulled down for a fixed host connection.
413 * pulled down for a fixed host connection.
414 */ 419 */
415 fsl,pins = <MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x13059>; 420 fsl,pins = <MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x13059>;
416 }; 421 };
diff --git a/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi b/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
index b6220d62f6de..acc3b11fba2a 100644
--- a/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
@@ -44,7 +44,7 @@
44#include <dt-bindings/sound/fsl-imx-audmux.h> 44#include <dt-bindings/sound/fsl-imx-audmux.h>
45 45
46/ { 46/ {
47 memory { 47 memory@10000000 {
48 reg = <0x10000000 0x80000000>; 48 reg = <0x10000000 0x80000000>;
49 }; 49 };
50 50
@@ -200,7 +200,11 @@
200 status = "okay"; 200 status = "okay";
201 201
202 mdio { 202 mdio {
203 eth_phy: ethernet-phy { 203 #address-cells = <1>;
204 #size-cells = <0>;
205
206 eth_phy: ethernet-phy@0 {
207 reg = <0x0>;
204 rxc-skew-ps = <1140>; 208 rxc-skew-ps = <1140>;
205 txc-skew-ps = <1140>; 209 txc-skew-ps = <1140>;
206 txen-skew-ps = <600>; 210 txen-skew-ps = <600>;
diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi
index a1b469c142f1..b3a463a5908b 100644
--- a/arch/arm/boot/dts/imx6qdl-icore.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi
@@ -45,7 +45,7 @@
45#include <dt-bindings/sound/fsl-imx-audmux.h> 45#include <dt-bindings/sound/fsl-imx-audmux.h>
46 46
47/ { 47/ {
48 memory { 48 memory@10000000 {
49 reg = <0x10000000 0x80000000>; 49 reg = <0x10000000 0x80000000>;
50 }; 50 };
51 51
diff --git a/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi b/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi
index 4cc4e23cf99c..aab088f318e8 100644
--- a/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi
@@ -46,7 +46,7 @@
46 stdout-path = &uart2; 46 stdout-path = &uart2;
47 }; 47 };
48 48
49 memory { 49 memory@10000000 {
50 reg = <0x10000000 0x20000000>; 50 reg = <0x10000000 0x20000000>;
51 }; 51 };
52 52
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
index fd05f7caa472..87ca6ead4098 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
@@ -46,7 +46,7 @@
46 stdout-path = &uart2; 46 stdout-path = &uart2;
47 }; 47 };
48 48
49 memory { 49 memory@10000000 {
50 reg = <0x10000000 0xF0000000>; 50 reg = <0x10000000 0xF0000000>;
51 }; 51 };
52 52
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi
index 40942d6b94b3..f5b763d39285 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi
@@ -46,7 +46,7 @@
46 stdout-path = &uart2; 46 stdout-path = &uart2;
47 }; 47 };
48 48
49 memory { 49 memory@10000000 {
50 reg = <0x10000000 0x40000000>; 50 reg = <0x10000000 0x40000000>;
51 }; 51 };
52 52
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
index 919b6b7619a4..596866b0a0d2 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
@@ -48,7 +48,7 @@
48 stdout-path = &uart2; 48 stdout-path = &uart2;
49 }; 49 };
50 50
51 memory { 51 memory@10000000 {
52 reg = <0x10000000 0x40000000>; 52 reg = <0x10000000 0x40000000>;
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-mira.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-mira.dtsi
new file mode 100644
index 000000000000..9ebd438dce7d
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-phytec-mira.dtsi
@@ -0,0 +1,390 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Christian Hemp <c.hemp@phytec.de>
5 */
6
7
8/ {
9 aliases {
10 rtc0 = &i2c_rtc;
11 };
12
13 backlight: backlight {
14 compatible = "pwm-backlight";
15 brightness-levels = <0 4 8 16 32 64 128 255>;
16 default-brightness-level = <7>;
17 power-supply = <&reg_backlight>;
18 pwms = <&pwm1 0 5000000>;
19 status = "okay";
20 };
21
22 gpio_leds: leds {
23 compatible = "gpio-leds";
24 pinctrl-names = "default";
25 pinctrl-0 = <&pinctrl_gpioleds>;
26 status = "disabled";
27
28 red {
29 label = "phyboard-mira:red";
30 gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>;
31 };
32
33 green {
34 label = "phyboard-mira:green";
35 gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>;
36 };
37
38 blue {
39 label = "phyboard-mira:blue";
40 gpios = <&gpio5 24 GPIO_ACTIVE_HIGH>;
41 linux,default-trigger = "mmc0";
42 };
43 };
44
45 reg_backlight: regulator-backlight {
46 compatible = "regulator-fixed";
47 regulator-name = "backlight_3v3";
48 regulator-min-microvolt = <3300000>;
49 regulator-max-microvolt = <3300000>;
50 regulator-always-on;
51 };
52
53 reg_en_switch: regulator-en-switch {
54 compatible = "regulator-fixed";
55 pinctrl-names = "default";
56 pinctrl-0 = <&pinctrl_en_switch>;
57 regulator-name = "Enable Switch";
58 regulator-min-microvolt = <3300000>;
59 regulator-max-microvolt = <3300000>;
60 enable-active-high;
61 gpio = <&gpio3 4 GPIO_ACTIVE_HIGH>;
62 regulator-always-on;
63 };
64
65 reg_flexcan1: regulator-flexcan1 {
66 compatible = "regulator-fixed";
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_flexcan1_en>;
69 regulator-name = "flexcan1-reg";
70 regulator-min-microvolt = <1500000>;
71 regulator-max-microvolt = <1500000>;
72 gpio = <&gpio2 20 GPIO_ACTIVE_HIGH>;
73 enable-active-high;
74 };
75
76 reg_panel: regulator-panel {
77 compatible = "regulator-fixed";
78 regulator-name = "panel-power-supply";
79 regulator-min-microvolt = <12000000>;
80 regulator-max-microvolt = <12000000>;
81 regulator-always-on;
82 };
83
84 reg_pcie: regulator-pcie {
85 compatible = "regulator-fixed";
86 pinctrl-names = "default";
87 pinctrl-0 = <&pinctrl_pcie_reg>;
88 regulator-name = "mPCIe_1V5";
89 regulator-min-microvolt = <1500000>;
90 regulator-max-microvolt = <1500000>;
91 gpio = <&gpio3 0 GPIO_ACTIVE_HIGH>;
92 enable-active-high;
93 };
94
95 reg_usb_h1_vbus: usb-h1-vbus {
96 compatible = "regulator-fixed";
97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_usbh1_vbus>;
99 regulator-name = "usb_h1_vbus";
100 regulator-min-microvolt = <5000000>;
101 regulator-max-microvolt = <5000000>;
102 gpio = <&gpio2 18 GPIO_ACTIVE_HIGH>;
103 enable-active-high;
104 };
105
106 reg_usbotg_vbus: usbotg-vbus {
107 compatible = "regulator-fixed";
108 pinctrl-names = "default";
109 pinctrl-0 = <&pinctrl_usbotg_vbus>;
110 regulator-name = "usb_otg_vbus";
111 regulator-min-microvolt = <5000000>;
112 regulator-max-microvolt = <5000000>;
113 gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
114 enable-active-high;
115 };
116
117 panel {
118 compatible = "auo,g104sn02";
119 pinctrl-names = "default";
120 pinctrl-0 = <&pinctrl_panel_en>;
121 power-supply = <&reg_panel>;
122 enable-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
123 backlight = <&backlight>;
124
125 port {
126 panel_in: endpoint {
127 remote-endpoint = <&lvds0_out>;
128 };
129 };
130 };
131};
132
133&can1 {
134 pinctrl-names = "default";
135 pinctrl-0 = <&pinctrl_flexcan1>;
136 xceiver-supply = <&reg_flexcan1>;
137 status = "disabled";
138};
139
140&hdmi {
141 pinctrl-names = "default";
142 pinctrl-0 = <&pinctrl_hdmicec>;
143 ddc-i2c-bus = <&i2c2>;
144 status = "disabled";
145};
146
147&i2c1 {
148 pinctrl-names = "default";
149 pinctrl-0 = <&pinctrl_i2c1>;
150 clock-frequency = <400000>;
151 status = "disabled";
152
153 stmpe: touchctrl@44 {
154 compatible = "st,stmpe811";
155 pinctrl-names = "default";
156 pinctrl-0 = <&pinctrl_stmpe>;
157 reg = <0x44>;
158 interrupt-parent = <&gpio7>;
159 interrupts = <12 IRQ_TYPE_NONE>;
160 status = "disabled";
161
162 stmpe_touchscreen {
163 compatible = "st,stmpe-ts";
164 st,sample-time = <4>;
165 st,mod-12b = <1>;
166 st,ref-sel = <0>;
167 st,adc-freq = <1>;
168 st,ave-ctrl = <1>;
169 st,touch-det-delay = <2>;
170 st,settling = <2>;
171 st,fraction-z = <7>;
172 st,i-drive = <1>;
173 };
174 };
175
176 i2c_rtc: rtc@68 {
177 compatible = "microcrystal,rv4162";
178 pinctrl-names = "default";
179 pinctrl-0 = <&pinctrl_rtc_int>;
180 reg = <0x68>;
181 interrupt-parent = <&gpio7>;
182 interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
183 status = "disabled";
184 };
185};
186
187&i2c2 {
188 pinctrl-names = "default";
189 pinctrl-0 = <&pinctrl_i2c2>;
190 clock-frequency = <100000>;
191 status = "disabled";
192};
193
194&ldb {
195 status = "okay";
196
197 lvds-channel@0 {
198 fsl,data-mapping = "spwg";
199 fsl,data-width = <24>;
200 status = "disabled";
201
202 port@4 {
203 reg = <4>;
204
205 lvds0_out: endpoint {
206 remote-endpoint = <&panel_in>;
207 };
208 };
209 };
210};
211
212&pcie {
213 pinctrl-names = "default";
214 pinctrl-0 = <&pinctrl_pcie>;
215 reset-gpio = <&gpio2 25 GPIO_ACTIVE_LOW>;
216 vpcie-supply = <&reg_pcie>;
217 status = "disabled";
218};
219
220&pwm1 {
221 pinctrl-names = "default";
222 pinctrl-0 = <&pinctrl_pwm1>;
223 status = "okay";
224};
225
226&uart2 {
227 pinctrl-names = "default";
228 pinctrl-0 = <&pinctrl_uart2>;
229 status = "okay";
230};
231
232&uart3 {
233 pinctrl-names = "default";
234 pinctrl-0 = <&pinctrl_uart3>;
235 uart-has-rtscts;
236 status = "disabled";
237};
238
239&usbh1 {
240 vbus-supply = <&reg_usb_h1_vbus>;
241 disable-over-current;
242 status = "disabled";
243};
244
245&usbotg {
246 pinctrl-names = "default";
247 pinctrl-0 = <&pinctrl_usbotg>;
248 vbus-supply = <&reg_usbotg_vbus>;
249 disable-over-current;
250 status = "disabled";
251};
252
253&usdhc1 {
254 pinctrl-names = "default";
255 pinctrl-0 = <&pinctrl_usdhc1>;
256 cd-gpios = <&gpio6 31 GPIO_ACTIVE_LOW>;
257 no-1-8-v;
258 status = "disabled";
259};
260
261&iomuxc {
262 pinctrl_panel_en: panelen1grp {
263 fsl,pins = <
264 MX6QDL_PAD_EIM_EB0__GPIO2_IO28 0xb0b1
265 >;
266 };
267
268 pinctrl_en_switch: enswitchgrp {
269 fsl,pins = <
270 MX6QDL_PAD_EIM_DA4__GPIO3_IO04 0xb0b1
271 >;
272 };
273
274 pinctrl_flexcan1: flexcan1grp {
275 fsl,pins = <
276 MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x1b0b0
277 MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x1b0b0
278 >;
279 };
280
281 pinctrl_flexcan1_en: flexcan1engrp {
282 fsl,pins = <
283 MX6QDL_PAD_EIM_A18__GPIO2_IO20 0xb0b1
284 >;
285 };
286
287 pinctrl_gpioleds: gpioledsgrp {
288 fsl,pins = <
289 MX6QDL_PAD_CSI0_DAT4__GPIO5_IO22 0x1b0b0
290 MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 0x1b0b0
291 MX6QDL_PAD_CSI0_DAT6__GPIO5_IO24 0x1b0b0
292 >;
293 };
294
295 pinctrl_hdmicec: hdmicecgrp {
296 fsl,pins = <
297 MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE 0x1f8b0
298 >;
299 };
300
301 pinctrl_i2c2: i2c2grp {
302 fsl,pins = <
303 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
304 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
305 >;
306 };
307
308 pinctrl_i2c1: i2c1grp {
309 fsl,pins = <
310 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
311 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
312 >;
313 };
314
315 pinctrl_pcie: pciegrp {
316 fsl,pins = <
317 MX6QDL_PAD_EIM_OE__GPIO2_IO25 0xb0b1
318 >;
319 };
320
321 pinctrl_pcie_reg: pciereggrp {
322 fsl,pins = <
323 MX6QDL_PAD_EIM_DA0__GPIO3_IO00 0xb0b1
324 >;
325 };
326
327 pinctrl_pwm1: pwm1grp {
328 fsl,pins = <
329 MX6QDL_PAD_GPIO_9__PWM1_OUT 0x1b0b1
330 >;
331 };
332
333 pinctrl_rtc_int: rtcintgrp {
334 fsl,pins = <
335 MX6QDL_PAD_SD3_RST__GPIO7_IO08 0x1b0b0
336 >;
337 };
338
339 pinctrl_stmpe: stmpegrp {
340 fsl,pins = <
341 MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x1b0b0
342 >;
343 };
344
345 pinctrl_uart2: uart2grp {
346 fsl,pins = <
347 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
348 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
349 >;
350 };
351
352 pinctrl_uart3: uart3grp {
353 fsl,pins = <
354 MX6QDL_PAD_EIM_EB3__UART3_CTS_B 0x1b0b1
355 MX6QDL_PAD_EIM_D23__UART3_RTS_B 0x1b0b1
356 MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
357 MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
358 >;
359 };
360
361 pinctrl_usbh1_vbus: usbh1vbusgrp {
362 fsl,pins = <
363 MX6QDL_PAD_EIM_A20__GPIO2_IO18 0xb0b1
364 >;
365 };
366
367 pinctrl_usbotg: usbotggrp {
368 fsl,pins = <
369 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
370 >;
371 };
372
373 pinctrl_usbotg_vbus: usbotgvbusgrp {
374 fsl,pins = <
375 MX6QDL_PAD_EIM_A19__GPIO2_IO19 0xb0b1
376 >;
377 };
378
379 pinctrl_usdhc1: usdhc1grp {
380 fsl,pins = <
381 MX6QDL_PAD_SD1_CMD__SD1_CMD 0x170f9
382 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x100f9
383 MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x170f9
384 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x170f9
385 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x170f9
386 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x170f9
387 MX6QDL_PAD_EIM_BCLK__GPIO6_IO31 0xb0b1 /* CD */
388 >;
389 };
390};
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
index 585b4f6986c1..7ba317ae899b 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
@@ -13,7 +13,7 @@
13 13
14/ { 14/ {
15 chosen { 15 chosen {
16 linux,stdout-path = &uart4; 16 stdout-path = &uart4;
17 }; 17 };
18 18
19 regulators { 19 regulators {
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
index d81b0078a100..c58f3443d55d 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
@@ -15,7 +15,7 @@
15 model = "Phytec phyFLEX-i.MX6 Quad"; 15 model = "Phytec phyFLEX-i.MX6 Quad";
16 compatible = "phytec,imx6q-pfla02", "fsl,imx6q"; 16 compatible = "phytec,imx6q-pfla02", "fsl,imx6q";
17 17
18 memory { 18 memory@10000000 {
19 reg = <0x10000000 0x80000000>; 19 reg = <0x10000000 0x80000000>;
20 }; 20 };
21 21
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi
new file mode 100644
index 000000000000..6486df3e2942
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-phytec-phycore-som.dtsi
@@ -0,0 +1,279 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Christian Hemp <c.hemp@phytec.de>
5 */
6
7#include <dt-bindings/gpio/gpio.h>
8
9/ {
10 aliases {
11 rtc1 = &da9062_rtc;
12 rtc2 = &snvs_rtc;
13 };
14
15 /*
16 * Set the minimum memory size here and
17 * let the bootloader set the real size.
18 */
19 memory@10000000 {
20 device_type = "memory";
21 reg = <0x10000000 0x8000000>;
22 };
23
24 gpio_leds_som: somleds {
25 compatible = "gpio-leds";
26 pinctrl-names = "default";
27 pinctrl-0 = <&pinctrl_gpioleds_som>;
28
29 som-led-green {
30 label = "phycore:green";
31 gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
32 linux,default-trigger = "heartbeat";
33 };
34 };
35};
36
37&ecspi1 {
38 pinctrl-names = "default";
39 pinctrl-0 = <&pinctrl_ecspi1>;
40 cs-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
41 status = "okay";
42
43 m25p80: flash@0 {
44 compatible = "jedec,spi-nor";
45 spi-max-frequency = <20000000>;
46 reg = <0>;
47 status = "disabled";
48 };
49};
50
51&fec {
52 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_enet>;
54 phy-handle = <&ethphy>;
55 phy-mode = "rgmii";
56 phy-supply = <&vdd_eth_io>;
57 phy-reset-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
58 status = "disabled";
59
60 mdio {
61 #address-cells = <1>;
62 #size-cells = <0>;
63
64 ethphy: ethernet-phy@3 {
65 reg = <3>;
66 txc-skew-ps = <1680>;
67 rxc-skew-ps = <1860>;
68 };
69 };
70};
71
72&gpmi {
73 pinctrl-names = "default";
74 pinctrl-0 = <&pinctrl_gpmi_nand>;
75 nand-on-flash-bbt;
76 status = "disabled";
77};
78
79&i2c3 {
80 pinctrl-names = "default";
81 pinctrl-0 = <&pinctrl_i2c3>;
82 clock-frequency = <400000>;
83 status = "okay";
84
85 eeprom@50 {
86 compatible = "atmel,24c32";
87 reg = <0x50>;
88 };
89
90 pmic@58 {
91 compatible = "dlg,da9062";
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_pmic>;
94 reg = <0x58>;
95 interrupt-parent = <&gpio1>;
96 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
97 interrupt-controller;
98
99 da9062_rtc: rtc {
100 compatible = "dlg,da9062-rtc";
101 };
102
103 watchdog {
104 compatible = "dlg,da9062-watchdog";
105 };
106
107 regulators {
108 vdd_arm: buck1 {
109 regulator-name = "vdd_arm";
110 regulator-min-microvolt = <730000>;
111 regulator-max-microvolt = <1380000>;
112 regulator-always-on;
113 };
114
115 vdd_soc: buck2 {
116 regulator-name = "vdd_soc";
117 regulator-min-microvolt = <730000>;
118 regulator-max-microvolt = <1380000>;
119 regulator-always-on;
120 };
121
122 vdd_ddr3_1p5: buck3 {
123 regulator-name = "vdd_ddr3";
124 regulator-min-microvolt = <1500000>;
125 regulator-max-microvolt = <1500000>;
126 regulator-always-on;
127 };
128
129 vdd_eth_1p2: buck4 {
130 regulator-name = "vdd_eth";
131 regulator-min-microvolt = <1200000>;
132 regulator-max-microvolt = <1200000>;
133 regulator-always-on;
134 };
135
136 vdd_snvs: ldo1 {
137 regulator-name = "vdd_snvs";
138 regulator-min-microvolt = <3000000>;
139 regulator-max-microvolt = <3000000>;
140 regulator-always-on;
141 };
142
143 vdd_high: ldo2 {
144 regulator-name = "vdd_high";
145 regulator-min-microvolt = <3000000>;
146 regulator-max-microvolt = <3000000>;
147 regulator-always-on;
148 };
149
150 vdd_eth_io: ldo3 {
151 regulator-name = "vdd_eth_io";
152 regulator-min-microvolt = <2500000>;
153 regulator-max-microvolt = <2500000>;
154 };
155
156 vdd_emmc_1p8: ldo4 {
157 regulator-name = "vdd_emmc";
158 regulator-min-microvolt = <1800000>;
159 regulator-max-microvolt = <1800000>;
160 };
161 };
162 };
163};
164
165&reg_arm {
166 vin-supply = <&vdd_arm>;
167};
168
169&reg_pu {
170 vin-supply = <&vdd_soc>;
171};
172
173&reg_soc {
174 vin-supply = <&vdd_soc>;
175};
176
177&snvs_poweroff {
178 status = "okay";
179};
180
181&usdhc4 {
182 pinctrl-names = "default";
183 pinctrl-0 = <&pinctrl_usdhc4>;
184 bus-width = <8>;
185 non-removable;
186 vmmc-supply = <&vdd_emmc_1p8>;
187 status = "disabled";
188};
189
190&iomuxc {
191 pinctrl_enet: enetgrp {
192 fsl,pins = <
193 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
194 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
195 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
196 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
197 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
198 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
199 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
200 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
201 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
202 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
203 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
204 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
205 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
206 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
207 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
208 MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0
209 MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x1b0b0
210 >;
211 };
212
213 pinctrl_gpioleds_som: gpioledssomgrp {
214 fsl,pins = <
215 MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x1b0b0
216 >;
217 };
218
219 pinctrl_gpmi_nand: gpminandgrp {
220 fsl,pins = <
221 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
222 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
223 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
224 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
225 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
226 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
227 MX6QDL_PAD_NANDF_CS2__NAND_CE2_B 0xb0b1
228 MX6QDL_PAD_NANDF_CS3__NAND_CE3_B 0xb0b1
229 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
230 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
231 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
232 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
233 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
234 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
235 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
236 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
237 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
238 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
239 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
240 >;
241 };
242
243 pinctrl_i2c3: i2c3grp {
244 fsl,pins = <
245 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
246 MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
247 >;
248 };
249
250 pinctrl_ecspi1: ecspi1grp {
251 fsl,pins = <
252 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
253 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
254 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
255 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x1b0b0
256 >;
257 };
258
259 pinctrl_pmic: pmicgrp {
260 fsl,pins = <
261 MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x1b0b0
262 >;
263 };
264
265 pinctrl_usdhc4: usdhc4grp {
266 fsl,pins = <
267 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
268 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
269 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
270 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
271 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
272 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
273 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
274 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
275 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
276 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
277 >;
278 };
279};
diff --git a/arch/arm/boot/dts/imx6qdl-rex.dtsi b/arch/arm/boot/dts/imx6qdl-rex.dtsi
index 6e9549ff11da..039e3b8306c4 100644
--- a/arch/arm/boot/dts/imx6qdl-rex.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-rex.dtsi
@@ -137,7 +137,7 @@
137 status = "okay"; 137 status = "okay";
138 138
139 eeprom@57 { 139 eeprom@57 {
140 compatible = "at,24c02"; 140 compatible = "atmel,24c02";
141 reg = <0x57>; 141 reg = <0x57>;
142 }; 142 };
143}; 143};
diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 82d6ccb46982..54b0139e978d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -13,7 +13,7 @@
13#include <dt-bindings/gpio/gpio.h> 13#include <dt-bindings/gpio/gpio.h>
14 14
15/ { 15/ {
16 memory { 16 memory@10000000 {
17 reg = <0x10000000 0x80000000>; 17 reg = <0x10000000 0x80000000>;
18 }; 18 };
19 19
diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
index 35de7adc997b..18b65052553d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
@@ -49,7 +49,7 @@
49 stdout-path = &uart2; 49 stdout-path = &uart2;
50 }; 50 };
51 51
52 memory { 52 memory@10000000 {
53 reg = <0x10000000 0x40000000>; 53 reg = <0x10000000 0x40000000>;
54 }; 54 };
55 55
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 0a50705b9c18..f019f9900369 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -19,7 +19,7 @@
19 stdout-path = &uart1; 19 stdout-path = &uart1;
20 }; 20 };
21 21
22 memory { 22 memory@10000000 {
23 reg = <0x10000000 0x40000000>; 23 reg = <0x10000000 0x40000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/imx6qdl-tx6.dtsi b/arch/arm/boot/dts/imx6qdl-tx6.dtsi
index 6abb66cd7d4a..f015e2d1cf35 100644
--- a/arch/arm/boot/dts/imx6qdl-tx6.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-tx6.dtsi
@@ -61,8 +61,8 @@
61 sdhc1 = &usdhc2; 61 sdhc1 = &usdhc2;
62 }; 62 };
63 63
64 memory { 64 memory@10000000 {
65 reg = <0 0>; /* will be filled by U-Boot */ 65 reg = <0x10000000 0>; /* will be filled by U-Boot */
66 }; 66 };
67 67
68 clocks { 68 clocks {
diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
index 4161b7d4323a..906387915dc5 100644
--- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
@@ -35,7 +35,7 @@
35 pinctrl-names = "default"; 35 pinctrl-names = "default";
36 }; 36 };
37 37
38 memory { 38 memory@10000000 {
39 reg = <0x10000000 0x40000000>; 39 reg = <0x10000000 0x40000000>;
40 }; 40 };
41 41
diff --git a/arch/arm/boot/dts/imx6qdl-var-dart.dtsi b/arch/arm/boot/dts/imx6qdl-var-dart.dtsi
index 421d6f527609..38080c1dfaec 100644
--- a/arch/arm/boot/dts/imx6qdl-var-dart.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-var-dart.dtsi
@@ -10,7 +10,7 @@
10#include <dt-bindings/sound/fsl-imx-audmux.h> 10#include <dt-bindings/sound/fsl-imx-audmux.h>
11 11
12/ { 12/ {
13 memory { 13 memory@10000000 {
14 reg = <0x10000000 0x40000000>; 14 reg = <0x10000000 0x40000000>;
15 }; 15 };
16 16
diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 72f52fcecee1..911f7f0e3cea 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -305,6 +305,15 @@
305 pinctrl-names = "default"; 305 pinctrl-names = "default";
306 pinctrl-0 = <&pinctrl_uart4>; 306 pinctrl-0 = <&pinctrl_uart4>;
307 status = "okay"; 307 status = "okay";
308
309 rave-sp {
310 compatible = "zii,rave-sp-rdu2";
311 current-speed = <1000000>;
312
313 watchdog {
314 compatible = "zii,rave-sp-watchdog";
315 };
316 };
308}; 317};
309 318
310&ecspi1 { 319&ecspi1 {
@@ -498,7 +507,7 @@
498 }; 507 };
499 508
500 eeprom@54 { 509 eeprom@54 {
501 compatible = "at,24c128"; 510 compatible = "atmel,24c128";
502 reg = <0x54>; 511 reg = <0x54>;
503 }; 512 };
504 513
@@ -602,6 +611,8 @@
602 wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; 611 wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
603 vmmc-supply = <&reg_3p3v_sd>; 612 vmmc-supply = <&reg_3p3v_sd>;
604 vqmmc-supply = <&reg_3p3v>; 613 vqmmc-supply = <&reg_3p3v>;
614 no-1-8-v;
615 no-sdio;
605 status = "okay"; 616 status = "okay";
606}; 617};
607 618
@@ -613,6 +624,8 @@
613 wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; 624 wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
614 vmmc-supply = <&reg_3p3v_sd>; 625 vmmc-supply = <&reg_3p3v_sd>;
615 vqmmc-supply = <&reg_3p3v>; 626 vqmmc-supply = <&reg_3p3v>;
627 no-1-8-v;
628 no-sdio;
616 status = "okay"; 629 status = "okay";
617}; 630};
618 631
@@ -622,7 +635,10 @@
622 bus-width = <8>; 635 bus-width = <8>;
623 vmmc-supply = <&reg_3p3v>; 636 vmmc-supply = <&reg_3p3v>;
624 vqmmc-supply = <&reg_3p3v>; 637 vqmmc-supply = <&reg_3p3v>;
638 no-1-8-v;
625 non-removable; 639 non-removable;
640 no-sdio;
641 no-sd;
626 status = "okay"; 642 status = "okay";
627}; 643};
628 644
@@ -805,6 +821,10 @@
805 }; 821 };
806}; 822};
807 823
824&wdog1 {
825 status = "disabled";
826};
827
808&iomuxc { 828&iomuxc {
809 pinctrl_accel: accelgrp { 829 pinctrl_accel: accelgrp {
810 fsl,pins = < 830 fsl,pins = <
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 59ff86695a14..c003e62bf290 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -23,7 +23,7 @@
23 * Also for U-Boot there must be a pre-existing /memory node. 23 * Also for U-Boot there must be a pre-existing /memory node.
24 */ 24 */
25 chosen {}; 25 chosen {};
26 memory { device_type = "memory"; reg = <0 0>; }; 26 memory { device_type = "memory"; };
27 27
28 aliases { 28 aliases {
29 ethernet0 = &fec; 29 ethernet0 = &fec;
@@ -143,7 +143,7 @@
143 }; 143 };
144 }; 144 };
145 145
146 pmu { 146 pmu: pmu {
147 compatible = "arm,cortex-a9-pmu"; 147 compatible = "arm,cortex-a9-pmu";
148 interrupt-parent = <&gpc>; 148 interrupt-parent = <&gpc>;
149 interrupts = <0 94 IRQ_TYPE_LEVEL_HIGH>; 149 interrupts = <0 94 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/imx6qp-phytec-mira-rdk-nand.dts b/arch/arm/boot/dts/imx6qp-phytec-mira-rdk-nand.dts
new file mode 100644
index 000000000000..3618e5316bf4
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qp-phytec-mira-rdk-nand.dts
@@ -0,0 +1,72 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 PHYTEC Messtechnik GmbH
4 * Author: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
5 */
6
7/dts-v1/;
8#include "imx6qp.dtsi"
9#include "imx6qdl-phytec-phycore-som.dtsi"
10#include "imx6qdl-phytec-mira.dtsi"
11
12/ {
13 model = "PHYTEC phyBOARD-Mira QuadPlus Carrier-Board with NAND";
14 compatible = "phytec,imx6qp-pbac06-nand", "phytec,imx6qp-pbac06",
15 "phytec,imx6qdl-pcm058", "fsl,imx6qp";
16
17 chosen {
18 linux,stdout-path = &uart2;
19 };
20};
21
22&can1 {
23 status = "okay";
24};
25
26&fec {
27 status = "okay";
28};
29
30&gpmi {
31 status = "okay";
32};
33
34&hdmi {
35 status = "okay";
36};
37
38&i2c1 {
39 status = "okay";
40};
41
42&i2c2 {
43 status = "okay";
44};
45
46&i2c_rtc {
47 status = "okay";
48};
49
50&m25p80 {
51 status = "okay";
52};
53
54&pcie {
55 status = "okay";
56};
57
58&uart3 {
59 status = "okay";
60};
61
62&usbh1 {
63 status = "okay";
64};
65
66&usbotg {
67 status = "okay";
68};
69
70&usdhc1 {
71 status = "okay";
72};
diff --git a/arch/arm/boot/dts/imx6qp-wandboard-revd1.dts b/arch/arm/boot/dts/imx6qp-wandboard-revd1.dts
index f7badd82ce8a..907ba0c74ba6 100644
--- a/arch/arm/boot/dts/imx6qp-wandboard-revd1.dts
+++ b/arch/arm/boot/dts/imx6qp-wandboard-revd1.dts
@@ -16,7 +16,7 @@
16 model = "Wandboard i.MX6 QuadPlus Board revD1"; 16 model = "Wandboard i.MX6 QuadPlus Board revD1";
17 compatible = "wand,imx6qp-wandboard", "fsl,imx6qp"; 17 compatible = "wand,imx6qp-wandboard", "fsl,imx6qp";
18 18
19 memory { 19 memory@10000000 {
20 reg = <0x10000000 0x80000000>; 20 reg = <0x10000000 0x80000000>;
21 }; 21 };
22}; 22};
diff --git a/arch/arm/boot/dts/imx6qp-zii-rdu2.dts b/arch/arm/boot/dts/imx6qp-zii-rdu2.dts
index 547a76677ab3..de5b50df833c 100644
--- a/arch/arm/boot/dts/imx6qp-zii-rdu2.dts
+++ b/arch/arm/boot/dts/imx6qp-zii-rdu2.dts
@@ -47,4 +47,9 @@
47/ { 47/ {
48 model = "ZII RDU2+ Board"; 48 model = "ZII RDU2+ Board";
49 compatible = "zii,imx6qp-zii-rdu2", "fsl,imx6qp"; 49 compatible = "zii,imx6qp-zii-rdu2", "fsl,imx6qp";
50
51 /* Will be filled by the bootloader */
52 memory@10000000 {
53 reg = <0x10000000 0>;
54 };
50}; 55};
diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
index 2844ab541759..37e792fdc160 100644
--- a/arch/arm/boot/dts/imx6sl-evk.dts
+++ b/arch/arm/boot/dts/imx6sl-evk.dts
@@ -16,7 +16,7 @@
16 model = "Freescale i.MX6 SoloLite EVK Board"; 16 model = "Freescale i.MX6 SoloLite EVK Board";
17 compatible = "fsl,imx6sl-evk", "fsl,imx6sl"; 17 compatible = "fsl,imx6sl-evk", "fsl,imx6sl";
18 18
19 memory { 19 memory@80000000 {
20 reg = <0x80000000 0x40000000>; 20 reg = <0x80000000 0x40000000>;
21 }; 21 };
22 22
diff --git a/arch/arm/boot/dts/imx6sl-warp.dts b/arch/arm/boot/dts/imx6sl-warp.dts
index 72c7745f51d3..404e602e6781 100644
--- a/arch/arm/boot/dts/imx6sl-warp.dts
+++ b/arch/arm/boot/dts/imx6sl-warp.dts
@@ -54,7 +54,7 @@
54 model = "WaRP Board"; 54 model = "WaRP Board";
55 compatible = "warp,imx6sl-warp", "fsl,imx6sl"; 55 compatible = "warp,imx6sl-warp", "fsl,imx6sl";
56 56
57 memory { 57 memory@80000000 {
58 reg = <0x80000000 0x20000000>; 58 reg = <0x80000000 0x20000000>;
59 }; 59 };
60 60
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index ae8df3cf687e..ab6a7e2e7e8f 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -21,7 +21,7 @@
21 * Also for U-Boot there must be a pre-existing /memory node. 21 * Also for U-Boot there must be a pre-existing /memory node.
22 */ 22 */
23 chosen {}; 23 chosen {};
24 memory { device_type = "memory"; reg = <0 0>; }; 24 memory { device_type = "memory"; };
25 25
26 aliases { 26 aliases {
27 ethernet0 = &fec; 27 ethernet0 = &fec;
diff --git a/arch/arm/boot/dts/imx6sx-nitrogen6sx.dts b/arch/arm/boot/dts/imx6sx-nitrogen6sx.dts
index f9d40ee14982..b58f770c40d9 100644
--- a/arch/arm/boot/dts/imx6sx-nitrogen6sx.dts
+++ b/arch/arm/boot/dts/imx6sx-nitrogen6sx.dts
@@ -52,7 +52,7 @@
52 t_lcd = &t_lcd; 52 t_lcd = &t_lcd;
53 }; 53 };
54 54
55 memory { 55 memory@80000000 {
56 reg = <0x80000000 0x40000000>; 56 reg = <0x80000000 0x40000000>;
57 }; 57 };
58 58
diff --git a/arch/arm/boot/dts/imx6sx-sabreauto.dts b/arch/arm/boot/dts/imx6sx-sabreauto.dts
index 240a2864d044..72da5acf35a2 100644
--- a/arch/arm/boot/dts/imx6sx-sabreauto.dts
+++ b/arch/arm/boot/dts/imx6sx-sabreauto.dts
@@ -14,7 +14,7 @@
14 model = "Freescale i.MX6 SoloX Sabre Auto Board"; 14 model = "Freescale i.MX6 SoloX Sabre Auto Board";
15 compatible = "fsl,imx6sx-sabreauto", "fsl,imx6sx"; 15 compatible = "fsl,imx6sx-sabreauto", "fsl,imx6sx";
16 16
17 memory { 17 memory@80000000 {
18 reg = <0x80000000 0x80000000>; 18 reg = <0x80000000 0x80000000>;
19 }; 19 };
20 20
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
index d35aa858f9db..f8f31872fa14 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
+++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
@@ -20,7 +20,7 @@
20 stdout-path = &uart1; 20 stdout-path = &uart1;
21 }; 21 };
22 22
23 memory { 23 memory@80000000 {
24 reg = <0x80000000 0x40000000>; 24 reg = <0x80000000 0x40000000>;
25 }; 25 };
26 26
diff --git a/arch/arm/boot/dts/imx6sx-softing-vining-2000.dts b/arch/arm/boot/dts/imx6sx-softing-vining-2000.dts
index 4d8c6521845f..252175b59247 100644
--- a/arch/arm/boot/dts/imx6sx-softing-vining-2000.dts
+++ b/arch/arm/boot/dts/imx6sx-softing-vining-2000.dts
@@ -20,7 +20,7 @@
20 stdout-path = &uart1; 20 stdout-path = &uart1;
21 }; 21 };
22 22
23 memory { 23 memory@80000000 {
24 reg = <0x80000000 0x40000000>; 24 reg = <0x80000000 0x40000000>;
25 }; 25 };
26 26
diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo-basic.dts b/arch/arm/boot/dts/imx6sx-udoo-neo-basic.dts
index 0c1fc1a8f913..40ccdf43dffc 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo-basic.dts
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo-basic.dts
@@ -48,7 +48,7 @@
48 model = "UDOO Neo Basic"; 48 model = "UDOO Neo Basic";
49 compatible = "udoo,neobasic", "fsl,imx6sx"; 49 compatible = "udoo,neobasic", "fsl,imx6sx";
50 50
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0x20000000>; 52 reg = <0x80000000 0x20000000>;
53 }; 53 };
54}; 54};
diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts b/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
index 5d6c2274ee2b..42bfc8f8f7f6 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo-extended.dts
@@ -48,7 +48,7 @@
48 model = "UDOO Neo Extended"; 48 model = "UDOO Neo Extended";
49 compatible = "udoo,neoextended", "fsl,imx6sx"; 49 compatible = "udoo,neoextended", "fsl,imx6sx";
50 50
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0x40000000>; 52 reg = <0x80000000 0x40000000>;
53 }; 53 };
54}; 54};
diff --git a/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts b/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
index 653ceb29e28b..c84c877f09d4 100644
--- a/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
+++ b/arch/arm/boot/dts/imx6sx-udoo-neo-full.dts
@@ -48,7 +48,7 @@
48 model = "UDOO Neo Full"; 48 model = "UDOO Neo Full";
49 compatible = "udoo,neofull", "fsl,imx6sx"; 49 compatible = "udoo,neofull", "fsl,imx6sx";
50 50
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0x40000000>; 52 reg = <0x80000000 0x40000000>;
53 }; 53 };
54}; 54};
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index fd7879342d0d..49c7205b8db8 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -22,7 +22,7 @@
22 * Also for U-Boot there must be a pre-existing /memory node. 22 * Also for U-Boot there must be a pre-existing /memory node.
23 */ 23 */
24 chosen {}; 24 chosen {};
25 memory { device_type = "memory"; reg = <0 0>; }; 25 memory { device_type = "memory"; };
26 26
27 aliases { 27 aliases {
28 can0 = &flexcan1; 28 can0 = &flexcan1;
@@ -188,6 +188,7 @@
188 <&clks IMX6SX_CLK_GPU>, 188 <&clks IMX6SX_CLK_GPU>,
189 <&clks IMX6SX_CLK_GPU>; 189 <&clks IMX6SX_CLK_GPU>;
190 clock-names = "bus", "core", "shader"; 190 clock-names = "bus", "core", "shader";
191 power-domains = <&pd_pu>;
191 }; 192 };
192 193
193 dma_apbh: dma-apbh@1804000 { 194 dma_apbh: dma-apbh@1804000 {
@@ -767,6 +768,18 @@
767 #address-cells = <1>; 768 #address-cells = <1>;
768 #size-cells = <0>; 769 #size-cells = <0>;
769 770
771 power-domain@0 {
772 reg = <0>;
773 #power-domain-cells = <0>;
774 };
775
776 pd_pu: power-domain@1 {
777 reg = <1>;
778 #power-domain-cells = <0>;
779 power-supply = <&reg_soc>;
780 clocks = <&clks IMX6SX_CLK_GPU>;
781 };
782
770 pd_pci: power-domain@3 { 783 pd_pci: power-domain@3 {
771 reg = <3>; 784 reg = <3>;
772 #power-domain-cells = <0>; 785 #power-domain-cells = <0>;
@@ -1355,9 +1368,4 @@
1355 status = "disabled"; 1368 status = "disabled";
1356 }; 1369 };
1357 }; 1370 };
1358
1359 gpu-subsystem {
1360 compatible = "fsl,imx-gpu-subsystem";
1361 cores = <&gpu>;
1362 };
1363}; 1371};
diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dts b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
index 18fdb088ba1e..6d720b20e7ed 100644
--- a/arch/arm/boot/dts/imx6ul-14x14-evk.dts
+++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
@@ -9,487 +9,9 @@
9/dts-v1/; 9/dts-v1/;
10 10
11#include "imx6ul.dtsi" 11#include "imx6ul.dtsi"
12#include "imx6ul-14x14-evk.dtsi"
12 13
13/ { 14/ {
14 model = "Freescale i.MX6 UltraLite 14x14 EVK Board"; 15 model = "Freescale i.MX6 UltraLite 14x14 EVK Board";
15 compatible = "fsl,imx6ul-14x14-evk", "fsl,imx6ul"; 16 compatible = "fsl,imx6ul-14x14-evk", "fsl,imx6ul";
16
17 chosen {
18 stdout-path = &uart1;
19 };
20
21 memory {
22 reg = <0x80000000 0x20000000>;
23 };
24
25 backlight_display: backlight-display {
26 compatible = "pwm-backlight";
27 pwms = <&pwm1 0 5000000>;
28 brightness-levels = <0 4 8 16 32 64 128 255>;
29 default-brightness-level = <6>;
30 status = "okay";
31 };
32
33
34 reg_sd1_vmmc: regulator-sd1-vmmc {
35 compatible = "regulator-fixed";
36 regulator-name = "VSD_3V3";
37 regulator-min-microvolt = <3300000>;
38 regulator-max-microvolt = <3300000>;
39 gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
40 enable-active-high;
41 };
42
43 sound {
44 compatible = "simple-audio-card";
45 simple-audio-card,name = "mx6ul-wm8960";
46 simple-audio-card,format = "i2s";
47 simple-audio-card,bitclock-master = <&dailink_master>;
48 simple-audio-card,frame-master = <&dailink_master>;
49 simple-audio-card,widgets =
50 "Microphone", "Mic Jack",
51 "Line", "Line In",
52 "Line", "Line Out",
53 "Speaker", "Speaker",
54 "Headphone", "Headphone Jack";
55 simple-audio-card,routing =
56 "Headphone Jack", "HP_L",
57 "Headphone Jack", "HP_R",
58 "Speaker", "SPK_LP",
59 "Speaker", "SPK_LN",
60 "Speaker", "SPK_RP",
61 "Speaker", "SPK_RN",
62 "LINPUT1", "Mic Jack",
63 "LINPUT3", "Mic Jack",
64 "RINPUT1", "Mic Jack",
65 "RINPUT2", "Mic Jack";
66
67 simple-audio-card,cpu {
68 sound-dai = <&sai2>;
69 };
70
71 dailink_master: simple-audio-card,codec {
72 sound-dai = <&codec>;
73 clocks = <&clks IMX6UL_CLK_SAI2>;
74 };
75 };
76
77 panel {
78 compatible = "innolux,at043tn24";
79 backlight = <&backlight_display>;
80
81 port {
82 panel_in: endpoint {
83 remote-endpoint = <&display_out>;
84 };
85 };
86 };
87};
88
89&clks {
90 assigned-clocks = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
91 assigned-clock-rates = <786432000>;
92};
93
94&i2c2 {
95 clock_frequency = <100000>;
96 pinctrl-names = "default";
97 pinctrl-0 = <&pinctrl_i2c2>;
98 status = "okay";
99
100 codec: wm8960@1a {
101 #sound-dai-cells = <0>;
102 compatible = "wlf,wm8960";
103 reg = <0x1a>;
104 wlf,shared-lrclk;
105 };
106};
107
108&fec1 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_enet1>;
111 phy-mode = "rmii";
112 phy-handle = <&ethphy0>;
113 status = "okay";
114};
115
116&fec2 {
117 pinctrl-names = "default";
118 pinctrl-0 = <&pinctrl_enet2>;
119 phy-mode = "rmii";
120 phy-handle = <&ethphy1>;
121 status = "okay";
122
123 mdio {
124 #address-cells = <1>;
125 #size-cells = <0>;
126
127 ethphy0: ethernet-phy@2 {
128 reg = <2>;
129 micrel,led-mode = <1>;
130 clocks = <&clks IMX6UL_CLK_ENET_REF>;
131 clock-names = "rmii-ref";
132 };
133
134 ethphy1: ethernet-phy@1 {
135 reg = <1>;
136 micrel,led-mode = <1>;
137 clocks = <&clks IMX6UL_CLK_ENET2_REF>;
138 clock-names = "rmii-ref";
139 };
140 };
141};
142
143
144&lcdif {
145 assigned-clocks = <&clks IMX6UL_CLK_LCDIF_PRE_SEL>;
146 assigned-clock-parents = <&clks IMX6UL_CLK_PLL5_VIDEO_DIV>;
147 pinctrl-names = "default";
148 pinctrl-0 = <&pinctrl_lcdif_dat
149 &pinctrl_lcdif_ctrl>;
150 status = "okay";
151
152 port {
153 display_out: endpoint {
154 remote-endpoint = <&panel_in>;
155 };
156 };
157};
158
159&pwm1 {
160 pinctrl-names = "default";
161 pinctrl-0 = <&pinctrl_pwm1>;
162 status = "okay";
163};
164
165&qspi {
166 pinctrl-names = "default";
167 pinctrl-0 = <&pinctrl_qspi>;
168 status = "okay";
169
170 flash0: n25q256a@0 {
171 #address-cells = <1>;
172 #size-cells = <1>;
173 compatible = "micron,n25q256a";
174 spi-max-frequency = <29000000>;
175 reg = <0>;
176 };
177};
178
179&sai2 {
180 pinctrl-names = "default";
181 pinctrl-0 = <&pinctrl_sai2>;
182 assigned-clocks = <&clks IMX6UL_CLK_SAI2_SEL>,
183 <&clks IMX6UL_CLK_SAI2>;
184 assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
185 assigned-clock-rates = <0>, <12288000>;
186 fsl,sai-mclk-direction-output;
187 status = "okay";
188};
189
190&snvs_poweroff {
191 status = "okay";
192};
193
194&tsc {
195 pinctrl-names = "default";
196 pinctrl-0 = <&pinctrl_tsc>;
197 xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
198 measure-delay-time = <0xffff>;
199 pre-charge-time = <0xfff>;
200 status = "okay";
201};
202
203&uart1 {
204 pinctrl-names = "default";
205 pinctrl-0 = <&pinctrl_uart1>;
206 status = "okay";
207};
208
209&uart2 {
210 pinctrl-names = "default";
211 pinctrl-0 = <&pinctrl_uart2>;
212 uart-has-rtscts;
213 status = "okay";
214};
215
216&usbotg1 {
217 dr_mode = "otg";
218 status = "okay";
219};
220
221&usbotg2 {
222 dr_mode = "host";
223 disable-over-current;
224 status = "okay";
225};
226
227&usbphy1 {
228 fsl,tx-d-cal = <106>;
229};
230
231&usbphy2 {
232 fsl,tx-d-cal = <106>;
233};
234
235&usdhc1 {
236 pinctrl-names = "default", "state_100mhz", "state_200mhz";
237 pinctrl-0 = <&pinctrl_usdhc1>;
238 pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
239 pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
240 cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
241 keep-power-in-suspend;
242 wakeup-source;
243 vmmc-supply = <&reg_sd1_vmmc>;
244 status = "okay";
245};
246
247&usdhc2 {
248 pinctrl-names = "default";
249 pinctrl-0 = <&pinctrl_usdhc2>;
250 no-1-8-v;
251 keep-power-in-suspend;
252 wakeup-source;
253 status = "okay";
254};
255
256&wdog1 {
257 pinctrl-names = "default";
258 pinctrl-0 = <&pinctrl_wdog>;
259 fsl,ext-reset-output;
260};
261
262&iomuxc {
263 pinctrl-names = "default";
264
265 pinctrl_csi1: csi1grp {
266 fsl,pins = <
267 MX6UL_PAD_CSI_MCLK__CSI_MCLK 0x1b088
268 MX6UL_PAD_CSI_PIXCLK__CSI_PIXCLK 0x1b088
269 MX6UL_PAD_CSI_VSYNC__CSI_VSYNC 0x1b088
270 MX6UL_PAD_CSI_HSYNC__CSI_HSYNC 0x1b088
271 MX6UL_PAD_CSI_DATA00__CSI_DATA02 0x1b088
272 MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x1b088
273 MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x1b088
274 MX6UL_PAD_CSI_DATA03__CSI_DATA05 0x1b088
275 MX6UL_PAD_CSI_DATA04__CSI_DATA06 0x1b088
276 MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x1b088
277 MX6UL_PAD_CSI_DATA06__CSI_DATA08 0x1b088
278 MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x1b088
279 >;
280 };
281
282 pinctrl_enet1: enet1grp {
283 fsl,pins = <
284 MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
285 MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0
286 MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
287 MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
288 MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
289 MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
290 MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
291 MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031
292 >;
293 };
294
295 pinctrl_enet2: enet2grp {
296 fsl,pins = <
297 MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
298 MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
299 MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
300 MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
301 MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
302 MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
303 MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
304 MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
305 MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
306 MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
307 >;
308 };
309
310 pinctrl_flexcan1: flexcan1grp{
311 fsl,pins = <
312 MX6UL_PAD_UART3_RTS_B__FLEXCAN1_RX 0x1b020
313 MX6UL_PAD_UART3_CTS_B__FLEXCAN1_TX 0x1b020
314 >;
315 };
316
317 pinctrl_flexcan2: flexcan2grp{
318 fsl,pins = <
319 MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX 0x1b020
320 MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX 0x1b020
321 >;
322 };
323
324 pinctrl_i2c1: i2c1grp {
325 fsl,pins = <
326 MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0
327 MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0
328 >;
329 };
330
331 pinctrl_i2c2: i2c2grp {
332 fsl,pins = <
333 MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x4001b8b0
334 MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x4001b8b0
335 >;
336 };
337
338 pinctrl_lcdif_dat: lcdifdatgrp {
339 fsl,pins = <
340 MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x79
341 MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x79
342 MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x79
343 MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x79
344 MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x79
345 MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x79
346 MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x79
347 MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x79
348 MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x79
349 MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x79
350 MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x79
351 MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x79
352 MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x79
353 MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x79
354 MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x79
355 MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x79
356 MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x79
357 MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x79
358 MX6UL_PAD_LCD_DATA18__LCDIF_DATA18 0x79
359 MX6UL_PAD_LCD_DATA19__LCDIF_DATA19 0x79
360 MX6UL_PAD_LCD_DATA20__LCDIF_DATA20 0x79
361 MX6UL_PAD_LCD_DATA21__LCDIF_DATA21 0x79
362 MX6UL_PAD_LCD_DATA22__LCDIF_DATA22 0x79
363 MX6UL_PAD_LCD_DATA23__LCDIF_DATA23 0x79
364 >;
365 };
366
367 pinctrl_lcdif_ctrl: lcdifctrlgrp {
368 fsl,pins = <
369 MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x79
370 MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x79
371 MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x79
372 MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x79
373 /* used for lcd reset */
374 MX6UL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x79
375 >;
376 };
377
378 pinctrl_qspi: qspigrp {
379 fsl,pins = <
380 MX6UL_PAD_NAND_WP_B__QSPI_A_SCLK 0x70a1
381 MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x70a1
382 MX6UL_PAD_NAND_CE0_B__QSPI_A_DATA01 0x70a1
383 MX6UL_PAD_NAND_CE1_B__QSPI_A_DATA02 0x70a1
384 MX6UL_PAD_NAND_CLE__QSPI_A_DATA03 0x70a1
385 MX6UL_PAD_NAND_DQS__QSPI_A_SS0_B 0x70a1
386 >;
387 };
388
389 pinctrl_sai2: sai2grp {
390 fsl,pins = <
391 MX6UL_PAD_JTAG_TDI__SAI2_TX_BCLK 0x17088
392 MX6UL_PAD_JTAG_TDO__SAI2_TX_SYNC 0x17088
393 MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA 0x11088
394 MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA 0x11088
395 MX6UL_PAD_JTAG_TMS__SAI2_MCLK 0x17088
396 MX6UL_PAD_SNVS_TAMPER4__GPIO5_IO04 0x17059
397 >;
398 };
399
400 pinctrl_pwm1: pwm1grp {
401 fsl,pins = <
402 MX6UL_PAD_GPIO1_IO08__PWM1_OUT 0x110b0
403 >;
404 };
405
406 pinctrl_sim2: sim2grp {
407 fsl,pins = <
408 MX6UL_PAD_CSI_DATA03__SIM2_PORT1_PD 0xb808
409 MX6UL_PAD_CSI_DATA04__SIM2_PORT1_CLK 0x31
410 MX6UL_PAD_CSI_DATA05__SIM2_PORT1_RST_B 0xb808
411 MX6UL_PAD_CSI_DATA06__SIM2_PORT1_SVEN 0xb808
412 MX6UL_PAD_CSI_DATA07__SIM2_PORT1_TRXD 0xb809
413 MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x3008
414 >;
415 };
416
417 pinctrl_tsc: tscgrp {
418 fsl,pins = <
419 MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0xb0
420 MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0xb0
421 MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0xb0
422 MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0xb0
423 >;
424 };
425
426 pinctrl_uart1: uart1grp {
427 fsl,pins = <
428 MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1
429 MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b1
430 >;
431 };
432
433 pinctrl_uart2: uart2grp {
434 fsl,pins = <
435 MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1
436 MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1
437 MX6UL_PAD_UART3_RX_DATA__UART2_DCE_RTS 0x1b0b1
438 MX6UL_PAD_UART3_TX_DATA__UART2_DCE_CTS 0x1b0b1
439 >;
440 };
441
442 pinctrl_usdhc1: usdhc1grp {
443 fsl,pins = <
444 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x17059
445 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x10059
446 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x17059
447 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x17059
448 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x17059
449 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x17059
450 MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
451 MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
452 MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
453 >;
454 };
455
456 pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
457 fsl,pins = <
458 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9
459 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9
460 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
461 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
462 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
463 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
464
465 >;
466 };
467
468 pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
469 fsl,pins = <
470 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170f9
471 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100f9
472 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170f9
473 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170f9
474 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170f9
475 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170f9
476 >;
477 };
478
479 pinctrl_usdhc2: usdhc2grp {
480 fsl,pins = <
481 MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x17059
482 MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059
483 MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059
484 MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059
485 MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059
486 MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059
487 >;
488 };
489
490 pinctrl_wdog: wdoggrp {
491 fsl,pins = <
492 MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY 0x30b0
493 >;
494 };
495}; 17};
diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
new file mode 100644
index 000000000000..32a07232c034
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
@@ -0,0 +1,499 @@
1/*
2 * Copyright (C) 2015 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/ {
10 chosen {
11 stdout-path = &uart1;
12 };
13
14 memory@80000000 {
15 reg = <0x80000000 0x20000000>;
16 };
17
18 backlight_display: backlight-display {
19 compatible = "pwm-backlight";
20 pwms = <&pwm1 0 5000000>;
21 brightness-levels = <0 4 8 16 32 64 128 255>;
22 default-brightness-level = <6>;
23 status = "okay";
24 };
25
26
27 reg_sd1_vmmc: regulator-sd1-vmmc {
28 compatible = "regulator-fixed";
29 regulator-name = "VSD_3V3";
30 regulator-min-microvolt = <3300000>;
31 regulator-max-microvolt = <3300000>;
32 gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
33 enable-active-high;
34 };
35
36 sound {
37 compatible = "simple-audio-card";
38 simple-audio-card,name = "mx6ul-wm8960";
39 simple-audio-card,format = "i2s";
40 simple-audio-card,bitclock-master = <&dailink_master>;
41 simple-audio-card,frame-master = <&dailink_master>;
42 simple-audio-card,widgets =
43 "Microphone", "Mic Jack",
44 "Line", "Line In",
45 "Line", "Line Out",
46 "Speaker", "Speaker",
47 "Headphone", "Headphone Jack";
48 simple-audio-card,routing =
49 "Headphone Jack", "HP_L",
50 "Headphone Jack", "HP_R",
51 "Speaker", "SPK_LP",
52 "Speaker", "SPK_LN",
53 "Speaker", "SPK_RP",
54 "Speaker", "SPK_RN",
55 "LINPUT1", "Mic Jack",
56 "LINPUT3", "Mic Jack",
57 "RINPUT1", "Mic Jack",
58 "RINPUT2", "Mic Jack";
59
60 simple-audio-card,cpu {
61 sound-dai = <&sai2>;
62 };
63
64 dailink_master: simple-audio-card,codec {
65 sound-dai = <&codec>;
66 clocks = <&clks IMX6UL_CLK_SAI2>;
67 };
68 };
69
70 panel {
71 compatible = "innolux,at043tn24";
72 backlight = <&backlight_display>;
73
74 port {
75 panel_in: endpoint {
76 remote-endpoint = <&display_out>;
77 };
78 };
79 };
80};
81
82&clks {
83 assigned-clocks = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
84 assigned-clock-rates = <786432000>;
85};
86
87&i2c2 {
88 clock_frequency = <100000>;
89 pinctrl-names = "default";
90 pinctrl-0 = <&pinctrl_i2c2>;
91 status = "okay";
92
93 codec: wm8960@1a {
94 #sound-dai-cells = <0>;
95 compatible = "wlf,wm8960";
96 reg = <0x1a>;
97 wlf,shared-lrclk;
98 };
99};
100
101&fec1 {
102 pinctrl-names = "default";
103 pinctrl-0 = <&pinctrl_enet1>;
104 phy-mode = "rmii";
105 phy-handle = <&ethphy0>;
106 status = "okay";
107};
108
109&fec2 {
110 pinctrl-names = "default";
111 pinctrl-0 = <&pinctrl_enet2>;
112 phy-mode = "rmii";
113 phy-handle = <&ethphy1>;
114 status = "okay";
115
116 mdio {
117 #address-cells = <1>;
118 #size-cells = <0>;
119
120 ethphy0: ethernet-phy@2 {
121 reg = <2>;
122 micrel,led-mode = <1>;
123 clocks = <&clks IMX6UL_CLK_ENET_REF>;
124 clock-names = "rmii-ref";
125 };
126
127 ethphy1: ethernet-phy@1 {
128 reg = <1>;
129 micrel,led-mode = <1>;
130 clocks = <&clks IMX6UL_CLK_ENET2_REF>;
131 clock-names = "rmii-ref";
132 };
133 };
134};
135
136&i2c1 {
137 clock-frequency = <100000>;
138 pinctrl-names = "default";
139 pinctrl-0 = <&pinctrl_i2c1>;
140 status = "okay";
141
142 mag3110@e {
143 compatible = "fsl,mag3110";
144 reg = <0x0e>;
145 };
146};
147
148&lcdif {
149 assigned-clocks = <&clks IMX6UL_CLK_LCDIF_PRE_SEL>;
150 assigned-clock-parents = <&clks IMX6UL_CLK_PLL5_VIDEO_DIV>;
151 pinctrl-names = "default";
152 pinctrl-0 = <&pinctrl_lcdif_dat
153 &pinctrl_lcdif_ctrl>;
154 status = "okay";
155
156 port {
157 display_out: endpoint {
158 remote-endpoint = <&panel_in>;
159 };
160 };
161};
162
163&pwm1 {
164 pinctrl-names = "default";
165 pinctrl-0 = <&pinctrl_pwm1>;
166 status = "okay";
167};
168
169&qspi {
170 pinctrl-names = "default";
171 pinctrl-0 = <&pinctrl_qspi>;
172 status = "okay";
173
174 flash0: n25q256a@0 {
175 #address-cells = <1>;
176 #size-cells = <1>;
177 compatible = "micron,n25q256a";
178 spi-max-frequency = <29000000>;
179 reg = <0>;
180 };
181};
182
183&sai2 {
184 pinctrl-names = "default";
185 pinctrl-0 = <&pinctrl_sai2>;
186 assigned-clocks = <&clks IMX6UL_CLK_SAI2_SEL>,
187 <&clks IMX6UL_CLK_SAI2>;
188 assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
189 assigned-clock-rates = <0>, <12288000>;
190 fsl,sai-mclk-direction-output;
191 status = "okay";
192};
193
194&snvs_poweroff {
195 status = "okay";
196};
197
198&tsc {
199 pinctrl-names = "default";
200 pinctrl-0 = <&pinctrl_tsc>;
201 xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
202 measure-delay-time = <0xffff>;
203 pre-charge-time = <0xfff>;
204 status = "okay";
205};
206
207&uart1 {
208 pinctrl-names = "default";
209 pinctrl-0 = <&pinctrl_uart1>;
210 status = "okay";
211};
212
213&uart2 {
214 pinctrl-names = "default";
215 pinctrl-0 = <&pinctrl_uart2>;
216 uart-has-rtscts;
217 status = "okay";
218};
219
220&usbotg1 {
221 dr_mode = "otg";
222 status = "okay";
223};
224
225&usbotg2 {
226 dr_mode = "host";
227 disable-over-current;
228 status = "okay";
229};
230
231&usbphy1 {
232 fsl,tx-d-cal = <106>;
233};
234
235&usbphy2 {
236 fsl,tx-d-cal = <106>;
237};
238
239&usdhc1 {
240 pinctrl-names = "default", "state_100mhz", "state_200mhz";
241 pinctrl-0 = <&pinctrl_usdhc1>;
242 pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
243 pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
244 cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
245 keep-power-in-suspend;
246 wakeup-source;
247 vmmc-supply = <&reg_sd1_vmmc>;
248 status = "okay";
249};
250
251&usdhc2 {
252 pinctrl-names = "default";
253 pinctrl-0 = <&pinctrl_usdhc2>;
254 no-1-8-v;
255 keep-power-in-suspend;
256 wakeup-source;
257 status = "okay";
258};
259
260&wdog1 {
261 pinctrl-names = "default";
262 pinctrl-0 = <&pinctrl_wdog>;
263 fsl,ext-reset-output;
264};
265
266&iomuxc {
267 pinctrl-names = "default";
268
269 pinctrl_csi1: csi1grp {
270 fsl,pins = <
271 MX6UL_PAD_CSI_MCLK__CSI_MCLK 0x1b088
272 MX6UL_PAD_CSI_PIXCLK__CSI_PIXCLK 0x1b088
273 MX6UL_PAD_CSI_VSYNC__CSI_VSYNC 0x1b088
274 MX6UL_PAD_CSI_HSYNC__CSI_HSYNC 0x1b088
275 MX6UL_PAD_CSI_DATA00__CSI_DATA02 0x1b088
276 MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x1b088
277 MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x1b088
278 MX6UL_PAD_CSI_DATA03__CSI_DATA05 0x1b088
279 MX6UL_PAD_CSI_DATA04__CSI_DATA06 0x1b088
280 MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x1b088
281 MX6UL_PAD_CSI_DATA06__CSI_DATA08 0x1b088
282 MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x1b088
283 >;
284 };
285
286 pinctrl_enet1: enet1grp {
287 fsl,pins = <
288 MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
289 MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0
290 MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
291 MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
292 MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
293 MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
294 MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
295 MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031
296 >;
297 };
298
299 pinctrl_enet2: enet2grp {
300 fsl,pins = <
301 MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
302 MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
303 MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
304 MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
305 MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
306 MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
307 MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
308 MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
309 MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
310 MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
311 >;
312 };
313
314 pinctrl_flexcan1: flexcan1grp{
315 fsl,pins = <
316 MX6UL_PAD_UART3_RTS_B__FLEXCAN1_RX 0x1b020
317 MX6UL_PAD_UART3_CTS_B__FLEXCAN1_TX 0x1b020
318 >;
319 };
320
321 pinctrl_flexcan2: flexcan2grp{
322 fsl,pins = <
323 MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX 0x1b020
324 MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX 0x1b020
325 >;
326 };
327
328 pinctrl_i2c1: i2c1grp {
329 fsl,pins = <
330 MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0
331 MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0
332 >;
333 };
334
335 pinctrl_i2c2: i2c2grp {
336 fsl,pins = <
337 MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x4001b8b0
338 MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x4001b8b0
339 >;
340 };
341
342 pinctrl_lcdif_dat: lcdifdatgrp {
343 fsl,pins = <
344 MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x79
345 MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x79
346 MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x79
347 MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x79
348 MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x79
349 MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x79
350 MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x79
351 MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x79
352 MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x79
353 MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x79
354 MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x79
355 MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x79
356 MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x79
357 MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x79
358 MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x79
359 MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x79
360 MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x79
361 MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x79
362 MX6UL_PAD_LCD_DATA18__LCDIF_DATA18 0x79
363 MX6UL_PAD_LCD_DATA19__LCDIF_DATA19 0x79
364 MX6UL_PAD_LCD_DATA20__LCDIF_DATA20 0x79
365 MX6UL_PAD_LCD_DATA21__LCDIF_DATA21 0x79
366 MX6UL_PAD_LCD_DATA22__LCDIF_DATA22 0x79
367 MX6UL_PAD_LCD_DATA23__LCDIF_DATA23 0x79
368 >;
369 };
370
371 pinctrl_lcdif_ctrl: lcdifctrlgrp {
372 fsl,pins = <
373 MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x79
374 MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x79
375 MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x79
376 MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x79
377 /* used for lcd reset */
378 MX6UL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x79
379 >;
380 };
381
382 pinctrl_qspi: qspigrp {
383 fsl,pins = <
384 MX6UL_PAD_NAND_WP_B__QSPI_A_SCLK 0x70a1
385 MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x70a1
386 MX6UL_PAD_NAND_CE0_B__QSPI_A_DATA01 0x70a1
387 MX6UL_PAD_NAND_CE1_B__QSPI_A_DATA02 0x70a1
388 MX6UL_PAD_NAND_CLE__QSPI_A_DATA03 0x70a1
389 MX6UL_PAD_NAND_DQS__QSPI_A_SS0_B 0x70a1
390 >;
391 };
392
393 pinctrl_sai2: sai2grp {
394 fsl,pins = <
395 MX6UL_PAD_JTAG_TDI__SAI2_TX_BCLK 0x17088
396 MX6UL_PAD_JTAG_TDO__SAI2_TX_SYNC 0x17088
397 MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA 0x11088
398 MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA 0x11088
399 MX6UL_PAD_JTAG_TMS__SAI2_MCLK 0x17088
400 MX6UL_PAD_SNVS_TAMPER4__GPIO5_IO04 0x17059
401 >;
402 };
403
404 pinctrl_pwm1: pwm1grp {
405 fsl,pins = <
406 MX6UL_PAD_GPIO1_IO08__PWM1_OUT 0x110b0
407 >;
408 };
409
410 pinctrl_sim2: sim2grp {
411 fsl,pins = <
412 MX6UL_PAD_CSI_DATA03__SIM2_PORT1_PD 0xb808
413 MX6UL_PAD_CSI_DATA04__SIM2_PORT1_CLK 0x31
414 MX6UL_PAD_CSI_DATA05__SIM2_PORT1_RST_B 0xb808
415 MX6UL_PAD_CSI_DATA06__SIM2_PORT1_SVEN 0xb808
416 MX6UL_PAD_CSI_DATA07__SIM2_PORT1_TRXD 0xb809
417 MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x3008
418 >;
419 };
420
421 pinctrl_tsc: tscgrp {
422 fsl,pins = <
423 MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0xb0
424 MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0xb0
425 MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0xb0
426 MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0xb0
427 >;
428 };
429
430 pinctrl_uart1: uart1grp {
431 fsl,pins = <
432 MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1
433 MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b1
434 >;
435 };
436
437 pinctrl_uart2: uart2grp {
438 fsl,pins = <
439 MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1
440 MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1
441 MX6UL_PAD_UART3_RX_DATA__UART2_DCE_RTS 0x1b0b1
442 MX6UL_PAD_UART3_TX_DATA__UART2_DCE_CTS 0x1b0b1
443 >;
444 };
445
446 pinctrl_usdhc1: usdhc1grp {
447 fsl,pins = <
448 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x17059
449 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x10059
450 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x17059
451 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x17059
452 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x17059
453 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x17059
454 MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
455 MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
456 MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
457 >;
458 };
459
460 pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
461 fsl,pins = <
462 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9
463 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9
464 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
465 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
466 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
467 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
468
469 >;
470 };
471
472 pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
473 fsl,pins = <
474 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170f9
475 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100f9
476 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170f9
477 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170f9
478 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170f9
479 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170f9
480 >;
481 };
482
483 pinctrl_usdhc2: usdhc2grp {
484 fsl,pins = <
485 MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x17059
486 MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059
487 MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059
488 MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059
489 MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059
490 MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059
491 >;
492 };
493
494 pinctrl_wdog: wdoggrp {
495 fsl,pins = <
496 MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY 0x30b0
497 >;
498 };
499};
diff --git a/arch/arm/boot/dts/imx6ul-geam.dts b/arch/arm/boot/dts/imx6ul-geam.dts
index 571eea7f1c6b..d81d20f8fc8d 100644
--- a/arch/arm/boot/dts/imx6ul-geam.dts
+++ b/arch/arm/boot/dts/imx6ul-geam.dts
@@ -50,7 +50,7 @@
50 model = "Engicam GEAM6UL Starter Kit"; 50 model = "Engicam GEAM6UL Starter Kit";
51 compatible = "engicam,imx6ul-geam", "fsl,imx6ul"; 51 compatible = "engicam,imx6ul-geam", "fsl,imx6ul";
52 52
53 memory { 53 memory@80000000 {
54 reg = <0x80000000 0x08000000>; 54 reg = <0x80000000 0x08000000>;
55 }; 55 };
56 56
@@ -181,6 +181,7 @@
181 sgtl5000: codec@a { 181 sgtl5000: codec@a {
182 compatible = "fsl,sgtl5000"; 182 compatible = "fsl,sgtl5000";
183 reg = <0x0a>; 183 reg = <0x0a>;
184 #sound-dai-cells = <0>;
184 clocks = <&clks IMX6UL_CLK_OSC>; 185 clocks = <&clks IMX6UL_CLK_OSC>;
185 clock-names = "mclk"; 186 clock-names = "mclk";
186 VDDA-supply = <&reg_3p3v>; 187 VDDA-supply = <&reg_3p3v>;
diff --git a/arch/arm/boot/dts/imx6ul-isiot.dtsi b/arch/arm/boot/dts/imx6ul-isiot.dtsi
index 950fb28b630a..b0ecebb512b3 100644
--- a/arch/arm/boot/dts/imx6ul-isiot.dtsi
+++ b/arch/arm/boot/dts/imx6ul-isiot.dtsi
@@ -45,7 +45,7 @@
45#include "imx6ul.dtsi" 45#include "imx6ul.dtsi"
46 46
47/ { 47/ {
48 memory { 48 memory@80000000 {
49 reg = <0x80000000 0x20000000>; 49 reg = <0x80000000 0x20000000>;
50 }; 50 };
51 51
diff --git a/arch/arm/boot/dts/imx6ul-litesom.dtsi b/arch/arm/boot/dts/imx6ul-litesom.dtsi
index 039721d3dcb4..8f775f6974d1 100644
--- a/arch/arm/boot/dts/imx6ul-litesom.dtsi
+++ b/arch/arm/boot/dts/imx6ul-litesom.dtsi
@@ -47,7 +47,7 @@
47 model = "Grinn i.MX6UL liteSOM"; 47 model = "Grinn i.MX6UL liteSOM";
48 compatible = "grinn,imx6ul-litesom", "fsl,imx6ul"; 48 compatible = "grinn,imx6ul-litesom", "fsl,imx6ul";
49 49
50 memory { 50 memory@80000000 {
51 reg = <0x80000000 0x20000000>; 51 reg = <0x80000000 0x20000000>;
52 }; 52 };
53}; 53};
diff --git a/arch/arm/boot/dts/imx6ul-opos6ul.dtsi b/arch/arm/boot/dts/imx6ul-opos6ul.dtsi
index aec5ccce0321..a031bee311df 100644
--- a/arch/arm/boot/dts/imx6ul-opos6ul.dtsi
+++ b/arch/arm/boot/dts/imx6ul-opos6ul.dtsi
@@ -48,7 +48,7 @@
48#include "imx6ul.dtsi" 48#include "imx6ul.dtsi"
49 49
50/ { 50/ {
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0>; /* will be filled by U-Boot */ 52 reg = <0x80000000 0>; /* will be filled by U-Boot */
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx6ul-pico-hobbit.dts b/arch/arm/boot/dts/imx6ul-pico-hobbit.dts
index 3bf26ebd4df9..47682b8c023c 100644
--- a/arch/arm/boot/dts/imx6ul-pico-hobbit.dts
+++ b/arch/arm/boot/dts/imx6ul-pico-hobbit.dts
@@ -51,7 +51,7 @@
51 model = "Technexion Pico i.MX6UL Board"; 51 model = "Technexion Pico i.MX6UL Board";
52 compatible = "technexion,imx6ul-pico-hobbit", "fsl,imx6ul"; 52 compatible = "technexion,imx6ul-pico-hobbit", "fsl,imx6ul";
53 53
54 memory { 54 memory@80000000 {
55 reg = <0x80000000 0x10000000>; 55 reg = <0x80000000 0x10000000>;
56 }; 56 };
57 57
diff --git a/arch/arm/boot/dts/imx6ul-pinfunc.h b/arch/arm/boot/dts/imx6ul-pinfunc.h
index 0034eeb84542..7b9a4dc38456 100644
--- a/arch/arm/boot/dts/imx6ul-pinfunc.h
+++ b/arch/arm/boot/dts/imx6ul-pinfunc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2015 Freescale Semiconductor, Inc. 2 * Copyright 2014 - 2015 Freescale Semiconductor, Inc.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -34,14 +34,14 @@
34#define MX6UL_PAD_JTAG_MOD__ENET1_REF_CLK_25M 0x0044 0x02d0 0x0000 3 0 34#define MX6UL_PAD_JTAG_MOD__ENET1_REF_CLK_25M 0x0044 0x02d0 0x0000 3 0
35#define MX6UL_PAD_JTAG_MOD__CCM_PMIC_RDY 0x0044 0x02d0 0x04c0 4 0 35#define MX6UL_PAD_JTAG_MOD__CCM_PMIC_RDY 0x0044 0x02d0 0x04c0 4 0
36#define MX6UL_PAD_JTAG_MOD__GPIO1_IO10 0x0044 0x02d0 0x0000 5 0 36#define MX6UL_PAD_JTAG_MOD__GPIO1_IO10 0x0044 0x02d0 0x0000 5 0
37#define MX6UL_PAD_JTAG_MOD__SDMA_EXT_EVENT00 0x0044 0x02d0 0x0000 6 0 37#define MX6UL_PAD_JTAG_MOD__SDMA_EXT_EVENT00 0x0044 0x02d0 0x0610 6 0
38#define MX6UL_PAD_JTAG_TMS__SJC_TMS 0x0048 0x02d4 0x0000 0 0 38#define MX6UL_PAD_JTAG_TMS__SJC_TMS 0x0048 0x02d4 0x0000 0 0
39#define MX6UL_PAD_JTAG_TMS__GPT2_CAPTURE1 0x0048 0x02d4 0x0598 1 0 39#define MX6UL_PAD_JTAG_TMS__GPT2_CAPTURE1 0x0048 0x02d4 0x0598 1 0
40#define MX6UL_PAD_JTAG_TMS__SAI2_MCLK 0x0048 0x02d4 0x0000 2 0 40#define MX6UL_PAD_JTAG_TMS__SAI2_MCLK 0x0048 0x02d4 0x05f0 2 0
41#define MX6UL_PAD_JTAG_TMS__CCM_CLKO1 0x0048 0x02d4 0x0000 3 0 41#define MX6UL_PAD_JTAG_TMS__CCM_CLKO1 0x0048 0x02d4 0x0000 3 0
42#define MX6UL_PAD_JTAG_TMS__CCM_WAIT 0x0048 0x02d4 0x0000 4 0 42#define MX6UL_PAD_JTAG_TMS__CCM_WAIT 0x0048 0x02d4 0x0000 4 0
43#define MX6UL_PAD_JTAG_TMS__GPIO1_IO11 0x0048 0x02d4 0x0000 5 0 43#define MX6UL_PAD_JTAG_TMS__GPIO1_IO11 0x0048 0x02d4 0x0000 5 0
44#define MX6UL_PAD_JTAG_TMS__SDMA_EXT_EVENT01 0x0048 0x02d4 0x0000 6 0 44#define MX6UL_PAD_JTAG_TMS__SDMA_EXT_EVENT01 0x0048 0x02d4 0x0614 6 0
45#define MX6UL_PAD_JTAG_TMS__EPIT1_OUT 0x0048 0x02d4 0x0000 8 0 45#define MX6UL_PAD_JTAG_TMS__EPIT1_OUT 0x0048 0x02d4 0x0000 8 0
46#define MX6UL_PAD_JTAG_TDO__SJC_TDO 0x004c 0x02d8 0x0000 0 0 46#define MX6UL_PAD_JTAG_TDO__SJC_TDO 0x004c 0x02d8 0x0000 0 0
47#define MX6UL_PAD_JTAG_TDO__GPT2_CAPTURE2 0x004c 0x02d8 0x059c 1 0 47#define MX6UL_PAD_JTAG_TDO__GPT2_CAPTURE2 0x004c 0x02d8 0x059c 1 0
@@ -63,12 +63,14 @@
63#define MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA 0x0054 0x02e0 0x05f4 2 0 63#define MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA 0x0054 0x02e0 0x05f4 2 0
64#define MX6UL_PAD_JTAG_TCK__PWM7_OUT 0x0054 0x02e0 0x0000 4 0 64#define MX6UL_PAD_JTAG_TCK__PWM7_OUT 0x0054 0x02e0 0x0000 4 0
65#define MX6UL_PAD_JTAG_TCK__GPIO1_IO14 0x0054 0x02e0 0x0000 5 0 65#define MX6UL_PAD_JTAG_TCK__GPIO1_IO14 0x0054 0x02e0 0x0000 5 0
66#define MX6UL_PAD_JTAG_TCK__OSC32K_32K_OUT 0x0054 0x02e0 0x0000 6 0
66#define MX6UL_PAD_JTAG_TCK__SIM2_POWER_FAIL 0x0054 0x02e0 0x0000 8 0 67#define MX6UL_PAD_JTAG_TCK__SIM2_POWER_FAIL 0x0054 0x02e0 0x0000 8 0
67#define MX6UL_PAD_JTAG_TRST_B__SJC_TRSTB 0x0058 0x02e4 0x0000 0 0 68#define MX6UL_PAD_JTAG_TRST_B__SJC_TRSTB 0x0058 0x02e4 0x0000 0 0
68#define MX6UL_PAD_JTAG_TRST_B__GPT2_COMPARE3 0x0058 0x02e4 0x0000 1 0 69#define MX6UL_PAD_JTAG_TRST_B__GPT2_COMPARE3 0x0058 0x02e4 0x0000 1 0
69#define MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA 0x0058 0x02e4 0x0000 2 0 70#define MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA 0x0058 0x02e4 0x0000 2 0
70#define MX6UL_PAD_JTAG_TRST_B__PWM8_OUT 0x0058 0x02e4 0x0000 4 0 71#define MX6UL_PAD_JTAG_TRST_B__PWM8_OUT 0x0058 0x02e4 0x0000 4 0
71#define MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15 0x0058 0x02e4 0x0000 5 0 72#define MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15 0x0058 0x02e4 0x0000 5 0
73#define MX6UL_PAD_JTAG_TRST_B__REF_CLK_24M 0x0058 0x02e4 0x0000 6 0
72#define MX6UL_PAD_JTAG_TRST_B__CAAM_RNG_OSC_OBS 0x0058 0x02e4 0x0000 8 0 74#define MX6UL_PAD_JTAG_TRST_B__CAAM_RNG_OSC_OBS 0x0058 0x02e4 0x0000 8 0
73#define MX6UL_PAD_GPIO1_IO00__I2C2_SCL 0x005c 0x02e8 0x05ac 0 1 75#define MX6UL_PAD_GPIO1_IO00__I2C2_SCL 0x005c 0x02e8 0x05ac 0 1
74#define MX6UL_PAD_GPIO1_IO00__GPT1_CAPTURE1 0x005c 0x02e8 0x058c 1 0 76#define MX6UL_PAD_GPIO1_IO00__GPT1_CAPTURE1 0x005c 0x02e8 0x058c 1 0
@@ -94,22 +96,24 @@
94#define MX6UL_PAD_GPIO1_IO02__ENET1_REF_CLK_25M 0x0064 0x02f0 0x0000 3 0 96#define MX6UL_PAD_GPIO1_IO02__ENET1_REF_CLK_25M 0x0064 0x02f0 0x0000 3 0
95#define MX6UL_PAD_GPIO1_IO02__USDHC1_WP 0x0064 0x02f0 0x066c 4 0 97#define MX6UL_PAD_GPIO1_IO02__USDHC1_WP 0x0064 0x02f0 0x066c 4 0
96#define MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0x0064 0x02f0 0x0000 5 0 98#define MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0x0064 0x02f0 0x0000 5 0
97#define MX6UL_PAD_GPIO1_IO02__SDMA_EXT_EVENT00 0x0064 0x02f0 0x0000 6 0 99#define MX6UL_PAD_GPIO1_IO02__SDMA_EXT_EVENT00 0x0064 0x02f0 0x0610 6 1
98#define MX6UL_PAD_GPIO1_IO02__SRC_ANY_PU_RESET 0x0064 0x02f0 0x0000 7 0 100#define MX6UL_PAD_GPIO1_IO02__SRC_ANY_PU_RESET 0x0064 0x02f0 0x0000 7 0
99#define MX6UL_PAD_GPIO1_IO02__UART1_DCE_TX 0x0064 0x02f0 0x0000 8 0 101#define MX6UL_PAD_GPIO1_IO02__UART1_DCE_TX 0x0064 0x02f0 0x0000 8 0
100#define MX6UL_PAD_GPIO1_IO02__UART1_DTE_RX 0x0064 0x02f0 0x0624 8 0 102#define MX6UL_PAD_GPIO1_IO02__UART1_DTE_RX 0x0064 0x02f0 0x0624 8 0
101#define MX6UL_PAD_GPIO1_IO03__I2C1_SDA 0x0068 0x02f4 0x05a8 0 1 103#define MX6UL_PAD_GPIO1_IO03__I2C1_SDA 0x0068 0x02f4 0x05a8 0 1
102#define MX6UL_PAD_GPIO1_IO03__GPT1_COMPARE3 0x0068 0x02f4 0x0000 1 0 104#define MX6UL_PAD_GPIO1_IO03__GPT1_COMPARE3 0x0068 0x02f4 0x0000 1 0
103#define MX6UL_PAD_GPIO1_IO03__USB_OTG2_OC 0x0068 0x02f4 0x0660 2 0 105#define MX6UL_PAD_GPIO1_IO03__USB_OTG2_OC 0x0068 0x02f4 0x0660 2 0
106#define MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT 0x0068 0x02f4 0x0000 3 0
104#define MX6UL_PAD_GPIO1_IO03__USDHC1_CD_B 0x0068 0x02f4 0x0668 4 0 107#define MX6UL_PAD_GPIO1_IO03__USDHC1_CD_B 0x0068 0x02f4 0x0668 4 0
105#define MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x0068 0x02f4 0x0000 5 0 108#define MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x0068 0x02f4 0x0000 5 0
106#define MX6UL_PAD_GPIO1_IO03__CCM_DI0_eXT_CLK 0x0068 0x02f4 0x0000 6 0 109#define MX6UL_PAD_GPIO1_IO03__CCM_DI0_EXT_CLK 0x0068 0x02f4 0x0000 6 0
107#define MX6UL_PAD_GPIO1_IO03__SRC_TESTER_ACK 0x0068 0x02f4 0x0000 7 0 110#define MX6UL_PAD_GPIO1_IO03__SRC_TESTER_ACK 0x0068 0x02f4 0x0000 7 0
108#define MX6UL_PAD_GPIO1_IO03__UART1_DTE_TX 0x0068 0x02f4 0x0000 8 0
109#define MX6UL_PAD_GPIO1_IO03__UART1_DCE_RX 0x0068 0x02f4 0x0624 8 1 111#define MX6UL_PAD_GPIO1_IO03__UART1_DCE_RX 0x0068 0x02f4 0x0624 8 1
112#define MX6UL_PAD_GPIO1_IO03__UART1_DTE_TX 0x0068 0x02f4 0x0000 8 0
110#define MX6UL_PAD_GPIO1_IO04__ENET1_REF_CLK1 0x006c 0x02f8 0x0574 0 1 113#define MX6UL_PAD_GPIO1_IO04__ENET1_REF_CLK1 0x006c 0x02f8 0x0574 0 1
111#define MX6UL_PAD_GPIO1_IO04__PWM3_OUT 0x006c 0x02f8 0x0000 1 0 114#define MX6UL_PAD_GPIO1_IO04__PWM3_OUT 0x006c 0x02f8 0x0000 1 0
112#define MX6UL_PAD_GPIO1_IO04__USB_OTG1_PWR 0x006c 0x02f8 0x0000 2 0 115#define MX6UL_PAD_GPIO1_IO04__USB_OTG1_PWR 0x006c 0x02f8 0x0000 2 0
116#define MX6UL_PAD_GPIO1_IO04__REF_CLK_24M 0x006c 0x02f8 0x0000 3 0
113#define MX6UL_PAD_GPIO1_IO04__USDHC1_RESET_B 0x006c 0x02f8 0x0000 4 0 117#define MX6UL_PAD_GPIO1_IO04__USDHC1_RESET_B 0x006c 0x02f8 0x0000 4 0
114#define MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x006c 0x02f8 0x0000 5 0 118#define MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x006c 0x02f8 0x0000 5 0
115#define MX6UL_PAD_GPIO1_IO04__ENET2_1588_EVENT0_IN 0x006c 0x02f8 0x0000 6 0 119#define MX6UL_PAD_GPIO1_IO04__ENET2_1588_EVENT0_IN 0x006c 0x02f8 0x0000 6 0
@@ -200,7 +204,7 @@
200#define MX6UL_PAD_UART2_TX_DATA__CSI_DATA06 0x0094 0x0320 0x04dc 3 0 204#define MX6UL_PAD_UART2_TX_DATA__CSI_DATA06 0x0094 0x0320 0x04dc 3 0
201#define MX6UL_PAD_UART2_TX_DATA__GPT1_CAPTURE1 0x0094 0x0320 0x058c 4 1 205#define MX6UL_PAD_UART2_TX_DATA__GPT1_CAPTURE1 0x0094 0x0320 0x058c 4 1
202#define MX6UL_PAD_UART2_TX_DATA__GPIO1_IO20 0x0094 0x0320 0x0000 5 0 206#define MX6UL_PAD_UART2_TX_DATA__GPIO1_IO20 0x0094 0x0320 0x0000 5 0
203#define MX6UL_PAD_UART2_TX_DATA__ECSPI3_SS0 0x0094 0x0320 0x0000 8 0 207#define MX6UL_PAD_UART2_TX_DATA__ECSPI3_SS0 0x0094 0x0320 0x0560 8 0
204#define MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x0098 0x0324 0x062c 0 1 208#define MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x0098 0x0324 0x062c 0 1
205#define MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x0098 0x0324 0x0000 0 0 209#define MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x0098 0x0324 0x0000 0 0
206#define MX6UL_PAD_UART2_RX_DATA__ENET1_TDATA03 0x0098 0x0324 0x0000 1 0 210#define MX6UL_PAD_UART2_RX_DATA__ENET1_TDATA03 0x0098 0x0324 0x0000 1 0
@@ -232,7 +236,7 @@
232#define MX6UL_PAD_UART3_TX_DATA__UART3_DTE_RX 0x00a4 0x0330 0x0634 0 0 236#define MX6UL_PAD_UART3_TX_DATA__UART3_DTE_RX 0x00a4 0x0330 0x0634 0 0
233#define MX6UL_PAD_UART3_TX_DATA__ENET2_RDATA02 0x00a4 0x0330 0x0000 1 0 237#define MX6UL_PAD_UART3_TX_DATA__ENET2_RDATA02 0x00a4 0x0330 0x0000 1 0
234#define MX6UL_PAD_UART3_TX_DATA__SIM1_PORT0_PD 0x00a4 0x0330 0x0000 2 0 238#define MX6UL_PAD_UART3_TX_DATA__SIM1_PORT0_PD 0x00a4 0x0330 0x0000 2 0
235#define MX6UL_PAD_UART3_TX_DATA__CSI_DATA01 0x00a4 0x0330 0x0000 3 0 239#define MX6UL_PAD_UART3_TX_DATA__CSI_DATA01 0x00a4 0x0330 0x04d4 3 0
236#define MX6UL_PAD_UART3_TX_DATA__UART2_DCE_CTS 0x00a4 0x0330 0x0000 4 0 240#define MX6UL_PAD_UART3_TX_DATA__UART2_DCE_CTS 0x00a4 0x0330 0x0000 4 0
237#define MX6UL_PAD_UART3_TX_DATA__UART2_DTE_RTS 0x00a4 0x0330 0x0628 4 2 241#define MX6UL_PAD_UART3_TX_DATA__UART2_DTE_RTS 0x00a4 0x0330 0x0628 4 2
238#define MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x00a4 0x0330 0x0000 5 0 242#define MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x00a4 0x0330 0x0000 5 0
@@ -242,7 +246,7 @@
242#define MX6UL_PAD_UART3_RX_DATA__UART3_DTE_TX 0x00a8 0x0334 0x0000 0 0 246#define MX6UL_PAD_UART3_RX_DATA__UART3_DTE_TX 0x00a8 0x0334 0x0000 0 0
243#define MX6UL_PAD_UART3_RX_DATA__ENET2_RDATA03 0x00a8 0x0334 0x0000 1 0 247#define MX6UL_PAD_UART3_RX_DATA__ENET2_RDATA03 0x00a8 0x0334 0x0000 1 0
244#define MX6UL_PAD_UART3_RX_DATA__SIM2_PORT0_PD 0x00a8 0x0334 0x0000 2 0 248#define MX6UL_PAD_UART3_RX_DATA__SIM2_PORT0_PD 0x00a8 0x0334 0x0000 2 0
245#define MX6UL_PAD_UART3_RX_DATA__CSI_DATA00 0x00a8 0x0334 0x0000 3 0 249#define MX6UL_PAD_UART3_RX_DATA__CSI_DATA00 0x00a8 0x0334 0x04d0 3 0
246#define MX6UL_PAD_UART3_RX_DATA__UART2_DCE_RTS 0x00a8 0x0334 0x0628 4 3 250#define MX6UL_PAD_UART3_RX_DATA__UART2_DCE_RTS 0x00a8 0x0334 0x0628 4 3
247#define MX6UL_PAD_UART3_RX_DATA__UART2_DTE_CTS 0x00a8 0x0334 0x0000 4 0 251#define MX6UL_PAD_UART3_RX_DATA__UART2_DTE_CTS 0x00a8 0x0334 0x0000 4 0
248#define MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x00a8 0x0334 0x0000 5 0 252#define MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x00a8 0x0334 0x0000 5 0
@@ -251,7 +255,7 @@
251#define MX6UL_PAD_UART3_CTS_B__UART3_DTE_RTS 0x00ac 0x0338 0x0630 0 0 255#define MX6UL_PAD_UART3_CTS_B__UART3_DTE_RTS 0x00ac 0x0338 0x0630 0 0
252#define MX6UL_PAD_UART3_CTS_B__ENET2_RX_CLK 0x00ac 0x0338 0x0000 1 0 256#define MX6UL_PAD_UART3_CTS_B__ENET2_RX_CLK 0x00ac 0x0338 0x0000 1 0
253#define MX6UL_PAD_UART3_CTS_B__FLEXCAN1_TX 0x00ac 0x0338 0x0000 2 0 257#define MX6UL_PAD_UART3_CTS_B__FLEXCAN1_TX 0x00ac 0x0338 0x0000 2 0
254#define MX6UL_PAD_UART3_CTS_B__CSI_DATA10 0x00ac 0x0338 0x0000 3 0 258#define MX6UL_PAD_UART3_CTS_B__CSI_DATA10 0x00ac 0x0338 0x04ec 3 0
255#define MX6UL_PAD_UART3_CTS_B__ENET1_1588_EVENT1_IN 0x00ac 0x0338 0x0000 4 0 259#define MX6UL_PAD_UART3_CTS_B__ENET1_1588_EVENT1_IN 0x00ac 0x0338 0x0000 4 0
256#define MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x00ac 0x0338 0x0000 5 0 260#define MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x00ac 0x0338 0x0000 5 0
257#define MX6UL_PAD_UART3_CTS_B__EPIT2_OUT 0x00ac 0x0338 0x0000 8 0 261#define MX6UL_PAD_UART3_CTS_B__EPIT2_OUT 0x00ac 0x0338 0x0000 8 0
@@ -259,7 +263,7 @@
259#define MX6UL_PAD_UART3_RTS_B__UART3_DTE_CTS 0x00b0 0x033c 0x0000 0 0 263#define MX6UL_PAD_UART3_RTS_B__UART3_DTE_CTS 0x00b0 0x033c 0x0000 0 0
260#define MX6UL_PAD_UART3_RTS_B__ENET2_TX_ER 0x00b0 0x033c 0x0000 1 0 264#define MX6UL_PAD_UART3_RTS_B__ENET2_TX_ER 0x00b0 0x033c 0x0000 1 0
261#define MX6UL_PAD_UART3_RTS_B__FLEXCAN1_RX 0x00b0 0x033c 0x0584 2 0 265#define MX6UL_PAD_UART3_RTS_B__FLEXCAN1_RX 0x00b0 0x033c 0x0584 2 0
262#define MX6UL_PAD_UART3_RTS_B__CSI_DATA11 0x00b0 0x033c 0x0000 3 0 266#define MX6UL_PAD_UART3_RTS_B__CSI_DATA11 0x00b0 0x033c 0x04f0 3 0
263#define MX6UL_PAD_UART3_RTS_B__ENET1_1588_EVENT1_OUT 0x00b0 0x033c 0x0000 4 0 267#define MX6UL_PAD_UART3_RTS_B__ENET1_1588_EVENT1_OUT 0x00b0 0x033c 0x0000 4 0
264#define MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x00b0 0x033c 0x0000 5 0 268#define MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x00b0 0x033c 0x0000 5 0
265#define MX6UL_PAD_UART3_RTS_B__WDOG1_WDOG_B 0x00b0 0x033c 0x0000 8 0 269#define MX6UL_PAD_UART3_RTS_B__WDOG1_WDOG_B 0x00b0 0x033c 0x0000 8 0
@@ -267,7 +271,7 @@
267#define MX6UL_PAD_UART4_TX_DATA__UART4_DTE_RX 0x00b4 0x0340 0x063c 0 0 271#define MX6UL_PAD_UART4_TX_DATA__UART4_DTE_RX 0x00b4 0x0340 0x063c 0 0
268#define MX6UL_PAD_UART4_TX_DATA__ENET2_TDATA02 0x00b4 0x0340 0x0000 1 0 272#define MX6UL_PAD_UART4_TX_DATA__ENET2_TDATA02 0x00b4 0x0340 0x0000 1 0
269#define MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x00b4 0x0340 0x05a4 2 1 273#define MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x00b4 0x0340 0x05a4 2 1
270#define MX6UL_PAD_UART4_TX_DATA__CSI_DATA12 0x00b4 0x0340 0x0000 3 0 274#define MX6UL_PAD_UART4_TX_DATA__CSI_DATA12 0x00b4 0x0340 0x04f4 3 0
271#define MX6UL_PAD_UART4_TX_DATA__CSU_CSU_ALARM_AUT02 0x00b4 0x0340 0x0000 4 0 275#define MX6UL_PAD_UART4_TX_DATA__CSU_CSU_ALARM_AUT02 0x00b4 0x0340 0x0000 4 0
272#define MX6UL_PAD_UART4_TX_DATA__GPIO1_IO28 0x00b4 0x0340 0x0000 5 0 276#define MX6UL_PAD_UART4_TX_DATA__GPIO1_IO28 0x00b4 0x0340 0x0000 5 0
273#define MX6UL_PAD_UART4_TX_DATA__ECSPI2_SCLK 0x00b4 0x0340 0x0544 8 1 277#define MX6UL_PAD_UART4_TX_DATA__ECSPI2_SCLK 0x00b4 0x0340 0x0544 8 1
@@ -275,23 +279,23 @@
275#define MX6UL_PAD_UART4_RX_DATA__UART4_DTE_TX 0x00b8 0x0344 0x0000 0 0 279#define MX6UL_PAD_UART4_RX_DATA__UART4_DTE_TX 0x00b8 0x0344 0x0000 0 0
276#define MX6UL_PAD_UART4_RX_DATA__ENET2_TDATA03 0x00b8 0x0344 0x0000 1 0 280#define MX6UL_PAD_UART4_RX_DATA__ENET2_TDATA03 0x00b8 0x0344 0x0000 1 0
277#define MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x00b8 0x0344 0x05a8 2 2 281#define MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x00b8 0x0344 0x05a8 2 2
278#define MX6UL_PAD_UART4_RX_DATA__CSI_DATA13 0x00b8 0x0344 0x0000 3 0 282#define MX6UL_PAD_UART4_RX_DATA__CSI_DATA13 0x00b8 0x0344 0x04f8 3 0
279#define MX6UL_PAD_UART4_RX_DATA__CSU_CSU_ALARM_AUT01 0x00b8 0x0344 0x0000 4 0 283#define MX6UL_PAD_UART4_RX_DATA__CSU_CSU_ALARM_AUT01 0x00b8 0x0344 0x0000 4 0
280#define MX6UL_PAD_UART4_RX_DATA__GPIO1_IO29 0x00b8 0x0344 0x0000 5 0 284#define MX6UL_PAD_UART4_RX_DATA__GPIO1_IO29 0x00b8 0x0344 0x0000 5 0
281#define MX6UL_PAD_UART4_RX_DATA__ECSPI2_SS0 0x00b8 0x0344 0x0000 8 0 285#define MX6UL_PAD_UART4_RX_DATA__ECSPI2_SS0 0x00b8 0x0344 0x0550 8 1
282#define MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x00bc 0x0348 0x0000 5 0 286#define MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x00bc 0x0348 0x0000 5 0
283#define MX6UL_PAD_UART5_TX_DATA__ECSPI2_MOSI 0x00bc 0x0348 0x054c 8 0 287#define MX6UL_PAD_UART5_TX_DATA__ECSPI2_MOSI 0x00bc 0x0348 0x054c 8 0
284#define MX6UL_PAD_UART5_TX_DATA__UART5_DCE_TX 0x00bc 0x0348 0x0000 0 0 288#define MX6UL_PAD_UART5_TX_DATA__UART5_DCE_TX 0x00bc 0x0348 0x0000 0 0
285#define MX6UL_PAD_UART5_TX_DATA__UART5_DTE_RX 0x00bc 0x0348 0x0644 0 4 289#define MX6UL_PAD_UART5_TX_DATA__UART5_DTE_RX 0x00bc 0x0348 0x0644 0 4
286#define MX6UL_PAD_UART5_TX_DATA__ENET2_CRS 0x00bc 0x0348 0x0000 1 0 290#define MX6UL_PAD_UART5_TX_DATA__ENET2_CRS 0x00bc 0x0348 0x0000 1 0
287#define MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x00bc 0x0348 0x05ac 2 2 291#define MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x00bc 0x0348 0x05ac 2 2
288#define MX6UL_PAD_UART5_TX_DATA__CSI_DATA14 0x00bc 0x0348 0x0000 3 0 292#define MX6UL_PAD_UART5_TX_DATA__CSI_DATA14 0x00bc 0x0348 0x04fc 3 0
289#define MX6UL_PAD_UART5_TX_DATA__CSU_CSU_ALARM_AUT00 0x00bc 0x0348 0x0000 4 0 293#define MX6UL_PAD_UART5_TX_DATA__CSU_CSU_ALARM_AUT00 0x00bc 0x0348 0x0000 4 0
290#define MX6UL_PAD_UART5_RX_DATA__UART5_DCE_RX 0x00c0 0x034c 0x0644 0 5 294#define MX6UL_PAD_UART5_RX_DATA__UART5_DCE_RX 0x00c0 0x034c 0x0644 0 5
291#define MX6UL_PAD_UART5_RX_DATA__UART5_DTE_TX 0x00c0 0x034c 0x0000 0 0 295#define MX6UL_PAD_UART5_RX_DATA__UART5_DTE_TX 0x00c0 0x034c 0x0000 0 0
292#define MX6UL_PAD_UART5_RX_DATA__ENET2_COL 0x00c0 0x034c 0x0000 1 0 296#define MX6UL_PAD_UART5_RX_DATA__ENET2_COL 0x00c0 0x034c 0x0000 1 0
293#define MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x00c0 0x034c 0x05b0 2 2 297#define MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x00c0 0x034c 0x05b0 2 2
294#define MX6UL_PAD_UART5_RX_DATA__CSI_DATA15 0x00c0 0x034c 0x0000 3 0 298#define MX6UL_PAD_UART5_RX_DATA__CSI_DATA15 0x00c0 0x034c 0x0500 3 0
295#define MX6UL_PAD_UART5_RX_DATA__CSU_CSU_INT_DEB 0x00c0 0x034c 0x0000 4 0 299#define MX6UL_PAD_UART5_RX_DATA__CSU_CSU_INT_DEB 0x00c0 0x034c 0x0000 4 0
296#define MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0x00c0 0x034c 0x0000 5 0 300#define MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0x00c0 0x034c 0x0000 5 0
297#define MX6UL_PAD_UART5_RX_DATA__ECSPI2_MISO 0x00c0 0x034c 0x0548 8 1 301#define MX6UL_PAD_UART5_RX_DATA__ECSPI2_MISO 0x00c0 0x034c 0x0548 8 1
@@ -299,59 +303,61 @@
299#define MX6UL_PAD_ENET1_RX_DATA0__UART4_DCE_RTS 0x00c4 0x0350 0x0638 1 0 303#define MX6UL_PAD_ENET1_RX_DATA0__UART4_DCE_RTS 0x00c4 0x0350 0x0638 1 0
300#define MX6UL_PAD_ENET1_RX_DATA0__UART4_DTE_CTS 0x00c4 0x0350 0x0000 1 0 304#define MX6UL_PAD_ENET1_RX_DATA0__UART4_DTE_CTS 0x00c4 0x0350 0x0000 1 0
301#define MX6UL_PAD_ENET1_RX_DATA0__PWM1_OUT 0x00c4 0x0350 0x0000 2 0 305#define MX6UL_PAD_ENET1_RX_DATA0__PWM1_OUT 0x00c4 0x0350 0x0000 2 0
302#define MX6UL_PAD_ENET1_RX_DATA0__CSI_DATA16 0x00c4 0x0350 0x0000 3 0 306#define MX6UL_PAD_ENET1_RX_DATA0__CSI_DATA16 0x00c4 0x0350 0x0504 3 0
303#define MX6UL_PAD_ENET1_RX_DATA0__FLEXCAN1_TX 0x00c4 0x0350 0x0000 4 0 307#define MX6UL_PAD_ENET1_RX_DATA0__FLEXCAN1_TX 0x00c4 0x0350 0x0000 4 0
304#define MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x00c4 0x0350 0x0000 5 0 308#define MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x00c4 0x0350 0x0000 5 0
305#define MX6UL_PAD_ENET1_RX_DATA0__KPP_ROW00 0x00c4 0x0350 0x0000 6 0 309#define MX6UL_PAD_ENET1_RX_DATA0__KPP_ROW00 0x00c4 0x0350 0x05d0 6 0
306#define MX6UL_PAD_ENET1_RX_DATA0__USDHC1_LCTL 0x00c4 0x0350 0x0000 8 0 310#define MX6UL_PAD_ENET1_RX_DATA0__USDHC1_LCTL 0x00c4 0x0350 0x0000 8 0
307#define MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x00c8 0x0354 0x0000 0 0 311#define MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x00c8 0x0354 0x0000 0 0
308#define MX6UL_PAD_ENET1_RX_DATA1__UART4_DCE_CTS 0x00c8 0x0354 0x0000 1 0 312#define MX6UL_PAD_ENET1_RX_DATA1__UART4_DCE_CTS 0x00c8 0x0354 0x0000 1 0
309#define MX6UL_PAD_ENET1_RX_DATA1__UART4_DTE_RTS 0x00c8 0x0354 0x0638 1 1 313#define MX6UL_PAD_ENET1_RX_DATA1__UART4_DTE_RTS 0x00c8 0x0354 0x0638 1 1
310#define MX6UL_PAD_ENET1_RX_DATA1__PWM2_OUT 0x00c8 0x0354 0x0000 2 0 314#define MX6UL_PAD_ENET1_RX_DATA1__PWM2_OUT 0x00c8 0x0354 0x0000 2 0
311#define MX6UL_PAD_ENET1_RX_DATA1__CSI_DATA17 0x00c8 0x0354 0x0000 3 0 315#define MX6UL_PAD_ENET1_RX_DATA1__CSI_DATA17 0x00c8 0x0354 0x0508 3 0
312#define MX6UL_PAD_ENET1_RX_DATA1__FLEXCAN1_RX 0x00c8 0x0354 0x0584 4 1 316#define MX6UL_PAD_ENET1_RX_DATA1__FLEXCAN1_RX 0x00c8 0x0354 0x0584 4 1
313#define MX6UL_PAD_ENET1_RX_DATA1__GPIO2_IO01 0x00c8 0x0354 0x0000 5 0 317#define MX6UL_PAD_ENET1_RX_DATA1__GPIO2_IO01 0x00c8 0x0354 0x0000 5 0
314#define MX6UL_PAD_ENET1_RX_DATA1__KPP_COL00 0x00c8 0x0354 0x0000 6 0 318#define MX6UL_PAD_ENET1_RX_DATA1__KPP_COL00 0x00c8 0x0354 0x05c4 6 0
315#define MX6UL_PAD_ENET1_RX_DATA1__USDHC2_LCTL 0x00c8 0x0354 0x0000 8 0 319#define MX6UL_PAD_ENET1_RX_DATA1__USDHC2_LCTL 0x00c8 0x0354 0x0000 8 0
316#define MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x00cc 0x0358 0x0000 0 0 320#define MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x00cc 0x0358 0x0000 0 0
317#define MX6UL_PAD_ENET1_RX_EN__UART5_DCE_RTS 0x00cc 0x0358 0x0640 1 3 321#define MX6UL_PAD_ENET1_RX_EN__UART5_DCE_RTS 0x00cc 0x0358 0x0640 1 3
318#define MX6UL_PAD_ENET1_RX_EN__UART5_DTE_CTS 0x00cc 0x0358 0x0000 1 0 322#define MX6UL_PAD_ENET1_RX_EN__UART5_DTE_CTS 0x00cc 0x0358 0x0000 1 0
319#define MX6UL_PAD_ENET1_RX_EN__CSI_DATA18 0x00cc 0x0358 0x0000 3 0 323#define MX6UL_PAD_ENET1_RX_EN__OSC32K_32K_OUT 0x00cc 0x0358 0x0000 2 0
324#define MX6UL_PAD_ENET1_RX_EN__CSI_DATA18 0x00cc 0x0358 0x050c 3 0
320#define MX6UL_PAD_ENET1_RX_EN__FLEXCAN2_TX 0x00cc 0x0358 0x0000 4 0 325#define MX6UL_PAD_ENET1_RX_EN__FLEXCAN2_TX 0x00cc 0x0358 0x0000 4 0
321#define MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02 0x00cc 0x0358 0x0000 5 0 326#define MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02 0x00cc 0x0358 0x0000 5 0
322#define MX6UL_PAD_ENET1_RX_EN__KPP_ROW01 0x00cc 0x0358 0x0000 6 0 327#define MX6UL_PAD_ENET1_RX_EN__KPP_ROW01 0x00cc 0x0358 0x05d4 6 0
323#define MX6UL_PAD_ENET1_RX_EN__USDHC1_VSELECT 0x00cc 0x0358 0x0000 8 0 328#define MX6UL_PAD_ENET1_RX_EN__USDHC1_VSELECT 0x00cc 0x0358 0x0000 8 0
324#define MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x00d0 0x035c 0x0000 0 0 329#define MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x00d0 0x035c 0x0000 0 0
325#define MX6UL_PAD_ENET1_TX_DATA0__UART5_DCE_CTS 0x00d0 0x035c 0x0000 1 0 330#define MX6UL_PAD_ENET1_TX_DATA0__UART5_DCE_CTS 0x00d0 0x035c 0x0000 1 0
326#define MX6UL_PAD_ENET1_TX_DATA0__UART5_DTE_RTS 0x00d0 0x035c 0x0640 1 4 331#define MX6UL_PAD_ENET1_TX_DATA0__UART5_DTE_RTS 0x00d0 0x035c 0x0640 1 4
327#define MX6UL_PAD_ENET1_TX_DATA0__CSI_DATA19 0x00d0 0x035c 0x0000 3 0 332#define MX6UL_PAD_ENET1_TX_DATA0__REF_CLK_24M 0x00d0 0x035c 0x0000 2 0
333#define MX6UL_PAD_ENET1_TX_DATA0__CSI_DATA19 0x00d0 0x035c 0x0510 3 0
328#define MX6UL_PAD_ENET1_TX_DATA0__FLEXCAN2_RX 0x00d0 0x035c 0x0588 4 1 334#define MX6UL_PAD_ENET1_TX_DATA0__FLEXCAN2_RX 0x00d0 0x035c 0x0588 4 1
329#define MX6UL_PAD_ENET1_TX_DATA0__GPIO2_IO03 0x00d0 0x035c 0x0000 5 0 335#define MX6UL_PAD_ENET1_TX_DATA0__GPIO2_IO03 0x00d0 0x035c 0x0000 5 0
330#define MX6UL_PAD_ENET1_TX_DATA0__KPP_COL01 0x00d0 0x035c 0x0000 6 0 336#define MX6UL_PAD_ENET1_TX_DATA0__KPP_COL01 0x00d0 0x035c 0x05c8 6 0
331#define MX6UL_PAD_ENET1_TX_DATA0__USDHC2_VSELECT 0x00d0 0x035c 0x0000 8 0 337#define MX6UL_PAD_ENET1_TX_DATA0__USDHC2_VSELECT 0x00d0 0x035c 0x0000 8 0
332#define MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x00d4 0x0360 0x0000 0 0 338#define MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x00d4 0x0360 0x0000 0 0
333#define MX6UL_PAD_ENET1_TX_DATA1__UART6_DCE_CTS 0x00d4 0x0360 0x0000 1 0 339#define MX6UL_PAD_ENET1_TX_DATA1__UART6_DCE_CTS 0x00d4 0x0360 0x0000 1 0
334#define MX6UL_PAD_ENET1_TX_DATA1__UART6_DTE_RTS 0x00d4 0x0360 0x0648 1 2 340#define MX6UL_PAD_ENET1_TX_DATA1__UART6_DTE_RTS 0x00d4 0x0360 0x0648 1 2
335#define MX6UL_PAD_ENET1_TX_DATA1__PWM5_OUT 0x00d4 0x0360 0x0000 2 0 341#define MX6UL_PAD_ENET1_TX_DATA1__PWM5_OUT 0x00d4 0x0360 0x0000 2 0
336#define MX6UL_PAD_ENET1_TX_DATA1__CSI_DATA20 0x00d4 0x0360 0x0000 3 0 342#define MX6UL_PAD_ENET1_TX_DATA1__CSI_DATA20 0x00d4 0x0360 0x0514 3 0
337#define MX6UL_PAD_ENET1_TX_DATA1__ENET2_MDIO 0x00d4 0x0360 0x0580 4 1 343#define MX6UL_PAD_ENET1_TX_DATA1__ENET2_MDIO 0x00d4 0x0360 0x0580 4 1
338#define MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO04 0x00d4 0x0360 0x0000 5 0 344#define MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO04 0x00d4 0x0360 0x0000 5 0
339#define MX6UL_PAD_ENET1_TX_DATA1__KPP_ROW02 0x00d4 0x0360 0x0000 6 0 345#define MX6UL_PAD_ENET1_TX_DATA1__KPP_ROW02 0x00d4 0x0360 0x05d8 6 0
340#define MX6UL_PAD_ENET1_TX_DATA1__WDOG1_WDOG_RST_B_DEB 0x00d4 0x0360 0x0000 8 0 346#define MX6UL_PAD_ENET1_TX_DATA1__WDOG1_WDOG_RST_B_DEB 0x00d4 0x0360 0x0000 8 0
341#define MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x00d8 0x0364 0x0000 0 0 347#define MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x00d8 0x0364 0x0000 0 0
342#define MX6UL_PAD_ENET1_TX_EN__UART6_DCE_RTS 0x00d8 0x0364 0x0648 1 3 348#define MX6UL_PAD_ENET1_TX_EN__UART6_DCE_RTS 0x00d8 0x0364 0x0648 1 3
343#define MX6UL_PAD_ENET1_TX_EN__UART6_DTE_CTS 0x00d8 0x0364 0x0000 1 0 349#define MX6UL_PAD_ENET1_TX_EN__UART6_DTE_CTS 0x00d8 0x0364 0x0000 1 0
344#define MX6UL_PAD_ENET1_TX_EN__PWM6_OUT 0x00d8 0x0364 0x0000 2 0 350#define MX6UL_PAD_ENET1_TX_EN__PWM6_OUT 0x00d8 0x0364 0x0000 2 0
345#define MX6UL_PAD_ENET1_TX_EN__CSI_DATA21 0x00d8 0x0364 0x0000 3 0 351#define MX6UL_PAD_ENET1_TX_EN__CSI_DATA21 0x00d8 0x0364 0x0518 3 0
346#define MX6UL_PAD_ENET1_TX_EN__ENET2_MDC 0x00d8 0x0364 0x0000 4 0 352#define MX6UL_PAD_ENET1_TX_EN__ENET2_MDC 0x00d8 0x0364 0x0000 4 0
347#define MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x00d8 0x0364 0x0000 5 0 353#define MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x00d8 0x0364 0x0000 5 0
348#define MX6UL_PAD_ENET1_TX_EN__KPP_COL02 0x00d8 0x0364 0x0000 6 0 354#define MX6UL_PAD_ENET1_TX_EN__KPP_COL02 0x00d8 0x0364 0x05cc 6 0
349#define MX6UL_PAD_ENET1_TX_EN__WDOG2_WDOG_RST_B_DEB 0x00d8 0x0364 0x0000 8 0 355#define MX6UL_PAD_ENET1_TX_EN__WDOG2_WDOG_RST_B_DEB 0x00d8 0x0364 0x0000 8 0
350#define MX6UL_PAD_ENET1_TX_CLK__ENET1_TX_CLK 0x00dc 0x0368 0x0000 0 0 356#define MX6UL_PAD_ENET1_TX_CLK__ENET1_TX_CLK 0x00dc 0x0368 0x0000 0 0
351#define MX6UL_PAD_ENET1_TX_CLK__UART7_DCE_CTS 0x00dc 0x0368 0x0000 1 0 357#define MX6UL_PAD_ENET1_TX_CLK__UART7_DCE_CTS 0x00dc 0x0368 0x0000 1 0
352#define MX6UL_PAD_ENET1_TX_CLK__UART7_DTE_RTS 0x00dc 0x0368 0x0650 1 0 358#define MX6UL_PAD_ENET1_TX_CLK__UART7_DTE_RTS 0x00dc 0x0368 0x0650 1 0
353#define MX6UL_PAD_ENET1_TX_CLK__PWM7_OUT 0x00dc 0x0368 0x0000 2 0 359#define MX6UL_PAD_ENET1_TX_CLK__PWM7_OUT 0x00dc 0x0368 0x0000 2 0
354#define MX6UL_PAD_ENET1_TX_CLK__CSI_DATA22 0x00dc 0x0368 0x0000 3 0 360#define MX6UL_PAD_ENET1_TX_CLK__CSI_DATA22 0x00dc 0x0368 0x051c 3 0
355#define MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x00dc 0x0368 0x0574 4 2 361#define MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x00dc 0x0368 0x0574 4 2
356#define MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06 0x00dc 0x0368 0x0000 5 0 362#define MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06 0x00dc 0x0368 0x0000 5 0
357#define MX6UL_PAD_ENET1_TX_CLK__KPP_ROW03 0x00dc 0x0368 0x0000 6 0 363#define MX6UL_PAD_ENET1_TX_CLK__KPP_ROW03 0x00dc 0x0368 0x0000 6 0
@@ -360,7 +366,7 @@
360#define MX6UL_PAD_ENET1_RX_ER__UART7_DCE_RTS 0x00e0 0x036c 0x0650 1 1 366#define MX6UL_PAD_ENET1_RX_ER__UART7_DCE_RTS 0x00e0 0x036c 0x0650 1 1
361#define MX6UL_PAD_ENET1_RX_ER__UART7_DTE_CTS 0x00e0 0x036c 0x0000 1 0 367#define MX6UL_PAD_ENET1_RX_ER__UART7_DTE_CTS 0x00e0 0x036c 0x0000 1 0
362#define MX6UL_PAD_ENET1_RX_ER__PWM8_OUT 0x00e0 0x036c 0x0000 2 0 368#define MX6UL_PAD_ENET1_RX_ER__PWM8_OUT 0x00e0 0x036c 0x0000 2 0
363#define MX6UL_PAD_ENET1_RX_ER__CSI_DATA23 0x00e0 0x036c 0x0000 3 0 369#define MX6UL_PAD_ENET1_RX_ER__CSI_DATA23 0x00e0 0x036c 0x0520 3 0
364#define MX6UL_PAD_ENET1_RX_ER__EIM_CRE 0x00e0 0x036c 0x0000 4 0 370#define MX6UL_PAD_ENET1_RX_ER__EIM_CRE 0x00e0 0x036c 0x0000 4 0
365#define MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07 0x00e0 0x036c 0x0000 5 0 371#define MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07 0x00e0 0x036c 0x0000 5 0
366#define MX6UL_PAD_ENET1_RX_ER__KPP_COL03 0x00e0 0x036c 0x0000 6 0 372#define MX6UL_PAD_ENET1_RX_ER__KPP_COL03 0x00e0 0x036c 0x0000 6 0
@@ -377,7 +383,7 @@
377#define MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x00e8 0x0374 0x0000 0 0 383#define MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x00e8 0x0374 0x0000 0 0
378#define MX6UL_PAD_ENET2_RX_DATA1__UART6_DCE_RX 0x00e8 0x0374 0x064c 1 2 384#define MX6UL_PAD_ENET2_RX_DATA1__UART6_DCE_RX 0x00e8 0x0374 0x064c 1 2
379#define MX6UL_PAD_ENET2_RX_DATA1__UART6_DTE_TX 0x00e8 0x0374 0x0000 1 0 385#define MX6UL_PAD_ENET2_RX_DATA1__UART6_DTE_TX 0x00e8 0x0374 0x0000 1 0
380#define MX6UL_PAD_ENET2_RX_DATA1__SIM1_PORT0_cLK 0x00e8 0x0374 0x0000 2 0 386#define MX6UL_PAD_ENET2_RX_DATA1__SIM1_PORT0_CLK 0x00e8 0x0374 0x0000 2 0
381#define MX6UL_PAD_ENET2_RX_DATA1__I2C3_SDA 0x00e8 0x0374 0x05b8 3 1 387#define MX6UL_PAD_ENET2_RX_DATA1__I2C3_SDA 0x00e8 0x0374 0x05b8 3 1
382#define MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC 0x00e8 0x0374 0x0000 4 0 388#define MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC 0x00e8 0x0374 0x0000 4 0
383#define MX6UL_PAD_ENET2_RX_DATA1__GPIO2_IO09 0x00e8 0x0374 0x0000 5 0 389#define MX6UL_PAD_ENET2_RX_DATA1__GPIO2_IO09 0x00e8 0x0374 0x0000 5 0
@@ -400,6 +406,7 @@
400#define MX6UL_PAD_ENET2_TX_DATA0__EIM_EB_B02 0x00f0 0x037c 0x0000 4 0 406#define MX6UL_PAD_ENET2_TX_DATA0__EIM_EB_B02 0x00f0 0x037c 0x0000 4 0
401#define MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x00f0 0x037c 0x0000 5 0 407#define MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x00f0 0x037c 0x0000 5 0
402#define MX6UL_PAD_ENET2_TX_DATA0__KPP_COL05 0x00f0 0x037c 0x0000 6 0 408#define MX6UL_PAD_ENET2_TX_DATA0__KPP_COL05 0x00f0 0x037c 0x0000 6 0
409#define MX6UL_PAD_ENET2_TX_DATA0__REF_CLK_24M 0x00f0 0x037c 0x0000 8 0
403#define MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x00f4 0x0380 0x0000 0 0 410#define MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x00f4 0x0380 0x0000 0 0
404#define MX6UL_PAD_ENET2_TX_DATA1__UART8_DCE_TX 0x00f4 0x0380 0x0000 1 0 411#define MX6UL_PAD_ENET2_TX_DATA1__UART8_DCE_TX 0x00f4 0x0380 0x0000 1 0
405#define MX6UL_PAD_ENET2_TX_DATA1__UART8_DTE_RX 0x00f4 0x0380 0x065c 1 0 412#define MX6UL_PAD_ENET2_TX_DATA1__UART8_DTE_RX 0x00f4 0x0380 0x065c 1 0
@@ -412,7 +419,7 @@
412#define MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x00f8 0x0384 0x0000 0 0 419#define MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x00f8 0x0384 0x0000 0 0
413#define MX6UL_PAD_ENET2_TX_EN__UART8_DCE_RX 0x00f8 0x0384 0x065c 1 1 420#define MX6UL_PAD_ENET2_TX_EN__UART8_DCE_RX 0x00f8 0x0384 0x065c 1 1
414#define MX6UL_PAD_ENET2_TX_EN__UART8_DTE_TX 0x00f8 0x0384 0x0000 1 0 421#define MX6UL_PAD_ENET2_TX_EN__UART8_DTE_TX 0x00f8 0x0384 0x0000 1 0
415#define MX6UL_PAD_ENET2_TX_EN__SIM2_PORT0_cLK 0x00f8 0x0384 0x0000 2 0 422#define MX6UL_PAD_ENET2_TX_EN__SIM2_PORT0_CLK 0x00f8 0x0384 0x0000 2 0
416#define MX6UL_PAD_ENET2_TX_EN__ECSPI4_MOSI 0x00f8 0x0384 0x056c 3 0 423#define MX6UL_PAD_ENET2_TX_EN__ECSPI4_MOSI 0x00f8 0x0384 0x056c 3 0
417#define MX6UL_PAD_ENET2_TX_EN__EIM_ACLK_FREERUN 0x00f8 0x0384 0x0000 4 0 424#define MX6UL_PAD_ENET2_TX_EN__EIM_ACLK_FREERUN 0x00f8 0x0384 0x0000 4 0
418#define MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13 0x00f8 0x0384 0x0000 5 0 425#define MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13 0x00f8 0x0384 0x0000 5 0
@@ -431,7 +438,7 @@
431#define MX6UL_PAD_ENET2_RX_ER__UART8_DCE_RTS 0x0100 0x038c 0x0658 1 1 438#define MX6UL_PAD_ENET2_RX_ER__UART8_DCE_RTS 0x0100 0x038c 0x0658 1 1
432#define MX6UL_PAD_ENET2_RX_ER__UART8_DTE_CTS 0x0100 0x038c 0x0000 1 0 439#define MX6UL_PAD_ENET2_RX_ER__UART8_DTE_CTS 0x0100 0x038c 0x0000 1 0
433#define MX6UL_PAD_ENET2_RX_ER__SIM2_PORT0_SVEN 0x0100 0x038c 0x0000 2 0 440#define MX6UL_PAD_ENET2_RX_ER__SIM2_PORT0_SVEN 0x0100 0x038c 0x0000 2 0
434#define MX6UL_PAD_ENET2_RX_ER__ECSPI4_SS0 0x0100 0x038c 0x0000 3 0 441#define MX6UL_PAD_ENET2_RX_ER__ECSPI4_SS0 0x0100 0x038c 0x0570 3 0
435#define MX6UL_PAD_ENET2_RX_ER__EIM_ADDR25 0x0100 0x038c 0x0000 4 0 442#define MX6UL_PAD_ENET2_RX_ER__EIM_ADDR25 0x0100 0x038c 0x0000 4 0
436#define MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15 0x0100 0x038c 0x0000 5 0 443#define MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15 0x0100 0x038c 0x0000 5 0
437#define MX6UL_PAD_ENET2_RX_ER__KPP_COL07 0x0100 0x038c 0x0000 6 0 444#define MX6UL_PAD_ENET2_RX_ER__KPP_COL07 0x0100 0x038c 0x0000 6 0
@@ -440,7 +447,7 @@
440#define MX6UL_PAD_LCD_CLK__LCDIF_WR_RWN 0x0104 0x0390 0x0000 1 0 447#define MX6UL_PAD_LCD_CLK__LCDIF_WR_RWN 0x0104 0x0390 0x0000 1 0
441#define MX6UL_PAD_LCD_CLK__UART4_DCE_TX 0x0104 0x0390 0x0000 2 0 448#define MX6UL_PAD_LCD_CLK__UART4_DCE_TX 0x0104 0x0390 0x0000 2 0
442#define MX6UL_PAD_LCD_CLK__UART4_DTE_RX 0x0104 0x0390 0x063c 2 2 449#define MX6UL_PAD_LCD_CLK__UART4_DTE_RX 0x0104 0x0390 0x063c 2 2
443#define MX6UL_PAD_LCD_CLK__SAI3_MCLK 0x0104 0x0390 0x0000 3 0 450#define MX6UL_PAD_LCD_CLK__SAI3_MCLK 0x0104 0x0390 0x0600 3 0
444#define MX6UL_PAD_LCD_CLK__EIM_CS2_B 0x0104 0x0390 0x0000 4 0 451#define MX6UL_PAD_LCD_CLK__EIM_CS2_B 0x0104 0x0390 0x0000 4 0
445#define MX6UL_PAD_LCD_CLK__GPIO3_IO00 0x0104 0x0390 0x0000 5 0 452#define MX6UL_PAD_LCD_CLK__GPIO3_IO00 0x0104 0x0390 0x0000 5 0
446#define MX6UL_PAD_LCD_CLK__WDOG1_WDOG_RST_B_DEB 0x0104 0x0390 0x0000 8 0 453#define MX6UL_PAD_LCD_CLK__WDOG1_WDOG_RST_B_DEB 0x0104 0x0390 0x0000 8 0
@@ -464,7 +471,7 @@
464#define MX6UL_PAD_LCD_VSYNC__LCDIF_BUSY 0x0110 0x039c 0x05dc 1 1 471#define MX6UL_PAD_LCD_VSYNC__LCDIF_BUSY 0x0110 0x039c 0x05dc 1 1
465#define MX6UL_PAD_LCD_VSYNC__UART4_DCE_RTS 0x0110 0x039c 0x0638 2 3 472#define MX6UL_PAD_LCD_VSYNC__UART4_DCE_RTS 0x0110 0x039c 0x0638 2 3
466#define MX6UL_PAD_LCD_VSYNC__UART4_DTE_CTS 0x0110 0x039c 0x0000 2 0 473#define MX6UL_PAD_LCD_VSYNC__UART4_DTE_CTS 0x0110 0x039c 0x0000 2 0
467#define MX6UL_PAD_LCD_VSYNC__SAI3_RX_DATA 0x0110 0x039c 0x0000 3 0 474#define MX6UL_PAD_LCD_VSYNC__SAI3_RX_DATA 0x0110 0x039c 0x0604 3 0
468#define MX6UL_PAD_LCD_VSYNC__WDOG2_WDOG_B 0x0110 0x039c 0x0000 4 0 475#define MX6UL_PAD_LCD_VSYNC__WDOG2_WDOG_B 0x0110 0x039c 0x0000 4 0
469#define MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x0110 0x039c 0x0000 5 0 476#define MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x0110 0x039c 0x0000 5 0
470#define MX6UL_PAD_LCD_VSYNC__ECSPI2_SS2 0x0110 0x039c 0x0000 8 0 477#define MX6UL_PAD_LCD_VSYNC__ECSPI2_SS2 0x0110 0x039c 0x0000 8 0
@@ -477,13 +484,15 @@
477#define MX6UL_PAD_LCD_RESET__ECSPI2_SS3 0x0114 0x03a0 0x0000 8 0 484#define MX6UL_PAD_LCD_RESET__ECSPI2_SS3 0x0114 0x03a0 0x0000 8 0
478#define MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x0118 0x03a4 0x0000 0 0 485#define MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x0118 0x03a4 0x0000 0 0
479#define MX6UL_PAD_LCD_DATA00__PWM1_OUT 0x0118 0x03a4 0x0000 1 0 486#define MX6UL_PAD_LCD_DATA00__PWM1_OUT 0x0118 0x03a4 0x0000 1 0
487#define MX6UL_PAD_LCD_DATA00__CA7_MX6UL_TRACE0 0x0118 0x03a4 0x0000 2 0
480#define MX6UL_PAD_LCD_DATA00__ENET1_1588_EVENT2_IN 0x0118 0x03a4 0x0000 3 0 488#define MX6UL_PAD_LCD_DATA00__ENET1_1588_EVENT2_IN 0x0118 0x03a4 0x0000 3 0
481#define MX6UL_PAD_LCD_DATA00__I2C3_SDA 0x0118 0x03a4 0x05b8 4 2 489#define MX6UL_PAD_LCD_DATA00__I2C3_SDA 0x0118 0x03a4 0x05b8 4 2
482#define MX6UL_PAD_LCD_DATA00__GPIO3_IO05 0x0118 0x03a4 0x0000 5 0 490#define MX6UL_PAD_LCD_DATA00__GPIO3_IO05 0x0118 0x03a4 0x0000 5 0
483#define MX6UL_PAD_LCD_DATA00__SRC_BT_CFG00 0x0118 0x03a4 0x0000 6 0 491#define MX6UL_PAD_LCD_DATA00__SRC_BT_CFG00 0x0118 0x03a4 0x0000 6 0
484#define MX6UL_PAD_LCD_DATA00__SAI1_MCLK 0x0118 0x03a4 0x0000 8 0 492#define MX6UL_PAD_LCD_DATA00__SAI1_MCLK 0x0118 0x03a4 0x05e0 8 1
485#define MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x011c 0x03a8 0x0000 0 0 493#define MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x011c 0x03a8 0x0000 0 0
486#define MX6UL_PAD_LCD_DATA01__PWM2_OUT 0x011c 0x03a8 0x0000 1 0 494#define MX6UL_PAD_LCD_DATA01__PWM2_OUT 0x011c 0x03a8 0x0000 1 0
495#define MX6UL_PAD_LCD_DATA01__CA7_MX6UL_TRACE1 0x011c 0x03a8 0x0000 2 0
487#define MX6UL_PAD_LCD_DATA01__ENET1_1588_EVENT2_OUT 0x011c 0x03a8 0x0000 3 0 496#define MX6UL_PAD_LCD_DATA01__ENET1_1588_EVENT2_OUT 0x011c 0x03a8 0x0000 3 0
488#define MX6UL_PAD_LCD_DATA01__I2C3_SCL 0x011c 0x03a8 0x05b4 4 2 497#define MX6UL_PAD_LCD_DATA01__I2C3_SCL 0x011c 0x03a8 0x05b4 4 2
489#define MX6UL_PAD_LCD_DATA01__GPIO3_IO06 0x011c 0x03a8 0x0000 5 0 498#define MX6UL_PAD_LCD_DATA01__GPIO3_IO06 0x011c 0x03a8 0x0000 5 0
@@ -491,6 +500,7 @@
491#define MX6UL_PAD_LCD_DATA01__SAI1_TX_SYNC 0x011c 0x03a8 0x05ec 8 0 500#define MX6UL_PAD_LCD_DATA01__SAI1_TX_SYNC 0x011c 0x03a8 0x05ec 8 0
492#define MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x0120 0x03ac 0x0000 0 0 501#define MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x0120 0x03ac 0x0000 0 0
493#define MX6UL_PAD_LCD_DATA02__PWM3_OUT 0x0120 0x03ac 0x0000 1 0 502#define MX6UL_PAD_LCD_DATA02__PWM3_OUT 0x0120 0x03ac 0x0000 1 0
503#define MX6UL_PAD_LCD_DATA02__CA7_MX6UL_TRACE2 0x0120 0x03ac 0x0000 2 0
494#define MX6UL_PAD_LCD_DATA02__ENET1_1588_EVENT3_IN 0x0120 0x03ac 0x0000 3 0 504#define MX6UL_PAD_LCD_DATA02__ENET1_1588_EVENT3_IN 0x0120 0x03ac 0x0000 3 0
495#define MX6UL_PAD_LCD_DATA02__I2C4_SDA 0x0120 0x03ac 0x05c0 4 2 505#define MX6UL_PAD_LCD_DATA02__I2C4_SDA 0x0120 0x03ac 0x05c0 4 2
496#define MX6UL_PAD_LCD_DATA02__GPIO3_IO07 0x0120 0x03ac 0x0000 5 0 506#define MX6UL_PAD_LCD_DATA02__GPIO3_IO07 0x0120 0x03ac 0x0000 5 0
@@ -498,14 +508,16 @@
498#define MX6UL_PAD_LCD_DATA02__SAI1_TX_BCLK 0x0120 0x03ac 0x05e8 8 0 508#define MX6UL_PAD_LCD_DATA02__SAI1_TX_BCLK 0x0120 0x03ac 0x05e8 8 0
499#define MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x0124 0x03b0 0x0000 0 0 509#define MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x0124 0x03b0 0x0000 0 0
500#define MX6UL_PAD_LCD_DATA03__PWM4_OUT 0x0124 0x03b0 0x0000 1 0 510#define MX6UL_PAD_LCD_DATA03__PWM4_OUT 0x0124 0x03b0 0x0000 1 0
511#define MX6UL_PAD_LCD_DATA03__CA7_MX6UL_TRACE3 0x0124 0x03b0 0x0000 2 0
501#define MX6UL_PAD_LCD_DATA03__ENET1_1588_EVENT3_OUT 0x0124 0x03b0 0x0000 3 0 512#define MX6UL_PAD_LCD_DATA03__ENET1_1588_EVENT3_OUT 0x0124 0x03b0 0x0000 3 0
502#define MX6UL_PAD_LCD_DATA03__I2C4_SCL 0x0124 0x03b0 0x05bc 4 2 513#define MX6UL_PAD_LCD_DATA03__I2C4_SCL 0x0124 0x03b0 0x05bc 4 2
503#define MX6UL_PAD_LCD_DATA03__GPIO3_IO08 0x0124 0x03b0 0x0000 5 0 514#define MX6UL_PAD_LCD_DATA03__GPIO3_IO08 0x0124 0x03b0 0x0000 5 0
504#define MX6UL_PAD_LCD_DATA03__SRC_BT_CFG03 0x0124 0x03b0 0x0000 6 0 515#define MX6UL_PAD_LCD_DATA03__SRC_BT_CFG03 0x0124 0x03b0 0x0000 6 0
505#define MX6UL_PAD_LCD_DATA03__SAI1_RX_DATA 0x0124 0x03b0 0x0000 8 0 516#define MX6UL_PAD_LCD_DATA03__SAI1_RX_DATA 0x0124 0x03b0 0x05e4 8 0
506#define MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x0128 0x03b4 0x0000 0 0 517#define MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x0128 0x03b4 0x0000 0 0
507#define MX6UL_PAD_LCD_DATA04__UART8_DCE_CTS 0x0128 0x03b4 0x0000 1 0 518#define MX6UL_PAD_LCD_DATA04__UART8_DCE_CTS 0x0128 0x03b4 0x0000 1 0
508#define MX6UL_PAD_LCD_DATA04__UART8_DTE_RTS 0x0128 0x03b4 0x0658 1 2 519#define MX6UL_PAD_LCD_DATA04__UART8_DTE_RTS 0x0128 0x03b4 0x0658 1 2
520#define MX6UL_PAD_LCD_DATA04__CA7_MX6UL_TRACE4 0x0128 0x03b4 0x0000 2 0
509#define MX6UL_PAD_LCD_DATA04__ENET2_1588_EVENT2_IN 0x0128 0x03b4 0x0000 3 0 521#define MX6UL_PAD_LCD_DATA04__ENET2_1588_EVENT2_IN 0x0128 0x03b4 0x0000 3 0
510#define MX6UL_PAD_LCD_DATA04__SPDIF_SR_CLK 0x0128 0x03b4 0x0000 4 0 522#define MX6UL_PAD_LCD_DATA04__SPDIF_SR_CLK 0x0128 0x03b4 0x0000 4 0
511#define MX6UL_PAD_LCD_DATA04__GPIO3_IO09 0x0128 0x03b4 0x0000 5 0 523#define MX6UL_PAD_LCD_DATA04__GPIO3_IO09 0x0128 0x03b4 0x0000 5 0
@@ -514,6 +526,7 @@
514#define MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x012c 0x03b8 0x0000 0 0 526#define MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x012c 0x03b8 0x0000 0 0
515#define MX6UL_PAD_LCD_DATA05__UART8_DCE_RTS 0x012c 0x03b8 0x0658 1 3 527#define MX6UL_PAD_LCD_DATA05__UART8_DCE_RTS 0x012c 0x03b8 0x0658 1 3
516#define MX6UL_PAD_LCD_DATA05__UART8_DTE_CTS 0x012c 0x03b8 0x0000 1 0 528#define MX6UL_PAD_LCD_DATA05__UART8_DTE_CTS 0x012c 0x03b8 0x0000 1 0
529#define MX6UL_PAD_LCD_DATA05__CA7_MX6UL_TRACE5 0x012c 0x03b8 0x0000 2 0
517#define MX6UL_PAD_LCD_DATA05__ENET2_1588_EVENT2_OUT 0x012c 0x03b8 0x0000 3 0 530#define MX6UL_PAD_LCD_DATA05__ENET2_1588_EVENT2_OUT 0x012c 0x03b8 0x0000 3 0
518#define MX6UL_PAD_LCD_DATA05__SPDIF_OUT 0x012c 0x03b8 0x0000 4 0 531#define MX6UL_PAD_LCD_DATA05__SPDIF_OUT 0x012c 0x03b8 0x0000 4 0
519#define MX6UL_PAD_LCD_DATA05__GPIO3_IO10 0x012c 0x03b8 0x0000 5 0 532#define MX6UL_PAD_LCD_DATA05__GPIO3_IO10 0x012c 0x03b8 0x0000 5 0
@@ -522,6 +535,7 @@
522#define MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x0130 0x03bc 0x0000 0 0 535#define MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x0130 0x03bc 0x0000 0 0
523#define MX6UL_PAD_LCD_DATA06__UART7_DCE_CTS 0x0130 0x03bc 0x0000 1 0 536#define MX6UL_PAD_LCD_DATA06__UART7_DCE_CTS 0x0130 0x03bc 0x0000 1 0
524#define MX6UL_PAD_LCD_DATA06__UART7_DTE_RTS 0x0130 0x03bc 0x0650 1 2 537#define MX6UL_PAD_LCD_DATA06__UART7_DTE_RTS 0x0130 0x03bc 0x0650 1 2
538#define MX6UL_PAD_LCD_DATA06__CA7_MX6UL_TRACE6 0x0130 0x03bc 0x0000 2 0
525#define MX6UL_PAD_LCD_DATA06__ENET2_1588_EVENT3_IN 0x0130 0x03bc 0x0000 3 0 539#define MX6UL_PAD_LCD_DATA06__ENET2_1588_EVENT3_IN 0x0130 0x03bc 0x0000 3 0
526#define MX6UL_PAD_LCD_DATA06__SPDIF_LOCK 0x0130 0x03bc 0x0000 4 0 540#define MX6UL_PAD_LCD_DATA06__SPDIF_LOCK 0x0130 0x03bc 0x0000 4 0
527#define MX6UL_PAD_LCD_DATA06__GPIO3_IO11 0x0130 0x03bc 0x0000 5 0 541#define MX6UL_PAD_LCD_DATA06__GPIO3_IO11 0x0130 0x03bc 0x0000 5 0
@@ -530,6 +544,7 @@
530#define MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x0134 0x03c0 0x0000 0 0 544#define MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x0134 0x03c0 0x0000 0 0
531#define MX6UL_PAD_LCD_DATA07__UART7_DCE_RTS 0x0134 0x03c0 0x0650 1 3 545#define MX6UL_PAD_LCD_DATA07__UART7_DCE_RTS 0x0134 0x03c0 0x0650 1 3
532#define MX6UL_PAD_LCD_DATA07__UART7_DTE_CTS 0x0134 0x03c0 0x0000 1 0 546#define MX6UL_PAD_LCD_DATA07__UART7_DTE_CTS 0x0134 0x03c0 0x0000 1 0
547#define MX6UL_PAD_LCD_DATA07__CA7_MX6UL_TRACE7 0x0134 0x03c0 0x0000 2 0
533#define MX6UL_PAD_LCD_DATA07__ENET2_1588_EVENT3_OUT 0x0134 0x03c0 0x0000 3 0 548#define MX6UL_PAD_LCD_DATA07__ENET2_1588_EVENT3_OUT 0x0134 0x03c0 0x0000 3 0
534#define MX6UL_PAD_LCD_DATA07__SPDIF_EXT_CLK 0x0134 0x03c0 0x061c 4 0 549#define MX6UL_PAD_LCD_DATA07__SPDIF_EXT_CLK 0x0134 0x03c0 0x061c 4 0
535#define MX6UL_PAD_LCD_DATA07__GPIO3_IO12 0x0134 0x03c0 0x0000 5 0 550#define MX6UL_PAD_LCD_DATA07__GPIO3_IO12 0x0134 0x03c0 0x0000 5 0
@@ -537,56 +552,64 @@
537#define MX6UL_PAD_LCD_DATA07__ECSPI1_SS3 0x0134 0x03c0 0x0000 8 0 552#define MX6UL_PAD_LCD_DATA07__ECSPI1_SS3 0x0134 0x03c0 0x0000 8 0
538#define MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x0138 0x03c4 0x0000 0 0 553#define MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x0138 0x03c4 0x0000 0 0
539#define MX6UL_PAD_LCD_DATA08__SPDIF_IN 0x0138 0x03c4 0x0618 1 2 554#define MX6UL_PAD_LCD_DATA08__SPDIF_IN 0x0138 0x03c4 0x0618 1 2
540#define MX6UL_PAD_LCD_DATA08__CSI_DATA16 0x0138 0x03c4 0x0000 3 0 555#define MX6UL_PAD_LCD_DATA08__CA7_MX6UL_TRACE8 0x0138 0x03c4 0x0000 2 0
556#define MX6UL_PAD_LCD_DATA08__CSI_DATA16 0x0138 0x03c4 0x0504 3 1
541#define MX6UL_PAD_LCD_DATA08__EIM_DATA00 0x0138 0x03c4 0x0000 4 0 557#define MX6UL_PAD_LCD_DATA08__EIM_DATA00 0x0138 0x03c4 0x0000 4 0
542#define MX6UL_PAD_LCD_DATA08__GPIO3_IO13 0x0138 0x03c4 0x0000 5 0 558#define MX6UL_PAD_LCD_DATA08__GPIO3_IO13 0x0138 0x03c4 0x0000 5 0
543#define MX6UL_PAD_LCD_DATA08__SRC_BT_CFG08 0x0138 0x03c4 0x0000 6 0 559#define MX6UL_PAD_LCD_DATA08__SRC_BT_CFG08 0x0138 0x03c4 0x0000 6 0
544#define MX6UL_PAD_LCD_DATA08__FLEXCAN1_TX 0x0138 0x03c4 0x0000 8 0 560#define MX6UL_PAD_LCD_DATA08__FLEXCAN1_TX 0x0138 0x03c4 0x0000 8 0
545#define MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x013c 0x03c8 0x0000 0 0 561#define MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x013c 0x03c8 0x0000 0 0
546#define MX6UL_PAD_LCD_DATA09__SAI3_MCLK 0x013c 0x03c8 0x0000 1 0 562#define MX6UL_PAD_LCD_DATA09__SAI3_MCLK 0x013c 0x03c8 0x0600 1 1
547#define MX6UL_PAD_LCD_DATA09__CSI_DATA17 0x013c 0x03c8 0x0000 3 0 563#define MX6UL_PAD_LCD_DATA09__CA7_MX6UL_TRACE9 0x013c 0x03c8 0x0000 2 0
564#define MX6UL_PAD_LCD_DATA09__CSI_DATA17 0x013c 0x03c8 0x0508 3 1
548#define MX6UL_PAD_LCD_DATA09__EIM_DATA01 0x013c 0x03c8 0x0000 4 0 565#define MX6UL_PAD_LCD_DATA09__EIM_DATA01 0x013c 0x03c8 0x0000 4 0
549#define MX6UL_PAD_LCD_DATA09__GPIO3_IO14 0x013c 0x03c8 0x0000 5 0 566#define MX6UL_PAD_LCD_DATA09__GPIO3_IO14 0x013c 0x03c8 0x0000 5 0
550#define MX6UL_PAD_LCD_DATA09__SRC_BT_CFG09 0x013c 0x03c8 0x0000 6 0 567#define MX6UL_PAD_LCD_DATA09__SRC_BT_CFG09 0x013c 0x03c8 0x0000 6 0
551#define MX6UL_PAD_LCD_DATA09__FLEXCAN1_RX 0x013c 0x03c8 0x0584 8 2 568#define MX6UL_PAD_LCD_DATA09__FLEXCAN1_RX 0x013c 0x03c8 0x0584 8 2
552#define MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x0140 0x03cc 0x0000 0 0 569#define MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x0140 0x03cc 0x0000 0 0
553#define MX6UL_PAD_LCD_DATA10__SAI3_RX_SYNC 0x0140 0x03cc 0x0000 1 0 570#define MX6UL_PAD_LCD_DATA10__SAI3_RX_SYNC 0x0140 0x03cc 0x0000 1 0
554#define MX6UL_PAD_LCD_DATA10__CSI_DATA18 0x0140 0x03cc 0x0000 3 0 571#define MX6UL_PAD_LCD_DATA10__CA7_MX6UL_TRACE10 0x0140 0x03cc 0x0000 2 0
572#define MX6UL_PAD_LCD_DATA10__CSI_DATA18 0x0140 0x03cc 0x050c 3 1
555#define MX6UL_PAD_LCD_DATA10__EIM_DATA02 0x0140 0x03cc 0x0000 4 0 573#define MX6UL_PAD_LCD_DATA10__EIM_DATA02 0x0140 0x03cc 0x0000 4 0
556#define MX6UL_PAD_LCD_DATA10__GPIO3_IO15 0x0140 0x03cc 0x0000 5 0 574#define MX6UL_PAD_LCD_DATA10__GPIO3_IO15 0x0140 0x03cc 0x0000 5 0
557#define MX6UL_PAD_LCD_DATA10__SRC_BT_CFG10 0x0140 0x03cc 0x0000 6 0 575#define MX6UL_PAD_LCD_DATA10__SRC_BT_CFG10 0x0140 0x03cc 0x0000 6 0
558#define MX6UL_PAD_LCD_DATA10__FLEXCAN2_TX 0x0140 0x03cc 0x0000 8 0 576#define MX6UL_PAD_LCD_DATA10__FLEXCAN2_TX 0x0140 0x03cc 0x0000 8 0
559#define MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x0144 0x03d0 0x0000 0 0 577#define MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x0144 0x03d0 0x0000 0 0
560#define MX6UL_PAD_LCD_DATA11__SAI3_RX_BCLK 0x0144 0x03d0 0x0000 1 0 578#define MX6UL_PAD_LCD_DATA11__SAI3_RX_BCLK 0x0144 0x03d0 0x0000 1 0
561#define MX6UL_PAD_LCD_DATA11__CSI_DATA19 0x0144 0x03d0 0x0000 3 0 579#define MX6UL_PAD_LCD_DATA11__CA7_MX6UL_TRACE11 0x0144 0x03d0 0x0000 2 0
580#define MX6UL_PAD_LCD_DATA11__CSI_DATA19 0x0144 0x03d0 0x0510 3 1
562#define MX6UL_PAD_LCD_DATA11__EIM_DATA03 0x0144 0x03d0 0x0000 4 0 581#define MX6UL_PAD_LCD_DATA11__EIM_DATA03 0x0144 0x03d0 0x0000 4 0
563#define MX6UL_PAD_LCD_DATA11__GPIO3_IO16 0x0144 0x03d0 0x0000 5 0 582#define MX6UL_PAD_LCD_DATA11__GPIO3_IO16 0x0144 0x03d0 0x0000 5 0
564#define MX6UL_PAD_LCD_DATA11__SRC_BT_CFG11 0x0144 0x03d0 0x0000 6 0 583#define MX6UL_PAD_LCD_DATA11__SRC_BT_CFG11 0x0144 0x03d0 0x0000 6 0
565#define MX6UL_PAD_LCD_DATA11__FLEXCAN2_RX 0x0144 0x03d0 0x0588 8 2 584#define MX6UL_PAD_LCD_DATA11__FLEXCAN2_RX 0x0144 0x03d0 0x0588 8 2
566#define MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x0148 0x03d4 0x0000 0 0 585#define MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x0148 0x03d4 0x0000 0 0
567#define MX6UL_PAD_LCD_DATA12__SAI3_TX_SYNC 0x0148 0x03d4 0x060c 1 1 586#define MX6UL_PAD_LCD_DATA12__SAI3_TX_SYNC 0x0148 0x03d4 0x060c 1 1
568#define MX6UL_PAD_LCD_DATA12__CSI_DATA20 0x0148 0x03d4 0x0000 3 0 587#define MX6UL_PAD_LCD_DATA12__CA7_MX6UL_TRACE12 0x0148 0x03d4 0x0000 2 0
588#define MX6UL_PAD_LCD_DATA12__CSI_DATA20 0x0148 0x03d4 0x0514 3 1
569#define MX6UL_PAD_LCD_DATA12__EIM_DATA04 0x0148 0x03d4 0x0000 4 0 589#define MX6UL_PAD_LCD_DATA12__EIM_DATA04 0x0148 0x03d4 0x0000 4 0
570#define MX6UL_PAD_LCD_DATA12__GPIO3_IO17 0x0148 0x03d4 0x0000 5 0 590#define MX6UL_PAD_LCD_DATA12__GPIO3_IO17 0x0148 0x03d4 0x0000 5 0
571#define MX6UL_PAD_LCD_DATA12__SRC_BT_CFG12 0x0148 0x03d4 0x0000 6 0 591#define MX6UL_PAD_LCD_DATA12__SRC_BT_CFG12 0x0148 0x03d4 0x0000 6 0
572#define MX6UL_PAD_LCD_DATA12__ECSPI1_RDY 0x0148 0x03d4 0x0000 8 0 592#define MX6UL_PAD_LCD_DATA12__ECSPI1_RDY 0x0148 0x03d4 0x0000 8 0
573#define MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x014c 0x03d8 0x0000 0 0 593#define MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x014c 0x03d8 0x0000 0 0
574#define MX6UL_PAD_LCD_DATA13__SAI3_TX_BCLK 0x014c 0x03d8 0x0608 1 1 594#define MX6UL_PAD_LCD_DATA13__SAI3_TX_BCLK 0x014c 0x03d8 0x0608 1 1
575#define MX6UL_PAD_LCD_DATA13__CSI_DATA21 0x014c 0x03d8 0x0000 3 0 595#define MX6UL_PAD_LCD_DATA13__CA7_MX6UL_TRACE13 0x014c 0x03d8 0x0000 2 0
596#define MX6UL_PAD_LCD_DATA13__CSI_DATA21 0x014c 0x03d8 0x0518 3 1
576#define MX6UL_PAD_LCD_DATA13__EIM_DATA05 0x014c 0x03d8 0x0000 4 0 597#define MX6UL_PAD_LCD_DATA13__EIM_DATA05 0x014c 0x03d8 0x0000 4 0
577#define MX6UL_PAD_LCD_DATA13__GPIO3_IO18 0x014c 0x03d8 0x0000 5 0 598#define MX6UL_PAD_LCD_DATA13__GPIO3_IO18 0x014c 0x03d8 0x0000 5 0
578#define MX6UL_PAD_LCD_DATA13__SRC_BT_CFG13 0x014c 0x03d8 0x0000 6 0 599#define MX6UL_PAD_LCD_DATA13__SRC_BT_CFG13 0x014c 0x03d8 0x0000 6 0
579#define MX6UL_PAD_LCD_DATA13__USDHC2_RESET_B 0x014c 0x03d8 0x0000 8 0 600#define MX6UL_PAD_LCD_DATA13__USDHC2_RESET_B 0x014c 0x03d8 0x0000 8 0
580#define MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x0150 0x03dc 0x0000 0 0 601#define MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x0150 0x03dc 0x0000 0 0
581#define MX6UL_PAD_LCD_DATA14__SAI3_RX_DATA 0x0150 0x03dc 0x0000 1 0 602#define MX6UL_PAD_LCD_DATA14__SAI3_RX_DATA 0x0150 0x03dc 0x0604 1 1
582#define MX6UL_PAD_LCD_DATA14__CSI_DATA22 0x0150 0x03dc 0x0000 3 0 603#define MX6UL_PAD_LCD_DATA14__CA7_MX6UL_TRACE14 0x0150 0x03dc 0x0000 2 0
604#define MX6UL_PAD_LCD_DATA14__CSI_DATA22 0x0150 0x03dc 0x051c 3 1
583#define MX6UL_PAD_LCD_DATA14__EIM_DATA06 0x0150 0x03dc 0x0000 4 0 605#define MX6UL_PAD_LCD_DATA14__EIM_DATA06 0x0150 0x03dc 0x0000 4 0
584#define MX6UL_PAD_LCD_DATA14__GPIO3_IO19 0x0150 0x03dc 0x0000 5 0 606#define MX6UL_PAD_LCD_DATA14__GPIO3_IO19 0x0150 0x03dc 0x0000 5 0
585#define MX6UL_PAD_LCD_DATA14__SRC_BT_CFG14 0x0150 0x03dc 0x0000 6 0 607#define MX6UL_PAD_LCD_DATA14__SRC_BT_CFG14 0x0150 0x03dc 0x0000 6 0
586#define MX6UL_PAD_LCD_DATA14__USDHC2_DATA4 0x0150 0x03dc 0x068c 8 0 608#define MX6UL_PAD_LCD_DATA14__USDHC2_DATA4 0x0150 0x03dc 0x068c 8 0
587#define MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x0154 0x03e0 0x0000 0 0 609#define MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x0154 0x03e0 0x0000 0 0
588#define MX6UL_PAD_LCD_DATA15__SAI3_TX_DATA 0x0154 0x03e0 0x0000 1 0 610#define MX6UL_PAD_LCD_DATA15__SAI3_TX_DATA 0x0154 0x03e0 0x0000 1 0
589#define MX6UL_PAD_LCD_DATA15__CSI_DATA23 0x0154 0x03e0 0x0000 3 0 611#define MX6UL_PAD_LCD_DATA15__CA7_MX6UL_TRACE15 0x0154 0x03e0 0x0000 2 0
612#define MX6UL_PAD_LCD_DATA15__CSI_DATA23 0x0154 0x03e0 0x0520 3 1
590#define MX6UL_PAD_LCD_DATA15__EIM_DATA07 0x0154 0x03e0 0x0000 4 0 613#define MX6UL_PAD_LCD_DATA15__EIM_DATA07 0x0154 0x03e0 0x0000 4 0
591#define MX6UL_PAD_LCD_DATA15__GPIO3_IO20 0x0154 0x03e0 0x0000 5 0 614#define MX6UL_PAD_LCD_DATA15__GPIO3_IO20 0x0154 0x03e0 0x0000 5 0
592#define MX6UL_PAD_LCD_DATA15__SRC_BT_CFG15 0x0154 0x03e0 0x0000 6 0 615#define MX6UL_PAD_LCD_DATA15__SRC_BT_CFG15 0x0154 0x03e0 0x0000 6 0
@@ -594,7 +617,8 @@
594#define MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x0158 0x03e4 0x0000 0 0 617#define MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x0158 0x03e4 0x0000 0 0
595#define MX6UL_PAD_LCD_DATA16__UART7_DCE_TX 0x0158 0x03e4 0x0000 1 0 618#define MX6UL_PAD_LCD_DATA16__UART7_DCE_TX 0x0158 0x03e4 0x0000 1 0
596#define MX6UL_PAD_LCD_DATA16__UART7_DTE_RX 0x0158 0x03e4 0x0654 1 2 619#define MX6UL_PAD_LCD_DATA16__UART7_DTE_RX 0x0158 0x03e4 0x0654 1 2
597#define MX6UL_PAD_LCD_DATA16__CSI_DATA01 0x0158 0x03e4 0x0000 3 0 620#define MX6UL_PAD_LCD_DATA16__CA7_MX6UL_TRACE_CLK 0x0158 0x03e4 0x0000 2 0
621#define MX6UL_PAD_LCD_DATA16__CSI_DATA01 0x0158 0x03e4 0x04d4 3 1
598#define MX6UL_PAD_LCD_DATA16__EIM_DATA08 0x0158 0x03e4 0x0000 4 0 622#define MX6UL_PAD_LCD_DATA16__EIM_DATA08 0x0158 0x03e4 0x0000 4 0
599#define MX6UL_PAD_LCD_DATA16__GPIO3_IO21 0x0158 0x03e4 0x0000 5 0 623#define MX6UL_PAD_LCD_DATA16__GPIO3_IO21 0x0158 0x03e4 0x0000 5 0
600#define MX6UL_PAD_LCD_DATA16__SRC_BT_CFG24 0x0158 0x03e4 0x0000 6 0 624#define MX6UL_PAD_LCD_DATA16__SRC_BT_CFG24 0x0158 0x03e4 0x0000 6 0
@@ -602,7 +626,8 @@
602#define MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x015c 0x03e8 0x0000 0 0 626#define MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x015c 0x03e8 0x0000 0 0
603#define MX6UL_PAD_LCD_DATA17__UART7_DCE_RX 0x015c 0x03e8 0x0654 1 3 627#define MX6UL_PAD_LCD_DATA17__UART7_DCE_RX 0x015c 0x03e8 0x0654 1 3
604#define MX6UL_PAD_LCD_DATA17__UART7_DTE_TX 0x015c 0x03e8 0x0000 1 0 628#define MX6UL_PAD_LCD_DATA17__UART7_DTE_TX 0x015c 0x03e8 0x0000 1 0
605#define MX6UL_PAD_LCD_DATA17__CSI_DATA00 0x015c 0x03e8 0x0000 3 0 629#define MX6UL_PAD_LCD_DATA17__CA7_MX6UL_TRACE_CTL 0x015c 0x03e8 0x0000 2 0
630#define MX6UL_PAD_LCD_DATA17__CSI_DATA00 0x015c 0x03e8 0x04d0 3 1
606#define MX6UL_PAD_LCD_DATA17__EIM_DATA09 0x015c 0x03e8 0x0000 4 0 631#define MX6UL_PAD_LCD_DATA17__EIM_DATA09 0x015c 0x03e8 0x0000 4 0
607#define MX6UL_PAD_LCD_DATA17__GPIO3_IO22 0x015c 0x03e8 0x0000 5 0 632#define MX6UL_PAD_LCD_DATA17__GPIO3_IO22 0x015c 0x03e8 0x0000 5 0
608#define MX6UL_PAD_LCD_DATA17__SRC_BT_CFG25 0x015c 0x03e8 0x0000 6 0 633#define MX6UL_PAD_LCD_DATA17__SRC_BT_CFG25 0x015c 0x03e8 0x0000 6 0
@@ -610,7 +635,7 @@
610#define MX6UL_PAD_LCD_DATA18__LCDIF_DATA18 0x0160 0x03ec 0x0000 0 0 635#define MX6UL_PAD_LCD_DATA18__LCDIF_DATA18 0x0160 0x03ec 0x0000 0 0
611#define MX6UL_PAD_LCD_DATA18__PWM5_OUT 0x0160 0x03ec 0x0000 1 0 636#define MX6UL_PAD_LCD_DATA18__PWM5_OUT 0x0160 0x03ec 0x0000 1 0
612#define MX6UL_PAD_LCD_DATA18__CA7_MX6UL_EVENTO 0x0160 0x03ec 0x0000 2 0 637#define MX6UL_PAD_LCD_DATA18__CA7_MX6UL_EVENTO 0x0160 0x03ec 0x0000 2 0
613#define MX6UL_PAD_LCD_DATA18__CSI_DATA10 0x0160 0x03ec 0x0000 3 0 638#define MX6UL_PAD_LCD_DATA18__CSI_DATA10 0x0160 0x03ec 0x04ec 3 1
614#define MX6UL_PAD_LCD_DATA18__EIM_DATA10 0x0160 0x03ec 0x0000 4 0 639#define MX6UL_PAD_LCD_DATA18__EIM_DATA10 0x0160 0x03ec 0x0000 4 0
615#define MX6UL_PAD_LCD_DATA18__GPIO3_IO23 0x0160 0x03ec 0x0000 5 0 640#define MX6UL_PAD_LCD_DATA18__GPIO3_IO23 0x0160 0x03ec 0x0000 5 0
616#define MX6UL_PAD_LCD_DATA18__SRC_BT_CFG26 0x0160 0x03ec 0x0000 6 0 641#define MX6UL_PAD_LCD_DATA18__SRC_BT_CFG26 0x0160 0x03ec 0x0000 6 0
@@ -622,7 +647,7 @@
622#define MX6UL_PAD_LCD_DATA19__LCDIF_DATA19 0x0164 0x03f0 0x0000 0 0 647#define MX6UL_PAD_LCD_DATA19__LCDIF_DATA19 0x0164 0x03f0 0x0000 0 0
623#define MX6UL_PAD_LCD_DATA19__PWM6_OUT 0x0164 0x03f0 0x0000 1 0 648#define MX6UL_PAD_LCD_DATA19__PWM6_OUT 0x0164 0x03f0 0x0000 1 0
624#define MX6UL_PAD_LCD_DATA19__WDOG1_WDOG_ANY 0x0164 0x03f0 0x0000 2 0 649#define MX6UL_PAD_LCD_DATA19__WDOG1_WDOG_ANY 0x0164 0x03f0 0x0000 2 0
625#define MX6UL_PAD_LCD_DATA19__CSI_DATA11 0x0164 0x03f0 0x0000 3 0 650#define MX6UL_PAD_LCD_DATA19__CSI_DATA11 0x0164 0x03f0 0x04f0 3 1
626#define MX6UL_PAD_LCD_DATA20__EIM_DATA12 0x0168 0x03f4 0x0000 4 0 651#define MX6UL_PAD_LCD_DATA20__EIM_DATA12 0x0168 0x03f4 0x0000 4 0
627#define MX6UL_PAD_LCD_DATA20__GPIO3_IO25 0x0168 0x03f4 0x0000 5 0 652#define MX6UL_PAD_LCD_DATA20__GPIO3_IO25 0x0168 0x03f4 0x0000 5 0
628#define MX6UL_PAD_LCD_DATA20__SRC_BT_CFG28 0x0168 0x03f4 0x0000 6 0 653#define MX6UL_PAD_LCD_DATA20__SRC_BT_CFG28 0x0168 0x03f4 0x0000 6 0
@@ -631,12 +656,12 @@
631#define MX6UL_PAD_LCD_DATA20__UART8_DCE_TX 0x0168 0x03f4 0x0000 1 0 656#define MX6UL_PAD_LCD_DATA20__UART8_DCE_TX 0x0168 0x03f4 0x0000 1 0
632#define MX6UL_PAD_LCD_DATA20__UART8_DTE_RX 0x0168 0x03f4 0x065c 1 2 657#define MX6UL_PAD_LCD_DATA20__UART8_DTE_RX 0x0168 0x03f4 0x065c 1 2
633#define MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK 0x0168 0x03f4 0x0534 2 0 658#define MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK 0x0168 0x03f4 0x0534 2 0
634#define MX6UL_PAD_LCD_DATA20__CSI_DATA12 0x0168 0x03f4 0x0000 3 0 659#define MX6UL_PAD_LCD_DATA20__CSI_DATA12 0x0168 0x03f4 0x04f4 3 1
635#define MX6UL_PAD_LCD_DATA21__LCDIF_DATA21 0x016c 0x03f8 0x0000 0 0 660#define MX6UL_PAD_LCD_DATA21__LCDIF_DATA21 0x016c 0x03f8 0x0000 0 0
636#define MX6UL_PAD_LCD_DATA21__UART8_DCE_RX 0x016c 0x03f8 0x065c 1 3 661#define MX6UL_PAD_LCD_DATA21__UART8_DCE_RX 0x016c 0x03f8 0x065c 1 3
637#define MX6UL_PAD_LCD_DATA21__UART8_DTE_TX 0x016c 0x03f8 0x0000 1 0 662#define MX6UL_PAD_LCD_DATA21__UART8_DTE_TX 0x016c 0x03f8 0x0000 1 0
638#define MX6UL_PAD_LCD_DATA21__ECSPI1_SS0 0x016c 0x03f8 0x0000 2 0 663#define MX6UL_PAD_LCD_DATA21__ECSPI1_SS0 0x016c 0x03f8 0x0540 2 0
639#define MX6UL_PAD_LCD_DATA21__CSI_DATA13 0x016c 0x03f8 0x0000 3 0 664#define MX6UL_PAD_LCD_DATA21__CSI_DATA13 0x016c 0x03f8 0x04f8 3 1
640#define MX6UL_PAD_LCD_DATA21__EIM_DATA13 0x016c 0x03f8 0x0000 4 0 665#define MX6UL_PAD_LCD_DATA21__EIM_DATA13 0x016c 0x03f8 0x0000 4 0
641#define MX6UL_PAD_LCD_DATA21__GPIO3_IO26 0x016c 0x03f8 0x0000 5 0 666#define MX6UL_PAD_LCD_DATA21__GPIO3_IO26 0x016c 0x03f8 0x0000 5 0
642#define MX6UL_PAD_LCD_DATA21__SRC_BT_CFG29 0x016c 0x03f8 0x0000 6 0 667#define MX6UL_PAD_LCD_DATA21__SRC_BT_CFG29 0x016c 0x03f8 0x0000 6 0
@@ -644,7 +669,7 @@
644#define MX6UL_PAD_LCD_DATA22__LCDIF_DATA22 0x0170 0x03fc 0x0000 0 0 669#define MX6UL_PAD_LCD_DATA22__LCDIF_DATA22 0x0170 0x03fc 0x0000 0 0
645#define MX6UL_PAD_LCD_DATA22__MQS_RIGHT 0x0170 0x03fc 0x0000 1 0 670#define MX6UL_PAD_LCD_DATA22__MQS_RIGHT 0x0170 0x03fc 0x0000 1 0
646#define MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI 0x0170 0x03fc 0x053c 2 0 671#define MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI 0x0170 0x03fc 0x053c 2 0
647#define MX6UL_PAD_LCD_DATA22__CSI_DATA14 0x0170 0x03fc 0x0000 3 0 672#define MX6UL_PAD_LCD_DATA22__CSI_DATA14 0x0170 0x03fc 0x04fc 3 1
648#define MX6UL_PAD_LCD_DATA22__EIM_DATA14 0x0170 0x03fc 0x0000 4 0 673#define MX6UL_PAD_LCD_DATA22__EIM_DATA14 0x0170 0x03fc 0x0000 4 0
649#define MX6UL_PAD_LCD_DATA22__GPIO3_IO27 0x0170 0x03fc 0x0000 5 0 674#define MX6UL_PAD_LCD_DATA22__GPIO3_IO27 0x0170 0x03fc 0x0000 5 0
650#define MX6UL_PAD_LCD_DATA22__SRC_BT_CFG30 0x0170 0x03fc 0x0000 6 0 675#define MX6UL_PAD_LCD_DATA22__SRC_BT_CFG30 0x0170 0x03fc 0x0000 6 0
@@ -652,7 +677,7 @@
652#define MX6UL_PAD_LCD_DATA23__LCDIF_DATA23 0x0174 0x0400 0x0000 0 0 677#define MX6UL_PAD_LCD_DATA23__LCDIF_DATA23 0x0174 0x0400 0x0000 0 0
653#define MX6UL_PAD_LCD_DATA23__MQS_LEFT 0x0174 0x0400 0x0000 1 0 678#define MX6UL_PAD_LCD_DATA23__MQS_LEFT 0x0174 0x0400 0x0000 1 0
654#define MX6UL_PAD_LCD_DATA23__ECSPI1_MISO 0x0174 0x0400 0x0538 2 0 679#define MX6UL_PAD_LCD_DATA23__ECSPI1_MISO 0x0174 0x0400 0x0538 2 0
655#define MX6UL_PAD_LCD_DATA23__CSI_DATA15 0x0174 0x0400 0x0000 3 0 680#define MX6UL_PAD_LCD_DATA23__CSI_DATA15 0x0174 0x0400 0x0500 3 1
656#define MX6UL_PAD_LCD_DATA23__EIM_DATA15 0x0174 0x0400 0x0000 4 0 681#define MX6UL_PAD_LCD_DATA23__EIM_DATA15 0x0174 0x0400 0x0000 4 0
657#define MX6UL_PAD_LCD_DATA23__GPIO3_IO28 0x0174 0x0400 0x0000 5 0 682#define MX6UL_PAD_LCD_DATA23__GPIO3_IO28 0x0174 0x0400 0x0000 5 0
658#define MX6UL_PAD_LCD_DATA23__SRC_BT_CFG31 0x0174 0x0400 0x0000 6 0 683#define MX6UL_PAD_LCD_DATA23__SRC_BT_CFG31 0x0174 0x0400 0x0000 6 0
@@ -660,42 +685,42 @@
660#define MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0x0178 0x0404 0x0000 0 0 685#define MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0x0178 0x0404 0x0000 0 0
661#define MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x0178 0x0404 0x0670 1 2 686#define MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x0178 0x0404 0x0670 1 2
662#define MX6UL_PAD_NAND_RE_B__QSPI_B_SCLK 0x0178 0x0404 0x0000 2 0 687#define MX6UL_PAD_NAND_RE_B__QSPI_B_SCLK 0x0178 0x0404 0x0000 2 0
663#define MX6UL_PAD_NAND_RE_B__KPP_ROW00 0x0178 0x0404 0x0000 3 0 688#define MX6UL_PAD_NAND_RE_B__KPP_ROW00 0x0178 0x0404 0x05d0 3 1
664#define MX6UL_PAD_NAND_RE_B__EIM_EB_B00 0x0178 0x0404 0x0000 4 0 689#define MX6UL_PAD_NAND_RE_B__EIM_EB_B00 0x0178 0x0404 0x0000 4 0
665#define MX6UL_PAD_NAND_RE_B__GPIO4_IO00 0x0178 0x0404 0x0000 5 0 690#define MX6UL_PAD_NAND_RE_B__GPIO4_IO00 0x0178 0x0404 0x0000 5 0
666#define MX6UL_PAD_NAND_RE_B__ECSPI3_SS2 0x0178 0x0404 0x0000 8 0 691#define MX6UL_PAD_NAND_RE_B__ECSPI3_SS2 0x0178 0x0404 0x0000 8 0
667#define MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0x017c 0x0408 0x0000 0 0 692#define MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0x017c 0x0408 0x0000 0 0
668#define MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x017c 0x0408 0x0678 1 2 693#define MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x017c 0x0408 0x0678 1 2
669#define MX6UL_PAD_NAND_WE_B__QSPI_B_SS0_B 0x017c 0x0408 0x0000 2 0 694#define MX6UL_PAD_NAND_WE_B__QSPI_B_SS0_B 0x017c 0x0408 0x0000 2 0
670#define MX6UL_PAD_NAND_WE_B__KPP_COL00 0x017c 0x0408 0x0000 3 0 695#define MX6UL_PAD_NAND_WE_B__KPP_COL00 0x017c 0x0408 0x05c4 3 1
671#define MX6UL_PAD_NAND_WE_B__EIM_EB_B01 0x017c 0x0408 0x0000 4 0 696#define MX6UL_PAD_NAND_WE_B__EIM_EB_B01 0x017c 0x0408 0x0000 4 0
672#define MX6UL_PAD_NAND_WE_B__GPIO4_IO01 0x017c 0x0408 0x0000 5 0 697#define MX6UL_PAD_NAND_WE_B__GPIO4_IO01 0x017c 0x0408 0x0000 5 0
673#define MX6UL_PAD_NAND_WE_B__ECSPI3_SS3 0x017c 0x0408 0x0000 8 0 698#define MX6UL_PAD_NAND_WE_B__ECSPI3_SS3 0x017c 0x0408 0x0000 8 0
674#define MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0x0180 0x040c 0x0000 0 0 699#define MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0x0180 0x040c 0x0000 0 0
675#define MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x0180 0x040c 0x067c 1 2 700#define MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x0180 0x040c 0x067c 1 2
676#define MX6UL_PAD_NAND_DATA00__QSPI_B_SS1_B 0x0180 0x040c 0x0000 2 0 701#define MX6UL_PAD_NAND_DATA00__QSPI_B_SS1_B 0x0180 0x040c 0x0000 2 0
677#define MX6UL_PAD_NAND_DATA00__KPP_ROW01 0x0180 0x040c 0x0000 3 0 702#define MX6UL_PAD_NAND_DATA00__KPP_ROW01 0x0180 0x040c 0x05d4 3 1
678#define MX6UL_PAD_NAND_DATA00__EIM_AD08 0x0180 0x040c 0x0000 4 0 703#define MX6UL_PAD_NAND_DATA00__EIM_AD08 0x0180 0x040c 0x0000 4 0
679#define MX6UL_PAD_NAND_DATA00__GPIO4_IO02 0x0180 0x040c 0x0000 5 0 704#define MX6UL_PAD_NAND_DATA00__GPIO4_IO02 0x0180 0x040c 0x0000 5 0
680#define MX6UL_PAD_NAND_DATA00__ECSPI4_RDY 0x0180 0x040c 0x0000 8 0 705#define MX6UL_PAD_NAND_DATA00__ECSPI4_RDY 0x0180 0x040c 0x0000 8 0
681#define MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0x0184 0x0410 0x0000 0 0 706#define MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0x0184 0x0410 0x0000 0 0
682#define MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x0184 0x0410 0x0680 1 2 707#define MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x0184 0x0410 0x0680 1 2
683#define MX6UL_PAD_NAND_DATA01__QSPI_B_DQS 0x0184 0x0410 0x0000 2 0 708#define MX6UL_PAD_NAND_DATA01__QSPI_B_DQS 0x0184 0x0410 0x0000 2 0
684#define MX6UL_PAD_NAND_DATA01__KPP_COL01 0x0184 0x0410 0x0000 3 0 709#define MX6UL_PAD_NAND_DATA01__KPP_COL01 0x0184 0x0410 0x05c8 3 1
685#define MX6UL_PAD_NAND_DATA01__EIM_AD09 0x0184 0x0410 0x0000 4 0 710#define MX6UL_PAD_NAND_DATA01__EIM_AD09 0x0184 0x0410 0x0000 4 0
686#define MX6UL_PAD_NAND_DATA01__GPIO4_IO03 0x0184 0x0410 0x0000 5 0 711#define MX6UL_PAD_NAND_DATA01__GPIO4_IO03 0x0184 0x0410 0x0000 5 0
687#define MX6UL_PAD_NAND_DATA01__ECSPI4_SS1 0x0184 0x0410 0x0000 8 0 712#define MX6UL_PAD_NAND_DATA01__ECSPI4_SS1 0x0184 0x0410 0x0000 8 0
688#define MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0x0188 0x0414 0x0000 0 0 713#define MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0x0188 0x0414 0x0000 0 0
689#define MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x0188 0x0414 0x0684 1 1 714#define MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x0188 0x0414 0x0684 1 1
690#define MX6UL_PAD_NAND_DATA02__QSPI_B_DATA00 0x0188 0x0414 0x0000 2 0 715#define MX6UL_PAD_NAND_DATA02__QSPI_B_DATA00 0x0188 0x0414 0x0000 2 0
691#define MX6UL_PAD_NAND_DATA02__KPP_ROW02 0x0188 0x0414 0x0000 3 0 716#define MX6UL_PAD_NAND_DATA02__KPP_ROW02 0x0188 0x0414 0x05d8 3 1
692#define MX6UL_PAD_NAND_DATA02__EIM_AD10 0x0188 0x0414 0x0000 4 0 717#define MX6UL_PAD_NAND_DATA02__EIM_AD10 0x0188 0x0414 0x0000 4 0
693#define MX6UL_PAD_NAND_DATA02__GPIO4_IO04 0x0188 0x0414 0x0000 5 0 718#define MX6UL_PAD_NAND_DATA02__GPIO4_IO04 0x0188 0x0414 0x0000 5 0
694#define MX6UL_PAD_NAND_DATA02__ECSPI4_SS2 0x0188 0x0414 0x0000 8 0 719#define MX6UL_PAD_NAND_DATA02__ECSPI4_SS2 0x0188 0x0414 0x0000 8 0
695#define MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0x018c 0x0418 0x0000 0 0 720#define MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0x018c 0x0418 0x0000 0 0
696#define MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x018c 0x0418 0x0688 1 2 721#define MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x018c 0x0418 0x0688 1 2
697#define MX6UL_PAD_NAND_DATA03__QSPI_B_DATA01 0x018c 0x0418 0x0000 2 0 722#define MX6UL_PAD_NAND_DATA03__QSPI_B_DATA01 0x018c 0x0418 0x0000 2 0
698#define MX6UL_PAD_NAND_DATA03__KPP_COL02 0x018c 0x0418 0x0000 3 0 723#define MX6UL_PAD_NAND_DATA03__KPP_COL02 0x018c 0x0418 0x05cc 3 1
699#define MX6UL_PAD_NAND_DATA03__EIM_AD11 0x018c 0x0418 0x0000 4 0 724#define MX6UL_PAD_NAND_DATA03__EIM_AD11 0x018c 0x0418 0x0000 4 0
700#define MX6UL_PAD_NAND_DATA03__GPIO4_IO05 0x018c 0x0418 0x0000 5 0 725#define MX6UL_PAD_NAND_DATA03__GPIO4_IO05 0x018c 0x0418 0x0000 5 0
701#define MX6UL_PAD_NAND_DATA03__ECSPI4_SS3 0x018c 0x0418 0x0000 8 0 726#define MX6UL_PAD_NAND_DATA03__ECSPI4_SS3 0x018c 0x0418 0x0000 8 0
@@ -726,7 +751,7 @@
726#define MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0x019c 0x0428 0x0000 0 0 751#define MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0x019c 0x0428 0x0000 0 0
727#define MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x019c 0x0428 0x0698 1 1 752#define MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x019c 0x0428 0x0698 1 1
728#define MX6UL_PAD_NAND_DATA07__QSPI_A_SS1_B 0x019c 0x0428 0x0000 2 0 753#define MX6UL_PAD_NAND_DATA07__QSPI_A_SS1_B 0x019c 0x0428 0x0000 2 0
729#define MX6UL_PAD_NAND_DATA07__ECSPI4_SS0 0x019c 0x0428 0x0000 3 0 754#define MX6UL_PAD_NAND_DATA07__ECSPI4_SS0 0x019c 0x0428 0x0570 3 1
730#define MX6UL_PAD_NAND_DATA07__EIM_AD15 0x019c 0x0428 0x0000 4 0 755#define MX6UL_PAD_NAND_DATA07__EIM_AD15 0x019c 0x0428 0x0000 4 0
731#define MX6UL_PAD_NAND_DATA07__GPIO4_IO09 0x019c 0x0428 0x0000 5 0 756#define MX6UL_PAD_NAND_DATA07__GPIO4_IO09 0x019c 0x0428 0x0000 5 0
732#define MX6UL_PAD_NAND_DATA07__UART2_DCE_RTS 0x019c 0x0428 0x0628 8 5 757#define MX6UL_PAD_NAND_DATA07__UART2_DCE_RTS 0x019c 0x0428 0x0628 8 5
@@ -748,7 +773,7 @@
748#define MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0x01a8 0x0434 0x0000 0 0 773#define MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0x01a8 0x0434 0x0000 0 0
749#define MX6UL_PAD_NAND_READY_B__USDHC1_DATA4 0x01a8 0x0434 0x0000 1 0 774#define MX6UL_PAD_NAND_READY_B__USDHC1_DATA4 0x01a8 0x0434 0x0000 1 0
750#define MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x01a8 0x0434 0x0000 2 0 775#define MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x01a8 0x0434 0x0000 2 0
751#define MX6UL_PAD_NAND_READY_B__ECSPI3_SS0 0x01a8 0x0434 0x0000 3 0 776#define MX6UL_PAD_NAND_READY_B__ECSPI3_SS0 0x01a8 0x0434 0x0560 3 1
752#define MX6UL_PAD_NAND_READY_B__EIM_CS1_B 0x01a8 0x0434 0x0000 4 0 777#define MX6UL_PAD_NAND_READY_B__EIM_CS1_B 0x01a8 0x0434 0x0000 4 0
753#define MX6UL_PAD_NAND_READY_B__GPIO4_IO12 0x01a8 0x0434 0x0000 5 0 778#define MX6UL_PAD_NAND_READY_B__GPIO4_IO12 0x01a8 0x0434 0x0000 5 0
754#define MX6UL_PAD_NAND_READY_B__UART3_DCE_TX 0x01a8 0x0434 0x0000 8 0 779#define MX6UL_PAD_NAND_READY_B__UART3_DCE_TX 0x01a8 0x0434 0x0000 8 0
@@ -783,7 +808,7 @@
783#define MX6UL_PAD_NAND_DQS__PWM5_OUT 0x01b8 0x0444 0x0000 3 0 808#define MX6UL_PAD_NAND_DQS__PWM5_OUT 0x01b8 0x0444 0x0000 3 0
784#define MX6UL_PAD_NAND_DQS__EIM_WAIT 0x01b8 0x0444 0x0000 4 0 809#define MX6UL_PAD_NAND_DQS__EIM_WAIT 0x01b8 0x0444 0x0000 4 0
785#define MX6UL_PAD_NAND_DQS__GPIO4_IO16 0x01b8 0x0444 0x0000 5 0 810#define MX6UL_PAD_NAND_DQS__GPIO4_IO16 0x01b8 0x0444 0x0000 5 0
786#define MX6UL_PAD_NAND_DQS__SDMA_EXT_EVENT01 0x01b8 0x0444 0x0000 6 0 811#define MX6UL_PAD_NAND_DQS__SDMA_EXT_EVENT01 0x01b8 0x0444 0x0614 6 1
787#define MX6UL_PAD_NAND_DQS__SPDIF_EXT_CLK 0x01b8 0x0444 0x061c 8 1 812#define MX6UL_PAD_NAND_DQS__SPDIF_EXT_CLK 0x01b8 0x0444 0x061c 8 1
788#define MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x01bc 0x0448 0x0000 0 0 813#define MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x01bc 0x0448 0x0000 0 0
789#define MX6UL_PAD_SD1_CMD__GPT2_COMPARE1 0x01bc 0x0448 0x0000 1 0 814#define MX6UL_PAD_SD1_CMD__GPT2_COMPARE1 0x01bc 0x0448 0x0000 1 0
@@ -791,11 +816,11 @@
791#define MX6UL_PAD_SD1_CMD__SPDIF_OUT 0x01bc 0x0448 0x0000 3 0 816#define MX6UL_PAD_SD1_CMD__SPDIF_OUT 0x01bc 0x0448 0x0000 3 0
792#define MX6UL_PAD_SD1_CMD__EIM_ADDR19 0x01bc 0x0448 0x0000 4 0 817#define MX6UL_PAD_SD1_CMD__EIM_ADDR19 0x01bc 0x0448 0x0000 4 0
793#define MX6UL_PAD_SD1_CMD__GPIO2_IO16 0x01bc 0x0448 0x0000 5 0 818#define MX6UL_PAD_SD1_CMD__GPIO2_IO16 0x01bc 0x0448 0x0000 5 0
794#define MX6UL_PAD_SD1_CMD__SDMA_EXT_EVENT00 0x01bc 0x0448 0x0000 6 0 819#define MX6UL_PAD_SD1_CMD__SDMA_EXT_EVENT00 0x01bc 0x0448 0x0610 6 2
795#define MX6UL_PAD_SD1_CMD__USB_OTG1_PWR 0x01bc 0x0448 0x0000 8 0 820#define MX6UL_PAD_SD1_CMD__USB_OTG1_PWR 0x01bc 0x0448 0x0000 8 0
796#define MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x01c0 0x044c 0x0000 0 0 821#define MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x01c0 0x044c 0x0000 0 0
797#define MX6UL_PAD_SD1_CLK__GPT2_COMPARE2 0x01c0 0x044c 0x0000 1 0 822#define MX6UL_PAD_SD1_CLK__GPT2_COMPARE2 0x01c0 0x044c 0x0000 1 0
798#define MX6UL_PAD_SD1_CLK__SAI2_MCLK 0x01c0 0x044c 0x0000 2 0 823#define MX6UL_PAD_SD1_CLK__SAI2_MCLK 0x01c0 0x044c 0x05f0 2 1
799#define MX6UL_PAD_SD1_CLK__SPDIF_IN 0x01c0 0x044c 0x0618 3 3 824#define MX6UL_PAD_SD1_CLK__SPDIF_IN 0x01c0 0x044c 0x0618 3 3
800#define MX6UL_PAD_SD1_CLK__EIM_ADDR20 0x01c0 0x044c 0x0000 4 0 825#define MX6UL_PAD_SD1_CLK__EIM_ADDR20 0x01c0 0x044c 0x0000 4 0
801#define MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x01c0 0x044c 0x0000 5 0 826#define MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x01c0 0x044c 0x0000 5 0
@@ -878,10 +903,10 @@
878#define MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x01e8 0x0474 0x04c8 0 0 903#define MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x01e8 0x0474 0x04c8 0 0
879#define MX6UL_PAD_CSI_DATA01__USDHC2_DATA1 0x01e8 0x0474 0x0680 1 0 904#define MX6UL_PAD_CSI_DATA01__USDHC2_DATA1 0x01e8 0x0474 0x0680 1 0
880#define MX6UL_PAD_CSI_DATA01__SIM1_PORT1_SVEN 0x01e8 0x0474 0x0000 2 0 905#define MX6UL_PAD_CSI_DATA01__SIM1_PORT1_SVEN 0x01e8 0x0474 0x0000 2 0
881#define MX6UL_PAD_CSI_DATA01__ECSPI2_SS0 0x01e8 0x0474 0x0000 3 0 906#define MX6UL_PAD_CSI_DATA01__ECSPI2_SS0 0x01e8 0x0474 0x0550 3 0
882#define MX6UL_PAD_CSI_DATA01__EIM_AD01 0x01e8 0x0474 0x0000 4 0 907#define MX6UL_PAD_CSI_DATA01__EIM_AD01 0x01e8 0x0474 0x0000 4 0
883#define MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x01e8 0x0474 0x0000 5 0 908#define MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x01e8 0x0474 0x0000 5 0
884#define MX6UL_PAD_CSI_DATA01__SAI1_MCLK 0x01e8 0x0474 0x0000 6 0 909#define MX6UL_PAD_CSI_DATA01__SAI1_MCLK 0x01e8 0x0474 0x05e0 6 0
885#define MX6UL_PAD_CSI_DATA01__UART5_DCE_RX 0x01e8 0x0474 0x0644 8 1 910#define MX6UL_PAD_CSI_DATA01__UART5_DCE_RX 0x01e8 0x0474 0x0644 8 1
886#define MX6UL_PAD_CSI_DATA01__UART5_DTE_TX 0x01e8 0x0474 0x0000 8 0 911#define MX6UL_PAD_CSI_DATA01__UART5_DTE_TX 0x01e8 0x0474 0x0000 8 0
887#define MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x01ec 0x0478 0x04d8 0 1 912#define MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x01ec 0x0478 0x04d8 0 1
@@ -913,7 +938,7 @@
913#define MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x01f8 0x0484 0x04e0 0 1 938#define MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x01f8 0x0484 0x04e0 0 1
914#define MX6UL_PAD_CSI_DATA05__USDHC2_DATA5 0x01f8 0x0484 0x0690 1 2 939#define MX6UL_PAD_CSI_DATA05__USDHC2_DATA5 0x01f8 0x0484 0x0690 1 2
915#define MX6UL_PAD_CSI_DATA05__SIM2_PORT1_RST_B 0x01f8 0x0484 0x0000 2 0 940#define MX6UL_PAD_CSI_DATA05__SIM2_PORT1_RST_B 0x01f8 0x0484 0x0000 2 0
916#define MX6UL_PAD_CSI_DATA05__ECSPI1_SS0 0x01f8 0x0484 0x0000 3 0 941#define MX6UL_PAD_CSI_DATA05__ECSPI1_SS0 0x01f8 0x0484 0x0540 3 1
917#define MX6UL_PAD_CSI_DATA05__EIM_AD05 0x01f8 0x0484 0x0000 4 0 942#define MX6UL_PAD_CSI_DATA05__EIM_AD05 0x01f8 0x0484 0x0000 4 0
918#define MX6UL_PAD_CSI_DATA05__GPIO4_IO26 0x01f8 0x0484 0x0000 5 0 943#define MX6UL_PAD_CSI_DATA05__GPIO4_IO26 0x01f8 0x0484 0x0000 5 0
919#define MX6UL_PAD_CSI_DATA05__SAI1_TX_BCLK 0x01f8 0x0484 0x05e8 6 1 944#define MX6UL_PAD_CSI_DATA05__SAI1_TX_BCLK 0x01f8 0x0484 0x05e8 6 1
@@ -924,7 +949,7 @@
924#define MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x01fc 0x0488 0x053c 3 1 949#define MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x01fc 0x0488 0x053c 3 1
925#define MX6UL_PAD_CSI_DATA06__EIM_AD06 0x01fc 0x0488 0x0000 4 0 950#define MX6UL_PAD_CSI_DATA06__EIM_AD06 0x01fc 0x0488 0x0000 4 0
926#define MX6UL_PAD_CSI_DATA06__GPIO4_IO27 0x01fc 0x0488 0x0000 5 0 951#define MX6UL_PAD_CSI_DATA06__GPIO4_IO27 0x01fc 0x0488 0x0000 5 0
927#define MX6UL_PAD_CSI_DATA06__SAI1_RX_DATA 0x01fc 0x0488 0x0000 6 0 952#define MX6UL_PAD_CSI_DATA06__SAI1_RX_DATA 0x01fc 0x0488 0x05e4 6 1
928#define MX6UL_PAD_CSI_DATA06__USDHC1_RESET_B 0x01fc 0x0488 0x0000 8 0 953#define MX6UL_PAD_CSI_DATA06__USDHC1_RESET_B 0x01fc 0x0488 0x0000 8 0
929#define MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x0200 0x048c 0x04e8 0 1 954#define MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x0200 0x048c 0x04e8 0 1
930#define MX6UL_PAD_CSI_DATA07__USDHC2_DATA7 0x0200 0x048c 0x0698 1 2 955#define MX6UL_PAD_CSI_DATA07__USDHC2_DATA7 0x0200 0x048c 0x0698 1 2
diff --git a/arch/arm/boot/dts/imx6ul-tx6ul.dtsi b/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
index 65111f9843f4..f678d18ad44a 100644
--- a/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
+++ b/arch/arm/boot/dts/imx6ul-tx6ul.dtsi
@@ -70,8 +70,8 @@
70 stdout-path = &uart1; 70 stdout-path = &uart1;
71 }; 71 };
72 72
73 memory { 73 memory@80000000 {
74 reg = <0 0>; /* will be filled by U-Boot */ 74 reg = <0x80000000 0>; /* will be filled by U-Boot */
75 }; 75 };
76 76
77 clocks { 77 clocks {
diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi
index 5d6c3ba36cd1..1241972b16ba 100644
--- a/arch/arm/boot/dts/imx6ul.dtsi
+++ b/arch/arm/boot/dts/imx6ul.dtsi
@@ -22,7 +22,7 @@
22 * Also for U-Boot there must be a pre-existing /memory node. 22 * Also for U-Boot there must be a pre-existing /memory node.
23 */ 23 */
24 chosen {}; 24 chosen {};
25 memory { device_type = "memory"; reg = <0 0>; }; 25 memory { device_type = "memory"; };
26 26
27 aliases { 27 aliases {
28 ethernet0 = &fec1; 28 ethernet0 = &fec1;
@@ -86,15 +86,10 @@
86 <&clks IMX6UL_CA7_SECONDARY_SEL>, 86 <&clks IMX6UL_CA7_SECONDARY_SEL>,
87 <&clks IMX6UL_CLK_STEP>, 87 <&clks IMX6UL_CLK_STEP>,
88 <&clks IMX6UL_CLK_PLL1_SW>, 88 <&clks IMX6UL_CLK_PLL1_SW>,
89 <&clks IMX6UL_CLK_PLL1_SYS>, 89 <&clks IMX6UL_CLK_PLL1_SYS>;
90 <&clks IMX6UL_PLL1_BYPASS>,
91 <&clks IMX6UL_CLK_PLL1>,
92 <&clks IMX6UL_PLL1_BYPASS_SRC>,
93 <&clks IMX6UL_CLK_OSC>;
94 clock-names = "arm", "pll2_bus", "pll2_pfd2_396m", 90 clock-names = "arm", "pll2_bus", "pll2_pfd2_396m",
95 "secondary_sel", "step", "pll1_sw", 91 "secondary_sel", "step", "pll1_sw",
96 "pll1_sys", "pll1_bypass", "pll1", 92 "pll1_sys";
97 "pll1_bypass_src", "osc";
98 arm-supply = <&reg_arm>; 93 arm-supply = <&reg_arm>;
99 soc-supply = <&reg_soc>; 94 soc-supply = <&reg_soc>;
100 }; 95 };
@@ -102,14 +97,26 @@
102 97
103 intc: interrupt-controller@a01000 { 98 intc: interrupt-controller@a01000 {
104 compatible = "arm,gic-400", "arm,cortex-a7-gic"; 99 compatible = "arm,gic-400", "arm,cortex-a7-gic";
100 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
105 #interrupt-cells = <3>; 101 #interrupt-cells = <3>;
106 interrupt-controller; 102 interrupt-controller;
103 interrupt-parent = <&intc>;
107 reg = <0x00a01000 0x1000>, 104 reg = <0x00a01000 0x1000>,
108 <0x00a02000 0x2000>, 105 <0x00a02000 0x2000>,
109 <0x00a04000 0x2000>, 106 <0x00a04000 0x2000>,
110 <0x00a06000 0x2000>; 107 <0x00a06000 0x2000>;
111 }; 108 };
112 109
110 timer {
111 compatible = "arm,armv7-timer";
112 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
113 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
114 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
115 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
116 interrupt-parent = <&intc>;
117 status = "disabled";
118 };
119
113 ckil: clock-cli { 120 ckil: clock-cli {
114 compatible = "fixed-clock"; 121 compatible = "fixed-clock";
115 #clock-cells = <0>; 122 #clock-cells = <0>;
@@ -924,6 +931,14 @@
924 status = "disabled"; 931 status = "disabled";
925 }; 932 };
926 933
934 wdog3: wdog@21e4000 {
935 compatible = "fsl,imx6ul-wdt", "fsl,imx21-wdt";
936 reg = <0x021e4000 0x4000>;
937 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
938 clocks = <&clks IMX6UL_CLK_WDOG3>;
939 status = "disabled";
940 };
941
927 uart2: serial@21e8000 { 942 uart2: serial@21e8000 {
928 compatible = "fsl,imx6ul-uart", 943 compatible = "fsl,imx6ul-uart",
929 "fsl,imx6q-uart"; 944 "fsl,imx6q-uart";
diff --git a/arch/arm/boot/dts/imx6ull-14x14-evk.dts b/arch/arm/boot/dts/imx6ull-14x14-evk.dts
index 4741871434dd..30ef60344af3 100644
--- a/arch/arm/boot/dts/imx6ull-14x14-evk.dts
+++ b/arch/arm/boot/dts/imx6ull-14x14-evk.dts
@@ -39,7 +39,10 @@
39 * OTHER DEALINGS IN THE SOFTWARE. 39 * OTHER DEALINGS IN THE SOFTWARE.
40 */ 40 */
41 41
42#include "imx6ul-14x14-evk.dts" 42/dts-v1/;
43
44#include "imx6ull.dtsi"
45#include "imx6ul-14x14-evk.dtsi"
43 46
44/ { 47/ {
45 model = "Freescale i.MX6 UlltraLite 14x14 EVK Board"; 48 model = "Freescale i.MX6 UlltraLite 14x14 EVK Board";
diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts
new file mode 100644
index 000000000000..08669a18349e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dts
@@ -0,0 +1,14 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2018 Toradex AG
4 */
5
6/dts-v1/;
7
8#include "imx6ull-colibri-nonwifi.dtsi"
9#include "imx6ull-colibri-eval-v3.dtsi"
10
11/ {
12 model = "Toradex Colibri iMX6ULL 256MB on Colibri Evaluation Board V3";
13 compatible = "toradex,colibri-imx6ull-eval", "fsl,imx6ull";
14};
diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
new file mode 100644
index 000000000000..006690ea98c0
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -0,0 +1,157 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2017 Toradex AG
4 */
5
6/ {
7 chosen {
8 stdout-path = "serial0:115200n8";
9 };
10
11 /* fixed crystal dedicated to mcp2515 */
12 clk16m: clk16m {
13 compatible = "fixed-clock";
14 #clock-cells = <0>;
15 clock-frequency = <16000000>;
16 };
17
18 panel: panel {
19 compatible = "edt,et057090dhu";
20 backlight = <&bl>;
21 power-supply = <&reg_3v3>;
22
23 port {
24 panel_in: endpoint {
25 remote-endpoint = <&lcdif_out>;
26 };
27 };
28 };
29
30 reg_3v3: regulator-3v3 {
31 compatible = "regulator-fixed";
32 regulator-name = "3.3V";
33 regulator-min-microvolt = <3300000>;
34 regulator-max-microvolt = <3300000>;
35 };
36
37 reg_5v0: regulator-5v0 {
38 compatible = "regulator-fixed";
39 regulator-name = "5V";
40 regulator-min-microvolt = <5000000>;
41 regulator-max-microvolt = <5000000>;
42 };
43
44 reg_usbh_vbus: regulator-usbh-vbus {
45 compatible = "regulator-fixed";
46 pinctrl-names = "default";
47 pinctrl-0 = <&pinctrl_usbh_reg>;
48 regulator-name = "VCC_USB[1-4]";
49 regulator-min-microvolt = <5000000>;
50 regulator-max-microvolt = <5000000>;
51 gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
52 vin-supply = <&reg_5v0>;
53 };
54};
55
56&adc1 {
57 status = "okay";
58};
59
60&bl {
61 brightness-levels = <0 4 8 16 32 64 128 255>;
62 default-brightness-level = <6>;
63 power-supply = <&reg_3v3>;
64 pwms = <&pwm4 0 5000000 1>;
65 status = "okay";
66};
67
68&ecspi1 {
69 status = "okay";
70
71 mcp2515: can@0 {
72 compatible = "microchip,mcp2515";
73 pinctrl-names = "default";
74 pinctrl-0 = <&pinctrl_can_int>;
75 reg = <0>;
76 clocks = <&clk16m>;
77 interrupt-parent = <&gpio2>;
78 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
79 spi-max-frequency = <10000000>;
80 vdd-supply = <&reg_3v3>;
81 xceiver-supply = <&reg_5v0>;
82 status = "okay";
83 };
84};
85
86&i2c1 {
87 status = "okay";
88
89 /* M41T0M6 real time clock on carrier board */
90 m41t0m6: rtc@68 {
91 compatible = "st,m41t0";
92 reg = <0x68>;
93 };
94};
95
96&lcdif {
97 status = "okay";
98
99 port {
100 lcdif_out: endpoint {
101 remote-endpoint = <&panel_in>;
102 };
103 };
104};
105
106/* PWM <A> */
107&pwm4 {
108 status = "okay";
109};
110
111/* PWM <B> */
112&pwm5 {
113 status = "okay";
114};
115
116/* PWM <C> */
117&pwm6 {
118 status = "okay";
119};
120
121/* PWM <D> */
122&pwm7 {
123 status = "okay";
124};
125
126&uart1 {
127 status = "okay";
128};
129
130&uart2 {
131 status = "okay";
132};
133
134&uart5 {
135 status = "okay";
136};
137
138&usbotg1 {
139 status = "okay";
140};
141
142&usbotg2 {
143 vbus-supply = <&reg_usbh_vbus>;
144 status = "okay";
145};
146
147&usdhc1 {
148 pinctrl-names = "default";
149 pinctrl-0 = <&pinctrl_usdhc1 &pinctrl_snvs_usdhc1_cd>;
150 no-1-8-v;
151 cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
152 disable-wp;
153 wakeup-source;
154 keep-power-in-suspend;
155 vmmc-supply = <&reg_3v3>;
156 status = "okay";
157};
diff --git a/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi b/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi
new file mode 100644
index 000000000000..10ab4697950f
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi
@@ -0,0 +1,23 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2018 Toradex AG
4 */
5
6#include "imx6ull-colibri.dtsi"
7
8/ {
9 memory@80000000 {
10 reg = <0x80000000 0x10000000>;
11 };
12};
13
14&iomuxc {
15 pinctrl-names = "default";
16 pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3
17 &pinctrl_gpio4 &pinctrl_gpio5 &pinctrl_gpio6>;
18};
19
20&iomuxc_snvs {
21 pinctrl-names = "default";
22 pinctrl-0 = <&pinctrl_snvs_gpio1 &pinctrl_snvs_gpio2 &pinctrl_snvs_gpio3>;
23};
diff --git a/arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dts b/arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dts
new file mode 100644
index 000000000000..df72ce1ae2cb
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dts
@@ -0,0 +1,14 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2018 Toradex AG
4 */
5
6/dts-v1/;
7
8#include "imx6ull-colibri-wifi.dtsi"
9#include "imx6ull-colibri-eval-v3.dtsi"
10
11/ {
12 model = "Toradex Colibri iMX6ULL 512MB on Colibri Evaluation Board V3";
13 compatible = "toradex,colibri-imx6ull-wifi-eval", "fsl,imx6ull";
14};
diff --git a/arch/arm/boot/dts/imx6ull-colibri-wifi.dtsi b/arch/arm/boot/dts/imx6ull-colibri-wifi.dtsi
new file mode 100644
index 000000000000..3dffbcd50bf6
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri-wifi.dtsi
@@ -0,0 +1,65 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2018 Toradex AG
4 */
5
6#include "imx6ull-colibri.dtsi"
7
8/ {
9 memory@80000000 {
10 reg = <0x80000000 0x20000000>;
11 };
12
13 wifi_pwrseq: sdio-pwrseq {
14 compatible = "mmc-pwrseq-simple";
15 pinctrl-names = "default";
16 pinctrl-0 = <&pinctrl_snvs_wifi_pdn>;
17 reset-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
18 };
19};
20
21&cpu0 {
22 clock-frequency = <792000000>;
23 operating-points = <
24 /* kHz uV */
25 792000 1225000
26 528000 1175000
27 396000 1025000
28 198000 950000
29 >;
30 fsl,soc-operating-points = <
31 /* KHz uV */
32 792000 1175000
33 528000 1175000
34 396000 1175000
35 198000 1175000
36 >;
37};
38
39&iomuxc {
40 pinctrl-names = "default";
41 pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3
42 &pinctrl_gpio4 &pinctrl_gpio5>;
43
44};
45
46&iomuxc_snvs {
47 pinctrl-names = "default";
48 pinctrl-0 = <&pinctrl_snvs_gpio1 &pinctrl_snvs_gpio2>;
49};
50
51&usdhc2 {
52 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_usdhc2>;
54 assigned-clocks = <&clks IMX6UL_CLK_USDHC2_SEL>, <&clks IMX6UL_CLK_USDHC2>;
55 assigned-clock-parents = <&clks IMX6UL_CLK_PLL2_PFD2>;
56 assigned-clock-rates = <0>, <198000000>;
57 cap-power-off-card;
58 keep-power-in-suspend;
59 mmc-pwrseq = <&wifi_pwrseq>;
60 no-1-8-v;
61 non-removable;
62 vmmc-supply = <&reg_module_3v3>;
63 wakeup-source;
64 status = "okay";
65};
diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
new file mode 100644
index 000000000000..6c63a7384611
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -0,0 +1,553 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2018 Toradex AG
4 */
5
6#include "imx6ull.dtsi"
7
8/ {
9 aliases {
10 ethernet0 = &fec2;
11 ethernet1 = &fec1;
12 };
13
14 bl: backlight {
15 compatible = "pwm-backlight";
16 pinctrl-names = "default";
17 pinctrl-0 = <&pinctrl_gpio_bl_on>;
18 enable-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
19 status = "disabled";
20 };
21
22 reg_module_3v3: regulator-module-3v3 {
23 compatible = "regulator-fixed";
24 regulator-always-on;
25 regulator-name = "+V3.3";
26 regulator-min-microvolt = <3300000>;
27 regulator-max-microvolt = <3300000>;
28 };
29
30 reg_module_3v3_avdd: regulator-module-3v3-avdd {
31 compatible = "regulator-fixed";
32 regulator-always-on;
33 regulator-name = "+V3.3_AVDD_AUDIO";
34 regulator-min-microvolt = <3300000>;
35 regulator-max-microvolt = <3300000>;
36 };
37
38 reg_sd1_vmmc: regulator-sd1-vmmc {
39 compatible = "regulator-gpio";
40 gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
41 pinctrl-names = "default";
42 pinctrl-0 = <&pinctrl_snvs_reg_sd>;
43 regulator-always-on;
44 regulator-name = "+V3.3_1.8_SD";
45 regulator-min-microvolt = <1800000>;
46 regulator-max-microvolt = <3300000>;
47 states = <1800000 0x1 3300000 0x0>;
48 vin-supply = <&reg_module_3v3>;
49 };
50};
51
52&adc1 {
53 num-channels = <10>;
54 vref-supply = <&reg_module_3v3_avdd>;
55};
56
57/* Colibri SPI */
58&ecspi1 {
59 cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
60 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
62};
63
64&fec2 {
65 pinctrl-names = "default";
66 pinctrl-0 = <&pinctrl_enet2>;
67 phy-mode = "rmii";
68 phy-handle = <&ethphy1>;
69 status = "okay";
70
71 mdio {
72 #address-cells = <1>;
73 #size-cells = <0>;
74
75 ethphy1: ethernet-phy@2 {
76 compatible = "ethernet-phy-ieee802.3-c22";
77 max-speed = <100>;
78 reg = <2>;
79 };
80 };
81};
82
83&gpmi {
84 pinctrl-names = "default";
85 pinctrl-0 = <&pinctrl_gpmi_nand>;
86 nand-on-flash-bbt;
87 nand-ecc-mode = "hw";
88 nand-ecc-strength = <8>;
89 nand-ecc-step-size = <512>;
90 status = "okay";
91};
92
93&i2c1 {
94 pinctrl-names = "default", "gpio";
95 pinctrl-0 = <&pinctrl_i2c1>;
96 pinctrl-1 = <&pinctrl_i2c1_gpio>;
97 sda-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
98 scl-gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
99};
100
101&i2c2 {
102 pinctrl-names = "default", "gpio";
103 pinctrl-0 = <&pinctrl_i2c2>;
104 pinctrl-1 = <&pinctrl_i2c2_gpio>;
105 sda-gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
106 scl-gpios = <&gpio1 30 GPIO_ACTIVE_LOW>;
107 status = "okay";
108
109 ad7879@2c {
110 compatible = "adi,ad7879-1";
111 pinctrl-names = "default";
112 pinctrl-0 = <&pinctrl_snvs_ad7879_int>;
113 reg = <0x2c>;
114 interrupt-parent = <&gpio5>;
115 interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
116 touchscreen-max-pressure = <4096>;
117 adi,resistance-plate-x = <120>;
118 adi,first-conversion-delay = /bits/ 8 <3>;
119 adi,acquisition-time = /bits/ 8 <1>;
120 adi,median-filter-size = /bits/ 8 <2>;
121 adi,averaging = /bits/ 8 <1>;
122 adi,conversion-interval = /bits/ 8 <255>;
123 };
124};
125
126&lcdif {
127 pinctrl-names = "default";
128 pinctrl-0 = <&pinctrl_lcdif_dat
129 &pinctrl_lcdif_ctrl>;
130};
131
132&pwm4 {
133 pinctrl-names = "default";
134 pinctrl-0 = <&pinctrl_pwm4>;
135 #pwm-cells = <3>;
136};
137
138&pwm5 {
139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_pwm5>;
141 #pwm-cells = <3>;
142};
143
144&pwm6 {
145 pinctrl-names = "default";
146 pinctrl-0 = <&pinctrl_pwm6>;
147 #pwm-cells = <3>;
148};
149
150&pwm7 {
151 pinctrl-names = "default";
152 pinctrl-0 = <&pinctrl_pwm7>;
153 #pwm-cells = <3>;
154};
155
156&sdma {
157 status = "okay";
158};
159
160&snvs_pwrkey {
161 status = "disabled";
162};
163
164&uart1 {
165 pinctrl-names = "default";
166 pinctrl-0 = <&pinctrl_uart1 &pinctrl_uart1_ctrl1>;
167 uart-has-rtscts;
168 fsl,dte-mode;
169};
170
171&uart2 {
172 pinctrl-names = "default";
173 pinctrl-0 = <&pinctrl_uart2>;
174 uart-has-rtscts;
175 fsl,dte-mode;
176};
177
178&uart5 {
179 pinctrl-names = "default";
180 pinctrl-0 = <&pinctrl_uart5>;
181 fsl,dte-mode;
182};
183
184&usbotg1 {
185 dr_mode = "otg";
186 srp-disable;
187 hnp-disable;
188 adp-disable;
189};
190
191&usbotg2 {
192 dr_mode = "host";
193};
194
195&usdhc1 {
196 assigned-clocks = <&clks IMX6UL_CLK_USDHC1_SEL>, <&clks IMX6UL_CLK_USDHC1>;
197 assigned-clock-parents = <&clks IMX6UL_CLK_PLL2_PFD2>;
198 assigned-clock-rates = <0>, <198000000>;
199};
200
201&iomuxc {
202 pinctrl_can_int: canint-grp {
203 fsl,pins = <
204 MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO04 0X14 /* SODIMM 73 */
205 >;
206 };
207
208 pinctrl_enet2: enet2-grp {
209 fsl,pins = <
210 MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
211 MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
212 MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
213 MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
214 MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
215 MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
216 MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
217 MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
218 MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
219 MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
220 >;
221 };
222
223 pinctrl_ecspi1_cs: ecspi1-cs-grp {
224 fsl,pins = <
225 MX6UL_PAD_LCD_DATA21__GPIO3_IO26 0x000a0
226 >;
227 };
228
229 pinctrl_ecspi1: ecspi1-grp {
230 fsl,pins = <
231 MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK 0x000a0
232 MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI 0x000a0
233 MX6UL_PAD_LCD_DATA23__ECSPI1_MISO 0x100a0
234 >;
235 };
236
237 pinctrl_flexcan2: flexcan2-grp {
238 fsl,pins = <
239 MX6UL_PAD_ENET1_TX_DATA0__FLEXCAN2_RX 0x1b020
240 MX6UL_PAD_ENET1_RX_EN__FLEXCAN2_TX 0x1b020
241 >;
242 };
243
244 pinctrl_gpio_bl_on: gpio-bl-on-grp {
245 fsl,pins = <
246 MX6UL_PAD_JTAG_TMS__GPIO1_IO11 0x000a0
247 >;
248 };
249
250 pinctrl_gpio1: gpio1-grp {
251 fsl,pins = <
252 MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x74 /* SODIMM 55 */
253 MX6UL_PAD_ENET1_RX_DATA1__GPIO2_IO01 0x74 /* SODIMM 63 */
254 MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0X14 /* SODIMM 77 */
255 MX6UL_PAD_JTAG_TCK__GPIO1_IO14 0x14 /* SODIMM 99 */
256 MX6UL_PAD_NAND_CE1_B__GPIO4_IO14 0x14 /* SODIMM 133 */
257 MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x14 /* SODIMM 135 */
258 MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x14 /* SODIMM 100 */
259 MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15 0x14 /* SODIMM 102 */
260 MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07 0x14 /* SODIMM 104 */
261 MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x14 /* SODIMM 186 */
262 >;
263 };
264
265 pinctrl_gpio2: gpio2-grp { /* Camera */
266 fsl,pins = <
267 MX6UL_PAD_CSI_DATA04__GPIO4_IO25 0x74 /* SODIMM 69 */
268 MX6UL_PAD_CSI_MCLK__GPIO4_IO17 0x14 /* SODIMM 75 */
269 MX6UL_PAD_CSI_DATA06__GPIO4_IO27 0x14 /* SODIMM 85 */
270 MX6UL_PAD_CSI_PIXCLK__GPIO4_IO18 0x14 /* SODIMM 96 */
271 MX6UL_PAD_CSI_DATA05__GPIO4_IO26 0x14 /* SODIMM 98 */
272 >;
273 };
274
275 pinctrl_gpio3: gpio3-grp { /* CAN2 */
276 fsl,pins = <
277 MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02 0x14 /* SODIMM 178 */
278 MX6UL_PAD_ENET1_TX_DATA0__GPIO2_IO03 0x14 /* SODIMM 188 */
279 >;
280 };
281
282 pinctrl_gpio4: gpio4-grp {
283 fsl,pins = <
284 MX6UL_PAD_CSI_DATA07__GPIO4_IO28 0x74 /* SODIMM 65 */
285 >;
286 };
287
288 pinctrl_gpio5: gpio5-grp { /* ATMEL MXT TOUCH */
289 fsl,pins = <
290 MX6UL_PAD_JTAG_MOD__GPIO1_IO10 0x74 /* SODIMM 106 */
291 >;
292 };
293
294 pinctrl_gpio6: gpio6-grp { /* Wifi pins */
295 fsl,pins = <
296 MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x14 /* SODIMM 89 */
297 MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x14 /* SODIMM 79 */
298 MX6UL_PAD_CSI_VSYNC__GPIO4_IO19 0x14 /* SODIMM 81 */
299 MX6UL_PAD_CSI_DATA03__GPIO4_IO24 0x14 /* SODIMM 97 */
300 MX6UL_PAD_CSI_DATA00__GPIO4_IO21 0x14 /* SODIMM 101 */
301 MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x14 /* SODIMM 103 */
302 MX6UL_PAD_CSI_HSYNC__GPIO4_IO20 0x14 /* SODIMM 94 */
303 >;
304 };
305
306 pinctrl_gpmi_nand: gpmi-nand-grp {
307 fsl,pins = <
308 MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0x100a9
309 MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0x100a9
310 MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0x100a9
311 MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0x100a9
312 MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0x100a9
313 MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0x100a9
314 MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0x100a9
315 MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0x100a9
316 MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0x100a9
317 MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0x100a9
318 MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0x100a9
319 MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0x100a9
320 MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0x100a9
321 MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0x100a9
322 >;
323 };
324
325 pinctrl_i2c1: i2c1-grp {
326 fsl,pins = <
327 MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0
328 MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0
329 >;
330 };
331
332 pinctrl_i2c1_gpio: i2c1-gpio-grp {
333 fsl,pins = <
334 MX6UL_PAD_UART4_TX_DATA__GPIO1_IO28 0x4001b8b0
335 MX6UL_PAD_UART4_RX_DATA__GPIO1_IO29 0x4001b8b0
336 >;
337 };
338
339 pinctrl_i2c2: i2c2-grp {
340 fsl,pins = <
341 MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x4001b8b0
342 MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x4001b8b0
343 >;
344 };
345
346 pinctrl_i2c2_gpio: i2c2-gpio-grp {
347 fsl,pins = <
348 MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x4001b8b0
349 MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0x4001b8b0
350 >;
351 };
352
353 pinctrl_lcdif_dat: lcdif-dat-grp {
354 fsl,pins = <
355 MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x00079
356 MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x00079
357 MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x00079
358 MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x00079
359 MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x00079
360 MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x00079
361 MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x00079
362 MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x00079
363 MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x00079
364 MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x00079
365 MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x00079
366 MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x00079
367 MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x00079
368 MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x00079
369 MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x00079
370 MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x00079
371 MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x00079
372 MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x00079
373 >;
374 };
375
376 pinctrl_lcdif_ctrl: lcdif-ctrl-grp {
377 fsl,pins = <
378 MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x00079
379 MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x00079
380 MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x00079
381 MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x00079
382 >;
383 };
384
385 pinctrl_pwm4: pwm4-grp {
386 fsl,pins = <
387 MX6UL_PAD_NAND_WP_B__PWM4_OUT 0x00079
388 >;
389 };
390
391 pinctrl_pwm5: pwm5-grp {
392 fsl,pins = <
393 MX6UL_PAD_NAND_DQS__PWM5_OUT 0x00079
394 >;
395 };
396
397 pinctrl_pwm6: pwm6-grp {
398 fsl,pins = <
399 MX6UL_PAD_ENET1_TX_EN__PWM6_OUT 0x00079
400 >;
401 };
402
403 pinctrl_pwm7: pwm7-grp {
404 fsl,pins = <
405 MX6UL_PAD_ENET1_TX_CLK__PWM7_OUT 0x00079
406 >;
407 };
408
409 pinctrl_uart1: uart1-grp {
410 fsl,pins = <
411 MX6UL_PAD_UART1_TX_DATA__UART1_DTE_RX 0x1b0b1
412 MX6UL_PAD_UART1_RX_DATA__UART1_DTE_TX 0x1b0b1
413 MX6UL_PAD_UART1_RTS_B__UART1_DTE_CTS 0x1b0b1
414 MX6UL_PAD_UART1_CTS_B__UART1_DTE_RTS 0x1b0b1
415 >;
416 };
417
418 pinctrl_uart1_ctrl1: uart1-ctrl1-grp { /* Additional DTR, DCD */
419 fsl,pins = <
420 MX6UL_PAD_JTAG_TDI__GPIO1_IO13 0x1b0b1 /* DCD */
421 MX6UL_PAD_LCD_DATA18__GPIO3_IO23 0x1b0b1 /* DSR */
422 MX6UL_PAD_JTAG_TDO__GPIO1_IO12 0x1b0b1 /* DTR */
423 MX6UL_PAD_LCD_DATA19__GPIO3_IO24 0x1b0b1 /* RI */
424 >;
425 };
426
427 pinctrl_uart2: uart2-grp {
428 fsl,pins = <
429 MX6UL_PAD_UART2_TX_DATA__UART2_DTE_RX 0x1b0b1
430 MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x1b0b1
431 MX6UL_PAD_UART2_CTS_B__UART2_DTE_RTS 0x1b0b1
432 MX6UL_PAD_UART2_RTS_B__UART2_DTE_CTS 0x1b0b1
433 >;
434 };
435 pinctrl_uart5: uart5-grp {
436 fsl,pins = <
437 MX6UL_PAD_GPIO1_IO04__UART5_DTE_RX 0x1b0b1
438 MX6UL_PAD_GPIO1_IO05__UART5_DTE_TX 0x1b0b1
439 >;
440 };
441
442 pinctrl_usbh_reg: gpio-usbh-reg {
443 fsl,pins = <
444 MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0x1b0b1 /* SODIMM 129 USBH PEN */
445 >;
446 };
447
448 pinctrl_usdhc1: usdhc1-grp {
449 fsl,pins = <
450 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x17059
451 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x10059
452 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x17059
453 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x17059
454 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x17059
455 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x17059
456 >;
457 };
458
459 pinctrl_usdhc1_100mhz: usdhc1-100mhz-grp {
460 fsl,pins = <
461 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x170b9
462 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x100b9
463 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
464 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
465 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
466 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
467 >;
468 };
469
470 pinctrl_usdhc1_200mhz: usdhc1-200mhz-grp {
471 fsl,pins = <
472 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x170f9
473 MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x100f9
474 MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9
475 MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9
476 MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9
477 MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9
478 >;
479 };
480
481 pinctrl_usdhc2: usdhc2-grp {
482 fsl,pins = <
483 MX6UL_PAD_CSI_DATA00__USDHC2_DATA0 0x17059
484 MX6UL_PAD_CSI_DATA01__USDHC2_DATA1 0x17059
485 MX6UL_PAD_CSI_DATA02__USDHC2_DATA2 0x17059
486 MX6UL_PAD_CSI_DATA03__USDHC2_DATA3 0x17059
487 MX6UL_PAD_CSI_HSYNC__USDHC2_CMD 0x17059
488 MX6UL_PAD_CSI_VSYNC__USDHC2_CLK 0x17059
489
490 MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT 0x14
491 >;
492 };
493};
494
495&iomuxc_snvs {
496 pinctrl_snvs_gpio1: snvs-gpio1-grp {
497 fsl,pins = <
498 MX6ULL_PAD_SNVS_TAMPER6__GPIO5_IO06 0x14 /* SODIMM 93 */
499 MX6ULL_PAD_SNVS_TAMPER3__GPIO5_IO03 0x14 /* SODIMM 95 */
500 MX6ULL_PAD_BOOT_MODE0__GPIO5_IO10 0x74 /* SODIMM 105 */
501 MX6ULL_PAD_SNVS_TAMPER5__GPIO5_IO05 0x14 /* SODIMM 131 USBH OC */
502 MX6ULL_PAD_SNVS_TAMPER8__GPIO5_IO08 0x74 /* SODIMM 138 */
503 >;
504 };
505
506 pinctrl_snvs_gpio2: snvs-gpio2-grp { /* ATMEL MXT TOUCH */
507 fsl,pins = <
508 MX6ULL_PAD_SNVS_TAMPER4__GPIO5_IO04 0x74 /* SODIMM 107 */
509 >;
510 };
511
512 pinctrl_snvs_gpio3: snvs-gpio3-grp { /* Wifi pins */
513 fsl,pins = <
514 MX6ULL_PAD_BOOT_MODE1__GPIO5_IO11 0x14 /* SODIMM 127 */
515 >;
516 };
517
518 pinctrl_snvs_ad7879_int: snvs-ad7879-int-grp { /* TOUCH Interrupt */
519 fsl,pins = <
520 MX6ULL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x1b0b0
521 >;
522 };
523
524 pinctrl_snvs_reg_sd: snvs-reg-sd-grp {
525 fsl,pins = <
526 MX6ULL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x4001b8b0
527 >;
528 };
529
530 pinctrl_snvs_usbc_det: snvs-usbc-det-grp {
531 fsl,pins = <
532 MX6ULL_PAD_SNVS_TAMPER2__GPIO5_IO02 0x1b0b0
533 >;
534 };
535
536 pinctrl_snvs_gpiokeys: snvs-gpiokeys-grp {
537 fsl,pins = <
538 MX6ULL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x130b0
539 >;
540 };
541
542 pinctrl_snvs_usdhc1_cd: snvs-usdhc1-cd-grp {
543 fsl,pins = <
544 MX6ULL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x1b0b0 /* CD */
545 >;
546 };
547
548 pinctrl_snvs_wifi_pdn: snvs-wifi-pdn-grp {
549 fsl,pins = <
550 MX6ULL_PAD_BOOT_MODE1__GPIO5_IO11 0x14
551 >;
552 };
553};
diff --git a/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h b/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h
new file mode 100644
index 000000000000..f6fb6783c193
--- /dev/null
+++ b/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h
@@ -0,0 +1,26 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
4 * Copyright (C) 2017 NXP
5 */
6
7#ifndef __DTS_IMX6ULL_PINFUNC_SNVS_H
8#define __DTS_IMX6ULL_PINFUNC_SNVS_H
9/*
10 * The pin function ID is a tuple of
11 * <mux_reg conf_reg input_reg mux_mode input_val>
12 */
13#define MX6ULL_PAD_BOOT_MODE0__GPIO5_IO10 0x0000 0x0044 0x0000 0x5 0x0
14#define MX6ULL_PAD_BOOT_MODE1__GPIO5_IO11 0x0004 0x0048 0x0000 0x5 0x0
15#define MX6ULL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x0008 0x004C 0x0000 0x5 0x0
16#define MX6ULL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x000C 0x0050 0x0000 0x5 0x0
17#define MX6ULL_PAD_SNVS_TAMPER2__GPIO5_IO02 0x0010 0x0054 0x0000 0x5 0x0
18#define MX6ULL_PAD_SNVS_TAMPER3__GPIO5_IO03 0x0014 0x0058 0x0000 0x5 0x0
19#define MX6ULL_PAD_SNVS_TAMPER4__GPIO5_IO04 0x0018 0x005C 0x0000 0x5 0x0
20#define MX6ULL_PAD_SNVS_TAMPER5__GPIO5_IO05 0x001C 0x0060 0x0000 0x5 0x0
21#define MX6ULL_PAD_SNVS_TAMPER6__GPIO5_IO06 0x0020 0x0064 0x0000 0x5 0x0
22#define MX6ULL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x0024 0x0068 0x0000 0x5 0x0
23#define MX6ULL_PAD_SNVS_TAMPER8__GPIO5_IO08 0x0028 0x006C 0x0000 0x5 0x0
24#define MX6ULL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x002C 0x0070 0x0000 0x5 0x0
25
26#endif /* __DTS_IMX6ULL_PINFUNC_SNVS_H */
diff --git a/arch/arm/boot/dts/imx6ull.dtsi b/arch/arm/boot/dts/imx6ull.dtsi
index 0c182917b863..571ddd71cdba 100644
--- a/arch/arm/boot/dts/imx6ull.dtsi
+++ b/arch/arm/boot/dts/imx6ull.dtsi
@@ -41,3 +41,35 @@
41 41
42#include "imx6ul.dtsi" 42#include "imx6ul.dtsi"
43#include "imx6ull-pinfunc.h" 43#include "imx6ull-pinfunc.h"
44#include "imx6ull-pinfunc-snvs.h"
45
46/* Delete UART8 in AIPS-1 (i.MX6UL specific) */
47/delete-node/ &uart8;
48
49/ {
50 soc {
51 aips3: aips-bus@2200000 {
52 compatible = "fsl,aips-bus", "simple-bus";
53 #address-cells = <1>;
54 #size-cells = <1>;
55 reg = <0x02200000 0x100000>;
56 ranges;
57
58 iomuxc_snvs: iomuxc-snvs@2290000 {
59 compatible = "fsl,imx6ull-iomuxc-snvs";
60 reg = <0x02290000 0x4000>;
61 };
62
63 uart8: serial@2288000 {
64 compatible = "fsl,imx6ul-uart",
65 "fsl,imx6q-uart";
66 reg = <0x02288000 0x4000>;
67 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
68 clocks = <&clks IMX6UL_CLK_UART8_IPG>,
69 <&clks IMX6UL_CLK_UART8_SERIAL>;
70 clock-names = "ipg", "per";
71 status = "disabled";
72 };
73 };
74 };
75};
diff --git a/arch/arm/boot/dts/imx7d-cl-som-imx7.dts b/arch/arm/boot/dts/imx7d-cl-som-imx7.dts
index ae45af1ad062..7f645683f53b 100644
--- a/arch/arm/boot/dts/imx7d-cl-som-imx7.dts
+++ b/arch/arm/boot/dts/imx7d-cl-som-imx7.dts
@@ -18,7 +18,7 @@
18 model = "CompuLab CL-SOM-iMX7"; 18 model = "CompuLab CL-SOM-iMX7";
19 compatible = "compulab,cl-som-imx7", "fsl,imx7d"; 19 compatible = "compulab,cl-som-imx7", "fsl,imx7d";
20 20
21 memory { 21 memory@80000000 {
22 reg = <0x80000000 0x10000000>; /* 256 MB - minimal configuration */ 22 reg = <0x80000000 0x10000000>; /* 256 MB - minimal configuration */
23 }; 23 };
24 24
@@ -213,37 +213,37 @@
213&iomuxc { 213&iomuxc {
214 pinctrl_enet1: enet1grp { 214 pinctrl_enet1: enet1grp {
215 fsl,pins = < 215 fsl,pins = <
216 MX7D_PAD_SD2_CD_B__ENET1_MDIO 0x3 216 MX7D_PAD_SD2_CD_B__ENET1_MDIO 0x30
217 MX7D_PAD_SD2_WP__ENET1_MDC 0x3 217 MX7D_PAD_SD2_WP__ENET1_MDC 0x30
218 MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC 0x1 218 MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC 0x11
219 MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 0x1 219 MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 0x11
220 MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 0x1 220 MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 0x11
221 MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 0x1 221 MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 0x11
222 MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 0x1 222 MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 0x11
223 MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x1 223 MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x11
224 MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC 0x1 224 MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC 0x11
225 MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x1 225 MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x11
226 MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x1 226 MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x11
227 MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 0x1 227 MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 0x11
228 MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 0x1 228 MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 0x11
229 MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x1 229 MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x11
230 >; 230 >;
231 }; 231 };
232 232
233 pinctrl_enet2: enet2grp { 233 pinctrl_enet2: enet2grp {
234 fsl,pins = < 234 fsl,pins = <
235 MX7D_PAD_EPDC_GDSP__ENET2_RGMII_TXC 0x1 235 MX7D_PAD_EPDC_GDSP__ENET2_RGMII_TXC 0x11
236 MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0 0x1 236 MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0 0x11
237 MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1 0x1 237 MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1 0x11
238 MX7D_PAD_EPDC_GDCLK__ENET2_RGMII_TD2 0x1 238 MX7D_PAD_EPDC_GDCLK__ENET2_RGMII_TD2 0x11
239 MX7D_PAD_EPDC_GDOE__ENET2_RGMII_TD3 0x1 239 MX7D_PAD_EPDC_GDOE__ENET2_RGMII_TD3 0x11
240 MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL 0x1 240 MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL 0x11
241 MX7D_PAD_EPDC_SDCE1__ENET2_RGMII_RXC 0x1 241 MX7D_PAD_EPDC_SDCE1__ENET2_RGMII_RXC 0x11
242 MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0 0x1 242 MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0 0x11
243 MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1 0x1 243 MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1 0x11
244 MX7D_PAD_EPDC_SDOE__ENET2_RGMII_RD2 0x1 244 MX7D_PAD_EPDC_SDOE__ENET2_RGMII_RD2 0x11
245 MX7D_PAD_EPDC_SDSHR__ENET2_RGMII_RD3 0x1 245 MX7D_PAD_EPDC_SDSHR__ENET2_RGMII_RD3 0x11
246 MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL 0x1 246 MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL 0x11
247 >; 247 >;
248 }; 248 };
249 249
diff --git a/arch/arm/boot/dts/imx7d-colibri-emmc.dtsi b/arch/arm/boot/dts/imx7d-colibri-emmc.dtsi
index 9b63b9c89e4b..04d24ee17b14 100644
--- a/arch/arm/boot/dts/imx7d-colibri-emmc.dtsi
+++ b/arch/arm/boot/dts/imx7d-colibri-emmc.dtsi
@@ -7,7 +7,7 @@
7#include "imx7-colibri.dtsi" 7#include "imx7-colibri.dtsi"
8 8
9/ { 9/ {
10 memory { 10 memory@80000000 {
11 reg = <0x80000000 0x40000000>; 11 reg = <0x80000000 0x40000000>;
12 }; 12 };
13}; 13};
diff --git a/arch/arm/boot/dts/imx7d-colibri.dtsi b/arch/arm/boot/dts/imx7d-colibri.dtsi
index 6f2bb70c1fbd..d9f8fb69511b 100644
--- a/arch/arm/boot/dts/imx7d-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7d-colibri.dtsi
@@ -44,7 +44,7 @@
44#include "imx7-colibri.dtsi" 44#include "imx7-colibri.dtsi"
45 45
46/ { 46/ {
47 memory { 47 memory@80000000 {
48 reg = <0x80000000 0x20000000>; 48 reg = <0x80000000 0x20000000>;
49 }; 49 };
50}; 50};
diff --git a/arch/arm/boot/dts/imx7d-nitrogen7.dts b/arch/arm/boot/dts/imx7d-nitrogen7.dts
index 2b05898bb3f6..52167298984d 100644
--- a/arch/arm/boot/dts/imx7d-nitrogen7.dts
+++ b/arch/arm/boot/dts/imx7d-nitrogen7.dts
@@ -53,7 +53,7 @@
53 t_lcd = &t_lcd; 53 t_lcd = &t_lcd;
54 }; 54 };
55 55
56 memory { 56 memory@80000000 {
57 reg = <0x80000000 0x40000000>; 57 reg = <0x80000000 0x40000000>;
58 }; 58 };
59 59
diff --git a/arch/arm/boot/dts/imx7d-pico.dtsi b/arch/arm/boot/dts/imx7d-pico.dtsi
index e307462a48ec..21973eb55671 100644
--- a/arch/arm/boot/dts/imx7d-pico.dtsi
+++ b/arch/arm/boot/dts/imx7d-pico.dtsi
@@ -48,7 +48,7 @@
48 model = "Technexion Pico i.MX7D Board"; 48 model = "Technexion Pico i.MX7D Board";
49 compatible = "technexion,imx7d-pico", "fsl,imx7d"; 49 compatible = "technexion,imx7d-pico", "fsl,imx7d";
50 50
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0x80000000>; 52 reg = <0x80000000 0x80000000>;
53 }; 53 };
54 54
diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts
index a7a5dc7b2700..7f241afc15ea 100644
--- a/arch/arm/boot/dts/imx7d-sdb.dts
+++ b/arch/arm/boot/dts/imx7d-sdb.dts
@@ -48,7 +48,7 @@
48 model = "Freescale i.MX7 SabreSD Board"; 48 model = "Freescale i.MX7 SabreSD Board";
49 compatible = "fsl,imx7d-sdb", "fsl,imx7d"; 49 compatible = "fsl,imx7d-sdb", "fsl,imx7d";
50 50
51 memory { 51 memory@80000000 {
52 reg = <0x80000000 0x80000000>; 52 reg = <0x80000000 0x80000000>;
53 }; 53 };
54 54
@@ -336,6 +336,11 @@
336 pinctrl-names = "default"; 336 pinctrl-names = "default";
337 pinctrl-0 = <&pinctrl_i2c2>; 337 pinctrl-0 = <&pinctrl_i2c2>;
338 status = "okay"; 338 status = "okay";
339
340 mpl3115@60 {
341 compatible = "fsl,mpl3115";
342 reg = <0x60>;
343 };
339}; 344};
340 345
341&i2c3 { 346&i2c3 {
diff --git a/arch/arm/boot/dts/imx7s-colibri.dtsi b/arch/arm/boot/dts/imx7s-colibri.dtsi
index b81013455b21..fe8344cee864 100644
--- a/arch/arm/boot/dts/imx7s-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7s-colibri.dtsi
@@ -44,7 +44,7 @@
44#include "imx7-colibri.dtsi" 44#include "imx7-colibri.dtsi"
45 45
46/ { 46/ {
47 memory { 47 memory@80000000 {
48 reg = <0x80000000 0x10000000>; 48 reg = <0x80000000 0x10000000>;
49 }; 49 };
50}; 50};
diff --git a/arch/arm/boot/dts/imx7s-warp.dts b/arch/arm/boot/dts/imx7s-warp.dts
index 9bdf121f7e43..8a30b148534d 100644
--- a/arch/arm/boot/dts/imx7s-warp.dts
+++ b/arch/arm/boot/dts/imx7s-warp.dts
@@ -50,7 +50,7 @@
50 model = "Warp i.MX7 Board"; 50 model = "Warp i.MX7 Board";
51 compatible = "warp,imx7s-warp", "fsl,imx7s"; 51 compatible = "warp,imx7s-warp", "fsl,imx7s";
52 52
53 memory { 53 memory@80000000 {
54 reg = <0x80000000 0x20000000>; 54 reg = <0x80000000 0x20000000>;
55 }; 55 };
56 56
@@ -271,6 +271,15 @@
271 status = "okay"; 271 status = "okay";
272}; 272};
273 273
274&uart6 {
275 pinctrl-names = "default";
276 pinctrl-0 = <&pinctrl_uart6>;
277 assigned-clocks = <&clks IMX7D_UART6_ROOT_SRC>;
278 assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>;
279 fsl,dte-mode;
280 status = "okay";
281};
282
274&usbotg1 { 283&usbotg1 {
275 dr_mode = "peripheral"; 284 dr_mode = "peripheral";
276 status = "okay"; 285 status = "okay";
@@ -379,6 +388,13 @@
379 >; 388 >;
380 }; 389 };
381 390
391 pinctrl_uart6: uart6grp {
392 fsl,pins = <
393 MX7D_PAD_ECSPI1_MOSI__UART6_DTE_RX 0x79
394 MX7D_PAD_ECSPI1_SCLK__UART6_DTE_TX 0x79
395 >;
396 };
397
382 pinctrl_usdhc1: usdhc1grp { 398 pinctrl_usdhc1: usdhc1grp {
383 fsl,pins = < 399 fsl,pins = <
384 MX7D_PAD_SD1_CMD__SD1_CMD 0x59 400 MX7D_PAD_SD1_CMD__SD1_CMD 0x59
diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 9aa2bb998552..4d42335c0dee 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -58,7 +58,7 @@
58 * Also for U-Boot there must be a pre-existing /memory node. 58 * Also for U-Boot there must be a pre-existing /memory node.
59 */ 59 */
60 chosen {}; 60 chosen {};
61 memory { device_type = "memory"; reg = <0 0>; }; 61 memory { device_type = "memory"; };
62 62
63 aliases { 63 aliases {
64 gpio0 = &gpio1; 64 gpio0 = &gpio1;
@@ -130,6 +130,12 @@
130 #phy-cells = <0>; 130 #phy-cells = <0>;
131 }; 131 };
132 132
133 pmu {
134 compatible = "arm,cortex-a7-pmu";
135 interrupt-parent = <&gpc>;
136 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
137 interrupt-affinity = <&cpu0>;
138 };
133 139
134 replicator { 140 replicator {
135 /* 141 /*
@@ -499,6 +505,14 @@
499 status = "disabled"; 505 status = "disabled";
500 }; 506 };
501 507
508 kpp: kpp@30320000 {
509 compatible = "fsl,imx7d-kpp", "fsl,imx21-kpp";
510 reg = <0x30320000 0x10000>;
511 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
512 clocks = <&clks IMX7D_KPP_ROOT_CLK>;
513 status = "disabled";
514 };
515
502 iomuxc: iomuxc@30330000 { 516 iomuxc: iomuxc@30330000 {
503 compatible = "fsl,imx7d-iomuxc"; 517 compatible = "fsl,imx7d-iomuxc";
504 reg = <0x30330000 0x10000>; 518 reg = <0x30330000 0x10000>;
@@ -511,9 +525,29 @@
511 }; 525 };
512 526
513 ocotp: ocotp-ctrl@30350000 { 527 ocotp: ocotp-ctrl@30350000 {
528 #address-cells = <1>;
529 #size-cells = <1>;
514 compatible = "fsl,imx7d-ocotp", "syscon"; 530 compatible = "fsl,imx7d-ocotp", "syscon";
515 reg = <0x30350000 0x10000>; 531 reg = <0x30350000 0x10000>;
516 clocks = <&clks IMX7D_OCOTP_CLK>; 532 clocks = <&clks IMX7D_OCOTP_CLK>;
533
534 tempmon_calib: calib@3c {
535 reg = <0x3c 0x4>;
536 };
537
538 tempmon_temp_grade: temp-grade@10 {
539 reg = <0x10 0x4>;
540 };
541 };
542
543 tempmon: tempmon {
544 compatible = "fsl,imx7d-tempmon";
545 interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
546 fsl,tempmon =<&anatop>;
547 nvmem-cells = <&tempmon_calib>,
548 <&tempmon_temp_grade>;
549 nvmem-cell-names = "calib", "temp_grade";
550 clocks = <&clks IMX7D_PLL_SYS_MAIN_CLK>;
517 }; 551 };
518 552
519 anatop: anatop@30360000 { 553 anatop: anatop@30360000 {
@@ -551,6 +585,8 @@
551 offset = <0x34>; 585 offset = <0x34>;
552 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, 586 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
553 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; 587 <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
588 clocks = <&clks IMX7D_SNVS_CLK>;
589 clock-names = "snvs-rtc";
554 }; 590 };
555 591
556 snvs_poweroff: snvs-poweroff { 592 snvs_poweroff: snvs-poweroff {
@@ -708,118 +744,156 @@
708 reg = <0x30800000 0x400000>; 744 reg = <0x30800000 0x400000>;
709 ranges; 745 ranges;
710 746
711 ecspi1: ecspi@30820000 { 747 spba-bus@30800000 {
748 compatible = "fsl,spba-bus", "simple-bus";
712 #address-cells = <1>; 749 #address-cells = <1>;
713 #size-cells = <0>; 750 #size-cells = <1>;
714 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi"; 751 reg = <0x30800000 0x100000>;
715 reg = <0x30820000 0x10000>; 752 ranges;
716 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
717 clocks = <&clks IMX7D_ECSPI1_ROOT_CLK>,
718 <&clks IMX7D_ECSPI1_ROOT_CLK>;
719 clock-names = "ipg", "per";
720 status = "disabled";
721 };
722 753
723 ecspi2: ecspi@30830000 { 754 ecspi1: ecspi@30820000 {
724 #address-cells = <1>; 755 #address-cells = <1>;
725 #size-cells = <0>; 756 #size-cells = <0>;
726 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi"; 757 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi";
727 reg = <0x30830000 0x10000>; 758 reg = <0x30820000 0x10000>;
728 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; 759 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
729 clocks = <&clks IMX7D_ECSPI2_ROOT_CLK>, 760 clocks = <&clks IMX7D_ECSPI1_ROOT_CLK>,
730 <&clks IMX7D_ECSPI2_ROOT_CLK>; 761 <&clks IMX7D_ECSPI1_ROOT_CLK>;
731 clock-names = "ipg", "per"; 762 clock-names = "ipg", "per";
732 status = "disabled"; 763 status = "disabled";
733 }; 764 };
734 765
735 ecspi3: ecspi@30840000 { 766 ecspi2: ecspi@30830000 {
736 #address-cells = <1>; 767 #address-cells = <1>;
737 #size-cells = <0>; 768 #size-cells = <0>;
738 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi"; 769 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi";
739 reg = <0x30840000 0x10000>; 770 reg = <0x30830000 0x10000>;
740 interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; 771 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
741 clocks = <&clks IMX7D_ECSPI3_ROOT_CLK>, 772 clocks = <&clks IMX7D_ECSPI2_ROOT_CLK>,
742 <&clks IMX7D_ECSPI3_ROOT_CLK>; 773 <&clks IMX7D_ECSPI2_ROOT_CLK>;
743 clock-names = "ipg", "per"; 774 clock-names = "ipg", "per";
744 status = "disabled"; 775 status = "disabled";
745 }; 776 };
746 777
747 uart1: serial@30860000 { 778 ecspi3: ecspi@30840000 {
748 compatible = "fsl,imx7d-uart", 779 #address-cells = <1>;
749 "fsl,imx6q-uart"; 780 #size-cells = <0>;
750 reg = <0x30860000 0x10000>; 781 compatible = "fsl,imx7d-ecspi", "fsl,imx51-ecspi";
751 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 782 reg = <0x30840000 0x10000>;
752 clocks = <&clks IMX7D_UART1_ROOT_CLK>, 783 interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
753 <&clks IMX7D_UART1_ROOT_CLK>; 784 clocks = <&clks IMX7D_ECSPI3_ROOT_CLK>,
754 clock-names = "ipg", "per"; 785 <&clks IMX7D_ECSPI3_ROOT_CLK>;
755 status = "disabled"; 786 clock-names = "ipg", "per";
756 }; 787 status = "disabled";
788 };
757 789
758 uart2: serial@30890000 { 790 uart1: serial@30860000 {
759 compatible = "fsl,imx7d-uart", 791 compatible = "fsl,imx7d-uart",
760 "fsl,imx6q-uart"; 792 "fsl,imx6q-uart";
761 reg = <0x30890000 0x10000>; 793 reg = <0x30860000 0x10000>;
762 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; 794 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
763 clocks = <&clks IMX7D_UART2_ROOT_CLK>, 795 clocks = <&clks IMX7D_UART1_ROOT_CLK>,
764 <&clks IMX7D_UART2_ROOT_CLK>; 796 <&clks IMX7D_UART1_ROOT_CLK>;
765 clock-names = "ipg", "per"; 797 clock-names = "ipg", "per";
766 status = "disabled"; 798 status = "disabled";
767 }; 799 };
768 800
769 uart3: serial@30880000 { 801 uart2: serial@30890000 {
770 compatible = "fsl,imx7d-uart", 802 compatible = "fsl,imx7d-uart",
771 "fsl,imx6q-uart"; 803 "fsl,imx6q-uart";
772 reg = <0x30880000 0x10000>; 804 reg = <0x30890000 0x10000>;
773 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; 805 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
774 clocks = <&clks IMX7D_UART3_ROOT_CLK>, 806 clocks = <&clks IMX7D_UART2_ROOT_CLK>,
775 <&clks IMX7D_UART3_ROOT_CLK>; 807 <&clks IMX7D_UART2_ROOT_CLK>;
776 clock-names = "ipg", "per"; 808 clock-names = "ipg", "per";
777 status = "disabled"; 809 status = "disabled";
778 }; 810 };
779 811
780 sai1: sai@308a0000 { 812 uart3: serial@30880000 {
781 #sound-dai-cells = <0>; 813 compatible = "fsl,imx7d-uart",
782 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai"; 814 "fsl,imx6q-uart";
783 reg = <0x308a0000 0x10000>; 815 reg = <0x30880000 0x10000>;
784 interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; 816 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
785 clocks = <&clks IMX7D_SAI1_IPG_CLK>, 817 clocks = <&clks IMX7D_UART3_ROOT_CLK>,
786 <&clks IMX7D_SAI1_ROOT_CLK>, 818 <&clks IMX7D_UART3_ROOT_CLK>;
787 <&clks IMX7D_CLK_DUMMY>, 819 clock-names = "ipg", "per";
788 <&clks IMX7D_CLK_DUMMY>; 820 status = "disabled";
789 clock-names = "bus", "mclk1", "mclk2", "mclk3"; 821 };
790 dma-names = "rx", "tx";
791 dmas = <&sdma 8 24 0>, <&sdma 9 24 0>;
792 status = "disabled";
793 };
794 822
795 sai2: sai@308b0000 { 823 sai1: sai@308a0000 {
796 #sound-dai-cells = <0>; 824 #sound-dai-cells = <0>;
797 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai"; 825 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai";
798 reg = <0x308b0000 0x10000>; 826 reg = <0x308a0000 0x10000>;
799 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; 827 interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
800 clocks = <&clks IMX7D_SAI2_IPG_CLK>, 828 clocks = <&clks IMX7D_SAI1_IPG_CLK>,
801 <&clks IMX7D_SAI2_ROOT_CLK>, 829 <&clks IMX7D_SAI1_ROOT_CLK>,
802 <&clks IMX7D_CLK_DUMMY>, 830 <&clks IMX7D_CLK_DUMMY>,
803 <&clks IMX7D_CLK_DUMMY>; 831 <&clks IMX7D_CLK_DUMMY>;
804 clock-names = "bus", "mclk1", "mclk2", "mclk3"; 832 clock-names = "bus", "mclk1", "mclk2", "mclk3";
805 dma-names = "rx", "tx"; 833 dma-names = "rx", "tx";
806 dmas = <&sdma 10 24 0>, <&sdma 11 24 0>; 834 dmas = <&sdma 8 24 0>, <&sdma 9 24 0>;
807 status = "disabled"; 835 status = "disabled";
836 };
837
838 sai2: sai@308b0000 {
839 #sound-dai-cells = <0>;
840 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai";
841 reg = <0x308b0000 0x10000>;
842 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
843 clocks = <&clks IMX7D_SAI2_IPG_CLK>,
844 <&clks IMX7D_SAI2_ROOT_CLK>,
845 <&clks IMX7D_CLK_DUMMY>,
846 <&clks IMX7D_CLK_DUMMY>;
847 clock-names = "bus", "mclk1", "mclk2", "mclk3";
848 dma-names = "rx", "tx";
849 dmas = <&sdma 10 24 0>, <&sdma 11 24 0>;
850 status = "disabled";
851 };
852
853 sai3: sai@308c0000 {
854 #sound-dai-cells = <0>;
855 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai";
856 reg = <0x308c0000 0x10000>;
857 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
858 clocks = <&clks IMX7D_SAI3_IPG_CLK>,
859 <&clks IMX7D_SAI3_ROOT_CLK>,
860 <&clks IMX7D_CLK_DUMMY>,
861 <&clks IMX7D_CLK_DUMMY>;
862 clock-names = "bus", "mclk1", "mclk2", "mclk3";
863 dma-names = "rx", "tx";
864 dmas = <&sdma 12 24 0>, <&sdma 13 24 0>;
865 status = "disabled";
866 };
808 }; 867 };
809 868
810 sai3: sai@308c0000 { 869 crypto: caam@30900000 {
811 #sound-dai-cells = <0>; 870 compatible = "fsl,sec-v4.0";
812 compatible = "fsl,imx7d-sai", "fsl,imx6sx-sai"; 871 #address-cells = <1>;
813 reg = <0x308c0000 0x10000>; 872 #size-cells = <1>;
814 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; 873 reg = <0x30900000 0x40000>;
815 clocks = <&clks IMX7D_SAI3_IPG_CLK>, 874 ranges = <0 0x30900000 0x40000>;
816 <&clks IMX7D_SAI3_ROOT_CLK>, 875 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
817 <&clks IMX7D_CLK_DUMMY>, 876 clocks = <&clks IMX7D_CAAM_CLK>,
818 <&clks IMX7D_CLK_DUMMY>; 877 <&clks IMX7D_AHB_CHANNEL_ROOT_CLK>;
819 clock-names = "bus", "mclk1", "mclk2", "mclk3"; 878 clock-names = "ipg", "aclk";
820 dma-names = "rx", "tx"; 879
821 dmas = <&sdma 12 24 0>, <&sdma 13 24 0>; 880 sec_jr0: jr0@1000 {
822 status = "disabled"; 881 compatible = "fsl,sec-v4.0-job-ring";
882 reg = <0x1000 0x1000>;
883 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
884 };
885
886 sec_jr1: jr1@2000 {
887 compatible = "fsl,sec-v4.0-job-ring";
888 reg = <0x2000 0x1000>;
889 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
890 };
891
892 sec_jr2: jr1@3000 {
893 compatible = "fsl,sec-v4.0-job-ring";
894 reg = <0x3000 0x1000>;
895 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
896 };
823 }; 897 };
824 898
825 flexcan1: can@30a00000 { 899 flexcan1: can@30a00000 {
diff --git a/arch/arm/boot/dts/keystone-k2e-clocks.dtsi b/arch/arm/boot/dts/keystone-k2e-clocks.dtsi
index 5e0e7d232161..f7592155a740 100644
--- a/arch/arm/boot/dts/keystone-k2e-clocks.dtsi
+++ b/arch/arm/boot/dts/keystone-k2e-clocks.dtsi
@@ -42,7 +42,7 @@ clocks {
42 domain-id = <0>; 42 domain-id = <0>;
43 }; 43 };
44 44
45 clkhyperlink0: clkhyperlink02350030 { 45 clkhyperlink0: clkhyperlink0@2350030 {
46 #clock-cells = <0>; 46 #clock-cells = <0>;
47 compatible = "ti,keystone,psc-clock"; 47 compatible = "ti,keystone,psc-clock";
48 clocks = <&chipclk12>; 48 clocks = <&chipclk12>;
diff --git a/arch/arm/boot/dts/keystone-k2e.dtsi b/arch/arm/boot/dts/keystone-k2e.dtsi
index 0bcd3f8a9c45..085e7326ea8e 100644
--- a/arch/arm/boot/dts/keystone-k2e.dtsi
+++ b/arch/arm/boot/dts/keystone-k2e.dtsi
@@ -109,11 +109,14 @@
109 }; 109 };
110 }; 110 };
111 111
112 dspgpio0: keystone_dsp_gpio@2620240 { 112 devctrl: device-state-control@2620000 {
113 compatible = "ti,keystone-dsp-gpio"; 113 dspgpio0: keystone_dsp_gpio@240 {
114 gpio-controller; 114 compatible = "ti,keystone-dsp-gpio";
115 #gpio-cells = <2>; 115 reg = <0x240 0x4>;
116 gpio,syscon-dev = <&devctrl 0x240>; 116 gpio-controller;
117 #gpio-cells = <2>;
118 gpio,syscon-dev = <&devctrl 0x240>;
119 };
117 }; 120 };
118 121
119 dsp0: dsp@10800000 { 122 dsp0: dsp@10800000 {
diff --git a/arch/arm/boot/dts/keystone-k2g.dtsi b/arch/arm/boot/dts/keystone-k2g.dtsi
index fd061718dc0a..da78c0034427 100644
--- a/arch/arm/boot/dts/keystone-k2g.dtsi
+++ b/arch/arm/boot/dts/keystone-k2g.dtsi
@@ -69,6 +69,24 @@
69 interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>; 69 interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
70 }; 70 };
71 71
72 usbphy {
73 #address-cells = <1>;
74 #size-cells = <0>;
75 compatible = "simple-bus";
76
77 usb0_phy: usb-phy@0 {
78 compatible = "usb-nop-xceiv";
79 reg = <0>;
80 status = "disabled";
81 };
82
83 usb1_phy: usb-phy@1 {
84 compatible = "usb-nop-xceiv";
85 reg = <1>;
86 status = "disabled";
87 };
88 };
89
72 soc0: soc@0 { 90 soc0: soc@0 {
73 #address-cells = <1>; 91 #address-cells = <1>;
74 #size-cells = <1>; 92 #size-cells = <1>;
@@ -97,8 +115,28 @@
97 }; 115 };
98 116
99 devctrl: device-state-control@2620000 { 117 devctrl: device-state-control@2620000 {
100 compatible = "ti,keystone-devctrl", "syscon"; 118 compatible = "ti,keystone-devctrl", "syscon", "simple-mfd";
101 reg = <0x02620000 0x1000>; 119 reg = <0x02620000 0x1000>;
120 #address-cells = <1>;
121 #size-cells = <1>;
122 ranges = <0x0 0x02620000 0x1000>;
123
124 kirq0: keystone_irq@2a0 {
125 compatible = "ti,keystone-irq";
126 reg = <0x2a0 0x10>;
127 interrupts = <GIC_SPI 1 IRQ_TYPE_EDGE_RISING>;
128 interrupt-controller;
129 #interrupt-cells = <1>;
130 ti,syscon-dev = <&devctrl 0x2a0>;
131 };
132
133 dspgpio0: keystone_dsp_gpio@240 {
134 compatible = "ti,keystone-dsp-gpio";
135 reg = <0x240 0x4>;
136 gpio-controller;
137 #gpio-cells = <2>;
138 gpio,syscon-dev = <&devctrl 0x240>;
139 };
102 }; 140 };
103 141
104 uart0: serial@2530c00 { 142 uart0: serial@2530c00 {
@@ -113,7 +151,7 @@
113 status = "disabled"; 151 status = "disabled";
114 }; 152 };
115 153
116 uart1: serial@02531000 { 154 uart1: serial@2531000 {
117 compatible = "ti,da830-uart", "ns16550a"; 155 compatible = "ti,da830-uart", "ns16550a";
118 current-speed = <115200>; 156 current-speed = <115200>;
119 reg-shift = <2>; 157 reg-shift = <2>;
@@ -125,7 +163,7 @@
125 status = "disabled"; 163 status = "disabled";
126 }; 164 };
127 165
128 uart2: serial@02531400 { 166 uart2: serial@2531400 {
129 compatible = "ti,da830-uart", "ns16550a"; 167 compatible = "ti,da830-uart", "ns16550a";
130 current-speed = <115200>; 168 current-speed = <115200>;
131 reg-shift = <2>; 169 reg-shift = <2>;
@@ -188,21 +226,6 @@
188 status = "disabled"; 226 status = "disabled";
189 }; 227 };
190 228
191 kirq0: keystone_irq@26202a0 {
192 compatible = "ti,keystone-irq";
193 interrupts = <GIC_SPI 1 IRQ_TYPE_EDGE_RISING>;
194 interrupt-controller;
195 #interrupt-cells = <1>;
196 ti,syscon-dev = <&devctrl 0x2a0>;
197 };
198
199 dspgpio0: keystone_dsp_gpio@2620240 {
200 compatible = "ti,keystone-dsp-gpio";
201 gpio-controller;
202 #gpio-cells = <2>;
203 gpio,syscon-dev = <&devctrl 0x240>;
204 };
205
206 dsp0: dsp@10800000 { 229 dsp0: dsp@10800000 {
207 compatible = "ti,k2g-dsp"; 230 compatible = "ti,k2g-dsp";
208 reg = <0x10800000 0x00100000>, 231 reg = <0x10800000 0x00100000>,
@@ -460,11 +483,6 @@
460 status = "disabled"; 483 status = "disabled";
461 }; 484 };
462 485
463 usb0_phy: usb-phy@0 {
464 compatible = "usb-nop-xceiv";
465 status = "disabled";
466 };
467
468 keystone_usb0: keystone-dwc3@2680000 { 486 keystone_usb0: keystone-dwc3@2680000 {
469 compatible = "ti,keystone-dwc3"; 487 compatible = "ti,keystone-dwc3";
470 #address-cells = <1>; 488 #address-cells = <1>;
@@ -488,11 +506,6 @@
488 }; 506 };
489 }; 507 };
490 508
491 usb1_phy: usb-phy@1 {
492 compatible = "usb-nop-xceiv";
493 status = "disabled";
494 };
495
496 keystone_usb1: keystone-dwc3@2580000 { 509 keystone_usb1: keystone-dwc3@2580000 {
497 compatible = "ti,keystone-dwc3"; 510 compatible = "ti,keystone-dwc3";
498 #address-cells = <1>; 511 #address-cells = <1>;
@@ -583,5 +596,18 @@
583 power-domains = <&k2g_pds 0x0013>; 596 power-domains = <&k2g_pds 0x0013>;
584 clocks = <&k2g_clks 0x0013 0>; 597 clocks = <&k2g_clks 0x0013 0>;
585 }; 598 };
599
600 wdt: wdt@02250000 {
601 compatible = "ti,keystone-wdt", "ti,davinci-wdt";
602 reg = <0x02250000 0x80>;
603 power-domains = <&k2g_pds 0x22>;
604 clocks = <&k2g_clks 0x22 0>;
605 };
606
607 emif: emif@21010000 {
608 compatible = "ti,emif-keystone";
609 reg = <0x21010000 0x200>;
610 interrupts = <GIC_SPI 123 IRQ_TYPE_EDGE_RISING>;
611 };
586 }; 612 };
587}; 613};
diff --git a/arch/arm/boot/dts/keystone-k2hk.dtsi b/arch/arm/boot/dts/keystone-k2hk.dtsi
index ed59474522cb..ca0f198ba627 100644
--- a/arch/arm/boot/dts/keystone-k2hk.dtsi
+++ b/arch/arm/boot/dts/keystone-k2hk.dtsi
@@ -87,60 +87,70 @@
87 }; 87 };
88 }; 88 };
89 89
90 dspgpio0: keystone_dsp_gpio@2620240 { 90 devctrl: device-state-control@2620000 {
91 compatible = "ti,keystone-dsp-gpio"; 91 dspgpio0: keystone_dsp_gpio@240 {
92 gpio-controller; 92 compatible = "ti,keystone-dsp-gpio";
93 #gpio-cells = <2>; 93 reg = <0x240 0x4>;
94 gpio,syscon-dev = <&devctrl 0x240>; 94 gpio-controller;
95 }; 95 #gpio-cells = <2>;
96 gpio,syscon-dev = <&devctrl 0x240>;
97 };
96 98
97 dspgpio1: keystone_dsp_gpio@2620244 { 99 dspgpio1: keystone_dsp_gpio@244 {
98 compatible = "ti,keystone-dsp-gpio"; 100 compatible = "ti,keystone-dsp-gpio";
99 gpio-controller; 101 reg = <0x244 0x4>;
100 #gpio-cells = <2>; 102 gpio-controller;
101 gpio,syscon-dev = <&devctrl 0x244>; 103 #gpio-cells = <2>;
102 }; 104 gpio,syscon-dev = <&devctrl 0x244>;
105 };
103 106
104 dspgpio2: keystone_dsp_gpio@2620248 { 107 dspgpio2: keystone_dsp_gpio@248 {
105 compatible = "ti,keystone-dsp-gpio"; 108 compatible = "ti,keystone-dsp-gpio";
106 gpio-controller; 109 reg = <0x248 0x4>;
107 #gpio-cells = <2>; 110 gpio-controller;
108 gpio,syscon-dev = <&devctrl 0x248>; 111 #gpio-cells = <2>;
109 }; 112 gpio,syscon-dev = <&devctrl 0x248>;
113 };
110 114
111 dspgpio3: keystone_dsp_gpio@262024c { 115 dspgpio3: keystone_dsp_gpio@24c {
112 compatible = "ti,keystone-dsp-gpio"; 116 compatible = "ti,keystone-dsp-gpio";
113 gpio-controller; 117 reg = <0x24c 0x4>;
114 #gpio-cells = <2>; 118 gpio-controller;
115 gpio,syscon-dev = <&devctrl 0x24c>; 119 #gpio-cells = <2>;
116 }; 120 gpio,syscon-dev = <&devctrl 0x24c>;
121 };
117 122
118 dspgpio4: keystone_dsp_gpio@2620250 { 123 dspgpio4: keystone_dsp_gpio@250 {
119 compatible = "ti,keystone-dsp-gpio"; 124 compatible = "ti,keystone-dsp-gpio";
120 gpio-controller; 125 reg = <0x250 0x4>;
121 #gpio-cells = <2>; 126 gpio-controller;
122 gpio,syscon-dev = <&devctrl 0x250>; 127 #gpio-cells = <2>;
123 }; 128 gpio,syscon-dev = <&devctrl 0x250>;
129 };
124 130
125 dspgpio5: keystone_dsp_gpio@2620254 { 131 dspgpio5: keystone_dsp_gpio@254 {
126 compatible = "ti,keystone-dsp-gpio"; 132 compatible = "ti,keystone-dsp-gpio";
127 gpio-controller; 133 reg = <0x254 0x4>;
128 #gpio-cells = <2>; 134 gpio-controller;
129 gpio,syscon-dev = <&devctrl 0x254>; 135 #gpio-cells = <2>;
130 }; 136 gpio,syscon-dev = <&devctrl 0x254>;
137 };
131 138
132 dspgpio6: keystone_dsp_gpio@2620258 { 139 dspgpio6: keystone_dsp_gpio@258 {
133 compatible = "ti,keystone-dsp-gpio"; 140 compatible = "ti,keystone-dsp-gpio";
134 gpio-controller; 141 reg = <0x258 0x4>;
135 #gpio-cells = <2>; 142 gpio-controller;
136 gpio,syscon-dev = <&devctrl 0x258>; 143 #gpio-cells = <2>;
137 }; 144 gpio,syscon-dev = <&devctrl 0x258>;
145 };
138 146
139 dspgpio7: keystone_dsp_gpio@262025c { 147 dspgpio7: keystone_dsp_gpio@25c {
140 compatible = "ti,keystone-dsp-gpio"; 148 compatible = "ti,keystone-dsp-gpio";
141 gpio-controller; 149 reg = <0x25c 0x4>;
142 #gpio-cells = <2>; 150 gpio-controller;
143 gpio,syscon-dev = <&devctrl 0x25c>; 151 #gpio-cells = <2>;
152 gpio,syscon-dev = <&devctrl 0x25c>;
153 };
144 }; 154 };
145 155
146 dsp0: dsp@10800000 { 156 dsp0: dsp@10800000 {
diff --git a/arch/arm/boot/dts/keystone-k2l.dtsi b/arch/arm/boot/dts/keystone-k2l.dtsi
index b61a830f4a4d..374c80124c4e 100644
--- a/arch/arm/boot/dts/keystone-k2l.dtsi
+++ b/arch/arm/boot/dts/keystone-k2l.dtsi
@@ -289,32 +289,38 @@
289 clocks = <&clkosr>; 289 clocks = <&clkosr>;
290 }; 290 };
291 291
292 dspgpio0: keystone_dsp_gpio@2620240 { 292 devctrl: device-state-control@2620000 {
293 compatible = "ti,keystone-dsp-gpio"; 293 dspgpio0: keystone_dsp_gpio@240 {
294 gpio-controller; 294 compatible = "ti,keystone-dsp-gpio";
295 #gpio-cells = <2>; 295 reg = <0x240 0x4>;
296 gpio,syscon-dev = <&devctrl 0x240>; 296 gpio-controller;
297 }; 297 #gpio-cells = <2>;
298 gpio,syscon-dev = <&devctrl 0x240>;
299 };
298 300
299 dspgpio1: keystone_dsp_gpio@2620244 { 301 dspgpio1: keystone_dsp_gpio@244 {
300 compatible = "ti,keystone-dsp-gpio"; 302 compatible = "ti,keystone-dsp-gpio";
301 gpio-controller; 303 reg = <0x244 0x4>;
302 #gpio-cells = <2>; 304 gpio-controller;
303 gpio,syscon-dev = <&devctrl 0x244>; 305 #gpio-cells = <2>;
304 }; 306 gpio,syscon-dev = <&devctrl 0x244>;
307 };
305 308
306 dspgpio2: keystone_dsp_gpio@2620248 { 309 dspgpio2: keystone_dsp_gpio@248 {
307 compatible = "ti,keystone-dsp-gpio"; 310 compatible = "ti,keystone-dsp-gpio";
308 gpio-controller; 311 reg = <0x248 0x4>;
309 #gpio-cells = <2>; 312 gpio-controller;
310 gpio,syscon-dev = <&devctrl 0x248>; 313 #gpio-cells = <2>;
311 }; 314 gpio,syscon-dev = <&devctrl 0x248>;
315 };
312 316
313 dspgpio3: keystone_dsp_gpio@262024c { 317 dspgpio3: keystone_dsp_gpio@24c {
314 compatible = "ti,keystone-dsp-gpio"; 318 compatible = "ti,keystone-dsp-gpio";
315 gpio-controller; 319 reg = <0x24c 0x4>;
316 #gpio-cells = <2>; 320 gpio-controller;
317 gpio,syscon-dev = <&devctrl 0x24c>; 321 #gpio-cells = <2>;
322 gpio,syscon-dev = <&devctrl 0x24c>;
323 };
318 }; 324 };
319 325
320 dsp0: dsp@10800000 { 326 dsp0: dsp@10800000 {
diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
index 93ea5c69ea77..c298675a29a5 100644
--- a/arch/arm/boot/dts/keystone.dtsi
+++ b/arch/arm/boot/dts/keystone.dtsi
@@ -87,15 +87,28 @@
87 }; 87 };
88 88
89 devctrl: device-state-control@2620000 { 89 devctrl: device-state-control@2620000 {
90 compatible = "ti,keystone-devctrl", "syscon"; 90 compatible = "ti,keystone-devctrl", "syscon", "simple-mfd";
91 reg = <0x02620000 0x1000>; 91 reg = <0x02620000 0x1000>;
92 }; 92 #address-cells = <1>;
93 #size-cells = <1>;
94 ranges = <0x0 0x02620000 0x1000>;
95
96 kirq0: keystone_irq@2a0 {
97 compatible = "ti,keystone-irq";
98 reg = <0x2a0 0x4>;
99 interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
100 interrupt-controller;
101 #interrupt-cells = <1>;
102 ti,syscon-dev = <&devctrl 0x2a0>;
103 };
93 104
94 rstctrl: reset-controller { 105 rstctrl: reset-controller@328 {
95 compatible = "ti,keystone-reset"; 106 compatible = "ti,keystone-reset";
96 ti,syscon-pll = <&pllctrl 0xe4>; 107 reg = <0x328 0x10>;
97 ti,syscon-dev = <&devctrl 0x328>; 108 ti,syscon-pll = <&pllctrl 0xe4>;
98 ti,wdt-list = <0>; 109 ti,syscon-dev = <&devctrl 0x328>;
110 ti,wdt-list = <0>;
111 };
99 }; 112 };
100 113
101 /include/ "keystone-clocks.dtsi" 114 /include/ "keystone-clocks.dtsi"
@@ -282,14 +295,6 @@
282 1 0 0x21000A00 0x00000100>; 295 1 0 0x21000A00 0x00000100>;
283 }; 296 };
284 297
285 kirq0: keystone_irq@26202a0 {
286 compatible = "ti,keystone-irq";
287 interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
288 interrupt-controller;
289 #interrupt-cells = <1>;
290 ti,syscon-dev = <&devctrl 0x2a0>;
291 };
292
293 pcie0: pcie@21800000 { 298 pcie0: pcie@21800000 {
294 compatible = "ti,keystone-pcie", "snps,dw-pcie"; 299 compatible = "ti,keystone-pcie", "snps,dw-pcie";
295 clocks = <&clkpcie>; 300 clocks = <&clkpcie>;
@@ -338,5 +343,12 @@
338 <GIC_SPI 29 IRQ_TYPE_EDGE_RISING>; 343 <GIC_SPI 29 IRQ_TYPE_EDGE_RISING>;
339 }; 344 };
340 }; 345 };
346
347 emif: emif@21010000 {
348 compatible = "ti,emif-keystone";
349 reg = <0x21010000 0x200>;
350 interrupts = <GIC_SPI 448 IRQ_TYPE_EDGE_RISING>;
351 interrupt-parent = <&gic>;
352 };
341 }; 353 };
342}; 354};
diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi
index c1aa7a4518fb..b47cac23a04b 100644
--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi
+++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi
@@ -71,6 +71,8 @@
71}; 71};
72 72
73&i2c1 { 73&i2c1 {
74 pinctrl-names = "default";
75 pinctrl-0 = <&i2c1_pins>;
74 clock-frequency = <2600000>; 76 clock-frequency = <2600000>;
75 77
76 twl: twl@48 { 78 twl: twl@48 {
@@ -86,10 +88,14 @@
86}; 88};
87 89
88&i2c2 { 90&i2c2 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&i2c2_pins>;
89 clock-frequency = <400000>; 93 clock-frequency = <400000>;
90}; 94};
91 95
92&i2c3 { 96&i2c3 {
97 pinctrl-names = "default";
98 pinctrl-0 = <&i2c3_pins>;
93 clock-frequency = <400000>; 99 clock-frequency = <400000>;
94}; 100};
95 101
@@ -189,7 +195,12 @@
189 >; 195 >;
190 }; 196 };
191 197
192 198 i2c1_pins: pinmux_i2c1_pins {
199 pinctrl-single,pins = <
200 OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
201 OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */
202 >;
203 };
193}; 204};
194 205
195&omap3_pmx_wkup { 206&omap3_pmx_wkup {
@@ -206,6 +217,18 @@
206 OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */ 217 OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */
207 >; 218 >;
208 }; 219 };
220 i2c2_pins: pinmux_i2c2_pins {
221 pinctrl-single,pins = <
222 OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT | MUX_MODE0) /* i2c2_scl */
223 OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT | MUX_MODE0) /* i2c2_sda */
224 >;
225 };
226 i2c3_pins: pinmux_i2c3_pins {
227 pinctrl-single,pins = <
228 OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0) /* i2c3_scl */
229 OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT | MUX_MODE0) /* i2c3_sda */
230 >;
231 };
209}; 232};
210 233
211&omap3_pmx_core2 { 234&omap3_pmx_core2 {
diff --git a/arch/arm/boot/dts/logicpd-torpedo-som.dtsi b/arch/arm/boot/dts/logicpd-torpedo-som.dtsi
index b50b796e15c7..3e174e474d3d 100644
--- a/arch/arm/boot/dts/logicpd-torpedo-som.dtsi
+++ b/arch/arm/boot/dts/logicpd-torpedo-som.dtsi
@@ -66,6 +66,8 @@
66}; 66};
67 67
68&i2c1 { 68&i2c1 {
69 pinctrl-names = "default";
70 pinctrl-0 = <&i2c1_pins>;
69 clock-frequency = <2600000>; 71 clock-frequency = <2600000>;
70 72
71 twl: twl@48 { 73 twl: twl@48 {
@@ -81,10 +83,14 @@
81}; 83};
82 84
83&i2c2 { 85&i2c2 {
86 pinctrl-names = "default";
87 pinctrl-0 = <&i2c2_pins>;
84 clock-frequency = <400000>; 88 clock-frequency = <400000>;
85}; 89};
86 90
87&i2c3 { 91&i2c3 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&i2c3_pins>;
88 clock-frequency = <400000>; 94 clock-frequency = <400000>;
89 at24@50 { 95 at24@50 {
90 compatible = "atmel,24c64"; 96 compatible = "atmel,24c64";
@@ -136,6 +142,24 @@
136 OMAP3_CORE1_IOPAD(0x21b8, PIN_INPUT | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */ 142 OMAP3_CORE1_IOPAD(0x21b8, PIN_INPUT | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */
137 >; 143 >;
138 }; 144 };
145 i2c1_pins: pinmux_i2c1_pins {
146 pinctrl-single,pins = <
147 OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
148 OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */
149 >;
150 };
151 i2c2_pins: pinmux_i2c2_pins {
152 pinctrl-single,pins = <
153 OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT | MUX_MODE0) /* i2c2_scl */
154 OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT | MUX_MODE0) /* i2c2_sda */
155 >;
156 };
157 i2c3_pins: pinmux_i2c3_pins {
158 pinctrl-single,pins = <
159 OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0) /* i2c3_scl */
160 OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT | MUX_MODE0) /* i2c3_sda */
161 >;
162 };
139}; 163};
140 164
141&uart2 { 165&uart2 {
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index c31dad98f989..fbd2897566c3 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -788,5 +788,21 @@
788 clock-names = "ipg", "per"; 788 clock-names = "ipg", "per";
789 big-endian; 789 big-endian;
790 }; 790 };
791
792 ocram1: sram@10000000 {
793 compatible = "mmio-sram";
794 reg = <0x0 0x10000000 0x0 0x10000>;
795 #address-cells = <1>;
796 #size-cells = <1>;
797 ranges = <0x0 0x0 0x10000000 0x10000>;
798 };
799
800 ocram2: sram@10010000 {
801 compatible = "mmio-sram";
802 reg = <0x0 0x10010000 0x0 0x10000>;
803 #address-cells = <1>;
804 #size-cells = <1>;
805 ranges = <0x0 0x0 0x10010000 0x10000>;
806 };
791 }; 807 };
792}; 808};
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index d2e3eeaa1a5f..dcc9292d2ffa 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -46,6 +46,7 @@
46#include <dt-bindings/clock/meson8b-clkc.h> 46#include <dt-bindings/clock/meson8b-clkc.h>
47#include <dt-bindings/gpio/meson8-gpio.h> 47#include <dt-bindings/gpio/meson8-gpio.h>
48#include <dt-bindings/reset/amlogic,meson8b-clkc-reset.h> 48#include <dt-bindings/reset/amlogic,meson8b-clkc-reset.h>
49#include <dt-bindings/reset/amlogic,meson8b-reset.h>
49#include "meson.dtsi" 50#include "meson.dtsi"
50 51
51/ { 52/ {
@@ -187,6 +188,12 @@
187 reg = <0x8000 0x4>, <0x4000 0x460>; 188 reg = <0x8000 0x4>, <0x4000 0x460>;
188 }; 189 };
189 190
191 reset: reset-controller@4404 {
192 compatible = "amlogic,meson8b-reset";
193 reg = <0x4404 0x9c>;
194 #reset-cells = <1>;
195 };
196
190 analog_top: analog-top@81a8 { 197 analog_top: analog-top@81a8 {
191 compatible = "amlogic,meson8-analog-top", "syscon"; 198 compatible = "amlogic,meson8-analog-top", "syscon";
192 reg = <0x81a8 0x14>; 199 reg = <0x81a8 0x14>;
@@ -383,10 +390,12 @@
383 compatible = "amlogic,meson8-usb2-phy", "amlogic,meson-mx-usb2-phy"; 390 compatible = "amlogic,meson8-usb2-phy", "amlogic,meson-mx-usb2-phy";
384 clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB0>; 391 clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB0>;
385 clock-names = "usb_general", "usb"; 392 clock-names = "usb_general", "usb";
393 resets = <&reset RESET_USB_OTG>;
386}; 394};
387 395
388&usb1_phy { 396&usb1_phy {
389 compatible = "amlogic,meson8-usb2-phy", "amlogic,meson-mx-usb2-phy"; 397 compatible = "amlogic,meson8-usb2-phy", "amlogic,meson-mx-usb2-phy";
390 clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB1>; 398 clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB1>;
391 clock-names = "usb_general", "usb"; 399 clock-names = "usb_general", "usb";
400 resets = <&reset RESET_USB_OTG>;
392}; 401};
diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index 9ff6ca4e20d0..3a5603d95b70 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -54,6 +54,7 @@
54 54
55 aliases { 55 aliases {
56 serial0 = &uart_AO; 56 serial0 = &uart_AO;
57 mmc0 = &sd_card_slot;
57 }; 58 };
58 59
59 memory { 60 memory {
@@ -69,6 +70,37 @@
69 default-state = "off"; 70 default-state = "off";
70 }; 71 };
71 }; 72 };
73
74 tflash_vdd: regulator-tflash_vdd {
75 /*
76 * signal name from schematics: TFLASH_VDD_EN
77 */
78 compatible = "regulator-fixed";
79
80 regulator-name = "TFLASH_VDD";
81 regulator-min-microvolt = <3300000>;
82 regulator-max-microvolt = <3300000>;
83
84 gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
85 enable-active-high;
86 };
87
88 tf_io: gpio-regulator-tf_io {
89 compatible = "regulator-gpio";
90
91 regulator-name = "TF_IO";
92 regulator-min-microvolt = <1800000>;
93 regulator-max-microvolt = <3300000>;
94
95 /*
96 * signal name from schematics: TF_3V3N_1V8_EN
97 */
98 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
99 gpios-states = <0>;
100
101 states = <3300000 0
102 1800000 1>;
103 };
72}; 104};
73 105
74&uart_AO { 106&uart_AO {
@@ -99,3 +131,59 @@
99&usb1 { 131&usb1 {
100 status = "okay"; 132 status = "okay";
101}; 133};
134
135&sdio {
136 status = "okay";
137
138 pinctrl-0 = <&sd_b_pins>;
139 pinctrl-names = "default";
140
141 /* SD card */
142 sd_card_slot: slot@1 {
143 compatible = "mmc-slot";
144 reg = <1>;
145 status = "okay";
146
147 bus-width = <4>;
148 no-sdio;
149 cap-mmc-highspeed;
150 cap-sd-highspeed;
151 disable-wp;
152
153 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
154 cd-inverted;
155
156 vmmc-supply = <&tflash_vdd>;
157 vqmmc-supply = <&tf_io>;
158 };
159};
160
161&ethmac {
162 status = "okay";
163
164 snps,reset-gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
165 snps,reset-active-low;
166 snps,reset-delays-us = <0 10000 30000>;
167
168 pinctrl-0 = <&eth_rgmii_pins>;
169 pinctrl-names = "default";
170
171 phy-mode = "rgmii";
172 phy-handle = <&eth_phy>;
173 amlogic,tx-delay-ns = <4>;
174
175 mdio {
176 compatible = "snps,dwmac-mdio";
177 #address-cells = <1>;
178 #size-cells = <0>;
179
180 /* Realtek RTL8211F (0x001cc916) */
181 eth_phy: ethernet-phy@0 {
182 reg = <0>;
183 eee-broken-1000t;
184 interrupt-parent = <&gpio_intc>;
185 /* GPIOH_3 */
186 interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
187 };
188 };
189};
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index 7cd03ed3742e..553b82174604 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -152,7 +152,7 @@
152 152
153 reset: reset-controller@4404 { 153 reset: reset-controller@4404 {
154 compatible = "amlogic,meson8b-reset"; 154 compatible = "amlogic,meson8b-reset";
155 reg = <0x4404 0x20>; 155 reg = <0x4404 0x9c>;
156 #reset-cells = <1>; 156 #reset-cells = <1>;
157 }; 157 };
158 158
@@ -183,7 +183,36 @@
183 reg-names = "mux", "pull", "pull-enable", "gpio"; 183 reg-names = "mux", "pull", "pull-enable", "gpio";
184 gpio-controller; 184 gpio-controller;
185 #gpio-cells = <2>; 185 #gpio-cells = <2>;
186 gpio-ranges = <&pinctrl_cbus 0 0 130>; 186 gpio-ranges = <&pinctrl_cbus 0 0 83>;
187 };
188
189 eth_rgmii_pins: eth-rgmii {
190 mux {
191 groups = "eth_tx_clk",
192 "eth_tx_en",
193 "eth_txd1_0",
194 "eth_txd1_1",
195 "eth_txd0_0",
196 "eth_txd0_1",
197 "eth_rx_clk",
198 "eth_rx_dv",
199 "eth_rxd1",
200 "eth_rxd0",
201 "eth_mdio_en",
202 "eth_mdc",
203 "eth_ref_clk",
204 "eth_txd2",
205 "eth_txd3";
206 function = "ethernet";
207 };
208 };
209
210 sd_b_pins: sd-b {
211 mux {
212 groups = "sd_d0_b", "sd_d1_b", "sd_d2_b",
213 "sd_d3_b", "sd_clk_b", "sd_cmd_b";
214 function = "sd_b";
215 };
187 }; 216 };
188 }; 217 };
189}; 218};
@@ -203,8 +232,18 @@
203}; 232};
204 233
205&ethmac { 234&ethmac {
206 clocks = <&clkc CLKID_ETH>; 235 compatible = "amlogic,meson8b-dwmac", "snps,dwmac-3.70a", "snps,dwmac";
207 clock-names = "stmmaceth"; 236
237 reg = <0xc9410000 0x10000
238 0xc1108140 0x4>;
239
240 clocks = <&clkc CLKID_ETH>,
241 <&clkc CLKID_MPLL2>,
242 <&clkc CLKID_MPLL2>;
243 clock-names = "stmmaceth", "clkin0", "clkin1";
244
245 resets = <&reset RESET_ETHERNET>;
246 reset-names = "stmmaceth";
208}; 247};
209 248
210&gpio_intc { 249&gpio_intc {
@@ -219,6 +258,18 @@
219 clock-names = "core"; 258 clock-names = "core";
220}; 259};
221 260
261&i2c_AO {
262 clocks = <&clkc CLKID_CLK81>;
263};
264
265&i2c_A {
266 clocks = <&clkc CLKID_I2C>;
267};
268
269&i2c_B {
270 clocks = <&clkc CLKID_I2C>;
271};
272
222&L2 { 273&L2 {
223 arm,data-latency = <3 3 3>; 274 arm,data-latency = <3 3 3>;
224 arm,tag-latency = <2 2 2>; 275 arm,tag-latency = <2 2 2>;
diff --git a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
index 4d61e5b1334a..ddc7a7bb33c0 100644
--- a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
+++ b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
@@ -68,6 +68,19 @@
68 }; 68 };
69 }; 69 };
70 70
71 cpcap_audio: audio-codec {
72 #sound-dai-cells = <1>;
73
74 port@0 {
75 cpcap_audio_codec0: endpoint {
76 };
77 };
78 port@1 {
79 cpcap_audio_codec1: endpoint {
80 };
81 };
82 };
83
71 cpcap_rtc: rtc { 84 cpcap_rtc: rtc {
72 compatible = "motorola,cpcap-rtc"; 85 compatible = "motorola,cpcap-rtc";
73 86
diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
index b750da5362f7..ead9e1c1184a 100644
--- a/arch/arm/boot/dts/mt7623.dtsi
+++ b/arch/arm/boot/dts/mt7623.dtsi
@@ -28,7 +28,7 @@
28 compatible = "mediatek,mt7623"; 28 compatible = "mediatek,mt7623";
29 interrupt-parent = <&sysirq>; 29 interrupt-parent = <&sysirq>;
30 30
31 cpu_opp_table: opp_table { 31 cpu_opp_table: opp-table {
32 compatible = "operating-points-v2"; 32 compatible = "operating-points-v2";
33 opp-shared; 33 opp-shared;
34 34
@@ -96,6 +96,9 @@
96 device_type = "cpu"; 96 device_type = "cpu";
97 compatible = "arm,cortex-a7"; 97 compatible = "arm,cortex-a7";
98 reg = <0x1>; 98 reg = <0x1>;
99 clocks = <&infracfg CLK_INFRA_CPUSEL>,
100 <&apmixedsys CLK_APMIXED_MAINPLL>;
101 clock-names = "cpu", "intermediate";
99 operating-points-v2 = <&cpu_opp_table>; 102 operating-points-v2 = <&cpu_opp_table>;
100 clock-frequency = <1300000000>; 103 clock-frequency = <1300000000>;
101 }; 104 };
@@ -104,6 +107,9 @@
104 device_type = "cpu"; 107 device_type = "cpu";
105 compatible = "arm,cortex-a7"; 108 compatible = "arm,cortex-a7";
106 reg = <0x2>; 109 reg = <0x2>;
110 clocks = <&infracfg CLK_INFRA_CPUSEL>,
111 <&apmixedsys CLK_APMIXED_MAINPLL>;
112 clock-names = "cpu", "intermediate";
107 operating-points-v2 = <&cpu_opp_table>; 113 operating-points-v2 = <&cpu_opp_table>;
108 clock-frequency = <1300000000>; 114 clock-frequency = <1300000000>;
109 }; 115 };
@@ -112,6 +118,9 @@
112 device_type = "cpu"; 118 device_type = "cpu";
113 compatible = "arm,cortex-a7"; 119 compatible = "arm,cortex-a7";
114 reg = <0x3>; 120 reg = <0x3>;
121 clocks = <&infracfg CLK_INFRA_CPUSEL>,
122 <&apmixedsys CLK_APMIXED_MAINPLL>;
123 clock-names = "cpu", "intermediate";
115 operating-points-v2 = <&cpu_opp_table>; 124 operating-points-v2 = <&cpu_opp_table>;
116 clock-frequency = <1300000000>; 125 clock-frequency = <1300000000>;
117 }; 126 };
@@ -138,32 +147,32 @@
138 }; 147 };
139 148
140 thermal-zones { 149 thermal-zones {
141 cpu_thermal: cpu_thermal { 150 cpu_thermal: cpu-thermal {
142 polling-delay-passive = <1000>; 151 polling-delay-passive = <1000>;
143 polling-delay = <1000>; 152 polling-delay = <1000>;
144 153
145 thermal-sensors = <&thermal 0>; 154 thermal-sensors = <&thermal 0>;
146 155
147 trips { 156 trips {
148 cpu_passive: cpu_passive { 157 cpu_passive: cpu-passive {
149 temperature = <47000>; 158 temperature = <47000>;
150 hysteresis = <2000>; 159 hysteresis = <2000>;
151 type = "passive"; 160 type = "passive";
152 }; 161 };
153 162
154 cpu_active: cpu_active { 163 cpu_active: cpu-active {
155 temperature = <67000>; 164 temperature = <67000>;
156 hysteresis = <2000>; 165 hysteresis = <2000>;
157 type = "active"; 166 type = "active";
158 }; 167 };
159 168
160 cpu_hot: cpu_hot { 169 cpu_hot: cpu-hot {
161 temperature = <87000>; 170 temperature = <87000>;
162 hysteresis = <2000>; 171 hysteresis = <2000>;
163 type = "hot"; 172 type = "hot";
164 }; 173 };
165 174
166 cpu_crit { 175 cpu-crit {
167 temperature = <107000>; 176 temperature = <107000>;
168 hysteresis = <2000>; 177 hysteresis = <2000>;
169 type = "critical"; 178 type = "critical";
@@ -670,6 +679,111 @@
670 #reset-cells = <1>; 679 #reset-cells = <1>;
671 }; 680 };
672 681
682 pcie: pcie@1a140000 {
683 compatible = "mediatek,mt7623-pcie";
684 device_type = "pci";
685 reg = <0 0x1a140000 0 0x1000>, /* PCIe shared registers */
686 <0 0x1a142000 0 0x1000>, /* Port0 registers */
687 <0 0x1a143000 0 0x1000>, /* Port1 registers */
688 <0 0x1a144000 0 0x1000>; /* Port2 registers */
689 reg-names = "subsys", "port0", "port1", "port2";
690 #address-cells = <3>;
691 #size-cells = <2>;
692 #interrupt-cells = <1>;
693 interrupt-map-mask = <0xf800 0 0 0>;
694 interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
695 <0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
696 <0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
697 clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
698 <&hifsys CLK_HIFSYS_PCIE0>,
699 <&hifsys CLK_HIFSYS_PCIE1>,
700 <&hifsys CLK_HIFSYS_PCIE2>;
701 clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2";
702 resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>,
703 <&hifsys MT2701_HIFSYS_PCIE1_RST>,
704 <&hifsys MT2701_HIFSYS_PCIE2_RST>;
705 reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2";
706 phys = <&pcie0_port PHY_TYPE_PCIE>,
707 <&pcie1_port PHY_TYPE_PCIE>,
708 <&u3port1 PHY_TYPE_PCIE>;
709 phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2";
710 power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
711 bus-range = <0x00 0xff>;
712 status = "disabled";
713 ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000
714 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>;
715
716 pcie@0,0 {
717 reg = <0x0000 0 0 0 0>;
718 #address-cells = <3>;
719 #size-cells = <2>;
720 #interrupt-cells = <1>;
721 interrupt-map-mask = <0 0 0 0>;
722 interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>;
723 ranges;
724 num-lanes = <1>;
725 status = "disabled";
726 };
727
728 pcie@1,0 {
729 reg = <0x0800 0 0 0 0>;
730 #address-cells = <3>;
731 #size-cells = <2>;
732 #interrupt-cells = <1>;
733 interrupt-map-mask = <0 0 0 0>;
734 interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
735 ranges;
736 num-lanes = <1>;
737 status = "disabled";
738 };
739
740 pcie@2,0 {
741 reg = <0x1000 0 0 0 0>;
742 #address-cells = <3>;
743 #size-cells = <2>;
744 #interrupt-cells = <1>;
745 interrupt-map-mask = <0 0 0 0>;
746 interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
747 ranges;
748 num-lanes = <1>;
749 status = "disabled";
750 };
751 };
752
753 pcie0_phy: pcie-phy@1a149000 {
754 compatible = "mediatek,generic-tphy-v1";
755 reg = <0 0x1a149000 0 0x0700>;
756 #address-cells = <2>;
757 #size-cells = <2>;
758 ranges;
759 status = "disabled";
760
761 pcie0_port: pcie-phy@1a149900 {
762 reg = <0 0x1a149900 0 0x0700>;
763 clocks = <&clk26m>;
764 clock-names = "ref";
765 #phy-cells = <1>;
766 status = "okay";
767 };
768 };
769
770 pcie1_phy: pcie-phy@1a14a000 {
771 compatible = "mediatek,generic-tphy-v1";
772 reg = <0 0x1a14a000 0 0x0700>;
773 #address-cells = <2>;
774 #size-cells = <2>;
775 ranges;
776 status = "disabled";
777
778 pcie1_port: pcie-phy@1a14a900 {
779 reg = <0 0x1a14a900 0 0x0700>;
780 clocks = <&clk26m>;
781 clock-names = "ref";
782 #phy-cells = <1>;
783 status = "okay";
784 };
785 };
786
673 usb1: usb@1a1c0000 { 787 usb1: usb@1a1c0000 {
674 compatible = "mediatek,mt7623-xhci", 788 compatible = "mediatek,mt7623-xhci",
675 "mediatek,mt8173-xhci"; 789 "mediatek,mt8173-xhci";
diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
index 7bf5aa2237c9..bbf56f855e46 100644
--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -39,7 +39,34 @@
39 }; 39 };
40 }; 40 };
41 41
42 gpio_keys { 42 reg_1p8v: regulator-1p8v {
43 compatible = "regulator-fixed";
44 regulator-name = "fixed-1.8V";
45 regulator-min-microvolt = <1800000>;
46 regulator-max-microvolt = <1800000>;
47 regulator-boot-on;
48 regulator-always-on;
49 };
50
51 reg_3p3v: regulator-3p3v {
52 compatible = "regulator-fixed";
53 regulator-name = "fixed-3.3V";
54 regulator-min-microvolt = <3300000>;
55 regulator-max-microvolt = <3300000>;
56 regulator-boot-on;
57 regulator-always-on;
58 };
59
60 reg_5v: regulator-5v {
61 compatible = "regulator-fixed";
62 regulator-name = "fixed-5V";
63 regulator-min-microvolt = <5000000>;
64 regulator-max-microvolt = <5000000>;
65 regulator-boot-on;
66 regulator-always-on;
67 };
68
69 gpio-keys {
43 compatible = "gpio-keys"; 70 compatible = "gpio-keys";
44 pinctrl-names = "default"; 71 pinctrl-names = "default";
45 pinctrl-0 = <&key_pins_a>; 72 pinctrl-0 = <&key_pins_a>;
@@ -120,7 +147,6 @@
120 #address-cells = <1>; 147 #address-cells = <1>;
121 #size-cells = <0>; 148 #size-cells = <0>;
122 reg = <0>; 149 reg = <0>;
123 pinctrl-names = "default";
124 reset-gpios = <&pio 33 0>; 150 reset-gpios = <&pio 33 0>;
125 core-supply = <&mt6323_vpa_reg>; 151 core-supply = <&mt6323_vpa_reg>;
126 io-supply = <&mt6323_vemc3v3_reg>; 152 io-supply = <&mt6323_vemc3v3_reg>;
@@ -191,8 +217,8 @@
191 bus-width = <8>; 217 bus-width = <8>;
192 max-frequency = <50000000>; 218 max-frequency = <50000000>;
193 cap-mmc-highspeed; 219 cap-mmc-highspeed;
194 vmmc-supply = <&mt6323_vemc3v3_reg>; 220 vmmc-supply = <&reg_3p3v>;
195 vqmmc-supply = <&mt6323_vio18_reg>; 221 vqmmc-supply = <&reg_1p8v>;
196 non-removable; 222 non-removable;
197}; 223};
198 224
@@ -205,20 +231,42 @@
205 max-frequency = <50000000>; 231 max-frequency = <50000000>;
206 cap-sd-highspeed; 232 cap-sd-highspeed;
207 cd-gpios = <&pio 261 GPIO_ACTIVE_LOW>; 233 cd-gpios = <&pio 261 GPIO_ACTIVE_LOW>;
208 vmmc-supply = <&mt6323_vmch_reg>; 234 vmmc-supply = <&reg_3p3v>;
209 vqmmc-supply = <&mt6323_vio18_reg>; 235 vqmmc-supply = <&reg_3p3v>;
236};
237
238&pcie {
239 pinctrl-names = "default";
240 pinctrl-0 = <&pcie_default>;
241 status = "okay";
242
243 pcie@0,0 {
244 status = "okay";
245 };
246
247 pcie@1,0 {
248 status = "okay";
249 };
250};
251
252&pcie0_phy {
253 status = "okay";
254};
255
256&pcie1_phy {
257 status = "okay";
210}; 258};
211 259
212&pio { 260&pio {
213 cir_pins_a:cir@0 { 261 cir_pins_a:cir@0 {
214 pins_cir { 262 pins-cir {
215 pinmux = <MT7623_PIN_46_IR_FUNC_IR>; 263 pinmux = <MT7623_PIN_46_IR_FUNC_IR>;
216 bias-disable; 264 bias-disable;
217 }; 265 };
218 }; 266 };
219 267
220 i2c0_pins_a: i2c@0 { 268 i2c0_pins_a: i2c@0 {
221 pins_i2c0 { 269 pins-i2c0 {
222 pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>, 270 pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
223 <MT7623_PIN_76_SCL0_FUNC_SCL0>; 271 <MT7623_PIN_76_SCL0_FUNC_SCL0>;
224 bias-disable; 272 bias-disable;
@@ -226,7 +274,7 @@
226 }; 274 };
227 275
228 i2c1_pins_a: i2c@1 { 276 i2c1_pins_a: i2c@1 {
229 pin_i2c1 { 277 pin-i2c1 {
230 pinmux = <MT7623_PIN_57_SDA1_FUNC_SDA1>, 278 pinmux = <MT7623_PIN_57_SDA1_FUNC_SDA1>,
231 <MT7623_PIN_58_SCL1_FUNC_SCL1>; 279 <MT7623_PIN_58_SCL1_FUNC_SCL1>;
232 bias-disable; 280 bias-disable;
@@ -234,7 +282,7 @@
234 }; 282 };
235 283
236 i2s0_pins_a: i2s@0 { 284 i2s0_pins_a: i2s@0 {
237 pin_i2s0 { 285 pin-i2s0 {
238 pinmux = <MT7623_PIN_49_I2S0_DATA_FUNC_I2S0_DATA>, 286 pinmux = <MT7623_PIN_49_I2S0_DATA_FUNC_I2S0_DATA>,
239 <MT7623_PIN_72_I2S0_DATA_IN_FUNC_I2S0_DATA_IN>, 287 <MT7623_PIN_72_I2S0_DATA_IN_FUNC_I2S0_DATA_IN>,
240 <MT7623_PIN_73_I2S0_LRCK_FUNC_I2S0_LRCK>, 288 <MT7623_PIN_73_I2S0_LRCK_FUNC_I2S0_LRCK>,
@@ -246,7 +294,7 @@
246 }; 294 };
247 295
248 i2s1_pins_a: i2s@1 { 296 i2s1_pins_a: i2s@1 {
249 pin_i2s1 { 297 pin-i2s1 {
250 pinmux = <MT7623_PIN_33_I2S1_DATA_FUNC_I2S1_DATA>, 298 pinmux = <MT7623_PIN_33_I2S1_DATA_FUNC_I2S1_DATA>,
251 <MT7623_PIN_34_I2S1_DATA_IN_FUNC_I2S1_DATA_IN>, 299 <MT7623_PIN_34_I2S1_DATA_IN_FUNC_I2S1_DATA_IN>,
252 <MT7623_PIN_35_I2S1_BCK_FUNC_I2S1_BCK>, 300 <MT7623_PIN_35_I2S1_BCK_FUNC_I2S1_BCK>,
@@ -258,7 +306,7 @@
258 }; 306 };
259 307
260 key_pins_a: keys@0 { 308 key_pins_a: keys@0 {
261 pins_keys { 309 pins-keys {
262 pinmux = <MT7623_PIN_256_GPIO256_FUNC_GPIO256>, 310 pinmux = <MT7623_PIN_256_GPIO256_FUNC_GPIO256>,
263 <MT7623_PIN_257_GPIO257_FUNC_GPIO257> ; 311 <MT7623_PIN_257_GPIO257_FUNC_GPIO257> ;
264 input-enable; 312 input-enable;
@@ -266,7 +314,7 @@
266 }; 314 };
267 315
268 led_pins_a: leds@0 { 316 led_pins_a: leds@0 {
269 pins_leds { 317 pins-leds {
270 pinmux = <MT7623_PIN_239_EXT_SDIO0_FUNC_GPIO239>, 318 pinmux = <MT7623_PIN_239_EXT_SDIO0_FUNC_GPIO239>,
271 <MT7623_PIN_240_EXT_XCS_FUNC_GPIO240>, 319 <MT7623_PIN_240_EXT_XCS_FUNC_GPIO240>,
272 <MT7623_PIN_241_EXT_SCK_FUNC_GPIO241>; 320 <MT7623_PIN_241_EXT_SCK_FUNC_GPIO241>;
@@ -274,7 +322,7 @@
274 }; 322 };
275 323
276 mmc0_pins_default: mmc0default { 324 mmc0_pins_default: mmc0default {
277 pins_cmd_dat { 325 pins-cmd-dat {
278 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>, 326 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
279 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>, 327 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
280 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>, 328 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
@@ -288,19 +336,19 @@
288 bias-pull-up; 336 bias-pull-up;
289 }; 337 };
290 338
291 pins_clk { 339 pins-clk {
292 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>; 340 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
293 bias-pull-down; 341 bias-pull-down;
294 }; 342 };
295 343
296 pins_rst { 344 pins-rst {
297 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>; 345 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
298 bias-pull-up; 346 bias-pull-up;
299 }; 347 };
300 }; 348 };
301 349
302 mmc0_pins_uhs: mmc0 { 350 mmc0_pins_uhs: mmc0 {
303 pins_cmd_dat { 351 pins-cmd-dat {
304 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>, 352 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
305 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>, 353 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
306 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>, 354 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
@@ -315,20 +363,20 @@
315 bias-pull-up = <MTK_PUPD_SET_R1R0_01>; 363 bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
316 }; 364 };
317 365
318 pins_clk { 366 pins-clk {
319 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>; 367 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
320 drive-strength = <MTK_DRIVE_2mA>; 368 drive-strength = <MTK_DRIVE_2mA>;
321 bias-pull-down = <MTK_PUPD_SET_R1R0_01>; 369 bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
322 }; 370 };
323 371
324 pins_rst { 372 pins-rst {
325 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>; 373 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
326 bias-pull-up; 374 bias-pull-up;
327 }; 375 };
328 }; 376 };
329 377
330 mmc1_pins_default: mmc1default { 378 mmc1_pins_default: mmc1default {
331 pins_cmd_dat { 379 pins-cmd-dat {
332 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>, 380 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
333 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>, 381 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
334 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>, 382 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
@@ -339,26 +387,26 @@
339 bias-pull-up = <MTK_PUPD_SET_R1R0_10>; 387 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
340 }; 388 };
341 389
342 pins_clk { 390 pins-clk {
343 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>; 391 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
344 bias-pull-down; 392 bias-pull-down;
345 drive-strength = <MTK_DRIVE_4mA>; 393 drive-strength = <MTK_DRIVE_4mA>;
346 }; 394 };
347 395
348 pins_wp { 396 pins-wp {
349 pinmux = <MT7623_PIN_29_EINT7_FUNC_MSDC1_WP>; 397 pinmux = <MT7623_PIN_29_EINT7_FUNC_MSDC1_WP>;
350 input-enable; 398 input-enable;
351 bias-pull-up; 399 bias-pull-up;
352 }; 400 };
353 401
354 pins_insert { 402 pins-insert {
355 pinmux = <MT7623_PIN_261_MSDC1_INS_FUNC_GPIO261>; 403 pinmux = <MT7623_PIN_261_MSDC1_INS_FUNC_GPIO261>;
356 bias-pull-up; 404 bias-pull-up;
357 }; 405 };
358 }; 406 };
359 407
360 mmc1_pins_uhs: mmc1 { 408 mmc1_pins_uhs: mmc1 {
361 pins_cmd_dat { 409 pins-cmd-dat {
362 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>, 410 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
363 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>, 411 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
364 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>, 412 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
@@ -369,15 +417,23 @@
369 bias-pull-up = <MTK_PUPD_SET_R1R0_10>; 417 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
370 }; 418 };
371 419
372 pins_clk { 420 pins-clk {
373 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>; 421 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
374 drive-strength = <MTK_DRIVE_4mA>; 422 drive-strength = <MTK_DRIVE_4mA>;
375 bias-pull-down = <MTK_PUPD_SET_R1R0_10>; 423 bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
376 }; 424 };
377 }; 425 };
378 426
427 pcie_default: pcie_pin_default {
428 pins_cmd_dat {
429 pinmux = <MT7623_PIN_208_AUD_EXT_CK1_FUNC_PCIE0_PERST_N>,
430 <MT7623_PIN_209_AUD_EXT_CK2_FUNC_PCIE1_PERST_N>;
431 bias-disable;
432 };
433 };
434
379 pwm_pins_a: pwm@0 { 435 pwm_pins_a: pwm@0 {
380 pins_pwm { 436 pins-pwm {
381 pinmux = <MT7623_PIN_203_PWM0_FUNC_PWM0>, 437 pinmux = <MT7623_PIN_203_PWM0_FUNC_PWM0>,
382 <MT7623_PIN_204_PWM1_FUNC_PWM1>, 438 <MT7623_PIN_204_PWM1_FUNC_PWM1>,
383 <MT7623_PIN_205_PWM2_FUNC_PWM2>, 439 <MT7623_PIN_205_PWM2_FUNC_PWM2>,
@@ -387,7 +443,7 @@
387 }; 443 };
388 444
389 spi0_pins_a: spi@0 { 445 spi0_pins_a: spi@0 {
390 pins_spi { 446 pins-spi {
391 pinmux = <MT7623_PIN_53_SPI0_CSN_FUNC_SPI0_CS>, 447 pinmux = <MT7623_PIN_53_SPI0_CSN_FUNC_SPI0_CS>,
392 <MT7623_PIN_54_SPI0_CK_FUNC_SPI0_CK>, 448 <MT7623_PIN_54_SPI0_CK_FUNC_SPI0_CK>,
393 <MT7623_PIN_55_SPI0_MI_FUNC_SPI0_MI>, 449 <MT7623_PIN_55_SPI0_MI_FUNC_SPI0_MI>,
@@ -397,18 +453,25 @@
397 }; 453 };
398 454
399 uart0_pins_a: uart@0 { 455 uart0_pins_a: uart@0 {
400 pins_dat { 456 pins-dat {
401 pinmux = <MT7623_PIN_79_URXD0_FUNC_URXD0>, 457 pinmux = <MT7623_PIN_79_URXD0_FUNC_URXD0>,
402 <MT7623_PIN_80_UTXD0_FUNC_UTXD0>; 458 <MT7623_PIN_80_UTXD0_FUNC_UTXD0>;
403 }; 459 };
404 }; 460 };
405 461
406 uart1_pins_a: uart@1 { 462 uart1_pins_a: uart@1 {
407 pins_dat { 463 pins-dat {
408 pinmux = <MT7623_PIN_81_URXD1_FUNC_URXD1>, 464 pinmux = <MT7623_PIN_81_URXD1_FUNC_URXD1>,
409 <MT7623_PIN_82_UTXD1_FUNC_UTXD1>; 465 <MT7623_PIN_82_UTXD1_FUNC_UTXD1>;
410 }; 466 };
411 }; 467 };
468
469 uart2_pins_a: uart@2 {
470 pins-dat {
471 pinmux = <MT7623_PIN_14_GPIO14_FUNC_URXD2>,
472 <MT7623_PIN_15_GPIO15_FUNC_UTXD2>;
473 };
474 };
412}; 475};
413 476
414&pwm { 477&pwm {
@@ -454,26 +517,30 @@
454&uart0 { 517&uart0 {
455 pinctrl-names = "default"; 518 pinctrl-names = "default";
456 pinctrl-0 = <&uart0_pins_a>; 519 pinctrl-0 = <&uart0_pins_a>;
457 status = "disabled"; 520 status = "okay";
458}; 521};
459 522
460&uart1 { 523&uart1 {
461 pinctrl-names = "default"; 524 pinctrl-names = "default";
462 pinctrl-0 = <&uart1_pins_a>; 525 pinctrl-0 = <&uart1_pins_a>;
463 status = "disabled"; 526 status = "okay";
464}; 527};
465 528
466&uart2 { 529&uart2 {
530 pinctrl-names = "default";
531 pinctrl-0 = <&uart2_pins_a>;
467 status = "okay"; 532 status = "okay";
468}; 533};
469 534
470&usb1 { 535&usb1 {
471 vusb33-supply = <&mt6323_vusb_reg>; 536 vusb33-supply = <&reg_3p3v>;
537 vbus-supply = <&reg_5v>;
472 status = "okay"; 538 status = "okay";
473}; 539};
474 540
475&usb2 { 541&usb2 {
476 vusb33-supply = <&mt6323_vusb_reg>; 542 vusb33-supply = <&reg_3p3v>;
543 vbus-supply = <&reg_5v>;
477 status = "okay"; 544 status = "okay";
478}; 545};
479 546
diff --git a/arch/arm/boot/dts/mt7623n-rfb-nand.dts b/arch/arm/boot/dts/mt7623n-rfb-nand.dts
index e66de8611650..f729c718aba1 100644
--- a/arch/arm/boot/dts/mt7623n-rfb-nand.dts
+++ b/arch/arm/boot/dts/mt7623n-rfb-nand.dts
@@ -81,13 +81,13 @@
81 81
82&pio { 82&pio {
83 nand_pins_default: nanddefault { 83 nand_pins_default: nanddefault {
84 pins_ale { 84 pins-ale {
85 pinmux = <MT7623_PIN_116_MSDC0_CMD_FUNC_NALE>; 85 pinmux = <MT7623_PIN_116_MSDC0_CMD_FUNC_NALE>;
86 drive-strength = <MTK_DRIVE_8mA>; 86 drive-strength = <MTK_DRIVE_8mA>;
87 bias-pull-down = <MTK_PUPD_SET_R1R0_10>; 87 bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
88 }; 88 };
89 89
90 pins_dat { 90 pins-dat {
91 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_NLD7>, 91 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_NLD7>,
92 <MT7623_PIN_112_MSDC0_DAT6_FUNC_NLD6>, 92 <MT7623_PIN_112_MSDC0_DAT6_FUNC_NLD6>,
93 <MT7623_PIN_114_MSDC0_DAT4_FUNC_NLD4>, 93 <MT7623_PIN_114_MSDC0_DAT4_FUNC_NLD4>,
@@ -102,7 +102,7 @@
102 bias-pull-up; 102 bias-pull-up;
103 }; 103 };
104 104
105 pins_we { 105 pins-we {
106 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_NWEB>; 106 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_NWEB>;
107 drive-strength = <MTK_DRIVE_8mA>; 107 drive-strength = <MTK_DRIVE_8mA>;
108 bias-pull-up = <MTK_PUPD_SET_R1R0_10>; 108 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
new file mode 100644
index 000000000000..cabde3d5be8a
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
@@ -0,0 +1,35 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2018 Nuvoton Technology corporation.
3// Copyright 2018 Google, Inc.
4
5/dts-v1/;
6#include "nuvoton-npcm750.dtsi"
7
8/ {
9 model = "Nuvoton npcm750 Development Board (Device Tree)";
10 compatible = "nuvoton,npcm750";
11
12 chosen {
13 stdout-path = &serial3;
14 };
15
16 memory {
17 reg = <0 0x40000000>;
18 };
19};
20
21&serial0 {
22 status = "okay";
23};
24
25&serial1 {
26 status = "okay";
27};
28
29&serial2 {
30 status = "okay";
31};
32
33&serial3 {
34 status = "okay";
35};
diff --git a/arch/arm/boot/dts/nuvoton-npcm750.dtsi b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
new file mode 100644
index 000000000000..839e45cfd695
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
@@ -0,0 +1,165 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2018 Nuvoton Technology corporation.
3// Copyright 2018 Google, Inc.
4
5#include <dt-bindings/interrupt-controller/arm-gic.h>
6
7/ {
8 #address-cells = <1>;
9 #size-cells = <1>;
10 interrupt-parent = <&gic>;
11
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15 enable-method = "nuvoton,npcm750-smp";
16
17 cpu@0 {
18 device_type = "cpu";
19 compatible = "arm,cortex-a9";
20 clocks = <&clk 10>;
21 clock-names = "clk_cpu";
22 reg = <0>;
23 next-level-cache = <&l2>;
24 };
25
26 cpu@1 {
27 device_type = "cpu";
28 compatible = "arm,cortex-a9";
29 clocks = <&clk 10>;
30 clock-names = "clk_cpu";
31 reg = <1>;
32 next-level-cache = <&l2>;
33 };
34 };
35
36 /* external clock signal rg1refck, supplied by the phy */
37 clk-rg1refck {
38 compatible = "fixed-clock";
39 #clock-cells = <0>;
40 clock-frequency = <125000000>;
41 };
42
43 /* external clock signal rg2refck, supplied by the phy */
44 clk-rg2refck {
45 compatible = "fixed-clock";
46 #clock-cells = <0>;
47 clock-frequency = <125000000>;
48 };
49
50 clk-xin {
51 compatible = "fixed-clock";
52 #clock-cells = <0>;
53 clock-frequency = <50000000>;
54 };
55
56 soc {
57 #address-cells = <1>;
58 #size-cells = <1>;
59 compatible = "simple-bus";
60 interrupt-parent = <&gic>;
61 ranges = <0x0 0xf0000000 0x00900000>;
62
63 gcr: gcr@800000 {
64 compatible = "nuvoton,npcm750-gcr", "syscon",
65 "simple-mfd";
66 reg = <0x800000 0x1000>;
67 };
68
69 scu: scu@3fe000 {
70 compatible = "arm,cortex-a9-scu";
71 reg = <0x3fe000 0x1000>;
72 };
73
74 l2: cache-controller@3fc000 {
75 compatible = "arm,pl310-cache";
76 reg = <0x3fc000 0x1000>;
77 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
78 cache-unified;
79 cache-level = <2>;
80 clocks = <&clk 22>;
81 arm,shared-override;
82 };
83
84 gic: interrupt-controller@3ff000 {
85 compatible = "arm,cortex-a9-gic";
86 interrupt-controller;
87 #interrupt-cells = <3>;
88 reg = <0x3ff000 0x1000>,
89 <0x3fe100 0x100>;
90 };
91
92 timer@3fe600 {
93 compatible = "arm,cortex-a9-twd-timer";
94 reg = <0x3fe600 0x20>;
95 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
96 IRQ_TYPE_LEVEL_HIGH)>;
97 clocks = <&clk 15>;
98 };
99 };
100
101 ahb {
102 #address-cells = <1>;
103 #size-cells = <1>;
104 compatible = "simple-bus";
105 interrupt-parent = <&gic>;
106 ranges;
107
108 clk: clock-controller@f0801000 {
109 compatible = "nuvoton,npcm750-clk";
110 #clock-cells = <1>;
111 reg = <0xf0801000 0x1000>;
112 };
113
114 apb {
115 #address-cells = <1>;
116 #size-cells = <1>;
117 compatible = "simple-bus";
118 interrupt-parent = <&gic>;
119 ranges = <0x0 0xf0000000 0x00300000>;
120
121 timer0: timer@8000 {
122 compatible = "nuvoton,npcm750-timer";
123 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
124 reg = <0x8000 0x1000>;
125 clocks = <&clk 15>;
126 };
127
128 serial0: serial@1000 {
129 compatible = "ns16550a";
130 reg = <0x1000 0x1000>;
131 clocks = <&clk 14>;
132 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
133 reg-shift = <2>;
134 status = "disabled";
135 };
136
137 serial1: serial@2000 {
138 compatible = "ns16550a";
139 reg = <0x2000 0x1000>;
140 clocks = <&clk 14>;
141 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
142 reg-shift = <2>;
143 status = "disabled";
144 };
145
146 serial2: serial@3000 {
147 compatible = "ns16550a";
148 reg = <0x3000 0x1000>;
149 clocks = <&clk 14>;
150 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
151 reg-shift = <2>;
152 status = "disabled";
153 };
154
155 serial3: serial@4000 {
156 compatible = "ns16550a";
157 reg = <0x4000 0x1000>;
158 clocks = <&clk 14>;
159 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
160 reg-shift = <2>;
161 status = "disabled";
162 };
163 };
164 };
165};
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index e44d93fc644c..ded5fcf084eb 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -39,6 +39,13 @@
39 }; 39 };
40}; 40};
41 41
42&i2c3 {
43 ak8975@0f {
44 compatible = "asahi-kasei,ak8975";
45 reg = <0x0f>;
46 };
47};
48
42&isp { 49&isp {
43 vdd-csiphy1-supply = <&vaux2>; 50 vdd-csiphy1-supply = <&vaux2>;
44 vdd-csiphy2-supply = <&vaux2>; 51 vdd-csiphy2-supply = <&vaux2>;
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index a005802cd52b..4043ecb38016 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -557,6 +557,7 @@
557 dma-names = "tx", "rx"; 557 dma-names = "tx", "rx";
558 clocks = <&mcbsp4_fck>; 558 clocks = <&mcbsp4_fck>;
559 clock-names = "fck"; 559 clock-names = "fck";
560 #sound-dai-cells = <0>;
560 status = "disabled"; 561 status = "disabled";
561 }; 562 };
562 563
diff --git a/arch/arm/boot/dts/omap4-droid4-xt894.dts b/arch/arm/boot/dts/omap4-droid4-xt894.dts
index b21084da490b..bdf73cbcec3a 100644
--- a/arch/arm/boot/dts/omap4-droid4-xt894.dts
+++ b/arch/arm/boot/dts/omap4-droid4-xt894.dts
@@ -70,8 +70,30 @@
70 regulator-always-on; 70 regulator-always-on;
71 }; 71 };
72 72
73 /* HS USB Host PHY on PORT 1 */ 73 /* FS USB Host PHY on port 1 for mdm6600 */
74 hsusb1_phy: hsusb1_phy { 74 fsusb1_phy: usb-phy@1 {
75 compatible = "motorola,mapphone-mdm6600";
76 pinctrl-0 = <&usb_mdm6600_pins>;
77 pinctrl-names = "default";
78 enable-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; /* gpio_95 */
79 power-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>; /* gpio_54 */
80 reset-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>; /* gpio_49 */
81 /* mode: gpio_148 gpio_149 */
82 motorola,mode-gpios = <&gpio5 20 GPIO_ACTIVE_HIGH>,
83 <&gpio5 21 GPIO_ACTIVE_HIGH>;
84 /* cmd: gpio_103 gpio_104 gpio_142 */
85 motorola,cmd-gpios = <&gpio4 7 GPIO_ACTIVE_HIGH>,
86 <&gpio4 8 GPIO_ACTIVE_HIGH>,
87 <&gpio5 14 GPIO_ACTIVE_HIGH>;
88 /* status: gpio_52 gpio_53 gpio_55 */
89 motorola,status-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>,
90 <&gpio2 21 GPIO_ACTIVE_HIGH>,
91 <&gpio2 23 GPIO_ACTIVE_HIGH>;
92 #phy-cells = <0>;
93 };
94
95 /* HS USB host TLL nop-phy on port 2 for w3glte */
96 hsusb2_phy: usb-phy@2 {
75 compatible = "usb-nop-xceiv"; 97 compatible = "usb-nop-xceiv";
76 #phy-cells = <0>; 98 #phy-cells = <0>;
77 }; 99 };
@@ -117,6 +139,26 @@
117 139
118 }; 140 };
119 }; 141 };
142
143 soundcard {
144 compatible = "audio-graph-card";
145 label = "Droid 4 Audio";
146
147 simple-graph-card,widgets =
148 "Speaker", "Earpiece",
149 "Speaker", "Loudspeaker",
150 "Headphone", "Headphone Jack",
151 "Microphone", "Internal Mic";
152
153 simple-graph-card,routing =
154 "Earpiece", "EP",
155 "Loudspeaker", "SPKR",
156 "Headphone Jack", "HSL",
157 "Headphone Jack", "HSR",
158 "MICR", "Internal Mic";
159
160 dais = <&mcbsp2_port>, <&mcbsp3_port>;
161 };
120}; 162};
121 163
122&dss { 164&dss {
@@ -124,13 +166,6 @@
124}; 166};
125 167
126&gpio6 { 168&gpio6 {
127 touchscreen_reset {
128 gpio-hog;
129 gpios = <13 0>;
130 output-high;
131 line-name = "touchscreen-reset";
132 };
133
134 pwm8: dmtimer-pwm-8 { 169 pwm8: dmtimer-pwm-8 {
135 pinctrl-names = "default"; 170 pinctrl-names = "default";
136 pinctrl-0 = <&vibrator_direction_pin>; 171 pinctrl-0 = <&vibrator_direction_pin>;
@@ -362,22 +397,18 @@
362 }; 397 };
363}; 398};
364 399
365/*
366 * REVISIT: Add gpio173 reset pin handling to the driver, see gpio-hog above.
367 * If the GPIO reset is used, we probably need to have /lib/firmware/maxtouch.fw
368 * available. See "mxt-app" and "droid4-touchscreen-firmware" tools for more
369 * information.
370 */
371&i2c2 { 400&i2c2 {
372 tsp@4a { 401 touchscreen@4a {
373 compatible = "atmel,maxtouch"; 402 compatible = "atmel,maxtouch";
374 reg = <0x4a>; 403 reg = <0x4a>;
375 pinctrl-names = "default"; 404 pinctrl-names = "default";
376 pinctrl-0 = <&touchscreen_pins>; 405 pinctrl-0 = <&touchscreen_pins>;
377 406
407 reset-gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>; /* gpio173 */
408
378 /* gpio_183 with sys_nirq2 pad as wakeup */ 409 /* gpio_183 with sys_nirq2 pad as wakeup */
379 interrupts-extended = <&gpio6 23 IRQ_TYPE_EDGE_FALLING 410 interrupts-extended = <&gpio6 23 IRQ_TYPE_EDGE_FALLING>,
380 &omap4_pmx_core 0x160>; 411 <&omap4_pmx_core 0x160>;
381 interrupt-names = "irq", "wakeup"; 412 interrupt-names = "irq", "wakeup";
382 wakeup-source; 413 wakeup-source;
383 }; 414 };
@@ -435,6 +466,7 @@
435 466
436 touchscreen_pins: pinmux_touchscreen_pins { 467 touchscreen_pins: pinmux_touchscreen_pins {
437 pinctrl-single,pins = < 468 pinctrl-single,pins = <
469 OMAP4_IOPAD(0x180, PIN_OUTPUT | MUX_MODE3)
438 OMAP4_IOPAD(0x1a0, PIN_INPUT_PULLUP | MUX_MODE3) 470 OMAP4_IOPAD(0x1a0, PIN_INPUT_PULLUP | MUX_MODE3)
439 >; 471 >;
440 }; 472 };
@@ -445,6 +477,43 @@
445 >; 477 >;
446 }; 478 };
447 479
480 usb_mdm6600_pins: pinmux_usb_mdm6600_pins {
481 pinctrl-single,pins = <
482 /* enable 0x4a1000d8 usbb1_ulpitll_dat7.gpio_95 ag16 */
483 OMAP4_IOPAD(0x0d8, PIN_INPUT | MUX_MODE3)
484
485 /* power 0x4a10007c gpmc_nwp.gpio_54 c25 */
486 OMAP4_IOPAD(0x07c, PIN_OUTPUT | MUX_MODE3)
487
488 /* reset 0x4a100072 gpmc_a25.gpio_49 d20 */
489 OMAP4_IOPAD(0x072, PIN_OUTPUT | MUX_MODE3)
490
491 /* mode0/bpwake 0x4a10014e sdmmc5_dat1.gpio_148 af4 */
492 OMAP4_IOPAD(0x14e, PIN_OUTPUT | MUX_MODE3)
493
494 /* mode1/apwake 0x4a100150 sdmmc5_dat2.gpio_149 ag3 */
495 OMAP4_IOPAD(0x150, PIN_OFF_OUTPUT_LOW | PIN_INPUT | MUX_MODE3)
496
497 /* status0 0x4a10007e gpmc_clk.gpio_55 b22 */
498 OMAP4_IOPAD(0x07e, PIN_INPUT | MUX_MODE3)
499
500 /* status1 0x4a10007a gpmc_ncs3.gpio_53 c22 */
501 OMAP4_IOPAD(0x07a, PIN_INPUT | MUX_MODE3)
502
503 /* status2 0x4a100078 gpmc_ncs2.gpio_52 d21 */
504 OMAP4_IOPAD(0x078, PIN_INPUT | MUX_MODE3)
505
506 /* cmd0 0x4a100094 gpmc_ncs6.gpio_103 c24 */
507 OMAP4_IOPAD(0x094, PIN_OUTPUT | MUX_MODE3)
508
509 /* cmd1 0x4a100096 gpmc_ncs7.gpio_104 d24 */
510 OMAP4_IOPAD(0x096, PIN_OUTPUT | MUX_MODE3)
511
512 /* cmd2 0x4a100142 uart3_rts_sd.gpio_142 f28 */
513 OMAP4_IOPAD(0x142, PIN_OUTPUT | MUX_MODE3)
514 >;
515 };
516
448 usb_ulpi_pins: pinmux_usb_ulpi_pins { 517 usb_ulpi_pins: pinmux_usb_ulpi_pins {
449 pinctrl-single,pins = < 518 pinctrl-single,pins = <
450 OMAP4_IOPAD(0x196, MUX_MODE7) 519 OMAP4_IOPAD(0x196, MUX_MODE7)
@@ -484,6 +553,28 @@
484 >; 553 >;
485 }; 554 };
486 555
556 /*
557 * Note that the v3.0.8 stock userspace dynamically remuxes uart1
558 * rts pin probably for PM purposes to PIN_INPUT_PULLUP | MUX_MODE7
559 * when not used. If needed, we can add rts pin remux later based
560 * on power measurements.
561 */
562 uart1_pins: pinmux_uart1_pins {
563 pinctrl-single,pins = <
564 /* 0x4a10013c mcspi1_cs2.uart1_cts ag23 */
565 OMAP4_IOPAD(0x13c, PIN_INPUT_PULLUP | MUX_MODE1)
566
567 /* 0x4a10013e mcspi1_cs3.uart1_rts ah23 */
568 OMAP4_IOPAD(0x13e, MUX_MODE1)
569
570 /* 0x4a100140 uart3_cts_rctx.uart1_tx f27 */
571 OMAP4_IOPAD(0x140, PIN_OUTPUT | MUX_MODE1)
572
573 /* 0x4a1001ca dpm_emu14.uart1_rx aa3 */
574 OMAP4_IOPAD(0x1ca, PIN_INPUT_PULLUP | MUX_MODE2)
575 >;
576 };
577
487 /* uart3_tx_irtx and uart3_rx_irrx */ 578 /* uart3_tx_irtx and uart3_rx_irrx */
488 uart3_pins: pinmux_uart3_pins { 579 uart3_pins: pinmux_uart3_pins {
489 pinctrl-single,pins = < 580 pinctrl-single,pins = <
@@ -512,6 +603,24 @@
512 OMAP4_IOPAD(0x112, PIN_OUTPUT_PULLUP | MUX_MODE5) /* uart4_rts */ 603 OMAP4_IOPAD(0x112, PIN_OUTPUT_PULLUP | MUX_MODE5) /* uart4_rts */
513 >; 604 >;
514 }; 605 };
606
607 mcbsp2_pins: pinmux_mcbsp2_pins {
608 pinctrl-single,pins = <
609 OMAP4_IOPAD(0x0f6, PIN_INPUT | MUX_MODE0) /* abe_mcbsp2_clkx */
610 OMAP4_IOPAD(0x0f8, PIN_INPUT | MUX_MODE0) /* abe_mcbsp2_dr */
611 OMAP4_IOPAD(0x0fa, PIN_OUTPUT | MUX_MODE0) /* abe_mcbsp2_dx */
612 OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0) /* abe_mcbsp2_fsx */
613 >;
614 };
615
616 mcbsp3_pins: pinmux_mcbsp3_pins {
617 pinctrl-single,pins = <
618 OMAP4_IOPAD(0x106, PIN_INPUT | MUX_MODE1) /* abe_mcbsp3_dr */
619 OMAP4_IOPAD(0x108, PIN_OUTPUT | MUX_MODE1) /* abe_mcbsp3_dx */
620 OMAP4_IOPAD(0x10a, PIN_INPUT | MUX_MODE1) /* abe_mcbsp3_clkx */
621 OMAP4_IOPAD(0x10c, PIN_INPUT | MUX_MODE1) /* abe_mcbsp3_fsx */
622 >;
623 };
515}; 624};
516 625
517&omap4_pmx_wkup { 626&omap4_pmx_wkup {
@@ -535,6 +644,17 @@
535 }; 644 };
536}; 645};
537 646
647/*
648 * As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for
649 * uart1 wakeirq.
650 */
651&uart1 {
652 pinctrl-names = "default";
653 pinctrl-0 = <&uart1_pins>;
654 interrupts-extended = <&wakeupgen GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH
655 &omap4_pmx_core 0xfc>;
656};
657
538&uart3 { 658&uart3 {
539 interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH 659 interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH
540 &omap4_pmx_core 0x17c>; 660 &omap4_pmx_core 0x17c>;
@@ -551,8 +671,13 @@
551 }; 671 };
552}; 672};
553 673
674&usbhsohci {
675 phys = <&fsusb1_phy>;
676 phy-names = "usb";
677};
678
554&usbhsehci { 679&usbhsehci {
555 phys = <&hsusb1_phy>; 680 phys = <&hsusb2_phy>;
556}; 681};
557 682
558&usbhshost { 683&usbhshost {
@@ -597,3 +722,43 @@
597 "0", "0", "1"; 722 "0", "0", "1";
598 }; 723 };
599}; 724};
725
726&mcbsp2 {
727 #sound-dai-cells = <0>;
728 pinctrl-names = "default";
729 pinctrl-0 = <&mcbsp2_pins>;
730 status = "okay";
731
732 mcbsp2_port: port {
733 cpu_dai2: endpoint {
734 dai-format = "i2s";
735 remote-endpoint = <&cpcap_audio_codec0>;
736 frame-master = <&cpcap_audio_codec0>;
737 bitclock-master = <&cpcap_audio_codec0>;
738 };
739 };
740};
741
742&mcbsp3 {
743 #sound-dai-cells = <0>;
744 pinctrl-names = "default";
745 pinctrl-0 = <&mcbsp3_pins>;
746 status = "okay";
747
748 mcbsp3_port: port {
749 cpu_dai3: endpoint {
750 dai-format = "dsp_a";
751 frame-master = <&cpcap_audio_codec1>;
752 bitclock-master = <&cpcap_audio_codec1>;
753 remote-endpoint = <&cpcap_audio_codec1>;
754 };
755 };
756};
757
758&cpcap_audio_codec0 {
759 remote-endpoint = <&cpu_dai2>;
760};
761
762&cpcap_audio_codec1 {
763 remote-endpoint = <&cpu_dai3>;
764};
diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 03c8ad91ddac..cbcdcb4e7d1c 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -24,8 +24,6 @@
24 clock-latency = <300000>; /* From legacy driver */ 24 clock-latency = <300000>; /* From legacy driver */
25 25
26 /* cooling options */ 26 /* cooling options */
27 cooling-min-level = <0>;
28 cooling-max-level = <3>;
29 #cooling-cells = <2>; /* min followed by max */ 27 #cooling-cells = <2>; /* min followed by max */
30 }; 28 };
31 }; 29 };
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index c43f2a2d0a1e..ad97493e4e46 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -22,8 +22,6 @@
22 clock-latency = <300000>; /* From legacy driver */ 22 clock-latency = <300000>; /* From legacy driver */
23 23
24 /* cooling options */ 24 /* cooling options */
25 cooling-min-level = <0>;
26 cooling-max-level = <2>;
27 #cooling-cells = <2>; /* min followed by max */ 25 #cooling-cells = <2>; /* min followed by max */
28 }; 26 };
29 }; 27 };
diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi b/arch/arm/boot/dts/omap5-board-common.dtsi
index 1b20838bb9a4..3b2244560c28 100644
--- a/arch/arm/boot/dts/omap5-board-common.dtsi
+++ b/arch/arm/boot/dts/omap5-board-common.dtsi
@@ -659,8 +659,8 @@
659 v2v1-supply = <&smps9_reg>; 659 v2v1-supply = <&smps9_reg>;
660 enable-active-high; 660 enable-active-high;
661 661
662 clocks = <&clk32kgaudio>; 662 clocks = <&clk32kgaudio>, <&fref_xtal_ck>;
663 clock-names = "clk32k"; 663 clock-names = "clk32k", "mclk";
664 }; 664 };
665}; 665};
666 666
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index ec2c8baef62a..592e17fd4eeb 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -47,7 +47,7 @@
47 gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; /* gpio3_83 */ 47 gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; /* gpio3_83 */
48 wakeup-source; 48 wakeup-source;
49 autorepeat; 49 autorepeat;
50 debounce_interval = <50>; 50 debounce-interval = <50>;
51 }; 51 };
52 }; 52 };
53 53
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 35d4298da83d..732b61a0e990 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -55,8 +55,6 @@
55 clock-latency = <300000>; /* From omap-cpufreq driver */ 55 clock-latency = <300000>; /* From omap-cpufreq driver */
56 56
57 /* cooling options */ 57 /* cooling options */
58 cooling-min-level = <0>;
59 cooling-max-level = <2>;
60 #cooling-cells = <2>; /* min followed by max */ 58 #cooling-cells = <2>; /* min followed by max */
61 }; 59 };
62 cpu@1 { 60 cpu@1 {
@@ -289,6 +287,28 @@
289 pinctrl-single,register-width = <16>; 287 pinctrl-single,register-width = <16>;
290 pinctrl-single,function-mask = <0x7fff>; 288 pinctrl-single,function-mask = <0x7fff>;
291 }; 289 };
290
291 omap5_scm_wkup_pad_conf: omap5_scm_wkup_pad_conf@cda0 {
292 compatible = "ti,omap5-scm-wkup-pad-conf",
293 "simple-bus";
294 reg = <0xcda0 0x60>;
295 #address-cells = <1>;
296 #size-cells = <1>;
297 ranges = <0 0xcda0 0x60>;
298
299 scm_wkup_pad_conf: scm_conf@0 {
300 compatible = "syscon", "simple-bus";
301 reg = <0x0 0x60>;
302 #address-cells = <1>;
303 #size-cells = <1>;
304 ranges = <0 0x0 0x60>;
305
306 scm_wkup_pad_conf_clocks: clocks@0 {
307 #address-cells = <1>;
308 #size-cells = <0>;
309 };
310 };
311 };
292 }; 312 };
293 313
294 ocmcram: ocmcram@40300000 { 314 ocmcram: ocmcram@40300000 {
diff --git a/arch/arm/boot/dts/omap54xx-clocks.dtsi b/arch/arm/boot/dts/omap54xx-clocks.dtsi
index 9619a746d657..ecc5573d264c 100644
--- a/arch/arm/boot/dts/omap54xx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap54xx-clocks.dtsi
@@ -1179,3 +1179,13 @@
1179 }; 1179 };
1180 }; 1180 };
1181}; 1181};
1182
1183&scm_wkup_pad_conf_clocks {
1184 fref_xtal_ck: fref_xtal_ck {
1185 #clock-cells = <0>;
1186 compatible = "ti,gate-clock";
1187 clocks = <&sys_clkin>;
1188 ti,bit-shift = <28>;
1189 reg = <0x14>;
1190 };
1191};
diff --git a/arch/arm/boot/dts/orion5x-lacie-d2-network.dts b/arch/arm/boot/dts/orion5x-lacie-d2-network.dts
index c701e8d16bbb..8c2449da6f00 100644
--- a/arch/arm/boot/dts/orion5x-lacie-d2-network.dts
+++ b/arch/arm/boot/dts/orion5x-lacie-d2-network.dts
@@ -24,7 +24,7 @@
24 24
25 chosen { 25 chosen {
26 bootargs = "console=ttyS0,115200n8 earlyprintk"; 26 bootargs = "console=ttyS0,115200n8 earlyprintk";
27 linux,stdout-path = &uart0; 27 stdout-path = &uart0;
28 }; 28 };
29 29
30 soc { 30 soc {
diff --git a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
index 89ff404a528c..b545d0f228a5 100644
--- a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
+++ b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
@@ -30,7 +30,7 @@
30 30
31 chosen { 31 chosen {
32 bootargs = "console=ttyS0,115200n8 earlyprintk"; 32 bootargs = "console=ttyS0,115200n8 earlyprintk";
33 linux,stdout-path = &uart0; 33 stdout-path = &uart0;
34 }; 34 };
35 35
36 soc { 36 soc {
diff --git a/arch/arm/boot/dts/orion5x-linkstation.dtsi b/arch/arm/boot/dts/orion5x-linkstation.dtsi
index e9991c83d7b7..ebd93df5d07a 100644
--- a/arch/arm/boot/dts/orion5x-linkstation.dtsi
+++ b/arch/arm/boot/dts/orion5x-linkstation.dtsi
@@ -48,7 +48,7 @@
48/ { 48/ {
49 chosen { 49 chosen {
50 bootargs = "console=ttyS0,115200n8 earlyprintk"; 50 bootargs = "console=ttyS0,115200n8 earlyprintk";
51 linux,stdout-path = &uart0; 51 stdout-path = &uart0;
52 }; 52 };
53 53
54 soc { 54 soc {
diff --git a/arch/arm/boot/dts/orion5x-lswsgl.dts b/arch/arm/boot/dts/orion5x-lswsgl.dts
index ea966ec03dd0..0d97ded66257 100644
--- a/arch/arm/boot/dts/orion5x-lswsgl.dts
+++ b/arch/arm/boot/dts/orion5x-lswsgl.dts
@@ -60,7 +60,7 @@
60 60
61 chosen { 61 chosen {
62 bootargs = "console=ttyS0,115200 earlyprintk"; 62 bootargs = "console=ttyS0,115200 earlyprintk";
63 linux,stdout-path = &uart0; 63 stdout-path = &uart0;
64 }; 64 };
65 65
66 soc { 66 soc {
diff --git a/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts b/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts
index ff3484904294..0324cb54939d 100644
--- a/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts
+++ b/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts
@@ -24,7 +24,7 @@
24 24
25 chosen { 25 chosen {
26 bootargs = "console=ttyS0,115200n8 earlyprintk"; 26 bootargs = "console=ttyS0,115200n8 earlyprintk";
27 linux,stdout-path = &uart0; 27 stdout-path = &uart0;
28 }; 28 };
29 29
30 soc { 30 soc {
diff --git a/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts b/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts
index 6fb052507b36..d1817af53e0b 100644
--- a/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts
+++ b/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts
@@ -21,7 +21,7 @@
21 21
22 chosen { 22 chosen {
23 bootargs = "console=ttyS0,115200n8 earlyprintk"; 23 bootargs = "console=ttyS0,115200n8 earlyprintk";
24 linux,stdout-path = &uart0; 24 stdout-path = &uart0;
25 }; 25 };
26 26
27 soc { 27 soc {
diff --git a/arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts b/arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts
index 1297414dd649..0c9729306089 100644
--- a/arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts
+++ b/arch/arm/boot/dts/picoxcell-pc7302-pc3x2.dts
@@ -23,7 +23,7 @@
23 }; 23 };
24 24
25 chosen { 25 chosen {
26 linux,stdout-path = &uart0; 26 stdout-path = &uart0;
27 }; 27 };
28 28
29 clocks { 29 clocks {
diff --git a/arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts b/arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts
index 9e317a4f431c..86f26715b619 100644
--- a/arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts
+++ b/arch/arm/boot/dts/picoxcell-pc7302-pc3x3.dts
@@ -23,7 +23,7 @@
23 }; 23 };
24 24
25 chosen { 25 chosen {
26 linux,stdout-path = &uart0; 26 stdout-path = &uart0;
27 }; 27 };
28 28
29 clocks { 29 clocks {
diff --git a/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts b/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts
index b818ebce0978..209eb21cea00 100644
--- a/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts
+++ b/arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts
@@ -133,7 +133,7 @@
133 clock-frequency = <200000>; 133 clock-frequency = <200000>;
134 134
135 eeprom@50 { 135 eeprom@50 {
136 compatible = "24c02"; 136 compatible = "atmel,24c02";
137 reg = <0x50>; 137 reg = <0x50>;
138 pagesize = <32>; 138 pagesize = <32>;
139 }; 139 };
diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
index 3ca96e361878..5341a39c0392 100644
--- a/arch/arm/boot/dts/qcom-apq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
@@ -316,6 +316,23 @@
316 }; 316 };
317 }; 317 };
318 318
319
320 /*
321 * These channels from the ADC are simply hardware monitors.
322 * That is why the ADC is referred to as "HKADC" - HouseKeeping
323 * ADC.
324 */
325 iio-hwmon {
326 compatible = "iio-hwmon";
327 io-channels = <&xoadc 0x00 0x01>, /* Battery */
328 <&xoadc 0x00 0x02>, /* DC in (charger) */
329 <&xoadc 0x00 0x04>, /* VPH the main system voltage */
330 <&xoadc 0x00 0x0b>, /* Die temperature */
331 <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */
332 <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */
333 <&xoadc 0x00 0x0e>; /* Charger temperature */
334 };
335
319 soc: soc { 336 soc: soc {
320 #address-cells = <1>; 337 #address-cells = <1>;
321 #size-cells = <1>; 338 #size-cells = <1>;
@@ -770,6 +787,52 @@
770 debounce = <15625>; 787 debounce = <15625>;
771 pull-up; 788 pull-up;
772 }; 789 };
790
791 xoadc: xoadc@197 {
792 compatible = "qcom,pm8921-adc";
793 reg = <197>;
794 interrupts-extended = <&pmicintc 78 IRQ_TYPE_EDGE_RISING>;
795 #address-cells = <2>;
796 #size-cells = <0>;
797 #io-channel-cells = <2>;
798
799 vcoin: adc-channel@00 {
800 reg = <0x00 0x00>;
801 };
802 vbat: adc-channel@01 {
803 reg = <0x00 0x01>;
804 };
805 dcin: adc-channel@02 {
806 reg = <0x00 0x02>;
807 };
808 vph_pwr: adc-channel@04 {
809 reg = <0x00 0x04>;
810 };
811 batt_therm: adc-channel@08 {
812 reg = <0x00 0x08>;
813 };
814 batt_id: adc-channel@09 {
815 reg = <0x00 0x09>;
816 };
817 usb_vbus: adc-channel@0a {
818 reg = <0x00 0x0a>;
819 };
820 die_temp: adc-channel@0b {
821 reg = <0x00 0x0b>;
822 };
823 ref_625mv: adc-channel@0c {
824 reg = <0x00 0x0c>;
825 };
826 ref_1250mv: adc-channel@0d {
827 reg = <0x00 0x0d>;
828 };
829 chg_temp: adc-channel@0e {
830 reg = <0x00 0x0e>;
831 };
832 ref_muxoff: adc-channel@0f {
833 reg = <0x00 0x0f>;
834 };
835 };
773 }; 836 };
774 }; 837 };
775 838
diff --git a/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
new file mode 100644
index 000000000000..eaa1001d0a46
--- /dev/null
+++ b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
@@ -0,0 +1,24 @@
1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-msm8974pro.dtsi"
3#include "qcom-pm8841.dtsi"
4#include "qcom-pm8941.dtsi"
5
6/ {
7 model = "Samsung Galaxy S5";
8 compatible = "samsung,klte", "qcom,msm8974";
9
10 aliases {
11 serial0 = &blsp1_uart1;
12 };
13
14 chosen {
15 stdout-path = "serial0:115200n8";
16 };
17};
18
19&soc {
20 serial@f991e000 {
21 status = "ok";
22 };
23
24};
diff --git a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts
index e87f2c99060d..701b396719c7 100644
--- a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-castor.dts
@@ -491,7 +491,7 @@
491 pinctrl-0 = <&i2c8_pins>; 491 pinctrl-0 = <&i2c8_pins>;
492 492
493 synaptics@2c { 493 synaptics@2c {
494 compatible = "syna,rmi-i2c"; 494 compatible = "syna,rmi4-i2c";
495 reg = <0x2c>; 495 reg = <0x2c>;
496 496
497 interrupt-parent = <&msmgpio>; 497 interrupt-parent = <&msmgpio>;
@@ -506,6 +506,8 @@
506 pinctrl-names = "default"; 506 pinctrl-names = "default";
507 pinctrl-0 = <&ts_int_pin>; 507 pinctrl-0 = <&ts_int_pin>;
508 508
509 syna,startup-delay-ms = <10>;
510
509 rmi-f01@1 { 511 rmi-f01@1 {
510 reg = <0x1>; 512 reg = <0x1>;
511 syna,nosleep = <1>; 513 syna,nosleep = <1>;
diff --git a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
index 75a8ca571846..1d3e9503c5bd 100644
--- a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
+++ b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
@@ -34,6 +34,10 @@
34 }; 34 };
35}; 35};
36 36
37&cmt0 {
38 status = "okay";
39};
40
37&extal_clk { 41&extal_clk {
38 clock-frequency = <20000000>; 42 clock-frequency = <20000000>;
39}; 43};
diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index 0b74c6c7d21d..1d9073ba0ce0 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -141,29 +141,6 @@
141 #size-cells = <2>; 141 #size-cells = <2>;
142 ranges; 142 ranges;
143 143
144 apmu@e6152000 {
145 compatible = "renesas,r8a7743-apmu", "renesas,apmu";
146 reg = <0 0xe6152000 0 0x188>;
147 cpus = <&cpu0 &cpu1>;
148 };
149
150 gic: interrupt-controller@f1001000 {
151 compatible = "arm,gic-400";
152 #interrupt-cells = <3>;
153 #address-cells = <0>;
154 interrupt-controller;
155 reg = <0 0xf1001000 0 0x1000>,
156 <0 0xf1002000 0 0x2000>,
157 <0 0xf1004000 0 0x2000>,
158 <0 0xf1006000 0 0x2000>;
159 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
160 IRQ_TYPE_LEVEL_HIGH)>;
161 clocks = <&cpg CPG_MOD 408>;
162 clock-names = "clk";
163 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
164 resets = <&cpg 408>;
165 };
166
167 gpio0: gpio@e6050000 { 144 gpio0: gpio@e6050000 {
168 compatible = "renesas,gpio-r8a7743", 145 compatible = "renesas,gpio-r8a7743",
169 "renesas,rcar-gen2-gpio"; 146 "renesas,rcar-gen2-gpio";
@@ -284,6 +261,48 @@
284 resets = <&cpg 904>; 261 resets = <&cpg 904>;
285 }; 262 };
286 263
264 pfc: pin-controller@e6060000 {
265 compatible = "renesas,pfc-r8a7743";
266 reg = <0 0xe6060000 0 0x250>;
267 };
268
269 tpu: pwm@e60f0000 {
270 compatible = "renesas,tpu-r8a7743", "renesas,tpu";
271 reg = <0 0xe60f0000 0 0x148>;
272 clocks = <&cpg CPG_MOD 304>;
273 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
274 resets = <&cpg 304>;
275 #pwm-cells = <3>;
276 status = "disabled";
277 };
278
279 cpg: clock-controller@e6150000 {
280 compatible = "renesas,r8a7743-cpg-mssr";
281 reg = <0 0xe6150000 0 0x1000>;
282 clocks = <&extal_clk>, <&usb_extal_clk>;
283 clock-names = "extal", "usb_extal";
284 #clock-cells = <2>;
285 #power-domain-cells = <0>;
286 #reset-cells = <1>;
287 };
288
289 apmu@e6152000 {
290 compatible = "renesas,r8a7743-apmu", "renesas,apmu";
291 reg = <0 0xe6152000 0 0x188>;
292 cpus = <&cpu0 &cpu1>;
293 };
294
295 rst: reset-controller@e6160000 {
296 compatible = "renesas,r8a7743-rst";
297 reg = <0 0xe6160000 0 0x100>;
298 };
299
300 sysc: system-controller@e6180000 {
301 compatible = "renesas,r8a7743-sysc";
302 reg = <0 0xe6180000 0 0x200>;
303 #power-domain-cells = <1>;
304 };
305
287 irqc: interrupt-controller@e61c0000 { 306 irqc: interrupt-controller@e61c0000 {
288 compatible = "renesas,irqc-r8a7743", "renesas,irqc"; 307 compatible = "renesas,irqc-r8a7743", "renesas,irqc";
289 #interrupt-cells = <2>; 308 #interrupt-cells = <2>;
@@ -316,227 +335,89 @@
316 #thermal-sensor-cells = <0>; 335 #thermal-sensor-cells = <0>;
317 }; 336 };
318 337
319 cmt0: timer@ffca0000 { 338 ipmmu_sy0: mmu@e6280000 {
320 compatible = "renesas,r8a7743-cmt0", 339 compatible = "renesas,ipmmu-r8a7743",
321 "renesas,rcar-gen2-cmt0"; 340 "renesas,ipmmu-vmsa";
322 reg = <0 0xffca0000 0 0x1004>; 341 reg = <0 0xe6280000 0 0x1000>;
323 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 342 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
324 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 343 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
325 clocks = <&cpg CPG_MOD 124>; 344 #iommu-cells = <1>;
326 clock-names = "fck";
327 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
328 resets = <&cpg 124>;
329 status = "disabled"; 345 status = "disabled";
330 }; 346 };
331 347
332 cmt1: timer@e6130000 { 348 ipmmu_sy1: mmu@e6290000 {
333 compatible = "renesas,r8a7743-cmt1", 349 compatible = "renesas,ipmmu-r8a7743",
334 "renesas,rcar-gen2-cmt1"; 350 "renesas,ipmmu-vmsa";
335 reg = <0 0xe6130000 0 0x1004>; 351 reg = <0 0xe6290000 0 0x1000>;
336 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 352 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
337 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 353 #iommu-cells = <1>;
338 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
339 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
340 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
341 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
342 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
343 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
344 clocks = <&cpg CPG_MOD 329>;
345 clock-names = "fck";
346 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
347 resets = <&cpg 329>;
348 status = "disabled"; 354 status = "disabled";
349 }; 355 };
350 356
351 cpg: clock-controller@e6150000 { 357 ipmmu_ds: mmu@e6740000 {
352 compatible = "renesas,r8a7743-cpg-mssr"; 358 compatible = "renesas,ipmmu-r8a7743",
353 reg = <0 0xe6150000 0 0x1000>; 359 "renesas,ipmmu-vmsa";
354 clocks = <&extal_clk>, <&usb_extal_clk>; 360 reg = <0 0xe6740000 0 0x1000>;
355 clock-names = "extal", "usb_extal"; 361 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
356 #clock-cells = <2>; 362 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
357 #power-domain-cells = <0>; 363 #iommu-cells = <1>;
358 #reset-cells = <1>; 364 status = "disabled";
359 };
360
361 prr: chipid@ff000044 {
362 compatible = "renesas,prr";
363 reg = <0 0xff000044 0 4>;
364 };
365
366 rst: reset-controller@e6160000 {
367 compatible = "renesas,r8a7743-rst";
368 reg = <0 0xe6160000 0 0x100>;
369 };
370
371 sysc: system-controller@e6180000 {
372 compatible = "renesas,r8a7743-sysc";
373 reg = <0 0xe6180000 0 0x200>;
374 #power-domain-cells = <1>;
375 }; 365 };
376 366
377 pfc: pin-controller@e6060000 { 367 ipmmu_mp: mmu@ec680000 {
378 compatible = "renesas,pfc-r8a7743"; 368 compatible = "renesas,ipmmu-r8a7743",
379 reg = <0 0xe6060000 0 0x250>; 369 "renesas,ipmmu-vmsa";
370 reg = <0 0xec680000 0 0x1000>;
371 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
372 #iommu-cells = <1>;
373 status = "disabled";
380 }; 374 };
381 375
382 dmac0: dma-controller@e6700000 { 376 ipmmu_mx: mmu@fe951000 {
383 compatible = "renesas,dmac-r8a7743", 377 compatible = "renesas,ipmmu-r8a7743",
384 "renesas,rcar-dmac"; 378 "renesas,ipmmu-vmsa";
385 reg = <0 0xe6700000 0 0x20000>; 379 reg = <0 0xfe951000 0 0x1000>;
386 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH 380 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
387 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH 381 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
388 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH 382 #iommu-cells = <1>;
389 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH 383 status = "disabled";
390 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
391 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
392 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
393 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
394 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
395 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
396 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
397 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
398 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
399 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
400 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
401 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
402 interrupt-names = "error",
403 "ch0", "ch1", "ch2", "ch3",
404 "ch4", "ch5", "ch6", "ch7",
405 "ch8", "ch9", "ch10", "ch11",
406 "ch12", "ch13", "ch14";
407 clocks = <&cpg CPG_MOD 219>;
408 clock-names = "fck";
409 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
410 resets = <&cpg 219>;
411 #dma-cells = <1>;
412 dma-channels = <15>;
413 }; 384 };
414 385
415 dmac1: dma-controller@e6720000 { 386 ipmmu_gp: mmu@e62a0000 {
416 compatible = "renesas,dmac-r8a7743", 387 compatible = "renesas,ipmmu-r8a7743",
417 "renesas,rcar-dmac"; 388 "renesas,ipmmu-vmsa";
418 reg = <0 0xe6720000 0 0x20000>; 389 reg = <0 0xe62a0000 0 0x1000>;
419 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH 390 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
420 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH 391 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
421 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH 392 #iommu-cells = <1>;
422 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH 393 status = "disabled";
423 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
424 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
425 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
426 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
427 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
428 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
429 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
430 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
431 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
432 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
433 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
434 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
435 interrupt-names = "error",
436 "ch0", "ch1", "ch2", "ch3",
437 "ch4", "ch5", "ch6", "ch7",
438 "ch8", "ch9", "ch10", "ch11",
439 "ch12", "ch13", "ch14";
440 clocks = <&cpg CPG_MOD 218>;
441 clock-names = "fck";
442 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
443 resets = <&cpg 218>;
444 #dma-cells = <1>;
445 dma-channels = <15>;
446 }; 394 };
447 395
448 audma0: dma-controller@ec700000 { 396 icram0: sram@e63a0000 {
449 compatible = "renesas,dmac-r8a7743", 397 compatible = "mmio-sram";
450 "renesas,rcar-dmac"; 398 reg = <0 0xe63a0000 0 0x12000>;
451 reg = <0 0xec700000 0 0x10000>;
452 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
453 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
454 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
455 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
456 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
457 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
458 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
459 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
460 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
461 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
462 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
463 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
464 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
465 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
466 interrupt-names = "error",
467 "ch0", "ch1", "ch2", "ch3",
468 "ch4", "ch5", "ch6", "ch7",
469 "ch8", "ch9", "ch10", "ch11",
470 "ch12";
471 clocks = <&cpg CPG_MOD 502>;
472 clock-names = "fck";
473 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
474 resets = <&cpg 502>;
475 #dma-cells = <1>;
476 dma-channels = <13>;
477 }; 399 };
478 400
479 audma1: dma-controller@ec720000 { 401 icram1: sram@e63c0000 {
480 compatible = "renesas,dmac-r8a7743", 402 compatible = "mmio-sram";
481 "renesas,rcar-dmac"; 403 reg = <0 0xe63c0000 0 0x1000>;
482 reg = <0 0xec720000 0 0x10000>; 404 #address-cells = <1>;
483 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH 405 #size-cells = <1>;
484 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH 406 ranges = <0 0 0xe63c0000 0x1000>;
485 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
486 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
487 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
488 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
489 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
490 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
491 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
492 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
493 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
494 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
495 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
496 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
497 interrupt-names = "error",
498 "ch0", "ch1", "ch2", "ch3",
499 "ch4", "ch5", "ch6", "ch7",
500 "ch8", "ch9", "ch10", "ch11",
501 "ch12";
502 clocks = <&cpg CPG_MOD 501>;
503 clock-names = "fck";
504 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
505 resets = <&cpg 501>;
506 #dma-cells = <1>;
507 dma-channels = <13>;
508 };
509 407
510 usb_dmac0: dma-controller@e65a0000 { 408 smp-sram@0 {
511 compatible = "renesas,r8a7743-usb-dmac", 409 compatible = "renesas,smp-sram";
512 "renesas,usb-dmac"; 410 reg = <0 0x10>;
513 reg = <0 0xe65a0000 0 0x100>; 411 };
514 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
515 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
516 interrupt-names = "ch0", "ch1";
517 clocks = <&cpg CPG_MOD 330>;
518 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
519 resets = <&cpg 330>;
520 #dma-cells = <1>;
521 dma-channels = <2>;
522 }; 412 };
523 413
524 usb_dmac1: dma-controller@e65b0000 { 414 icram2: sram@e6300000 {
525 compatible = "renesas,r8a7743-usb-dmac", 415 compatible = "mmio-sram";
526 "renesas,usb-dmac"; 416 reg = <0 0xe6300000 0 0x40000>;
527 reg = <0 0xe65b0000 0 0x100>;
528 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
529 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
530 interrupt-names = "ch0", "ch1";
531 clocks = <&cpg CPG_MOD 331>;
532 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
533 resets = <&cpg 331>;
534 #dma-cells = <1>;
535 dma-channels = <2>;
536 }; 417 };
537 418
538 /* The memory map in the User's Manual maps the cores to bus 419 /* The memory map in the User's Manual maps the cores to
539 * numbers 420 * bus numbers
540 */ 421 */
541 i2c0: i2c@e6508000 { 422 i2c0: i2c@e6508000 {
542 #address-cells = <1>; 423 #address-cells = <1>;
@@ -675,6 +556,168 @@
675 status = "disabled"; 556 status = "disabled";
676 }; 557 };
677 558
559 hsusb: usb@e6590000 {
560 compatible = "renesas,usbhs-r8a7743",
561 "renesas,rcar-gen2-usbhs";
562 reg = <0 0xe6590000 0 0x100>;
563 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
564 clocks = <&cpg CPG_MOD 704>;
565 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
566 <&usb_dmac1 0>, <&usb_dmac1 1>;
567 dma-names = "ch0", "ch1", "ch2", "ch3";
568 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
569 resets = <&cpg 704>;
570 renesas,buswait = <4>;
571 phys = <&usb0 1>;
572 phy-names = "usb";
573 status = "disabled";
574 };
575
576 usbphy: usb-phy@e6590100 {
577 compatible = "renesas,usb-phy-r8a7743",
578 "renesas,rcar-gen2-usb-phy";
579 reg = <0 0xe6590100 0 0x100>;
580 #address-cells = <1>;
581 #size-cells = <0>;
582 clocks = <&cpg CPG_MOD 704>;
583 clock-names = "usbhs";
584 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
585 resets = <&cpg 704>;
586 status = "disabled";
587
588 usb0: usb-channel@0 {
589 reg = <0>;
590 #phy-cells = <1>;
591 };
592 usb2: usb-channel@2 {
593 reg = <2>;
594 #phy-cells = <1>;
595 };
596 };
597
598 usb_dmac0: dma-controller@e65a0000 {
599 compatible = "renesas,r8a7743-usb-dmac",
600 "renesas,usb-dmac";
601 reg = <0 0xe65a0000 0 0x100>;
602 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
603 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
604 interrupt-names = "ch0", "ch1";
605 clocks = <&cpg CPG_MOD 330>;
606 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
607 resets = <&cpg 330>;
608 #dma-cells = <1>;
609 dma-channels = <2>;
610 };
611
612 usb_dmac1: dma-controller@e65b0000 {
613 compatible = "renesas,r8a7743-usb-dmac",
614 "renesas,usb-dmac";
615 reg = <0 0xe65b0000 0 0x100>;
616 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
617 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
618 interrupt-names = "ch0", "ch1";
619 clocks = <&cpg CPG_MOD 331>;
620 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
621 resets = <&cpg 331>;
622 #dma-cells = <1>;
623 dma-channels = <2>;
624 };
625
626 dmac0: dma-controller@e6700000 {
627 compatible = "renesas,dmac-r8a7743",
628 "renesas,rcar-dmac";
629 reg = <0 0xe6700000 0 0x20000>;
630 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH
631 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
632 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
633 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
634 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
635 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
636 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
637 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
638 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
639 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
640 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
641 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
642 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
643 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
644 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
645 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
646 interrupt-names = "error",
647 "ch0", "ch1", "ch2", "ch3",
648 "ch4", "ch5", "ch6", "ch7",
649 "ch8", "ch9", "ch10", "ch11",
650 "ch12", "ch13", "ch14";
651 clocks = <&cpg CPG_MOD 219>;
652 clock-names = "fck";
653 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
654 resets = <&cpg 219>;
655 #dma-cells = <1>;
656 dma-channels = <15>;
657 };
658
659 dmac1: dma-controller@e6720000 {
660 compatible = "renesas,dmac-r8a7743",
661 "renesas,rcar-dmac";
662 reg = <0 0xe6720000 0 0x20000>;
663 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
664 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
665 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
666 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
667 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
668 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
669 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
670 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
671 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
672 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
673 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
674 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
675 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
676 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
677 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
678 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
679 interrupt-names = "error",
680 "ch0", "ch1", "ch2", "ch3",
681 "ch4", "ch5", "ch6", "ch7",
682 "ch8", "ch9", "ch10", "ch11",
683 "ch12", "ch13", "ch14";
684 clocks = <&cpg CPG_MOD 218>;
685 clock-names = "fck";
686 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
687 resets = <&cpg 218>;
688 #dma-cells = <1>;
689 dma-channels = <15>;
690 };
691
692 avb: ethernet@e6800000 {
693 compatible = "renesas,etheravb-r8a7743",
694 "renesas,etheravb-rcar-gen2";
695 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
696 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
697 clocks = <&cpg CPG_MOD 812>;
698 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
699 resets = <&cpg 812>;
700 #address-cells = <1>;
701 #size-cells = <0>;
702 status = "disabled";
703 };
704
705 qspi: spi@e6b10000 {
706 compatible = "renesas,qspi-r8a7743", "renesas,qspi";
707 reg = <0 0xe6b10000 0 0x2c>;
708 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
709 clocks = <&cpg CPG_MOD 917>;
710 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
711 <&dmac1 0x17>, <&dmac1 0x18>;
712 dma-names = "tx", "rx", "tx", "rx";
713 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
714 num-cs = <1>;
715 #address-cells = <1>;
716 #size-cells = <0>;
717 resets = <&cpg 917>;
718 status = "disabled";
719 };
720
678 scifa0: serial@e6c40000 { 721 scifa0: serial@e6c40000 {
679 compatible = "renesas,scifa-r8a7743", 722 compatible = "renesas,scifa-r8a7743",
680 "renesas,rcar-gen2-scifa", "renesas,scifa"; 723 "renesas,rcar-gen2-scifa", "renesas,scifa";
@@ -954,88 +997,6 @@
954 status = "disabled"; 997 status = "disabled";
955 }; 998 };
956 999
957 icram2: sram@e6300000 {
958 compatible = "mmio-sram";
959 reg = <0 0xe6300000 0 0x40000>;
960 };
961
962 icram0: sram@e63a0000 {
963 compatible = "mmio-sram";
964 reg = <0 0xe63a0000 0 0x12000>;
965 };
966
967 icram1: sram@e63c0000 {
968 compatible = "mmio-sram";
969 reg = <0 0xe63c0000 0 0x1000>;
970 #address-cells = <1>;
971 #size-cells = <1>;
972 ranges = <0 0 0xe63c0000 0x1000>;
973
974 smp-sram@0 {
975 compatible = "renesas,smp-sram";
976 reg = <0 0x10>;
977 };
978 };
979
980 ether: ethernet@ee700000 {
981 compatible = "renesas,ether-r8a7743",
982 "renesas,rcar-gen2-ether";
983 reg = <0 0xee700000 0 0x400>;
984 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
985 clocks = <&cpg CPG_MOD 813>;
986 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
987 resets = <&cpg 813>;
988 phy-mode = "rmii";
989 #address-cells = <1>;
990 #size-cells = <0>;
991 status = "disabled";
992 };
993
994 avb: ethernet@e6800000 {
995 compatible = "renesas,etheravb-r8a7743",
996 "renesas,etheravb-rcar-gen2";
997 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
998 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
999 clocks = <&cpg CPG_MOD 812>;
1000 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1001 resets = <&cpg 812>;
1002 #address-cells = <1>;
1003 #size-cells = <0>;
1004 status = "disabled";
1005 };
1006
1007 mmcif0: mmc@ee200000 {
1008 compatible = "renesas,mmcif-r8a7743",
1009 "renesas,sh-mmcif";
1010 reg = <0 0xee200000 0 0x80>;
1011 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1012 clocks = <&cpg CPG_MOD 315>;
1013 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1014 <&dmac1 0xd1>, <&dmac1 0xd2>;
1015 dma-names = "tx", "rx", "tx", "rx";
1016 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1017 resets = <&cpg 315>;
1018 reg-io-width = <4>;
1019 max-frequency = <97500000>;
1020 status = "disabled";
1021 };
1022
1023 qspi: spi@e6b10000 {
1024 compatible = "renesas,qspi-r8a7743", "renesas,qspi";
1025 reg = <0 0xe6b10000 0 0x2c>;
1026 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
1027 clocks = <&cpg CPG_MOD 917>;
1028 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
1029 <&dmac1 0x17>, <&dmac1 0x18>;
1030 dma-names = "tx", "rx", "tx", "rx";
1031 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1032 num-cs = <1>;
1033 #address-cells = <1>;
1034 #size-cells = <0>;
1035 resets = <&cpg 917>;
1036 status = "disabled";
1037 };
1038
1039 msiof0: spi@e6e20000 { 1000 msiof0: spi@e6e20000 {
1040 compatible = "renesas,msiof-r8a7743", 1001 compatible = "renesas,msiof-r8a7743",
1041 "renesas,rcar-gen2-msiof"; 1002 "renesas,rcar-gen2-msiof";
@@ -1084,26 +1045,6 @@
1084 status = "disabled"; 1045 status = "disabled";
1085 }; 1046 };
1086 1047
1087 /*
1088 * pci1 and xhci share the same phy, therefore only one of them
1089 * can be active at any one time. If both of them are enabled,
1090 * a race condition will determine who'll control the phy.
1091 * A firmware file is needed by the xhci driver in order for
1092 * USB 3.0 to work properly.
1093 */
1094 xhci: usb@ee000000 {
1095 compatible = "renesas,xhci-r8a7743",
1096 "renesas,rcar-gen2-xhci";
1097 reg = <0 0xee000000 0 0xc00>;
1098 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
1099 clocks = <&cpg CPG_MOD 328>;
1100 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1101 resets = <&cpg 328>;
1102 phys = <&usb2 1>;
1103 phy-names = "usb";
1104 status = "disabled";
1105 };
1106
1107 pwm0: pwm@e6e30000 { 1048 pwm0: pwm@e6e30000 {
1108 compatible = "renesas,pwm-r8a7743", "renesas,pwm-rcar"; 1049 compatible = "renesas,pwm-r8a7743", "renesas,pwm-rcar";
1109 reg = <0 0xe6e30000 0 0x8>; 1050 reg = <0 0xe6e30000 0 0x8>;
@@ -1174,98 +1115,32 @@
1174 status = "disabled"; 1115 status = "disabled";
1175 }; 1116 };
1176 1117
1177 tpu: pwm@e60f0000 { 1118 can0: can@e6e80000 {
1178 compatible = "renesas,tpu-r8a7743", "renesas,tpu"; 1119 compatible = "renesas,can-r8a7743",
1179 reg = <0 0xe60f0000 0 0x148>; 1120 "renesas,rcar-gen2-can";
1180 clocks = <&cpg CPG_MOD 304>; 1121 reg = <0 0xe6e80000 0 0x1000>;
1181 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; 1122 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
1182 resets = <&cpg 304>; 1123 clocks = <&cpg CPG_MOD 916>,
1183 #pwm-cells = <3>; 1124 <&cpg CPG_CORE R8A7743_CLK_RCAN>,
1184 status = "disabled"; 1125 <&can_clk>;
1185 }; 1126 clock-names = "clkp1", "clkp2", "can_clk";
1186
1187 sdhi0: sd@ee100000 {
1188 compatible = "renesas,sdhi-r8a7743",
1189 "renesas,rcar-gen2-sdhi";
1190 reg = <0 0xee100000 0 0x328>;
1191 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1192 clocks = <&cpg CPG_MOD 314>;
1193 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1194 <&dmac1 0xcd>, <&dmac1 0xce>;
1195 dma-names = "tx", "rx", "tx", "rx";
1196 max-frequency = <195000000>;
1197 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1198 resets = <&cpg 314>;
1199 status = "disabled";
1200 };
1201
1202 sdhi1: sd@ee140000 {
1203 compatible = "renesas,sdhi-r8a7743",
1204 "renesas,rcar-gen2-sdhi";
1205 reg = <0 0xee140000 0 0x100>;
1206 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1207 clocks = <&cpg CPG_MOD 312>;
1208 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1209 <&dmac1 0xc1>, <&dmac1 0xc2>;
1210 dma-names = "tx", "rx", "tx", "rx";
1211 max-frequency = <97500000>;
1212 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1213 resets = <&cpg 312>;
1214 status = "disabled";
1215 };
1216
1217 sdhi2: sd@ee160000 {
1218 compatible = "renesas,sdhi-r8a7743",
1219 "renesas,rcar-gen2-sdhi";
1220 reg = <0 0xee160000 0 0x100>;
1221 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1222 clocks = <&cpg CPG_MOD 311>;
1223 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1224 <&dmac1 0xd3>, <&dmac1 0xd4>;
1225 dma-names = "tx", "rx", "tx", "rx";
1226 max-frequency = <97500000>;
1227 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1228 resets = <&cpg 311>;
1229 status = "disabled";
1230 };
1231
1232 hsusb: usb@e6590000 {
1233 compatible = "renesas,usbhs-r8a7743",
1234 "renesas,rcar-gen2-usbhs";
1235 reg = <0 0xe6590000 0 0x100>;
1236 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
1237 clocks = <&cpg CPG_MOD 704>;
1238 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
1239 <&usb_dmac1 0>, <&usb_dmac1 1>;
1240 dma-names = "ch0", "ch1", "ch2", "ch3";
1241 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; 1127 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1242 resets = <&cpg 704>; 1128 resets = <&cpg 916>;
1243 renesas,buswait = <4>;
1244 phys = <&usb0 1>;
1245 phy-names = "usb";
1246 status = "disabled"; 1129 status = "disabled";
1247 }; 1130 };
1248 1131
1249 usbphy: usb-phy@e6590100 { 1132 can1: can@e6e88000 {
1250 compatible = "renesas,usb-phy-r8a7743", 1133 compatible = "renesas,can-r8a7743",
1251 "renesas,rcar-gen2-usb-phy"; 1134 "renesas,rcar-gen2-can";
1252 reg = <0 0xe6590100 0 0x100>; 1135 reg = <0 0xe6e88000 0 0x1000>;
1253 #address-cells = <1>; 1136 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
1254 #size-cells = <0>; 1137 clocks = <&cpg CPG_MOD 915>,
1255 clocks = <&cpg CPG_MOD 704>; 1138 <&cpg CPG_CORE R8A7743_CLK_RCAN>,
1256 clock-names = "usbhs"; 1139 <&can_clk>;
1140 clock-names = "clkp1", "clkp2", "can_clk";
1257 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; 1141 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1258 resets = <&cpg 704>; 1142 resets = <&cpg 915>;
1259 status = "disabled"; 1143 status = "disabled";
1260
1261 usb0: usb-channel@0 {
1262 reg = <0>;
1263 #phy-cells = <1>;
1264 };
1265 usb2: usb-channel@2 {
1266 reg = <2>;
1267 #phy-cells = <1>;
1268 };
1269 }; 1144 };
1270 1145
1271 vin0: video@e6ef0000 { 1146 vin0: video@e6ef0000 {
@@ -1301,162 +1176,6 @@
1301 status = "disabled"; 1176 status = "disabled";
1302 }; 1177 };
1303 1178
1304 du: display@feb00000 {
1305 compatible = "renesas,du-r8a7743";
1306 reg = <0 0xfeb00000 0 0x40000>,
1307 <0 0xfeb90000 0 0x1c>;
1308 reg-names = "du", "lvds.0";
1309 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1310 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1311 clocks = <&cpg CPG_MOD 724>,
1312 <&cpg CPG_MOD 723>,
1313 <&cpg CPG_MOD 726>;
1314 clock-names = "du.0", "du.1", "lvds.0";
1315 status = "disabled";
1316
1317 ports {
1318 #address-cells = <1>;
1319 #size-cells = <0>;
1320
1321 port@0 {
1322 reg = <0>;
1323 du_out_rgb: endpoint {
1324 };
1325 };
1326 port@1 {
1327 reg = <1>;
1328 du_out_lvds0: endpoint {
1329 };
1330 };
1331 };
1332 };
1333
1334 can0: can@e6e80000 {
1335 compatible = "renesas,can-r8a7743",
1336 "renesas,rcar-gen2-can";
1337 reg = <0 0xe6e80000 0 0x1000>;
1338 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
1339 clocks = <&cpg CPG_MOD 916>,
1340 <&cpg CPG_CORE R8A7743_CLK_RCAN>,
1341 <&can_clk>;
1342 clock-names = "clkp1", "clkp2", "can_clk";
1343 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1344 resets = <&cpg 916>;
1345 status = "disabled";
1346 };
1347
1348 can1: can@e6e88000 {
1349 compatible = "renesas,can-r8a7743",
1350 "renesas,rcar-gen2-can";
1351 reg = <0 0xe6e88000 0 0x1000>;
1352 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
1353 clocks = <&cpg CPG_MOD 915>,
1354 <&cpg CPG_CORE R8A7743_CLK_RCAN>,
1355 <&can_clk>;
1356 clock-names = "clkp1", "clkp2", "can_clk";
1357 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1358 resets = <&cpg 915>;
1359 status = "disabled";
1360 };
1361
1362 pci0: pci@ee090000 {
1363 compatible = "renesas,pci-r8a7743",
1364 "renesas,pci-rcar-gen2";
1365 device_type = "pci";
1366 reg = <0 0xee090000 0 0xc00>,
1367 <0 0xee080000 0 0x1100>;
1368 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1369 clocks = <&cpg CPG_MOD 703>;
1370 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1371 resets = <&cpg 703>;
1372 status = "disabled";
1373
1374 bus-range = <0 0>;
1375 #address-cells = <3>;
1376 #size-cells = <2>;
1377 #interrupt-cells = <1>;
1378 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1379 interrupt-map-mask = <0xff00 0 0 0x7>;
1380 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1381 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1382 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1383
1384 usb@1,0 {
1385 reg = <0x800 0 0 0 0>;
1386 phys = <&usb0 0>;
1387 phy-names = "usb";
1388 };
1389
1390 usb@2,0 {
1391 reg = <0x1000 0 0 0 0>;
1392 phys = <&usb0 0>;
1393 phy-names = "usb";
1394 };
1395 };
1396
1397 pci1: pci@ee0d0000 {
1398 compatible = "renesas,pci-r8a7743",
1399 "renesas,pci-rcar-gen2";
1400 device_type = "pci";
1401 reg = <0 0xee0d0000 0 0xc00>,
1402 <0 0xee0c0000 0 0x1100>;
1403 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1404 clocks = <&cpg CPG_MOD 703>;
1405 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1406 resets = <&cpg 703>;
1407 status = "disabled";
1408
1409 bus-range = <1 1>;
1410 #address-cells = <3>;
1411 #size-cells = <2>;
1412 #interrupt-cells = <1>;
1413 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1414 interrupt-map-mask = <0xff00 0 0 0x7>;
1415 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1416 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1417 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1418
1419 usb@1,0 {
1420 reg = <0x10800 0 0 0 0>;
1421 phys = <&usb2 0>;
1422 phy-names = "usb";
1423 };
1424
1425 usb@2,0 {
1426 reg = <0x11000 0 0 0 0>;
1427 phys = <&usb2 0>;
1428 phy-names = "usb";
1429 };
1430 };
1431
1432 pciec: pcie@fe000000 {
1433 compatible = "renesas,pcie-r8a7743",
1434 "renesas,pcie-rcar-gen2";
1435 reg = <0 0xfe000000 0 0x80000>;
1436 #address-cells = <3>;
1437 #size-cells = <2>;
1438 bus-range = <0x00 0xff>;
1439 device_type = "pci";
1440 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
1441 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
1442 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
1443 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1444 /* Map all possible DDR as inbound ranges */
1445 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1446 0x43000000 2 0x00000000 2 0x00000000 1 0x00000000>;
1447 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1448 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1449 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1450 #interrupt-cells = <1>;
1451 interrupt-map-mask = <0 0 0 0>;
1452 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1453 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1454 clock-names = "pcie", "pcie_bus";
1455 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1456 resets = <&cpg 319>;
1457 status = "disabled";
1458 };
1459
1460 rcar_sound: sound@ec500000 { 1179 rcar_sound: sound@ec500000 {
1461 /* 1180 /*
1462 * #sound-dai-cells is required 1181 * #sound-dai-cells is required
@@ -1641,6 +1360,369 @@
1641 }; 1360 };
1642 }; 1361 };
1643 }; 1362 };
1363
1364 audma0: dma-controller@ec700000 {
1365 compatible = "renesas,dmac-r8a7743",
1366 "renesas,rcar-dmac";
1367 reg = <0 0xec700000 0 0x10000>;
1368 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1369 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1370 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1371 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1372 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1373 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1374 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1375 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1376 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1377 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1378 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1379 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1380 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1381 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1382 interrupt-names = "error",
1383 "ch0", "ch1", "ch2", "ch3",
1384 "ch4", "ch5", "ch6", "ch7",
1385 "ch8", "ch9", "ch10", "ch11",
1386 "ch12";
1387 clocks = <&cpg CPG_MOD 502>;
1388 clock-names = "fck";
1389 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1390 resets = <&cpg 502>;
1391 #dma-cells = <1>;
1392 dma-channels = <13>;
1393 };
1394
1395 audma1: dma-controller@ec720000 {
1396 compatible = "renesas,dmac-r8a7743",
1397 "renesas,rcar-dmac";
1398 reg = <0 0xec720000 0 0x10000>;
1399 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH
1400 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
1401 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
1402 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
1403 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
1404 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
1405 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
1406 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
1407 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
1408 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
1409 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
1410 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
1411 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
1412 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
1413 interrupt-names = "error",
1414 "ch0", "ch1", "ch2", "ch3",
1415 "ch4", "ch5", "ch6", "ch7",
1416 "ch8", "ch9", "ch10", "ch11",
1417 "ch12";
1418 clocks = <&cpg CPG_MOD 501>;
1419 clock-names = "fck";
1420 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1421 resets = <&cpg 501>;
1422 #dma-cells = <1>;
1423 dma-channels = <13>;
1424 };
1425
1426 /*
1427 * pci1 and xhci share the same phy, therefore only one of them
1428 * can be active at any one time. If both of them are enabled,
1429 * a race condition will determine who'll control the phy.
1430 * A firmware file is needed by the xhci driver in order for
1431 * USB 3.0 to work properly.
1432 */
1433 xhci: usb@ee000000 {
1434 compatible = "renesas,xhci-r8a7743",
1435 "renesas,rcar-gen2-xhci";
1436 reg = <0 0xee000000 0 0xc00>;
1437 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
1438 clocks = <&cpg CPG_MOD 328>;
1439 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1440 resets = <&cpg 328>;
1441 phys = <&usb2 1>;
1442 phy-names = "usb";
1443 status = "disabled";
1444 };
1445
1446 pci0: pci@ee090000 {
1447 compatible = "renesas,pci-r8a7743",
1448 "renesas,pci-rcar-gen2";
1449 device_type = "pci";
1450 reg = <0 0xee090000 0 0xc00>,
1451 <0 0xee080000 0 0x1100>;
1452 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1453 clocks = <&cpg CPG_MOD 703>;
1454 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1455 resets = <&cpg 703>;
1456 status = "disabled";
1457
1458 bus-range = <0 0>;
1459 #address-cells = <3>;
1460 #size-cells = <2>;
1461 #interrupt-cells = <1>;
1462 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1463 interrupt-map-mask = <0xff00 0 0 0x7>;
1464 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1465 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1466 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1467
1468 usb@1,0 {
1469 reg = <0x800 0 0 0 0>;
1470 phys = <&usb0 0>;
1471 phy-names = "usb";
1472 };
1473
1474 usb@2,0 {
1475 reg = <0x1000 0 0 0 0>;
1476 phys = <&usb0 0>;
1477 phy-names = "usb";
1478 };
1479 };
1480
1481 pci1: pci@ee0d0000 {
1482 compatible = "renesas,pci-r8a7743",
1483 "renesas,pci-rcar-gen2";
1484 device_type = "pci";
1485 reg = <0 0xee0d0000 0 0xc00>,
1486 <0 0xee0c0000 0 0x1100>;
1487 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1488 clocks = <&cpg CPG_MOD 703>;
1489 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1490 resets = <&cpg 703>;
1491 status = "disabled";
1492
1493 bus-range = <1 1>;
1494 #address-cells = <3>;
1495 #size-cells = <2>;
1496 #interrupt-cells = <1>;
1497 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1498 interrupt-map-mask = <0xff00 0 0 0x7>;
1499 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1500 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1501 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1502
1503 usb@1,0 {
1504 reg = <0x10800 0 0 0 0>;
1505 phys = <&usb2 0>;
1506 phy-names = "usb";
1507 };
1508
1509 usb@2,0 {
1510 reg = <0x11000 0 0 0 0>;
1511 phys = <&usb2 0>;
1512 phy-names = "usb";
1513 };
1514 };
1515
1516 sdhi0: sd@ee100000 {
1517 compatible = "renesas,sdhi-r8a7743",
1518 "renesas,rcar-gen2-sdhi";
1519 reg = <0 0xee100000 0 0x328>;
1520 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1521 clocks = <&cpg CPG_MOD 314>;
1522 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1523 <&dmac1 0xcd>, <&dmac1 0xce>;
1524 dma-names = "tx", "rx", "tx", "rx";
1525 max-frequency = <195000000>;
1526 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1527 resets = <&cpg 314>;
1528 status = "disabled";
1529 };
1530
1531 sdhi1: sd@ee140000 {
1532 compatible = "renesas,sdhi-r8a7743",
1533 "renesas,rcar-gen2-sdhi";
1534 reg = <0 0xee140000 0 0x100>;
1535 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1536 clocks = <&cpg CPG_MOD 312>;
1537 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1538 <&dmac1 0xc1>, <&dmac1 0xc2>;
1539 dma-names = "tx", "rx", "tx", "rx";
1540 max-frequency = <97500000>;
1541 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1542 resets = <&cpg 312>;
1543 status = "disabled";
1544 };
1545
1546 sdhi2: sd@ee160000 {
1547 compatible = "renesas,sdhi-r8a7743",
1548 "renesas,rcar-gen2-sdhi";
1549 reg = <0 0xee160000 0 0x100>;
1550 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1551 clocks = <&cpg CPG_MOD 311>;
1552 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1553 <&dmac1 0xd3>, <&dmac1 0xd4>;
1554 dma-names = "tx", "rx", "tx", "rx";
1555 max-frequency = <97500000>;
1556 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1557 resets = <&cpg 311>;
1558 status = "disabled";
1559 };
1560
1561 mmcif0: mmc@ee200000 {
1562 compatible = "renesas,mmcif-r8a7743",
1563 "renesas,sh-mmcif";
1564 reg = <0 0xee200000 0 0x80>;
1565 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1566 clocks = <&cpg CPG_MOD 315>;
1567 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1568 <&dmac1 0xd1>, <&dmac1 0xd2>;
1569 dma-names = "tx", "rx", "tx", "rx";
1570 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1571 resets = <&cpg 315>;
1572 reg-io-width = <4>;
1573 max-frequency = <97500000>;
1574 status = "disabled";
1575 };
1576
1577 ether: ethernet@ee700000 {
1578 compatible = "renesas,ether-r8a7743",
1579 "renesas,rcar-gen2-ether";
1580 reg = <0 0xee700000 0 0x400>;
1581 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1582 clocks = <&cpg CPG_MOD 813>;
1583 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1584 resets = <&cpg 813>;
1585 phy-mode = "rmii";
1586 #address-cells = <1>;
1587 #size-cells = <0>;
1588 status = "disabled";
1589 };
1590
1591 gic: interrupt-controller@f1001000 {
1592 compatible = "arm,gic-400";
1593 #interrupt-cells = <3>;
1594 #address-cells = <0>;
1595 interrupt-controller;
1596 reg = <0 0xf1001000 0 0x1000>, <0 0xf1002000 0 0x2000>,
1597 <0 0xf1004000 0 0x2000>, <0 0xf1006000 0 0x2000>;
1598 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
1599 clocks = <&cpg CPG_MOD 408>;
1600 clock-names = "clk";
1601 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1602 resets = <&cpg 408>;
1603 };
1604
1605 pciec: pcie@fe000000 {
1606 compatible = "renesas,pcie-r8a7743",
1607 "renesas,pcie-rcar-gen2";
1608 reg = <0 0xfe000000 0 0x80000>;
1609 #address-cells = <3>;
1610 #size-cells = <2>;
1611 bus-range = <0x00 0xff>;
1612 device_type = "pci";
1613 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
1614 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
1615 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
1616 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1617 /* Map all possible DDR as inbound ranges */
1618 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1619 0x43000000 2 0x00000000 2 0x00000000 1 0x00000000>;
1620 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1621 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1622 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1623 #interrupt-cells = <1>;
1624 interrupt-map-mask = <0 0 0 0>;
1625 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1626 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1627 clock-names = "pcie", "pcie_bus";
1628 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1629 resets = <&cpg 319>;
1630 status = "disabled";
1631 };
1632
1633 vsp@fe928000 {
1634 compatible = "renesas,vsp1";
1635 reg = <0 0xfe928000 0 0x8000>;
1636 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
1637 clocks = <&cpg CPG_MOD 131>;
1638 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1639 resets = <&cpg 131>;
1640 };
1641
1642 vsp@fe930000 {
1643 compatible = "renesas,vsp1";
1644 reg = <0 0xfe930000 0 0x8000>;
1645 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
1646 clocks = <&cpg CPG_MOD 128>;
1647 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1648 resets = <&cpg 128>;
1649 };
1650
1651 vsp@fe938000 {
1652 compatible = "renesas,vsp1";
1653 reg = <0 0xfe938000 0 0x8000>;
1654 interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
1655 clocks = <&cpg CPG_MOD 127>;
1656 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1657 resets = <&cpg 127>;
1658 };
1659
1660 du: display@feb00000 {
1661 compatible = "renesas,du-r8a7743";
1662 reg = <0 0xfeb00000 0 0x40000>,
1663 <0 0xfeb90000 0 0x1c>;
1664 reg-names = "du", "lvds.0";
1665 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1666 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1667 clocks = <&cpg CPG_MOD 724>,
1668 <&cpg CPG_MOD 723>,
1669 <&cpg CPG_MOD 726>;
1670 clock-names = "du.0", "du.1", "lvds.0";
1671 status = "disabled";
1672
1673 ports {
1674 #address-cells = <1>;
1675 #size-cells = <0>;
1676
1677 port@0 {
1678 reg = <0>;
1679 du_out_rgb: endpoint {
1680 };
1681 };
1682 port@1 {
1683 reg = <1>;
1684 du_out_lvds0: endpoint {
1685 };
1686 };
1687 };
1688 };
1689
1690 prr: chipid@ff000044 {
1691 compatible = "renesas,prr";
1692 reg = <0 0xff000044 0 4>;
1693 };
1694
1695 cmt0: timer@ffca0000 {
1696 compatible = "renesas,r8a7743-cmt0",
1697 "renesas,rcar-gen2-cmt0";
1698 reg = <0 0xffca0000 0 0x1004>;
1699 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1700 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1701 clocks = <&cpg CPG_MOD 124>;
1702 clock-names = "fck";
1703 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1704 resets = <&cpg 124>;
1705 status = "disabled";
1706 };
1707
1708 cmt1: timer@e6130000 {
1709 compatible = "renesas,r8a7743-cmt1",
1710 "renesas,rcar-gen2-cmt1";
1711 reg = <0 0xe6130000 0 0x1004>;
1712 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1713 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1714 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1715 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1716 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1717 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1718 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1719 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1720 clocks = <&cpg CPG_MOD 329>;
1721 clock-names = "fck";
1722 power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
1723 resets = <&cpg 329>;
1724 status = "disabled";
1725 };
1644 }; 1726 };
1645 1727
1646 thermal-zones { 1728 thermal-zones {
diff --git a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
index ed9a8cf3fe36..8d0a392b6811 100644
--- a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
+++ b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
@@ -29,6 +29,10 @@
29 }; 29 };
30}; 30};
31 31
32&cmt0 {
33 status = "okay";
34};
35
32&extal_clk { 36&extal_clk {
33 clock-frequency = <20000000>; 37 clock-frequency = <20000000>;
34}; 38};
diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index ae918e9cce21..dd49a8b48f3e 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -121,29 +121,6 @@
121 #size-cells = <2>; 121 #size-cells = <2>;
122 ranges; 122 ranges;
123 123
124 apmu@e6151000 {
125 compatible = "renesas,r8a7745-apmu", "renesas,apmu";
126 reg = <0 0xe6151000 0 0x188>;
127 cpus = <&cpu0 &cpu1>;
128 };
129
130 gic: interrupt-controller@f1001000 {
131 compatible = "arm,gic-400";
132 #interrupt-cells = <3>;
133 #address-cells = <0>;
134 interrupt-controller;
135 reg = <0 0xf1001000 0 0x1000>,
136 <0 0xf1002000 0 0x2000>,
137 <0 0xf1004000 0 0x2000>,
138 <0 0xf1006000 0 0x2000>;
139 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
140 IRQ_TYPE_LEVEL_HIGH)>;
141 clocks = <&cpg CPG_MOD 408>;
142 clock-names = "clk";
143 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
144 resets = <&cpg 408>;
145 };
146
147 gpio0: gpio@e6050000 { 124 gpio0: gpio@e6050000 {
148 compatible = "renesas,gpio-r8a7745", 125 compatible = "renesas,gpio-r8a7745",
149 "renesas,rcar-gen2-gpio"; 126 "renesas,rcar-gen2-gpio";
@@ -249,6 +226,48 @@
249 resets = <&cpg 905>; 226 resets = <&cpg 905>;
250 }; 227 };
251 228
229 pfc: pin-controller@e6060000 {
230 compatible = "renesas,pfc-r8a7745";
231 reg = <0 0xe6060000 0 0x11c>;
232 };
233
234 tpu: pwm@e60f0000 {
235 compatible = "renesas,tpu-r8a7745", "renesas,tpu";
236 reg = <0 0xe60f0000 0 0x148>;
237 clocks = <&cpg CPG_MOD 304>;
238 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
239 resets = <&cpg 304>;
240 #pwm-cells = <3>;
241 status = "disabled";
242 };
243
244 cpg: clock-controller@e6150000 {
245 compatible = "renesas,r8a7745-cpg-mssr";
246 reg = <0 0xe6150000 0 0x1000>;
247 clocks = <&extal_clk>, <&usb_extal_clk>;
248 clock-names = "extal", "usb_extal";
249 #clock-cells = <2>;
250 #power-domain-cells = <0>;
251 #reset-cells = <1>;
252 };
253
254 apmu@e6151000 {
255 compatible = "renesas,r8a7745-apmu", "renesas,apmu";
256 reg = <0 0xe6151000 0 0x188>;
257 cpus = <&cpu0 &cpu1>;
258 };
259
260 rst: reset-controller@e6160000 {
261 compatible = "renesas,r8a7745-rst";
262 reg = <0 0xe6160000 0 0x100>;
263 };
264
265 sysc: system-controller@e6180000 {
266 compatible = "renesas,r8a7745-sysc";
267 reg = <0 0xe6180000 0 0x200>;
268 #power-domain-cells = <1>;
269 };
270
252 irqc: interrupt-controller@e61c0000 { 271 irqc: interrupt-controller@e61c0000 {
253 compatible = "renesas,irqc-r8a7745", "renesas,irqc"; 272 compatible = "renesas,irqc-r8a7745", "renesas,irqc";
254 #interrupt-cells = <2>; 273 #interrupt-cells = <2>;
@@ -269,67 +288,269 @@
269 resets = <&cpg 407>; 288 resets = <&cpg 407>;
270 }; 289 };
271 290
272 cmt0: timer@ffca0000 { 291 ipmmu_sy0: mmu@e6280000 {
273 compatible = "renesas,r8a7745-cmt0", 292 compatible = "renesas,ipmmu-r8a7745",
274 "renesas,rcar-gen2-cmt0"; 293 "renesas,ipmmu-vmsa";
275 reg = <0 0xffca0000 0 0x1004>; 294 reg = <0 0xe6280000 0 0x1000>;
276 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 295 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
277 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 296 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
278 clocks = <&cpg CPG_MOD 124>; 297 #iommu-cells = <1>;
279 clock-names = "fck"; 298 status = "disabled";
299 };
300
301 ipmmu_sy1: mmu@e6290000 {
302 compatible = "renesas,ipmmu-r8a7745",
303 "renesas,ipmmu-vmsa";
304 reg = <0 0xe6290000 0 0x1000>;
305 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
306 #iommu-cells = <1>;
307 status = "disabled";
308 };
309
310 ipmmu_ds: mmu@e6740000 {
311 compatible = "renesas,ipmmu-r8a7745",
312 "renesas,ipmmu-vmsa";
313 reg = <0 0xe6740000 0 0x1000>;
314 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
315 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
316 #iommu-cells = <1>;
317 status = "disabled";
318 };
319
320 ipmmu_mp: mmu@ec680000 {
321 compatible = "renesas,ipmmu-r8a7745",
322 "renesas,ipmmu-vmsa";
323 reg = <0 0xec680000 0 0x1000>;
324 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
325 #iommu-cells = <1>;
326 status = "disabled";
327 };
328
329 ipmmu_mx: mmu@fe951000 {
330 compatible = "renesas,ipmmu-r8a7745",
331 "renesas,ipmmu-vmsa";
332 reg = <0 0xfe951000 0 0x1000>;
333 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
334 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
335 #iommu-cells = <1>;
336 status = "disabled";
337 };
338
339 ipmmu_gp: mmu@e62a0000 {
340 compatible = "renesas,ipmmu-r8a7745",
341 "renesas,ipmmu-vmsa";
342 reg = <0 0xe62a0000 0 0x1000>;
343 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
344 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
345 #iommu-cells = <1>;
346 status = "disabled";
347 };
348
349 icram0: sram@e63a0000 {
350 compatible = "mmio-sram";
351 reg = <0 0xe63a0000 0 0x12000>;
352 };
353
354 icram1: sram@e63c0000 {
355 compatible = "mmio-sram";
356 reg = <0 0xe63c0000 0 0x1000>;
357 #address-cells = <1>;
358 #size-cells = <1>;
359 ranges = <0 0 0xe63c0000 0x1000>;
360
361 smp-sram@0 {
362 compatible = "renesas,smp-sram";
363 reg = <0 0x10>;
364 };
365 };
366
367 icram2: sram@e6300000 {
368 compatible = "mmio-sram";
369 reg = <0 0xe6300000 0 0x40000>;
370 };
371 i2c0: i2c@e6508000 {
372 #address-cells = <1>;
373 #size-cells = <0>;
374 compatible = "renesas,i2c-r8a7745",
375 "renesas,rcar-gen2-i2c";
376 reg = <0 0xe6508000 0 0x40>;
377 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
378 clocks = <&cpg CPG_MOD 931>;
280 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 379 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
281 resets = <&cpg 124>; 380 resets = <&cpg 931>;
381 i2c-scl-internal-delay-ns = <6>;
282 status = "disabled"; 382 status = "disabled";
283 }; 383 };
284 384
285 cmt1: timer@e6130000 { 385 i2c1: i2c@e6518000 {
286 compatible = "renesas,r8a7745-cmt1", 386 #address-cells = <1>;
287 "renesas,rcar-gen2-cmt1"; 387 #size-cells = <0>;
288 reg = <0 0xe6130000 0 0x1004>; 388 compatible = "renesas,i2c-r8a7745",
289 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 389 "renesas,rcar-gen2-i2c";
290 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 390 reg = <0 0xe6518000 0 0x40>;
291 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 391 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
292 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 392 clocks = <&cpg CPG_MOD 930>;
293 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
294 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
295 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
296 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&cpg CPG_MOD 329>;
298 clock-names = "fck";
299 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 393 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
300 resets = <&cpg 329>; 394 resets = <&cpg 930>;
395 i2c-scl-internal-delay-ns = <6>;
301 status = "disabled"; 396 status = "disabled";
302 }; 397 };
303 398
304 cpg: clock-controller@e6150000 { 399 i2c2: i2c@e6530000 {
305 compatible = "renesas,r8a7745-cpg-mssr"; 400 #address-cells = <1>;
306 reg = <0 0xe6150000 0 0x1000>; 401 #size-cells = <0>;
307 clocks = <&extal_clk>, <&usb_extal_clk>; 402 compatible = "renesas,i2c-r8a7745",
308 clock-names = "extal", "usb_extal"; 403 "renesas,rcar-gen2-i2c";
309 #clock-cells = <2>; 404 reg = <0 0xe6530000 0 0x40>;
310 #power-domain-cells = <0>; 405 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
311 #reset-cells = <1>; 406 clocks = <&cpg CPG_MOD 929>;
407 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
408 resets = <&cpg 929>;
409 i2c-scl-internal-delay-ns = <6>;
410 status = "disabled";
312 }; 411 };
313 412
314 prr: chipid@ff000044 { 413 i2c3: i2c@e6540000 {
315 compatible = "renesas,prr"; 414 #address-cells = <1>;
316 reg = <0 0xff000044 0 4>; 415 #size-cells = <0>;
416 compatible = "renesas,i2c-r8a7745",
417 "renesas,rcar-gen2-i2c";
418 reg = <0 0xe6540000 0 0x40>;
419 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
420 clocks = <&cpg CPG_MOD 928>;
421 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
422 resets = <&cpg 928>;
423 i2c-scl-internal-delay-ns = <6>;
424 status = "disabled";
317 }; 425 };
318 426
319 rst: reset-controller@e6160000 { 427 i2c4: i2c@e6520000 {
320 compatible = "renesas,r8a7745-rst"; 428 #address-cells = <1>;
321 reg = <0 0xe6160000 0 0x100>; 429 #size-cells = <0>;
430 compatible = "renesas,i2c-r8a7745",
431 "renesas,rcar-gen2-i2c";
432 reg = <0 0xe6520000 0 0x40>;
433 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
434 clocks = <&cpg CPG_MOD 927>;
435 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
436 resets = <&cpg 927>;
437 i2c-scl-internal-delay-ns = <6>;
438 status = "disabled";
322 }; 439 };
323 440
324 sysc: system-controller@e6180000 { 441 i2c5: i2c@e6528000 {
325 compatible = "renesas,r8a7745-sysc"; 442 #address-cells = <1>;
326 reg = <0 0xe6180000 0 0x200>; 443 #size-cells = <0>;
327 #power-domain-cells = <1>; 444 compatible = "renesas,i2c-r8a7745",
445 "renesas,rcar-gen2-i2c";
446 reg = <0 0xe6528000 0 0x40>;
447 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
448 clocks = <&cpg CPG_MOD 925>;
449 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
450 resets = <&cpg 925>;
451 i2c-scl-internal-delay-ns = <6>;
452 status = "disabled";
328 }; 453 };
329 454
330 pfc: pin-controller@e6060000 { 455 iic0: i2c@e6500000 {
331 compatible = "renesas,pfc-r8a7745"; 456 #address-cells = <1>;
332 reg = <0 0xe6060000 0 0x11c>; 457 #size-cells = <0>;
458 compatible = "renesas,iic-r8a7745",
459 "renesas,rcar-gen2-iic",
460 "renesas,rmobile-iic";
461 reg = <0 0xe6500000 0 0x425>;
462 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
463 clocks = <&cpg CPG_MOD 318>;
464 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
465 <&dmac1 0x61>, <&dmac1 0x62>;
466 dma-names = "tx", "rx", "tx", "rx";
467 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
468 resets = <&cpg 318>;
469 status = "disabled";
470 };
471
472 iic1: i2c@e6510000 {
473 #address-cells = <1>;
474 #size-cells = <0>;
475 compatible = "renesas,iic-r8a7745",
476 "renesas,rcar-gen2-iic",
477 "renesas,rmobile-iic";
478 reg = <0 0xe6510000 0 0x425>;
479 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
480 clocks = <&cpg CPG_MOD 323>;
481 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
482 <&dmac1 0x65>, <&dmac1 0x66>;
483 dma-names = "tx", "rx", "tx", "rx";
484 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
485 resets = <&cpg 323>;
486 status = "disabled";
487 };
488
489 hsusb: usb@e6590000 {
490 compatible = "renesas,usbhs-r8a7745",
491 "renesas,rcar-gen2-usbhs";
492 reg = <0 0xe6590000 0 0x100>;
493 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
494 clocks = <&cpg CPG_MOD 704>;
495 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
496 <&usb_dmac1 0>, <&usb_dmac1 1>;
497 dma-names = "ch0", "ch1", "ch2", "ch3";
498 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
499 resets = <&cpg 704>;
500 renesas,buswait = <4>;
501 phys = <&usb0 1>;
502 phy-names = "usb";
503 status = "disabled";
504 };
505
506 usbphy: usb-phy@e6590100 {
507 compatible = "renesas,usb-phy-r8a7745",
508 "renesas,rcar-gen2-usb-phy";
509 reg = <0 0xe6590100 0 0x100>;
510 #address-cells = <1>;
511 #size-cells = <0>;
512 clocks = <&cpg CPG_MOD 704>;
513 clock-names = "usbhs";
514 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
515 resets = <&cpg 704>;
516 status = "disabled";
517
518 usb0: usb-channel@0 {
519 reg = <0>;
520 #phy-cells = <1>;
521 };
522 usb2: usb-channel@2 {
523 reg = <2>;
524 #phy-cells = <1>;
525 };
526 };
527
528 usb_dmac0: dma-controller@e65a0000 {
529 compatible = "renesas,r8a7745-usb-dmac",
530 "renesas,usb-dmac";
531 reg = <0 0xe65a0000 0 0x100>;
532 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
533 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
534 interrupt-names = "ch0", "ch1";
535 clocks = <&cpg CPG_MOD 330>;
536 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
537 resets = <&cpg 330>;
538 #dma-cells = <1>;
539 dma-channels = <2>;
540 };
541
542 usb_dmac1: dma-controller@e65b0000 {
543 compatible = "renesas,r8a7745-usb-dmac",
544 "renesas,usb-dmac";
545 reg = <0 0xe65b0000 0 0x100>;
546 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
547 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
548 interrupt-names = "ch0", "ch1";
549 clocks = <&cpg CPG_MOD 331>;
550 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
551 resets = <&cpg 331>;
552 #dma-cells = <1>;
553 dma-channels = <2>;
333 }; 554 };
334 555
335 dmac0: dma-controller@e6700000 { 556 dmac0: dma-controller@e6700000 {
@@ -353,10 +574,10 @@
353 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH 574 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
354 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>; 575 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
355 interrupt-names = "error", 576 interrupt-names = "error",
356 "ch0", "ch1", "ch2", "ch3", 577 "ch0", "ch1", "ch2", "ch3",
357 "ch4", "ch5", "ch6", "ch7", 578 "ch4", "ch5", "ch6", "ch7",
358 "ch8", "ch9", "ch10", "ch11", 579 "ch8", "ch9", "ch10", "ch11",
359 "ch12", "ch13", "ch14"; 580 "ch12", "ch13", "ch14";
360 clocks = <&cpg CPG_MOD 219>; 581 clocks = <&cpg CPG_MOD 219>;
361 clock-names = "fck"; 582 clock-names = "fck";
362 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 583 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
@@ -386,75 +607,45 @@
386 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH 607 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
387 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>; 608 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
388 interrupt-names = "error", 609 interrupt-names = "error",
389 "ch0", "ch1", "ch2", "ch3",
390 "ch4", "ch5", "ch6", "ch7",
391 "ch8", "ch9", "ch10", "ch11",
392 "ch12", "ch13", "ch14";
393 clocks = <&cpg CPG_MOD 218>;
394 clock-names = "fck";
395 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
396 resets = <&cpg 218>;
397 #dma-cells = <1>;
398 dma-channels = <15>;
399 };
400
401 audma0: dma-controller@ec700000 {
402 compatible = "renesas,dmac-r8a7745",
403 "renesas,rcar-dmac";
404 reg = <0 0xec700000 0 0x10000>;
405 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
406 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
407 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
408 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
409 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
410 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
411 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
412 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
413 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
414 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
415 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
416 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
417 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
418 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
419 interrupt-names = "error",
420 "ch0", "ch1", "ch2", "ch3", 610 "ch0", "ch1", "ch2", "ch3",
421 "ch4", "ch5", "ch6", "ch7", 611 "ch4", "ch5", "ch6", "ch7",
422 "ch8", "ch9", "ch10", "ch11", 612 "ch8", "ch9", "ch10", "ch11",
423 "ch12"; 613 "ch12", "ch13", "ch14";
424 clocks = <&cpg CPG_MOD 502>; 614 clocks = <&cpg CPG_MOD 218>;
425 clock-names = "fck"; 615 clock-names = "fck";
426 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 616 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
427 resets = <&cpg 502>; 617 resets = <&cpg 218>;
428 #dma-cells = <1>; 618 #dma-cells = <1>;
429 dma-channels = <13>; 619 dma-channels = <15>;
430 }; 620 };
431 621
432 usb_dmac0: dma-controller@e65a0000 { 622 avb: ethernet@e6800000 {
433 compatible = "renesas,r8a7745-usb-dmac", 623 compatible = "renesas,etheravb-r8a7745",
434 "renesas,usb-dmac"; 624 "renesas,etheravb-rcar-gen2";
435 reg = <0 0xe65a0000 0 0x100>; 625 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
436 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH 626 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
437 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; 627 clocks = <&cpg CPG_MOD 812>;
438 interrupt-names = "ch0", "ch1";
439 clocks = <&cpg CPG_MOD 330>;
440 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 628 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
441 resets = <&cpg 330>; 629 resets = <&cpg 812>;
442 #dma-cells = <1>; 630 #address-cells = <1>;
443 dma-channels = <2>; 631 #size-cells = <0>;
632 status = "disabled";
444 }; 633 };
445 634
446 usb_dmac1: dma-controller@e65b0000 { 635 qspi: spi@e6b10000 {
447 compatible = "renesas,r8a7745-usb-dmac", 636 compatible = "renesas,qspi-r8a7745", "renesas,qspi";
448 "renesas,usb-dmac"; 637 reg = <0 0xe6b10000 0 0x2c>;
449 reg = <0 0xe65b0000 0 0x100>; 638 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
450 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 639 clocks = <&cpg CPG_MOD 917>;
451 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>; 640 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
452 interrupt-names = "ch0", "ch1"; 641 <&dmac1 0x17>, <&dmac1 0x18>;
453 clocks = <&cpg CPG_MOD 331>; 642 dma-names = "tx", "rx", "tx", "rx";
454 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>; 643 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
455 resets = <&cpg 331>; 644 num-cs = <1>;
456 #dma-cells = <1>; 645 #address-cells = <1>;
457 dma-channels = <2>; 646 #size-cells = <0>;
647 resets = <&cpg 917>;
648 status = "disabled";
458 }; 649 };
459 650
460 scifa0: serial@e6c40000 { 651 scifa0: serial@e6c40000 {
@@ -736,255 +927,6 @@
736 status = "disabled"; 927 status = "disabled";
737 }; 928 };
738 929
739 icram2: sram@e6300000 {
740 compatible = "mmio-sram";
741 reg = <0 0xe6300000 0 0x40000>;
742 };
743
744 icram0: sram@e63a0000 {
745 compatible = "mmio-sram";
746 reg = <0 0xe63a0000 0 0x12000>;
747 };
748
749 icram1: sram@e63c0000 {
750 compatible = "mmio-sram";
751 reg = <0 0xe63c0000 0 0x1000>;
752 #address-cells = <1>;
753 #size-cells = <1>;
754 ranges = <0 0 0xe63c0000 0x1000>;
755
756 smp-sram@0 {
757 compatible = "renesas,smp-sram";
758 reg = <0 0x10>;
759 };
760 };
761
762 ether: ethernet@ee700000 {
763 compatible = "renesas,ether-r8a7745",
764 "renesas,rcar-gen2-ether";
765 reg = <0 0xee700000 0 0x400>;
766 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
767 clocks = <&cpg CPG_MOD 813>;
768 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
769 resets = <&cpg 813>;
770 phy-mode = "rmii";
771 #address-cells = <1>;
772 #size-cells = <0>;
773 status = "disabled";
774 };
775
776 avb: ethernet@e6800000 {
777 compatible = "renesas,etheravb-r8a7745",
778 "renesas,etheravb-rcar-gen2";
779 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
780 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
781 clocks = <&cpg CPG_MOD 812>;
782 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
783 resets = <&cpg 812>;
784 #address-cells = <1>;
785 #size-cells = <0>;
786 status = "disabled";
787 };
788
789 i2c0: i2c@e6508000 {
790 #address-cells = <1>;
791 #size-cells = <0>;
792 compatible = "renesas,i2c-r8a7745",
793 "renesas,rcar-gen2-i2c";
794 reg = <0 0xe6508000 0 0x40>;
795 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
796 clocks = <&cpg CPG_MOD 931>;
797 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
798 resets = <&cpg 931>;
799 i2c-scl-internal-delay-ns = <6>;
800 status = "disabled";
801 };
802
803 i2c1: i2c@e6518000 {
804 #address-cells = <1>;
805 #size-cells = <0>;
806 compatible = "renesas,i2c-r8a7745",
807 "renesas,rcar-gen2-i2c";
808 reg = <0 0xe6518000 0 0x40>;
809 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
810 clocks = <&cpg CPG_MOD 930>;
811 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
812 resets = <&cpg 930>;
813 i2c-scl-internal-delay-ns = <6>;
814 status = "disabled";
815 };
816
817 i2c2: i2c@e6530000 {
818 #address-cells = <1>;
819 #size-cells = <0>;
820 compatible = "renesas,i2c-r8a7745",
821 "renesas,rcar-gen2-i2c";
822 reg = <0 0xe6530000 0 0x40>;
823 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
824 clocks = <&cpg CPG_MOD 929>;
825 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
826 resets = <&cpg 929>;
827 i2c-scl-internal-delay-ns = <6>;
828 status = "disabled";
829 };
830
831 i2c3: i2c@e6540000 {
832 #address-cells = <1>;
833 #size-cells = <0>;
834 compatible = "renesas,i2c-r8a7745",
835 "renesas,rcar-gen2-i2c";
836 reg = <0 0xe6540000 0 0x40>;
837 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
838 clocks = <&cpg CPG_MOD 928>;
839 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
840 resets = <&cpg 928>;
841 i2c-scl-internal-delay-ns = <6>;
842 status = "disabled";
843 };
844
845 i2c4: i2c@e6520000 {
846 #address-cells = <1>;
847 #size-cells = <0>;
848 compatible = "renesas,i2c-r8a7745",
849 "renesas,rcar-gen2-i2c";
850 reg = <0 0xe6520000 0 0x40>;
851 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
852 clocks = <&cpg CPG_MOD 927>;
853 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
854 resets = <&cpg 927>;
855 i2c-scl-internal-delay-ns = <6>;
856 status = "disabled";
857 };
858
859 i2c5: i2c@e6528000 {
860 #address-cells = <1>;
861 #size-cells = <0>;
862 compatible = "renesas,i2c-r8a7745",
863 "renesas,rcar-gen2-i2c";
864 reg = <0 0xe6528000 0 0x40>;
865 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
866 clocks = <&cpg CPG_MOD 925>;
867 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
868 resets = <&cpg 925>;
869 i2c-scl-internal-delay-ns = <6>;
870 status = "disabled";
871 };
872
873 iic0: i2c@e6500000 {
874 #address-cells = <1>;
875 #size-cells = <0>;
876 compatible = "renesas,iic-r8a7745",
877 "renesas,rcar-gen2-iic",
878 "renesas,rmobile-iic";
879 reg = <0 0xe6500000 0 0x425>;
880 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
881 clocks = <&cpg CPG_MOD 318>;
882 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
883 <&dmac1 0x61>, <&dmac1 0x62>;
884 dma-names = "tx", "rx", "tx", "rx";
885 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
886 resets = <&cpg 318>;
887 status = "disabled";
888 };
889
890 iic1: i2c@e6510000 {
891 #address-cells = <1>;
892 #size-cells = <0>;
893 compatible = "renesas,iic-r8a7745",
894 "renesas,rcar-gen2-iic",
895 "renesas,rmobile-iic";
896 reg = <0 0xe6510000 0 0x425>;
897 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
898 clocks = <&cpg CPG_MOD 323>;
899 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
900 <&dmac1 0x65>, <&dmac1 0x66>;
901 dma-names = "tx", "rx", "tx", "rx";
902 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
903 resets = <&cpg 323>;
904 status = "disabled";
905 };
906
907 mmcif0: mmc@ee200000 {
908 compatible = "renesas,mmcif-r8a7745",
909 "renesas,sh-mmcif";
910 reg = <0 0xee200000 0 0x80>;
911 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
912 clocks = <&cpg CPG_MOD 315>;
913 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
914 <&dmac1 0xd1>, <&dmac1 0xd2>;
915 dma-names = "tx", "rx", "tx", "rx";
916 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
917 resets = <&cpg 315>;
918 reg-io-width = <4>;
919 max-frequency = <97500000>;
920 status = "disabled";
921 };
922
923 qspi: spi@e6b10000 {
924 compatible = "renesas,qspi-r8a7745", "renesas,qspi";
925 reg = <0 0xe6b10000 0 0x2c>;
926 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
927 clocks = <&cpg CPG_MOD 917>;
928 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
929 <&dmac1 0x17>, <&dmac1 0x18>;
930 dma-names = "tx", "rx", "tx", "rx";
931 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
932 num-cs = <1>;
933 #address-cells = <1>;
934 #size-cells = <0>;
935 resets = <&cpg 917>;
936 status = "disabled";
937 };
938
939 vin0: video@e6ef0000 {
940 compatible = "renesas,vin-r8a7745",
941 "renesas,rcar-gen2-vin";
942 reg = <0 0xe6ef0000 0 0x1000>;
943 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
944 clocks = <&cpg CPG_MOD 811>;
945 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
946 resets = <&cpg 811>;
947 status = "disabled";
948 };
949
950 vin1: video@e6ef1000 {
951 compatible = "renesas,vin-r8a7745",
952 "renesas,rcar-gen2-vin";
953 reg = <0 0xe6ef1000 0 0x1000>;
954 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
955 clocks = <&cpg CPG_MOD 810>;
956 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
957 resets = <&cpg 810>;
958 status = "disabled";
959 };
960
961 du: display@feb00000 {
962 compatible = "renesas,du-r8a7745";
963 reg = <0 0xfeb00000 0 0x40000>;
964 reg-names = "du";
965 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
966 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
967 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>;
968 clock-names = "du.0", "du.1";
969 status = "disabled";
970
971 ports {
972 #address-cells = <1>;
973 #size-cells = <0>;
974
975 port@0 {
976 reg = <0>;
977 du_out_rgb0: endpoint {
978 };
979 };
980 port@1 {
981 reg = <1>;
982 du_out_rgb1: endpoint {
983 };
984 };
985 };
986 };
987
988 msiof0: spi@e6e20000 { 930 msiof0: spi@e6e20000 {
989 compatible = "renesas,msiof-r8a7745", 931 compatible = "renesas,msiof-r8a7745",
990 "renesas,rcar-gen2-msiof"; 932 "renesas,rcar-gen2-msiof";
@@ -1103,170 +1045,6 @@
1103 status = "disabled"; 1045 status = "disabled";
1104 }; 1046 };
1105 1047
1106 tpu: pwm@e60f0000 {
1107 compatible = "renesas,tpu-r8a7745", "renesas,tpu";
1108 reg = <0 0xe60f0000 0 0x148>;
1109 clocks = <&cpg CPG_MOD 304>;
1110 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1111 resets = <&cpg 304>;
1112 #pwm-cells = <3>;
1113 status = "disabled";
1114 };
1115
1116 sdhi0: sd@ee100000 {
1117 compatible = "renesas,sdhi-r8a7745",
1118 "renesas,rcar-gen2-sdhi";
1119 reg = <0 0xee100000 0 0x328>;
1120 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1121 clocks = <&cpg CPG_MOD 314>;
1122 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1123 <&dmac1 0xcd>, <&dmac1 0xce>;
1124 dma-names = "tx", "rx", "tx", "rx";
1125 max-frequency = <195000000>;
1126 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1127 resets = <&cpg 314>;
1128 status = "disabled";
1129 };
1130
1131 sdhi1: sd@ee140000 {
1132 compatible = "renesas,sdhi-r8a7745",
1133 "renesas,rcar-gen2-sdhi";
1134 reg = <0 0xee140000 0 0x100>;
1135 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1136 clocks = <&cpg CPG_MOD 312>;
1137 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1138 <&dmac1 0xc1>, <&dmac1 0xc2>;
1139 dma-names = "tx", "rx", "tx", "rx";
1140 max-frequency = <97500000>;
1141 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1142 resets = <&cpg 312>;
1143 status = "disabled";
1144 };
1145
1146 sdhi2: sd@ee160000 {
1147 compatible = "renesas,sdhi-r8a7745",
1148 "renesas,rcar-gen2-sdhi";
1149 reg = <0 0xee160000 0 0x100>;
1150 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1151 clocks = <&cpg CPG_MOD 311>;
1152 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1153 <&dmac1 0xd3>, <&dmac1 0xd4>;
1154 dma-names = "tx", "rx", "tx", "rx";
1155 max-frequency = <97500000>;
1156 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1157 resets = <&cpg 311>;
1158 status = "disabled";
1159 };
1160
1161 pci0: pci@ee090000 {
1162 compatible = "renesas,pci-r8a7745",
1163 "renesas,pci-rcar-gen2";
1164 device_type = "pci";
1165 reg = <0 0xee090000 0 0xc00>,
1166 <0 0xee080000 0 0x1100>;
1167 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1168 clocks = <&cpg CPG_MOD 703>;
1169 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1170 resets = <&cpg 703>;
1171 status = "disabled";
1172
1173 bus-range = <0 0>;
1174 #address-cells = <3>;
1175 #size-cells = <2>;
1176 #interrupt-cells = <1>;
1177 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1178 interrupt-map-mask = <0xff00 0 0 0x7>;
1179 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1180 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1181 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1182
1183 usb@1,0 {
1184 reg = <0x800 0 0 0 0>;
1185 phys = <&usb0 0>;
1186 phy-names = "usb";
1187 };
1188
1189 usb@2,0 {
1190 reg = <0x1000 0 0 0 0>;
1191 phys = <&usb0 0>;
1192 phy-names = "usb";
1193 };
1194 };
1195
1196 pci1: pci@ee0d0000 {
1197 compatible = "renesas,pci-r8a7745",
1198 "renesas,pci-rcar-gen2";
1199 device_type = "pci";
1200 reg = <0 0xee0d0000 0 0xc00>,
1201 <0 0xee0c0000 0 0x1100>;
1202 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1203 clocks = <&cpg CPG_MOD 703>;
1204 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1205 resets = <&cpg 703>;
1206 status = "disabled";
1207
1208 bus-range = <1 1>;
1209 #address-cells = <3>;
1210 #size-cells = <2>;
1211 #interrupt-cells = <1>;
1212 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1213 interrupt-map-mask = <0xff00 0 0 0x7>;
1214 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1215 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1216 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1217
1218 usb@1,0 {
1219 reg = <0x10800 0 0 0 0>;
1220 phys = <&usb2 0>;
1221 phy-names = "usb";
1222 };
1223
1224 usb@2,0 {
1225 reg = <0x11000 0 0 0 0>;
1226 phys = <&usb2 0>;
1227 phy-names = "usb";
1228 };
1229 };
1230
1231 hsusb: usb@e6590000 {
1232 compatible = "renesas,usbhs-r8a7745",
1233 "renesas,rcar-gen2-usbhs";
1234 reg = <0 0xe6590000 0 0x100>;
1235 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
1236 clocks = <&cpg CPG_MOD 704>;
1237 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
1238 <&usb_dmac1 0>, <&usb_dmac1 1>;
1239 dma-names = "ch0", "ch1", "ch2", "ch3";
1240 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1241 resets = <&cpg 704>;
1242 renesas,buswait = <4>;
1243 phys = <&usb0 1>;
1244 phy-names = "usb";
1245 status = "disabled";
1246 };
1247
1248 usbphy: usb-phy@e6590100 {
1249 compatible = "renesas,usb-phy-r8a7745",
1250 "renesas,rcar-gen2-usb-phy";
1251 reg = <0 0xe6590100 0 0x100>;
1252 #address-cells = <1>;
1253 #size-cells = <0>;
1254 clocks = <&cpg CPG_MOD 704>;
1255 clock-names = "usbhs";
1256 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1257 resets = <&cpg 704>;
1258 status = "disabled";
1259
1260 usb0: usb-channel@0 {
1261 reg = <0>;
1262 #phy-cells = <1>;
1263 };
1264 usb2: usb-channel@2 {
1265 reg = <2>;
1266 #phy-cells = <1>;
1267 };
1268 };
1269
1270 can0: can@e6e80000 { 1048 can0: can@e6e80000 {
1271 compatible = "renesas,can-r8a7745", 1049 compatible = "renesas,can-r8a7745",
1272 "renesas,rcar-gen2-can"; 1050 "renesas,rcar-gen2-can";
@@ -1295,6 +1073,28 @@
1295 status = "disabled"; 1073 status = "disabled";
1296 }; 1074 };
1297 1075
1076 vin0: video@e6ef0000 {
1077 compatible = "renesas,vin-r8a7745",
1078 "renesas,rcar-gen2-vin";
1079 reg = <0 0xe6ef0000 0 0x1000>;
1080 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
1081 clocks = <&cpg CPG_MOD 811>;
1082 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1083 resets = <&cpg 811>;
1084 status = "disabled";
1085 };
1086
1087 vin1: video@e6ef1000 {
1088 compatible = "renesas,vin-r8a7745",
1089 "renesas,rcar-gen2-vin";
1090 reg = <0 0xe6ef1000 0 0x1000>;
1091 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
1092 clocks = <&cpg CPG_MOD 810>;
1093 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1094 resets = <&cpg 810>;
1095 status = "disabled";
1096 };
1097
1298 rcar_sound: sound@ec500000 { 1098 rcar_sound: sound@ec500000 {
1299 /* 1099 /*
1300 * #sound-dai-cells is required 1100 * #sound-dai-cells is required
@@ -1474,6 +1274,278 @@
1474 }; 1274 };
1475 }; 1275 };
1476 }; 1276 };
1277
1278 audma0: dma-controller@ec700000 {
1279 compatible = "renesas,dmac-r8a7745",
1280 "renesas,rcar-dmac";
1281 reg = <0 0xec700000 0 0x10000>;
1282 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1283 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1284 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1285 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1286 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1287 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1288 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1289 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1290 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1291 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1292 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1293 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1294 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1295 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1296 interrupt-names = "error",
1297 "ch0", "ch1", "ch2", "ch3",
1298 "ch4", "ch5", "ch6", "ch7",
1299 "ch8", "ch9", "ch10", "ch11",
1300 "ch12";
1301 clocks = <&cpg CPG_MOD 502>;
1302 clock-names = "fck";
1303 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1304 resets = <&cpg 502>;
1305 #dma-cells = <1>;
1306 dma-channels = <13>;
1307 };
1308
1309 pci0: pci@ee090000 {
1310 compatible = "renesas,pci-r8a7745",
1311 "renesas,pci-rcar-gen2";
1312 device_type = "pci";
1313 reg = <0 0xee090000 0 0xc00>,
1314 <0 0xee080000 0 0x1100>;
1315 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1316 clocks = <&cpg CPG_MOD 703>;
1317 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1318 resets = <&cpg 703>;
1319 status = "disabled";
1320
1321 bus-range = <0 0>;
1322 #address-cells = <3>;
1323 #size-cells = <2>;
1324 #interrupt-cells = <1>;
1325 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1326 interrupt-map-mask = <0xff00 0 0 0x7>;
1327 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1328 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1329 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1330
1331 usb@1,0 {
1332 reg = <0x800 0 0 0 0>;
1333 phys = <&usb0 0>;
1334 phy-names = "usb";
1335 };
1336
1337 usb@2,0 {
1338 reg = <0x1000 0 0 0 0>;
1339 phys = <&usb0 0>;
1340 phy-names = "usb";
1341 };
1342 };
1343
1344 pci1: pci@ee0d0000 {
1345 compatible = "renesas,pci-r8a7745",
1346 "renesas,pci-rcar-gen2";
1347 device_type = "pci";
1348 reg = <0 0xee0d0000 0 0xc00>,
1349 <0 0xee0c0000 0 0x1100>;
1350 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1351 clocks = <&cpg CPG_MOD 703>;
1352 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1353 resets = <&cpg 703>;
1354 status = "disabled";
1355
1356 bus-range = <1 1>;
1357 #address-cells = <3>;
1358 #size-cells = <2>;
1359 #interrupt-cells = <1>;
1360 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1361 interrupt-map-mask = <0xff00 0 0 0x7>;
1362 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1363 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1364 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1365
1366 usb@1,0 {
1367 reg = <0x10800 0 0 0 0>;
1368 phys = <&usb2 0>;
1369 phy-names = "usb";
1370 };
1371
1372 usb@2,0 {
1373 reg = <0x11000 0 0 0 0>;
1374 phys = <&usb2 0>;
1375 phy-names = "usb";
1376 };
1377 };
1378
1379 sdhi0: sd@ee100000 {
1380 compatible = "renesas,sdhi-r8a7745",
1381 "renesas,rcar-gen2-sdhi";
1382 reg = <0 0xee100000 0 0x328>;
1383 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1384 clocks = <&cpg CPG_MOD 314>;
1385 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1386 <&dmac1 0xcd>, <&dmac1 0xce>;
1387 dma-names = "tx", "rx", "tx", "rx";
1388 max-frequency = <195000000>;
1389 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1390 resets = <&cpg 314>;
1391 status = "disabled";
1392 };
1393
1394 sdhi1: sd@ee140000 {
1395 compatible = "renesas,sdhi-r8a7745",
1396 "renesas,rcar-gen2-sdhi";
1397 reg = <0 0xee140000 0 0x100>;
1398 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1399 clocks = <&cpg CPG_MOD 312>;
1400 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1401 <&dmac1 0xc1>, <&dmac1 0xc2>;
1402 dma-names = "tx", "rx", "tx", "rx";
1403 max-frequency = <97500000>;
1404 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1405 resets = <&cpg 312>;
1406 status = "disabled";
1407 };
1408
1409 sdhi2: sd@ee160000 {
1410 compatible = "renesas,sdhi-r8a7745",
1411 "renesas,rcar-gen2-sdhi";
1412 reg = <0 0xee160000 0 0x100>;
1413 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1414 clocks = <&cpg CPG_MOD 311>;
1415 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1416 <&dmac1 0xd3>, <&dmac1 0xd4>;
1417 dma-names = "tx", "rx", "tx", "rx";
1418 max-frequency = <97500000>;
1419 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1420 resets = <&cpg 311>;
1421 status = "disabled";
1422 };
1423
1424 mmcif0: mmc@ee200000 {
1425 compatible = "renesas,mmcif-r8a7745",
1426 "renesas,sh-mmcif";
1427 reg = <0 0xee200000 0 0x80>;
1428 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1429 clocks = <&cpg CPG_MOD 315>;
1430 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1431 <&dmac1 0xd1>, <&dmac1 0xd2>;
1432 dma-names = "tx", "rx", "tx", "rx";
1433 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1434 resets = <&cpg 315>;
1435 reg-io-width = <4>;
1436 max-frequency = <97500000>;
1437 status = "disabled";
1438 };
1439
1440 ether: ethernet@ee700000 {
1441 compatible = "renesas,ether-r8a7745",
1442 "renesas,rcar-gen2-ether";
1443 reg = <0 0xee700000 0 0x400>;
1444 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1445 clocks = <&cpg CPG_MOD 813>;
1446 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1447 resets = <&cpg 813>;
1448 phy-mode = "rmii";
1449 #address-cells = <1>;
1450 #size-cells = <0>;
1451 status = "disabled";
1452 };
1453
1454 gic: interrupt-controller@f1001000 {
1455 compatible = "arm,gic-400";
1456 #interrupt-cells = <3>;
1457 #address-cells = <0>;
1458 interrupt-controller;
1459 reg = <0 0xf1001000 0 0x1000>, <0 0xf1002000 0 0x2000>,
1460 <0 0xf1004000 0 0x2000>, <0 0xf1006000 0 0x2000>;
1461 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
1462 clocks = <&cpg CPG_MOD 408>;
1463 clock-names = "clk";
1464 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1465 resets = <&cpg 408>;
1466 };
1467
1468 vsp@fe928000 {
1469 compatible = "renesas,vsp1";
1470 reg = <0 0xfe928000 0 0x8000>;
1471 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
1472 clocks = <&cpg CPG_MOD 131>;
1473 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1474 resets = <&cpg 131>;
1475 };
1476
1477 vsp@fe930000 {
1478 compatible = "renesas,vsp1";
1479 reg = <0 0xfe930000 0 0x8000>;
1480 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
1481 clocks = <&cpg CPG_MOD 128>;
1482 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1483 resets = <&cpg 128>;
1484 };
1485
1486 du: display@feb00000 {
1487 compatible = "renesas,du-r8a7745";
1488 reg = <0 0xfeb00000 0 0x40000>;
1489 reg-names = "du";
1490 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1491 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1492 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>;
1493 clock-names = "du.0", "du.1";
1494 status = "disabled";
1495
1496 ports {
1497 #address-cells = <1>;
1498 #size-cells = <0>;
1499
1500 port@0 {
1501 reg = <0>;
1502 du_out_rgb0: endpoint {
1503 };
1504 };
1505 port@1 {
1506 reg = <1>;
1507 du_out_rgb1: endpoint {
1508 };
1509 };
1510 };
1511 };
1512
1513 prr: chipid@ff000044 {
1514 compatible = "renesas,prr";
1515 reg = <0 0xff000044 0 4>;
1516 };
1517
1518 cmt0: timer@ffca0000 {
1519 compatible = "renesas,r8a7745-cmt0",
1520 "renesas,rcar-gen2-cmt0";
1521 reg = <0 0xffca0000 0 0x1004>;
1522 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1523 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1524 clocks = <&cpg CPG_MOD 124>;
1525 clock-names = "fck";
1526 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1527 resets = <&cpg 124>;
1528 status = "disabled";
1529 };
1530
1531 cmt1: timer@e6130000 {
1532 compatible = "renesas,r8a7745-cmt1",
1533 "renesas,rcar-gen2-cmt1";
1534 reg = <0 0xe6130000 0 0x1004>;
1535 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1536 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1537 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1538 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1539 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1540 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1541 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1542 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1543 clocks = <&cpg CPG_MOD 329>;
1544 clock-names = "fck";
1545 power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
1546 resets = <&cpg 329>;
1547 status = "disabled";
1548 };
1477 }; 1549 };
1478 1550
1479 timer { 1551 timer {
diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index 9412a86f9b30..4b9006bac3cb 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -42,6 +42,19 @@
42 regulator-always-on; 42 regulator-always-on;
43 }; 43 };
44 44
45 vccq_sdhi0: regulator-vccq-sdhi0 {
46 compatible = "regulator-gpio";
47
48 regulator-name = "SDHI0 VccQ";
49 regulator-min-microvolt = <1800000>;
50 regulator-max-microvolt = <3300000>;
51
52 gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
53 gpios-states = <1>;
54 states = <3300000 1
55 1800000 0>;
56 };
57
45 ethernet@18000000 { 58 ethernet@18000000 {
46 compatible = "smsc,lan9220", "smsc,lan9115"; 59 compatible = "smsc,lan9220", "smsc,lan9115";
47 reg = <0x18000000 0x100>; 60 reg = <0x18000000 0x100>;
@@ -243,6 +256,7 @@
243 pinctrl-names = "default"; 256 pinctrl-names = "default";
244 257
245 vmmc-supply = <&fixedregulator3v3>; 258 vmmc-supply = <&fixedregulator3v3>;
259 vqmmc-supply = <&vccq_sdhi0>;
246 bus-width = <4>; 260 bus-width = <4>;
247 status = "okay"; 261 status = "okay";
248}; 262};
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index f2ea632381e7..063fdb65dc60 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -51,8 +51,11 @@
51 serial0 = &scif0; 51 serial0 = &scif0;
52 serial1 = &scifa1; 52 serial1 = &scifa1;
53 i2c8 = &gpioi2c1; 53 i2c8 = &gpioi2c1;
54 i2c9 = &gpioi2c2;
54 i2c10 = &i2cexio0; 55 i2c10 = &i2cexio0;
55 i2c11 = &i2cexio1; 56 i2c11 = &i2cexio1;
57 i2c12 = &i2chdmi;
58 i2c13 = &i2cpwr;
56 }; 59 };
57 60
58 chosen { 61 chosen {
@@ -244,6 +247,12 @@
244 }; 247 };
245 }; 248 };
246 249
250 cec_clock: cec-clock {
251 compatible = "fixed-clock";
252 #clock-cells = <0>;
253 clock-frequency = <12000000>;
254 };
255
247 hdmi-out { 256 hdmi-out {
248 compatible = "hdmi-connector"; 257 compatible = "hdmi-connector";
249 type = "a"; 258 type = "a";
@@ -272,8 +281,18 @@
272 #size-cells = <0>; 281 #size-cells = <0>;
273 compatible = "i2c-gpio"; 282 compatible = "i2c-gpio";
274 status = "disabled"; 283 status = "disabled";
275 sda-gpios = <&gpio1 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
276 scl-gpios = <&gpio1 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 284 scl-gpios = <&gpio1 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
285 sda-gpios = <&gpio1 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
286 i2c-gpio,delay-us = <5>;
287 };
288
289 gpioi2c2: i2c-9 {
290 #address-cells = <1>;
291 #size-cells = <0>;
292 compatible = "i2c-gpio";
293 status = "disabled";
294 scl-gpios = <&gpio5 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
295 sda-gpios = <&gpio5 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
277 i2c-gpio,delay-us = <5>; 296 i2c-gpio,delay-us = <5>;
278 }; 297 };
279 298
@@ -308,6 +327,138 @@
308 #address-cells = <1>; 327 #address-cells = <1>;
309 #size-cells = <0>; 328 #size-cells = <0>;
310 }; 329 };
330
331 /*
332 * IIC2 and I2C2 may be switched using pinmux.
333 * A fallback to GPIO is also provided.
334 */
335 i2chdmi: i2c-12 {
336 compatible = "i2c-demux-pinctrl";
337 i2c-parent = <&iic2>, <&i2c2>, <&gpioi2c2>;
338 i2c-bus-name = "i2c-hdmi";
339 #address-cells = <1>;
340 #size-cells = <0>;
341
342 ak4643: codec@12 {
343 compatible = "asahi-kasei,ak4643";
344 #sound-dai-cells = <0>;
345 reg = <0x12>;
346 };
347
348 composite-in@20 {
349 compatible = "adi,adv7180";
350 reg = <0x20>;
351 remote = <&vin1>;
352
353 port {
354 adv7180: endpoint {
355 bus-width = <8>;
356 remote-endpoint = <&vin1ep0>;
357 };
358 };
359 };
360
361 hdmi@39 {
362 compatible = "adi,adv7511w";
363 reg = <0x39>;
364 interrupt-parent = <&gpio1>;
365 interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
366 clocks = <&cec_clock>;
367 clock-names = "cec";
368
369 adi,input-depth = <8>;
370 adi,input-colorspace = "rgb";
371 adi,input-clock = "1x";
372 adi,input-style = <1>;
373 adi,input-justification = "evenly";
374
375 ports {
376 #address-cells = <1>;
377 #size-cells = <0>;
378
379 port@0 {
380 reg = <0>;
381 adv7511_in: endpoint {
382 remote-endpoint = <&du_out_lvds0>;
383 };
384 };
385
386 port@1 {
387 reg = <1>;
388 adv7511_out: endpoint {
389 remote-endpoint = <&hdmi_con_out>;
390 };
391 };
392 };
393 };
394
395 hdmi-in@4c {
396 compatible = "adi,adv7612";
397 reg = <0x4c>;
398 interrupt-parent = <&gpio1>;
399 interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
400 default-input = <0>;
401
402 ports {
403 #address-cells = <1>;
404 #size-cells = <0>;
405
406 port@0 {
407 reg = <0>;
408 adv7612_in: endpoint {
409 remote-endpoint = <&hdmi_con_in>;
410 };
411 };
412
413 port@2 {
414 reg = <2>;
415 adv7612_out: endpoint {
416 remote-endpoint = <&vin0ep2>;
417 };
418 };
419 };
420 };
421 };
422
423 /*
424 * IIC3 and I2C3 may be switched using pinmux.
425 * IIC3/I2C3 does not appear to support fallback to GPIO.
426 */
427 i2cpwr: i2c-13 {
428 compatible = "i2c-demux-pinctrl";
429 i2c-parent = <&iic3>, <&i2c3>;
430 i2c-bus-name = "i2c-pwr";
431 #address-cells = <1>;
432 #size-cells = <0>;
433
434 pmic@58 {
435 compatible = "dlg,da9063";
436 reg = <0x58>;
437 interrupt-parent = <&irqc0>;
438 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
439 interrupt-controller;
440
441 rtc {
442 compatible = "dlg,da9063-rtc";
443 };
444
445 wdt {
446 compatible = "dlg,da9063-watchdog";
447 };
448 };
449
450 vdd_dvfs: regulator@68 {
451 compatible = "dlg,da9210";
452 reg = <0x68>;
453 interrupt-parent = <&irqc0>;
454 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
455
456 regulator-min-microvolt = <1000000>;
457 regulator-max-microvolt = <1000000>;
458 regulator-boot-on;
459 regulator-always-on;
460 };
461 };
311}; 462};
312 463
313&du { 464&du {
@@ -437,11 +588,21 @@
437 function = "iic1"; 588 function = "iic1";
438 }; 589 };
439 590
591 i2c2_pins: i2c2 {
592 groups = "i2c2";
593 function = "i2c2";
594 };
595
440 iic2_pins: iic2 { 596 iic2_pins: iic2 {
441 groups = "iic2"; 597 groups = "iic2";
442 function = "iic2"; 598 function = "iic2";
443 }; 599 };
444 600
601 i2c3_pins: i2c3 {
602 groups = "i2c3";
603 function = "i2c3";
604 };
605
445 iic3_pins: iic3 { 606 iic3_pins: iic3 {
446 groups = "iic3"; 607 groups = "iic3";
447 function = "iic3"; 608 function = "iic3";
@@ -643,124 +804,28 @@
643 pinctrl-names = "i2c-exio1"; 804 pinctrl-names = "i2c-exio1";
644}; 805};
645 806
646&iic2 { 807&i2c2 {
647 status = "okay"; 808 pinctrl-0 = <&i2c2_pins>;
648 pinctrl-0 = <&iic2_pins>; 809 pinctrl-names = "i2c-hdmi";
649 pinctrl-names = "default";
650 810
651 clock-frequency = <100000>; 811 clock-frequency = <100000>;
812};
652 813
653 ak4643: codec@12 { 814&iic2 {
654 compatible = "asahi-kasei,ak4643"; 815 pinctrl-0 = <&iic2_pins>;
655 #sound-dai-cells = <0>; 816 pinctrl-names = "i2c-hdmi";
656 reg = <0x12>;
657 };
658
659 composite-in@20 {
660 compatible = "adi,adv7180";
661 reg = <0x20>;
662 remote = <&vin1>;
663
664 port {
665 adv7180: endpoint {
666 bus-width = <8>;
667 remote-endpoint = <&vin1ep0>;
668 };
669 };
670 };
671
672 hdmi@39 {
673 compatible = "adi,adv7511w";
674 reg = <0x39>;
675 interrupt-parent = <&gpio1>;
676 interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
677
678 adi,input-depth = <8>;
679 adi,input-colorspace = "rgb";
680 adi,input-clock = "1x";
681 adi,input-style = <1>;
682 adi,input-justification = "evenly";
683
684 ports {
685 #address-cells = <1>;
686 #size-cells = <0>;
687
688 port@0 {
689 reg = <0>;
690 adv7511_in: endpoint {
691 remote-endpoint = <&du_out_lvds0>;
692 };
693 };
694
695 port@1 {
696 reg = <1>;
697 adv7511_out: endpoint {
698 remote-endpoint = <&hdmi_con_out>;
699 };
700 };
701 };
702 };
703
704 hdmi-in@4c {
705 compatible = "adi,adv7612";
706 reg = <0x4c>;
707 interrupt-parent = <&gpio1>;
708 interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
709 default-input = <0>;
710
711 ports {
712 #address-cells = <1>;
713 #size-cells = <0>;
714 817
715 port@0 { 818 clock-frequency = <100000>;
716 reg = <0>; 819};
717 adv7612_in: endpoint {
718 remote-endpoint = <&hdmi_con_in>;
719 };
720 };
721 820
722 port@2 { 821&i2c3 {
723 reg = <2>; 822 pinctrl-0 = <&i2c3_pins>;
724 adv7612_out: endpoint { 823 pinctrl-names = "i2c-pwr";
725 remote-endpoint = <&vin0ep2>;
726 };
727 };
728 };
729 };
730}; 824};
731 825
732&iic3 { 826&iic3 {
733 pinctrl-names = "default";
734 pinctrl-0 = <&iic3_pins>; 827 pinctrl-0 = <&iic3_pins>;
735 status = "okay"; 828 pinctrl-names = "i2c-pwr";
736
737 pmic@58 {
738 compatible = "dlg,da9063";
739 reg = <0x58>;
740 interrupt-parent = <&irqc0>;
741 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
742 interrupt-controller;
743
744 rtc {
745 compatible = "dlg,da9063-rtc";
746 };
747
748 wdt {
749 compatible = "dlg,da9063-watchdog";
750 };
751 };
752
753 vdd_dvfs: regulator@68 {
754 compatible = "dlg,da9210";
755 reg = <0x68>;
756 interrupt-parent = <&irqc0>;
757 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
758
759 regulator-min-microvolt = <1000000>;
760 regulator-max-microvolt = <1000000>;
761 regulator-boot-on;
762 regulator-always-on;
763 };
764}; 829};
765 830
766&pci0 { 831&pci0 {
diff --git a/arch/arm/boot/dts/r8a7790-stout.dts b/arch/arm/boot/dts/r8a7790-stout.dts
new file mode 100644
index 000000000000..a13a92c26645
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7790-stout.dts
@@ -0,0 +1,363 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Stout board
4 *
5 * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
6 */
7
8/dts-v1/;
9#include "r8a7790.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12
13/ {
14 model = "Stout";
15 compatible = "renesas,stout", "renesas,r8a7790";
16
17 aliases {
18 serial0 = &scifa0;
19 };
20
21 chosen {
22 bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
23 stdout-path = "serial0:115200n8";
24 };
25
26 memory@40000000 {
27 device_type = "memory";
28 reg = <0 0x40000000 0 0x40000000>;
29 };
30
31 leds {
32 compatible = "gpio-leds";
33 led1 {
34 gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
35 };
36 led2 {
37 gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
38 };
39 led3 {
40 gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
41 };
42 led5 {
43 gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
44 };
45 };
46
47 fixedregulator3v3: regulator-3v3 {
48 compatible = "regulator-fixed";
49 regulator-name = "fixed-3.3V";
50 regulator-min-microvolt = <3300000>;
51 regulator-max-microvolt = <3300000>;
52 regulator-boot-on;
53 regulator-always-on;
54 };
55
56 vcc_sdhi0: regulator-vcc-sdhi0 {
57 compatible = "regulator-fixed";
58
59 regulator-name = "SDHI0 Vcc";
60 regulator-min-microvolt = <3300000>;
61 regulator-max-microvolt = <3300000>;
62
63 gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
64 enable-active-high;
65 };
66
67 hdmi-out {
68 compatible = "hdmi-connector";
69 type = "a";
70
71 port {
72 hdmi_con_out: endpoint {
73 remote-endpoint = <&adv7511_out>;
74 };
75 };
76 };
77
78 osc1_clk: osc1-clock {
79 compatible = "fixed-clock";
80 #clock-cells = <0>;
81 clock-frequency = <148500000>;
82 };
83
84 osc4_clk: osc4-clock {
85 compatible = "fixed-clock";
86 #clock-cells = <0>;
87 clock-frequency = <12000000>;
88 };
89};
90
91&du {
92 pinctrl-0 = <&du_pins>;
93 pinctrl-names = "default";
94 status = "okay";
95
96 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 722>,
97 <&cpg CPG_MOD 726>, <&cpg CPG_MOD 725>,
98 <&osc1_clk>;
99 clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1", "dclkin.0";
100
101 ports {
102 port@0 {
103 endpoint {
104 remote-endpoint = <&adv7511_in>;
105 };
106 };
107 port@1 {
108 lvds_connector0: endpoint {
109 };
110 };
111 port@2 {
112 lvds_connector1: endpoint {
113 };
114 };
115 };
116};
117
118&extal_clk {
119 clock-frequency = <20000000>;
120};
121
122&pfc {
123
124 pinctrl-0 = <&scif_clk_pins>;
125 pinctrl-names = "default";
126
127 du_pins: du {
128 groups = "du_rgb888", "du_sync_1", "du_clk_out_0";
129 function = "du";
130 };
131
132 scifa0_pins: scifa0 {
133 groups = "scifa0_data_b";
134 function = "scifa0";
135 };
136
137 scif_clk_pins: scif_clk {
138 groups = "scif_clk";
139 function = "scif_clk";
140 };
141
142 ether_pins: ether {
143 groups = "eth_link", "eth_mdio", "eth_rmii";
144 function = "eth";
145 };
146
147 phy1_pins: phy1 {
148 groups = "intc_irq1";
149 function = "intc";
150 };
151
152 sdhi0_pins: sd0 {
153 groups = "sdhi0_data4", "sdhi0_ctrl";
154 function = "sdhi0";
155 power-source = <3300>;
156 };
157
158 qspi_pins: qspi {
159 groups = "qspi_ctrl", "qspi_data4";
160 function = "qspi";
161 };
162
163 iic2_pins: iic2 {
164 groups = "iic2_b";
165 function = "iic2";
166 };
167
168 iic3_pins: iic3 {
169 groups = "iic3";
170 function = "iic3";
171 };
172
173 usb0_pins: usb0 {
174 groups = "usb0";
175 function = "usb0";
176 };
177};
178
179&ether {
180 pinctrl-0 = <&ether_pins &phy1_pins>;
181 pinctrl-names = "default";
182
183 phy-handle = <&phy1>;
184 renesas,ether-link-active-low;
185 status = "okay";
186
187 phy1: ethernet-phy@1 {
188 reg = <1>;
189 interrupt-parent = <&irqc0>;
190 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
191 micrel,led-mode = <1>;
192 };
193};
194
195&cmt0 {
196 status = "okay";
197};
198
199&qspi {
200 pinctrl-0 = <&qspi_pins>;
201 pinctrl-names = "default";
202
203 status = "okay";
204
205 flash: flash@0 {
206 compatible = "spansion,s25fl512s", "jedec,spi-nor";
207 reg = <0>;
208 spi-max-frequency = <30000000>;
209 spi-tx-bus-width = <4>;
210 spi-rx-bus-width = <4>;
211 spi-cpha;
212 spi-cpol;
213 m25p,fast-read;
214
215 partitions {
216 compatible = "fixed-partitions";
217 #address-cells = <1>;
218 #size-cells = <1>;
219
220 partition@0 {
221 label = "loader";
222 reg = <0x00000000 0x00080000>;
223 read-only;
224 };
225 partition@80000 {
226 label = "uboot";
227 reg = <0x00080000 0x00040000>;
228 read-only;
229 };
230 partition@c0000 {
231 label = "uboot-env";
232 reg = <0x000c0000 0x00040000>;
233 read-only;
234 };
235 partition@100000 {
236 label = "flash";
237 reg = <0x00100000 0x03f00000>;
238 };
239 };
240 };
241};
242
243&scifa0 {
244 pinctrl-0 = <&scifa0_pins>;
245 pinctrl-names = "default";
246
247 status = "okay";
248};
249
250&scif_clk {
251 clock-frequency = <14745600>;
252};
253
254&sdhi0 {
255 pinctrl-0 = <&sdhi0_pins>;
256 pinctrl-names = "default";
257
258 vmmc-supply = <&vcc_sdhi0>;
259 cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
260 status = "okay";
261};
262
263&cpu0 {
264 cpu0-supply = <&vdd_dvfs>;
265};
266
267&iic2 {
268 status = "okay";
269 pinctrl-0 = <&iic2_pins>;
270 pinctrl-names = "default";
271
272 clock-frequency = <100000>;
273
274 hdmi@39 {
275 compatible = "adi,adv7511w";
276 reg = <0x39>;
277 interrupt-parent = <&gpio1>;
278 interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
279 clocks = <&osc4_clk>;
280 clock-names = "cec";
281
282 adi,input-depth = <8>;
283 adi,input-colorspace = "rgb";
284 adi,input-clock = "1x";
285 adi,input-style = <1>;
286 adi,input-justification = "evenly";
287
288 ports {
289 #address-cells = <1>;
290 #size-cells = <0>;
291
292 port@0 {
293 reg = <0>;
294 adv7511_in: endpoint {
295 remote-endpoint = <&du_out_rgb>;
296 };
297 };
298
299 port@1 {
300 reg = <1>;
301 adv7511_out: endpoint {
302 remote-endpoint = <&hdmi_con_out>;
303 };
304 };
305 };
306 };
307};
308
309&iic3 {
310 pinctrl-names = "default";
311 pinctrl-0 = <&iic3_pins>;
312 status = "okay";
313
314 pmic@58 {
315 compatible = "dlg,da9063";
316 reg = <0x58>;
317 interrupt-parent = <&irqc0>;
318 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
319 interrupt-controller;
320
321 rtc {
322 compatible = "dlg,da9063-rtc";
323 };
324
325 wdt {
326 compatible = "dlg,da9063-watchdog";
327 };
328 };
329
330 vdd_dvfs: regulator@68 {
331 compatible = "dlg,da9210";
332 reg = <0x68>;
333 interrupt-parent = <&irqc0>;
334 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
335
336 regulator-min-microvolt = <1000000>;
337 regulator-max-microvolt = <1000000>;
338 regulator-boot-on;
339 regulator-always-on;
340 };
341
342 vdd: regulator@70 {
343 compatible = "dlg,da9210";
344 reg = <0x70>;
345 interrupt-parent = <&irqc0>;
346 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
347
348 regulator-min-microvolt = <1000000>;
349 regulator-max-microvolt = <1000000>;
350 regulator-boot-on;
351 regulator-always-on;
352 };
353};
354
355&pci0 {
356 status = "okay";
357 pinctrl-0 = <&usb0_pins>;
358 pinctrl-names = "default";
359};
360
361&usbphy {
362 status = "okay";
363};
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index ed9a68538a55..e4367cecad18 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -17,7 +17,6 @@
17 17
18/ { 18/ {
19 compatible = "renesas,r8a7790"; 19 compatible = "renesas,r8a7790";
20 interrupt-parent = <&gic>;
21 #address-cells = <2>; 20 #address-cells = <2>;
22 #size-cells = <2>; 21 #size-cells = <2>;
23 22
@@ -41,6 +40,35 @@
41 vin3 = &vin3; 40 vin3 = &vin3;
42 }; 41 };
43 42
43 /*
44 * The external audio clocks are configured as 0 Hz fixed frequency
45 * clocks by default.
46 * Boards that provide audio clocks should override them.
47 */
48 audio_clk_a: audio_clk_a {
49 compatible = "fixed-clock";
50 #clock-cells = <0>;
51 clock-frequency = <0>;
52 };
53 audio_clk_b: audio_clk_b {
54 compatible = "fixed-clock";
55 #clock-cells = <0>;
56 clock-frequency = <0>;
57 };
58 audio_clk_c: audio_clk_c {
59 compatible = "fixed-clock";
60 #clock-cells = <0>;
61 clock-frequency = <0>;
62 };
63
64 /* External CAN clock */
65 can_clk: can {
66 compatible = "fixed-clock";
67 #clock-cells = <0>;
68 /* This value must be overridden by the board. */
69 clock-frequency = <0>;
70 };
71
44 cpus { 72 cpus {
45 #address-cells = <1>; 73 #address-cells = <1>;
46 #size-cells = <0>; 74 #size-cells = <0>;
@@ -159,1510 +187,1553 @@
159 }; 187 };
160 }; 188 };
161 189
162 thermal-zones { 190 /* External root clock */
163 cpu_thermal: cpu-thermal { 191 extal_clk: extal {
164 polling-delay-passive = <0>; 192 compatible = "fixed-clock";
165 polling-delay = <0>; 193 #clock-cells = <0>;
166 194 /* This value must be overridden by the board. */
167 thermal-sensors = <&thermal>; 195 clock-frequency = <0>;
168
169 trips {
170 cpu-crit {
171 temperature = <95000>;
172 hysteresis = <0>;
173 type = "critical";
174 };
175 };
176 cooling-maps {
177 };
178 };
179 }; 196 };
180 197
181 apmu@e6151000 { 198 /* External PCIe clock - can be overridden by the board */
182 compatible = "renesas,r8a7790-apmu", "renesas,apmu"; 199 pcie_bus_clk: pcie_bus {
183 reg = <0 0xe6151000 0 0x188>; 200 compatible = "fixed-clock";
184 cpus = <&cpu4 &cpu5 &cpu6 &cpu7>; 201 #clock-cells = <0>;
202 clock-frequency = <0>;
185 }; 203 };
186 204
187 apmu@e6152000 { 205 /* External SCIF clock */
188 compatible = "renesas,r8a7790-apmu", "renesas,apmu"; 206 scif_clk: scif {
189 reg = <0 0xe6152000 0 0x188>; 207 compatible = "fixed-clock";
190 cpus = <&cpu0 &cpu1 &cpu2 &cpu3>; 208 #clock-cells = <0>;
209 /* This value must be overridden by the board. */
210 clock-frequency = <0>;
191 }; 211 };
192 212
193 gic: interrupt-controller@f1001000 { 213 soc {
194 compatible = "arm,gic-400"; 214 compatible = "simple-bus";
195 #interrupt-cells = <3>; 215 interrupt-parent = <&gic>;
196 #address-cells = <0>;
197 interrupt-controller;
198 reg = <0 0xf1001000 0 0x1000>,
199 <0 0xf1002000 0 0x2000>,
200 <0 0xf1004000 0 0x2000>,
201 <0 0xf1006000 0 0x2000>;
202 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
203 clocks = <&cpg CPG_MOD 408>;
204 clock-names = "clk";
205 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
206 resets = <&cpg 408>;
207 };
208 216
209 gpio0: gpio@e6050000 { 217 #address-cells = <2>;
210 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 218 #size-cells = <2>;
211 reg = <0 0xe6050000 0 0x50>; 219 ranges;
212 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; 220
213 #gpio-cells = <2>; 221 gpio0: gpio@e6050000 {
214 gpio-controller; 222 compatible = "renesas,gpio-r8a7790",
215 gpio-ranges = <&pfc 0 0 32>; 223 "renesas,rcar-gen2-gpio";
216 #interrupt-cells = <2>; 224 reg = <0 0xe6050000 0 0x50>;
217 interrupt-controller; 225 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
218 clocks = <&cpg CPG_MOD 912>; 226 #gpio-cells = <2>;
219 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 227 gpio-controller;
220 resets = <&cpg 912>; 228 gpio-ranges = <&pfc 0 0 32>;
221 }; 229 #interrupt-cells = <2>;
230 interrupt-controller;
231 clocks = <&cpg CPG_MOD 912>;
232 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
233 resets = <&cpg 912>;
234 };
222 235
223 gpio1: gpio@e6051000 { 236 gpio1: gpio@e6051000 {
224 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 237 compatible = "renesas,gpio-r8a7790",
225 reg = <0 0xe6051000 0 0x50>; 238 "renesas,rcar-gen2-gpio";
226 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; 239 reg = <0 0xe6051000 0 0x50>;
227 #gpio-cells = <2>; 240 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
228 gpio-controller; 241 #gpio-cells = <2>;
229 gpio-ranges = <&pfc 0 32 30>; 242 gpio-controller;
230 #interrupt-cells = <2>; 243 gpio-ranges = <&pfc 0 32 30>;
231 interrupt-controller; 244 #interrupt-cells = <2>;
232 clocks = <&cpg CPG_MOD 911>; 245 interrupt-controller;
233 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 246 clocks = <&cpg CPG_MOD 911>;
234 resets = <&cpg 911>; 247 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
235 }; 248 resets = <&cpg 911>;
249 };
236 250
237 gpio2: gpio@e6052000 { 251 gpio2: gpio@e6052000 {
238 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 252 compatible = "renesas,gpio-r8a7790",
239 reg = <0 0xe6052000 0 0x50>; 253 "renesas,rcar-gen2-gpio";
240 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; 254 reg = <0 0xe6052000 0 0x50>;
241 #gpio-cells = <2>; 255 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
242 gpio-controller; 256 #gpio-cells = <2>;
243 gpio-ranges = <&pfc 0 64 30>; 257 gpio-controller;
244 #interrupt-cells = <2>; 258 gpio-ranges = <&pfc 0 64 30>;
245 interrupt-controller; 259 #interrupt-cells = <2>;
246 clocks = <&cpg CPG_MOD 910>; 260 interrupt-controller;
247 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 261 clocks = <&cpg CPG_MOD 910>;
248 resets = <&cpg 910>; 262 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
249 }; 263 resets = <&cpg 910>;
264 };
250 265
251 gpio3: gpio@e6053000 { 266 gpio3: gpio@e6053000 {
252 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 267 compatible = "renesas,gpio-r8a7790",
253 reg = <0 0xe6053000 0 0x50>; 268 "renesas,rcar-gen2-gpio";
254 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 269 reg = <0 0xe6053000 0 0x50>;
255 #gpio-cells = <2>; 270 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
256 gpio-controller; 271 #gpio-cells = <2>;
257 gpio-ranges = <&pfc 0 96 32>; 272 gpio-controller;
258 #interrupt-cells = <2>; 273 gpio-ranges = <&pfc 0 96 32>;
259 interrupt-controller; 274 #interrupt-cells = <2>;
260 clocks = <&cpg CPG_MOD 909>; 275 interrupt-controller;
261 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 276 clocks = <&cpg CPG_MOD 909>;
262 resets = <&cpg 909>; 277 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
263 }; 278 resets = <&cpg 909>;
279 };
264 280
265 gpio4: gpio@e6054000 { 281 gpio4: gpio@e6054000 {
266 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 282 compatible = "renesas,gpio-r8a7790",
267 reg = <0 0xe6054000 0 0x50>; 283 "renesas,rcar-gen2-gpio";
268 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; 284 reg = <0 0xe6054000 0 0x50>;
269 #gpio-cells = <2>; 285 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
270 gpio-controller; 286 #gpio-cells = <2>;
271 gpio-ranges = <&pfc 0 128 32>; 287 gpio-controller;
272 #interrupt-cells = <2>; 288 gpio-ranges = <&pfc 0 128 32>;
273 interrupt-controller; 289 #interrupt-cells = <2>;
274 clocks = <&cpg CPG_MOD 908>; 290 interrupt-controller;
275 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 291 clocks = <&cpg CPG_MOD 908>;
276 resets = <&cpg 908>; 292 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
277 }; 293 resets = <&cpg 908>;
294 };
278 295
279 gpio5: gpio@e6055000 { 296 gpio5: gpio@e6055000 {
280 compatible = "renesas,gpio-r8a7790", "renesas,rcar-gen2-gpio"; 297 compatible = "renesas,gpio-r8a7790",
281 reg = <0 0xe6055000 0 0x50>; 298 "renesas,rcar-gen2-gpio";
282 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; 299 reg = <0 0xe6055000 0 0x50>;
283 #gpio-cells = <2>; 300 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
284 gpio-controller; 301 #gpio-cells = <2>;
285 gpio-ranges = <&pfc 0 160 32>; 302 gpio-controller;
286 #interrupt-cells = <2>; 303 gpio-ranges = <&pfc 0 160 32>;
287 interrupt-controller; 304 #interrupt-cells = <2>;
288 clocks = <&cpg CPG_MOD 907>; 305 interrupt-controller;
289 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 306 clocks = <&cpg CPG_MOD 907>;
290 resets = <&cpg 907>; 307 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
291 }; 308 resets = <&cpg 907>;
309 };
292 310
293 thermal: thermal@e61f0000 { 311 pfc: pin-controller@e6060000 {
294 compatible = "renesas,thermal-r8a7790", 312 compatible = "renesas,pfc-r8a7790";
295 "renesas,rcar-gen2-thermal", 313 reg = <0 0xe6060000 0 0x250>;
296 "renesas,rcar-thermal"; 314 };
297 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
298 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
299 clocks = <&cpg CPG_MOD 522>;
300 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
301 resets = <&cpg 522>;
302 #thermal-sensor-cells = <0>;
303 };
304 315
305 timer { 316 cpg: clock-controller@e6150000 {
306 compatible = "arm,armv7-timer"; 317 compatible = "renesas,r8a7790-cpg-mssr";
307 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 318 reg = <0 0xe6150000 0 0x1000>;
308 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 319 clocks = <&extal_clk>, <&usb_extal_clk>;
309 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 320 clock-names = "extal", "usb_extal";
310 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; 321 #clock-cells = <2>;
311 }; 322 #power-domain-cells = <0>;
323 #reset-cells = <1>;
324 };
312 325
313 cmt0: timer@ffca0000 { 326 apmu@e6151000 {
314 compatible = "renesas,r8a7790-cmt0", "renesas,rcar-gen2-cmt0"; 327 compatible = "renesas,r8a7790-apmu", "renesas,apmu";
315 reg = <0 0xffca0000 0 0x1004>; 328 reg = <0 0xe6151000 0 0x188>;
316 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 329 cpus = <&cpu4 &cpu5 &cpu6 &cpu7>;
317 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 330 };
318 clocks = <&cpg CPG_MOD 124>;
319 clock-names = "fck";
320 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
321 resets = <&cpg 124>;
322
323 status = "disabled";
324 };
325 331
326 cmt1: timer@e6130000 { 332 apmu@e6152000 {
327 compatible = "renesas,r8a7790-cmt1", "renesas,rcar-gen2-cmt1"; 333 compatible = "renesas,r8a7790-apmu", "renesas,apmu";
328 reg = <0 0xe6130000 0 0x1004>; 334 reg = <0 0xe6152000 0 0x188>;
329 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 335 cpus = <&cpu0 &cpu1 &cpu2 &cpu3>;
330 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 336 };
331 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
332 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
333 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
334 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
335 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
336 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
337 clocks = <&cpg CPG_MOD 329>;
338 clock-names = "fck";
339 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
340 resets = <&cpg 329>;
341
342 status = "disabled";
343 };
344 337
345 irqc0: interrupt-controller@e61c0000 { 338 rst: reset-controller@e6160000 {
346 compatible = "renesas,irqc-r8a7790", "renesas,irqc"; 339 compatible = "renesas,r8a7790-rst";
347 #interrupt-cells = <2>; 340 reg = <0 0xe6160000 0 0x0100>;
348 interrupt-controller; 341 };
349 reg = <0 0xe61c0000 0 0x200>;
350 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
351 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
352 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
353 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
354 clocks = <&cpg CPG_MOD 407>;
355 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
356 resets = <&cpg 407>;
357 };
358 342
359 dmac0: dma-controller@e6700000 { 343 sysc: system-controller@e6180000 {
360 compatible = "renesas,dmac-r8a7790", "renesas,rcar-dmac"; 344 compatible = "renesas,r8a7790-sysc";
361 reg = <0 0xe6700000 0 0x20000>; 345 reg = <0 0xe6180000 0 0x0200>;
362 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH 346 #power-domain-cells = <1>;
363 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH 347 };
364 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
365 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
366 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
367 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
368 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
369 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
370 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
371 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
372 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
373 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
374 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
375 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
376 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
377 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
378 interrupt-names = "error",
379 "ch0", "ch1", "ch2", "ch3",
380 "ch4", "ch5", "ch6", "ch7",
381 "ch8", "ch9", "ch10", "ch11",
382 "ch12", "ch13", "ch14";
383 clocks = <&cpg CPG_MOD 219>;
384 clock-names = "fck";
385 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
386 resets = <&cpg 219>;
387 #dma-cells = <1>;
388 dma-channels = <15>;
389 };
390 348
391 dmac1: dma-controller@e6720000 { 349 irqc0: interrupt-controller@e61c0000 {
392 compatible = "renesas,dmac-r8a7790", "renesas,rcar-dmac"; 350 compatible = "renesas,irqc-r8a7790", "renesas,irqc";
393 reg = <0 0xe6720000 0 0x20000>; 351 #interrupt-cells = <2>;
394 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH 352 interrupt-controller;
395 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH 353 reg = <0 0xe61c0000 0 0x200>;
396 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH 354 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
397 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH 355 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
398 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH 356 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
399 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH 357 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
400 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH 358 clocks = <&cpg CPG_MOD 407>;
401 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH 359 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
402 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH 360 resets = <&cpg 407>;
403 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH 361 };
404 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
405 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
406 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
407 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
408 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
409 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
410 interrupt-names = "error",
411 "ch0", "ch1", "ch2", "ch3",
412 "ch4", "ch5", "ch6", "ch7",
413 "ch8", "ch9", "ch10", "ch11",
414 "ch12", "ch13", "ch14";
415 clocks = <&cpg CPG_MOD 218>;
416 clock-names = "fck";
417 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
418 resets = <&cpg 218>;
419 #dma-cells = <1>;
420 dma-channels = <15>;
421 };
422 362
423 audma0: dma-controller@ec700000 { 363 thermal: thermal@e61f0000 {
424 compatible = "renesas,dmac-r8a7790", "renesas,rcar-dmac"; 364 compatible = "renesas,thermal-r8a7790",
425 reg = <0 0xec700000 0 0x10000>; 365 "renesas,rcar-gen2-thermal",
426 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH 366 "renesas,rcar-thermal";
427 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH 367 reg = <0 0xe61f0000 0 0x10>, <0 0xe61f0100 0 0x38>;
428 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH 368 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
429 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH 369 clocks = <&cpg CPG_MOD 522>;
430 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH 370 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
431 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH 371 resets = <&cpg 522>;
432 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH 372 #thermal-sensor-cells = <0>;
433 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH 373 };
434 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
435 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
436 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
437 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
438 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
439 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
440 interrupt-names = "error",
441 "ch0", "ch1", "ch2", "ch3",
442 "ch4", "ch5", "ch6", "ch7",
443 "ch8", "ch9", "ch10", "ch11",
444 "ch12";
445 clocks = <&cpg CPG_MOD 502>;
446 clock-names = "fck";
447 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
448 resets = <&cpg 502>;
449 #dma-cells = <1>;
450 dma-channels = <13>;
451 };
452 374
453 audma1: dma-controller@ec720000 { 375 ipmmu_sy0: mmu@e6280000 {
454 compatible = "renesas,dmac-r8a7790", "renesas,rcar-dmac"; 376 compatible = "renesas,ipmmu-r8a7790",
455 reg = <0 0xec720000 0 0x10000>; 377 "renesas,ipmmu-vmsa";
456 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH 378 reg = <0 0xe6280000 0 0x1000>;
457 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH 379 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
458 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH 380 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
459 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH 381 #iommu-cells = <1>;
460 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH 382 status = "disabled";
461 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH 383 };
462 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
463 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
464 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
465 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
466 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
467 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
468 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
469 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
470 interrupt-names = "error",
471 "ch0", "ch1", "ch2", "ch3",
472 "ch4", "ch5", "ch6", "ch7",
473 "ch8", "ch9", "ch10", "ch11",
474 "ch12";
475 clocks = <&cpg CPG_MOD 501>;
476 clock-names = "fck";
477 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
478 resets = <&cpg 501>;
479 #dma-cells = <1>;
480 dma-channels = <13>;
481 };
482 384
483 usb_dmac0: dma-controller@e65a0000 { 385 ipmmu_sy1: mmu@e6290000 {
484 compatible = "renesas,r8a7790-usb-dmac", "renesas,usb-dmac"; 386 compatible = "renesas,ipmmu-r8a7790",
485 reg = <0 0xe65a0000 0 0x100>; 387 "renesas,ipmmu-vmsa";
486 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH 388 reg = <0 0xe6290000 0 0x1000>;
487 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; 389 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
488 interrupt-names = "ch0", "ch1"; 390 #iommu-cells = <1>;
489 clocks = <&cpg CPG_MOD 330>; 391 status = "disabled";
490 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 392 };
491 resets = <&cpg 330>;
492 #dma-cells = <1>;
493 dma-channels = <2>;
494 };
495 393
496 usb_dmac1: dma-controller@e65b0000 { 394 ipmmu_ds: mmu@e6740000 {
497 compatible = "renesas,r8a7790-usb-dmac", "renesas,usb-dmac"; 395 compatible = "renesas,ipmmu-r8a7790",
498 reg = <0 0xe65b0000 0 0x100>; 396 "renesas,ipmmu-vmsa";
499 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 397 reg = <0 0xe6740000 0 0x1000>;
500 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>; 398 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
501 interrupt-names = "ch0", "ch1"; 399 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
502 clocks = <&cpg CPG_MOD 331>; 400 #iommu-cells = <1>;
503 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 401 status = "disabled";
504 resets = <&cpg 331>; 402 };
505 #dma-cells = <1>;
506 dma-channels = <2>;
507 };
508 403
509 i2c0: i2c@e6508000 { 404 ipmmu_mp: mmu@ec680000 {
510 #address-cells = <1>; 405 compatible = "renesas,ipmmu-r8a7790",
511 #size-cells = <0>; 406 "renesas,ipmmu-vmsa";
512 compatible = "renesas,i2c-r8a7790", "renesas,rcar-gen2-i2c"; 407 reg = <0 0xec680000 0 0x1000>;
513 reg = <0 0xe6508000 0 0x40>; 408 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
514 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 409 #iommu-cells = <1>;
515 clocks = <&cpg CPG_MOD 931>; 410 status = "disabled";
516 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 411 };
517 resets = <&cpg 931>;
518 i2c-scl-internal-delay-ns = <110>;
519 status = "disabled";
520 };
521 412
522 i2c1: i2c@e6518000 { 413 ipmmu_mx: mmu@fe951000 {
523 #address-cells = <1>; 414 compatible = "renesas,ipmmu-r8a7790",
524 #size-cells = <0>; 415 "renesas,ipmmu-vmsa";
525 compatible = "renesas,i2c-r8a7790", "renesas,rcar-gen2-i2c"; 416 reg = <0 0xfe951000 0 0x1000>;
526 reg = <0 0xe6518000 0 0x40>; 417 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
527 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>; 418 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
528 clocks = <&cpg CPG_MOD 930>; 419 #iommu-cells = <1>;
529 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 420 status = "disabled";
530 resets = <&cpg 930>; 421 };
531 i2c-scl-internal-delay-ns = <6>;
532 status = "disabled";
533 };
534 422
535 i2c2: i2c@e6530000 { 423 ipmmu_rt: mmu@ffc80000 {
536 #address-cells = <1>; 424 compatible = "renesas,ipmmu-r8a7790",
537 #size-cells = <0>; 425 "renesas,ipmmu-vmsa";
538 compatible = "renesas,i2c-r8a7790", "renesas,rcar-gen2-i2c"; 426 reg = <0 0xffc80000 0 0x1000>;
539 reg = <0 0xe6530000 0 0x40>; 427 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
540 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>; 428 #iommu-cells = <1>;
541 clocks = <&cpg CPG_MOD 929>; 429 status = "disabled";
542 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 430 };
543 resets = <&cpg 929>;
544 i2c-scl-internal-delay-ns = <6>;
545 status = "disabled";
546 };
547 431
548 i2c3: i2c@e6540000 { 432 icram0: sram@e63a0000 {
549 #address-cells = <1>; 433 compatible = "mmio-sram";
550 #size-cells = <0>; 434 reg = <0 0xe63a0000 0 0x12000>;
551 compatible = "renesas,i2c-r8a7790", "renesas,rcar-gen2-i2c"; 435 };
552 reg = <0 0xe6540000 0 0x40>;
553 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
554 clocks = <&cpg CPG_MOD 928>;
555 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
556 resets = <&cpg 928>;
557 i2c-scl-internal-delay-ns = <110>;
558 status = "disabled";
559 };
560 436
561 iic0: i2c@e6500000 { 437 icram1: sram@e63c0000 {
562 #address-cells = <1>; 438 compatible = "mmio-sram";
563 #size-cells = <0>; 439 reg = <0 0xe63c0000 0 0x1000>;
564 compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 440 #address-cells = <1>;
565 "renesas,rmobile-iic"; 441 #size-cells = <1>;
566 reg = <0 0xe6500000 0 0x425>; 442 ranges = <0 0 0xe63c0000 0x1000>;
567 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
568 clocks = <&cpg CPG_MOD 318>;
569 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
570 <&dmac1 0x61>, <&dmac1 0x62>;
571 dma-names = "tx", "rx", "tx", "rx";
572 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
573 resets = <&cpg 318>;
574 status = "disabled";
575 };
576 443
577 iic1: i2c@e6510000 { 444 smp-sram@0 {
578 #address-cells = <1>; 445 compatible = "renesas,smp-sram";
579 #size-cells = <0>; 446 reg = <0 0x10>;
580 compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 447 };
581 "renesas,rmobile-iic"; 448 };
582 reg = <0 0xe6510000 0 0x425>;
583 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
584 clocks = <&cpg CPG_MOD 323>;
585 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
586 <&dmac1 0x65>, <&dmac1 0x66>;
587 dma-names = "tx", "rx", "tx", "rx";
588 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
589 resets = <&cpg 323>;
590 status = "disabled";
591 };
592 449
593 iic2: i2c@e6520000 { 450 i2c0: i2c@e6508000 {
594 #address-cells = <1>; 451 #address-cells = <1>;
595 #size-cells = <0>; 452 #size-cells = <0>;
596 compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 453 compatible = "renesas,i2c-r8a7790",
597 "renesas,rmobile-iic"; 454 "renesas,rcar-gen2-i2c";
598 reg = <0 0xe6520000 0 0x425>; 455 reg = <0 0xe6508000 0 0x40>;
599 interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>; 456 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
600 clocks = <&cpg CPG_MOD 300>; 457 clocks = <&cpg CPG_MOD 931>;
601 dmas = <&dmac0 0x69>, <&dmac0 0x6a>, 458 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
602 <&dmac1 0x69>, <&dmac1 0x6a>; 459 resets = <&cpg 931>;
603 dma-names = "tx", "rx", "tx", "rx"; 460 i2c-scl-internal-delay-ns = <110>;
604 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 461 status = "disabled";
605 resets = <&cpg 300>; 462 };
606 status = "disabled";
607 };
608 463
609 iic3: i2c@e60b0000 { 464 i2c1: i2c@e6518000 {
610 #address-cells = <1>; 465 #address-cells = <1>;
611 #size-cells = <0>; 466 #size-cells = <0>;
612 compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 467 compatible = "renesas,i2c-r8a7790",
613 "renesas,rmobile-iic"; 468 "renesas,rcar-gen2-i2c";
614 reg = <0 0xe60b0000 0 0x425>; 469 reg = <0 0xe6518000 0 0x40>;
615 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; 470 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
616 clocks = <&cpg CPG_MOD 926>; 471 clocks = <&cpg CPG_MOD 930>;
617 dmas = <&dmac0 0x77>, <&dmac0 0x78>, 472 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
618 <&dmac1 0x77>, <&dmac1 0x78>; 473 resets = <&cpg 930>;
619 dma-names = "tx", "rx", "tx", "rx"; 474 i2c-scl-internal-delay-ns = <6>;
620 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 475 status = "disabled";
621 resets = <&cpg 926>; 476 };
622 status = "disabled";
623 };
624 477
625 mmcif0: mmc@ee200000 { 478 i2c2: i2c@e6530000 {
626 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif"; 479 #address-cells = <1>;
627 reg = <0 0xee200000 0 0x80>; 480 #size-cells = <0>;
628 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; 481 compatible = "renesas,i2c-r8a7790",
629 clocks = <&cpg CPG_MOD 315>; 482 "renesas,rcar-gen2-i2c";
630 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>, 483 reg = <0 0xe6530000 0 0x40>;
631 <&dmac1 0xd1>, <&dmac1 0xd2>; 484 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
632 dma-names = "tx", "rx", "tx", "rx"; 485 clocks = <&cpg CPG_MOD 929>;
633 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 486 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
634 resets = <&cpg 315>; 487 resets = <&cpg 929>;
635 reg-io-width = <4>; 488 i2c-scl-internal-delay-ns = <6>;
636 status = "disabled"; 489 status = "disabled";
637 max-frequency = <97500000>; 490 };
638 };
639 491
640 mmcif1: mmc@ee220000 { 492 i2c3: i2c@e6540000 {
641 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif"; 493 #address-cells = <1>;
642 reg = <0 0xee220000 0 0x80>; 494 #size-cells = <0>;
643 interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>; 495 compatible = "renesas,i2c-r8a7790",
644 clocks = <&cpg CPG_MOD 305>; 496 "renesas,rcar-gen2-i2c";
645 dmas = <&dmac0 0xe1>, <&dmac0 0xe2>, 497 reg = <0 0xe6540000 0 0x40>;
646 <&dmac1 0xe1>, <&dmac1 0xe2>; 498 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
647 dma-names = "tx", "rx", "tx", "rx"; 499 clocks = <&cpg CPG_MOD 928>;
648 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 500 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
649 resets = <&cpg 305>; 501 resets = <&cpg 928>;
650 reg-io-width = <4>; 502 i2c-scl-internal-delay-ns = <110>;
651 status = "disabled"; 503 status = "disabled";
652 max-frequency = <97500000>; 504 };
653 };
654 505
655 pfc: pin-controller@e6060000 { 506 iic0: i2c@e6500000 {
656 compatible = "renesas,pfc-r8a7790"; 507 #address-cells = <1>;
657 reg = <0 0xe6060000 0 0x250>; 508 #size-cells = <0>;
658 }; 509 compatible = "renesas,iic-r8a7790",
510 "renesas,rcar-gen2-iic",
511 "renesas,rmobile-iic";
512 reg = <0 0xe6500000 0 0x425>;
513 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
514 clocks = <&cpg CPG_MOD 318>;
515 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
516 <&dmac1 0x61>, <&dmac1 0x62>;
517 dma-names = "tx", "rx", "tx", "rx";
518 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
519 resets = <&cpg 318>;
520 status = "disabled";
521 };
659 522
660 sdhi0: sd@ee100000 { 523 iic1: i2c@e6510000 {
661 compatible = "renesas,sdhi-r8a7790", 524 #address-cells = <1>;
662 "renesas,rcar-gen2-sdhi"; 525 #size-cells = <0>;
663 reg = <0 0xee100000 0 0x328>; 526 compatible = "renesas,iic-r8a7790",
664 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>; 527 "renesas,rcar-gen2-iic",
665 clocks = <&cpg CPG_MOD 314>; 528 "renesas,rmobile-iic";
666 dmas = <&dmac0 0xcd>, <&dmac0 0xce>, 529 reg = <0 0xe6510000 0 0x425>;
667 <&dmac1 0xcd>, <&dmac1 0xce>; 530 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
668 dma-names = "tx", "rx", "tx", "rx"; 531 clocks = <&cpg CPG_MOD 323>;
669 max-frequency = <195000000>; 532 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
670 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 533 <&dmac1 0x65>, <&dmac1 0x66>;
671 resets = <&cpg 314>; 534 dma-names = "tx", "rx", "tx", "rx";
672 status = "disabled"; 535 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
673 }; 536 resets = <&cpg 323>;
537 status = "disabled";
538 };
674 539
675 sdhi1: sd@ee120000 { 540 iic2: i2c@e6520000 {
676 compatible = "renesas,sdhi-r8a7790", 541 #address-cells = <1>;
677 "renesas,rcar-gen2-sdhi"; 542 #size-cells = <0>;
678 reg = <0 0xee120000 0 0x328>; 543 compatible = "renesas,iic-r8a7790",
679 interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>; 544 "renesas,rcar-gen2-iic",
680 clocks = <&cpg CPG_MOD 313>; 545 "renesas,rmobile-iic";
681 dmas = <&dmac0 0xc9>, <&dmac0 0xca>, 546 reg = <0 0xe6520000 0 0x425>;
682 <&dmac1 0xc9>, <&dmac1 0xca>; 547 interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
683 dma-names = "tx", "rx", "tx", "rx"; 548 clocks = <&cpg CPG_MOD 300>;
684 max-frequency = <195000000>; 549 dmas = <&dmac0 0x69>, <&dmac0 0x6a>,
685 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 550 <&dmac1 0x69>, <&dmac1 0x6a>;
686 resets = <&cpg 313>; 551 dma-names = "tx", "rx", "tx", "rx";
687 status = "disabled"; 552 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
688 }; 553 resets = <&cpg 300>;
554 status = "disabled";
555 };
689 556
690 sdhi2: sd@ee140000 { 557 iic3: i2c@e60b0000 {
691 compatible = "renesas,sdhi-r8a7790", 558 #address-cells = <1>;
692 "renesas,rcar-gen2-sdhi"; 559 #size-cells = <0>;
693 reg = <0 0xee140000 0 0x100>; 560 compatible = "renesas,iic-r8a7790",
694 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>; 561 "renesas,rcar-gen2-iic",
695 clocks = <&cpg CPG_MOD 312>; 562 "renesas,rmobile-iic";
696 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>, 563 reg = <0 0xe60b0000 0 0x425>;
697 <&dmac1 0xc1>, <&dmac1 0xc2>; 564 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
698 dma-names = "tx", "rx", "tx", "rx"; 565 clocks = <&cpg CPG_MOD 926>;
699 max-frequency = <97500000>; 566 dmas = <&dmac0 0x77>, <&dmac0 0x78>,
700 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 567 <&dmac1 0x77>, <&dmac1 0x78>;
701 resets = <&cpg 312>; 568 dma-names = "tx", "rx", "tx", "rx";
702 status = "disabled"; 569 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
703 }; 570 resets = <&cpg 926>;
571 status = "disabled";
572 };
704 573
705 sdhi3: sd@ee160000 { 574 hsusb: usb@e6590000 {
706 compatible = "renesas,sdhi-r8a7790", 575 compatible = "renesas,usbhs-r8a7790",
707 "renesas,rcar-gen2-sdhi"; 576 "renesas,rcar-gen2-usbhs";
708 reg = <0 0xee160000 0 0x100>; 577 reg = <0 0xe6590000 0 0x100>;
709 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; 578 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
710 clocks = <&cpg CPG_MOD 311>; 579 clocks = <&cpg CPG_MOD 704>;
711 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>, 580 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
712 <&dmac1 0xd3>, <&dmac1 0xd4>; 581 <&usb_dmac1 0>, <&usb_dmac1 1>;
713 dma-names = "tx", "rx", "tx", "rx"; 582 dma-names = "ch0", "ch1", "ch2", "ch3";
714 max-frequency = <97500000>; 583 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
715 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 584 resets = <&cpg 704>;
716 resets = <&cpg 311>; 585 renesas,buswait = <4>;
717 status = "disabled"; 586 phys = <&usb0 1>;
718 }; 587 phy-names = "usb";
588 status = "disabled";
589 };
719 590
720 scifa0: serial@e6c40000 { 591 usbphy: usb-phy@e6590100 {
721 compatible = "renesas,scifa-r8a7790", 592 compatible = "renesas,usb-phy-r8a7790",
722 "renesas,rcar-gen2-scifa", "renesas,scifa"; 593 "renesas,rcar-gen2-usb-phy";
723 reg = <0 0xe6c40000 0 64>; 594 reg = <0 0xe6590100 0 0x100>;
724 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 595 #address-cells = <1>;
725 clocks = <&cpg CPG_MOD 204>; 596 #size-cells = <0>;
726 clock-names = "fck"; 597 clocks = <&cpg CPG_MOD 704>;
727 dmas = <&dmac0 0x21>, <&dmac0 0x22>, 598 clock-names = "usbhs";
728 <&dmac1 0x21>, <&dmac1 0x22>; 599 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
729 dma-names = "tx", "rx", "tx", "rx"; 600 resets = <&cpg 704>;
730 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 601 status = "disabled";
731 resets = <&cpg 204>;
732 status = "disabled";
733 };
734 602
735 scifa1: serial@e6c50000 { 603 usb0: usb-channel@0 {
736 compatible = "renesas,scifa-r8a7790", 604 reg = <0>;
737 "renesas,rcar-gen2-scifa", "renesas,scifa"; 605 #phy-cells = <1>;
738 reg = <0 0xe6c50000 0 64>; 606 };
739 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; 607 usb2: usb-channel@2 {
740 clocks = <&cpg CPG_MOD 203>; 608 reg = <2>;
741 clock-names = "fck"; 609 #phy-cells = <1>;
742 dmas = <&dmac0 0x25>, <&dmac0 0x26>, 610 };
743 <&dmac1 0x25>, <&dmac1 0x26>; 611 };
744 dma-names = "tx", "rx", "tx", "rx";
745 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
746 resets = <&cpg 203>;
747 status = "disabled";
748 };
749 612
750 scifa2: serial@e6c60000 { 613 usb_dmac0: dma-controller@e65a0000 {
751 compatible = "renesas,scifa-r8a7790", 614 compatible = "renesas,r8a7790-usb-dmac",
752 "renesas,rcar-gen2-scifa", "renesas,scifa"; 615 "renesas,usb-dmac";
753 reg = <0 0xe6c60000 0 64>; 616 reg = <0 0xe65a0000 0 0x100>;
754 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; 617 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
755 clocks = <&cpg CPG_MOD 202>; 618 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
756 clock-names = "fck"; 619 interrupt-names = "ch0", "ch1";
757 dmas = <&dmac0 0x27>, <&dmac0 0x28>, 620 clocks = <&cpg CPG_MOD 330>;
758 <&dmac1 0x27>, <&dmac1 0x28>; 621 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
759 dma-names = "tx", "rx", "tx", "rx"; 622 resets = <&cpg 330>;
760 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 623 #dma-cells = <1>;
761 resets = <&cpg 202>; 624 dma-channels = <2>;
762 status = "disabled"; 625 };
763 };
764 626
765 scifb0: serial@e6c20000 { 627 usb_dmac1: dma-controller@e65b0000 {
766 compatible = "renesas,scifb-r8a7790", 628 compatible = "renesas,r8a7790-usb-dmac",
767 "renesas,rcar-gen2-scifb", "renesas,scifb"; 629 "renesas,usb-dmac";
768 reg = <0 0xe6c20000 0 0x100>; 630 reg = <0 0xe65b0000 0 0x100>;
769 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; 631 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
770 clocks = <&cpg CPG_MOD 206>; 632 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
771 clock-names = "fck"; 633 interrupt-names = "ch0", "ch1";
772 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>, 634 clocks = <&cpg CPG_MOD 331>;
773 <&dmac1 0x3d>, <&dmac1 0x3e>; 635 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
774 dma-names = "tx", "rx", "tx", "rx"; 636 resets = <&cpg 331>;
775 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 637 #dma-cells = <1>;
776 resets = <&cpg 206>; 638 dma-channels = <2>;
777 status = "disabled"; 639 };
778 };
779 640
780 scifb1: serial@e6c30000 { 641 dmac0: dma-controller@e6700000 {
781 compatible = "renesas,scifb-r8a7790", 642 compatible = "renesas,dmac-r8a7790",
782 "renesas,rcar-gen2-scifb", "renesas,scifb"; 643 "renesas,rcar-dmac";
783 reg = <0 0xe6c30000 0 0x100>; 644 reg = <0 0xe6700000 0 0x20000>;
784 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>; 645 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH
785 clocks = <&cpg CPG_MOD 207>; 646 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
786 clock-names = "fck"; 647 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
787 dmas = <&dmac0 0x19>, <&dmac0 0x1a>, 648 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
788 <&dmac1 0x19>, <&dmac1 0x1a>; 649 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
789 dma-names = "tx", "rx", "tx", "rx"; 650 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
790 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 651 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
791 resets = <&cpg 207>; 652 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
792 status = "disabled"; 653 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
793 }; 654 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
655 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
656 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
657 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
658 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
659 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
660 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
661 interrupt-names = "error",
662 "ch0", "ch1", "ch2", "ch3",
663 "ch4", "ch5", "ch6", "ch7",
664 "ch8", "ch9", "ch10", "ch11",
665 "ch12", "ch13", "ch14";
666 clocks = <&cpg CPG_MOD 219>;
667 clock-names = "fck";
668 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
669 resets = <&cpg 219>;
670 #dma-cells = <1>;
671 dma-channels = <15>;
672 };
794 673
795 scifb2: serial@e6ce0000 { 674 dmac1: dma-controller@e6720000 {
796 compatible = "renesas,scifb-r8a7790", 675 compatible = "renesas,dmac-r8a7790",
797 "renesas,rcar-gen2-scifb", "renesas,scifb"; 676 "renesas,rcar-dmac";
798 reg = <0 0xe6ce0000 0 0x100>; 677 reg = <0 0xe6720000 0 0x20000>;
799 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>; 678 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
800 clocks = <&cpg CPG_MOD 216>; 679 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
801 clock-names = "fck"; 680 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
802 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>, 681 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
803 <&dmac1 0x1d>, <&dmac1 0x1e>; 682 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
804 dma-names = "tx", "rx", "tx", "rx"; 683 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
805 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 684 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
806 resets = <&cpg 216>; 685 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
807 status = "disabled"; 686 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
808 }; 687 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
688 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
689 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
690 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
691 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
692 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
693 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
694 interrupt-names = "error",
695 "ch0", "ch1", "ch2", "ch3",
696 "ch4", "ch5", "ch6", "ch7",
697 "ch8", "ch9", "ch10", "ch11",
698 "ch12", "ch13", "ch14";
699 clocks = <&cpg CPG_MOD 218>;
700 clock-names = "fck";
701 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
702 resets = <&cpg 218>;
703 #dma-cells = <1>;
704 dma-channels = <15>;
705 };
809 706
810 scif0: serial@e6e60000 { 707 avb: ethernet@e6800000 {
811 compatible = "renesas,scif-r8a7790", "renesas,rcar-gen2-scif", 708 compatible = "renesas,etheravb-r8a7790",
812 "renesas,scif"; 709 "renesas,etheravb-rcar-gen2";
813 reg = <0 0xe6e60000 0 64>; 710 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
814 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>; 711 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
815 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7790_CLK_ZS>, 712 clocks = <&cpg CPG_MOD 812>;
816 <&scif_clk>; 713 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
817 clock-names = "fck", "brg_int", "scif_clk"; 714 resets = <&cpg 812>;
818 dmas = <&dmac0 0x29>, <&dmac0 0x2a>, 715 #address-cells = <1>;
819 <&dmac1 0x29>, <&dmac1 0x2a>; 716 #size-cells = <0>;
820 dma-names = "tx", "rx", "tx", "rx"; 717 status = "disabled";
821 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 718 };
822 resets = <&cpg 721>;
823 status = "disabled";
824 };
825 719
826 scif1: serial@e6e68000 { 720 qspi: spi@e6b10000 {
827 compatible = "renesas,scif-r8a7790", "renesas,rcar-gen2-scif", 721 compatible = "renesas,qspi-r8a7790", "renesas,qspi";
828 "renesas,scif"; 722 reg = <0 0xe6b10000 0 0x2c>;
829 reg = <0 0xe6e68000 0 64>; 723 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
830 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>; 724 clocks = <&cpg CPG_MOD 917>;
831 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7790_CLK_ZS>, 725 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
832 <&scif_clk>; 726 <&dmac1 0x17>, <&dmac1 0x18>;
833 clock-names = "fck", "brg_int", "scif_clk"; 727 dma-names = "tx", "rx", "tx", "rx";
834 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>, 728 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
835 <&dmac1 0x2d>, <&dmac1 0x2e>; 729 resets = <&cpg 917>;
836 dma-names = "tx", "rx", "tx", "rx"; 730 num-cs = <1>;
837 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 731 #address-cells = <1>;
838 resets = <&cpg 720>; 732 #size-cells = <0>;
839 status = "disabled"; 733 status = "disabled";
840 }; 734 };
841 735
842 scif2: serial@e6e56000 { 736 scifa0: serial@e6c40000 {
843 compatible = "renesas,scif-r8a7790", "renesas,rcar-gen2-scif", 737 compatible = "renesas,scifa-r8a7790",
844 "renesas,scif"; 738 "renesas,rcar-gen2-scifa", "renesas,scifa";
845 reg = <0 0xe6e56000 0 64>; 739 reg = <0 0xe6c40000 0 64>;
846 interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>; 740 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
847 clocks = <&cpg CPG_MOD 310>, <&cpg CPG_CORE R8A7790_CLK_ZS>, 741 clocks = <&cpg CPG_MOD 204>;
848 <&scif_clk>; 742 clock-names = "fck";
849 clock-names = "fck", "brg_int", "scif_clk"; 743 dmas = <&dmac0 0x21>, <&dmac0 0x22>,
850 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>, 744 <&dmac1 0x21>, <&dmac1 0x22>;
851 <&dmac1 0x2b>, <&dmac1 0x2c>; 745 dma-names = "tx", "rx", "tx", "rx";
852 dma-names = "tx", "rx", "tx", "rx"; 746 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
853 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 747 resets = <&cpg 204>;
854 resets = <&cpg 310>; 748 status = "disabled";
855 status = "disabled"; 749 };
856 };
857 750
858 hscif0: serial@e62c0000 { 751 scifa1: serial@e6c50000 {
859 compatible = "renesas,hscif-r8a7790", 752 compatible = "renesas,scifa-r8a7790",
860 "renesas,rcar-gen2-hscif", "renesas,hscif"; 753 "renesas,rcar-gen2-scifa", "renesas,scifa";
861 reg = <0 0xe62c0000 0 96>; 754 reg = <0 0xe6c50000 0 64>;
862 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>; 755 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
863 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7790_CLK_ZS>, 756 clocks = <&cpg CPG_MOD 203>;
864 <&scif_clk>; 757 clock-names = "fck";
865 clock-names = "fck", "brg_int", "scif_clk"; 758 dmas = <&dmac0 0x25>, <&dmac0 0x26>,
866 dmas = <&dmac0 0x39>, <&dmac0 0x3a>, 759 <&dmac1 0x25>, <&dmac1 0x26>;
867 <&dmac1 0x39>, <&dmac1 0x3a>; 760 dma-names = "tx", "rx", "tx", "rx";
868 dma-names = "tx", "rx", "tx", "rx"; 761 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
869 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 762 resets = <&cpg 203>;
870 resets = <&cpg 717>; 763 status = "disabled";
871 status = "disabled"; 764 };
872 };
873 765
874 hscif1: serial@e62c8000 { 766 scifa2: serial@e6c60000 {
875 compatible = "renesas,hscif-r8a7790", 767 compatible = "renesas,scifa-r8a7790",
876 "renesas,rcar-gen2-hscif", "renesas,hscif"; 768 "renesas,rcar-gen2-scifa", "renesas,scifa";
877 reg = <0 0xe62c8000 0 96>; 769 reg = <0 0xe6c60000 0 64>;
878 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>; 770 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
879 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7790_CLK_ZS>, 771 clocks = <&cpg CPG_MOD 202>;
880 <&scif_clk>; 772 clock-names = "fck";
881 clock-names = "fck", "brg_int", "scif_clk"; 773 dmas = <&dmac0 0x27>, <&dmac0 0x28>,
882 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>, 774 <&dmac1 0x27>, <&dmac1 0x28>;
883 <&dmac1 0x4d>, <&dmac1 0x4e>; 775 dma-names = "tx", "rx", "tx", "rx";
884 dma-names = "tx", "rx", "tx", "rx"; 776 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
885 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 777 resets = <&cpg 202>;
886 resets = <&cpg 716>; 778 status = "disabled";
887 status = "disabled"; 779 };
888 };
889 780
890 icram0: sram@e63a0000 { 781 scifb0: serial@e6c20000 {
891 compatible = "mmio-sram"; 782 compatible = "renesas,scifb-r8a7790",
892 reg = <0 0xe63a0000 0 0x12000>; 783 "renesas,rcar-gen2-scifb", "renesas,scifb";
893 }; 784 reg = <0 0xe6c20000 0 0x100>;
785 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
786 clocks = <&cpg CPG_MOD 206>;
787 clock-names = "fck";
788 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>,
789 <&dmac1 0x3d>, <&dmac1 0x3e>;
790 dma-names = "tx", "rx", "tx", "rx";
791 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
792 resets = <&cpg 206>;
793 status = "disabled";
794 };
894 795
895 icram1: sram@e63c0000 { 796 scifb1: serial@e6c30000 {
896 compatible = "mmio-sram"; 797 compatible = "renesas,scifb-r8a7790",
897 reg = <0 0xe63c0000 0 0x1000>; 798 "renesas,rcar-gen2-scifb", "renesas,scifb";
898 #address-cells = <1>; 799 reg = <0 0xe6c30000 0 0x100>;
899 #size-cells = <1>; 800 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
900 ranges = <0 0 0xe63c0000 0x1000>; 801 clocks = <&cpg CPG_MOD 207>;
802 clock-names = "fck";
803 dmas = <&dmac0 0x19>, <&dmac0 0x1a>,
804 <&dmac1 0x19>, <&dmac1 0x1a>;
805 dma-names = "tx", "rx", "tx", "rx";
806 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
807 resets = <&cpg 207>;
808 status = "disabled";
809 };
901 810
902 smp-sram@0 { 811 scifb2: serial@e6ce0000 {
903 compatible = "renesas,smp-sram"; 812 compatible = "renesas,scifb-r8a7790",
904 reg = <0 0x10>; 813 "renesas,rcar-gen2-scifb", "renesas,scifb";
814 reg = <0 0xe6ce0000 0 0x100>;
815 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
816 clocks = <&cpg CPG_MOD 216>;
817 clock-names = "fck";
818 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>,
819 <&dmac1 0x1d>, <&dmac1 0x1e>;
820 dma-names = "tx", "rx", "tx", "rx";
821 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
822 resets = <&cpg 216>;
823 status = "disabled";
905 }; 824 };
906 };
907 825
908 ether: ethernet@ee700000 { 826 scif0: serial@e6e60000 {
909 compatible = "renesas,ether-r8a7790", 827 compatible = "renesas,scif-r8a7790",
910 "renesas,rcar-gen2-ether"; 828 "renesas,rcar-gen2-scif",
911 reg = <0 0xee700000 0 0x400>; 829 "renesas,scif";
912 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; 830 reg = <0 0xe6e60000 0 64>;
913 clocks = <&cpg CPG_MOD 813>; 831 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
914 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 832 clocks = <&cpg CPG_MOD 721>,
915 resets = <&cpg 813>; 833 <&cpg CPG_CORE R8A7790_CLK_ZS>, <&scif_clk>;
916 phy-mode = "rmii"; 834 clock-names = "fck", "brg_int", "scif_clk";
917 #address-cells = <1>; 835 dmas = <&dmac0 0x29>, <&dmac0 0x2a>,
918 #size-cells = <0>; 836 <&dmac1 0x29>, <&dmac1 0x2a>;
919 status = "disabled"; 837 dma-names = "tx", "rx", "tx", "rx";
920 }; 838 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
839 resets = <&cpg 721>;
840 status = "disabled";
841 };
921 842
922 avb: ethernet@e6800000 { 843 scif1: serial@e6e68000 {
923 compatible = "renesas,etheravb-r8a7790", 844 compatible = "renesas,scif-r8a7790",
924 "renesas,etheravb-rcar-gen2"; 845 "renesas,rcar-gen2-scif",
925 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>; 846 "renesas,scif";
926 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>; 847 reg = <0 0xe6e68000 0 64>;
927 clocks = <&cpg CPG_MOD 812>; 848 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
928 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 849 clocks = <&cpg CPG_MOD 720>,
929 resets = <&cpg 812>; 850 <&cpg CPG_CORE R8A7790_CLK_ZS>, <&scif_clk>;
930 #address-cells = <1>; 851 clock-names = "fck", "brg_int", "scif_clk";
931 #size-cells = <0>; 852 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>,
932 status = "disabled"; 853 <&dmac1 0x2d>, <&dmac1 0x2e>;
933 }; 854 dma-names = "tx", "rx", "tx", "rx";
855 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
856 resets = <&cpg 720>;
857 status = "disabled";
858 };
934 859
935 sata0: sata@ee300000 { 860 scif2: serial@e6e56000 {
936 compatible = "renesas,sata-r8a7790", "renesas,rcar-gen2-sata"; 861 compatible = "renesas,scif-r8a7790",
937 reg = <0 0xee300000 0 0x2000>; 862 "renesas,rcar-gen2-scif",
938 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; 863 "renesas,scif";
939 clocks = <&cpg CPG_MOD 815>; 864 reg = <0 0xe6e56000 0 64>;
940 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 865 interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
941 resets = <&cpg 815>; 866 clocks = <&cpg CPG_MOD 310>,
942 status = "disabled"; 867 <&cpg CPG_CORE R8A7790_CLK_ZS>, <&scif_clk>;
943 }; 868 clock-names = "fck", "brg_int", "scif_clk";
869 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>,
870 <&dmac1 0x2b>, <&dmac1 0x2c>;
871 dma-names = "tx", "rx", "tx", "rx";
872 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
873 resets = <&cpg 310>;
874 status = "disabled";
875 };
944 876
945 sata1: sata@ee500000 { 877 hscif0: serial@e62c0000 {
946 compatible = "renesas,sata-r8a7790", "renesas,rcar-gen2-sata"; 878 compatible = "renesas,hscif-r8a7790",
947 reg = <0 0xee500000 0 0x2000>; 879 "renesas,rcar-gen2-hscif", "renesas,hscif";
948 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; 880 reg = <0 0xe62c0000 0 96>;
949 clocks = <&cpg CPG_MOD 814>; 881 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
950 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 882 clocks = <&cpg CPG_MOD 717>,
951 resets = <&cpg 814>; 883 <&cpg CPG_CORE R8A7790_CLK_ZS>, <&scif_clk>;
952 status = "disabled"; 884 clock-names = "fck", "brg_int", "scif_clk";
953 }; 885 dmas = <&dmac0 0x39>, <&dmac0 0x3a>,
886 <&dmac1 0x39>, <&dmac1 0x3a>;
887 dma-names = "tx", "rx", "tx", "rx";
888 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
889 resets = <&cpg 717>;
890 status = "disabled";
891 };
954 892
955 hsusb: usb@e6590000 { 893 hscif1: serial@e62c8000 {
956 compatible = "renesas,usbhs-r8a7790", "renesas,rcar-gen2-usbhs"; 894 compatible = "renesas,hscif-r8a7790",
957 reg = <0 0xe6590000 0 0x100>; 895 "renesas,rcar-gen2-hscif", "renesas,hscif";
958 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; 896 reg = <0 0xe62c8000 0 96>;
959 clocks = <&cpg CPG_MOD 704>; 897 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
960 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>, 898 clocks = <&cpg CPG_MOD 716>,
961 <&usb_dmac1 0>, <&usb_dmac1 1>; 899 <&cpg CPG_CORE R8A7790_CLK_ZS>, <&scif_clk>;
962 dma-names = "ch0", "ch1", "ch2", "ch3"; 900 clock-names = "fck", "brg_int", "scif_clk";
963 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 901 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>,
964 resets = <&cpg 704>; 902 <&dmac1 0x4d>, <&dmac1 0x4e>;
965 renesas,buswait = <4>; 903 dma-names = "tx", "rx", "tx", "rx";
966 phys = <&usb0 1>; 904 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
967 phy-names = "usb"; 905 resets = <&cpg 716>;
968 status = "disabled"; 906 status = "disabled";
969 }; 907 };
970 908
971 usbphy: usb-phy@e6590100 { 909 msiof0: spi@e6e20000 {
972 compatible = "renesas,usb-phy-r8a7790", 910 compatible = "renesas,msiof-r8a7790",
973 "renesas,rcar-gen2-usb-phy"; 911 "renesas,rcar-gen2-msiof";
974 reg = <0 0xe6590100 0 0x100>; 912 reg = <0 0xe6e20000 0 0x0064>;
975 #address-cells = <1>; 913 interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
976 #size-cells = <0>; 914 clocks = <&cpg CPG_MOD 0>;
977 clocks = <&cpg CPG_MOD 704>; 915 dmas = <&dmac0 0x51>, <&dmac0 0x52>,
978 clock-names = "usbhs"; 916 <&dmac1 0x51>, <&dmac1 0x52>;
979 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 917 dma-names = "tx", "rx", "tx", "rx";
980 resets = <&cpg 704>; 918 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
981 status = "disabled"; 919 resets = <&cpg 0>;
920 #address-cells = <1>;
921 #size-cells = <0>;
922 status = "disabled";
923 };
982 924
983 usb0: usb-channel@0 { 925 msiof1: spi@e6e10000 {
984 reg = <0>; 926 compatible = "renesas,msiof-r8a7790",
985 #phy-cells = <1>; 927 "renesas,rcar-gen2-msiof";
928 reg = <0 0xe6e10000 0 0x0064>;
929 interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
930 clocks = <&cpg CPG_MOD 208>;
931 dmas = <&dmac0 0x55>, <&dmac0 0x56>,
932 <&dmac1 0x55>, <&dmac1 0x56>;
933 dma-names = "tx", "rx", "tx", "rx";
934 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
935 resets = <&cpg 208>;
936 #address-cells = <1>;
937 #size-cells = <0>;
938 status = "disabled";
986 }; 939 };
987 usb2: usb-channel@2 { 940
988 reg = <2>; 941 msiof2: spi@e6e00000 {
989 #phy-cells = <1>; 942 compatible = "renesas,msiof-r8a7790",
943 "renesas,rcar-gen2-msiof";
944 reg = <0 0xe6e00000 0 0x0064>;
945 interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
946 clocks = <&cpg CPG_MOD 205>;
947 dmas = <&dmac0 0x41>, <&dmac0 0x42>,
948 <&dmac1 0x41>, <&dmac1 0x42>;
949 dma-names = "tx", "rx", "tx", "rx";
950 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
951 resets = <&cpg 205>;
952 #address-cells = <1>;
953 #size-cells = <0>;
954 status = "disabled";
990 }; 955 };
991 };
992 956
993 vin0: video@e6ef0000 { 957 msiof3: spi@e6c90000 {
994 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; 958 compatible = "renesas,msiof-r8a7790",
995 reg = <0 0xe6ef0000 0 0x1000>; 959 "renesas,rcar-gen2-msiof";
996 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 960 reg = <0 0xe6c90000 0 0x0064>;
997 clocks = <&cpg CPG_MOD 811>; 961 interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
998 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 962 clocks = <&cpg CPG_MOD 215>;
999 resets = <&cpg 811>; 963 dmas = <&dmac0 0x45>, <&dmac0 0x46>,
1000 status = "disabled"; 964 <&dmac1 0x45>, <&dmac1 0x46>;
1001 }; 965 dma-names = "tx", "rx", "tx", "rx";
966 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
967 resets = <&cpg 215>;
968 #address-cells = <1>;
969 #size-cells = <0>;
970 status = "disabled";
971 };
1002 972
1003 vin1: video@e6ef1000 { 973 can0: can@e6e80000 {
1004 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; 974 compatible = "renesas,can-r8a7790",
1005 reg = <0 0xe6ef1000 0 0x1000>; 975 "renesas,rcar-gen2-can";
1006 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 976 reg = <0 0xe6e80000 0 0x1000>;
1007 clocks = <&cpg CPG_MOD 810>; 977 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
1008 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 978 clocks = <&cpg CPG_MOD 916>,
1009 resets = <&cpg 810>; 979 <&cpg CPG_CORE R8A7790_CLK_RCAN>, <&can_clk>;
1010 status = "disabled"; 980 clock-names = "clkp1", "clkp2", "can_clk";
1011 }; 981 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
982 resets = <&cpg 916>;
983 status = "disabled";
984 };
1012 985
1013 vin2: video@e6ef2000 { 986 can1: can@e6e88000 {
1014 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; 987 compatible = "renesas,can-r8a7790",
1015 reg = <0 0xe6ef2000 0 0x1000>; 988 "renesas,rcar-gen2-can";
1016 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>; 989 reg = <0 0xe6e88000 0 0x1000>;
1017 clocks = <&cpg CPG_MOD 809>; 990 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
1018 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 991 clocks = <&cpg CPG_MOD 915>,
1019 resets = <&cpg 809>; 992 <&cpg CPG_CORE R8A7790_CLK_RCAN>, <&can_clk>;
1020 status = "disabled"; 993 clock-names = "clkp1", "clkp2", "can_clk";
1021 }; 994 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
995 resets = <&cpg 915>;
996 status = "disabled";
997 };
1022 998
1023 vin3: video@e6ef3000 { 999 vin0: video@e6ef0000 {
1024 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; 1000 compatible = "renesas,vin-r8a7790",
1025 reg = <0 0xe6ef3000 0 0x1000>; 1001 "renesas,rcar-gen2-vin";
1026 interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; 1002 reg = <0 0xe6ef0000 0 0x1000>;
1027 clocks = <&cpg CPG_MOD 808>; 1003 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
1028 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1004 clocks = <&cpg CPG_MOD 811>;
1029 resets = <&cpg 808>; 1005 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1030 status = "disabled"; 1006 resets = <&cpg 811>;
1031 }; 1007 status = "disabled";
1008 };
1032 1009
1033 vsp@fe920000 { 1010 vin1: video@e6ef1000 {
1034 compatible = "renesas,vsp1"; 1011 compatible = "renesas,vin-r8a7790",
1035 reg = <0 0xfe920000 0 0x8000>; 1012 "renesas,rcar-gen2-vin";
1036 interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>; 1013 reg = <0 0xe6ef1000 0 0x1000>;
1037 clocks = <&cpg CPG_MOD 130>; 1014 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
1038 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1015 clocks = <&cpg CPG_MOD 810>;
1039 resets = <&cpg 130>; 1016 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1040 }; 1017 resets = <&cpg 810>;
1018 status = "disabled";
1019 };
1041 1020
1042 vsp@fe928000 { 1021 vin2: video@e6ef2000 {
1043 compatible = "renesas,vsp1"; 1022 compatible = "renesas,vin-r8a7790",
1044 reg = <0 0xfe928000 0 0x8000>; 1023 "renesas,rcar-gen2-vin";
1045 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>; 1024 reg = <0 0xe6ef2000 0 0x1000>;
1046 clocks = <&cpg CPG_MOD 131>; 1025 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
1047 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1026 clocks = <&cpg CPG_MOD 809>;
1048 resets = <&cpg 131>; 1027 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1049 }; 1028 resets = <&cpg 809>;
1029 status = "disabled";
1030 };
1050 1031
1051 vsp@fe930000 { 1032 vin3: video@e6ef3000 {
1052 compatible = "renesas,vsp1"; 1033 compatible = "renesas,vin-r8a7790",
1053 reg = <0 0xfe930000 0 0x8000>; 1034 "renesas,rcar-gen2-vin";
1054 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>; 1035 reg = <0 0xe6ef3000 0 0x1000>;
1055 clocks = <&cpg CPG_MOD 128>; 1036 interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>;
1056 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1037 clocks = <&cpg CPG_MOD 808>;
1057 resets = <&cpg 128>; 1038 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1058 }; 1039 resets = <&cpg 808>;
1040 status = "disabled";
1041 };
1059 1042
1060 vsp@fe938000 { 1043 rcar_sound: sound@ec500000 {
1061 compatible = "renesas,vsp1"; 1044 /*
1062 reg = <0 0xfe938000 0 0x8000>; 1045 * #sound-dai-cells is required
1063 interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>; 1046 *
1064 clocks = <&cpg CPG_MOD 127>; 1047 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
1065 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1048 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
1066 resets = <&cpg 127>; 1049 */
1067 }; 1050 compatible = "renesas,rcar_sound-r8a7790",
1051 "renesas,rcar_sound-gen2";
1052 reg = <0 0xec500000 0 0x1000>, /* SCU */
1053 <0 0xec5a0000 0 0x100>, /* ADG */
1054 <0 0xec540000 0 0x1000>, /* SSIU */
1055 <0 0xec541000 0 0x280>, /* SSI */
1056 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
1057 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
1058
1059 clocks = <&cpg CPG_MOD 1005>,
1060 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
1061 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
1062 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
1063 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
1064 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
1065 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
1066 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
1067 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
1068 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
1069 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
1070 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1071 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1072 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1073 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
1074 <&cpg CPG_CORE R8A7790_CLK_M2>;
1075 clock-names = "ssi-all",
1076 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
1077 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
1078 "ssi.1", "ssi.0",
1079 "src.9", "src.8", "src.7", "src.6",
1080 "src.5", "src.4", "src.3", "src.2",
1081 "src.1", "src.0",
1082 "ctu.0", "ctu.1",
1083 "mix.0", "mix.1",
1084 "dvc.0", "dvc.1",
1085 "clk_a", "clk_b", "clk_c", "clk_i";
1086 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1087 resets = <&cpg 1005>,
1088 <&cpg 1006>, <&cpg 1007>,
1089 <&cpg 1008>, <&cpg 1009>,
1090 <&cpg 1010>, <&cpg 1011>,
1091 <&cpg 1012>, <&cpg 1013>,
1092 <&cpg 1014>, <&cpg 1015>;
1093 reset-names = "ssi-all",
1094 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
1095 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
1096 "ssi.1", "ssi.0";
1097
1098 status = "disabled";
1099
1100 rcar_sound,dvc {
1101 dvc0: dvc-0 {
1102 dmas = <&audma1 0xbc>;
1103 dma-names = "tx";
1104 };
1105 dvc1: dvc-1 {
1106 dmas = <&audma1 0xbe>;
1107 dma-names = "tx";
1108 };
1109 };
1068 1110
1069 du: display@feb00000 { 1111 rcar_sound,mix {
1070 compatible = "renesas,du-r8a7790"; 1112 mix0: mix-0 { };
1071 reg = <0 0xfeb00000 0 0x70000>, 1113 mix1: mix-1 { };
1072 <0 0xfeb90000 0 0x1c>, 1114 };
1073 <0 0xfeb94000 0 0x1c>;
1074 reg-names = "du", "lvds.0", "lvds.1";
1075 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1076 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
1077 <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>;
1078 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>,
1079 <&cpg CPG_MOD 722>, <&cpg CPG_MOD 726>,
1080 <&cpg CPG_MOD 725>;
1081 clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1";
1082 status = "disabled";
1083
1084 ports {
1085 #address-cells = <1>;
1086 #size-cells = <0>;
1087 1115
1088 port@0 { 1116 rcar_sound,ctu {
1089 reg = <0>; 1117 ctu00: ctu-0 { };
1090 du_out_rgb: endpoint { 1118 ctu01: ctu-1 { };
1091 }; 1119 ctu02: ctu-2 { };
1120 ctu03: ctu-3 { };
1121 ctu10: ctu-4 { };
1122 ctu11: ctu-5 { };
1123 ctu12: ctu-6 { };
1124 ctu13: ctu-7 { };
1092 }; 1125 };
1093 port@1 { 1126
1094 reg = <1>; 1127 rcar_sound,src {
1095 du_out_lvds0: endpoint { 1128 src0: src-0 {
1129 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
1130 dmas = <&audma0 0x85>, <&audma1 0x9a>;
1131 dma-names = "rx", "tx";
1132 };
1133 src1: src-1 {
1134 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
1135 dmas = <&audma0 0x87>, <&audma1 0x9c>;
1136 dma-names = "rx", "tx";
1137 };
1138 src2: src-2 {
1139 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
1140 dmas = <&audma0 0x89>, <&audma1 0x9e>;
1141 dma-names = "rx", "tx";
1142 };
1143 src3: src-3 {
1144 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
1145 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
1146 dma-names = "rx", "tx";
1147 };
1148 src4: src-4 {
1149 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1150 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
1151 dma-names = "rx", "tx";
1152 };
1153 src5: src-5 {
1154 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1155 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
1156 dma-names = "rx", "tx";
1157 };
1158 src6: src-6 {
1159 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1160 dmas = <&audma0 0x91>, <&audma1 0xb4>;
1161 dma-names = "rx", "tx";
1162 };
1163 src7: src-7 {
1164 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1165 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1166 dma-names = "rx", "tx";
1167 };
1168 src8: src-8 {
1169 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1170 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1171 dma-names = "rx", "tx";
1172 };
1173 src9: src-9 {
1174 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1175 dmas = <&audma0 0x97>, <&audma1 0xba>;
1176 dma-names = "rx", "tx";
1096 }; 1177 };
1097 }; 1178 };
1098 port@2 { 1179
1099 reg = <2>; 1180 rcar_sound,ssi {
1100 du_out_lvds1: endpoint { 1181 ssi0: ssi-0 {
1182 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
1183 dmas = <&audma0 0x01>, <&audma1 0x02>,
1184 <&audma0 0x15>, <&audma1 0x16>;
1185 dma-names = "rx", "tx", "rxu", "txu";
1186 };
1187 ssi1: ssi-1 {
1188 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1189 dmas = <&audma0 0x03>, <&audma1 0x04>,
1190 <&audma0 0x49>, <&audma1 0x4a>;
1191 dma-names = "rx", "tx", "rxu", "txu";
1192 };
1193 ssi2: ssi-2 {
1194 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1195 dmas = <&audma0 0x05>, <&audma1 0x06>,
1196 <&audma0 0x63>, <&audma1 0x64>;
1197 dma-names = "rx", "tx", "rxu", "txu";
1198 };
1199 ssi3: ssi-3 {
1200 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1201 dmas = <&audma0 0x07>, <&audma1 0x08>,
1202 <&audma0 0x6f>, <&audma1 0x70>;
1203 dma-names = "rx", "tx", "rxu", "txu";
1204 };
1205 ssi4: ssi-4 {
1206 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1207 dmas = <&audma0 0x09>, <&audma1 0x0a>,
1208 <&audma0 0x71>, <&audma1 0x72>;
1209 dma-names = "rx", "tx", "rxu", "txu";
1210 };
1211 ssi5: ssi-5 {
1212 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1213 dmas = <&audma0 0x0b>, <&audma1 0x0c>,
1214 <&audma0 0x73>, <&audma1 0x74>;
1215 dma-names = "rx", "tx", "rxu", "txu";
1216 };
1217 ssi6: ssi-6 {
1218 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1219 dmas = <&audma0 0x0d>, <&audma1 0x0e>,
1220 <&audma0 0x75>, <&audma1 0x76>;
1221 dma-names = "rx", "tx", "rxu", "txu";
1222 };
1223 ssi7: ssi-7 {
1224 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1225 dmas = <&audma0 0x0f>, <&audma1 0x10>,
1226 <&audma0 0x79>, <&audma1 0x7a>;
1227 dma-names = "rx", "tx", "rxu", "txu";
1228 };
1229 ssi8: ssi-8 {
1230 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1231 dmas = <&audma0 0x11>, <&audma1 0x12>,
1232 <&audma0 0x7b>, <&audma1 0x7c>;
1233 dma-names = "rx", "tx", "rxu", "txu";
1234 };
1235 ssi9: ssi-9 {
1236 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1237 dmas = <&audma0 0x13>, <&audma1 0x14>,
1238 <&audma0 0x7d>, <&audma1 0x7e>;
1239 dma-names = "rx", "tx", "rxu", "txu";
1101 }; 1240 };
1102 }; 1241 };
1103 }; 1242 };
1104 };
1105 1243
1106 can0: can@e6e80000 { 1244 audma0: dma-controller@ec700000 {
1107 compatible = "renesas,can-r8a7790", "renesas,rcar-gen2-can"; 1245 compatible = "renesas,dmac-r8a7790",
1108 reg = <0 0xe6e80000 0 0x1000>; 1246 "renesas,rcar-dmac";
1109 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>; 1247 reg = <0 0xec700000 0 0x10000>;
1110 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7790_CLK_RCAN>, 1248 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1111 <&can_clk>; 1249 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1112 clock-names = "clkp1", "clkp2", "can_clk"; 1250 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1113 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1251 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1114 resets = <&cpg 916>; 1252 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1115 status = "disabled"; 1253 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1116 }; 1254 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1117 1255 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1118 can1: can@e6e88000 { 1256 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1119 compatible = "renesas,can-r8a7790", "renesas,rcar-gen2-can"; 1257 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1120 reg = <0 0xe6e88000 0 0x1000>; 1258 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1121 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; 1259 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1122 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7790_CLK_RCAN>, 1260 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1123 <&can_clk>; 1261 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1124 clock-names = "clkp1", "clkp2", "can_clk"; 1262 interrupt-names = "error",
1125 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1263 "ch0", "ch1", "ch2", "ch3",
1126 resets = <&cpg 915>; 1264 "ch4", "ch5", "ch6", "ch7",
1127 status = "disabled"; 1265 "ch8", "ch9", "ch10", "ch11",
1128 }; 1266 "ch12";
1129 1267 clocks = <&cpg CPG_MOD 502>;
1130 jpu: jpeg-codec@fe980000 { 1268 clock-names = "fck";
1131 compatible = "renesas,jpu-r8a7790", "renesas,rcar-gen2-jpu"; 1269 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1132 reg = <0 0xfe980000 0 0x10300>; 1270 resets = <&cpg 502>;
1133 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; 1271 #dma-cells = <1>;
1134 clocks = <&cpg CPG_MOD 106>; 1272 dma-channels = <13>;
1135 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1273 };
1136 resets = <&cpg 106>;
1137 };
1138
1139 /* External root clock */
1140 extal_clk: extal {
1141 compatible = "fixed-clock";
1142 #clock-cells = <0>;
1143 /* This value must be overridden by the board. */
1144 clock-frequency = <0>;
1145 };
1146
1147 /* External PCIe clock - can be overridden by the board */
1148 pcie_bus_clk: pcie_bus {
1149 compatible = "fixed-clock";
1150 #clock-cells = <0>;
1151 clock-frequency = <0>;
1152 };
1153 1274
1154 /* 1275 audma1: dma-controller@ec720000 {
1155 * The external audio clocks are configured as 0 Hz fixed frequency 1276 compatible = "renesas,dmac-r8a7790",
1156 * clocks by default. 1277 "renesas,rcar-dmac";
1157 * Boards that provide audio clocks should override them. 1278 reg = <0 0xec720000 0 0x10000>;
1158 */ 1279 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH
1159 audio_clk_a: audio_clk_a { 1280 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
1160 compatible = "fixed-clock"; 1281 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
1161 #clock-cells = <0>; 1282 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
1162 clock-frequency = <0>; 1283 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
1163 }; 1284 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
1164 audio_clk_b: audio_clk_b { 1285 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
1165 compatible = "fixed-clock"; 1286 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
1166 #clock-cells = <0>; 1287 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
1167 clock-frequency = <0>; 1288 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
1168 }; 1289 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
1169 audio_clk_c: audio_clk_c { 1290 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
1170 compatible = "fixed-clock"; 1291 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
1171 #clock-cells = <0>; 1292 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
1172 clock-frequency = <0>; 1293 interrupt-names = "error",
1173 }; 1294 "ch0", "ch1", "ch2", "ch3",
1295 "ch4", "ch5", "ch6", "ch7",
1296 "ch8", "ch9", "ch10", "ch11",
1297 "ch12";
1298 clocks = <&cpg CPG_MOD 501>;
1299 clock-names = "fck";
1300 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1301 resets = <&cpg 501>;
1302 #dma-cells = <1>;
1303 dma-channels = <13>;
1304 };
1174 1305
1175 /* External SCIF clock */ 1306 xhci: usb@ee000000 {
1176 scif_clk: scif { 1307 compatible = "renesas,xhci-r8a7790",
1177 compatible = "fixed-clock"; 1308 "renesas,rcar-gen2-xhci";
1178 #clock-cells = <0>; 1309 reg = <0 0xee000000 0 0xc00>;
1179 /* This value must be overridden by the board. */ 1310 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
1180 clock-frequency = <0>; 1311 clocks = <&cpg CPG_MOD 328>;
1181 }; 1312 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1313 resets = <&cpg 328>;
1314 phys = <&usb2 1>;
1315 phy-names = "usb";
1316 status = "disabled";
1317 };
1182 1318
1183 /* External USB clock - can be overridden by the board */ 1319 pci0: pci@ee090000 {
1184 usb_extal_clk: usb_extal { 1320 compatible = "renesas,pci-r8a7790",
1185 compatible = "fixed-clock"; 1321 "renesas,pci-rcar-gen2";
1186 #clock-cells = <0>; 1322 device_type = "pci";
1187 clock-frequency = <48000000>; 1323 reg = <0 0xee090000 0 0xc00>,
1188 }; 1324 <0 0xee080000 0 0x1100>;
1325 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1326 clocks = <&cpg CPG_MOD 703>;
1327 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1328 resets = <&cpg 703>;
1329 status = "disabled";
1330
1331 bus-range = <0 0>;
1332 #address-cells = <3>;
1333 #size-cells = <2>;
1334 #interrupt-cells = <1>;
1335 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1336 interrupt-map-mask = <0xff00 0 0 0x7>;
1337 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1338 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1339 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1340
1341 usb@1,0 {
1342 reg = <0x800 0 0 0 0>;
1343 phys = <&usb0 0>;
1344 phy-names = "usb";
1345 };
1189 1346
1190 /* External CAN clock */ 1347 usb@2,0 {
1191 can_clk: can { 1348 reg = <0x1000 0 0 0 0>;
1192 compatible = "fixed-clock"; 1349 phys = <&usb0 0>;
1193 #clock-cells = <0>; 1350 phy-names = "usb";
1194 /* This value must be overridden by the board. */ 1351 };
1195 clock-frequency = <0>; 1352 };
1196 };
1197 1353
1198 cpg: clock-controller@e6150000 { 1354 pci1: pci@ee0b0000 {
1199 compatible = "renesas,r8a7790-cpg-mssr"; 1355 compatible = "renesas,pci-r8a7790",
1200 reg = <0 0xe6150000 0 0x1000>; 1356 "renesas,pci-rcar-gen2";
1201 clocks = <&extal_clk>, <&usb_extal_clk>; 1357 device_type = "pci";
1202 clock-names = "extal", "usb_extal"; 1358 reg = <0 0xee0b0000 0 0xc00>,
1203 #clock-cells = <2>; 1359 <0 0xee0a0000 0 0x1100>;
1204 #power-domain-cells = <0>; 1360 interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
1205 #reset-cells = <1>; 1361 clocks = <&cpg CPG_MOD 703>;
1206 }; 1362 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1363 resets = <&cpg 703>;
1364 status = "disabled";
1365
1366 bus-range = <1 1>;
1367 #address-cells = <3>;
1368 #size-cells = <2>;
1369 #interrupt-cells = <1>;
1370 ranges = <0x02000000 0 0xee0a0000 0 0xee0a0000 0 0x00010000>;
1371 interrupt-map-mask = <0xff00 0 0 0x7>;
1372 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
1373 0x0800 0 0 1 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
1374 0x1000 0 0 2 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
1375 };
1207 1376
1208 prr: chipid@ff000044 { 1377 pci2: pci@ee0d0000 {
1209 compatible = "renesas,prr"; 1378 compatible = "renesas,pci-r8a7790",
1210 reg = <0 0xff000044 0 4>; 1379 "renesas,pci-rcar-gen2";
1211 }; 1380 device_type = "pci";
1381 clocks = <&cpg CPG_MOD 703>;
1382 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1383 resets = <&cpg 703>;
1384 reg = <0 0xee0d0000 0 0xc00>,
1385 <0 0xee0c0000 0 0x1100>;
1386 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1387 status = "disabled";
1388
1389 bus-range = <2 2>;
1390 #address-cells = <3>;
1391 #size-cells = <2>;
1392 #interrupt-cells = <1>;
1393 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1394 interrupt-map-mask = <0xff00 0 0 0x7>;
1395 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1396 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1397 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1398
1399 usb@1,0 {
1400 reg = <0x20800 0 0 0 0>;
1401 phys = <&usb2 0>;
1402 phy-names = "usb";
1403 };
1212 1404
1213 rst: reset-controller@e6160000 { 1405 usb@2,0 {
1214 compatible = "renesas,r8a7790-rst"; 1406 reg = <0x21000 0 0 0 0>;
1215 reg = <0 0xe6160000 0 0x0100>; 1407 phys = <&usb2 0>;
1216 }; 1408 phy-names = "usb";
1409 };
1410 };
1217 1411
1218 sysc: system-controller@e6180000 { 1412 sdhi0: sd@ee100000 {
1219 compatible = "renesas,r8a7790-sysc"; 1413 compatible = "renesas,sdhi-r8a7790",
1220 reg = <0 0xe6180000 0 0x0200>; 1414 "renesas,rcar-gen2-sdhi";
1221 #power-domain-cells = <1>; 1415 reg = <0 0xee100000 0 0x328>;
1222 }; 1416 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1417 clocks = <&cpg CPG_MOD 314>;
1418 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1419 <&dmac1 0xcd>, <&dmac1 0xce>;
1420 dma-names = "tx", "rx", "tx", "rx";
1421 max-frequency = <195000000>;
1422 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1423 resets = <&cpg 314>;
1424 status = "disabled";
1425 };
1223 1426
1224 qspi: spi@e6b10000 { 1427 sdhi1: sd@ee120000 {
1225 compatible = "renesas,qspi-r8a7790", "renesas,qspi"; 1428 compatible = "renesas,sdhi-r8a7790",
1226 reg = <0 0xe6b10000 0 0x2c>; 1429 "renesas,rcar-gen2-sdhi";
1227 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 1430 reg = <0 0xee120000 0 0x328>;
1228 clocks = <&cpg CPG_MOD 917>; 1431 interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
1229 dmas = <&dmac0 0x17>, <&dmac0 0x18>, 1432 clocks = <&cpg CPG_MOD 313>;
1230 <&dmac1 0x17>, <&dmac1 0x18>; 1433 dmas = <&dmac0 0xc9>, <&dmac0 0xca>,
1231 dma-names = "tx", "rx", "tx", "rx"; 1434 <&dmac1 0xc9>, <&dmac1 0xca>;
1232 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1435 dma-names = "tx", "rx", "tx", "rx";
1233 resets = <&cpg 917>; 1436 max-frequency = <195000000>;
1234 num-cs = <1>; 1437 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1235 #address-cells = <1>; 1438 resets = <&cpg 313>;
1236 #size-cells = <0>; 1439 status = "disabled";
1237 status = "disabled"; 1440 };
1238 };
1239 1441
1240 msiof0: spi@e6e20000 { 1442 sdhi2: sd@ee140000 {
1241 compatible = "renesas,msiof-r8a7790", 1443 compatible = "renesas,sdhi-r8a7790",
1242 "renesas,rcar-gen2-msiof"; 1444 "renesas,rcar-gen2-sdhi";
1243 reg = <0 0xe6e20000 0 0x0064>; 1445 reg = <0 0xee140000 0 0x100>;
1244 interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>; 1446 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1245 clocks = <&cpg CPG_MOD 0>; 1447 clocks = <&cpg CPG_MOD 312>;
1246 dmas = <&dmac0 0x51>, <&dmac0 0x52>, 1448 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1247 <&dmac1 0x51>, <&dmac1 0x52>; 1449 <&dmac1 0xc1>, <&dmac1 0xc2>;
1248 dma-names = "tx", "rx", "tx", "rx"; 1450 dma-names = "tx", "rx", "tx", "rx";
1249 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1451 max-frequency = <97500000>;
1250 resets = <&cpg 0>; 1452 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1251 #address-cells = <1>; 1453 resets = <&cpg 312>;
1252 #size-cells = <0>; 1454 status = "disabled";
1253 status = "disabled"; 1455 };
1254 };
1255 1456
1256 msiof1: spi@e6e10000 { 1457 sdhi3: sd@ee160000 {
1257 compatible = "renesas,msiof-r8a7790", 1458 compatible = "renesas,sdhi-r8a7790",
1258 "renesas,rcar-gen2-msiof"; 1459 "renesas,rcar-gen2-sdhi";
1259 reg = <0 0xe6e10000 0 0x0064>; 1460 reg = <0 0xee160000 0 0x100>;
1260 interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>; 1461 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1261 clocks = <&cpg CPG_MOD 208>; 1462 clocks = <&cpg CPG_MOD 311>;
1262 dmas = <&dmac0 0x55>, <&dmac0 0x56>, 1463 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1263 <&dmac1 0x55>, <&dmac1 0x56>; 1464 <&dmac1 0xd3>, <&dmac1 0xd4>;
1264 dma-names = "tx", "rx", "tx", "rx"; 1465 dma-names = "tx", "rx", "tx", "rx";
1265 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1466 max-frequency = <97500000>;
1266 resets = <&cpg 208>; 1467 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1267 #address-cells = <1>; 1468 resets = <&cpg 311>;
1268 #size-cells = <0>; 1469 status = "disabled";
1269 status = "disabled"; 1470 };
1270 };
1271 1471
1272 msiof2: spi@e6e00000 { 1472 mmcif0: mmc@ee200000 {
1273 compatible = "renesas,msiof-r8a7790", 1473 compatible = "renesas,mmcif-r8a7790",
1274 "renesas,rcar-gen2-msiof"; 1474 "renesas,sh-mmcif";
1275 reg = <0 0xe6e00000 0 0x0064>; 1475 reg = <0 0xee200000 0 0x80>;
1276 interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; 1476 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1277 clocks = <&cpg CPG_MOD 205>; 1477 clocks = <&cpg CPG_MOD 315>;
1278 dmas = <&dmac0 0x41>, <&dmac0 0x42>, 1478 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1279 <&dmac1 0x41>, <&dmac1 0x42>; 1479 <&dmac1 0xd1>, <&dmac1 0xd2>;
1280 dma-names = "tx", "rx", "tx", "rx"; 1480 dma-names = "tx", "rx", "tx", "rx";
1281 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1481 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1282 resets = <&cpg 205>; 1482 resets = <&cpg 315>;
1283 #address-cells = <1>; 1483 reg-io-width = <4>;
1284 #size-cells = <0>; 1484 status = "disabled";
1285 status = "disabled"; 1485 max-frequency = <97500000>;
1286 }; 1486 };
1287 1487
1288 msiof3: spi@e6c90000 { 1488 mmcif1: mmc@ee220000 {
1289 compatible = "renesas,msiof-r8a7790", 1489 compatible = "renesas,mmcif-r8a7790",
1290 "renesas,rcar-gen2-msiof"; 1490 "renesas,sh-mmcif";
1291 reg = <0 0xe6c90000 0 0x0064>; 1491 reg = <0 0xee220000 0 0x80>;
1292 interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>; 1492 interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
1293 clocks = <&cpg CPG_MOD 215>; 1493 clocks = <&cpg CPG_MOD 305>;
1294 dmas = <&dmac0 0x45>, <&dmac0 0x46>, 1494 dmas = <&dmac0 0xe1>, <&dmac0 0xe2>,
1295 <&dmac1 0x45>, <&dmac1 0x46>; 1495 <&dmac1 0xe1>, <&dmac1 0xe2>;
1296 dma-names = "tx", "rx", "tx", "rx"; 1496 dma-names = "tx", "rx", "tx", "rx";
1297 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1497 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1298 resets = <&cpg 215>; 1498 resets = <&cpg 305>;
1299 #address-cells = <1>; 1499 reg-io-width = <4>;
1300 #size-cells = <0>; 1500 status = "disabled";
1301 status = "disabled"; 1501 max-frequency = <97500000>;
1302 }; 1502 };
1303 1503
1304 xhci: usb@ee000000 { 1504 sata0: sata@ee300000 {
1305 compatible = "renesas,xhci-r8a7790", "renesas,rcar-gen2-xhci"; 1505 compatible = "renesas,sata-r8a7790",
1306 reg = <0 0xee000000 0 0xc00>; 1506 "renesas,rcar-gen2-sata";
1307 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; 1507 reg = <0 0xee300000 0 0x2000>;
1308 clocks = <&cpg CPG_MOD 328>; 1508 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
1309 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1509 clocks = <&cpg CPG_MOD 815>;
1310 resets = <&cpg 328>; 1510 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1311 phys = <&usb2 1>; 1511 resets = <&cpg 815>;
1312 phy-names = "usb"; 1512 status = "disabled";
1313 status = "disabled"; 1513 };
1314 };
1315 1514
1316 pci0: pci@ee090000 { 1515 sata1: sata@ee500000 {
1317 compatible = "renesas,pci-r8a7790", "renesas,pci-rcar-gen2"; 1516 compatible = "renesas,sata-r8a7790",
1318 device_type = "pci"; 1517 "renesas,rcar-gen2-sata";
1319 reg = <0 0xee090000 0 0xc00>, 1518 reg = <0 0xee500000 0 0x2000>;
1320 <0 0xee080000 0 0x1100>; 1519 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
1321 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; 1520 clocks = <&cpg CPG_MOD 814>;
1322 clocks = <&cpg CPG_MOD 703>; 1521 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1323 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1522 resets = <&cpg 814>;
1324 resets = <&cpg 703>; 1523 status = "disabled";
1325 status = "disabled";
1326
1327 bus-range = <0 0>;
1328 #address-cells = <3>;
1329 #size-cells = <2>;
1330 #interrupt-cells = <1>;
1331 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1332 interrupt-map-mask = <0xff00 0 0 0x7>;
1333 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1334 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1335 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1336
1337 usb@1,0 {
1338 reg = <0x800 0 0 0 0>;
1339 phys = <&usb0 0>;
1340 phy-names = "usb";
1341 }; 1524 };
1342 1525
1343 usb@2,0 { 1526 ether: ethernet@ee700000 {
1344 reg = <0x1000 0 0 0 0>; 1527 compatible = "renesas,ether-r8a7790",
1345 phys = <&usb0 0>; 1528 "renesas,rcar-gen2-ether";
1346 phy-names = "usb"; 1529 reg = <0 0xee700000 0 0x400>;
1530 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1531 clocks = <&cpg CPG_MOD 813>;
1532 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1533 resets = <&cpg 813>;
1534 phy-mode = "rmii";
1535 #address-cells = <1>;
1536 #size-cells = <0>;
1537 status = "disabled";
1347 }; 1538 };
1348 };
1349 1539
1350 pci1: pci@ee0b0000 { 1540 gic: interrupt-controller@f1001000 {
1351 compatible = "renesas,pci-r8a7790", "renesas,pci-rcar-gen2"; 1541 compatible = "arm,gic-400";
1352 device_type = "pci"; 1542 #interrupt-cells = <3>;
1353 reg = <0 0xee0b0000 0 0xc00>, 1543 #address-cells = <0>;
1354 <0 0xee0a0000 0 0x1100>; 1544 interrupt-controller;
1355 interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>; 1545 reg = <0 0xf1001000 0 0x1000>, <0 0xf1002000 0 0x2000>,
1356 clocks = <&cpg CPG_MOD 703>; 1546 <0 0xf1004000 0 0x2000>, <0 0xf1006000 0 0x2000>;
1357 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1547 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
1358 resets = <&cpg 703>; 1548 clocks = <&cpg CPG_MOD 408>;
1359 status = "disabled"; 1549 clock-names = "clk";
1360 1550 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1361 bus-range = <1 1>; 1551 resets = <&cpg 408>;
1362 #address-cells = <3>; 1552 };
1363 #size-cells = <2>;
1364 #interrupt-cells = <1>;
1365 ranges = <0x02000000 0 0xee0a0000 0 0xee0a0000 0 0x00010000>;
1366 interrupt-map-mask = <0xff00 0 0 0x7>;
1367 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
1368 0x0800 0 0 1 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH
1369 0x1000 0 0 2 &gic GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
1370 };
1371 1553
1372 pci2: pci@ee0d0000 { 1554 pciec: pcie@fe000000 {
1373 compatible = "renesas,pci-r8a7790", "renesas,pci-rcar-gen2"; 1555 compatible = "renesas,pcie-r8a7790",
1374 device_type = "pci"; 1556 "renesas,pcie-rcar-gen2";
1375 clocks = <&cpg CPG_MOD 703>; 1557 reg = <0 0xfe000000 0 0x80000>;
1376 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 1558 #address-cells = <3>;
1377 resets = <&cpg 703>; 1559 #size-cells = <2>;
1378 reg = <0 0xee0d0000 0 0xc00>, 1560 bus-range = <0x00 0xff>;
1379 <0 0xee0c0000 0 0x1100>; 1561 device_type = "pci";
1380 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 1562 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
1381 status = "disabled"; 1563 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
1382 1564 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
1383 bus-range = <2 2>; 1565 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1384 #address-cells = <3>; 1566 /* Map all possible DDR as inbound ranges */
1385 #size-cells = <2>; 1567 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1386 #interrupt-cells = <1>; 1568 0x43000000 1 0x80000000 1 0x80000000 0 0x80000000>;
1387 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>; 1569 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1388 interrupt-map-mask = <0xff00 0 0 0x7>; 1570 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1389 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 1571 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1390 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 1572 #interrupt-cells = <1>;
1391 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 1573 interrupt-map-mask = <0 0 0 0>;
1392 1574 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1393 usb@1,0 { 1575 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1394 reg = <0x20800 0 0 0 0>; 1576 clock-names = "pcie", "pcie_bus";
1395 phys = <&usb2 0>; 1577 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1396 phy-names = "usb"; 1578 resets = <&cpg 319>;
1579 status = "disabled";
1397 }; 1580 };
1398 1581
1399 usb@2,0 { 1582 vsp@fe920000 {
1400 reg = <0x21000 0 0 0 0>; 1583 compatible = "renesas,vsp1";
1401 phys = <&usb2 0>; 1584 reg = <0 0xfe920000 0 0x8000>;
1402 phy-names = "usb"; 1585 interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
1586 clocks = <&cpg CPG_MOD 130>;
1587 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1588 resets = <&cpg 130>;
1403 }; 1589 };
1404 };
1405 1590
1406 pciec: pcie@fe000000 { 1591 vsp@fe928000 {
1407 compatible = "renesas,pcie-r8a7790", "renesas,pcie-rcar-gen2"; 1592 compatible = "renesas,vsp1";
1408 reg = <0 0xfe000000 0 0x80000>; 1593 reg = <0 0xfe928000 0 0x8000>;
1409 #address-cells = <3>; 1594 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
1410 #size-cells = <2>; 1595 clocks = <&cpg CPG_MOD 131>;
1411 bus-range = <0x00 0xff>; 1596 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1412 device_type = "pci"; 1597 resets = <&cpg 131>;
1413 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000 1598 };
1414 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
1415 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
1416 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1417 /* Map all possible DDR as inbound ranges */
1418 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1419 0x43000000 1 0x80000000 1 0x80000000 0 0x80000000>;
1420 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1421 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1422 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1423 #interrupt-cells = <1>;
1424 interrupt-map-mask = <0 0 0 0>;
1425 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1426 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1427 clock-names = "pcie", "pcie_bus";
1428 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1429 resets = <&cpg 319>;
1430 status = "disabled";
1431 };
1432 1599
1433 rcar_sound: sound@ec500000 { 1600 vsp@fe930000 {
1434 /* 1601 compatible = "renesas,vsp1";
1435 * #sound-dai-cells is required 1602 reg = <0 0xfe930000 0 0x8000>;
1436 * 1603 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
1437 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>; 1604 clocks = <&cpg CPG_MOD 128>;
1438 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>; 1605 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1439 */ 1606 resets = <&cpg 128>;
1440 compatible = "renesas,rcar_sound-r8a7790", "renesas,rcar_sound-gen2";
1441 reg = <0 0xec500000 0 0x1000>, /* SCU */
1442 <0 0xec5a0000 0 0x100>, /* ADG */
1443 <0 0xec540000 0 0x1000>, /* SSIU */
1444 <0 0xec541000 0 0x280>, /* SSI */
1445 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
1446 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
1447
1448 clocks = <&cpg CPG_MOD 1005>,
1449 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
1450 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
1451 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
1452 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
1453 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
1454 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
1455 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
1456 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
1457 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
1458 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
1459 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1460 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1461 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1462 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
1463 <&cpg CPG_CORE R8A7790_CLK_M2>;
1464 clock-names = "ssi-all",
1465 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1466 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
1467 "src.9", "src.8", "src.7", "src.6", "src.5",
1468 "src.4", "src.3", "src.2", "src.1", "src.0",
1469 "ctu.0", "ctu.1",
1470 "mix.0", "mix.1",
1471 "dvc.0", "dvc.1",
1472 "clk_a", "clk_b", "clk_c", "clk_i";
1473 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1474 resets = <&cpg 1005>,
1475 <&cpg 1006>, <&cpg 1007>, <&cpg 1008>, <&cpg 1009>,
1476 <&cpg 1010>, <&cpg 1011>, <&cpg 1012>, <&cpg 1013>,
1477 <&cpg 1014>, <&cpg 1015>;
1478 reset-names = "ssi-all",
1479 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1480 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0";
1481
1482 status = "disabled";
1483
1484 rcar_sound,dvc {
1485 dvc0: dvc-0 {
1486 dmas = <&audma1 0xbc>;
1487 dma-names = "tx";
1488 };
1489 dvc1: dvc-1 {
1490 dmas = <&audma1 0xbe>;
1491 dma-names = "tx";
1492 };
1493 }; 1607 };
1494 1608
1495 rcar_sound,mix { 1609 vsp@fe938000 {
1496 mix0: mix-0 { }; 1610 compatible = "renesas,vsp1";
1497 mix1: mix-1 { }; 1611 reg = <0 0xfe938000 0 0x8000>;
1612 interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
1613 clocks = <&cpg CPG_MOD 127>;
1614 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1615 resets = <&cpg 127>;
1498 }; 1616 };
1499 1617
1500 rcar_sound,ctu { 1618 jpu: jpeg-codec@fe980000 {
1501 ctu00: ctu-0 { }; 1619 compatible = "renesas,jpu-r8a7790",
1502 ctu01: ctu-1 { }; 1620 "renesas,rcar-gen2-jpu";
1503 ctu02: ctu-2 { }; 1621 reg = <0 0xfe980000 0 0x10300>;
1504 ctu03: ctu-3 { }; 1622 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
1505 ctu10: ctu-4 { }; 1623 clocks = <&cpg CPG_MOD 106>;
1506 ctu11: ctu-5 { }; 1624 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1507 ctu12: ctu-6 { }; 1625 resets = <&cpg 106>;
1508 ctu13: ctu-7 { };
1509 }; 1626 };
1510 1627
1511 rcar_sound,src { 1628 du: display@feb00000 {
1512 src0: src-0 { 1629 compatible = "renesas,du-r8a7790";
1513 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>; 1630 reg = <0 0xfeb00000 0 0x70000>,
1514 dmas = <&audma0 0x85>, <&audma1 0x9a>; 1631 <0 0xfeb90000 0 0x1c>,
1515 dma-names = "rx", "tx"; 1632 <0 0xfeb94000 0 0x1c>;
1516 }; 1633 reg-names = "du", "lvds.0", "lvds.1";
1517 src1: src-1 { 1634 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1518 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>; 1635 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
1519 dmas = <&audma0 0x87>, <&audma1 0x9c>; 1636 <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>;
1520 dma-names = "rx", "tx"; 1637 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>,
1521 }; 1638 <&cpg CPG_MOD 722>, <&cpg CPG_MOD 726>,
1522 src2: src-2 { 1639 <&cpg CPG_MOD 725>;
1523 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>; 1640 clock-names = "du.0", "du.1", "du.2", "lvds.0",
1524 dmas = <&audma0 0x89>, <&audma1 0x9e>; 1641 "lvds.1";
1525 dma-names = "rx", "tx"; 1642 status = "disabled";
1526 }; 1643
1527 src3: src-3 { 1644 ports {
1528 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>; 1645 #address-cells = <1>;
1529 dmas = <&audma0 0x8b>, <&audma1 0xa0>; 1646 #size-cells = <0>;
1530 dma-names = "rx", "tx"; 1647
1531 }; 1648 port@0 {
1532 src4: src-4 { 1649 reg = <0>;
1533 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>; 1650 du_out_rgb: endpoint {
1534 dmas = <&audma0 0x8d>, <&audma1 0xb0>; 1651 };
1535 dma-names = "rx", "tx"; 1652 };
1536 }; 1653 port@1 {
1537 src5: src-5 { 1654 reg = <1>;
1538 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>; 1655 du_out_lvds0: endpoint {
1539 dmas = <&audma0 0x8f>, <&audma1 0xb2>; 1656 };
1540 dma-names = "rx", "tx"; 1657 };
1541 }; 1658 port@2 {
1542 src6: src-6 { 1659 reg = <2>;
1543 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>; 1660 du_out_lvds1: endpoint {
1544 dmas = <&audma0 0x91>, <&audma1 0xb4>; 1661 };
1545 dma-names = "rx", "tx"; 1662 };
1546 };
1547 src7: src-7 {
1548 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1549 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1550 dma-names = "rx", "tx";
1551 };
1552 src8: src-8 {
1553 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1554 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1555 dma-names = "rx", "tx";
1556 };
1557 src9: src-9 {
1558 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1559 dmas = <&audma0 0x97>, <&audma1 0xba>;
1560 dma-names = "rx", "tx";
1561 }; 1663 };
1562 }; 1664 };
1563 1665
1564 rcar_sound,ssi { 1666 prr: chipid@ff000044 {
1565 ssi0: ssi-0 { 1667 compatible = "renesas,prr";
1566 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>; 1668 reg = <0 0xff000044 0 4>;
1567 dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
1568 dma-names = "rx", "tx", "rxu", "txu";
1569 };
1570 ssi1: ssi-1 {
1571 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1572 dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
1573 dma-names = "rx", "tx", "rxu", "txu";
1574 };
1575 ssi2: ssi-2 {
1576 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1577 dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
1578 dma-names = "rx", "tx", "rxu", "txu";
1579 };
1580 ssi3: ssi-3 {
1581 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1582 dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
1583 dma-names = "rx", "tx", "rxu", "txu";
1584 };
1585 ssi4: ssi-4 {
1586 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1587 dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
1588 dma-names = "rx", "tx", "rxu", "txu";
1589 };
1590 ssi5: ssi-5 {
1591 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1592 dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
1593 dma-names = "rx", "tx", "rxu", "txu";
1594 };
1595 ssi6: ssi-6 {
1596 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1597 dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
1598 dma-names = "rx", "tx", "rxu", "txu";
1599 };
1600 ssi7: ssi-7 {
1601 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1602 dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
1603 dma-names = "rx", "tx", "rxu", "txu";
1604 };
1605 ssi8: ssi-8 {
1606 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1607 dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
1608 dma-names = "rx", "tx", "rxu", "txu";
1609 };
1610 ssi9: ssi-9 {
1611 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1612 dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
1613 dma-names = "rx", "tx", "rxu", "txu";
1614 };
1615 }; 1669 };
1616 };
1617 1670
1618 ipmmu_sy0: mmu@e6280000 { 1671 cmt0: timer@ffca0000 {
1619 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1672 compatible = "renesas,r8a7790-cmt0",
1620 reg = <0 0xe6280000 0 0x1000>; 1673 "renesas,rcar-gen2-cmt0";
1621 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>, 1674 reg = <0 0xffca0000 0 0x1004>;
1622 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 1675 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1623 #iommu-cells = <1>; 1676 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1624 status = "disabled"; 1677 clocks = <&cpg CPG_MOD 124>;
1625 }; 1678 clock-names = "fck";
1679 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1680 resets = <&cpg 124>;
1681
1682 status = "disabled";
1683 };
1626 1684
1627 ipmmu_sy1: mmu@e6290000 { 1685 cmt1: timer@e6130000 {
1628 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1686 compatible = "renesas,r8a7790-cmt1",
1629 reg = <0 0xe6290000 0 0x1000>; 1687 "renesas,rcar-gen2-cmt1";
1630 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 1688 reg = <0 0xe6130000 0 0x1004>;
1631 #iommu-cells = <1>; 1689 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1632 status = "disabled"; 1690 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1691 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1692 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1693 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1694 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1695 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1696 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1697 clocks = <&cpg CPG_MOD 329>;
1698 clock-names = "fck";
1699 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
1700 resets = <&cpg 329>;
1701
1702 status = "disabled";
1703 };
1633 }; 1704 };
1634 1705
1635 ipmmu_ds: mmu@e6740000 { 1706 thermal-zones {
1636 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1707 cpu_thermal: cpu-thermal {
1637 reg = <0 0xe6740000 0 0x1000>; 1708 polling-delay-passive = <0>;
1638 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, 1709 polling-delay = <0>;
1639 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
1640 #iommu-cells = <1>;
1641 status = "disabled";
1642 };
1643 1710
1644 ipmmu_mp: mmu@ec680000 { 1711 thermal-sensors = <&thermal>;
1645 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1712
1646 reg = <0 0xec680000 0 0x1000>; 1713 trips {
1647 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>; 1714 cpu-crit {
1648 #iommu-cells = <1>; 1715 temperature = <95000>;
1649 status = "disabled"; 1716 hysteresis = <0>;
1717 type = "critical";
1718 };
1719 };
1720 cooling-maps {
1721 };
1722 };
1650 }; 1723 };
1651 1724
1652 ipmmu_mx: mmu@fe951000 { 1725 timer {
1653 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1726 compatible = "arm,armv7-timer";
1654 reg = <0 0xfe951000 0 0x1000>; 1727 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
1655 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>, 1728 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
1656 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; 1729 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
1657 #iommu-cells = <1>; 1730 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
1658 status = "disabled";
1659 }; 1731 };
1660 1732
1661 ipmmu_rt: mmu@ffc80000 { 1733 /* External USB clock - can be overridden by the board */
1662 compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; 1734 usb_extal_clk: usb_extal {
1663 reg = <0 0xffc80000 0 0x1000>; 1735 compatible = "fixed-clock";
1664 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; 1736 #clock-cells = <0>;
1665 #iommu-cells = <1>; 1737 clock-frequency = <48000000>;
1666 status = "disabled";
1667 }; 1738 };
1668}; 1739};
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index a50924d12b6f..f40321a1c917 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -51,7 +51,11 @@
51 serial0 = &scif0; 51 serial0 = &scif0;
52 serial1 = &scif1; 52 serial1 = &scif1;
53 i2c9 = &gpioi2c1; 53 i2c9 = &gpioi2c1;
54 i2c10 = &gpioi2c2;
55 i2c11 = &gpioi2c4;
54 i2c12 = &i2cexio1; 56 i2c12 = &i2cexio1;
57 i2c13 = &i2chdmi;
58 i2c14 = &i2cexio4;
55 }; 59 };
56 60
57 chosen { 61 chosen {
@@ -312,8 +316,28 @@
312 #size-cells = <0>; 316 #size-cells = <0>;
313 compatible = "i2c-gpio"; 317 compatible = "i2c-gpio";
314 status = "disabled"; 318 status = "disabled";
315 sda-gpios = <&gpio7 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
316 scl-gpios = <&gpio7 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 319 scl-gpios = <&gpio7 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
320 sda-gpios = <&gpio7 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
321 i2c-gpio,delay-us = <5>;
322 };
323
324 gpioi2c2: i2c-10 {
325 #address-cells = <1>;
326 #size-cells = <0>;
327 compatible = "i2c-gpio";
328 status = "disabled";
329 scl-gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
330 sda-gpios = <&gpio2 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
331 i2c-gpio,delay-us = <5>;
332 };
333
334 gpioi2c4: i2c-11 {
335 #address-cells = <1>;
336 #size-cells = <0>;
337 compatible = "i2c-gpio";
338 status = "disabled";
339 scl-gpios = <&gpio7 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
340 sda-gpios = <&gpio7 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
317 i2c-gpio,delay-us = <5>; 341 i2c-gpio,delay-us = <5>;
318 }; 342 };
319 343
@@ -328,6 +352,115 @@
328 #address-cells = <1>; 352 #address-cells = <1>;
329 #size-cells = <0>; 353 #size-cells = <0>;
330 }; 354 };
355
356 /*
357 * A fallback to GPIO is provided for I2C2.
358 */
359 i2chdmi: i2c-13 {
360 compatible = "i2c-demux-pinctrl";
361 i2c-parent = <&i2c2>, <&gpioi2c2>;
362 i2c-bus-name = "i2c-hdmi";
363 #address-cells = <1>;
364 #size-cells = <0>;
365
366 ak4643: codec@12 {
367 compatible = "asahi-kasei,ak4643";
368 #sound-dai-cells = <0>;
369 reg = <0x12>;
370 };
371
372 composite-in@20 {
373 compatible = "adi,adv7180";
374 reg = <0x20>;
375 remote = <&vin1>;
376
377 port {
378 adv7180: endpoint {
379 bus-width = <8>;
380 remote-endpoint = <&vin1ep>;
381 };
382 };
383 };
384
385 hdmi@39 {
386 compatible = "adi,adv7511w";
387 reg = <0x39>;
388 interrupt-parent = <&gpio3>;
389 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
390 clocks = <&cec_clock>;
391 clock-names = "cec";
392
393 adi,input-depth = <8>;
394 adi,input-colorspace = "rgb";
395 adi,input-clock = "1x";
396 adi,input-style = <1>;
397 adi,input-justification = "evenly";
398
399 ports {
400 #address-cells = <1>;
401 #size-cells = <0>;
402
403 port@0 {
404 reg = <0>;
405 adv7511_in: endpoint {
406 remote-endpoint = <&du_out_rgb>;
407 };
408 };
409
410 port@1 {
411 reg = <1>;
412 adv7511_out: endpoint {
413 remote-endpoint = <&hdmi_con_out>;
414 };
415 };
416 };
417 };
418
419 hdmi-in@4c {
420 compatible = "adi,adv7612";
421 reg = <0x4c>;
422 interrupt-parent = <&gpio4>;
423 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
424 default-input = <0>;
425
426 ports {
427 #address-cells = <1>;
428 #size-cells = <0>;
429
430 port@0 {
431 reg = <0>;
432 adv7612_in: endpoint {
433 remote-endpoint = <&hdmi_con_in>;
434 };
435 };
436
437 port@2 {
438 reg = <2>;
439 adv7612_out: endpoint {
440 remote-endpoint = <&vin0ep2>;
441 };
442 };
443 };
444 };
445
446 eeprom@50 {
447 compatible = "renesas,r1ex24002", "atmel,24c02";
448 reg = <0x50>;
449 pagesize = <16>;
450 };
451 };
452
453 /*
454 * I2C4 is routed to EXIO connector E, pins 37 (SCL) + 39 (SDA).
455 * A fallback to GPIO is provided.
456 */
457 i2cexio4: i2c-14 {
458 compatible = "i2c-demux-pinctrl";
459 i2c-parent = <&i2c4>, <&gpioi2c4>;
460 i2c-bus-name = "i2c-exio4";
461 #address-cells = <1>;
462 #size-cells = <0>;
463 };
331}; 464};
332 465
333&du { 466&du {
@@ -371,6 +504,11 @@
371 function = "i2c2"; 504 function = "i2c2";
372 }; 505 };
373 506
507 i2c4_pins: i2c4 {
508 groups = "i2c4_c";
509 function = "i2c4";
510 };
511
374 du_pins: du { 512 du_pins: du {
375 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0"; 513 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
376 function = "du"; 514 function = "du";
@@ -621,96 +759,14 @@
621 759
622&i2c2 { 760&i2c2 {
623 pinctrl-0 = <&i2c2_pins>; 761 pinctrl-0 = <&i2c2_pins>;
624 pinctrl-names = "default"; 762 pinctrl-names = "i2c-hdmi";
625 763
626 status = "okay";
627 clock-frequency = <100000>; 764 clock-frequency = <100000>;
765};
628 766
629 ak4643: codec@12 { 767&i2c4 {
630 compatible = "asahi-kasei,ak4643"; 768 pinctrl-0 = <&i2c4_pins>;
631 #sound-dai-cells = <0>; 769 pinctrl-names = "i2c-exio4";
632 reg = <0x12>;
633 };
634
635 composite-in@20 {
636 compatible = "adi,adv7180";
637 reg = <0x20>;
638 remote = <&vin1>;
639
640 port {
641 adv7180: endpoint {
642 bus-width = <8>;
643 remote-endpoint = <&vin1ep>;
644 };
645 };
646 };
647
648 hdmi@39 {
649 compatible = "adi,adv7511w";
650 reg = <0x39>;
651 interrupt-parent = <&gpio3>;
652 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
653 clocks = <&cec_clock>;
654 clock-names = "cec";
655
656 adi,input-depth = <8>;
657 adi,input-colorspace = "rgb";
658 adi,input-clock = "1x";
659 adi,input-style = <1>;
660 adi,input-justification = "evenly";
661
662 ports {
663 #address-cells = <1>;
664 #size-cells = <0>;
665
666 port@0 {
667 reg = <0>;
668 adv7511_in: endpoint {
669 remote-endpoint = <&du_out_rgb>;
670 };
671 };
672
673 port@1 {
674 reg = <1>;
675 adv7511_out: endpoint {
676 remote-endpoint = <&hdmi_con_out>;
677 };
678 };
679 };
680 };
681
682 hdmi-in@4c {
683 compatible = "adi,adv7612";
684 reg = <0x4c>;
685 interrupt-parent = <&gpio4>;
686 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
687 default-input = <0>;
688
689 ports {
690 #address-cells = <1>;
691 #size-cells = <0>;
692
693 port@0 {
694 reg = <0>;
695 adv7612_in: endpoint {
696 remote-endpoint = <&hdmi_con_in>;
697 };
698 };
699
700 port@2 {
701 reg = <2>;
702 adv7612_out: endpoint {
703 remote-endpoint = <&vin0ep2>;
704 };
705 };
706 };
707 };
708
709 eeprom@50 {
710 compatible = "renesas,r1ex24002", "atmel,24c02";
711 reg = <0x50>;
712 pagesize = <16>;
713 };
714}; 770};
715 771
716&i2c6 { 772&i2c6 {
diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
index eb374956294f..c14e6fe9e4f6 100644
--- a/arch/arm/boot/dts/r8a7791-porter.dts
+++ b/arch/arm/boot/dts/r8a7791-porter.dts
@@ -29,6 +29,8 @@
29 29
30 aliases { 30 aliases {
31 serial0 = &scif0; 31 serial0 = &scif0;
32 i2c9 = &gpioi2c2;
33 i2c10 = &i2chdmi;
32 }; 34 };
33 35
34 chosen { 36 chosen {
@@ -135,6 +137,78 @@
135 clocks = <&x14_clk>; 137 clocks = <&x14_clk>;
136 }; 138 };
137 }; 139 };
140
141 gpioi2c2: i2c-9 {
142 #address-cells = <1>;
143 #size-cells = <0>;
144 compatible = "i2c-gpio";
145 status = "disabled";
146 scl-gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
147 sda-gpios = <&gpio2 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
148 i2c-gpio,delay-us = <5>;
149 };
150
151 /*
152 * A fallback to GPIO is provided for I2C2.
153 */
154 i2chdmi: i2c-10 {
155 compatible = "i2c-demux-pinctrl";
156 i2c-parent = <&i2c2>, <&gpioi2c2>;
157 i2c-bus-name = "i2c-hdmi";
158 #address-cells = <1>;
159 #size-cells = <0>;
160
161 ak4642: codec@12 {
162 compatible = "asahi-kasei,ak4642";
163 #sound-dai-cells = <0>;
164 reg = <0x12>;
165 };
166
167 composite-in@20 {
168 compatible = "adi,adv7180";
169 reg = <0x20>;
170 remote = <&vin0>;
171
172 port {
173 adv7180: endpoint {
174 bus-width = <8>;
175 remote-endpoint = <&vin0ep>;
176 };
177 };
178 };
179
180 hdmi@39 {
181 compatible = "adi,adv7511w";
182 reg = <0x39>;
183 interrupt-parent = <&gpio3>;
184 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
185
186 adi,input-depth = <8>;
187 adi,input-colorspace = "rgb";
188 adi,input-clock = "1x";
189 adi,input-style = <1>;
190 adi,input-justification = "evenly";
191
192 ports {
193 #address-cells = <1>;
194 #size-cells = <0>;
195
196 port@0 {
197 reg = <0>;
198 adv7511_in: endpoint {
199 remote-endpoint = <&du_out_rgb>;
200 };
201 };
202
203 port@1 {
204 reg = <1>;
205 adv7511_out: endpoint {
206 remote-endpoint = <&hdmi_con>;
207 };
208 };
209 };
210 };
211 };
138}; 212};
139 213
140&extal_clk { 214&extal_clk {
@@ -296,61 +370,9 @@
296 370
297&i2c2 { 371&i2c2 {
298 pinctrl-0 = <&i2c2_pins>; 372 pinctrl-0 = <&i2c2_pins>;
299 pinctrl-names = "default"; 373 pinctrl-names = "i2c-hdmi";
300 374
301 status = "okay";
302 clock-frequency = <400000>; 375 clock-frequency = <400000>;
303
304 ak4642: codec@12 {
305 compatible = "asahi-kasei,ak4642";
306 #sound-dai-cells = <0>;
307 reg = <0x12>;
308 };
309
310 composite-in@20 {
311 compatible = "adi,adv7180";
312 reg = <0x20>;
313 remote = <&vin0>;
314
315 port {
316 adv7180: endpoint {
317 bus-width = <8>;
318 remote-endpoint = <&vin0ep>;
319 };
320 };
321 };
322
323 hdmi@39 {
324 compatible = "adi,adv7511w";
325 reg = <0x39>;
326 interrupt-parent = <&gpio3>;
327 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
328
329 adi,input-depth = <8>;
330 adi,input-colorspace = "rgb";
331 adi,input-clock = "1x";
332 adi,input-style = <1>;
333 adi,input-justification = "evenly";
334
335 ports {
336 #address-cells = <1>;
337 #size-cells = <0>;
338
339 port@0 {
340 reg = <0>;
341 adv7511_in: endpoint {
342 remote-endpoint = <&du_out_rgb>;
343 };
344 };
345
346 port@1 {
347 reg = <1>;
348 adv7511_out: endpoint {
349 remote-endpoint = <&hdmi_con>;
350 };
351 };
352 };
353 };
354}; 376};
355 377
356&sata0 { 378&sata0 {
@@ -425,7 +447,7 @@
425 "dclkin.0", "dclkin.1"; 447 "dclkin.0", "dclkin.1";
426 448
427 ports { 449 ports {
428 port@1 { 450 port@0 {
429 endpoint { 451 endpoint {
430 remote-endpoint = <&adv7511_in>; 452 remote-endpoint = <&adv7511_in>;
431 }; 453 };
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 008a260f86a5..f11dab71b03a 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -17,7 +17,6 @@
17 17
18/ { 18/ {
19 compatible = "renesas,r8a7791"; 19 compatible = "renesas,r8a7791";
20 interrupt-parent = <&gic>;
21 #address-cells = <2>; 20 #address-cells = <2>;
22 #size-cells = <2>; 21 #size-cells = <2>;
23 22
@@ -40,6 +39,35 @@
40 vin2 = &vin2; 39 vin2 = &vin2;
41 }; 40 };
42 41
42 /*
43 * The external audio clocks are configured as 0 Hz fixed frequency
44 * clocks by default.
45 * Boards that provide audio clocks should override them.
46 */
47 audio_clk_a: audio_clk_a {
48 compatible = "fixed-clock";
49 #clock-cells = <0>;
50 clock-frequency = <0>;
51 };
52 audio_clk_b: audio_clk_b {
53 compatible = "fixed-clock";
54 #clock-cells = <0>;
55 clock-frequency = <0>;
56 };
57 audio_clk_c: audio_clk_c {
58 compatible = "fixed-clock";
59 #clock-cells = <0>;
60 clock-frequency = <0>;
61 };
62
63 /* External CAN clock */
64 can_clk: can {
65 compatible = "fixed-clock";
66 #clock-cells = <0>;
67 /* This value must be overridden by the board. */
68 clock-frequency = <0>;
69 };
70
43 cpus { 71 cpus {
44 #address-cells = <1>; 72 #address-cells = <1>;
45 #size-cells = <0>; 73 #size-cells = <0>;
@@ -83,1585 +111,1627 @@
83 }; 111 };
84 }; 112 };
85 113
86 thermal-zones { 114 /* External root clock */
87 cpu_thermal: cpu-thermal { 115 extal_clk: extal {
88 polling-delay-passive = <0>; 116 compatible = "fixed-clock";
89 polling-delay = <0>; 117 #clock-cells = <0>;
90 118 /* This value must be overridden by the board. */
91 thermal-sensors = <&thermal>; 119 clock-frequency = <0>;
92
93 trips {
94 cpu-crit {
95 temperature = <95000>;
96 hysteresis = <0>;
97 type = "critical";
98 };
99 };
100 cooling-maps {
101 };
102 };
103 };
104
105 apmu@e6152000 {
106 compatible = "renesas,r8a7791-apmu", "renesas,apmu";
107 reg = <0 0xe6152000 0 0x188>;
108 cpus = <&cpu0 &cpu1>;
109 };
110
111 gic: interrupt-controller@f1001000 {
112 compatible = "arm,gic-400";
113 #interrupt-cells = <3>;
114 #address-cells = <0>;
115 interrupt-controller;
116 reg = <0 0xf1001000 0 0x1000>,
117 <0 0xf1002000 0 0x2000>,
118 <0 0xf1004000 0 0x2000>,
119 <0 0xf1006000 0 0x2000>;
120 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
121 clocks = <&cpg CPG_MOD 408>;
122 clock-names = "clk";
123 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
124 resets = <&cpg 408>;
125 };
126
127 gpio0: gpio@e6050000 {
128 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio";
129 reg = <0 0xe6050000 0 0x50>;
130 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
131 #gpio-cells = <2>;
132 gpio-controller;
133 gpio-ranges = <&pfc 0 0 32>;
134 #interrupt-cells = <2>;
135 interrupt-controller;
136 clocks = <&cpg CPG_MOD 912>;
137 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
138 resets = <&cpg 912>;
139 };
140
141 gpio1: gpio@e6051000 {
142 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio";
143 reg = <0 0xe6051000 0 0x50>;
144 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
145 #gpio-cells = <2>;
146 gpio-controller;
147 gpio-ranges = <&pfc 0 32 26>;
148 #interrupt-cells = <2>;
149 interrupt-controller;
150 clocks = <&cpg CPG_MOD 911>;
151 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
152 resets = <&cpg 911>;
153 };
154
155 gpio2: gpio@e6052000 {
156 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio";
157 reg = <0 0xe6052000 0 0x50>;
158 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
159 #gpio-cells = <2>;
160 gpio-controller;
161 gpio-ranges = <&pfc 0 64 32>;
162 #interrupt-cells = <2>;
163 interrupt-controller;
164 clocks = <&cpg CPG_MOD 910>;
165 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
166 resets = <&cpg 910>;
167 }; 120 };
168 121
169 gpio3: gpio@e6053000 { 122 /* External PCIe clock - can be overridden by the board */
170 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio"; 123 pcie_bus_clk: pcie_bus {
171 reg = <0 0xe6053000 0 0x50>; 124 compatible = "fixed-clock";
172 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 125 #clock-cells = <0>;
173 #gpio-cells = <2>; 126 clock-frequency = <0>;
174 gpio-controller;
175 gpio-ranges = <&pfc 0 96 32>;
176 #interrupt-cells = <2>;
177 interrupt-controller;
178 clocks = <&cpg CPG_MOD 909>;
179 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
180 resets = <&cpg 909>;
181 }; 127 };
182 128
183 gpio4: gpio@e6054000 { 129 /* External SCIF clock */
184 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio"; 130 scif_clk: scif {
185 reg = <0 0xe6054000 0 0x50>; 131 compatible = "fixed-clock";
186 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; 132 #clock-cells = <0>;
187 #gpio-cells = <2>; 133 /* This value must be overridden by the board. */
188 gpio-controller; 134 clock-frequency = <0>;
189 gpio-ranges = <&pfc 0 128 32>;
190 #interrupt-cells = <2>;
191 interrupt-controller;
192 clocks = <&cpg CPG_MOD 908>;
193 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
194 resets = <&cpg 908>;
195 }; 135 };
196 136
197 gpio5: gpio@e6055000 { 137 soc {
198 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio"; 138 compatible = "simple-bus";
199 reg = <0 0xe6055000 0 0x50>; 139 interrupt-parent = <&gic>;
200 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
201 #gpio-cells = <2>;
202 gpio-controller;
203 gpio-ranges = <&pfc 0 160 32>;
204 #interrupt-cells = <2>;
205 interrupt-controller;
206 clocks = <&cpg CPG_MOD 907>;
207 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
208 resets = <&cpg 907>;
209 };
210 140
211 gpio6: gpio@e6055400 { 141 #address-cells = <2>;
212 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio"; 142 #size-cells = <2>;
213 reg = <0 0xe6055400 0 0x50>; 143 ranges;
214 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 144
215 #gpio-cells = <2>; 145 gpio0: gpio@e6050000 {
216 gpio-controller; 146 compatible = "renesas,gpio-r8a7791",
217 gpio-ranges = <&pfc 0 192 32>; 147 "renesas,rcar-gen2-gpio";
218 #interrupt-cells = <2>; 148 reg = <0 0xe6050000 0 0x50>;
219 interrupt-controller; 149 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
220 clocks = <&cpg CPG_MOD 905>; 150 #gpio-cells = <2>;
221 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 151 gpio-controller;
222 resets = <&cpg 905>; 152 gpio-ranges = <&pfc 0 0 32>;
223 }; 153 #interrupt-cells = <2>;
154 interrupt-controller;
155 clocks = <&cpg CPG_MOD 912>;
156 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
157 resets = <&cpg 912>;
158 };
224 159
225 gpio7: gpio@e6055800 { 160 gpio1: gpio@e6051000 {
226 compatible = "renesas,gpio-r8a7791", "renesas,rcar-gen2-gpio"; 161 compatible = "renesas,gpio-r8a7791",
227 reg = <0 0xe6055800 0 0x50>; 162 "renesas,rcar-gen2-gpio";
228 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; 163 reg = <0 0xe6051000 0 0x50>;
229 #gpio-cells = <2>; 164 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
230 gpio-controller; 165 #gpio-cells = <2>;
231 gpio-ranges = <&pfc 0 224 26>; 166 gpio-controller;
232 #interrupt-cells = <2>; 167 gpio-ranges = <&pfc 0 32 26>;
233 interrupt-controller; 168 #interrupt-cells = <2>;
234 clocks = <&cpg CPG_MOD 904>; 169 interrupt-controller;
235 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 170 clocks = <&cpg CPG_MOD 911>;
236 resets = <&cpg 904>; 171 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
237 }; 172 resets = <&cpg 911>;
173 };
238 174
239 thermal: thermal@e61f0000 { 175 gpio2: gpio@e6052000 {
240 compatible = "renesas,thermal-r8a7791", 176 compatible = "renesas,gpio-r8a7791",
241 "renesas,rcar-gen2-thermal", 177 "renesas,rcar-gen2-gpio";
242 "renesas,rcar-thermal"; 178 reg = <0 0xe6052000 0 0x50>;
243 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>; 179 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
244 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; 180 #gpio-cells = <2>;
245 clocks = <&cpg CPG_MOD 522>; 181 gpio-controller;
246 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 182 gpio-ranges = <&pfc 0 64 32>;
247 resets = <&cpg 522>; 183 #interrupt-cells = <2>;
248 #thermal-sensor-cells = <0>; 184 interrupt-controller;
249 }; 185 clocks = <&cpg CPG_MOD 910>;
186 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
187 resets = <&cpg 910>;
188 };
250 189
251 timer { 190 gpio3: gpio@e6053000 {
252 compatible = "arm,armv7-timer"; 191 compatible = "renesas,gpio-r8a7791",
253 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 192 "renesas,rcar-gen2-gpio";
254 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 193 reg = <0 0xe6053000 0 0x50>;
255 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 194 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
256 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>; 195 #gpio-cells = <2>;
257 }; 196 gpio-controller;
197 gpio-ranges = <&pfc 0 96 32>;
198 #interrupt-cells = <2>;
199 interrupt-controller;
200 clocks = <&cpg CPG_MOD 909>;
201 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
202 resets = <&cpg 909>;
203 };
258 204
259 cmt0: timer@ffca0000 { 205 gpio4: gpio@e6054000 {
260 compatible = "renesas,r8a7791-cmt0", "renesas,rcar-gen2-cmt0"; 206 compatible = "renesas,gpio-r8a7791",
261 reg = <0 0xffca0000 0 0x1004>; 207 "renesas,rcar-gen2-gpio";
262 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 208 reg = <0 0xe6054000 0 0x50>;
263 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 209 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
264 clocks = <&cpg CPG_MOD 124>; 210 #gpio-cells = <2>;
265 clock-names = "fck"; 211 gpio-controller;
266 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 212 gpio-ranges = <&pfc 0 128 32>;
267 resets = <&cpg 124>; 213 #interrupt-cells = <2>;
268 214 interrupt-controller;
269 status = "disabled"; 215 clocks = <&cpg CPG_MOD 908>;
270 }; 216 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
217 resets = <&cpg 908>;
218 };
271 219
272 cmt1: timer@e6130000 { 220 gpio5: gpio@e6055000 {
273 compatible = "renesas,r8a7791-cmt1", "renesas,rcar-gen2-cmt1"; 221 compatible = "renesas,gpio-r8a7791",
274 reg = <0 0xe6130000 0 0x1004>; 222 "renesas,rcar-gen2-gpio";
275 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 223 reg = <0 0xe6055000 0 0x50>;
276 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 224 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
277 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 225 #gpio-cells = <2>;
278 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 226 gpio-controller;
279 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, 227 gpio-ranges = <&pfc 0 160 32>;
280 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, 228 #interrupt-cells = <2>;
281 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, 229 interrupt-controller;
282 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; 230 clocks = <&cpg CPG_MOD 907>;
283 clocks = <&cpg CPG_MOD 329>; 231 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
284 clock-names = "fck"; 232 resets = <&cpg 907>;
285 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 233 };
286 resets = <&cpg 329>;
287
288 status = "disabled";
289 };
290 234
291 irqc0: interrupt-controller@e61c0000 { 235 gpio6: gpio@e6055400 {
292 compatible = "renesas,irqc-r8a7791", "renesas,irqc"; 236 compatible = "renesas,gpio-r8a7791",
293 #interrupt-cells = <2>; 237 "renesas,rcar-gen2-gpio";
294 interrupt-controller; 238 reg = <0 0xe6055400 0 0x50>;
295 reg = <0 0xe61c0000 0 0x200>; 239 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
296 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 240 #gpio-cells = <2>;
297 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 241 gpio-controller;
298 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 242 gpio-ranges = <&pfc 0 192 32>;
299 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 243 #interrupt-cells = <2>;
300 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, 244 interrupt-controller;
301 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, 245 clocks = <&cpg CPG_MOD 905>;
302 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, 246 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
303 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>, 247 resets = <&cpg 905>;
304 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, 248 };
305 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
306 clocks = <&cpg CPG_MOD 407>;
307 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
308 resets = <&cpg 407>;
309 };
310 249
311 dmac0: dma-controller@e6700000 { 250 gpio7: gpio@e6055800 {
312 compatible = "renesas,dmac-r8a7791", "renesas,rcar-dmac"; 251 compatible = "renesas,gpio-r8a7791",
313 reg = <0 0xe6700000 0 0x20000>; 252 "renesas,rcar-gen2-gpio";
314 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH 253 reg = <0 0xe6055800 0 0x50>;
315 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH 254 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
316 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH 255 #gpio-cells = <2>;
317 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH 256 gpio-controller;
318 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH 257 gpio-ranges = <&pfc 0 224 26>;
319 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH 258 #interrupt-cells = <2>;
320 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH 259 interrupt-controller;
321 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 260 clocks = <&cpg CPG_MOD 904>;
322 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH 261 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
323 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH 262 resets = <&cpg 904>;
324 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH 263 };
325 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
326 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
327 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
328 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
329 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
330 interrupt-names = "error",
331 "ch0", "ch1", "ch2", "ch3",
332 "ch4", "ch5", "ch6", "ch7",
333 "ch8", "ch9", "ch10", "ch11",
334 "ch12", "ch13", "ch14";
335 clocks = <&cpg CPG_MOD 219>;
336 clock-names = "fck";
337 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
338 resets = <&cpg 219>;
339 #dma-cells = <1>;
340 dma-channels = <15>;
341 };
342 264
343 dmac1: dma-controller@e6720000 { 265 pfc: pin-controller@e6060000 {
344 compatible = "renesas,dmac-r8a7791", "renesas,rcar-dmac"; 266 compatible = "renesas,pfc-r8a7791";
345 reg = <0 0xe6720000 0 0x20000>; 267 reg = <0 0xe6060000 0 0x250>;
346 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH 268 };
347 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
348 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
349 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
350 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
351 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
352 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
353 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
354 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
355 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
356 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
357 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
358 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
359 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
360 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
361 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
362 interrupt-names = "error",
363 "ch0", "ch1", "ch2", "ch3",
364 "ch4", "ch5", "ch6", "ch7",
365 "ch8", "ch9", "ch10", "ch11",
366 "ch12", "ch13", "ch14";
367 clocks = <&cpg CPG_MOD 218>;
368 clock-names = "fck";
369 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
370 resets = <&cpg 218>;
371 #dma-cells = <1>;
372 dma-channels = <15>;
373 };
374 269
375 audma0: dma-controller@ec700000 { 270 cpg: clock-controller@e6150000 {
376 compatible = "renesas,dmac-r8a7791", "renesas,rcar-dmac"; 271 compatible = "renesas,r8a7791-cpg-mssr";
377 reg = <0 0xec700000 0 0x10000>; 272 reg = <0 0xe6150000 0 0x1000>;
378 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH 273 clocks = <&extal_clk>, <&usb_extal_clk>;
379 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH 274 clock-names = "extal", "usb_extal";
380 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH 275 #clock-cells = <2>;
381 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH 276 #power-domain-cells = <0>;
382 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH 277 #reset-cells = <1>;
383 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH 278 };
384 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
385 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
386 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
387 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
388 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
389 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
390 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
391 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
392 interrupt-names = "error",
393 "ch0", "ch1", "ch2", "ch3",
394 "ch4", "ch5", "ch6", "ch7",
395 "ch8", "ch9", "ch10", "ch11",
396 "ch12";
397 clocks = <&cpg CPG_MOD 502>;
398 clock-names = "fck";
399 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
400 resets = <&cpg 502>;
401 #dma-cells = <1>;
402 dma-channels = <13>;
403 };
404 279
405 audma1: dma-controller@ec720000 { 280 apmu@e6152000 {
406 compatible = "renesas,dmac-r8a7791", "renesas,rcar-dmac"; 281 compatible = "renesas,r8a7791-apmu", "renesas,apmu";
407 reg = <0 0xec720000 0 0x10000>; 282 reg = <0 0xe6152000 0 0x188>;
408 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH 283 cpus = <&cpu0 &cpu1>;
409 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH 284 };
410 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
411 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
412 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
413 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
414 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
415 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
416 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
417 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
418 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
419 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
420 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
421 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
422 interrupt-names = "error",
423 "ch0", "ch1", "ch2", "ch3",
424 "ch4", "ch5", "ch6", "ch7",
425 "ch8", "ch9", "ch10", "ch11",
426 "ch12";
427 clocks = <&cpg CPG_MOD 501>;
428 clock-names = "fck";
429 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
430 resets = <&cpg 501>;
431 #dma-cells = <1>;
432 dma-channels = <13>;
433 };
434 285
435 usb_dmac0: dma-controller@e65a0000 { 286 rst: reset-controller@e6160000 {
436 compatible = "renesas,r8a7791-usb-dmac", "renesas,usb-dmac"; 287 compatible = "renesas,r8a7791-rst";
437 reg = <0 0xe65a0000 0 0x100>; 288 reg = <0 0xe6160000 0 0x0100>;
438 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH 289 };
439 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
440 interrupt-names = "ch0", "ch1";
441 clocks = <&cpg CPG_MOD 330>;
442 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
443 resets = <&cpg 330>;
444 #dma-cells = <1>;
445 dma-channels = <2>;
446 };
447 290
448 usb_dmac1: dma-controller@e65b0000 { 291 sysc: system-controller@e6180000 {
449 compatible = "renesas,r8a7791-usb-dmac", "renesas,usb-dmac"; 292 compatible = "renesas,r8a7791-sysc";
450 reg = <0 0xe65b0000 0 0x100>; 293 reg = <0 0xe6180000 0 0x0200>;
451 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 294 #power-domain-cells = <1>;
452 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>; 295 };
453 interrupt-names = "ch0", "ch1";
454 clocks = <&cpg CPG_MOD 331>;
455 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
456 resets = <&cpg 331>;
457 #dma-cells = <1>;
458 dma-channels = <2>;
459 };
460 296
461 /* The memory map in the User's Manual maps the cores to bus numbers */ 297 irqc0: interrupt-controller@e61c0000 {
462 i2c0: i2c@e6508000 { 298 compatible = "renesas,irqc-r8a7791", "renesas,irqc";
463 #address-cells = <1>; 299 #interrupt-cells = <2>;
464 #size-cells = <0>; 300 interrupt-controller;
465 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 301 reg = <0 0xe61c0000 0 0x200>;
466 reg = <0 0xe6508000 0 0x40>; 302 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
467 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 303 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
468 clocks = <&cpg CPG_MOD 931>; 304 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
469 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 305 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
470 resets = <&cpg 931>; 306 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
471 i2c-scl-internal-delay-ns = <6>; 307 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
472 status = "disabled"; 308 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
473 }; 309 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
310 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
311 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
312 clocks = <&cpg CPG_MOD 407>;
313 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
314 resets = <&cpg 407>;
315 };
474 316
475 i2c1: i2c@e6518000 { 317 thermal: thermal@e61f0000 {
476 #address-cells = <1>; 318 compatible = "renesas,thermal-r8a7791",
477 #size-cells = <0>; 319 "renesas,rcar-gen2-thermal",
478 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 320 "renesas,rcar-thermal";
479 reg = <0 0xe6518000 0 0x40>; 321 reg = <0 0xe61f0000 0 0x10>, <0 0xe61f0100 0 0x38>;
480 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>; 322 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
481 clocks = <&cpg CPG_MOD 930>; 323 clocks = <&cpg CPG_MOD 522>;
482 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 324 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
483 resets = <&cpg 930>; 325 resets = <&cpg 522>;
484 i2c-scl-internal-delay-ns = <6>; 326 #thermal-sensor-cells = <0>;
485 status = "disabled"; 327 };
486 };
487 328
488 i2c2: i2c@e6530000 { 329 ipmmu_sy0: mmu@e6280000 {
489 #address-cells = <1>; 330 compatible = "renesas,ipmmu-r8a7791",
490 #size-cells = <0>; 331 "renesas,ipmmu-vmsa";
491 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 332 reg = <0 0xe6280000 0 0x1000>;
492 reg = <0 0xe6530000 0 0x40>; 333 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
493 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>; 334 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
494 clocks = <&cpg CPG_MOD 929>; 335 #iommu-cells = <1>;
495 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 336 status = "disabled";
496 resets = <&cpg 929>; 337 };
497 i2c-scl-internal-delay-ns = <6>;
498 status = "disabled";
499 };
500 338
501 i2c3: i2c@e6540000 { 339 ipmmu_sy1: mmu@e6290000 {
502 #address-cells = <1>; 340 compatible = "renesas,ipmmu-r8a7791",
503 #size-cells = <0>; 341 "renesas,ipmmu-vmsa";
504 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 342 reg = <0 0xe6290000 0 0x1000>;
505 reg = <0 0xe6540000 0 0x40>; 343 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
506 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>; 344 #iommu-cells = <1>;
507 clocks = <&cpg CPG_MOD 928>; 345 status = "disabled";
508 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 346 };
509 resets = <&cpg 928>;
510 i2c-scl-internal-delay-ns = <6>;
511 status = "disabled";
512 };
513 347
514 i2c4: i2c@e6520000 { 348 ipmmu_ds: mmu@e6740000 {
515 #address-cells = <1>; 349 compatible = "renesas,ipmmu-r8a7791",
516 #size-cells = <0>; 350 "renesas,ipmmu-vmsa";
517 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 351 reg = <0 0xe6740000 0 0x1000>;
518 reg = <0 0xe6520000 0 0x40>; 352 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
519 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; 353 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
520 clocks = <&cpg CPG_MOD 927>; 354 #iommu-cells = <1>;
521 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 355 status = "disabled";
522 resets = <&cpg 927>; 356 };
523 i2c-scl-internal-delay-ns = <6>;
524 status = "disabled";
525 };
526 357
527 i2c5: i2c@e6528000 { 358 ipmmu_mp: mmu@ec680000 {
528 /* doesn't need pinmux */ 359 compatible = "renesas,ipmmu-r8a7791",
529 #address-cells = <1>; 360 "renesas,ipmmu-vmsa";
530 #size-cells = <0>; 361 reg = <0 0xec680000 0 0x1000>;
531 compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 362 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
532 reg = <0 0xe6528000 0 0x40>; 363 #iommu-cells = <1>;
533 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; 364 status = "disabled";
534 clocks = <&cpg CPG_MOD 925>; 365 };
535 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
536 resets = <&cpg 925>;
537 i2c-scl-internal-delay-ns = <110>;
538 status = "disabled";
539 };
540 366
541 i2c6: i2c@e60b0000 { 367 ipmmu_mx: mmu@fe951000 {
542 /* doesn't need pinmux */ 368 compatible = "renesas,ipmmu-r8a7791",
543 #address-cells = <1>; 369 "renesas,ipmmu-vmsa";
544 #size-cells = <0>; 370 reg = <0 0xfe951000 0 0x1000>;
545 compatible = "renesas,iic-r8a7791", "renesas,rcar-gen2-iic", 371 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
546 "renesas,rmobile-iic"; 372 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
547 reg = <0 0xe60b0000 0 0x425>; 373 #iommu-cells = <1>;
548 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; 374 status = "disabled";
549 clocks = <&cpg CPG_MOD 926>; 375 };
550 dmas = <&dmac0 0x77>, <&dmac0 0x78>,
551 <&dmac1 0x77>, <&dmac1 0x78>;
552 dma-names = "tx", "rx", "tx", "rx";
553 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
554 resets = <&cpg 926>;
555 status = "disabled";
556 };
557 376
558 i2c7: i2c@e6500000 { 377 ipmmu_rt: mmu@ffc80000 {
559 #address-cells = <1>; 378 compatible = "renesas,ipmmu-r8a7791",
560 #size-cells = <0>; 379 "renesas,ipmmu-vmsa";
561 compatible = "renesas,iic-r8a7791", "renesas,rcar-gen2-iic", 380 reg = <0 0xffc80000 0 0x1000>;
562 "renesas,rmobile-iic"; 381 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
563 reg = <0 0xe6500000 0 0x425>; 382 #iommu-cells = <1>;
564 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; 383 status = "disabled";
565 clocks = <&cpg CPG_MOD 318>; 384 };
566 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
567 <&dmac1 0x61>, <&dmac1 0x62>;
568 dma-names = "tx", "rx", "tx", "rx";
569 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
570 resets = <&cpg 318>;
571 status = "disabled";
572 };
573 385
574 i2c8: i2c@e6510000 { 386 ipmmu_gp: mmu@e62a0000 {
575 #address-cells = <1>; 387 compatible = "renesas,ipmmu-r8a7791",
576 #size-cells = <0>; 388 "renesas,ipmmu-vmsa";
577 compatible = "renesas,iic-r8a7791", "renesas,rcar-gen2-iic", 389 reg = <0 0xe62a0000 0 0x1000>;
578 "renesas,rmobile-iic"; 390 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
579 reg = <0 0xe6510000 0 0x425>; 391 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
580 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; 392 #iommu-cells = <1>;
581 clocks = <&cpg CPG_MOD 323>; 393 status = "disabled";
582 dmas = <&dmac0 0x65>, <&dmac0 0x66>, 394 };
583 <&dmac1 0x65>, <&dmac1 0x66>;
584 dma-names = "tx", "rx", "tx", "rx";
585 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
586 resets = <&cpg 323>;
587 status = "disabled";
588 };
589 395
590 pfc: pin-controller@e6060000 { 396 icram0: sram@e63a0000 {
591 compatible = "renesas,pfc-r8a7791"; 397 compatible = "mmio-sram";
592 reg = <0 0xe6060000 0 0x250>; 398 reg = <0 0xe63a0000 0 0x12000>;
593 }; 399 };
594 400
595 mmcif0: mmc@ee200000 { 401 icram1: sram@e63c0000 {
596 compatible = "renesas,mmcif-r8a7791", "renesas,sh-mmcif"; 402 compatible = "mmio-sram";
597 reg = <0 0xee200000 0 0x80>; 403 reg = <0 0xe63c0000 0 0x1000>;
598 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; 404 #address-cells = <1>;
599 clocks = <&cpg CPG_MOD 315>; 405 #size-cells = <1>;
600 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>, 406 ranges = <0 0 0xe63c0000 0x1000>;
601 <&dmac1 0xd1>, <&dmac1 0xd2>;
602 dma-names = "tx", "rx", "tx", "rx";
603 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
604 resets = <&cpg 315>;
605 reg-io-width = <4>;
606 status = "disabled";
607 max-frequency = <97500000>;
608 };
609 407
610 sdhi0: sd@ee100000 { 408 smp-sram@0 {
611 compatible = "renesas,sdhi-r8a7791", 409 compatible = "renesas,smp-sram";
612 "renesas,rcar-gen2-sdhi"; 410 reg = <0 0x10>;
613 reg = <0 0xee100000 0 0x328>; 411 };
614 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>; 412 };
615 clocks = <&cpg CPG_MOD 314>;
616 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
617 <&dmac1 0xcd>, <&dmac1 0xce>;
618 dma-names = "tx", "rx", "tx", "rx";
619 max-frequency = <195000000>;
620 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
621 resets = <&cpg 314>;
622 status = "disabled";
623 };
624 413
625 sdhi1: sd@ee140000 { 414 /* The memory map in the User's Manual maps the cores to
626 compatible = "renesas,sdhi-r8a7791", 415 * bus numbers
627 "renesas,rcar-gen2-sdhi"; 416 */
628 reg = <0 0xee140000 0 0x100>; 417 i2c0: i2c@e6508000 {
629 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>; 418 #address-cells = <1>;
630 clocks = <&cpg CPG_MOD 312>; 419 #size-cells = <0>;
631 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>, 420 compatible = "renesas,i2c-r8a7791",
632 <&dmac1 0xc1>, <&dmac1 0xc2>; 421 "renesas,rcar-gen2-i2c";
633 dma-names = "tx", "rx", "tx", "rx"; 422 reg = <0 0xe6508000 0 0x40>;
634 max-frequency = <97500000>; 423 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
635 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 424 clocks = <&cpg CPG_MOD 931>;
636 resets = <&cpg 312>; 425 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
637 status = "disabled"; 426 resets = <&cpg 931>;
638 }; 427 i2c-scl-internal-delay-ns = <6>;
428 status = "disabled";
429 };
639 430
640 sdhi2: sd@ee160000 { 431 i2c1: i2c@e6518000 {
641 compatible = "renesas,sdhi-r8a7791", 432 #address-cells = <1>;
642 "renesas,rcar-gen2-sdhi"; 433 #size-cells = <0>;
643 reg = <0 0xee160000 0 0x100>; 434 compatible = "renesas,i2c-r8a7791",
644 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; 435 "renesas,rcar-gen2-i2c";
645 clocks = <&cpg CPG_MOD 311>; 436 reg = <0 0xe6518000 0 0x40>;
646 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>, 437 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
647 <&dmac1 0xd3>, <&dmac1 0xd4>; 438 clocks = <&cpg CPG_MOD 930>;
648 dma-names = "tx", "rx", "tx", "rx"; 439 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
649 max-frequency = <97500000>; 440 resets = <&cpg 930>;
650 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 441 i2c-scl-internal-delay-ns = <6>;
651 resets = <&cpg 311>; 442 status = "disabled";
652 status = "disabled"; 443 };
653 };
654 444
655 scifa0: serial@e6c40000 { 445 i2c2: i2c@e6530000 {
656 compatible = "renesas,scifa-r8a7791", 446 #address-cells = <1>;
657 "renesas,rcar-gen2-scifa", "renesas,scifa"; 447 #size-cells = <0>;
658 reg = <0 0xe6c40000 0 64>; 448 compatible = "renesas,i2c-r8a7791",
659 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 449 "renesas,rcar-gen2-i2c";
660 clocks = <&cpg CPG_MOD 204>; 450 reg = <0 0xe6530000 0 0x40>;
661 clock-names = "fck"; 451 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
662 dmas = <&dmac0 0x21>, <&dmac0 0x22>, 452 clocks = <&cpg CPG_MOD 929>;
663 <&dmac1 0x21>, <&dmac1 0x22>; 453 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
664 dma-names = "tx", "rx", "tx", "rx"; 454 resets = <&cpg 929>;
665 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 455 i2c-scl-internal-delay-ns = <6>;
666 resets = <&cpg 204>; 456 status = "disabled";
667 status = "disabled"; 457 };
668 };
669 458
670 scifa1: serial@e6c50000 { 459 i2c3: i2c@e6540000 {
671 compatible = "renesas,scifa-r8a7791", 460 #address-cells = <1>;
672 "renesas,rcar-gen2-scifa", "renesas,scifa"; 461 #size-cells = <0>;
673 reg = <0 0xe6c50000 0 64>; 462 compatible = "renesas,i2c-r8a7791",
674 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; 463 "renesas,rcar-gen2-i2c";
675 clocks = <&cpg CPG_MOD 203>; 464 reg = <0 0xe6540000 0 0x40>;
676 clock-names = "fck"; 465 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
677 dmas = <&dmac0 0x25>, <&dmac0 0x26>, 466 clocks = <&cpg CPG_MOD 928>;
678 <&dmac1 0x25>, <&dmac1 0x26>; 467 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
679 dma-names = "tx", "rx", "tx", "rx"; 468 resets = <&cpg 928>;
680 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 469 i2c-scl-internal-delay-ns = <6>;
681 resets = <&cpg 203>; 470 status = "disabled";
682 status = "disabled"; 471 };
683 };
684 472
685 scifa2: serial@e6c60000 { 473 i2c4: i2c@e6520000 {
686 compatible = "renesas,scifa-r8a7791", 474 #address-cells = <1>;
687 "renesas,rcar-gen2-scifa", "renesas,scifa"; 475 #size-cells = <0>;
688 reg = <0 0xe6c60000 0 64>; 476 compatible = "renesas,i2c-r8a7791",
689 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; 477 "renesas,rcar-gen2-i2c";
690 clocks = <&cpg CPG_MOD 202>; 478 reg = <0 0xe6520000 0 0x40>;
691 clock-names = "fck"; 479 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
692 dmas = <&dmac0 0x27>, <&dmac0 0x28>, 480 clocks = <&cpg CPG_MOD 927>;
693 <&dmac1 0x27>, <&dmac1 0x28>; 481 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
694 dma-names = "tx", "rx", "tx", "rx"; 482 resets = <&cpg 927>;
695 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 483 i2c-scl-internal-delay-ns = <6>;
696 resets = <&cpg 202>; 484 status = "disabled";
697 status = "disabled"; 485 };
698 };
699 486
700 scifa3: serial@e6c70000 { 487 i2c5: i2c@e6528000 {
701 compatible = "renesas,scifa-r8a7791", 488 /* doesn't need pinmux */
702 "renesas,rcar-gen2-scifa", "renesas,scifa"; 489 #address-cells = <1>;
703 reg = <0 0xe6c70000 0 64>; 490 #size-cells = <0>;
704 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; 491 compatible = "renesas,i2c-r8a7791",
705 clocks = <&cpg CPG_MOD 1106>; 492 "renesas,rcar-gen2-i2c";
706 clock-names = "fck"; 493 reg = <0 0xe6528000 0 0x40>;
707 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>, 494 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
708 <&dmac1 0x1b>, <&dmac1 0x1c>; 495 clocks = <&cpg CPG_MOD 925>;
709 dma-names = "tx", "rx", "tx", "rx"; 496 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
710 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 497 resets = <&cpg 925>;
711 resets = <&cpg 1106>; 498 i2c-scl-internal-delay-ns = <110>;
712 status = "disabled"; 499 status = "disabled";
713 }; 500 };
714 501
715 scifa4: serial@e6c78000 { 502 i2c6: i2c@e60b0000 {
716 compatible = "renesas,scifa-r8a7791", 503 /* doesn't need pinmux */
717 "renesas,rcar-gen2-scifa", "renesas,scifa"; 504 #address-cells = <1>;
718 reg = <0 0xe6c78000 0 64>; 505 #size-cells = <0>;
719 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; 506 compatible = "renesas,iic-r8a7791",
720 clocks = <&cpg CPG_MOD 1107>; 507 "renesas,rcar-gen2-iic",
721 clock-names = "fck"; 508 "renesas,rmobile-iic";
722 dmas = <&dmac0 0x1f>, <&dmac0 0x20>, 509 reg = <0 0xe60b0000 0 0x425>;
723 <&dmac1 0x1f>, <&dmac1 0x20>; 510 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
724 dma-names = "tx", "rx", "tx", "rx"; 511 clocks = <&cpg CPG_MOD 926>;
725 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 512 dmas = <&dmac0 0x77>, <&dmac0 0x78>,
726 resets = <&cpg 1107>; 513 <&dmac1 0x77>, <&dmac1 0x78>;
727 status = "disabled"; 514 dma-names = "tx", "rx", "tx", "rx";
728 }; 515 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
516 resets = <&cpg 926>;
517 status = "disabled";
518 };
729 519
730 scifa5: serial@e6c80000 { 520 i2c7: i2c@e6500000 {
731 compatible = "renesas,scifa-r8a7791", 521 #address-cells = <1>;
732 "renesas,rcar-gen2-scifa", "renesas,scifa"; 522 #size-cells = <0>;
733 reg = <0 0xe6c80000 0 64>; 523 compatible = "renesas,iic-r8a7791",
734 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 524 "renesas,rcar-gen2-iic",
735 clocks = <&cpg CPG_MOD 1108>; 525 "renesas,rmobile-iic";
736 clock-names = "fck"; 526 reg = <0 0xe6500000 0 0x425>;
737 dmas = <&dmac0 0x23>, <&dmac0 0x24>, 527 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
738 <&dmac1 0x23>, <&dmac1 0x24>; 528 clocks = <&cpg CPG_MOD 318>;
739 dma-names = "tx", "rx", "tx", "rx"; 529 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
740 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 530 <&dmac1 0x61>, <&dmac1 0x62>;
741 resets = <&cpg 1108>; 531 dma-names = "tx", "rx", "tx", "rx";
742 status = "disabled"; 532 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
743 }; 533 resets = <&cpg 318>;
534 status = "disabled";
535 };
744 536
745 scifb0: serial@e6c20000 { 537 i2c8: i2c@e6510000 {
746 compatible = "renesas,scifb-r8a7791", 538 #address-cells = <1>;
747 "renesas,rcar-gen2-scifb", "renesas,scifb"; 539 #size-cells = <0>;
748 reg = <0 0xe6c20000 0 0x100>; 540 compatible = "renesas,iic-r8a7791",
749 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; 541 "renesas,rcar-gen2-iic",
750 clocks = <&cpg CPG_MOD 206>; 542 "renesas,rmobile-iic";
751 clock-names = "fck"; 543 reg = <0 0xe6510000 0 0x425>;
752 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>, 544 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
753 <&dmac1 0x3d>, <&dmac1 0x3e>; 545 clocks = <&cpg CPG_MOD 323>;
754 dma-names = "tx", "rx", "tx", "rx"; 546 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
755 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 547 <&dmac1 0x65>, <&dmac1 0x66>;
756 resets = <&cpg 206>; 548 dma-names = "tx", "rx", "tx", "rx";
757 status = "disabled"; 549 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
758 }; 550 resets = <&cpg 323>;
551 status = "disabled";
552 };
759 553
760 scifb1: serial@e6c30000 { 554 hsusb: usb@e6590000 {
761 compatible = "renesas,scifb-r8a7791", 555 compatible = "renesas,usbhs-r8a7791",
762 "renesas,rcar-gen2-scifb", "renesas,scifb"; 556 "renesas,rcar-gen2-usbhs";
763 reg = <0 0xe6c30000 0 0x100>; 557 reg = <0 0xe6590000 0 0x100>;
764 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>; 558 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
765 clocks = <&cpg CPG_MOD 207>; 559 clocks = <&cpg CPG_MOD 704>;
766 clock-names = "fck"; 560 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
767 dmas = <&dmac0 0x19>, <&dmac0 0x1a>, 561 <&usb_dmac1 0>, <&usb_dmac1 1>;
768 <&dmac1 0x19>, <&dmac1 0x1a>; 562 dma-names = "ch0", "ch1", "ch2", "ch3";
769 dma-names = "tx", "rx", "tx", "rx"; 563 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
770 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 564 resets = <&cpg 704>;
771 resets = <&cpg 207>; 565 renesas,buswait = <4>;
772 status = "disabled"; 566 phys = <&usb0 1>;
773 }; 567 phy-names = "usb";
568 status = "disabled";
569 };
774 570
775 scifb2: serial@e6ce0000 { 571 usbphy: usb-phy@e6590100 {
776 compatible = "renesas,scifb-r8a7791", 572 compatible = "renesas,usb-phy-r8a7791",
777 "renesas,rcar-gen2-scifb", "renesas,scifb"; 573 "renesas,rcar-gen2-usb-phy";
778 reg = <0 0xe6ce0000 0 0x100>; 574 reg = <0 0xe6590100 0 0x100>;
779 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>; 575 #address-cells = <1>;
780 clocks = <&cpg CPG_MOD 216>; 576 #size-cells = <0>;
781 clock-names = "fck"; 577 clocks = <&cpg CPG_MOD 704>;
782 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>, 578 clock-names = "usbhs";
783 <&dmac1 0x1d>, <&dmac1 0x1e>; 579 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
784 dma-names = "tx", "rx", "tx", "rx"; 580 resets = <&cpg 704>;
785 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 581 status = "disabled";
786 resets = <&cpg 216>;
787 status = "disabled";
788 };
789 582
790 scif0: serial@e6e60000 { 583 usb0: usb-channel@0 {
791 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 584 reg = <0>;
792 "renesas,scif"; 585 #phy-cells = <1>;
793 reg = <0 0xe6e60000 0 64>; 586 };
794 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>; 587 usb2: usb-channel@2 {
795 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 588 reg = <2>;
796 <&scif_clk>; 589 #phy-cells = <1>;
797 clock-names = "fck", "brg_int", "scif_clk"; 590 };
798 dmas = <&dmac0 0x29>, <&dmac0 0x2a>, 591 };
799 <&dmac1 0x29>, <&dmac1 0x2a>;
800 dma-names = "tx", "rx", "tx", "rx";
801 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
802 resets = <&cpg 721>;
803 status = "disabled";
804 };
805 592
806 scif1: serial@e6e68000 { 593 usb_dmac0: dma-controller@e65a0000 {
807 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 594 compatible = "renesas,r8a7791-usb-dmac",
808 "renesas,scif"; 595 "renesas,usb-dmac";
809 reg = <0 0xe6e68000 0 64>; 596 reg = <0 0xe65a0000 0 0x100>;
810 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>; 597 interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
811 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 598 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
812 <&scif_clk>; 599 interrupt-names = "ch0", "ch1";
813 clock-names = "fck", "brg_int", "scif_clk"; 600 clocks = <&cpg CPG_MOD 330>;
814 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>, 601 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
815 <&dmac1 0x2d>, <&dmac1 0x2e>; 602 resets = <&cpg 330>;
816 dma-names = "tx", "rx", "tx", "rx"; 603 #dma-cells = <1>;
817 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 604 dma-channels = <2>;
818 resets = <&cpg 720>; 605 };
819 status = "disabled";
820 };
821 606
822 adc: adc@e6e54000 { 607 usb_dmac1: dma-controller@e65b0000 {
823 compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc"; 608 compatible = "renesas,r8a7791-usb-dmac",
824 reg = <0 0xe6e54000 0 64>; 609 "renesas,usb-dmac";
825 clocks = <&cpg CPG_MOD 901>; 610 reg = <0 0xe65b0000 0 0x100>;
826 clock-names = "fck"; 611 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
827 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 612 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
828 resets = <&cpg 901>; 613 interrupt-names = "ch0", "ch1";
829 status = "disabled"; 614 clocks = <&cpg CPG_MOD 331>;
830 }; 615 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
616 resets = <&cpg 331>;
617 #dma-cells = <1>;
618 dma-channels = <2>;
619 };
831 620
832 scif2: serial@e6e58000 { 621 dmac0: dma-controller@e6700000 {
833 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 622 compatible = "renesas,dmac-r8a7791",
834 "renesas,scif"; 623 "renesas,rcar-dmac";
835 reg = <0 0xe6e58000 0 64>; 624 reg = <0 0xe6700000 0 0x20000>;
836 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; 625 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH
837 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 626 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
838 <&scif_clk>; 627 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
839 clock-names = "fck", "brg_int", "scif_clk"; 628 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
840 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>, 629 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
841 <&dmac1 0x2b>, <&dmac1 0x2c>; 630 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
842 dma-names = "tx", "rx", "tx", "rx"; 631 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
843 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 632 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
844 resets = <&cpg 719>; 633 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
845 status = "disabled"; 634 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
846 }; 635 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
636 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
637 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
638 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
639 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
640 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
641 interrupt-names = "error",
642 "ch0", "ch1", "ch2", "ch3",
643 "ch4", "ch5", "ch6", "ch7",
644 "ch8", "ch9", "ch10", "ch11",
645 "ch12", "ch13", "ch14";
646 clocks = <&cpg CPG_MOD 219>;
647 clock-names = "fck";
648 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
649 resets = <&cpg 219>;
650 #dma-cells = <1>;
651 dma-channels = <15>;
652 };
847 653
848 scif3: serial@e6ea8000 { 654 dmac1: dma-controller@e6720000 {
849 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 655 compatible = "renesas,dmac-r8a7791",
850 "renesas,scif"; 656 "renesas,rcar-dmac";
851 reg = <0 0xe6ea8000 0 64>; 657 reg = <0 0xe6720000 0 0x20000>;
852 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 658 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
853 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 659 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
854 <&scif_clk>; 660 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
855 clock-names = "fck", "brg_int", "scif_clk"; 661 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
856 dmas = <&dmac0 0x2f>, <&dmac0 0x30>, 662 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
857 <&dmac1 0x2f>, <&dmac1 0x30>; 663 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
858 dma-names = "tx", "rx", "tx", "rx"; 664 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
859 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 665 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
860 resets = <&cpg 718>; 666 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
861 status = "disabled"; 667 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
862 }; 668 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
669 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
670 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
671 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
672 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
673 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
674 interrupt-names = "error",
675 "ch0", "ch1", "ch2", "ch3",
676 "ch4", "ch5", "ch6", "ch7",
677 "ch8", "ch9", "ch10", "ch11",
678 "ch12", "ch13", "ch14";
679 clocks = <&cpg CPG_MOD 218>;
680 clock-names = "fck";
681 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
682 resets = <&cpg 218>;
683 #dma-cells = <1>;
684 dma-channels = <15>;
685 };
863 686
864 scif4: serial@e6ee0000 { 687 avb: ethernet@e6800000 {
865 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 688 compatible = "renesas,etheravb-r8a7791",
866 "renesas,scif"; 689 "renesas,etheravb-rcar-gen2";
867 reg = <0 0xe6ee0000 0 64>; 690 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
868 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 691 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
869 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 692 clocks = <&cpg CPG_MOD 812>;
870 <&scif_clk>; 693 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
871 clock-names = "fck", "brg_int", "scif_clk"; 694 resets = <&cpg 812>;
872 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>, 695 #address-cells = <1>;
873 <&dmac1 0xfb>, <&dmac1 0xfc>; 696 #size-cells = <0>;
874 dma-names = "tx", "rx", "tx", "rx"; 697 status = "disabled";
875 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 698 };
876 resets = <&cpg 715>;
877 status = "disabled";
878 };
879 699
880 scif5: serial@e6ee8000 { 700 qspi: spi@e6b10000 {
881 compatible = "renesas,scif-r8a7791", "renesas,rcar-gen2-scif", 701 compatible = "renesas,qspi-r8a7791", "renesas,qspi";
882 "renesas,scif"; 702 reg = <0 0xe6b10000 0 0x2c>;
883 reg = <0 0xe6ee8000 0 64>; 703 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
884 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; 704 clocks = <&cpg CPG_MOD 917>;
885 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 705 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
886 <&scif_clk>; 706 <&dmac1 0x17>, <&dmac1 0x18>;
887 clock-names = "fck", "brg_int", "scif_clk"; 707 dma-names = "tx", "rx", "tx", "rx";
888 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>, 708 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
889 <&dmac1 0xfd>, <&dmac1 0xfe>; 709 resets = <&cpg 917>;
890 dma-names = "tx", "rx", "tx", "rx"; 710 num-cs = <1>;
891 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 711 #address-cells = <1>;
892 resets = <&cpg 714>; 712 #size-cells = <0>;
893 status = "disabled"; 713 status = "disabled";
894 }; 714 };
895 715
896 hscif0: serial@e62c0000 { 716 scifa0: serial@e6c40000 {
897 compatible = "renesas,hscif-r8a7791", 717 compatible = "renesas,scifa-r8a7791",
898 "renesas,rcar-gen2-hscif", "renesas,hscif"; 718 "renesas,rcar-gen2-scifa", "renesas,scifa";
899 reg = <0 0xe62c0000 0 96>; 719 reg = <0 0xe6c40000 0 64>;
900 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>; 720 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
901 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 721 clocks = <&cpg CPG_MOD 204>;
902 <&scif_clk>; 722 clock-names = "fck";
903 clock-names = "fck", "brg_int", "scif_clk"; 723 dmas = <&dmac0 0x21>, <&dmac0 0x22>,
904 dmas = <&dmac0 0x39>, <&dmac0 0x3a>, 724 <&dmac1 0x21>, <&dmac1 0x22>;
905 <&dmac1 0x39>, <&dmac1 0x3a>; 725 dma-names = "tx", "rx", "tx", "rx";
906 dma-names = "tx", "rx", "tx", "rx"; 726 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
907 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 727 resets = <&cpg 204>;
908 resets = <&cpg 717>; 728 status = "disabled";
909 status = "disabled"; 729 };
910 };
911 730
912 hscif1: serial@e62c8000 { 731 scifa1: serial@e6c50000 {
913 compatible = "renesas,hscif-r8a7791", 732 compatible = "renesas,scifa-r8a7791",
914 "renesas,rcar-gen2-hscif", "renesas,hscif"; 733 "renesas,rcar-gen2-scifa", "renesas,scifa";
915 reg = <0 0xe62c8000 0 96>; 734 reg = <0 0xe6c50000 0 64>;
916 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>; 735 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
917 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 736 clocks = <&cpg CPG_MOD 203>;
918 <&scif_clk>; 737 clock-names = "fck";
919 clock-names = "fck", "brg_int", "scif_clk"; 738 dmas = <&dmac0 0x25>, <&dmac0 0x26>,
920 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>, 739 <&dmac1 0x25>, <&dmac1 0x26>;
921 <&dmac1 0x4d>, <&dmac1 0x4e>; 740 dma-names = "tx", "rx", "tx", "rx";
922 dma-names = "tx", "rx", "tx", "rx"; 741 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
923 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 742 resets = <&cpg 203>;
924 resets = <&cpg 716>; 743 status = "disabled";
925 status = "disabled"; 744 };
926 };
927 745
928 hscif2: serial@e62d0000 { 746 scifa2: serial@e6c60000 {
929 compatible = "renesas,hscif-r8a7791", 747 compatible = "renesas,scifa-r8a7791",
930 "renesas,rcar-gen2-hscif", "renesas,hscif"; 748 "renesas,rcar-gen2-scifa", "renesas,scifa";
931 reg = <0 0xe62d0000 0 96>; 749 reg = <0 0xe6c60000 0 64>;
932 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; 750 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
933 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7791_CLK_ZS>, 751 clocks = <&cpg CPG_MOD 202>;
934 <&scif_clk>; 752 clock-names = "fck";
935 clock-names = "fck", "brg_int", "scif_clk"; 753 dmas = <&dmac0 0x27>, <&dmac0 0x28>,
936 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>, 754 <&dmac1 0x27>, <&dmac1 0x28>;
937 <&dmac1 0x3b>, <&dmac1 0x3c>; 755 dma-names = "tx", "rx", "tx", "rx";
938 dma-names = "tx", "rx", "tx", "rx"; 756 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
939 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 757 resets = <&cpg 202>;
940 resets = <&cpg 713>; 758 status = "disabled";
941 status = "disabled"; 759 };
942 };
943 760
944 icram0: sram@e63a0000 { 761 scifa3: serial@e6c70000 {
945 compatible = "mmio-sram"; 762 compatible = "renesas,scifa-r8a7791",
946 reg = <0 0xe63a0000 0 0x12000>; 763 "renesas,rcar-gen2-scifa", "renesas,scifa";
947 }; 764 reg = <0 0xe6c70000 0 64>;
765 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
766 clocks = <&cpg CPG_MOD 1106>;
767 clock-names = "fck";
768 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>,
769 <&dmac1 0x1b>, <&dmac1 0x1c>;
770 dma-names = "tx", "rx", "tx", "rx";
771 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
772 resets = <&cpg 1106>;
773 status = "disabled";
774 };
948 775
949 icram1: sram@e63c0000 { 776 scifa4: serial@e6c78000 {
950 compatible = "mmio-sram"; 777 compatible = "renesas,scifa-r8a7791",
951 reg = <0 0xe63c0000 0 0x1000>; 778 "renesas,rcar-gen2-scifa", "renesas,scifa";
952 #address-cells = <1>; 779 reg = <0 0xe6c78000 0 64>;
953 #size-cells = <1>; 780 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
954 ranges = <0 0 0xe63c0000 0x1000>; 781 clocks = <&cpg CPG_MOD 1107>;
782 clock-names = "fck";
783 dmas = <&dmac0 0x1f>, <&dmac0 0x20>,
784 <&dmac1 0x1f>, <&dmac1 0x20>;
785 dma-names = "tx", "rx", "tx", "rx";
786 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
787 resets = <&cpg 1107>;
788 status = "disabled";
789 };
955 790
956 smp-sram@0 { 791 scifa5: serial@e6c80000 {
957 compatible = "renesas,smp-sram"; 792 compatible = "renesas,scifa-r8a7791",
958 reg = <0 0x10>; 793 "renesas,rcar-gen2-scifa", "renesas,scifa";
794 reg = <0 0xe6c80000 0 64>;
795 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
796 clocks = <&cpg CPG_MOD 1108>;
797 clock-names = "fck";
798 dmas = <&dmac0 0x23>, <&dmac0 0x24>,
799 <&dmac1 0x23>, <&dmac1 0x24>;
800 dma-names = "tx", "rx", "tx", "rx";
801 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
802 resets = <&cpg 1108>;
803 status = "disabled";
959 }; 804 };
960 };
961 805
962 ether: ethernet@ee700000 { 806 scifb0: serial@e6c20000 {
963 compatible = "renesas,ether-r8a7791", 807 compatible = "renesas,scifb-r8a7791",
964 "renesas,rcar-gen2-ether"; 808 "renesas,rcar-gen2-scifb", "renesas,scifb";
965 reg = <0 0xee700000 0 0x400>; 809 reg = <0 0xe6c20000 0 0x100>;
966 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; 810 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
967 clocks = <&cpg CPG_MOD 813>; 811 clocks = <&cpg CPG_MOD 206>;
968 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 812 clock-names = "fck";
969 resets = <&cpg 813>; 813 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>,
970 phy-mode = "rmii"; 814 <&dmac1 0x3d>, <&dmac1 0x3e>;
971 #address-cells = <1>; 815 dma-names = "tx", "rx", "tx", "rx";
972 #size-cells = <0>; 816 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
973 status = "disabled"; 817 resets = <&cpg 206>;
974 }; 818 status = "disabled";
819 };
975 820
976 avb: ethernet@e6800000 { 821 scifb1: serial@e6c30000 {
977 compatible = "renesas,etheravb-r8a7791", 822 compatible = "renesas,scifb-r8a7791",
978 "renesas,etheravb-rcar-gen2"; 823 "renesas,rcar-gen2-scifb", "renesas,scifb";
979 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>; 824 reg = <0 0xe6c30000 0 0x100>;
980 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>; 825 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
981 clocks = <&cpg CPG_MOD 812>; 826 clocks = <&cpg CPG_MOD 207>;
982 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 827 clock-names = "fck";
983 resets = <&cpg 812>; 828 dmas = <&dmac0 0x19>, <&dmac0 0x1a>,
984 #address-cells = <1>; 829 <&dmac1 0x19>, <&dmac1 0x1a>;
985 #size-cells = <0>; 830 dma-names = "tx", "rx", "tx", "rx";
986 status = "disabled"; 831 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
987 }; 832 resets = <&cpg 207>;
833 status = "disabled";
834 };
988 835
989 sata0: sata@ee300000 { 836 scifb2: serial@e6ce0000 {
990 compatible = "renesas,sata-r8a7791", "renesas,rcar-gen2-sata"; 837 compatible = "renesas,scifb-r8a7791",
991 reg = <0 0xee300000 0 0x2000>; 838 "renesas,rcar-gen2-scifb", "renesas,scifb";
992 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; 839 reg = <0 0xe6ce0000 0 0x100>;
993 clocks = <&cpg CPG_MOD 815>; 840 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
994 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 841 clocks = <&cpg CPG_MOD 216>;
995 resets = <&cpg 815>; 842 clock-names = "fck";
996 status = "disabled"; 843 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>,
997 }; 844 <&dmac1 0x1d>, <&dmac1 0x1e>;
845 dma-names = "tx", "rx", "tx", "rx";
846 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
847 resets = <&cpg 216>;
848 status = "disabled";
849 };
998 850
999 sata1: sata@ee500000 { 851 scif0: serial@e6e60000 {
1000 compatible = "renesas,sata-r8a7791", "renesas,rcar-gen2-sata"; 852 compatible = "renesas,scif-r8a7791",
1001 reg = <0 0xee500000 0 0x2000>; 853 "renesas,rcar-gen2-scif", "renesas,scif";
1002 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; 854 reg = <0 0xe6e60000 0 64>;
1003 clocks = <&cpg CPG_MOD 814>; 855 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
1004 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 856 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1005 resets = <&cpg 814>; 857 <&scif_clk>;
1006 status = "disabled"; 858 clock-names = "fck", "brg_int", "scif_clk";
1007 }; 859 dmas = <&dmac0 0x29>, <&dmac0 0x2a>,
860 <&dmac1 0x29>, <&dmac1 0x2a>;
861 dma-names = "tx", "rx", "tx", "rx";
862 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
863 resets = <&cpg 721>;
864 status = "disabled";
865 };
1008 866
1009 hsusb: usb@e6590000 { 867 scif1: serial@e6e68000 {
1010 compatible = "renesas,usbhs-r8a7791", "renesas,rcar-gen2-usbhs"; 868 compatible = "renesas,scif-r8a7791",
1011 reg = <0 0xe6590000 0 0x100>; 869 "renesas,rcar-gen2-scif", "renesas,scif";
1012 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; 870 reg = <0 0xe6e68000 0 64>;
1013 clocks = <&cpg CPG_MOD 704>; 871 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
1014 dmas = <&usb_dmac0 0>, <&usb_dmac0 1>, 872 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1015 <&usb_dmac1 0>, <&usb_dmac1 1>; 873 <&scif_clk>;
1016 dma-names = "ch0", "ch1", "ch2", "ch3"; 874 clock-names = "fck", "brg_int", "scif_clk";
1017 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 875 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>,
1018 resets = <&cpg 704>; 876 <&dmac1 0x2d>, <&dmac1 0x2e>;
1019 renesas,buswait = <4>; 877 dma-names = "tx", "rx", "tx", "rx";
1020 phys = <&usb0 1>; 878 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1021 phy-names = "usb"; 879 resets = <&cpg 720>;
1022 status = "disabled"; 880 status = "disabled";
1023 }; 881 };
1024 882
1025 usbphy: usb-phy@e6590100 { 883 scif2: serial@e6e58000 {
1026 compatible = "renesas,usb-phy-r8a7791", 884 compatible = "renesas,scif-r8a7791",
1027 "renesas,rcar-gen2-usb-phy"; 885 "renesas,rcar-gen2-scif", "renesas,scif";
1028 reg = <0 0xe6590100 0 0x100>; 886 reg = <0 0xe6e58000 0 64>;
1029 #address-cells = <1>; 887 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
1030 #size-cells = <0>; 888 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1031 clocks = <&cpg CPG_MOD 704>; 889 <&scif_clk>;
1032 clock-names = "usbhs"; 890 clock-names = "fck", "brg_int", "scif_clk";
1033 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 891 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>,
1034 resets = <&cpg 704>; 892 <&dmac1 0x2b>, <&dmac1 0x2c>;
1035 status = "disabled"; 893 dma-names = "tx", "rx", "tx", "rx";
894 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
895 resets = <&cpg 719>;
896 status = "disabled";
897 };
1036 898
1037 usb0: usb-channel@0 { 899 scif3: serial@e6ea8000 {
1038 reg = <0>; 900 compatible = "renesas,scif-r8a7791",
1039 #phy-cells = <1>; 901 "renesas,rcar-gen2-scif", "renesas,scif";
902 reg = <0 0xe6ea8000 0 64>;
903 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
904 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
905 <&scif_clk>;
906 clock-names = "fck", "brg_int", "scif_clk";
907 dmas = <&dmac0 0x2f>, <&dmac0 0x30>,
908 <&dmac1 0x2f>, <&dmac1 0x30>;
909 dma-names = "tx", "rx", "tx", "rx";
910 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
911 resets = <&cpg 718>;
912 status = "disabled";
1040 }; 913 };
1041 usb2: usb-channel@2 { 914
1042 reg = <2>; 915 scif4: serial@e6ee0000 {
1043 #phy-cells = <1>; 916 compatible = "renesas,scif-r8a7791",
917 "renesas,rcar-gen2-scif", "renesas,scif";
918 reg = <0 0xe6ee0000 0 64>;
919 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
920 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
921 <&scif_clk>;
922 clock-names = "fck", "brg_int", "scif_clk";
923 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>,
924 <&dmac1 0xfb>, <&dmac1 0xfc>;
925 dma-names = "tx", "rx", "tx", "rx";
926 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
927 resets = <&cpg 715>;
928 status = "disabled";
1044 }; 929 };
1045 };
1046 930
1047 vin0: video@e6ef0000 { 931 scif5: serial@e6ee8000 {
1048 compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; 932 compatible = "renesas,scif-r8a7791",
1049 reg = <0 0xe6ef0000 0 0x1000>; 933 "renesas,rcar-gen2-scif", "renesas,scif";
1050 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 934 reg = <0 0xe6ee8000 0 64>;
1051 clocks = <&cpg CPG_MOD 811>; 935 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
1052 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 936 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1053 resets = <&cpg 811>; 937 <&scif_clk>;
1054 status = "disabled"; 938 clock-names = "fck", "brg_int", "scif_clk";
1055 }; 939 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>,
940 <&dmac1 0xfd>, <&dmac1 0xfe>;
941 dma-names = "tx", "rx", "tx", "rx";
942 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
943 resets = <&cpg 714>;
944 status = "disabled";
945 };
1056 946
1057 vin1: video@e6ef1000 { 947 hscif0: serial@e62c0000 {
1058 compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; 948 compatible = "renesas,hscif-r8a7791",
1059 reg = <0 0xe6ef1000 0 0x1000>; 949 "renesas,rcar-gen2-hscif", "renesas,hscif";
1060 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 950 reg = <0 0xe62c0000 0 96>;
1061 clocks = <&cpg CPG_MOD 810>; 951 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
1062 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 952 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1063 resets = <&cpg 810>; 953 <&scif_clk>;
1064 status = "disabled"; 954 clock-names = "fck", "brg_int", "scif_clk";
1065 }; 955 dmas = <&dmac0 0x39>, <&dmac0 0x3a>,
956 <&dmac1 0x39>, <&dmac1 0x3a>;
957 dma-names = "tx", "rx", "tx", "rx";
958 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
959 resets = <&cpg 717>;
960 status = "disabled";
961 };
1066 962
1067 vin2: video@e6ef2000 { 963 hscif1: serial@e62c8000 {
1068 compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; 964 compatible = "renesas,hscif-r8a7791",
1069 reg = <0 0xe6ef2000 0 0x1000>; 965 "renesas,rcar-gen2-hscif", "renesas,hscif";
1070 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>; 966 reg = <0 0xe62c8000 0 96>;
1071 clocks = <&cpg CPG_MOD 809>; 967 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
1072 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 968 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1073 resets = <&cpg 809>; 969 <&scif_clk>;
1074 status = "disabled"; 970 clock-names = "fck", "brg_int", "scif_clk";
1075 }; 971 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>,
972 <&dmac1 0x4d>, <&dmac1 0x4e>;
973 dma-names = "tx", "rx", "tx", "rx";
974 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
975 resets = <&cpg 716>;
976 status = "disabled";
977 };
1076 978
1077 vsp@fe928000 { 979 hscif2: serial@e62d0000 {
1078 compatible = "renesas,vsp1"; 980 compatible = "renesas,hscif-r8a7791",
1079 reg = <0 0xfe928000 0 0x8000>; 981 "renesas,rcar-gen2-hscif", "renesas,hscif";
1080 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>; 982 reg = <0 0xe62d0000 0 96>;
1081 clocks = <&cpg CPG_MOD 131>; 983 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
1082 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 984 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7791_CLK_ZS>,
1083 resets = <&cpg 131>; 985 <&scif_clk>;
1084 }; 986 clock-names = "fck", "brg_int", "scif_clk";
987 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>,
988 <&dmac1 0x3b>, <&dmac1 0x3c>;
989 dma-names = "tx", "rx", "tx", "rx";
990 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
991 resets = <&cpg 713>;
992 status = "disabled";
993 };
1085 994
1086 vsp@fe930000 { 995 msiof0: spi@e6e20000 {
1087 compatible = "renesas,vsp1"; 996 compatible = "renesas,msiof-r8a7791",
1088 reg = <0 0xfe930000 0 0x8000>; 997 "renesas,rcar-gen2-msiof";
1089 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>; 998 reg = <0 0xe6e20000 0 0x0064>;
1090 clocks = <&cpg CPG_MOD 128>; 999 interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
1091 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1000 clocks = <&cpg CPG_MOD 000>;
1092 resets = <&cpg 128>; 1001 dmas = <&dmac0 0x51>, <&dmac0 0x52>,
1093 }; 1002 <&dmac1 0x51>, <&dmac1 0x52>;
1003 dma-names = "tx", "rx", "tx", "rx";
1004 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1005 resets = <&cpg 0>;
1006 #address-cells = <1>;
1007 #size-cells = <0>;
1008 status = "disabled";
1009 };
1094 1010
1095 vsp@fe938000 { 1011 msiof1: spi@e6e10000 {
1096 compatible = "renesas,vsp1"; 1012 compatible = "renesas,msiof-r8a7791",
1097 reg = <0 0xfe938000 0 0x8000>; 1013 "renesas,rcar-gen2-msiof";
1098 interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>; 1014 reg = <0 0xe6e10000 0 0x0064>;
1099 clocks = <&cpg CPG_MOD 127>; 1015 interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
1100 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1016 clocks = <&cpg CPG_MOD 208>;
1101 resets = <&cpg 127>; 1017 dmas = <&dmac0 0x55>, <&dmac0 0x56>,
1102 }; 1018 <&dmac1 0x55>, <&dmac1 0x56>;
1019 dma-names = "tx", "rx", "tx", "rx";
1020 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1021 resets = <&cpg 208>;
1022 #address-cells = <1>;
1023 #size-cells = <0>;
1024 status = "disabled";
1025 };
1103 1026
1104 du: display@feb00000 { 1027 msiof2: spi@e6e00000 {
1105 compatible = "renesas,du-r8a7791"; 1028 compatible = "renesas,msiof-r8a7791",
1106 reg = <0 0xfeb00000 0 0x40000>, 1029 "renesas,rcar-gen2-msiof";
1107 <0 0xfeb90000 0 0x1c>; 1030 reg = <0 0xe6e00000 0 0x0064>;
1108 reg-names = "du", "lvds.0"; 1031 interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
1109 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>, 1032 clocks = <&cpg CPG_MOD 205>;
1110 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>; 1033 dmas = <&dmac0 0x41>, <&dmac0 0x42>,
1111 clocks = <&cpg CPG_MOD 724>, 1034 <&dmac1 0x41>, <&dmac1 0x42>;
1112 <&cpg CPG_MOD 723>, 1035 dma-names = "tx", "rx", "tx", "rx";
1113 <&cpg CPG_MOD 726>; 1036 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1114 clock-names = "du.0", "du.1", "lvds.0"; 1037 resets = <&cpg 205>;
1115 status = "disabled";
1116
1117 ports {
1118 #address-cells = <1>; 1038 #address-cells = <1>;
1119 #size-cells = <0>; 1039 #size-cells = <0>;
1040 status = "disabled";
1041 };
1120 1042
1121 port@0 { 1043 adc: adc@e6e54000 {
1122 reg = <0>; 1044 compatible = "renesas,r8a7791-gyroadc",
1123 du_out_rgb: endpoint { 1045 "renesas,rcar-gyroadc";
1124 }; 1046 reg = <0 0xe6e54000 0 64>;
1125 }; 1047 clocks = <&cpg CPG_MOD 901>;
1126 port@1 { 1048 clock-names = "fck";
1127 reg = <1>; 1049 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1128 du_out_lvds0: endpoint { 1050 resets = <&cpg 901>;
1129 }; 1051 status = "disabled";
1130 };
1131 }; 1052 };
1132 };
1133 1053
1134 can0: can@e6e80000 { 1054 can0: can@e6e80000 {
1135 compatible = "renesas,can-r8a7791", "renesas,rcar-gen2-can"; 1055 compatible = "renesas,can-r8a7791",
1136 reg = <0 0xe6e80000 0 0x1000>; 1056 "renesas,rcar-gen2-can";
1137 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>; 1057 reg = <0 0xe6e80000 0 0x1000>;
1138 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7791_CLK_RCAN>, 1058 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
1139 <&can_clk>; 1059 clocks = <&cpg CPG_MOD 916>,
1140 clock-names = "clkp1", "clkp2", "can_clk"; 1060 <&cpg CPG_CORE R8A7791_CLK_RCAN>, <&can_clk>;
1141 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1061 clock-names = "clkp1", "clkp2", "can_clk";
1142 resets = <&cpg 916>; 1062 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1143 status = "disabled"; 1063 resets = <&cpg 916>;
1144 }; 1064 status = "disabled";
1065 };
1145 1066
1146 can1: can@e6e88000 { 1067 can1: can@e6e88000 {
1147 compatible = "renesas,can-r8a7791", "renesas,rcar-gen2-can"; 1068 compatible = "renesas,can-r8a7791",
1148 reg = <0 0xe6e88000 0 0x1000>; 1069 "renesas,rcar-gen2-can";
1149 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; 1070 reg = <0 0xe6e88000 0 0x1000>;
1150 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7791_CLK_RCAN>, 1071 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
1151 <&can_clk>; 1072 clocks = <&cpg CPG_MOD 915>,
1152 clock-names = "clkp1", "clkp2", "can_clk"; 1073 <&cpg CPG_CORE R8A7791_CLK_RCAN>, <&can_clk>;
1153 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1074 clock-names = "clkp1", "clkp2", "can_clk";
1154 resets = <&cpg 915>; 1075 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1155 status = "disabled"; 1076 resets = <&cpg 915>;
1156 }; 1077 status = "disabled";
1078 };
1157 1079
1158 jpu: jpeg-codec@fe980000 { 1080 vin0: video@e6ef0000 {
1159 compatible = "renesas,jpu-r8a7791", "renesas,rcar-gen2-jpu"; 1081 compatible = "renesas,vin-r8a7791",
1160 reg = <0 0xfe980000 0 0x10300>; 1082 "renesas,rcar-gen2-vin";
1161 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; 1083 reg = <0 0xe6ef0000 0 0x1000>;
1162 clocks = <&cpg CPG_MOD 106>; 1084 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
1163 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1085 clocks = <&cpg CPG_MOD 811>;
1164 resets = <&cpg 106>; 1086 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1165 }; 1087 resets = <&cpg 811>;
1088 status = "disabled";
1089 };
1166 1090
1167 /* External root clock */ 1091 vin1: video@e6ef1000 {
1168 extal_clk: extal { 1092 compatible = "renesas,vin-r8a7791",
1169 compatible = "fixed-clock"; 1093 "renesas,rcar-gen2-vin";
1170 #clock-cells = <0>; 1094 reg = <0 0xe6ef1000 0 0x1000>;
1171 /* This value must be overridden by the board. */ 1095 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
1172 clock-frequency = <0>; 1096 clocks = <&cpg CPG_MOD 810>;
1173 }; 1097 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1098 resets = <&cpg 810>;
1099 status = "disabled";
1100 };
1174 1101
1175 /* 1102 vin2: video@e6ef2000 {
1176 * The external audio clocks are configured as 0 Hz fixed frequency 1103 compatible = "renesas,vin-r8a7791",
1177 * clocks by default. 1104 "renesas,rcar-gen2-vin";
1178 * Boards that provide audio clocks should override them. 1105 reg = <0 0xe6ef2000 0 0x1000>;
1179 */ 1106 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
1180 audio_clk_a: audio_clk_a { 1107 clocks = <&cpg CPG_MOD 809>;
1181 compatible = "fixed-clock"; 1108 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1182 #clock-cells = <0>; 1109 resets = <&cpg 809>;
1183 clock-frequency = <0>; 1110 status = "disabled";
1184 }; 1111 };
1185 audio_clk_b: audio_clk_b {
1186 compatible = "fixed-clock";
1187 #clock-cells = <0>;
1188 clock-frequency = <0>;
1189 };
1190 audio_clk_c: audio_clk_c {
1191 compatible = "fixed-clock";
1192 #clock-cells = <0>;
1193 clock-frequency = <0>;
1194 };
1195 1112
1196 /* External PCIe clock - can be overridden by the board */ 1113 rcar_sound: sound@ec500000 {
1197 pcie_bus_clk: pcie_bus { 1114 /*
1198 compatible = "fixed-clock"; 1115 * #sound-dai-cells is required
1199 #clock-cells = <0>; 1116 *
1200 clock-frequency = <0>; 1117 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
1201 }; 1118 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
1119 */
1120 compatible = "renesas,rcar_sound-r8a7791",
1121 "renesas,rcar_sound-gen2";
1122 reg = <0 0xec500000 0 0x1000>, /* SCU */
1123 <0 0xec5a0000 0 0x100>, /* ADG */
1124 <0 0xec540000 0 0x1000>, /* SSIU */
1125 <0 0xec541000 0 0x280>, /* SSI */
1126 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
1127 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
1128
1129 clocks = <&cpg CPG_MOD 1005>,
1130 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
1131 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
1132 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
1133 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
1134 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
1135 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
1136 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
1137 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
1138 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
1139 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
1140 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1141 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1142 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1143 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
1144 <&cpg CPG_CORE R8A7791_CLK_M2>;
1145 clock-names = "ssi-all",
1146 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
1147 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
1148 "ssi.1", "ssi.0", "src.9", "src.8",
1149 "src.7", "src.6", "src.5", "src.4",
1150 "src.3", "src.2", "src.1", "src.0",
1151 "ctu.0", "ctu.1",
1152 "mix.0", "mix.1",
1153 "dvc.0", "dvc.1",
1154 "clk_a", "clk_b", "clk_c", "clk_i";
1155 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1156 resets = <&cpg 1005>,
1157 <&cpg 1006>, <&cpg 1007>,
1158 <&cpg 1008>, <&cpg 1009>,
1159 <&cpg 1010>, <&cpg 1011>,
1160 <&cpg 1012>, <&cpg 1013>,
1161 <&cpg 1014>, <&cpg 1015>;
1162 reset-names = "ssi-all",
1163 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
1164 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
1165 "ssi.1", "ssi.0";
1166
1167 status = "disabled";
1168
1169 rcar_sound,dvc {
1170 dvc0: dvc-0 {
1171 dmas = <&audma1 0xbc>;
1172 dma-names = "tx";
1173 };
1174 dvc1: dvc-1 {
1175 dmas = <&audma1 0xbe>;
1176 dma-names = "tx";
1177 };
1178 };
1202 1179
1203 /* External SCIF clock */ 1180 rcar_sound,mix {
1204 scif_clk: scif { 1181 mix0: mix-0 { };
1205 compatible = "fixed-clock"; 1182 mix1: mix-1 { };
1206 #clock-cells = <0>; 1183 };
1207 /* This value must be overridden by the board. */
1208 clock-frequency = <0>;
1209 };
1210 1184
1211 /* External USB clock - can be overridden by the board */ 1185 rcar_sound,ctu {
1212 usb_extal_clk: usb_extal { 1186 ctu00: ctu-0 { };
1213 compatible = "fixed-clock"; 1187 ctu01: ctu-1 { };
1214 #clock-cells = <0>; 1188 ctu02: ctu-2 { };
1215 clock-frequency = <48000000>; 1189 ctu03: ctu-3 { };
1216 }; 1190 ctu10: ctu-4 { };
1191 ctu11: ctu-5 { };
1192 ctu12: ctu-6 { };
1193 ctu13: ctu-7 { };
1194 };
1217 1195
1218 /* External CAN clock */ 1196 rcar_sound,src {
1219 can_clk: can { 1197 src0: src-0 {
1220 compatible = "fixed-clock"; 1198 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
1221 #clock-cells = <0>; 1199 dmas = <&audma0 0x85>, <&audma1 0x9a>;
1222 /* This value must be overridden by the board. */ 1200 dma-names = "rx", "tx";
1223 clock-frequency = <0>; 1201 };
1224 }; 1202 src1: src-1 {
1203 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
1204 dmas = <&audma0 0x87>, <&audma1 0x9c>;
1205 dma-names = "rx", "tx";
1206 };
1207 src2: src-2 {
1208 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
1209 dmas = <&audma0 0x89>, <&audma1 0x9e>;
1210 dma-names = "rx", "tx";
1211 };
1212 src3: src-3 {
1213 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
1214 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
1215 dma-names = "rx", "tx";
1216 };
1217 src4: src-4 {
1218 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1219 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
1220 dma-names = "rx", "tx";
1221 };
1222 src5: src-5 {
1223 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1224 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
1225 dma-names = "rx", "tx";
1226 };
1227 src6: src-6 {
1228 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1229 dmas = <&audma0 0x91>, <&audma1 0xb4>;
1230 dma-names = "rx", "tx";
1231 };
1232 src7: src-7 {
1233 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1234 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1235 dma-names = "rx", "tx";
1236 };
1237 src8: src-8 {
1238 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1239 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1240 dma-names = "rx", "tx";
1241 };
1242 src9: src-9 {
1243 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1244 dmas = <&audma0 0x97>, <&audma1 0xba>;
1245 dma-names = "rx", "tx";
1246 };
1247 };
1225 1248
1226 cpg: clock-controller@e6150000 { 1249 rcar_sound,ssi {
1227 compatible = "renesas,r8a7791-cpg-mssr"; 1250 ssi0: ssi-0 {
1228 reg = <0 0xe6150000 0 0x1000>; 1251 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
1229 clocks = <&extal_clk>, <&usb_extal_clk>; 1252 dmas = <&audma0 0x01>, <&audma1 0x02>,
1230 clock-names = "extal", "usb_extal"; 1253 <&audma0 0x15>, <&audma1 0x16>;
1231 #clock-cells = <2>; 1254 dma-names = "rx", "tx", "rxu", "txu";
1232 #power-domain-cells = <0>; 1255 };
1233 #reset-cells = <1>; 1256 ssi1: ssi-1 {
1234 }; 1257 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1258 dmas = <&audma0 0x03>, <&audma1 0x04>,
1259 <&audma0 0x49>, <&audma1 0x4a>;
1260 dma-names = "rx", "tx", "rxu", "txu";
1261 };
1262 ssi2: ssi-2 {
1263 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1264 dmas = <&audma0 0x05>, <&audma1 0x06>,
1265 <&audma0 0x63>, <&audma1 0x64>;
1266 dma-names = "rx", "tx", "rxu", "txu";
1267 };
1268 ssi3: ssi-3 {
1269 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1270 dmas = <&audma0 0x07>, <&audma1 0x08>,
1271 <&audma0 0x6f>, <&audma1 0x70>;
1272 dma-names = "rx", "tx", "rxu", "txu";
1273 };
1274 ssi4: ssi-4 {
1275 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1276 dmas = <&audma0 0x09>, <&audma1 0x0a>,
1277 <&audma0 0x71>, <&audma1 0x72>;
1278 dma-names = "rx", "tx", "rxu", "txu";
1279 };
1280 ssi5: ssi-5 {
1281 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1282 dmas = <&audma0 0x0b>, <&audma1 0x0c>,
1283 <&audma0 0x73>, <&audma1 0x74>;
1284 dma-names = "rx", "tx", "rxu", "txu";
1285 };
1286 ssi6: ssi-6 {
1287 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1288 dmas = <&audma0 0x0d>, <&audma1 0x0e>,
1289 <&audma0 0x75>, <&audma1 0x76>;
1290 dma-names = "rx", "tx", "rxu", "txu";
1291 };
1292 ssi7: ssi-7 {
1293 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1294 dmas = <&audma0 0x0f>, <&audma1 0x10>,
1295 <&audma0 0x79>, <&audma1 0x7a>;
1296 dma-names = "rx", "tx", "rxu", "txu";
1297 };
1298 ssi8: ssi-8 {
1299 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1300 dmas = <&audma0 0x11>, <&audma1 0x12>,
1301 <&audma0 0x7b>, <&audma1 0x7c>;
1302 dma-names = "rx", "tx", "rxu", "txu";
1303 };
1304 ssi9: ssi-9 {
1305 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1306 dmas = <&audma0 0x13>, <&audma1 0x14>,
1307 <&audma0 0x7d>, <&audma1 0x7e>;
1308 dma-names = "rx", "tx", "rxu", "txu";
1309 };
1310 };
1311 };
1235 1312
1236 rst: reset-controller@e6160000 { 1313 audma0: dma-controller@ec700000 {
1237 compatible = "renesas,r8a7791-rst"; 1314 compatible = "renesas,dmac-r8a7791",
1238 reg = <0 0xe6160000 0 0x0100>; 1315 "renesas,rcar-dmac";
1239 }; 1316 reg = <0 0xec700000 0 0x10000>;
1317 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1318 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1319 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1320 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1321 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1322 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1323 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1324 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1325 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1326 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1327 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1328 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1329 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1330 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1331 interrupt-names = "error",
1332 "ch0", "ch1", "ch2", "ch3",
1333 "ch4", "ch5", "ch6", "ch7",
1334 "ch8", "ch9", "ch10", "ch11",
1335 "ch12";
1336 clocks = <&cpg CPG_MOD 502>;
1337 clock-names = "fck";
1338 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1339 resets = <&cpg 502>;
1340 #dma-cells = <1>;
1341 dma-channels = <13>;
1342 };
1240 1343
1241 prr: chipid@ff000044 { 1344 audma1: dma-controller@ec720000 {
1242 compatible = "renesas,prr"; 1345 compatible = "renesas,dmac-r8a7791",
1243 reg = <0 0xff000044 0 4>; 1346 "renesas,rcar-dmac";
1244 }; 1347 reg = <0 0xec720000 0 0x10000>;
1348 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH
1349 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
1350 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
1351 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
1352 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
1353 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
1354 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
1355 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
1356 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
1357 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
1358 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
1359 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
1360 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
1361 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
1362 interrupt-names = "error",
1363 "ch0", "ch1", "ch2", "ch3",
1364 "ch4", "ch5", "ch6", "ch7",
1365 "ch8", "ch9", "ch10", "ch11",
1366 "ch12";
1367 clocks = <&cpg CPG_MOD 501>;
1368 clock-names = "fck";
1369 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1370 resets = <&cpg 501>;
1371 #dma-cells = <1>;
1372 dma-channels = <13>;
1373 };
1245 1374
1246 sysc: system-controller@e6180000 { 1375 xhci: usb@ee000000 {
1247 compatible = "renesas,r8a7791-sysc"; 1376 compatible = "renesas,xhci-r8a7791",
1248 reg = <0 0xe6180000 0 0x0200>; 1377 "renesas,rcar-gen2-xhci";
1249 #power-domain-cells = <1>; 1378 reg = <0 0xee000000 0 0xc00>;
1250 }; 1379 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
1380 clocks = <&cpg CPG_MOD 328>;
1381 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1382 resets = <&cpg 328>;
1383 phys = <&usb2 1>;
1384 phy-names = "usb";
1385 status = "disabled";
1386 };
1251 1387
1252 qspi: spi@e6b10000 { 1388 pci0: pci@ee090000 {
1253 compatible = "renesas,qspi-r8a7791", "renesas,qspi"; 1389 compatible = "renesas,pci-r8a7791",
1254 reg = <0 0xe6b10000 0 0x2c>; 1390 "renesas,pci-rcar-gen2";
1255 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 1391 device_type = "pci";
1256 clocks = <&cpg CPG_MOD 917>; 1392 reg = <0 0xee090000 0 0xc00>,
1257 dmas = <&dmac0 0x17>, <&dmac0 0x18>, 1393 <0 0xee080000 0 0x1100>;
1258 <&dmac1 0x17>, <&dmac1 0x18>; 1394 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1259 dma-names = "tx", "rx", "tx", "rx"; 1395 clocks = <&cpg CPG_MOD 703>;
1260 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1396 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1261 resets = <&cpg 917>; 1397 resets = <&cpg 703>;
1262 num-cs = <1>; 1398 status = "disabled";
1263 #address-cells = <1>; 1399
1264 #size-cells = <0>; 1400 bus-range = <0 0>;
1265 status = "disabled"; 1401 #address-cells = <3>;
1266 }; 1402 #size-cells = <2>;
1403 #interrupt-cells = <1>;
1404 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1405 interrupt-map-mask = <0xff00 0 0 0x7>;
1406 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1407 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1408 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1409
1410 usb@1,0 {
1411 reg = <0x800 0 0 0 0>;
1412 phys = <&usb0 0>;
1413 phy-names = "usb";
1414 };
1267 1415
1268 msiof0: spi@e6e20000 { 1416 usb@2,0 {
1269 compatible = "renesas,msiof-r8a7791", 1417 reg = <0x1000 0 0 0 0>;
1270 "renesas,rcar-gen2-msiof"; 1418 phys = <&usb0 0>;
1271 reg = <0 0xe6e20000 0 0x0064>; 1419 phy-names = "usb";
1272 interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>; 1420 };
1273 clocks = <&cpg CPG_MOD 000>; 1421 };
1274 dmas = <&dmac0 0x51>, <&dmac0 0x52>,
1275 <&dmac1 0x51>, <&dmac1 0x52>;
1276 dma-names = "tx", "rx", "tx", "rx";
1277 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1278 resets = <&cpg 0>;
1279 #address-cells = <1>;
1280 #size-cells = <0>;
1281 status = "disabled";
1282 };
1283 1422
1284 msiof1: spi@e6e10000 { 1423 pci1: pci@ee0d0000 {
1285 compatible = "renesas,msiof-r8a7791", 1424 compatible = "renesas,pci-r8a7791",
1286 "renesas,rcar-gen2-msiof"; 1425 "renesas,pci-rcar-gen2";
1287 reg = <0 0xe6e10000 0 0x0064>; 1426 device_type = "pci";
1288 interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>; 1427 reg = <0 0xee0d0000 0 0xc00>,
1289 clocks = <&cpg CPG_MOD 208>; 1428 <0 0xee0c0000 0 0x1100>;
1290 dmas = <&dmac0 0x55>, <&dmac0 0x56>, 1429 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1291 <&dmac1 0x55>, <&dmac1 0x56>; 1430 clocks = <&cpg CPG_MOD 703>;
1292 dma-names = "tx", "rx", "tx", "rx"; 1431 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1293 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1432 resets = <&cpg 703>;
1294 resets = <&cpg 208>; 1433 status = "disabled";
1295 #address-cells = <1>; 1434
1296 #size-cells = <0>; 1435 bus-range = <1 1>;
1297 status = "disabled"; 1436 #address-cells = <3>;
1298 }; 1437 #size-cells = <2>;
1438 #interrupt-cells = <1>;
1439 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1440 interrupt-map-mask = <0xff00 0 0 0x7>;
1441 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1442 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1443 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1444
1445 usb@1,0 {
1446 reg = <0x10800 0 0 0 0>;
1447 phys = <&usb2 0>;
1448 phy-names = "usb";
1449 };
1299 1450
1300 msiof2: spi@e6e00000 { 1451 usb@2,0 {
1301 compatible = "renesas,msiof-r8a7791", 1452 reg = <0x11000 0 0 0 0>;
1302 "renesas,rcar-gen2-msiof"; 1453 phys = <&usb2 0>;
1303 reg = <0 0xe6e00000 0 0x0064>; 1454 phy-names = "usb";
1304 interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>; 1455 };
1305 clocks = <&cpg CPG_MOD 205>; 1456 };
1306 dmas = <&dmac0 0x41>, <&dmac0 0x42>,
1307 <&dmac1 0x41>, <&dmac1 0x42>;
1308 dma-names = "tx", "rx", "tx", "rx";
1309 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1310 resets = <&cpg 205>;
1311 #address-cells = <1>;
1312 #size-cells = <0>;
1313 status = "disabled";
1314 };
1315 1457
1316 xhci: usb@ee000000 { 1458 sdhi0: sd@ee100000 {
1317 compatible = "renesas,xhci-r8a7791", "renesas,rcar-gen2-xhci"; 1459 compatible = "renesas,sdhi-r8a7791",
1318 reg = <0 0xee000000 0 0xc00>; 1460 "renesas,rcar-gen2-sdhi";
1319 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; 1461 reg = <0 0xee100000 0 0x328>;
1320 clocks = <&cpg CPG_MOD 328>; 1462 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1321 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1463 clocks = <&cpg CPG_MOD 314>;
1322 resets = <&cpg 328>; 1464 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1323 phys = <&usb2 1>; 1465 <&dmac1 0xcd>, <&dmac1 0xce>;
1324 phy-names = "usb"; 1466 dma-names = "tx", "rx", "tx", "rx";
1325 status = "disabled"; 1467 max-frequency = <195000000>;
1326 }; 1468 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1469 resets = <&cpg 314>;
1470 status = "disabled";
1471 };
1327 1472
1328 pci0: pci@ee090000 { 1473 sdhi1: sd@ee140000 {
1329 compatible = "renesas,pci-r8a7791", "renesas,pci-rcar-gen2"; 1474 compatible = "renesas,sdhi-r8a7791",
1330 device_type = "pci"; 1475 "renesas,rcar-gen2-sdhi";
1331 reg = <0 0xee090000 0 0xc00>, 1476 reg = <0 0xee140000 0 0x100>;
1332 <0 0xee080000 0 0x1100>; 1477 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1333 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; 1478 clocks = <&cpg CPG_MOD 312>;
1334 clocks = <&cpg CPG_MOD 703>; 1479 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1335 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1480 <&dmac1 0xc1>, <&dmac1 0xc2>;
1336 resets = <&cpg 703>; 1481 dma-names = "tx", "rx", "tx", "rx";
1337 status = "disabled"; 1482 max-frequency = <97500000>;
1338 1483 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1339 bus-range = <0 0>; 1484 resets = <&cpg 312>;
1340 #address-cells = <3>; 1485 status = "disabled";
1341 #size-cells = <2>;
1342 #interrupt-cells = <1>;
1343 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1344 interrupt-map-mask = <0xff00 0 0 0x7>;
1345 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1346 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1347 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1348
1349 usb@1,0 {
1350 reg = <0x800 0 0 0 0>;
1351 phys = <&usb0 0>;
1352 phy-names = "usb";
1353 }; 1486 };
1354 1487
1355 usb@2,0 { 1488 sdhi2: sd@ee160000 {
1356 reg = <0x1000 0 0 0 0>; 1489 compatible = "renesas,sdhi-r8a7791",
1357 phys = <&usb0 0>; 1490 "renesas,rcar-gen2-sdhi";
1358 phy-names = "usb"; 1491 reg = <0 0xee160000 0 0x100>;
1492 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1493 clocks = <&cpg CPG_MOD 311>;
1494 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1495 <&dmac1 0xd3>, <&dmac1 0xd4>;
1496 dma-names = "tx", "rx", "tx", "rx";
1497 max-frequency = <97500000>;
1498 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1499 resets = <&cpg 311>;
1500 status = "disabled";
1359 }; 1501 };
1360 };
1361 1502
1362 pci1: pci@ee0d0000 { 1503 mmcif0: mmc@ee200000 {
1363 compatible = "renesas,pci-r8a7791", "renesas,pci-rcar-gen2"; 1504 compatible = "renesas,mmcif-r8a7791",
1364 device_type = "pci"; 1505 "renesas,sh-mmcif";
1365 reg = <0 0xee0d0000 0 0xc00>, 1506 reg = <0 0xee200000 0 0x80>;
1366 <0 0xee0c0000 0 0x1100>; 1507 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1367 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 1508 clocks = <&cpg CPG_MOD 315>;
1368 clocks = <&cpg CPG_MOD 703>; 1509 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1369 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 1510 <&dmac1 0xd1>, <&dmac1 0xd2>;
1370 resets = <&cpg 703>; 1511 dma-names = "tx", "rx", "tx", "rx";
1371 status = "disabled"; 1512 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1372 1513 resets = <&cpg 315>;
1373 bus-range = <1 1>; 1514 reg-io-width = <4>;
1374 #address-cells = <3>; 1515 status = "disabled";
1375 #size-cells = <2>; 1516 max-frequency = <97500000>;
1376 #interrupt-cells = <1>;
1377 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1378 interrupt-map-mask = <0xff00 0 0 0x7>;
1379 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1380 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1381 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1382
1383 usb@1,0 {
1384 reg = <0x10800 0 0 0 0>;
1385 phys = <&usb2 0>;
1386 phy-names = "usb";
1387 }; 1517 };
1388 1518
1389 usb@2,0 { 1519 sata0: sata@ee300000 {
1390 reg = <0x11000 0 0 0 0>; 1520 compatible = "renesas,sata-r8a7791",
1391 phys = <&usb2 0>; 1521 "renesas,rcar-gen2-sata";
1392 phy-names = "usb"; 1522 reg = <0 0xee300000 0 0x2000>;
1523 interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
1524 clocks = <&cpg CPG_MOD 815>;
1525 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1526 resets = <&cpg 815>;
1527 status = "disabled";
1393 }; 1528 };
1394 };
1395 1529
1396 pciec: pcie@fe000000 { 1530 sata1: sata@ee500000 {
1397 compatible = "renesas,pcie-r8a7791", "renesas,pcie-rcar-gen2"; 1531 compatible = "renesas,sata-r8a7791",
1398 reg = <0 0xfe000000 0 0x80000>; 1532 "renesas,rcar-gen2-sata";
1399 #address-cells = <3>; 1533 reg = <0 0xee500000 0 0x2000>;
1400 #size-cells = <2>; 1534 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
1401 bus-range = <0x00 0xff>; 1535 clocks = <&cpg CPG_MOD 814>;
1402 device_type = "pci"; 1536 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1403 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000 1537 resets = <&cpg 814>;
1404 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000 1538 status = "disabled";
1405 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000 1539 };
1406 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1407 /* Map all possible DDR as inbound ranges */
1408 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1409 0x43000000 2 0x00000000 2 0x00000000 1 0x00000000>;
1410 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1411 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1412 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1413 #interrupt-cells = <1>;
1414 interrupt-map-mask = <0 0 0 0>;
1415 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1416 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1417 clock-names = "pcie", "pcie_bus";
1418 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1419 resets = <&cpg 319>;
1420 status = "disabled";
1421 };
1422 1540
1423 ipmmu_sy0: mmu@e6280000 { 1541 ether: ethernet@ee700000 {
1424 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1542 compatible = "renesas,ether-r8a7791",
1425 reg = <0 0xe6280000 0 0x1000>; 1543 "renesas,rcar-gen2-ether";
1426 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>, 1544 reg = <0 0xee700000 0 0x400>;
1427 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 1545 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1428 #iommu-cells = <1>; 1546 clocks = <&cpg CPG_MOD 813>;
1429 status = "disabled"; 1547 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1430 }; 1548 resets = <&cpg 813>;
1549 phy-mode = "rmii";
1550 #address-cells = <1>;
1551 #size-cells = <0>;
1552 status = "disabled";
1553 };
1431 1554
1432 ipmmu_sy1: mmu@e6290000 { 1555 gic: interrupt-controller@f1001000 {
1433 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1556 compatible = "arm,gic-400";
1434 reg = <0 0xe6290000 0 0x1000>; 1557 #interrupt-cells = <3>;
1435 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 1558 #address-cells = <0>;
1436 #iommu-cells = <1>; 1559 interrupt-controller;
1437 status = "disabled"; 1560 reg = <0 0xf1001000 0 0x1000>, <0 0xf1002000 0 0x2000>,
1438 }; 1561 <0 0xf1004000 0 0x2000>, <0 0xf1006000 0 0x2000>;
1562 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
1563 clocks = <&cpg CPG_MOD 408>;
1564 clock-names = "clk";
1565 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1566 resets = <&cpg 408>;
1567 };
1439 1568
1440 ipmmu_ds: mmu@e6740000 { 1569 pciec: pcie@fe000000 {
1441 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1570 compatible = "renesas,pcie-r8a7791",
1442 reg = <0 0xe6740000 0 0x1000>; 1571 "renesas,pcie-rcar-gen2";
1443 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, 1572 reg = <0 0xfe000000 0 0x80000>;
1444 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>; 1573 #address-cells = <3>;
1445 #iommu-cells = <1>; 1574 #size-cells = <2>;
1446 status = "disabled"; 1575 bus-range = <0x00 0xff>;
1447 }; 1576 device_type = "pci";
1577 ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
1578 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
1579 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
1580 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
1581 /* Map all possible DDR as inbound ranges */
1582 dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000
1583 0x43000000 2 0x00000000 2 0x00000000 1 0x00000000>;
1584 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
1585 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
1586 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
1587 #interrupt-cells = <1>;
1588 interrupt-map-mask = <0 0 0 0>;
1589 interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
1590 clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
1591 clock-names = "pcie", "pcie_bus";
1592 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1593 resets = <&cpg 319>;
1594 status = "disabled";
1595 };
1448 1596
1449 ipmmu_mp: mmu@ec680000 { 1597 vsp@fe928000 {
1450 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1598 compatible = "renesas,vsp1";
1451 reg = <0 0xec680000 0 0x1000>; 1599 reg = <0 0xfe928000 0 0x8000>;
1452 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>; 1600 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
1453 #iommu-cells = <1>; 1601 clocks = <&cpg CPG_MOD 131>;
1454 status = "disabled"; 1602 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1455 }; 1603 resets = <&cpg 131>;
1604 };
1456 1605
1457 ipmmu_mx: mmu@fe951000 { 1606 vsp@fe930000 {
1458 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1607 compatible = "renesas,vsp1";
1459 reg = <0 0xfe951000 0 0x1000>; 1608 reg = <0 0xfe930000 0 0x8000>;
1460 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>, 1609 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
1461 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; 1610 clocks = <&cpg CPG_MOD 128>;
1462 #iommu-cells = <1>; 1611 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1463 status = "disabled"; 1612 resets = <&cpg 128>;
1464 }; 1613 };
1465 1614
1466 ipmmu_rt: mmu@ffc80000 { 1615 vsp@fe938000 {
1467 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1616 compatible = "renesas,vsp1";
1468 reg = <0 0xffc80000 0 0x1000>; 1617 reg = <0 0xfe938000 0 0x8000>;
1469 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; 1618 interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
1470 #iommu-cells = <1>; 1619 clocks = <&cpg CPG_MOD 127>;
1471 status = "disabled"; 1620 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1472 }; 1621 resets = <&cpg 127>;
1622 };
1473 1623
1474 ipmmu_gp: mmu@e62a0000 { 1624 jpu: jpeg-codec@fe980000 {
1475 compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; 1625 compatible = "renesas,jpu-r8a7791",
1476 reg = <0 0xe62a0000 0 0x1000>; 1626 "renesas,rcar-gen2-jpu";
1477 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>, 1627 reg = <0 0xfe980000 0 0x10300>;
1478 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>; 1628 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
1479 #iommu-cells = <1>; 1629 clocks = <&cpg CPG_MOD 106>;
1480 status = "disabled"; 1630 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1481 }; 1631 resets = <&cpg 106>;
1632 };
1482 1633
1483 rcar_sound: sound@ec500000 { 1634 du: display@feb00000 {
1484 /* 1635 compatible = "renesas,du-r8a7791";
1485 * #sound-dai-cells is required 1636 reg = <0 0xfeb00000 0 0x40000>,
1486 * 1637 <0 0xfeb90000 0 0x1c>;
1487 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>; 1638 reg-names = "du", "lvds.0";
1488 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>; 1639 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1489 */ 1640 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1490 compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2"; 1641 clocks = <&cpg CPG_MOD 724>,
1491 reg = <0 0xec500000 0 0x1000>, /* SCU */ 1642 <&cpg CPG_MOD 723>,
1492 <0 0xec5a0000 0 0x100>, /* ADG */ 1643 <&cpg CPG_MOD 726>;
1493 <0 0xec540000 0 0x1000>, /* SSIU */ 1644 clock-names = "du.0", "du.1", "lvds.0";
1494 <0 0xec541000 0 0x280>, /* SSI */ 1645 status = "disabled";
1495 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/ 1646
1496 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp"; 1647 ports {
1497 1648 #address-cells = <1>;
1498 clocks = <&cpg CPG_MOD 1005>, 1649 #size-cells = <0>;
1499 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>, 1650
1500 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>, 1651 port@0 {
1501 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>, 1652 reg = <0>;
1502 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>, 1653 du_out_rgb: endpoint {
1503 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>, 1654 };
1504 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>, 1655 };
1505 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>, 1656 port@1 {
1506 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>, 1657 reg = <1>;
1507 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>, 1658 du_out_lvds0: endpoint {
1508 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>, 1659 };
1509 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>, 1660 };
1510 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1511 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1512 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
1513 <&cpg CPG_CORE R8A7791_CLK_M2>;
1514 clock-names = "ssi-all",
1515 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1516 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
1517 "src.9", "src.8", "src.7", "src.6", "src.5",
1518 "src.4", "src.3", "src.2", "src.1", "src.0",
1519 "ctu.0", "ctu.1",
1520 "mix.0", "mix.1",
1521 "dvc.0", "dvc.1",
1522 "clk_a", "clk_b", "clk_c", "clk_i";
1523 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1524 resets = <&cpg 1005>,
1525 <&cpg 1006>, <&cpg 1007>, <&cpg 1008>, <&cpg 1009>,
1526 <&cpg 1010>, <&cpg 1011>, <&cpg 1012>, <&cpg 1013>,
1527 <&cpg 1014>, <&cpg 1015>;
1528 reset-names = "ssi-all",
1529 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1530 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0";
1531
1532 status = "disabled";
1533
1534 rcar_sound,dvc {
1535 dvc0: dvc-0 {
1536 dmas = <&audma1 0xbc>;
1537 dma-names = "tx";
1538 };
1539 dvc1: dvc-1 {
1540 dmas = <&audma1 0xbe>;
1541 dma-names = "tx";
1542 }; 1661 };
1543 }; 1662 };
1544 1663
1545 rcar_sound,mix { 1664 prr: chipid@ff000044 {
1546 mix0: mix-0 { }; 1665 compatible = "renesas,prr";
1547 mix1: mix-1 { }; 1666 reg = <0 0xff000044 0 4>;
1548 }; 1667 };
1549 1668
1550 rcar_sound,ctu { 1669 cmt0: timer@ffca0000 {
1551 ctu00: ctu-0 { }; 1670 compatible = "renesas,r8a7791-cmt0",
1552 ctu01: ctu-1 { }; 1671 "renesas,rcar-gen2-cmt0";
1553 ctu02: ctu-2 { }; 1672 reg = <0 0xffca0000 0 0x1004>;
1554 ctu03: ctu-3 { }; 1673 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1555 ctu10: ctu-4 { }; 1674 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1556 ctu11: ctu-5 { }; 1675 clocks = <&cpg CPG_MOD 124>;
1557 ctu12: ctu-6 { }; 1676 clock-names = "fck";
1558 ctu13: ctu-7 { }; 1677 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1678 resets = <&cpg 124>;
1679
1680 status = "disabled";
1559 }; 1681 };
1560 1682
1561 rcar_sound,src { 1683 cmt1: timer@e6130000 {
1562 src0: src-0 { 1684 compatible = "renesas,r8a7791-cmt1",
1563 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>; 1685 "renesas,rcar-gen2-cmt1";
1564 dmas = <&audma0 0x85>, <&audma1 0x9a>; 1686 reg = <0 0xe6130000 0 0x1004>;
1565 dma-names = "rx", "tx"; 1687 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1566 }; 1688 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1567 src1: src-1 { 1689 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1568 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>; 1690 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1569 dmas = <&audma0 0x87>, <&audma1 0x9c>; 1691 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1570 dma-names = "rx", "tx"; 1692 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1571 }; 1693 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1572 src2: src-2 { 1694 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1573 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>; 1695 clocks = <&cpg CPG_MOD 329>;
1574 dmas = <&audma0 0x89>, <&audma1 0x9e>; 1696 clock-names = "fck";
1575 dma-names = "rx", "tx"; 1697 power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
1576 }; 1698 resets = <&cpg 329>;
1577 src3: src-3 { 1699
1578 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>; 1700 status = "disabled";
1579 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
1580 dma-names = "rx", "tx";
1581 };
1582 src4: src-4 {
1583 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1584 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
1585 dma-names = "rx", "tx";
1586 };
1587 src5: src-5 {
1588 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1589 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
1590 dma-names = "rx", "tx";
1591 };
1592 src6: src-6 {
1593 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1594 dmas = <&audma0 0x91>, <&audma1 0xb4>;
1595 dma-names = "rx", "tx";
1596 };
1597 src7: src-7 {
1598 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1599 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1600 dma-names = "rx", "tx";
1601 };
1602 src8: src-8 {
1603 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1604 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1605 dma-names = "rx", "tx";
1606 };
1607 src9: src-9 {
1608 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1609 dmas = <&audma0 0x97>, <&audma1 0xba>;
1610 dma-names = "rx", "tx";
1611 };
1612 }; 1701 };
1702 };
1613 1703
1614 rcar_sound,ssi { 1704 thermal-zones {
1615 ssi0: ssi-0 { 1705 cpu_thermal: cpu-thermal {
1616 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>; 1706 polling-delay-passive = <0>;
1617 dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; 1707 polling-delay = <0>;
1618 dma-names = "rx", "tx", "rxu", "txu"; 1708
1619 }; 1709 thermal-sensors = <&thermal>;
1620 ssi1: ssi-1 { 1710
1621 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>; 1711 trips {
1622 dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>; 1712 cpu-crit {
1623 dma-names = "rx", "tx", "rxu", "txu"; 1713 temperature = <95000>;
1624 }; 1714 hysteresis = <0>;
1625 ssi2: ssi-2 { 1715 type = "critical";
1626 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>; 1716 };
1627 dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
1628 dma-names = "rx", "tx", "rxu", "txu";
1629 };
1630 ssi3: ssi-3 {
1631 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1632 dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
1633 dma-names = "rx", "tx", "rxu", "txu";
1634 };
1635 ssi4: ssi-4 {
1636 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1637 dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
1638 dma-names = "rx", "tx", "rxu", "txu";
1639 };
1640 ssi5: ssi-5 {
1641 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1642 dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
1643 dma-names = "rx", "tx", "rxu", "txu";
1644 };
1645 ssi6: ssi-6 {
1646 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1647 dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
1648 dma-names = "rx", "tx", "rxu", "txu";
1649 };
1650 ssi7: ssi-7 {
1651 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1652 dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
1653 dma-names = "rx", "tx", "rxu", "txu";
1654 };
1655 ssi8: ssi-8 {
1656 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1657 dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
1658 dma-names = "rx", "tx", "rxu", "txu";
1659 }; 1717 };
1660 ssi9: ssi-9 { 1718 cooling-maps {
1661 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1662 dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
1663 dma-names = "rx", "tx", "rxu", "txu";
1664 }; 1719 };
1665 }; 1720 };
1666 }; 1721 };
1722
1723 timer {
1724 compatible = "arm,armv7-timer";
1725 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1726 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1727 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1728 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
1729 };
1730
1731 /* External USB clock - can be overridden by the board */
1732 usb_extal_clk: usb_extal {
1733 compatible = "fixed-clock";
1734 #clock-cells = <0>;
1735 clock-frequency = <48000000>;
1736 };
1667}; 1737};
diff --git a/arch/arm/boot/dts/r8a7792.dtsi b/arch/arm/boot/dts/r8a7792.dtsi
index 3be15a158bad..268987ff0201 100644
--- a/arch/arm/boot/dts/r8a7792.dtsi
+++ b/arch/arm/boot/dts/r8a7792.dtsi
@@ -101,63 +101,6 @@
101 #size-cells = <2>; 101 #size-cells = <2>;
102 ranges; 102 ranges;
103 103
104 apmu@e6152000 {
105 compatible = "renesas,r8a7792-apmu", "renesas,apmu";
106 reg = <0 0xe6152000 0 0x188>;
107 cpus = <&cpu0 &cpu1>;
108 };
109
110 gic: interrupt-controller@f1001000 {
111 compatible = "arm,gic-400";
112 #interrupt-cells = <3>;
113 interrupt-controller;
114 reg = <0 0xf1001000 0 0x1000>,
115 <0 0xf1002000 0 0x2000>,
116 <0 0xf1004000 0 0x2000>,
117 <0 0xf1006000 0 0x2000>;
118 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
119 IRQ_TYPE_LEVEL_HIGH)>;
120 clocks = <&cpg CPG_MOD 408>;
121 clock-names = "clk";
122 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
123 resets = <&cpg 408>;
124 };
125
126 irqc: interrupt-controller@e61c0000 {
127 compatible = "renesas,irqc-r8a7792", "renesas,irqc";
128 #interrupt-cells = <2>;
129 interrupt-controller;
130 reg = <0 0xe61c0000 0 0x200>;
131 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
132 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
133 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
134 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
135 clocks = <&cpg CPG_MOD 407>;
136 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
137 resets = <&cpg 407>;
138 };
139
140 rst: reset-controller@e6160000 {
141 compatible = "renesas,r8a7792-rst";
142 reg = <0 0xe6160000 0 0x0100>;
143 };
144
145 prr: chipid@ff000044 {
146 compatible = "renesas,prr";
147 reg = <0 0xff000044 0 4>;
148 };
149
150 sysc: system-controller@e6180000 {
151 compatible = "renesas,r8a7792-sysc";
152 reg = <0 0xe6180000 0 0x0200>;
153 #power-domain-cells = <1>;
154 };
155
156 pfc: pin-controller@e6060000 {
157 compatible = "renesas,pfc-r8a7792";
158 reg = <0 0xe6060000 0 0x144>;
159 };
160
161 gpio0: gpio@e6050000 { 104 gpio0: gpio@e6050000 {
162 compatible = "renesas,gpio-r8a7792", 105 compatible = "renesas,gpio-r8a7792",
163 "renesas,rcar-gen2-gpio"; 106 "renesas,rcar-gen2-gpio";
@@ -338,6 +281,155 @@
338 resets = <&cpg 913>; 281 resets = <&cpg 913>;
339 }; 282 };
340 283
284 pfc: pin-controller@e6060000 {
285 compatible = "renesas,pfc-r8a7792";
286 reg = <0 0xe6060000 0 0x144>;
287 };
288
289 cpg: clock-controller@e6150000 {
290 compatible = "renesas,r8a7792-cpg-mssr";
291 reg = <0 0xe6150000 0 0x1000>;
292 clocks = <&extal_clk>;
293 clock-names = "extal";
294 #clock-cells = <2>;
295 #power-domain-cells = <0>;
296 #reset-cells = <1>;
297 };
298
299 apmu@e6152000 {
300 compatible = "renesas,r8a7792-apmu", "renesas,apmu";
301 reg = <0 0xe6152000 0 0x188>;
302 cpus = <&cpu0 &cpu1>;
303 };
304
305 rst: reset-controller@e6160000 {
306 compatible = "renesas,r8a7792-rst";
307 reg = <0 0xe6160000 0 0x0100>;
308 };
309
310 sysc: system-controller@e6180000 {
311 compatible = "renesas,r8a7792-sysc";
312 reg = <0 0xe6180000 0 0x0200>;
313 #power-domain-cells = <1>;
314 };
315
316 irqc: interrupt-controller@e61c0000 {
317 compatible = "renesas,irqc-r8a7792", "renesas,irqc";
318 #interrupt-cells = <2>;
319 interrupt-controller;
320 reg = <0 0xe61c0000 0 0x200>;
321 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
322 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
323 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
324 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
325 clocks = <&cpg CPG_MOD 407>;
326 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
327 resets = <&cpg 407>;
328 };
329
330 icram0: sram@e63a0000 {
331 compatible = "mmio-sram";
332 reg = <0 0xe63a0000 0 0x12000>;
333 };
334
335 icram1: sram@e63c0000 {
336 compatible = "mmio-sram";
337 reg = <0 0xe63c0000 0 0x1000>;
338 #address-cells = <1>;
339 #size-cells = <1>;
340 ranges = <0 0 0xe63c0000 0x1000>;
341
342 smp-sram@0 {
343 compatible = "renesas,smp-sram";
344 reg = <0 0x10>;
345 };
346 };
347
348 /* I2C doesn't need pinmux */
349 i2c0: i2c@e6508000 {
350 compatible = "renesas,i2c-r8a7792",
351 "renesas,rcar-gen2-i2c";
352 reg = <0 0xe6508000 0 0x40>;
353 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
354 clocks = <&cpg CPG_MOD 931>;
355 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
356 resets = <&cpg 931>;
357 i2c-scl-internal-delay-ns = <6>;
358 #address-cells = <1>;
359 #size-cells = <0>;
360 status = "disabled";
361 };
362
363 i2c1: i2c@e6518000 {
364 compatible = "renesas,i2c-r8a7792",
365 "renesas,rcar-gen2-i2c";
366 reg = <0 0xe6518000 0 0x40>;
367 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
368 clocks = <&cpg CPG_MOD 930>;
369 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
370 resets = <&cpg 930>;
371 i2c-scl-internal-delay-ns = <6>;
372 #address-cells = <1>;
373 #size-cells = <0>;
374 status = "disabled";
375 };
376
377 i2c2: i2c@e6530000 {
378 compatible = "renesas,i2c-r8a7792",
379 "renesas,rcar-gen2-i2c";
380 reg = <0 0xe6530000 0 0x40>;
381 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
382 clocks = <&cpg CPG_MOD 929>;
383 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
384 resets = <&cpg 929>;
385 i2c-scl-internal-delay-ns = <6>;
386 #address-cells = <1>;
387 #size-cells = <0>;
388 status = "disabled";
389 };
390
391 i2c3: i2c@e6540000 {
392 compatible = "renesas,i2c-r8a7792",
393 "renesas,rcar-gen2-i2c";
394 reg = <0 0xe6540000 0 0x40>;
395 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
396 clocks = <&cpg CPG_MOD 928>;
397 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
398 resets = <&cpg 928>;
399 i2c-scl-internal-delay-ns = <6>;
400 #address-cells = <1>;
401 #size-cells = <0>;
402 status = "disabled";
403 };
404
405 i2c4: i2c@e6520000 {
406 compatible = "renesas,i2c-r8a7792",
407 "renesas,rcar-gen2-i2c";
408 reg = <0 0xe6520000 0 0x40>;
409 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
410 clocks = <&cpg CPG_MOD 927>;
411 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
412 resets = <&cpg 927>;
413 i2c-scl-internal-delay-ns = <6>;
414 #address-cells = <1>;
415 #size-cells = <0>;
416 status = "disabled";
417 };
418
419 i2c5: i2c@e6528000 {
420 compatible = "renesas,i2c-r8a7792",
421 "renesas,rcar-gen2-i2c";
422 reg = <0 0xe6528000 0 0x40>;
423 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
424 clocks = <&cpg CPG_MOD 925>;
425 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
426 resets = <&cpg 925>;
427 i2c-scl-internal-delay-ns = <110>;
428 #address-cells = <1>;
429 #size-cells = <0>;
430 status = "disabled";
431 };
432
341 dmac0: dma-controller@e6700000 { 433 dmac0: dma-controller@e6700000 {
342 compatible = "renesas,dmac-r8a7792", 434 compatible = "renesas,dmac-r8a7792",
343 "renesas,rcar-dmac"; 435 "renesas,rcar-dmac";
@@ -404,6 +496,35 @@
404 dma-channels = <15>; 496 dma-channels = <15>;
405 }; 497 };
406 498
499 avb: ethernet@e6800000 {
500 compatible = "renesas,etheravb-r8a7792",
501 "renesas,etheravb-rcar-gen2";
502 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
503 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
504 clocks = <&cpg CPG_MOD 812>;
505 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
506 resets = <&cpg 812>;
507 #address-cells = <1>;
508 #size-cells = <0>;
509 status = "disabled";
510 };
511
512 qspi: spi@e6b10000 {
513 compatible = "renesas,qspi-r8a7792", "renesas,qspi";
514 reg = <0 0xe6b10000 0 0x2c>;
515 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
516 clocks = <&cpg CPG_MOD 917>;
517 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
518 <&dmac1 0x17>, <&dmac1 0x18>;
519 dma-names = "tx", "rx", "tx", "rx";
520 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
521 resets = <&cpg 917>;
522 num-cs = <1>;
523 #address-cells = <1>;
524 #size-cells = <0>;
525 status = "disabled";
526 };
527
407 scif0: serial@e6e60000 { 528 scif0: serial@e6e60000 {
408 compatible = "renesas,scif-r8a7792", 529 compatible = "renesas,scif-r8a7792",
409 "renesas,rcar-gen2-scif", "renesas,scif"; 530 "renesas,rcar-gen2-scif", "renesas,scif";
@@ -500,162 +621,6 @@
500 status = "disabled"; 621 status = "disabled";
501 }; 622 };
502 623
503 icram0: sram@e63a0000 {
504 compatible = "mmio-sram";
505 reg = <0 0xe63a0000 0 0x12000>;
506 };
507
508 icram1: sram@e63c0000 {
509 compatible = "mmio-sram";
510 reg = <0 0xe63c0000 0 0x1000>;
511 #address-cells = <1>;
512 #size-cells = <1>;
513 ranges = <0 0 0xe63c0000 0x1000>;
514
515 smp-sram@0 {
516 compatible = "renesas,smp-sram";
517 reg = <0 0x10>;
518 };
519 };
520
521 sdhi0: sd@ee100000 {
522 compatible = "renesas,sdhi-r8a7792",
523 "renesas,rcar-gen2-sdhi";
524 reg = <0 0xee100000 0 0x328>;
525 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
526 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
527 <&dmac1 0xcd>, <&dmac1 0xce>;
528 dma-names = "tx", "rx", "tx", "rx";
529 clocks = <&cpg CPG_MOD 314>;
530 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
531 resets = <&cpg 314>;
532 status = "disabled";
533 };
534
535 jpu: jpeg-codec@fe980000 {
536 compatible = "renesas,jpu-r8a7792",
537 "renesas,rcar-gen2-jpu";
538 reg = <0 0xfe980000 0 0x10300>;
539 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
540 clocks = <&cpg CPG_MOD 106>;
541 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
542 resets = <&cpg 106>;
543 };
544
545 avb: ethernet@e6800000 {
546 compatible = "renesas,etheravb-r8a7792",
547 "renesas,etheravb-rcar-gen2";
548 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
549 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
550 clocks = <&cpg CPG_MOD 812>;
551 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
552 resets = <&cpg 812>;
553 #address-cells = <1>;
554 #size-cells = <0>;
555 status = "disabled";
556 };
557
558 /* I2C doesn't need pinmux */
559 i2c0: i2c@e6508000 {
560 compatible = "renesas,i2c-r8a7792",
561 "renesas,rcar-gen2-i2c";
562 reg = <0 0xe6508000 0 0x40>;
563 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
564 clocks = <&cpg CPG_MOD 931>;
565 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
566 resets = <&cpg 931>;
567 i2c-scl-internal-delay-ns = <6>;
568 #address-cells = <1>;
569 #size-cells = <0>;
570 status = "disabled";
571 };
572
573 i2c1: i2c@e6518000 {
574 compatible = "renesas,i2c-r8a7792",
575 "renesas,rcar-gen2-i2c";
576 reg = <0 0xe6518000 0 0x40>;
577 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
578 clocks = <&cpg CPG_MOD 930>;
579 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
580 resets = <&cpg 930>;
581 i2c-scl-internal-delay-ns = <6>;
582 #address-cells = <1>;
583 #size-cells = <0>;
584 status = "disabled";
585 };
586
587 i2c2: i2c@e6530000 {
588 compatible = "renesas,i2c-r8a7792",
589 "renesas,rcar-gen2-i2c";
590 reg = <0 0xe6530000 0 0x40>;
591 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
592 clocks = <&cpg CPG_MOD 929>;
593 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
594 resets = <&cpg 929>;
595 i2c-scl-internal-delay-ns = <6>;
596 #address-cells = <1>;
597 #size-cells = <0>;
598 status = "disabled";
599 };
600
601 i2c3: i2c@e6540000 {
602 compatible = "renesas,i2c-r8a7792",
603 "renesas,rcar-gen2-i2c";
604 reg = <0 0xe6540000 0 0x40>;
605 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
606 clocks = <&cpg CPG_MOD 928>;
607 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
608 resets = <&cpg 928>;
609 i2c-scl-internal-delay-ns = <6>;
610 #address-cells = <1>;
611 #size-cells = <0>;
612 status = "disabled";
613 };
614
615 i2c4: i2c@e6520000 {
616 compatible = "renesas,i2c-r8a7792",
617 "renesas,rcar-gen2-i2c";
618 reg = <0 0xe6520000 0 0x40>;
619 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
620 clocks = <&cpg CPG_MOD 927>;
621 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
622 resets = <&cpg 927>;
623 i2c-scl-internal-delay-ns = <6>;
624 #address-cells = <1>;
625 #size-cells = <0>;
626 status = "disabled";
627 };
628
629 i2c5: i2c@e6528000 {
630 compatible = "renesas,i2c-r8a7792",
631 "renesas,rcar-gen2-i2c";
632 reg = <0 0xe6528000 0 0x40>;
633 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
634 clocks = <&cpg CPG_MOD 925>;
635 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
636 resets = <&cpg 925>;
637 i2c-scl-internal-delay-ns = <110>;
638 #address-cells = <1>;
639 #size-cells = <0>;
640 status = "disabled";
641 };
642
643 qspi: spi@e6b10000 {
644 compatible = "renesas,qspi-r8a7792", "renesas,qspi";
645 reg = <0 0xe6b10000 0 0x2c>;
646 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
647 clocks = <&cpg CPG_MOD 917>;
648 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
649 <&dmac1 0x17>, <&dmac1 0x18>;
650 dma-names = "tx", "rx", "tx", "rx";
651 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
652 resets = <&cpg 917>;
653 num-cs = <1>;
654 #address-cells = <1>;
655 #size-cells = <0>;
656 status = "disabled";
657 };
658
659 msiof0: spi@e6e20000 { 624 msiof0: spi@e6e20000 {
660 compatible = "renesas,msiof-r8a7792", 625 compatible = "renesas,msiof-r8a7792",
661 "renesas,rcar-gen2-msiof"; 626 "renesas,rcar-gen2-msiof";
@@ -688,34 +653,6 @@
688 status = "disabled"; 653 status = "disabled";
689 }; 654 };
690 655
691 du: display@feb00000 {
692 compatible = "renesas,du-r8a7792";
693 reg = <0 0xfeb00000 0 0x40000>;
694 reg-names = "du";
695 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
696 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
697 clocks = <&cpg CPG_MOD 724>,
698 <&cpg CPG_MOD 723>;
699 clock-names = "du.0", "du.1";
700 status = "disabled";
701
702 ports {
703 #address-cells = <1>;
704 #size-cells = <0>;
705
706 port@0 {
707 reg = <0>;
708 du_out_rgb0: endpoint {
709 };
710 };
711 port@1 {
712 reg = <1>;
713 du_out_rgb1: endpoint {
714 };
715 };
716 };
717 };
718
719 can0: can@e6e80000 { 656 can0: can@e6e80000 {
720 compatible = "renesas,can-r8a7792", 657 compatible = "renesas,can-r8a7792",
721 "renesas,rcar-gen2-can"; 658 "renesas,rcar-gen2-can";
@@ -808,6 +745,36 @@
808 status = "disabled"; 745 status = "disabled";
809 }; 746 };
810 747
748 sdhi0: sd@ee100000 {
749 compatible = "renesas,sdhi-r8a7792",
750 "renesas,rcar-gen2-sdhi";
751 reg = <0 0xee100000 0 0x328>;
752 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
753 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
754 <&dmac1 0xcd>, <&dmac1 0xce>;
755 dma-names = "tx", "rx", "tx", "rx";
756 clocks = <&cpg CPG_MOD 314>;
757 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
758 resets = <&cpg 314>;
759 status = "disabled";
760 };
761
762 gic: interrupt-controller@f1001000 {
763 compatible = "arm,gic-400";
764 #interrupt-cells = <3>;
765 interrupt-controller;
766 reg = <0 0xf1001000 0 0x1000>,
767 <0 0xf1002000 0 0x2000>,
768 <0 0xf1004000 0 0x2000>,
769 <0 0xf1006000 0 0x2000>;
770 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
771 IRQ_TYPE_LEVEL_HIGH)>;
772 clocks = <&cpg CPG_MOD 408>;
773 clock-names = "clk";
774 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
775 resets = <&cpg 408>;
776 };
777
811 vsp@fe928000 { 778 vsp@fe928000 {
812 compatible = "renesas,vsp1"; 779 compatible = "renesas,vsp1";
813 reg = <0 0xfe928000 0 0x8000>; 780 reg = <0 0xfe928000 0 0x8000>;
@@ -835,14 +802,47 @@
835 resets = <&cpg 127>; 802 resets = <&cpg 127>;
836 }; 803 };
837 804
838 cpg: clock-controller@e6150000 { 805 jpu: jpeg-codec@fe980000 {
839 compatible = "renesas,r8a7792-cpg-mssr"; 806 compatible = "renesas,jpu-r8a7792",
840 reg = <0 0xe6150000 0 0x1000>; 807 "renesas,rcar-gen2-jpu";
841 clocks = <&extal_clk>; 808 reg = <0 0xfe980000 0 0x10300>;
842 clock-names = "extal"; 809 interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
843 #clock-cells = <2>; 810 clocks = <&cpg CPG_MOD 106>;
844 #power-domain-cells = <0>; 811 power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
845 #reset-cells = <1>; 812 resets = <&cpg 106>;
813 };
814
815 du: display@feb00000 {
816 compatible = "renesas,du-r8a7792";
817 reg = <0 0xfeb00000 0 0x40000>;
818 reg-names = "du";
819 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
820 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
821 clocks = <&cpg CPG_MOD 724>,
822 <&cpg CPG_MOD 723>;
823 clock-names = "du.0", "du.1";
824 status = "disabled";
825
826 ports {
827 #address-cells = <1>;
828 #size-cells = <0>;
829
830 port@0 {
831 reg = <0>;
832 du_out_rgb0: endpoint {
833 };
834 };
835 port@1 {
836 reg = <1>;
837 du_out_rgb1: endpoint {
838 };
839 };
840 };
841 };
842
843 prr: chipid@ff000044 {
844 compatible = "renesas,prr";
845 reg = <0 0xff000044 0 4>;
846 }; 846 };
847 }; 847 };
848 848
diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
index 51b3ffac8efa..9ed6961f2d9a 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -48,6 +48,10 @@
48 aliases { 48 aliases {
49 serial0 = &scif0; 49 serial0 = &scif0;
50 serial1 = &scif1; 50 serial1 = &scif1;
51 i2c9 = &gpioi2c2;
52 i2c10 = &gpioi2c4;
53 i2c11 = &i2chdmi;
54 i2c12 = &i2cexio4;
51 }; 55 };
52 56
53 chosen { 57 chosen {
@@ -296,6 +300,146 @@
296 #clock-cells = <0>; 300 #clock-cells = <0>;
297 clock-frequency = <148500000>; 301 clock-frequency = <148500000>;
298 }; 302 };
303
304 gpioi2c2: i2c-9 {
305 #address-cells = <1>;
306 #size-cells = <0>;
307 compatible = "i2c-gpio";
308 status = "disabled";
309 scl-gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
310 sda-gpios = <&gpio2 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
311 i2c-gpio,delay-us = <5>;
312 };
313
314 gpioi2c4: i2c-10 {
315 #address-cells = <1>;
316 #size-cells = <0>;
317 compatible = "i2c-gpio";
318 status = "disabled";
319 scl-gpios = <&gpio7 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
320 sda-gpios = <&gpio7 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
321 i2c-gpio,delay-us = <5>;
322 };
323
324 /*
325 * A fallback to GPIO is provided for I2C2.
326 */
327 i2chdmi: i2c-11 {
328 compatible = "i2c-demux-pinctrl";
329 i2c-parent = <&i2c2>, <&gpioi2c2>;
330 i2c-bus-name = "i2c-hdmi";
331 #address-cells = <1>;
332 #size-cells = <0>;
333
334 ak4643: codec@12 {
335 compatible = "asahi-kasei,ak4643";
336 #sound-dai-cells = <0>;
337 reg = <0x12>;
338 };
339
340 composite-in@20 {
341 compatible = "adi,adv7180cp";
342 reg = <0x20>;
343 remote = <&vin1>;
344
345 port {
346 #address-cells = <1>;
347 #size-cells = <0>;
348
349 port@0 {
350 reg = <0>;
351 adv7180_in: endpoint {
352 remote-endpoint = <&composite_con_in>;
353 };
354 };
355
356 port@3 {
357 reg = <3>;
358 adv7180_out: endpoint {
359 bus-width = <8>;
360 remote-endpoint = <&vin1ep>;
361 };
362 };
363 };
364 };
365
366 hdmi@39 {
367 compatible = "adi,adv7511w";
368 reg = <0x39>;
369 interrupt-parent = <&gpio3>;
370 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
371
372 adi,input-depth = <8>;
373 adi,input-colorspace = "rgb";
374 adi,input-clock = "1x";
375 adi,input-style = <1>;
376 adi,input-justification = "evenly";
377
378 ports {
379 #address-cells = <1>;
380 #size-cells = <0>;
381
382 port@0 {
383 reg = <0>;
384 adv7511_in: endpoint {
385 remote-endpoint = <&du_out_rgb>;
386 };
387 };
388
389 port@1 {
390 reg = <1>;
391 adv7511_out: endpoint {
392 remote-endpoint = <&hdmi_con_out>;
393 };
394 };
395 };
396 };
397
398 hdmi-in@4c {
399 compatible = "adi,adv7612";
400 reg = <0x4c>;
401 interrupt-parent = <&gpio4>;
402 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
403 default-input = <0>;
404
405 port {
406 #address-cells = <1>;
407 #size-cells = <0>;
408
409 port@0 {
410 reg = <0>;
411 adv7612_in: endpoint {
412 remote-endpoint = <&hdmi_con_in>;
413 };
414 };
415
416 port@2 {
417 reg = <2>;
418 adv7612_out: endpoint {
419 remote-endpoint = <&vin0ep2>;
420 };
421 };
422 };
423 };
424
425 eeprom@50 {
426 compatible = "renesas,r1ex24002", "atmel,24c02";
427 reg = <0x50>;
428 pagesize = <16>;
429 };
430 };
431
432 /*
433 * I2C4 is routed to EXIO connector E, pins 37 (SCL) + 39 (SDA).
434 * A fallback to GPIO is provided.
435 */
436 i2cexio4: i2c-12 {
437 compatible = "i2c-demux-pinctrl";
438 i2c-parent = <&i2c4>, <&gpioi2c4>;
439 i2c-bus-name = "i2c-exio4";
440 #address-cells = <1>;
441 #size-cells = <0>;
442 };
299}; 443};
300 444
301&du { 445&du {
@@ -334,6 +478,11 @@
334 function = "i2c2"; 478 function = "i2c2";
335 }; 479 };
336 480
481 i2c4_pins: i2c4 {
482 groups = "i2c4_c";
483 function = "i2c4";
484 };
485
337 du_pins: du { 486 du_pins: du {
338 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0"; 487 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
339 function = "du"; 488 function = "du";
@@ -544,107 +693,11 @@
544 693
545&i2c2 { 694&i2c2 {
546 pinctrl-0 = <&i2c2_pins>; 695 pinctrl-0 = <&i2c2_pins>;
547 pinctrl-names = "default"; 696 pinctrl-names = "i2c-hdmi";
548 697
549 status = "okay"; 698 status = "okay";
550 clock-frequency = <100000>; 699 clock-frequency = <100000>;
551 700
552 ak4643: codec@12 {
553 compatible = "asahi-kasei,ak4643";
554 #sound-dai-cells = <0>;
555 reg = <0x12>;
556 };
557
558 composite-in@20 {
559 compatible = "adi,adv7180cp";
560 reg = <0x20>;
561 remote = <&vin1>;
562
563 port {
564 #address-cells = <1>;
565 #size-cells = <0>;
566
567 port@0 {
568 reg = <0>;
569 adv7180_in: endpoint {
570 remote-endpoint = <&composite_con_in>;
571 };
572 };
573
574 port@3 {
575 reg = <3>;
576 adv7180_out: endpoint {
577 bus-width = <8>;
578 remote-endpoint = <&vin1ep>;
579 };
580 };
581 };
582 };
583
584 hdmi@39 {
585 compatible = "adi,adv7511w";
586 reg = <0x39>;
587 interrupt-parent = <&gpio3>;
588 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
589
590 adi,input-depth = <8>;
591 adi,input-colorspace = "rgb";
592 adi,input-clock = "1x";
593 adi,input-style = <1>;
594 adi,input-justification = "evenly";
595
596 ports {
597 #address-cells = <1>;
598 #size-cells = <0>;
599
600 port@0 {
601 reg = <0>;
602 adv7511_in: endpoint {
603 remote-endpoint = <&du_out_rgb>;
604 };
605 };
606
607 port@1 {
608 reg = <1>;
609 adv7511_out: endpoint {
610 remote-endpoint = <&hdmi_con_out>;
611 };
612 };
613 };
614 };
615
616 hdmi-in@4c {
617 compatible = "adi,adv7612";
618 reg = <0x4c>;
619 interrupt-parent = <&gpio4>;
620 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
621 default-input = <0>;
622
623 port {
624 #address-cells = <1>;
625 #size-cells = <0>;
626
627 port@0 {
628 reg = <0>;
629 adv7612_in: endpoint {
630 remote-endpoint = <&hdmi_con_in>;
631 };
632 };
633
634 port@2 {
635 reg = <2>;
636 adv7612_out: endpoint {
637 remote-endpoint = <&vin0ep2>;
638 };
639 };
640 };
641 };
642
643 eeprom@50 {
644 compatible = "renesas,r1ex24002", "atmel,24c02";
645 reg = <0x50>;
646 pagesize = <16>;
647 };
648}; 701};
649 702
650&i2c6 { 703&i2c6 {
@@ -668,6 +721,11 @@
668 }; 721 };
669}; 722};
670 723
724&i2c4 {
725 pinctrl-0 = <&i2c4_pins>;
726 pinctrl-names = "i2c-exio4";
727};
728
671&rcar_sound { 729&rcar_sound {
672 pinctrl-0 = <&sound_pins &sound_clk_pins>; 730 pinctrl-0 = <&sound_pins &sound_clk_pins>;
673 pinctrl-names = "default"; 731 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 039b22517526..f9c5a557107d 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -15,7 +15,6 @@
15 15
16/ { 16/ {
17 compatible = "renesas,r8a7793"; 17 compatible = "renesas,r8a7793";
18 interrupt-parent = <&gic>;
19 #address-cells = <2>; 18 #address-cells = <2>;
20 #size-cells = <2>; 19 #size-cells = <2>;
21 20
@@ -32,6 +31,35 @@
32 spi0 = &qspi; 31 spi0 = &qspi;
33 }; 32 };
34 33
34 /*
35 * The external audio clocks are configured as 0 Hz fixed frequency
36 * clocks by default.
37 * Boards that provide audio clocks should override them.
38 */
39 audio_clk_a: audio_clk_a {
40 compatible = "fixed-clock";
41 #clock-cells = <0>;
42 clock-frequency = <0>;
43 };
44 audio_clk_b: audio_clk_b {
45 compatible = "fixed-clock";
46 #clock-cells = <0>;
47 clock-frequency = <0>;
48 };
49 audio_clk_c: audio_clk_c {
50 compatible = "fixed-clock";
51 #clock-cells = <0>;
52 clock-frequency = <0>;
53 };
54
55 /* External CAN clock */
56 can_clk: can {
57 compatible = "fixed-clock";
58 #clock-cells = <0>;
59 /* This value must be overridden by the board. */
60 clock-frequency = <0>;
61 };
62
35 cpus { 63 cpus {
36 #address-cells = <1>; 64 #address-cells = <1>;
37 #size-cells = <0>; 65 #size-cells = <0>;
@@ -74,1261 +102,1295 @@
74 }; 102 };
75 }; 103 };
76 104
77 apmu@e6152000 { 105 /* External root clock */
78 compatible = "renesas,r8a7793-apmu", "renesas,apmu"; 106 extal_clk: extal {
79 reg = <0 0xe6152000 0 0x188>; 107 compatible = "fixed-clock";
80 cpus = <&cpu0 &cpu1>; 108 #clock-cells = <0>;
109 /* This value must be overridden by the board. */
110 clock-frequency = <0>;
81 }; 111 };
82 112
83 thermal-zones { 113 /* External SCIF clock */
84 cpu_thermal: cpu-thermal { 114 scif_clk: scif {
85 polling-delay-passive = <0>; 115 compatible = "fixed-clock";
86 polling-delay = <0>; 116 #clock-cells = <0>;
117 /* This value must be overridden by the board. */
118 clock-frequency = <0>;
119 };
87 120
88 thermal-sensors = <&thermal>; 121 soc {
122 compatible = "simple-bus";
123 interrupt-parent = <&gic>;
124
125 #address-cells = <2>;
126 #size-cells = <2>;
127 ranges;
128
129 gpio0: gpio@e6050000 {
130 compatible = "renesas,gpio-r8a7793",
131 "renesas,rcar-gen2-gpio";
132 reg = <0 0xe6050000 0 0x50>;
133 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
134 #gpio-cells = <2>;
135 gpio-controller;
136 gpio-ranges = <&pfc 0 0 32>;
137 #interrupt-cells = <2>;
138 interrupt-controller;
139 clocks = <&cpg CPG_MOD 912>;
140 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
141 resets = <&cpg 912>;
142 };
89 143
90 trips { 144 gpio1: gpio@e6051000 {
91 cpu-crit { 145 compatible = "renesas,gpio-r8a7793",
92 temperature = <95000>; 146 "renesas,rcar-gen2-gpio";
93 hysteresis = <0>; 147 reg = <0 0xe6051000 0 0x50>;
94 type = "critical"; 148 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
95 }; 149 #gpio-cells = <2>;
96 }; 150 gpio-controller;
97 cooling-maps { 151 gpio-ranges = <&pfc 0 32 26>;
98 }; 152 #interrupt-cells = <2>;
153 interrupt-controller;
154 clocks = <&cpg CPG_MOD 911>;
155 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
156 resets = <&cpg 911>;
99 }; 157 };
100 };
101 158
102 gic: interrupt-controller@f1001000 { 159 gpio2: gpio@e6052000 {
103 compatible = "arm,gic-400"; 160 compatible = "renesas,gpio-r8a7793",
104 #interrupt-cells = <3>; 161 "renesas,rcar-gen2-gpio";
105 #address-cells = <0>; 162 reg = <0 0xe6052000 0 0x50>;
106 interrupt-controller; 163 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
107 reg = <0 0xf1001000 0 0x1000>, 164 #gpio-cells = <2>;
108 <0 0xf1002000 0 0x2000>, 165 gpio-controller;
109 <0 0xf1004000 0 0x2000>, 166 gpio-ranges = <&pfc 0 64 32>;
110 <0 0xf1006000 0 0x2000>; 167 #interrupt-cells = <2>;
111 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>; 168 interrupt-controller;
112 clocks = <&cpg CPG_MOD 408>; 169 clocks = <&cpg CPG_MOD 910>;
113 clock-names = "clk"; 170 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
114 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 171 resets = <&cpg 910>;
115 resets = <&cpg 408>; 172 };
116 };
117 173
118 gpio0: gpio@e6050000 { 174 gpio3: gpio@e6053000 {
119 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 175 compatible = "renesas,gpio-r8a7793",
120 reg = <0 0xe6050000 0 0x50>; 176 "renesas,rcar-gen2-gpio";
121 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; 177 reg = <0 0xe6053000 0 0x50>;
122 #gpio-cells = <2>; 178 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
123 gpio-controller; 179 #gpio-cells = <2>;
124 gpio-ranges = <&pfc 0 0 32>; 180 gpio-controller;
125 #interrupt-cells = <2>; 181 gpio-ranges = <&pfc 0 96 32>;
126 interrupt-controller; 182 #interrupt-cells = <2>;
127 clocks = <&cpg CPG_MOD 912>; 183 interrupt-controller;
128 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 184 clocks = <&cpg CPG_MOD 909>;
129 resets = <&cpg 912>; 185 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
130 }; 186 resets = <&cpg 909>;
187 };
131 188
132 gpio1: gpio@e6051000 { 189 gpio4: gpio@e6054000 {
133 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 190 compatible = "renesas,gpio-r8a7793",
134 reg = <0 0xe6051000 0 0x50>; 191 "renesas,rcar-gen2-gpio";
135 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; 192 reg = <0 0xe6054000 0 0x50>;
136 #gpio-cells = <2>; 193 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
137 gpio-controller; 194 #gpio-cells = <2>;
138 gpio-ranges = <&pfc 0 32 26>; 195 gpio-controller;
139 #interrupt-cells = <2>; 196 gpio-ranges = <&pfc 0 128 32>;
140 interrupt-controller; 197 #interrupt-cells = <2>;
141 clocks = <&cpg CPG_MOD 911>; 198 interrupt-controller;
142 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 199 clocks = <&cpg CPG_MOD 908>;
143 resets = <&cpg 911>; 200 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
144 }; 201 resets = <&cpg 908>;
202 };
145 203
146 gpio2: gpio@e6052000 { 204 gpio5: gpio@e6055000 {
147 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 205 compatible = "renesas,gpio-r8a7793",
148 reg = <0 0xe6052000 0 0x50>; 206 "renesas,rcar-gen2-gpio";
149 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; 207 reg = <0 0xe6055000 0 0x50>;
150 #gpio-cells = <2>; 208 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
151 gpio-controller; 209 #gpio-cells = <2>;
152 gpio-ranges = <&pfc 0 64 32>; 210 gpio-controller;
153 #interrupt-cells = <2>; 211 gpio-ranges = <&pfc 0 160 32>;
154 interrupt-controller; 212 #interrupt-cells = <2>;
155 clocks = <&cpg CPG_MOD 910>; 213 interrupt-controller;
156 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 214 clocks = <&cpg CPG_MOD 907>;
157 resets = <&cpg 910>; 215 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
158 }; 216 resets = <&cpg 907>;
217 };
159 218
160 gpio3: gpio@e6053000 { 219 gpio6: gpio@e6055400 {
161 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 220 compatible = "renesas,gpio-r8a7793",
162 reg = <0 0xe6053000 0 0x50>; 221 "renesas,rcar-gen2-gpio";
163 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 222 reg = <0 0xe6055400 0 0x50>;
164 #gpio-cells = <2>; 223 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
165 gpio-controller; 224 #gpio-cells = <2>;
166 gpio-ranges = <&pfc 0 96 32>; 225 gpio-controller;
167 #interrupt-cells = <2>; 226 gpio-ranges = <&pfc 0 192 32>;
168 interrupt-controller; 227 #interrupt-cells = <2>;
169 clocks = <&cpg CPG_MOD 909>; 228 interrupt-controller;
170 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 229 clocks = <&cpg CPG_MOD 905>;
171 resets = <&cpg 909>; 230 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
172 }; 231 resets = <&cpg 905>;
232 };
173 233
174 gpio4: gpio@e6054000 { 234 gpio7: gpio@e6055800 {
175 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 235 compatible = "renesas,gpio-r8a7793",
176 reg = <0 0xe6054000 0 0x50>; 236 "renesas,rcar-gen2-gpio";
177 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; 237 reg = <0 0xe6055800 0 0x50>;
178 #gpio-cells = <2>; 238 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
179 gpio-controller; 239 #gpio-cells = <2>;
180 gpio-ranges = <&pfc 0 128 32>; 240 gpio-controller;
181 #interrupt-cells = <2>; 241 gpio-ranges = <&pfc 0 224 26>;
182 interrupt-controller; 242 #interrupt-cells = <2>;
183 clocks = <&cpg CPG_MOD 908>; 243 interrupt-controller;
184 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 244 clocks = <&cpg CPG_MOD 904>;
185 resets = <&cpg 908>; 245 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
186 }; 246 resets = <&cpg 904>;
247 };
187 248
188 gpio5: gpio@e6055000 { 249 pfc: pin-controller@e6060000 {
189 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 250 compatible = "renesas,pfc-r8a7793";
190 reg = <0 0xe6055000 0 0x50>; 251 reg = <0 0xe6060000 0 0x250>;
191 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; 252 };
192 #gpio-cells = <2>;
193 gpio-controller;
194 gpio-ranges = <&pfc 0 160 32>;
195 #interrupt-cells = <2>;
196 interrupt-controller;
197 clocks = <&cpg CPG_MOD 907>;
198 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
199 resets = <&cpg 907>;
200 };
201 253
202 gpio6: gpio@e6055400 { 254 /* Special CPG clocks */
203 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 255 cpg: clock-controller@e6150000 {
204 reg = <0 0xe6055400 0 0x50>; 256 compatible = "renesas,r8a7793-cpg-mssr";
205 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 257 reg = <0 0xe6150000 0 0x1000>;
206 #gpio-cells = <2>; 258 clocks = <&extal_clk>, <&usb_extal_clk>;
207 gpio-controller; 259 clock-names = "extal", "usb_extal";
208 gpio-ranges = <&pfc 0 192 32>; 260 #clock-cells = <2>;
209 #interrupt-cells = <2>; 261 #power-domain-cells = <0>;
210 interrupt-controller; 262 #reset-cells = <1>;
211 clocks = <&cpg CPG_MOD 905>; 263 };
212 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
213 resets = <&cpg 905>;
214 };
215 264
216 gpio7: gpio@e6055800 { 265 apmu@e6152000 {
217 compatible = "renesas,gpio-r8a7793", "renesas,rcar-gen2-gpio"; 266 compatible = "renesas,r8a7793-apmu", "renesas,apmu";
218 reg = <0 0xe6055800 0 0x50>; 267 reg = <0 0xe6152000 0 0x188>;
219 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; 268 cpus = <&cpu0 &cpu1>;
220 #gpio-cells = <2>; 269 };
221 gpio-controller;
222 gpio-ranges = <&pfc 0 224 26>;
223 #interrupt-cells = <2>;
224 interrupt-controller;
225 clocks = <&cpg CPG_MOD 904>;
226 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
227 resets = <&cpg 904>;
228 };
229 270
230 thermal: thermal@e61f0000 { 271 rst: reset-controller@e6160000 {
231 compatible = "renesas,thermal-r8a7793", 272 compatible = "renesas,r8a7793-rst";
232 "renesas,rcar-gen2-thermal", 273 reg = <0 0xe6160000 0 0x0100>;
233 "renesas,rcar-thermal"; 274 };
234 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
235 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
236 clocks = <&cpg CPG_MOD 522>;
237 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
238 resets = <&cpg 522>;
239 #thermal-sensor-cells = <0>;
240 };
241 275
242 timer { 276 sysc: system-controller@e6180000 {
243 compatible = "arm,armv7-timer"; 277 compatible = "renesas,r8a7793-sysc";
244 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 278 reg = <0 0xe6180000 0 0x0200>;
245 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 279 #power-domain-cells = <1>;
246 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 280 };
247 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
248 };
249 281
250 cmt0: timer@ffca0000 { 282 irqc0: interrupt-controller@e61c0000 {
251 compatible = "renesas,r8a7793-cmt0", "renesas,rcar-gen2-cmt0"; 283 compatible = "renesas,irqc-r8a7793", "renesas,irqc";
252 reg = <0 0xffca0000 0 0x1004>; 284 #interrupt-cells = <2>;
253 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 285 interrupt-controller;
254 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 286 reg = <0 0xe61c0000 0 0x200>;
255 clocks = <&cpg CPG_MOD 124>; 287 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
256 clock-names = "fck"; 288 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
257 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 289 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
258 resets = <&cpg 124>; 290 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
259 291 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
260 status = "disabled"; 292 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
261 }; 293 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
294 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
295 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
296 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&cpg CPG_MOD 407>;
298 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
299 resets = <&cpg 407>;
300 };
262 301
263 cmt1: timer@e6130000 { 302 thermal: thermal@e61f0000 {
264 compatible = "renesas,r8a7793-cmt1", "renesas,rcar-gen2-cmt1"; 303 compatible = "renesas,thermal-r8a7793",
265 reg = <0 0xe6130000 0 0x1004>; 304 "renesas,rcar-gen2-thermal",
266 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 305 "renesas,rcar-thermal";
267 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 306 reg = <0 0xe61f0000 0 0x10>, <0 0xe61f0100 0 0x38>;
268 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 307 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
269 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 308 clocks = <&cpg CPG_MOD 522>;
270 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, 309 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
271 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, 310 resets = <&cpg 522>;
272 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, 311 #thermal-sensor-cells = <0>;
273 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; 312 };
274 clocks = <&cpg CPG_MOD 329>;
275 clock-names = "fck";
276 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
277 resets = <&cpg 329>;
278
279 status = "disabled";
280 };
281 313
282 irqc0: interrupt-controller@e61c0000 { 314 ipmmu_sy0: mmu@e6280000 {
283 compatible = "renesas,irqc-r8a7793", "renesas,irqc"; 315 compatible = "renesas,ipmmu-r8a7793",
284 #interrupt-cells = <2>; 316 "renesas,ipmmu-vmsa";
285 interrupt-controller; 317 reg = <0 0xe6280000 0 0x1000>;
286 reg = <0 0xe61c0000 0 0x200>; 318 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
287 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 319 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
288 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 320 #iommu-cells = <1>;
289 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 321 status = "disabled";
290 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 322 };
291 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
292 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
293 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
294 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
295 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
296 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&cpg CPG_MOD 407>;
298 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
299 resets = <&cpg 407>;
300 };
301 323
302 dmac0: dma-controller@e6700000 { 324 ipmmu_sy1: mmu@e6290000 {
303 compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac"; 325 compatible = "renesas,ipmmu-r8a7793",
304 reg = <0 0xe6700000 0 0x20000>; 326 "renesas,ipmmu-vmsa";
305 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH 327 reg = <0 0xe6290000 0 0x1000>;
306 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH 328 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
307 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH 329 #iommu-cells = <1>;
308 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH 330 status = "disabled";
309 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH 331 };
310 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
311 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
312 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
313 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
314 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
315 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
316 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
317 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
318 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
319 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
320 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
321 interrupt-names = "error",
322 "ch0", "ch1", "ch2", "ch3",
323 "ch4", "ch5", "ch6", "ch7",
324 "ch8", "ch9", "ch10", "ch11",
325 "ch12", "ch13", "ch14";
326 clocks = <&cpg CPG_MOD 219>;
327 clock-names = "fck";
328 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
329 resets = <&cpg 219>;
330 #dma-cells = <1>;
331 dma-channels = <15>;
332 };
333 332
334 dmac1: dma-controller@e6720000 { 333 ipmmu_ds: mmu@e6740000 {
335 compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac"; 334 compatible = "renesas,ipmmu-r8a7793",
336 reg = <0 0xe6720000 0 0x20000>; 335 "renesas,ipmmu-vmsa";
337 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH 336 reg = <0 0xe6740000 0 0x1000>;
338 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH 337 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
339 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH 338 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
340 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH 339 #iommu-cells = <1>;
341 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH 340 status = "disabled";
342 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH 341 };
343 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
344 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
345 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
346 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
347 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
348 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
349 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
350 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
351 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
352 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
353 interrupt-names = "error",
354 "ch0", "ch1", "ch2", "ch3",
355 "ch4", "ch5", "ch6", "ch7",
356 "ch8", "ch9", "ch10", "ch11",
357 "ch12", "ch13", "ch14";
358 clocks = <&cpg CPG_MOD 218>;
359 clock-names = "fck";
360 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
361 resets = <&cpg 218>;
362 #dma-cells = <1>;
363 dma-channels = <15>;
364 };
365 342
366 audma0: dma-controller@ec700000 { 343 ipmmu_mp: mmu@ec680000 {
367 compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac"; 344 compatible = "renesas,ipmmu-r8a7793",
368 reg = <0 0xec700000 0 0x10000>; 345 "renesas,ipmmu-vmsa";
369 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH 346 reg = <0 0xec680000 0 0x1000>;
370 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH 347 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
371 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH 348 #iommu-cells = <1>;
372 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH 349 status = "disabled";
373 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH 350 };
374 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
375 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
376 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
377 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
378 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
379 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
380 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
381 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
382 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
383 interrupt-names = "error",
384 "ch0", "ch1", "ch2", "ch3",
385 "ch4", "ch5", "ch6", "ch7",
386 "ch8", "ch9", "ch10", "ch11",
387 "ch12";
388 clocks = <&cpg CPG_MOD 502>;
389 clock-names = "fck";
390 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
391 resets = <&cpg 502>;
392 #dma-cells = <1>;
393 dma-channels = <13>;
394 };
395 351
396 audma1: dma-controller@ec720000 { 352 ipmmu_mx: mmu@fe951000 {
397 compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac"; 353 compatible = "renesas,ipmmu-r8a7793",
398 reg = <0 0xec720000 0 0x10000>; 354 "renesas,ipmmu-vmsa";
399 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH 355 reg = <0 0xfe951000 0 0x1000>;
400 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH 356 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
401 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH 357 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
402 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH 358 #iommu-cells = <1>;
403 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH 359 status = "disabled";
404 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH 360 };
405 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
406 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
407 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
408 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
409 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
410 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
411 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
412 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
413 interrupt-names = "error",
414 "ch0", "ch1", "ch2", "ch3",
415 "ch4", "ch5", "ch6", "ch7",
416 "ch8", "ch9", "ch10", "ch11",
417 "ch12";
418 clocks = <&cpg CPG_MOD 501>;
419 clock-names = "fck";
420 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
421 resets = <&cpg 501>;
422 #dma-cells = <1>;
423 dma-channels = <13>;
424 };
425 361
426 /* The memory map in the User's Manual maps the cores to bus numbers */ 362 ipmmu_rt: mmu@ffc80000 {
427 i2c0: i2c@e6508000 { 363 compatible = "renesas,ipmmu-r8a7793",
428 #address-cells = <1>; 364 "renesas,ipmmu-vmsa";
429 #size-cells = <0>; 365 reg = <0 0xffc80000 0 0x1000>;
430 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 366 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
431 reg = <0 0xe6508000 0 0x40>; 367 #iommu-cells = <1>;
432 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 368 status = "disabled";
433 clocks = <&cpg CPG_MOD 931>; 369 };
434 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
435 resets = <&cpg 931>;
436 i2c-scl-internal-delay-ns = <6>;
437 status = "disabled";
438 };
439 370
440 i2c1: i2c@e6518000 { 371 ipmmu_gp: mmu@e62a0000 {
441 #address-cells = <1>; 372 compatible = "renesas,ipmmu-r8a7793",
442 #size-cells = <0>; 373 "renesas,ipmmu-vmsa";
443 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 374 reg = <0 0xe62a0000 0 0x1000>;
444 reg = <0 0xe6518000 0 0x40>; 375 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
445 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>; 376 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
446 clocks = <&cpg CPG_MOD 930>; 377 #iommu-cells = <1>;
447 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 378 status = "disabled";
448 resets = <&cpg 930>; 379 };
449 i2c-scl-internal-delay-ns = <6>;
450 status = "disabled";
451 };
452 380
453 i2c2: i2c@e6530000 { 381 icram0: sram@e63a0000 {
454 #address-cells = <1>; 382 compatible = "mmio-sram";
455 #size-cells = <0>; 383 reg = <0 0xe63a0000 0 0x12000>;
456 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 384 };
457 reg = <0 0xe6530000 0 0x40>;
458 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
459 clocks = <&cpg CPG_MOD 929>;
460 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
461 resets = <&cpg 929>;
462 i2c-scl-internal-delay-ns = <6>;
463 status = "disabled";
464 };
465 385
466 i2c3: i2c@e6540000 { 386 icram1: sram@e63c0000 {
467 #address-cells = <1>; 387 compatible = "mmio-sram";
468 #size-cells = <0>; 388 reg = <0 0xe63c0000 0 0x1000>;
469 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 389 #address-cells = <1>;
470 reg = <0 0xe6540000 0 0x40>; 390 #size-cells = <1>;
471 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>; 391 ranges = <0 0 0xe63c0000 0x1000>;
472 clocks = <&cpg CPG_MOD 928>;
473 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
474 resets = <&cpg 928>;
475 i2c-scl-internal-delay-ns = <6>;
476 status = "disabled";
477 };
478 392
479 i2c4: i2c@e6520000 { 393 smp-sram@0 {
480 #address-cells = <1>; 394 compatible = "renesas,smp-sram";
481 #size-cells = <0>; 395 reg = <0 0x10>;
482 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 396 };
483 reg = <0 0xe6520000 0 0x40>; 397 };
484 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
485 clocks = <&cpg CPG_MOD 927>;
486 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
487 resets = <&cpg 927>;
488 i2c-scl-internal-delay-ns = <6>;
489 status = "disabled";
490 };
491 398
492 i2c5: i2c@e6528000 { 399 /* The memory map in the User's Manual maps the cores to
493 /* doesn't need pinmux */ 400 * bus numbers
494 #address-cells = <1>; 401 */
495 #size-cells = <0>; 402 i2c0: i2c@e6508000 {
496 compatible = "renesas,i2c-r8a7793", "renesas,rcar-gen2-i2c"; 403 #address-cells = <1>;
497 reg = <0 0xe6528000 0 0x40>; 404 #size-cells = <0>;
498 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; 405 compatible = "renesas,i2c-r8a7793",
499 clocks = <&cpg CPG_MOD 925>; 406 "renesas,rcar-gen2-i2c";
500 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 407 reg = <0 0xe6508000 0 0x40>;
501 resets = <&cpg 925>; 408 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
502 i2c-scl-internal-delay-ns = <110>; 409 clocks = <&cpg CPG_MOD 931>;
503 status = "disabled"; 410 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
504 }; 411 resets = <&cpg 931>;
412 i2c-scl-internal-delay-ns = <6>;
413 status = "disabled";
414 };
505 415
506 i2c6: i2c@e60b0000 { 416 i2c1: i2c@e6518000 {
507 /* doesn't need pinmux */ 417 #address-cells = <1>;
508 #address-cells = <1>; 418 #size-cells = <0>;
509 #size-cells = <0>; 419 compatible = "renesas,i2c-r8a7793",
510 compatible = "renesas,iic-r8a7793", "renesas,rcar-gen2-iic", 420 "renesas,rcar-gen2-i2c";
511 "renesas,rmobile-iic"; 421 reg = <0 0xe6518000 0 0x40>;
512 reg = <0 0xe60b0000 0 0x425>; 422 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
513 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; 423 clocks = <&cpg CPG_MOD 930>;
514 clocks = <&cpg CPG_MOD 926>; 424 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
515 dmas = <&dmac0 0x77>, <&dmac0 0x78>, 425 resets = <&cpg 930>;
516 <&dmac1 0x77>, <&dmac1 0x78>; 426 i2c-scl-internal-delay-ns = <6>;
517 dma-names = "tx", "rx", "tx", "rx"; 427 status = "disabled";
518 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 428 };
519 resets = <&cpg 926>;
520 status = "disabled";
521 };
522 429
523 i2c7: i2c@e6500000 { 430 i2c2: i2c@e6530000 {
524 #address-cells = <1>; 431 #address-cells = <1>;
525 #size-cells = <0>; 432 #size-cells = <0>;
526 compatible = "renesas,iic-r8a7793", "renesas,rcar-gen2-iic", 433 compatible = "renesas,i2c-r8a7793",
527 "renesas,rmobile-iic"; 434 "renesas,rcar-gen2-i2c";
528 reg = <0 0xe6500000 0 0x425>; 435 reg = <0 0xe6530000 0 0x40>;
529 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; 436 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
530 clocks = <&cpg CPG_MOD 318>; 437 clocks = <&cpg CPG_MOD 929>;
531 dmas = <&dmac0 0x61>, <&dmac0 0x62>, 438 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
532 <&dmac1 0x61>, <&dmac1 0x62>; 439 resets = <&cpg 929>;
533 dma-names = "tx", "rx", "tx", "rx"; 440 i2c-scl-internal-delay-ns = <6>;
534 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 441 status = "disabled";
535 resets = <&cpg 318>; 442 };
536 status = "disabled";
537 };
538 443
539 i2c8: i2c@e6510000 { 444 i2c3: i2c@e6540000 {
540 #address-cells = <1>; 445 #address-cells = <1>;
541 #size-cells = <0>; 446 #size-cells = <0>;
542 compatible = "renesas,iic-r8a7793", "renesas,rcar-gen2-iic", 447 compatible = "renesas,i2c-r8a7793",
543 "renesas,rmobile-iic"; 448 "renesas,rcar-gen2-i2c";
544 reg = <0 0xe6510000 0 0x425>; 449 reg = <0 0xe6540000 0 0x40>;
545 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; 450 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
546 clocks = <&cpg CPG_MOD 323>; 451 clocks = <&cpg CPG_MOD 928>;
547 dmas = <&dmac0 0x65>, <&dmac0 0x66>, 452 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
548 <&dmac1 0x65>, <&dmac1 0x66>; 453 resets = <&cpg 928>;
549 dma-names = "tx", "rx", "tx", "rx"; 454 i2c-scl-internal-delay-ns = <6>;
550 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 455 status = "disabled";
551 resets = <&cpg 323>; 456 };
552 status = "disabled";
553 };
554 457
555 pfc: pin-controller@e6060000 { 458 i2c4: i2c@e6520000 {
556 compatible = "renesas,pfc-r8a7793"; 459 #address-cells = <1>;
557 reg = <0 0xe6060000 0 0x250>; 460 #size-cells = <0>;
558 }; 461 compatible = "renesas,i2c-r8a7793",
462 "renesas,rcar-gen2-i2c";
463 reg = <0 0xe6520000 0 0x40>;
464 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
465 clocks = <&cpg CPG_MOD 927>;
466 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
467 resets = <&cpg 927>;
468 i2c-scl-internal-delay-ns = <6>;
469 status = "disabled";
470 };
559 471
560 sdhi0: sd@ee100000 { 472 i2c5: i2c@e6528000 {
561 compatible = "renesas,sdhi-r8a7793", 473 /* doesn't need pinmux */
562 "renesas,rcar-gen2-sdhi"; 474 #address-cells = <1>;
563 reg = <0 0xee100000 0 0x328>; 475 #size-cells = <0>;
564 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>; 476 compatible = "renesas,i2c-r8a7793",
565 clocks = <&cpg CPG_MOD 314>; 477 "renesas,rcar-gen2-i2c";
566 dmas = <&dmac0 0xcd>, <&dmac0 0xce>, 478 reg = <0 0xe6528000 0 0x40>;
567 <&dmac1 0xcd>, <&dmac1 0xce>; 479 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
568 dma-names = "tx", "rx", "tx", "rx"; 480 clocks = <&cpg CPG_MOD 925>;
569 max-frequency = <195000000>; 481 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
570 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 482 resets = <&cpg 925>;
571 resets = <&cpg 314>; 483 i2c-scl-internal-delay-ns = <110>;
572 status = "disabled"; 484 status = "disabled";
573 }; 485 };
574 486
575 sdhi1: sd@ee140000 { 487 i2c6: i2c@e60b0000 {
576 compatible = "renesas,sdhi-r8a7793", 488 /* doesn't need pinmux */
577 "renesas,rcar-gen2-sdhi"; 489 #address-cells = <1>;
578 reg = <0 0xee140000 0 0x100>; 490 #size-cells = <0>;
579 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>; 491 compatible = "renesas,iic-r8a7793",
580 clocks = <&cpg CPG_MOD 312>; 492 "renesas,rcar-gen2-iic",
581 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>, 493 "renesas,rmobile-iic";
582 <&dmac1 0xc1>, <&dmac1 0xc2>; 494 reg = <0 0xe60b0000 0 0x425>;
583 dma-names = "tx", "rx", "tx", "rx"; 495 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
584 max-frequency = <97500000>; 496 clocks = <&cpg CPG_MOD 926>;
585 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 497 dmas = <&dmac0 0x77>, <&dmac0 0x78>,
586 resets = <&cpg 312>; 498 <&dmac1 0x77>, <&dmac1 0x78>;
587 status = "disabled"; 499 dma-names = "tx", "rx", "tx", "rx";
588 }; 500 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
501 resets = <&cpg 926>;
502 status = "disabled";
503 };
589 504
590 sdhi2: sd@ee160000 { 505 i2c7: i2c@e6500000 {
591 compatible = "renesas,sdhi-r8a7793", 506 #address-cells = <1>;
592 "renesas,rcar-gen2-sdhi"; 507 #size-cells = <0>;
593 reg = <0 0xee160000 0 0x100>; 508 compatible = "renesas,iic-r8a7793",
594 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; 509 "renesas,rcar-gen2-iic",
595 clocks = <&cpg CPG_MOD 311>; 510 "renesas,rmobile-iic";
596 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>, 511 reg = <0 0xe6500000 0 0x425>;
597 <&dmac1 0xd3>, <&dmac1 0xd4>; 512 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
598 dma-names = "tx", "rx", "tx", "rx"; 513 clocks = <&cpg CPG_MOD 318>;
599 max-frequency = <97500000>; 514 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
600 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 515 <&dmac1 0x61>, <&dmac1 0x62>;
601 resets = <&cpg 311>; 516 dma-names = "tx", "rx", "tx", "rx";
602 status = "disabled"; 517 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
603 }; 518 resets = <&cpg 318>;
519 status = "disabled";
520 };
604 521
605 mmcif0: mmc@ee200000 { 522 i2c8: i2c@e6510000 {
606 compatible = "renesas,mmcif-r8a7793", "renesas,sh-mmcif"; 523 #address-cells = <1>;
607 reg = <0 0xee200000 0 0x80>; 524 #size-cells = <0>;
608 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; 525 compatible = "renesas,iic-r8a7793",
609 clocks = <&cpg CPG_MOD 315>; 526 "renesas,rcar-gen2-iic",
610 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>, 527 "renesas,rmobile-iic";
611 <&dmac1 0xd1>, <&dmac1 0xd2>; 528 reg = <0 0xe6510000 0 0x425>;
612 dma-names = "tx", "rx", "tx", "rx"; 529 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
613 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 530 clocks = <&cpg CPG_MOD 323>;
614 resets = <&cpg 315>; 531 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
615 reg-io-width = <4>; 532 <&dmac1 0x65>, <&dmac1 0x66>;
616 status = "disabled"; 533 dma-names = "tx", "rx", "tx", "rx";
617 max-frequency = <97500000>; 534 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
618 }; 535 resets = <&cpg 323>;
536 status = "disabled";
537 };
619 538
620 scifa0: serial@e6c40000 { 539 dmac0: dma-controller@e6700000 {
621 compatible = "renesas,scifa-r8a7793", 540 compatible = "renesas,dmac-r8a7793",
622 "renesas,rcar-gen2-scifa", "renesas,scifa"; 541 "renesas,rcar-dmac";
623 reg = <0 0xe6c40000 0 64>; 542 reg = <0 0xe6700000 0 0x20000>;
624 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 543 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH
625 clocks = <&cpg CPG_MOD 204>; 544 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
626 clock-names = "fck"; 545 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
627 dmas = <&dmac0 0x21>, <&dmac0 0x22>, 546 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
628 <&dmac1 0x21>, <&dmac1 0x22>; 547 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
629 dma-names = "tx", "rx", "tx", "rx"; 548 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
630 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 549 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
631 resets = <&cpg 204>; 550 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
632 status = "disabled"; 551 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
633 }; 552 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
553 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
554 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
555 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
556 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
557 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
558 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
559 interrupt-names = "error",
560 "ch0", "ch1", "ch2", "ch3",
561 "ch4", "ch5", "ch6", "ch7",
562 "ch8", "ch9", "ch10", "ch11",
563 "ch12", "ch13", "ch14";
564 clocks = <&cpg CPG_MOD 219>;
565 clock-names = "fck";
566 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
567 resets = <&cpg 219>;
568 #dma-cells = <1>;
569 dma-channels = <15>;
570 };
634 571
635 scifa1: serial@e6c50000 { 572 dmac1: dma-controller@e6720000 {
636 compatible = "renesas,scifa-r8a7793", 573 compatible = "renesas,dmac-r8a7793",
637 "renesas,rcar-gen2-scifa", "renesas,scifa"; 574 "renesas,rcar-dmac";
638 reg = <0 0xe6c50000 0 64>; 575 reg = <0 0xe6720000 0 0x20000>;
639 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; 576 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
640 clocks = <&cpg CPG_MOD 203>; 577 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
641 clock-names = "fck"; 578 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
642 dmas = <&dmac0 0x25>, <&dmac0 0x26>, 579 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
643 <&dmac1 0x25>, <&dmac1 0x26>; 580 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
644 dma-names = "tx", "rx", "tx", "rx"; 581 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
645 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 582 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
646 resets = <&cpg 203>; 583 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
647 status = "disabled"; 584 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
648 }; 585 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
586 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
587 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
588 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
589 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
590 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
591 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
592 interrupt-names = "error",
593 "ch0", "ch1", "ch2", "ch3",
594 "ch4", "ch5", "ch6", "ch7",
595 "ch8", "ch9", "ch10", "ch11",
596 "ch12", "ch13", "ch14";
597 clocks = <&cpg CPG_MOD 218>;
598 clock-names = "fck";
599 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
600 resets = <&cpg 218>;
601 #dma-cells = <1>;
602 dma-channels = <15>;
603 };
649 604
650 scifa2: serial@e6c60000 { 605 qspi: spi@e6b10000 {
651 compatible = "renesas,scifa-r8a7793", 606 compatible = "renesas,qspi-r8a7793", "renesas,qspi";
652 "renesas,rcar-gen2-scifa", "renesas,scifa"; 607 reg = <0 0xe6b10000 0 0x2c>;
653 reg = <0 0xe6c60000 0 64>; 608 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
654 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; 609 clocks = <&cpg CPG_MOD 917>;
655 clocks = <&cpg CPG_MOD 202>; 610 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
656 clock-names = "fck"; 611 <&dmac1 0x17>, <&dmac1 0x18>;
657 dmas = <&dmac0 0x27>, <&dmac0 0x28>, 612 dma-names = "tx", "rx", "tx", "rx";
658 <&dmac1 0x27>, <&dmac1 0x28>; 613 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
659 dma-names = "tx", "rx", "tx", "rx"; 614 resets = <&cpg 917>;
660 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 615 num-cs = <1>;
661 resets = <&cpg 202>; 616 #address-cells = <1>;
662 status = "disabled"; 617 #size-cells = <0>;
663 }; 618 status = "disabled";
619 };
664 620
665 scifa3: serial@e6c70000 { 621 scifa0: serial@e6c40000 {
666 compatible = "renesas,scifa-r8a7793", 622 compatible = "renesas,scifa-r8a7793",
667 "renesas,rcar-gen2-scifa", "renesas,scifa"; 623 "renesas,rcar-gen2-scifa", "renesas,scifa";
668 reg = <0 0xe6c70000 0 64>; 624 reg = <0 0xe6c40000 0 64>;
669 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; 625 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
670 clocks = <&cpg CPG_MOD 1106>; 626 clocks = <&cpg CPG_MOD 204>;
671 clock-names = "fck"; 627 clock-names = "fck";
672 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>, 628 dmas = <&dmac0 0x21>, <&dmac0 0x22>,
673 <&dmac1 0x1b>, <&dmac1 0x1c>; 629 <&dmac1 0x21>, <&dmac1 0x22>;
674 dma-names = "tx", "rx", "tx", "rx"; 630 dma-names = "tx", "rx", "tx", "rx";
675 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 631 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
676 resets = <&cpg 1106>; 632 resets = <&cpg 204>;
677 status = "disabled"; 633 status = "disabled";
678 }; 634 };
679 635
680 scifa4: serial@e6c78000 { 636 scifa1: serial@e6c50000 {
681 compatible = "renesas,scifa-r8a7793", 637 compatible = "renesas,scifa-r8a7793",
682 "renesas,rcar-gen2-scifa", "renesas,scifa"; 638 "renesas,rcar-gen2-scifa", "renesas,scifa";
683 reg = <0 0xe6c78000 0 64>; 639 reg = <0 0xe6c50000 0 64>;
684 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; 640 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
685 clocks = <&cpg CPG_MOD 1107>; 641 clocks = <&cpg CPG_MOD 203>;
686 clock-names = "fck"; 642 clock-names = "fck";
687 dmas = <&dmac0 0x1f>, <&dmac0 0x20>, 643 dmas = <&dmac0 0x25>, <&dmac0 0x26>,
688 <&dmac1 0x1f>, <&dmac1 0x20>; 644 <&dmac1 0x25>, <&dmac1 0x26>;
689 dma-names = "tx", "rx", "tx", "rx"; 645 dma-names = "tx", "rx", "tx", "rx";
690 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 646 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
691 resets = <&cpg 1107>; 647 resets = <&cpg 203>;
692 status = "disabled"; 648 status = "disabled";
693 }; 649 };
694 650
695 scifa5: serial@e6c80000 { 651 scifa2: serial@e6c60000 {
696 compatible = "renesas,scifa-r8a7793", 652 compatible = "renesas,scifa-r8a7793",
697 "renesas,rcar-gen2-scifa", "renesas,scifa"; 653 "renesas,rcar-gen2-scifa", "renesas,scifa";
698 reg = <0 0xe6c80000 0 64>; 654 reg = <0 0xe6c60000 0 64>;
699 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 655 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
700 clocks = <&cpg CPG_MOD 1108>; 656 clocks = <&cpg CPG_MOD 202>;
701 clock-names = "fck"; 657 clock-names = "fck";
702 dmas = <&dmac0 0x23>, <&dmac0 0x24>, 658 dmas = <&dmac0 0x27>, <&dmac0 0x28>,
703 <&dmac1 0x23>, <&dmac1 0x24>; 659 <&dmac1 0x27>, <&dmac1 0x28>;
704 dma-names = "tx", "rx", "tx", "rx"; 660 dma-names = "tx", "rx", "tx", "rx";
705 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 661 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
706 resets = <&cpg 1108>; 662 resets = <&cpg 202>;
707 status = "disabled"; 663 status = "disabled";
708 }; 664 };
709 665
710 scifb0: serial@e6c20000 { 666 scifa3: serial@e6c70000 {
711 compatible = "renesas,scifb-r8a7793", 667 compatible = "renesas,scifa-r8a7793",
712 "renesas,rcar-gen2-scifb", "renesas,scifb"; 668 "renesas,rcar-gen2-scifa", "renesas,scifa";
713 reg = <0 0xe6c20000 0 0x100>; 669 reg = <0 0xe6c70000 0 64>;
714 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; 670 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
715 clocks = <&cpg CPG_MOD 206>; 671 clocks = <&cpg CPG_MOD 1106>;
716 clock-names = "fck"; 672 clock-names = "fck";
717 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>, 673 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>,
718 <&dmac1 0x3d>, <&dmac1 0x3e>; 674 <&dmac1 0x1b>, <&dmac1 0x1c>;
719 dma-names = "tx", "rx", "tx", "rx"; 675 dma-names = "tx", "rx", "tx", "rx";
720 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 676 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
721 resets = <&cpg 206>; 677 resets = <&cpg 1106>;
722 status = "disabled"; 678 status = "disabled";
723 }; 679 };
724 680
725 scifb1: serial@e6c30000 { 681 scifa4: serial@e6c78000 {
726 compatible = "renesas,scifb-r8a7793", 682 compatible = "renesas,scifa-r8a7793",
727 "renesas,rcar-gen2-scifb", "renesas,scifb"; 683 "renesas,rcar-gen2-scifa", "renesas,scifa";
728 reg = <0 0xe6c30000 0 0x100>; 684 reg = <0 0xe6c78000 0 64>;
729 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>; 685 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
730 clocks = <&cpg CPG_MOD 207>; 686 clocks = <&cpg CPG_MOD 1107>;
731 clock-names = "fck"; 687 clock-names = "fck";
732 dmas = <&dmac0 0x19>, <&dmac0 0x1a>, 688 dmas = <&dmac0 0x1f>, <&dmac0 0x20>,
733 <&dmac1 0x19>, <&dmac1 0x1a>; 689 <&dmac1 0x1f>, <&dmac1 0x20>;
734 dma-names = "tx", "rx", "tx", "rx"; 690 dma-names = "tx", "rx", "tx", "rx";
735 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 691 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
736 resets = <&cpg 207>; 692 resets = <&cpg 1107>;
737 status = "disabled"; 693 status = "disabled";
738 }; 694 };
739 695
740 scifb2: serial@e6ce0000 { 696 scifa5: serial@e6c80000 {
741 compatible = "renesas,scifb-r8a7793", 697 compatible = "renesas,scifa-r8a7793",
742 "renesas,rcar-gen2-scifb", "renesas,scifb"; 698 "renesas,rcar-gen2-scifa", "renesas,scifa";
743 reg = <0 0xe6ce0000 0 0x100>; 699 reg = <0 0xe6c80000 0 64>;
744 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>; 700 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
745 clocks = <&cpg CPG_MOD 216>; 701 clocks = <&cpg CPG_MOD 1108>;
746 clock-names = "fck"; 702 clock-names = "fck";
747 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>, 703 dmas = <&dmac0 0x23>, <&dmac0 0x24>,
748 <&dmac1 0x1d>, <&dmac1 0x1e>; 704 <&dmac1 0x23>, <&dmac1 0x24>;
749 dma-names = "tx", "rx", "tx", "rx"; 705 dma-names = "tx", "rx", "tx", "rx";
750 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 706 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
751 resets = <&cpg 216>; 707 resets = <&cpg 1108>;
752 status = "disabled"; 708 status = "disabled";
753 }; 709 };
754 710
755 scif0: serial@e6e60000 { 711 scifb0: serial@e6c20000 {
756 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 712 compatible = "renesas,scifb-r8a7793",
757 "renesas,scif"; 713 "renesas,rcar-gen2-scifb", "renesas,scifb";
758 reg = <0 0xe6e60000 0 64>; 714 reg = <0 0xe6c20000 0 0x100>;
759 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>; 715 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
760 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 716 clocks = <&cpg CPG_MOD 206>;
761 <&scif_clk>; 717 clock-names = "fck";
762 clock-names = "fck", "brg_int", "scif_clk"; 718 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>,
763 dmas = <&dmac0 0x29>, <&dmac0 0x2a>, 719 <&dmac1 0x3d>, <&dmac1 0x3e>;
764 <&dmac1 0x29>, <&dmac1 0x2a>; 720 dma-names = "tx", "rx", "tx", "rx";
765 dma-names = "tx", "rx", "tx", "rx"; 721 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
766 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 722 resets = <&cpg 206>;
767 resets = <&cpg 721>; 723 status = "disabled";
768 status = "disabled"; 724 };
769 };
770 725
771 scif1: serial@e6e68000 { 726 scifb1: serial@e6c30000 {
772 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 727 compatible = "renesas,scifb-r8a7793",
773 "renesas,scif"; 728 "renesas,rcar-gen2-scifb", "renesas,scifb";
774 reg = <0 0xe6e68000 0 64>; 729 reg = <0 0xe6c30000 0 0x100>;
775 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>; 730 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
776 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 731 clocks = <&cpg CPG_MOD 207>;
777 <&scif_clk>; 732 clock-names = "fck";
778 clock-names = "fck", "brg_int", "scif_clk"; 733 dmas = <&dmac0 0x19>, <&dmac0 0x1a>,
779 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>, 734 <&dmac1 0x19>, <&dmac1 0x1a>;
780 <&dmac1 0x2d>, <&dmac1 0x2e>; 735 dma-names = "tx", "rx", "tx", "rx";
781 dma-names = "tx", "rx", "tx", "rx"; 736 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
782 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 737 resets = <&cpg 207>;
783 resets = <&cpg 720>; 738 status = "disabled";
784 status = "disabled"; 739 };
785 };
786 740
787 scif2: serial@e6e58000 { 741 scifb2: serial@e6ce0000 {
788 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 742 compatible = "renesas,scifb-r8a7793",
789 "renesas,scif"; 743 "renesas,rcar-gen2-scifb", "renesas,scifb";
790 reg = <0 0xe6e58000 0 64>; 744 reg = <0 0xe6ce0000 0 0x100>;
791 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; 745 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
792 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 746 clocks = <&cpg CPG_MOD 216>;
793 <&scif_clk>; 747 clock-names = "fck";
794 clock-names = "fck", "brg_int", "scif_clk"; 748 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>,
795 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>, 749 <&dmac1 0x1d>, <&dmac1 0x1e>;
796 <&dmac1 0x2b>, <&dmac1 0x2c>; 750 dma-names = "tx", "rx", "tx", "rx";
797 dma-names = "tx", "rx", "tx", "rx"; 751 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
798 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 752 resets = <&cpg 216>;
799 resets = <&cpg 719>; 753 status = "disabled";
800 status = "disabled"; 754 };
801 };
802 755
803 scif3: serial@e6ea8000 { 756 scif0: serial@e6e60000 {
804 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 757 compatible = "renesas,scif-r8a7793",
805 "renesas,scif"; 758 "renesas,rcar-gen2-scif", "renesas,scif";
806 reg = <0 0xe6ea8000 0 64>; 759 reg = <0 0xe6e60000 0 64>;
807 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 760 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
808 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 761 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
809 <&scif_clk>; 762 <&scif_clk>;
810 clock-names = "fck", "brg_int", "scif_clk"; 763 clock-names = "fck", "brg_int", "scif_clk";
811 dmas = <&dmac0 0x2f>, <&dmac0 0x30>, 764 dmas = <&dmac0 0x29>, <&dmac0 0x2a>,
812 <&dmac1 0x2f>, <&dmac1 0x30>; 765 <&dmac1 0x29>, <&dmac1 0x2a>;
813 dma-names = "tx", "rx", "tx", "rx"; 766 dma-names = "tx", "rx", "tx", "rx";
814 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 767 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
815 resets = <&cpg 718>; 768 resets = <&cpg 721>;
816 status = "disabled"; 769 status = "disabled";
817 }; 770 };
818 771
819 scif4: serial@e6ee0000 { 772 scif1: serial@e6e68000 {
820 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 773 compatible = "renesas,scif-r8a7793",
821 "renesas,scif"; 774 "renesas,rcar-gen2-scif", "renesas,scif";
822 reg = <0 0xe6ee0000 0 64>; 775 reg = <0 0xe6e68000 0 64>;
823 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 776 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
824 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 777 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
825 <&scif_clk>; 778 <&scif_clk>;
826 clock-names = "fck", "brg_int", "scif_clk"; 779 clock-names = "fck", "brg_int", "scif_clk";
827 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>, 780 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>,
828 <&dmac1 0xfb>, <&dmac1 0xfc>; 781 <&dmac1 0x2d>, <&dmac1 0x2e>;
829 dma-names = "tx", "rx", "tx", "rx"; 782 dma-names = "tx", "rx", "tx", "rx";
830 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 783 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
831 resets = <&cpg 715>; 784 resets = <&cpg 720>;
832 status = "disabled"; 785 status = "disabled";
833 }; 786 };
834 787
835 scif5: serial@e6ee8000 { 788 scif2: serial@e6e58000 {
836 compatible = "renesas,scif-r8a7793", "renesas,rcar-gen2-scif", 789 compatible = "renesas,scif-r8a7793",
837 "renesas,scif"; 790 "renesas,rcar-gen2-scif", "renesas,scif";
838 reg = <0 0xe6ee8000 0 64>; 791 reg = <0 0xe6e58000 0 64>;
839 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; 792 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
840 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 793 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
841 <&scif_clk>; 794 <&scif_clk>;
842 clock-names = "fck", "brg_int", "scif_clk"; 795 clock-names = "fck", "brg_int", "scif_clk";
843 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>, 796 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>,
844 <&dmac1 0xfd>, <&dmac1 0xfe>; 797 <&dmac1 0x2b>, <&dmac1 0x2c>;
845 dma-names = "tx", "rx", "tx", "rx"; 798 dma-names = "tx", "rx", "tx", "rx";
846 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 799 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
847 resets = <&cpg 714>; 800 resets = <&cpg 719>;
848 status = "disabled"; 801 status = "disabled";
849 }; 802 };
850 803
851 hscif0: serial@e62c0000 { 804 scif3: serial@e6ea8000 {
852 compatible = "renesas,hscif-r8a7793", 805 compatible = "renesas,scif-r8a7793",
853 "renesas,rcar-gen2-hscif", "renesas,hscif"; 806 "renesas,rcar-gen2-scif", "renesas,scif";
854 reg = <0 0xe62c0000 0 96>; 807 reg = <0 0xe6ea8000 0 64>;
855 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>; 808 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
856 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 809 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
857 <&scif_clk>; 810 <&scif_clk>;
858 clock-names = "fck", "brg_int", "scif_clk"; 811 clock-names = "fck", "brg_int", "scif_clk";
859 dmas = <&dmac0 0x39>, <&dmac0 0x3a>, 812 dmas = <&dmac0 0x2f>, <&dmac0 0x30>,
860 <&dmac1 0x39>, <&dmac1 0x3a>; 813 <&dmac1 0x2f>, <&dmac1 0x30>;
861 dma-names = "tx", "rx", "tx", "rx"; 814 dma-names = "tx", "rx", "tx", "rx";
862 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 815 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
863 resets = <&cpg 717>; 816 resets = <&cpg 718>;
864 status = "disabled"; 817 status = "disabled";
865 }; 818 };
866 819
867 hscif1: serial@e62c8000 { 820 scif4: serial@e6ee0000 {
868 compatible = "renesas,hscif-r8a7793", 821 compatible = "renesas,scif-r8a7793",
869 "renesas,rcar-gen2-hscif", "renesas,hscif"; 822 "renesas,rcar-gen2-scif", "renesas,scif";
870 reg = <0 0xe62c8000 0 96>; 823 reg = <0 0xe6ee0000 0 64>;
871 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>; 824 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
872 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 825 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
873 <&scif_clk>; 826 <&scif_clk>;
874 clock-names = "fck", "brg_int", "scif_clk"; 827 clock-names = "fck", "brg_int", "scif_clk";
875 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>, 828 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>,
876 <&dmac1 0x4d>, <&dmac1 0x4e>; 829 <&dmac1 0xfb>, <&dmac1 0xfc>;
877 dma-names = "tx", "rx", "tx", "rx"; 830 dma-names = "tx", "rx", "tx", "rx";
878 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 831 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
879 resets = <&cpg 716>; 832 resets = <&cpg 715>;
880 status = "disabled"; 833 status = "disabled";
881 }; 834 };
882 835
883 hscif2: serial@e62d0000 { 836 scif5: serial@e6ee8000 {
884 compatible = "renesas,hscif-r8a7793", 837 compatible = "renesas,scif-r8a7793",
885 "renesas,rcar-gen2-hscif", "renesas,hscif"; 838 "renesas,rcar-gen2-scif", "renesas,scif";
886 reg = <0 0xe62d0000 0 96>; 839 reg = <0 0xe6ee8000 0 64>;
887 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; 840 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
888 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7793_CLK_ZS>, 841 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
889 <&scif_clk>; 842 <&scif_clk>;
890 clock-names = "fck", "brg_int", "scif_clk"; 843 clock-names = "fck", "brg_int", "scif_clk";
891 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>, 844 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>,
892 <&dmac1 0x3b>, <&dmac1 0x3c>; 845 <&dmac1 0xfd>, <&dmac1 0xfe>;
893 dma-names = "tx", "rx", "tx", "rx"; 846 dma-names = "tx", "rx", "tx", "rx";
894 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 847 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
895 resets = <&cpg 713>; 848 resets = <&cpg 714>;
896 status = "disabled"; 849 status = "disabled";
897 }; 850 };
898 851
899 icram0: sram@e63a0000 { 852 hscif0: serial@e62c0000 {
900 compatible = "mmio-sram"; 853 compatible = "renesas,hscif-r8a7793",
901 reg = <0 0xe63a0000 0 0x12000>; 854 "renesas,rcar-gen2-hscif", "renesas,hscif";
902 }; 855 reg = <0 0xe62c0000 0 96>;
856 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
857 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
858 <&scif_clk>;
859 clock-names = "fck", "brg_int", "scif_clk";
860 dmas = <&dmac0 0x39>, <&dmac0 0x3a>,
861 <&dmac1 0x39>, <&dmac1 0x3a>;
862 dma-names = "tx", "rx", "tx", "rx";
863 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
864 resets = <&cpg 717>;
865 status = "disabled";
866 };
903 867
904 icram1: sram@e63c0000 { 868 hscif1: serial@e62c8000 {
905 compatible = "mmio-sram"; 869 compatible = "renesas,hscif-r8a7793",
906 reg = <0 0xe63c0000 0 0x1000>; 870 "renesas,rcar-gen2-hscif", "renesas,hscif";
907 #address-cells = <1>; 871 reg = <0 0xe62c8000 0 96>;
908 #size-cells = <1>; 872 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
909 ranges = <0 0 0xe63c0000 0x1000>; 873 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
874 <&scif_clk>;
875 clock-names = "fck", "brg_int", "scif_clk";
876 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>,
877 <&dmac1 0x4d>, <&dmac1 0x4e>;
878 dma-names = "tx", "rx", "tx", "rx";
879 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
880 resets = <&cpg 716>;
881 status = "disabled";
882 };
910 883
911 smp-sram@0 { 884 hscif2: serial@e62d0000 {
912 compatible = "renesas,smp-sram"; 885 compatible = "renesas,hscif-r8a7793",
913 reg = <0 0x10>; 886 "renesas,rcar-gen2-hscif", "renesas,hscif";
887 reg = <0 0xe62d0000 0 96>;
888 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
889 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7793_CLK_ZS>,
890 <&scif_clk>;
891 clock-names = "fck", "brg_int", "scif_clk";
892 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>,
893 <&dmac1 0x3b>, <&dmac1 0x3c>;
894 dma-names = "tx", "rx", "tx", "rx";
895 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
896 resets = <&cpg 713>;
897 status = "disabled";
914 }; 898 };
915 };
916 899
917 ether: ethernet@ee700000 { 900 can0: can@e6e80000 {
918 compatible = "renesas,ether-r8a7793", 901 compatible = "renesas,can-r8a7793",
919 "renesas,rcar-gen2-ether"; 902 "renesas,rcar-gen2-can";
920 reg = <0 0xee700000 0 0x400>; 903 reg = <0 0xe6e80000 0 0x1000>;
921 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; 904 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
922 clocks = <&cpg CPG_MOD 813>; 905 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7793_CLK_RCAN>,
923 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 906 <&can_clk>;
924 resets = <&cpg 813>; 907 clock-names = "clkp1", "clkp2", "can_clk";
925 phy-mode = "rmii"; 908 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
926 #address-cells = <1>; 909 resets = <&cpg 916>;
927 #size-cells = <0>; 910 status = "disabled";
928 status = "disabled"; 911 };
929 };
930 912
931 vin0: video@e6ef0000 { 913 can1: can@e6e88000 {
932 compatible = "renesas,vin-r8a7793", "renesas,rcar-gen2-vin"; 914 compatible = "renesas,can-r8a7793",
933 reg = <0 0xe6ef0000 0 0x1000>; 915 "renesas,rcar-gen2-can";
934 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 916 reg = <0 0xe6e88000 0 0x1000>;
935 clocks = <&cpg CPG_MOD 811>; 917 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
936 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 918 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7793_CLK_RCAN>,
937 resets = <&cpg 811>; 919 <&can_clk>;
938 status = "disabled"; 920 clock-names = "clkp1", "clkp2", "can_clk";
939 }; 921 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
922 resets = <&cpg 915>;
923 status = "disabled";
924 };
940 925
941 vin1: video@e6ef1000 { 926 vin0: video@e6ef0000 {
942 compatible = "renesas,vin-r8a7793", "renesas,rcar-gen2-vin"; 927 compatible = "renesas,vin-r8a7793",
943 reg = <0 0xe6ef1000 0 0x1000>; 928 "renesas,rcar-gen2-vin";
944 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 929 reg = <0 0xe6ef0000 0 0x1000>;
945 clocks = <&cpg CPG_MOD 810>; 930 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
946 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 931 clocks = <&cpg CPG_MOD 811>;
947 resets = <&cpg 810>; 932 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
948 status = "disabled"; 933 resets = <&cpg 811>;
949 }; 934 status = "disabled";
935 };
950 936
951 vin2: video@e6ef2000 { 937 vin1: video@e6ef1000 {
952 compatible = "renesas,vin-r8a7793", "renesas,rcar-gen2-vin"; 938 compatible = "renesas,vin-r8a7793",
953 reg = <0 0xe6ef2000 0 0x1000>; 939 "renesas,rcar-gen2-vin";
954 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>; 940 reg = <0 0xe6ef1000 0 0x1000>;
955 clocks = <&cpg CPG_MOD 809>; 941 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
956 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 942 clocks = <&cpg CPG_MOD 810>;
957 resets = <&cpg 809>; 943 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
958 status = "disabled"; 944 resets = <&cpg 810>;
959 }; 945 status = "disabled";
946 };
960 947
961 qspi: spi@e6b10000 { 948 vin2: video@e6ef2000 {
962 compatible = "renesas,qspi-r8a7793", "renesas,qspi"; 949 compatible = "renesas,vin-r8a7793",
963 reg = <0 0xe6b10000 0 0x2c>; 950 "renesas,rcar-gen2-vin";
964 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 951 reg = <0 0xe6ef2000 0 0x1000>;
965 clocks = <&cpg CPG_MOD 917>; 952 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
966 dmas = <&dmac0 0x17>, <&dmac0 0x18>, 953 clocks = <&cpg CPG_MOD 809>;
967 <&dmac1 0x17>, <&dmac1 0x18>; 954 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
968 dma-names = "tx", "rx", "tx", "rx"; 955 resets = <&cpg 809>;
969 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 956 status = "disabled";
970 resets = <&cpg 917>; 957 };
971 num-cs = <1>;
972 #address-cells = <1>;
973 #size-cells = <0>;
974 status = "disabled";
975 };
976 958
977 du: display@feb00000 { 959 rcar_sound: sound@ec500000 {
978 compatible = "renesas,du-r8a7793"; 960 /*
979 reg = <0 0xfeb00000 0 0x40000>, 961 * #sound-dai-cells is required
980 <0 0xfeb90000 0 0x1c>; 962 *
981 reg-names = "du", "lvds.0"; 963 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
982 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>, 964 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
983 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>; 965 */
984 clocks = <&cpg CPG_MOD 724>, 966 compatible = "renesas,rcar_sound-r8a7793",
985 <&cpg CPG_MOD 723>, 967 "renesas,rcar_sound-gen2";
986 <&cpg CPG_MOD 726>; 968 reg = <0 0xec500000 0 0x1000>, /* SCU */
987 clock-names = "du.0", "du.1", "lvds.0"; 969 <0 0xec5a0000 0 0x100>, /* ADG */
988 status = "disabled"; 970 <0 0xec540000 0 0x1000>, /* SSIU */
989 971 <0 0xec541000 0 0x280>, /* SSI */
990 ports { 972 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
991 #address-cells = <1>; 973 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
992 #size-cells = <0>; 974
975 clocks = <&cpg CPG_MOD 1005>,
976 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
977 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
978 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
979 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
980 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
981 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
982 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
983 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
984 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
985 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
986 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
987 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
988 <&cpg CPG_CORE R8A7793_CLK_M2>;
989 clock-names = "ssi-all",
990 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
991 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
992 "ssi.1", "ssi.0",
993 "src.9", "src.8", "src.7", "src.6",
994 "src.5", "src.4", "src.3", "src.2",
995 "src.1", "src.0",
996 "dvc.0", "dvc.1",
997 "clk_a", "clk_b", "clk_c", "clk_i";
998 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
999 resets = <&cpg 1005>,
1000 <&cpg 1006>, <&cpg 1007>,
1001 <&cpg 1008>, <&cpg 1009>,
1002 <&cpg 1010>, <&cpg 1011>,
1003 <&cpg 1012>, <&cpg 1013>,
1004 <&cpg 1014>, <&cpg 1015>;
1005 reset-names = "ssi-all",
1006 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
1007 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
1008 "ssi.1", "ssi.0";
1009
1010 status = "disabled";
1011
1012 rcar_sound,dvc {
1013 dvc0: dvc-0 {
1014 dmas = <&audma1 0xbc>;
1015 dma-names = "tx";
1016 };
1017 dvc1: dvc-1 {
1018 dmas = <&audma1 0xbe>;
1019 dma-names = "tx";
1020 };
1021 };
993 1022
994 port@0 { 1023 rcar_sound,src {
995 reg = <0>; 1024 src0: src-0 {
996 du_out_rgb: endpoint { 1025 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
1026 dmas = <&audma0 0x85>, <&audma1 0x9a>;
1027 dma-names = "rx", "tx";
1028 };
1029 src1: src-1 {
1030 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
1031 dmas = <&audma0 0x87>, <&audma1 0x9c>;
1032 dma-names = "rx", "tx";
1033 };
1034 src2: src-2 {
1035 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
1036 dmas = <&audma0 0x89>, <&audma1 0x9e>;
1037 dma-names = "rx", "tx";
1038 };
1039 src3: src-3 {
1040 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
1041 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
1042 dma-names = "rx", "tx";
1043 };
1044 src4: src-4 {
1045 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1046 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
1047 dma-names = "rx", "tx";
1048 };
1049 src5: src-5 {
1050 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1051 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
1052 dma-names = "rx", "tx";
1053 };
1054 src6: src-6 {
1055 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1056 dmas = <&audma0 0x91>, <&audma1 0xb4>;
1057 dma-names = "rx", "tx";
1058 };
1059 src7: src-7 {
1060 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1061 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1062 dma-names = "rx", "tx";
1063 };
1064 src8: src-8 {
1065 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1066 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1067 dma-names = "rx", "tx";
1068 };
1069 src9: src-9 {
1070 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1071 dmas = <&audma0 0x97>, <&audma1 0xba>;
1072 dma-names = "rx", "tx";
997 }; 1073 };
998 }; 1074 };
999 port@1 { 1075
1000 reg = <1>; 1076 rcar_sound,ssi {
1001 du_out_lvds0: endpoint { 1077 ssi0: ssi-0 {
1078 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
1079 dmas = <&audma0 0x01>, <&audma1 0x02>,
1080 <&audma0 0x15>, <&audma1 0x16>;
1081 dma-names = "rx", "tx", "rxu", "txu";
1082 };
1083 ssi1: ssi-1 {
1084 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1085 dmas = <&audma0 0x03>, <&audma1 0x04>,
1086 <&audma0 0x49>, <&audma1 0x4a>;
1087 dma-names = "rx", "tx", "rxu", "txu";
1088 };
1089 ssi2: ssi-2 {
1090 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1091 dmas = <&audma0 0x05>, <&audma1 0x06>,
1092 <&audma0 0x63>, <&audma1 0x64>;
1093 dma-names = "rx", "tx", "rxu", "txu";
1094 };
1095 ssi3: ssi-3 {
1096 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1097 dmas = <&audma0 0x07>, <&audma1 0x08>,
1098 <&audma0 0x6f>, <&audma1 0x70>;
1099 dma-names = "rx", "tx", "rxu", "txu";
1100 };
1101 ssi4: ssi-4 {
1102 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1103 dmas = <&audma0 0x09>, <&audma1 0x0a>,
1104 <&audma0 0x71>, <&audma1 0x72>;
1105 dma-names = "rx", "tx", "rxu", "txu";
1106 };
1107 ssi5: ssi-5 {
1108 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1109 dmas = <&audma0 0x0b>, <&audma1 0x0c>,
1110 <&audma0 0x73>, <&audma1 0x74>;
1111 dma-names = "rx", "tx", "rxu", "txu";
1112 };
1113 ssi6: ssi-6 {
1114 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1115 dmas = <&audma0 0x0d>, <&audma1 0x0e>,
1116 <&audma0 0x75>, <&audma1 0x76>;
1117 dma-names = "rx", "tx", "rxu", "txu";
1118 };
1119 ssi7: ssi-7 {
1120 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1121 dmas = <&audma0 0x0f>, <&audma1 0x10>,
1122 <&audma0 0x79>, <&audma1 0x7a>;
1123 dma-names = "rx", "tx", "rxu", "txu";
1124 };
1125 ssi8: ssi-8 {
1126 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1127 dmas = <&audma0 0x11>, <&audma1 0x12>,
1128 <&audma0 0x7b>, <&audma1 0x7c>;
1129 dma-names = "rx", "tx", "rxu", "txu";
1130 };
1131 ssi9: ssi-9 {
1132 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1133 dmas = <&audma0 0x13>, <&audma1 0x14>,
1134 <&audma0 0x7d>, <&audma1 0x7e>;
1135 dma-names = "rx", "tx", "rxu", "txu";
1002 }; 1136 };
1003 }; 1137 };
1004 }; 1138 };
1005 };
1006 1139
1007 can0: can@e6e80000 { 1140 audma0: dma-controller@ec700000 {
1008 compatible = "renesas,can-r8a7793", "renesas,rcar-gen2-can"; 1141 compatible = "renesas,dmac-r8a7793",
1009 reg = <0 0xe6e80000 0 0x1000>; 1142 "renesas,rcar-dmac";
1010 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>; 1143 reg = <0 0xec700000 0 0x10000>;
1011 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7793_CLK_RCAN>, 1144 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1012 <&can_clk>; 1145 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1013 clock-names = "clkp1", "clkp2", "can_clk"; 1146 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1014 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 1147 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1015 resets = <&cpg 916>; 1148 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1016 status = "disabled"; 1149 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1017 }; 1150 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1018 1151 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1019 can1: can@e6e88000 { 1152 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1020 compatible = "renesas,can-r8a7793", "renesas,rcar-gen2-can"; 1153 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1021 reg = <0 0xe6e88000 0 0x1000>; 1154 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1022 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; 1155 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1023 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7793_CLK_RCAN>, 1156 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1024 <&can_clk>; 1157 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1025 clock-names = "clkp1", "clkp2", "can_clk"; 1158 interrupt-names = "error",
1026 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>; 1159 "ch0", "ch1", "ch2", "ch3",
1027 resets = <&cpg 915>; 1160 "ch4", "ch5", "ch6", "ch7",
1028 status = "disabled"; 1161 "ch8", "ch9", "ch10", "ch11",
1029 }; 1162 "ch12";
1030 1163 clocks = <&cpg CPG_MOD 502>;
1031 /* External root clock */ 1164 clock-names = "fck";
1032 extal_clk: extal { 1165 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1033 compatible = "fixed-clock"; 1166 resets = <&cpg 502>;
1034 #clock-cells = <0>; 1167 #dma-cells = <1>;
1035 /* This value must be overridden by the board. */ 1168 dma-channels = <13>;
1036 clock-frequency = <0>; 1169 };
1037 };
1038
1039 /*
1040 * The external audio clocks are configured as 0 Hz fixed frequency
1041 * clocks by default.
1042 * Boards that provide audio clocks should override them.
1043 */
1044 audio_clk_a: audio_clk_a {
1045 compatible = "fixed-clock";
1046 #clock-cells = <0>;
1047 clock-frequency = <0>;
1048 };
1049 audio_clk_b: audio_clk_b {
1050 compatible = "fixed-clock";
1051 #clock-cells = <0>;
1052 clock-frequency = <0>;
1053 };
1054 audio_clk_c: audio_clk_c {
1055 compatible = "fixed-clock";
1056 #clock-cells = <0>;
1057 clock-frequency = <0>;
1058 };
1059
1060 /* External USB clock - can be overridden by the board */
1061 usb_extal_clk: usb_extal {
1062 compatible = "fixed-clock";
1063 #clock-cells = <0>;
1064 clock-frequency = <48000000>;
1065 };
1066 1170
1067 /* External CAN clock */ 1171 audma1: dma-controller@ec720000 {
1068 can_clk: can { 1172 compatible = "renesas,dmac-r8a7793",
1069 compatible = "fixed-clock"; 1173 "renesas,rcar-dmac";
1070 #clock-cells = <0>; 1174 reg = <0 0xec720000 0 0x10000>;
1071 /* This value must be overridden by the board. */ 1175 interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH
1072 clock-frequency = <0>; 1176 GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
1073 }; 1177 GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
1178 GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH
1179 GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
1180 GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
1181 GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
1182 GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
1183 GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
1184 GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
1185 GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
1186 GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
1187 GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
1188 GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
1189 interrupt-names = "error",
1190 "ch0", "ch1", "ch2", "ch3",
1191 "ch4", "ch5", "ch6", "ch7",
1192 "ch8", "ch9", "ch10", "ch11",
1193 "ch12";
1194 clocks = <&cpg CPG_MOD 501>;
1195 clock-names = "fck";
1196 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1197 resets = <&cpg 501>;
1198 #dma-cells = <1>;
1199 dma-channels = <13>;
1200 };
1074 1201
1075 /* External SCIF clock */ 1202 sdhi0: sd@ee100000 {
1076 scif_clk: scif { 1203 compatible = "renesas,sdhi-r8a7793",
1077 compatible = "fixed-clock"; 1204 "renesas,rcar-gen2-sdhi";
1078 #clock-cells = <0>; 1205 reg = <0 0xee100000 0 0x328>;
1079 /* This value must be overridden by the board. */ 1206 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1080 clock-frequency = <0>; 1207 clocks = <&cpg CPG_MOD 314>;
1081 }; 1208 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1209 <&dmac1 0xcd>, <&dmac1 0xce>;
1210 dma-names = "tx", "rx", "tx", "rx";
1211 max-frequency = <195000000>;
1212 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1213 resets = <&cpg 314>;
1214 status = "disabled";
1215 };
1082 1216
1083 /* Special CPG clocks */ 1217 sdhi1: sd@ee140000 {
1084 cpg: clock-controller@e6150000 { 1218 compatible = "renesas,sdhi-r8a7793",
1085 compatible = "renesas,r8a7793-cpg-mssr"; 1219 "renesas,rcar-gen2-sdhi";
1086 reg = <0 0xe6150000 0 0x1000>; 1220 reg = <0 0xee140000 0 0x100>;
1087 clocks = <&extal_clk>, <&usb_extal_clk>; 1221 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1088 clock-names = "extal", "usb_extal"; 1222 clocks = <&cpg CPG_MOD 312>;
1089 #clock-cells = <2>; 1223 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1090 #power-domain-cells = <0>; 1224 <&dmac1 0xc1>, <&dmac1 0xc2>;
1091 #reset-cells = <1>; 1225 dma-names = "tx", "rx", "tx", "rx";
1092 }; 1226 max-frequency = <97500000>;
1227 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1228 resets = <&cpg 312>;
1229 status = "disabled";
1230 };
1093 1231
1094 rst: reset-controller@e6160000 { 1232 sdhi2: sd@ee160000 {
1095 compatible = "renesas,r8a7793-rst"; 1233 compatible = "renesas,sdhi-r8a7793",
1096 reg = <0 0xe6160000 0 0x0100>; 1234 "renesas,rcar-gen2-sdhi";
1097 }; 1235 reg = <0 0xee160000 0 0x100>;
1236 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1237 clocks = <&cpg CPG_MOD 311>;
1238 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1239 <&dmac1 0xd3>, <&dmac1 0xd4>;
1240 dma-names = "tx", "rx", "tx", "rx";
1241 max-frequency = <97500000>;
1242 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1243 resets = <&cpg 311>;
1244 status = "disabled";
1245 };
1098 1246
1099 prr: chipid@ff000044 { 1247 mmcif0: mmc@ee200000 {
1100 compatible = "renesas,prr"; 1248 compatible = "renesas,mmcif-r8a7793",
1101 reg = <0 0xff000044 0 4>; 1249 "renesas,sh-mmcif";
1102 }; 1250 reg = <0 0xee200000 0 0x80>;
1251 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1252 clocks = <&cpg CPG_MOD 315>;
1253 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1254 <&dmac1 0xd1>, <&dmac1 0xd2>;
1255 dma-names = "tx", "rx", "tx", "rx";
1256 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1257 resets = <&cpg 315>;
1258 reg-io-width = <4>;
1259 status = "disabled";
1260 max-frequency = <97500000>;
1261 };
1103 1262
1104 sysc: system-controller@e6180000 { 1263 ether: ethernet@ee700000 {
1105 compatible = "renesas,r8a7793-sysc"; 1264 compatible = "renesas,ether-r8a7793",
1106 reg = <0 0xe6180000 0 0x0200>; 1265 "renesas,rcar-gen2-ether";
1107 #power-domain-cells = <1>; 1266 reg = <0 0xee700000 0 0x400>;
1108 }; 1267 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1268 clocks = <&cpg CPG_MOD 813>;
1269 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1270 resets = <&cpg 813>;
1271 phy-mode = "rmii";
1272 #address-cells = <1>;
1273 #size-cells = <0>;
1274 status = "disabled";
1275 };
1109 1276
1110 ipmmu_sy0: mmu@e6280000 { 1277 gic: interrupt-controller@f1001000 {
1111 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1278 compatible = "arm,gic-400";
1112 reg = <0 0xe6280000 0 0x1000>; 1279 #interrupt-cells = <3>;
1113 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>, 1280 #address-cells = <0>;
1114 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 1281 interrupt-controller;
1115 #iommu-cells = <1>; 1282 reg = <0 0xf1001000 0 0x1000>,
1116 status = "disabled"; 1283 <0 0xf1002000 0 0x2000>,
1117 }; 1284 <0 0xf1004000 0 0x2000>,
1285 <0 0xf1006000 0 0x2000>;
1286 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
1287 clocks = <&cpg CPG_MOD 408>;
1288 clock-names = "clk";
1289 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1290 resets = <&cpg 408>;
1291 };
1118 1292
1119 ipmmu_sy1: mmu@e6290000 { 1293 du: display@feb00000 {
1120 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1294 compatible = "renesas,du-r8a7793";
1121 reg = <0 0xe6290000 0 0x1000>; 1295 reg = <0 0xfeb00000 0 0x40000>,
1122 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 1296 <0 0xfeb90000 0 0x1c>;
1123 #iommu-cells = <1>; 1297 reg-names = "du", "lvds.0";
1124 status = "disabled"; 1298 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1125 }; 1299 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1300 clocks = <&cpg CPG_MOD 724>,
1301 <&cpg CPG_MOD 723>,
1302 <&cpg CPG_MOD 726>;
1303 clock-names = "du.0", "du.1", "lvds.0";
1304 status = "disabled";
1305
1306 ports {
1307 #address-cells = <1>;
1308 #size-cells = <0>;
1309
1310 port@0 {
1311 reg = <0>;
1312 du_out_rgb: endpoint {
1313 };
1314 };
1315 port@1 {
1316 reg = <1>;
1317 du_out_lvds0: endpoint {
1318 };
1319 };
1320 };
1321 };
1126 1322
1127 ipmmu_ds: mmu@e6740000 { 1323 prr: chipid@ff000044 {
1128 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1324 compatible = "renesas,prr";
1129 reg = <0 0xe6740000 0 0x1000>; 1325 reg = <0 0xff000044 0 4>;
1130 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, 1326 };
1131 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
1132 #iommu-cells = <1>;
1133 status = "disabled";
1134 };
1135 1327
1136 ipmmu_mp: mmu@ec680000 { 1328 cmt0: timer@ffca0000 {
1137 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1329 compatible = "renesas,r8a7793-cmt0",
1138 reg = <0 0xec680000 0 0x1000>; 1330 "renesas,rcar-gen2-cmt0";
1139 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>; 1331 reg = <0 0xffca0000 0 0x1004>;
1140 #iommu-cells = <1>; 1332 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1141 status = "disabled"; 1333 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1142 }; 1334 clocks = <&cpg CPG_MOD 124>;
1335 clock-names = "fck";
1336 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1337 resets = <&cpg 124>;
1338
1339 status = "disabled";
1340 };
1143 1341
1144 ipmmu_mx: mmu@fe951000 { 1342 cmt1: timer@e6130000 {
1145 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1343 compatible = "renesas,r8a7793-cmt1",
1146 reg = <0 0xfe951000 0 0x1000>; 1344 "renesas,rcar-gen2-cmt1";
1147 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>, 1345 reg = <0 0xe6130000 0 0x1004>;
1148 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; 1346 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1149 #iommu-cells = <1>; 1347 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1150 status = "disabled"; 1348 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1349 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1350 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1351 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1352 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1353 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1354 clocks = <&cpg CPG_MOD 329>;
1355 clock-names = "fck";
1356 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1357 resets = <&cpg 329>;
1358
1359 status = "disabled";
1360 };
1151 }; 1361 };
1152 1362
1153 ipmmu_rt: mmu@ffc80000 { 1363 thermal-zones {
1154 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; 1364 cpu_thermal: cpu-thermal {
1155 reg = <0 0xffc80000 0 0x1000>; 1365 polling-delay-passive = <0>;
1156 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; 1366 polling-delay = <0>;
1157 #iommu-cells = <1>;
1158 status = "disabled";
1159 };
1160 1367
1161 ipmmu_gp: mmu@e62a0000 { 1368 thermal-sensors = <&thermal>;
1162 compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa";
1163 reg = <0 0xe62a0000 0 0x1000>;
1164 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
1165 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
1166 #iommu-cells = <1>;
1167 status = "disabled";
1168 };
1169 1369
1170 rcar_sound: sound@ec500000 { 1370 trips {
1171 /* 1371 cpu-crit {
1172 * #sound-dai-cells is required 1372 temperature = <95000>;
1173 * 1373 hysteresis = <0>;
1174 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>; 1374 type = "critical";
1175 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>; 1375 };
1176 */
1177 compatible = "renesas,rcar_sound-r8a7793", "renesas,rcar_sound-gen2";
1178 reg = <0 0xec500000 0 0x1000>, /* SCU */
1179 <0 0xec5a0000 0 0x100>, /* ADG */
1180 <0 0xec540000 0 0x1000>, /* SSIU */
1181 <0 0xec541000 0 0x280>, /* SSI */
1182 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
1183 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
1184
1185 clocks = <&cpg CPG_MOD 1005>,
1186 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
1187 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
1188 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
1189 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
1190 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
1191 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
1192 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
1193 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
1194 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
1195 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
1196 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1197 <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>,
1198 <&cpg CPG_CORE R8A7793_CLK_M2>;
1199 clock-names = "ssi-all",
1200 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1201 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
1202 "src.9", "src.8", "src.7", "src.6", "src.5",
1203 "src.4", "src.3", "src.2", "src.1", "src.0",
1204 "dvc.0", "dvc.1",
1205 "clk_a", "clk_b", "clk_c", "clk_i";
1206 power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
1207 resets = <&cpg 1005>,
1208 <&cpg 1006>, <&cpg 1007>, <&cpg 1008>, <&cpg 1009>,
1209 <&cpg 1010>, <&cpg 1011>, <&cpg 1012>, <&cpg 1013>,
1210 <&cpg 1014>, <&cpg 1015>;
1211 reset-names = "ssi-all",
1212 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1213 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0";
1214
1215 status = "disabled";
1216
1217 rcar_sound,dvc {
1218 dvc0: dvc-0 {
1219 dmas = <&audma1 0xbc>;
1220 dma-names = "tx";
1221 }; 1376 };
1222 dvc1: dvc-1 { 1377 cooling-maps {
1223 dmas = <&audma1 0xbe>;
1224 dma-names = "tx";
1225 }; 1378 };
1226 }; 1379 };
1380 };
1227 1381
1228 rcar_sound,src { 1382 timer {
1229 src0: src-0 { 1383 compatible = "arm,armv7-timer";
1230 interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>; 1384 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1231 dmas = <&audma0 0x85>, <&audma1 0x9a>; 1385 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1232 dma-names = "rx", "tx"; 1386 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1233 }; 1387 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
1234 src1: src-1 { 1388 };
1235 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
1236 dmas = <&audma0 0x87>, <&audma1 0x9c>;
1237 dma-names = "rx", "tx";
1238 };
1239 src2: src-2 {
1240 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
1241 dmas = <&audma0 0x89>, <&audma1 0x9e>;
1242 dma-names = "rx", "tx";
1243 };
1244 src3: src-3 {
1245 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
1246 dmas = <&audma0 0x8b>, <&audma1 0xa0>;
1247 dma-names = "rx", "tx";
1248 };
1249 src4: src-4 {
1250 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1251 dmas = <&audma0 0x8d>, <&audma1 0xb0>;
1252 dma-names = "rx", "tx";
1253 };
1254 src5: src-5 {
1255 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1256 dmas = <&audma0 0x8f>, <&audma1 0xb2>;
1257 dma-names = "rx", "tx";
1258 };
1259 src6: src-6 {
1260 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1261 dmas = <&audma0 0x91>, <&audma1 0xb4>;
1262 dma-names = "rx", "tx";
1263 };
1264 src7: src-7 {
1265 interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
1266 dmas = <&audma0 0x93>, <&audma1 0xb6>;
1267 dma-names = "rx", "tx";
1268 };
1269 src8: src-8 {
1270 interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
1271 dmas = <&audma0 0x95>, <&audma1 0xb8>;
1272 dma-names = "rx", "tx";
1273 };
1274 src9: src-9 {
1275 interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
1276 dmas = <&audma0 0x97>, <&audma1 0xba>;
1277 dma-names = "rx", "tx";
1278 };
1279 };
1280 1389
1281 rcar_sound,ssi { 1390 /* External USB clock - can be overridden by the board */
1282 ssi0: ssi-0 { 1391 usb_extal_clk: usb_extal {
1283 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>; 1392 compatible = "fixed-clock";
1284 dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; 1393 #clock-cells = <0>;
1285 dma-names = "rx", "tx", "rxu", "txu"; 1394 clock-frequency = <48000000>;
1286 };
1287 ssi1: ssi-1 {
1288 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1289 dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
1290 dma-names = "rx", "tx", "rxu", "txu";
1291 };
1292 ssi2: ssi-2 {
1293 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1294 dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
1295 dma-names = "rx", "tx", "rxu", "txu";
1296 };
1297 ssi3: ssi-3 {
1298 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1299 dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
1300 dma-names = "rx", "tx", "rxu", "txu";
1301 };
1302 ssi4: ssi-4 {
1303 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1304 dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
1305 dma-names = "rx", "tx", "rxu", "txu";
1306 };
1307 ssi5: ssi-5 {
1308 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1309 dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
1310 dma-names = "rx", "tx", "rxu", "txu";
1311 };
1312 ssi6: ssi-6 {
1313 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1314 dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
1315 dma-names = "rx", "tx", "rxu", "txu";
1316 };
1317 ssi7: ssi-7 {
1318 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1319 dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
1320 dma-names = "rx", "tx", "rxu", "txu";
1321 };
1322 ssi8: ssi-8 {
1323 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1324 dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
1325 dma-names = "rx", "tx", "rxu", "txu";
1326 };
1327 ssi9: ssi-9 {
1328 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1329 dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
1330 dma-names = "rx", "tx", "rxu", "txu";
1331 };
1332 };
1333 }; 1395 };
1334}; 1396};
diff --git a/arch/arm/boot/dts/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
index 60c6515c4996..26a883484ea8 100644
--- a/arch/arm/boot/dts/r8a7794-alt.dts
+++ b/arch/arm/boot/dts/r8a7794-alt.dts
@@ -18,7 +18,9 @@
18 18
19 aliases { 19 aliases {
20 serial0 = &scif2; 20 serial0 = &scif2;
21 i2c9 = &gpioi2c1;
21 i2c10 = &gpioi2c4; 22 i2c10 = &gpioi2c4;
23 i2c11 = &i2chdmi;
22 i2c12 = &i2cexio4; 24 i2c12 = &i2cexio4;
23 }; 25 };
24 26
@@ -138,17 +140,50 @@
138 clock-frequency = <148500000>; 140 clock-frequency = <148500000>;
139 }; 141 };
140 142
143 gpioi2c1: i2c-9 {
144 #address-cells = <1>;
145 #size-cells = <0>;
146 compatible = "i2c-gpio";
147 status = "disabled";
148 scl-gpios = <&gpio4 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
149 sda-gpios = <&gpio4 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
150 };
151
141 gpioi2c4: i2c-10 { 152 gpioi2c4: i2c-10 {
142 #address-cells = <1>; 153 #address-cells = <1>;
143 #size-cells = <0>; 154 #size-cells = <0>;
144 compatible = "i2c-gpio"; 155 compatible = "i2c-gpio";
145 status = "disabled"; 156 status = "disabled";
146 sda-gpios = <&gpio4 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
147 scl-gpios = <&gpio4 8 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 157 scl-gpios = <&gpio4 8 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
158 sda-gpios = <&gpio4 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
148 i2c-gpio,delay-us = <5>; 159 i2c-gpio,delay-us = <5>;
149 }; 160 };
150 161
151 /* 162 /*
163 * A fallback to GPIO is provided for I2C1.
164 */
165 i2chdmi: i2c-11 {
166 compatible = "i2c-demux-pinctrl";
167 i2c-parent = <&i2c1>, <&gpioi2c1>;
168 i2c-bus-name = "i2c-hdmi";
169 #address-cells = <1>;
170 #size-cells = <0>;
171
172 composite-in@20 {
173 compatible = "adi,adv7180";
174 reg = <0x20>;
175 remote = <&vin0>;
176
177 port {
178 adv7180: endpoint {
179 bus-width = <8>;
180 remote-endpoint = <&vin0ep>;
181 };
182 };
183 };
184 };
185
186 /*
152 * I2C4 is routed to EXIO connector B, pins 73 (SCL) + 74 (SDA). 187 * I2C4 is routed to EXIO connector B, pins 73 (SCL) + 74 (SDA).
153 * A fallback to GPIO is provided. 188 * A fallback to GPIO is provided.
154 */ 189 */
@@ -324,23 +359,9 @@
324 359
325&i2c1 { 360&i2c1 {
326 pinctrl-0 = <&i2c1_pins>; 361 pinctrl-0 = <&i2c1_pins>;
327 pinctrl-names = "default"; 362 pinctrl-names = "i2c-hdmi";
328 363
329 status = "okay";
330 clock-frequency = <400000>; 364 clock-frequency = <400000>;
331
332 composite-in@20 {
333 compatible = "adi,adv7180";
334 reg = <0x20>;
335 remote = <&vin0>;
336
337 port {
338 adv7180: endpoint {
339 bus-width = <8>;
340 remote-endpoint = <&vin0ep>;
341 };
342 };
343 };
344}; 365};
345 366
346&i2c4 { 367&i2c4 {
diff --git a/arch/arm/boot/dts/r8a7794-silk.dts b/arch/arm/boot/dts/r8a7794-silk.dts
index edfad0e5ac53..351cb3b3d966 100644
--- a/arch/arm/boot/dts/r8a7794-silk.dts
+++ b/arch/arm/boot/dts/r8a7794-silk.dts
@@ -24,6 +24,7 @@
24/dts-v1/; 24/dts-v1/;
25#include "r8a7794.dtsi" 25#include "r8a7794.dtsi"
26#include <dt-bindings/gpio/gpio.h> 26#include <dt-bindings/gpio/gpio.h>
27#include <dt-bindings/input/input.h>
27 28
28/ { 29/ {
29 model = "SILK"; 30 model = "SILK";
@@ -31,6 +32,8 @@
31 32
32 aliases { 33 aliases {
33 serial0 = &scif2; 34 serial0 = &scif2;
35 i2c9 = &gpioi2c1;
36 i2c10 = &i2chdmi;
34 }; 37 };
35 38
36 chosen { 39 chosen {
@@ -43,6 +46,60 @@
43 reg = <0 0x40000000 0 0x40000000>; 46 reg = <0 0x40000000 0 0x40000000>;
44 }; 47 };
45 48
49 gpio-keys {
50 compatible = "gpio-keys";
51
52 key-3 {
53 gpios = <&gpio5 10 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_3>;
55 label = "SW3";
56 wakeup-source;
57 debounce-interval = <20>;
58 };
59 key-4 {
60 gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_4>;
62 label = "SW4";
63 wakeup-source;
64 debounce-interval = <20>;
65 };
66 key-6 {
67 gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
68 linux,code = <KEY_6>;
69 label = "SW6";
70 wakeup-source;
71 debounce-interval = <20>;
72 };
73 key-a {
74 gpios = <&gpio3 9 GPIO_ACTIVE_LOW>;
75 linux,code = <KEY_A>;
76 label = "SW12-1";
77 wakeup-source;
78 debounce-interval = <20>;
79 };
80 key-b {
81 gpios = <&gpio3 10 GPIO_ACTIVE_LOW>;
82 linux,code = <KEY_B>;
83 label = "SW12-2";
84 wakeup-source;
85 debounce-interval = <20>;
86 };
87 key-c {
88 gpios = <&gpio3 11 GPIO_ACTIVE_LOW>;
89 linux,code = <KEY_C>;
90 label = "SW12-3";
91 wakeup-source;
92 debounce-interval = <20>;
93 };
94 key-d {
95 gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
96 linux,code = <KEY_D>;
97 label = "SW12-4";
98 wakeup-source;
99 debounce-interval = <20>;
100 };
101 };
102
46 d3_3v: regulator-d3-3v { 103 d3_3v: regulator-d3-3v {
47 compatible = "regulator-fixed"; 104 compatible = "regulator-fixed";
48 regulator-name = "D3.3V"; 105 regulator-name = "D3.3V";
@@ -153,6 +210,84 @@
153 clocks = <&x9_clk>; 210 clocks = <&x9_clk>;
154 }; 211 };
155 }; 212 };
213
214 gpioi2c1: i2c-9 {
215 #address-cells = <1>;
216 #size-cells = <0>;
217 compatible = "i2c-gpio";
218 status = "disabled";
219 scl-gpios = <&gpio4 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
220 sda-gpios = <&gpio4 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
221 i2c-gpio,delay-us = <5>;
222 };
223
224 /*
225 * A fallback to GPIO is provided for I2C1.
226 */
227 i2chdmi: i2c-10 {
228 compatible = "i2c-demux-pinctrl";
229 i2c-parent = <&i2c1>, <&gpioi2c1>;
230 i2c-bus-name = "i2c-hdmi";
231 #address-cells = <1>;
232 #size-cells = <0>;
233
234 ak4643: codec@12 {
235 compatible = "asahi-kasei,ak4643";
236 #sound-dai-cells = <0>;
237 reg = <0x12>;
238 };
239
240 composite-in@20 {
241 compatible = "adi,adv7180";
242 reg = <0x20>;
243 remote = <&vin0>;
244
245 port {
246 adv7180: endpoint {
247 bus-width = <8>;
248 remote-endpoint = <&vin0ep>;
249 };
250 };
251 };
252
253 hdmi@39 {
254 compatible = "adi,adv7511w";
255 reg = <0x39>;
256 interrupt-parent = <&gpio5>;
257 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
258
259 adi,input-depth = <8>;
260 adi,input-colorspace = "rgb";
261 adi,input-clock = "1x";
262 adi,input-style = <1>;
263 adi,input-justification = "evenly";
264
265 ports {
266 #address-cells = <1>;
267 #size-cells = <0>;
268
269 port@0 {
270 reg = <0>;
271 adv7511_in: endpoint {
272 remote-endpoint = <&du_out_rgb0>;
273 };
274 };
275
276 port@1 {
277 reg = <1>;
278 adv7511_out: endpoint {
279 remote-endpoint = <&hdmi_con>;
280 };
281 };
282 };
283 };
284
285 eeprom@50 {
286 compatible = "renesas,r1ex24002", "atmel,24c02";
287 reg = <0x50>;
288 pagesize = <16>;
289 };
290 };
156}; 291};
157 292
158&extal_clk { 293&extal_clk {
@@ -268,61 +403,9 @@
268 403
269&i2c1 { 404&i2c1 {
270 pinctrl-0 = <&i2c1_pins>; 405 pinctrl-0 = <&i2c1_pins>;
271 pinctrl-names = "default"; 406 pinctrl-names = "i2c-hdmi";
272 407
273 status = "okay";
274 clock-frequency = <400000>; 408 clock-frequency = <400000>;
275
276 ak4643: codec@12 {
277 compatible = "asahi-kasei,ak4643";
278 #sound-dai-cells = <0>;
279 reg = <0x12>;
280 };
281
282 composite-in@20 {
283 compatible = "adi,adv7180";
284 reg = <0x20>;
285 remote = <&vin0>;
286
287 port {
288 adv7180: endpoint {
289 bus-width = <8>;
290 remote-endpoint = <&vin0ep>;
291 };
292 };
293 };
294
295 hdmi@39 {
296 compatible = "adi,adv7511w";
297 reg = <0x39>;
298 interrupt-parent = <&gpio5>;
299 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
300
301 adi,input-depth = <8>;
302 adi,input-colorspace = "rgb";
303 adi,input-clock = "1x";
304 adi,input-style = <1>;
305 adi,input-justification = "evenly";
306
307 ports {
308 #address-cells = <1>;
309 #size-cells = <0>;
310
311 port@0 {
312 reg = <0>;
313 adv7511_in: endpoint {
314 remote-endpoint = <&du_out_rgb0>;
315 };
316 };
317
318 port@1 {
319 reg = <1>;
320 adv7511_out: endpoint {
321 remote-endpoint = <&hdmi_con>;
322 };
323 };
324 };
325 };
326}; 409};
327 410
328&mmcif0 { 411&mmcif0 {
diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index 106b4e1649ff..d588efa6aeaa 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -16,7 +16,6 @@
16 16
17/ { 17/ {
18 compatible = "renesas,r8a7794"; 18 compatible = "renesas,r8a7794";
19 interrupt-parent = <&gic>;
20 #address-cells = <2>; 19 #address-cells = <2>;
21 #size-cells = <2>; 20 #size-cells = <2>;
22 21
@@ -34,6 +33,35 @@
34 vin1 = &vin1; 33 vin1 = &vin1;
35 }; 34 };
36 35
36 /*
37 * The external audio clocks are configured as 0 Hz fixed frequency
38 * clocks by default.
39 * Boards that provide audio clocks should override them.
40 */
41 audio_clka: audio_clka {
42 compatible = "fixed-clock";
43 #clock-cells = <0>;
44 clock-frequency = <0>;
45 };
46 audio_clkb: audio_clkb {
47 compatible = "fixed-clock";
48 #clock-cells = <0>;
49 clock-frequency = <0>;
50 };
51 audio_clkc: audio_clkc {
52 compatible = "fixed-clock";
53 #clock-cells = <0>;
54 clock-frequency = <0>;
55 };
56
57 /* External CAN clock */
58 can_clk: can {
59 compatible = "fixed-clock";
60 #clock-cells = <0>;
61 /* This value must be overridden by the board. */
62 clock-frequency = <0>;
63 };
64
37 cpus { 65 cpus {
38 #address-cells = <1>; 66 #address-cells = <1>;
39 #size-cells = <0>; 67 #size-cells = <0>;
@@ -67,1290 +95,1313 @@
67 }; 95 };
68 }; 96 };
69 97
70 apmu@e6151000 { 98 /* External root clock */
71 compatible = "renesas,r8a7794-apmu", "renesas,apmu"; 99 extal_clk: extal {
72 reg = <0 0xe6151000 0 0x188>; 100 compatible = "fixed-clock";
73 cpus = <&cpu0 &cpu1>; 101 #clock-cells = <0>;
74 }; 102 /* This value must be overridden by the board. */
75 103 clock-frequency = <0>;
76 gic: interrupt-controller@f1001000 {
77 compatible = "arm,gic-400";
78 #interrupt-cells = <3>;
79 #address-cells = <0>;
80 interrupt-controller;
81 reg = <0 0xf1001000 0 0x1000>,
82 <0 0xf1002000 0 0x2000>,
83 <0 0xf1004000 0 0x2000>,
84 <0 0xf1006000 0 0x2000>;
85 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
86 clocks = <&cpg CPG_MOD 408>;
87 clock-names = "clk";
88 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
89 resets = <&cpg 408>;
90 }; 104 };
91 105
92 gpio0: gpio@e6050000 { 106 /* External SCIF clock */
93 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 107 scif_clk: scif {
94 reg = <0 0xe6050000 0 0x50>; 108 compatible = "fixed-clock";
95 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; 109 #clock-cells = <0>;
96 #gpio-cells = <2>; 110 /* This value must be overridden by the board. */
97 gpio-controller; 111 clock-frequency = <0>;
98 gpio-ranges = <&pfc 0 0 32>;
99 #interrupt-cells = <2>;
100 interrupt-controller;
101 clocks = <&cpg CPG_MOD 912>;
102 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
103 resets = <&cpg 912>;
104 }; 112 };
105 113
106 gpio1: gpio@e6051000 { 114 soc {
107 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 115 compatible = "simple-bus";
108 reg = <0 0xe6051000 0 0x50>; 116 interrupt-parent = <&gic>;
109 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
110 #gpio-cells = <2>;
111 gpio-controller;
112 gpio-ranges = <&pfc 0 32 26>;
113 #interrupt-cells = <2>;
114 interrupt-controller;
115 clocks = <&cpg CPG_MOD 911>;
116 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
117 resets = <&cpg 911>;
118 };
119 117
120 gpio2: gpio@e6052000 { 118 #address-cells = <2>;
121 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 119 #size-cells = <2>;
122 reg = <0 0xe6052000 0 0x50>; 120 ranges;
123 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; 121
124 #gpio-cells = <2>; 122 gpio0: gpio@e6050000 {
125 gpio-controller; 123 compatible = "renesas,gpio-r8a7794",
126 gpio-ranges = <&pfc 0 64 32>; 124 "renesas,rcar-gen2-gpio";
127 #interrupt-cells = <2>; 125 reg = <0 0xe6050000 0 0x50>;
128 interrupt-controller; 126 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
129 clocks = <&cpg CPG_MOD 910>; 127 #gpio-cells = <2>;
130 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 128 gpio-controller;
131 resets = <&cpg 910>; 129 gpio-ranges = <&pfc 0 0 32>;
132 }; 130 #interrupt-cells = <2>;
131 interrupt-controller;
132 clocks = <&cpg CPG_MOD 912>;
133 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
134 resets = <&cpg 912>;
135 };
133 136
134 gpio3: gpio@e6053000 { 137 gpio1: gpio@e6051000 {
135 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 138 compatible = "renesas,gpio-r8a7794",
136 reg = <0 0xe6053000 0 0x50>; 139 "renesas,rcar-gen2-gpio";
137 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 140 reg = <0 0xe6051000 0 0x50>;
138 #gpio-cells = <2>; 141 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
139 gpio-controller; 142 #gpio-cells = <2>;
140 gpio-ranges = <&pfc 0 96 32>; 143 gpio-controller;
141 #interrupt-cells = <2>; 144 gpio-ranges = <&pfc 0 32 26>;
142 interrupt-controller; 145 #interrupt-cells = <2>;
143 clocks = <&cpg CPG_MOD 909>; 146 interrupt-controller;
144 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 147 clocks = <&cpg CPG_MOD 911>;
145 resets = <&cpg 909>; 148 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
146 }; 149 resets = <&cpg 911>;
150 };
147 151
148 gpio4: gpio@e6054000 { 152 gpio2: gpio@e6052000 {
149 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 153 compatible = "renesas,gpio-r8a7794",
150 reg = <0 0xe6054000 0 0x50>; 154 "renesas,rcar-gen2-gpio";
151 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; 155 reg = <0 0xe6052000 0 0x50>;
152 #gpio-cells = <2>; 156 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
153 gpio-controller; 157 #gpio-cells = <2>;
154 gpio-ranges = <&pfc 0 128 32>; 158 gpio-controller;
155 #interrupt-cells = <2>; 159 gpio-ranges = <&pfc 0 64 32>;
156 interrupt-controller; 160 #interrupt-cells = <2>;
157 clocks = <&cpg CPG_MOD 908>; 161 interrupt-controller;
158 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 162 clocks = <&cpg CPG_MOD 910>;
159 resets = <&cpg 908>; 163 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
160 }; 164 resets = <&cpg 910>;
165 };
161 166
162 gpio5: gpio@e6055000 { 167 gpio3: gpio@e6053000 {
163 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 168 compatible = "renesas,gpio-r8a7794",
164 reg = <0 0xe6055000 0 0x50>; 169 "renesas,rcar-gen2-gpio";
165 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; 170 reg = <0 0xe6053000 0 0x50>;
166 #gpio-cells = <2>; 171 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
167 gpio-controller; 172 #gpio-cells = <2>;
168 gpio-ranges = <&pfc 0 160 28>; 173 gpio-controller;
169 #interrupt-cells = <2>; 174 gpio-ranges = <&pfc 0 96 32>;
170 interrupt-controller; 175 #interrupt-cells = <2>;
171 clocks = <&cpg CPG_MOD 907>; 176 interrupt-controller;
172 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 177 clocks = <&cpg CPG_MOD 909>;
173 resets = <&cpg 907>; 178 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
174 }; 179 resets = <&cpg 909>;
180 };
175 181
176 gpio6: gpio@e6055400 { 182 gpio4: gpio@e6054000 {
177 compatible = "renesas,gpio-r8a7794", "renesas,rcar-gen2-gpio"; 183 compatible = "renesas,gpio-r8a7794",
178 reg = <0 0xe6055400 0 0x50>; 184 "renesas,rcar-gen2-gpio";
179 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; 185 reg = <0 0xe6054000 0 0x50>;
180 #gpio-cells = <2>; 186 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
181 gpio-controller; 187 #gpio-cells = <2>;
182 gpio-ranges = <&pfc 0 192 26>; 188 gpio-controller;
183 #interrupt-cells = <2>; 189 gpio-ranges = <&pfc 0 128 32>;
184 interrupt-controller; 190 #interrupt-cells = <2>;
185 clocks = <&cpg CPG_MOD 905>; 191 interrupt-controller;
186 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 192 clocks = <&cpg CPG_MOD 908>;
187 resets = <&cpg 905>; 193 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
188 }; 194 resets = <&cpg 908>;
195 };
189 196
190 cmt0: timer@ffca0000 { 197 gpio5: gpio@e6055000 {
191 compatible = "renesas,r8a7794-cmt0", "renesas,rcar-gen2-cmt0"; 198 compatible = "renesas,gpio-r8a7794",
192 reg = <0 0xffca0000 0 0x1004>; 199 "renesas,rcar-gen2-gpio";
193 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>, 200 reg = <0 0xe6055000 0 0x50>;
194 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 201 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
195 clocks = <&cpg CPG_MOD 124>; 202 #gpio-cells = <2>;
196 clock-names = "fck"; 203 gpio-controller;
197 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 204 gpio-ranges = <&pfc 0 160 28>;
198 resets = <&cpg 124>; 205 #interrupt-cells = <2>;
199 206 interrupt-controller;
200 status = "disabled"; 207 clocks = <&cpg CPG_MOD 907>;
201 }; 208 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
209 resets = <&cpg 907>;
210 };
202 211
203 cmt1: timer@e6130000 { 212 gpio6: gpio@e6055400 {
204 compatible = "renesas,r8a7794-cmt1", "renesas,rcar-gen2-cmt1"; 213 compatible = "renesas,gpio-r8a7794",
205 reg = <0 0xe6130000 0 0x1004>; 214 "renesas,rcar-gen2-gpio";
206 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, 215 reg = <0 0xe6055400 0 0x50>;
207 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 216 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
208 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 217 #gpio-cells = <2>;
209 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 218 gpio-controller;
210 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, 219 gpio-ranges = <&pfc 0 192 26>;
211 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, 220 #interrupt-cells = <2>;
212 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, 221 interrupt-controller;
213 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; 222 clocks = <&cpg CPG_MOD 905>;
214 clocks = <&cpg CPG_MOD 329>; 223 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
215 clock-names = "fck"; 224 resets = <&cpg 905>;
216 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 225 };
217 resets = <&cpg 329>;
218
219 status = "disabled";
220 };
221 226
222 timer { 227 pfc: pin-controller@e6060000 {
223 compatible = "arm,armv7-timer"; 228 compatible = "renesas,pfc-r8a7794";
224 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 229 reg = <0 0xe6060000 0 0x11c>;
225 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, 230 };
226 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
227 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
228 };
229 231
230 irqc0: interrupt-controller@e61c0000 { 232 cpg: clock-controller@e6150000 {
231 compatible = "renesas,irqc-r8a7794", "renesas,irqc"; 233 compatible = "renesas,r8a7794-cpg-mssr";
232 #interrupt-cells = <2>; 234 reg = <0 0xe6150000 0 0x1000>;
233 interrupt-controller; 235 clocks = <&extal_clk>, <&usb_extal_clk>;
234 reg = <0 0xe61c0000 0 0x200>; 236 clock-names = "extal", "usb_extal";
235 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 237 #clock-cells = <2>;
236 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 238 #power-domain-cells = <0>;
237 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 239 #reset-cells = <1>;
238 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 240 };
239 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
240 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
241 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
242 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
243 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
244 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
245 clocks = <&cpg CPG_MOD 407>;
246 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
247 resets = <&cpg 407>;
248 };
249 241
250 pfc: pin-controller@e6060000 { 242 apmu@e6151000 {
251 compatible = "renesas,pfc-r8a7794"; 243 compatible = "renesas,r8a7794-apmu", "renesas,apmu";
252 reg = <0 0xe6060000 0 0x11c>; 244 reg = <0 0xe6151000 0 0x188>;
253 }; 245 cpus = <&cpu0 &cpu1>;
246 };
254 247
255 dmac0: dma-controller@e6700000 { 248 rst: reset-controller@e6160000 {
256 compatible = "renesas,dmac-r8a7794", "renesas,rcar-dmac"; 249 compatible = "renesas,r8a7794-rst";
257 reg = <0 0xe6700000 0 0x20000>; 250 reg = <0 0xe6160000 0 0x0100>;
258 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH 251 };
259 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
260 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
261 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
262 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
263 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
264 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
265 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
266 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
267 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
268 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
269 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
270 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
271 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
272 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
273 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
274 interrupt-names = "error",
275 "ch0", "ch1", "ch2", "ch3",
276 "ch4", "ch5", "ch6", "ch7",
277 "ch8", "ch9", "ch10", "ch11",
278 "ch12", "ch13", "ch14";
279 clocks = <&cpg CPG_MOD 219>;
280 clock-names = "fck";
281 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
282 resets = <&cpg 219>;
283 #dma-cells = <1>;
284 dma-channels = <15>;
285 };
286 252
287 dmac1: dma-controller@e6720000 { 253 sysc: system-controller@e6180000 {
288 compatible = "renesas,dmac-r8a7794", "renesas,rcar-dmac"; 254 compatible = "renesas,r8a7794-sysc";
289 reg = <0 0xe6720000 0 0x20000>; 255 reg = <0 0xe6180000 0 0x0200>;
290 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH 256 #power-domain-cells = <1>;
291 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH 257 };
292 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
293 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
294 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
295 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
296 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
297 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
298 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
299 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
300 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
301 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
302 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
303 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
304 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
305 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
306 interrupt-names = "error",
307 "ch0", "ch1", "ch2", "ch3",
308 "ch4", "ch5", "ch6", "ch7",
309 "ch8", "ch9", "ch10", "ch11",
310 "ch12", "ch13", "ch14";
311 clocks = <&cpg CPG_MOD 218>;
312 clock-names = "fck";
313 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
314 resets = <&cpg 218>;
315 #dma-cells = <1>;
316 dma-channels = <15>;
317 };
318 258
319 audma0: dma-controller@ec700000 { 259 irqc0: interrupt-controller@e61c0000 {
320 compatible = "renesas,dmac-r8a7794", "renesas,rcar-dmac"; 260 compatible = "renesas,irqc-r8a7794", "renesas,irqc";
321 reg = <0 0xec700000 0 0x10000>; 261 #interrupt-cells = <2>;
322 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH 262 interrupt-controller;
323 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH 263 reg = <0 0xe61c0000 0 0x200>;
324 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH 264 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
325 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH 265 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
326 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH 266 <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
327 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH 267 <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
328 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH 268 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
329 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH 269 <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
330 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH 270 <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
331 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH 271 <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
332 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH 272 <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
333 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH 273 <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
334 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH 274 clocks = <&cpg CPG_MOD 407>;
335 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>; 275 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
336 interrupt-names = "error", 276 resets = <&cpg 407>;
337 "ch0", "ch1", "ch2", "ch3", "ch4", "ch5", 277 };
338 "ch6", "ch7", "ch8", "ch9", "ch10", "ch11",
339 "ch12";
340 clocks = <&cpg CPG_MOD 502>;
341 clock-names = "fck";
342 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
343 resets = <&cpg 502>;
344 #dma-cells = <1>;
345 dma-channels = <13>;
346 };
347 278
348 scifa0: serial@e6c40000 { 279 ipmmu_sy0: mmu@e6280000 {
349 compatible = "renesas,scifa-r8a7794", 280 compatible = "renesas,ipmmu-r8a7794",
350 "renesas,rcar-gen2-scifa", "renesas,scifa"; 281 "renesas,ipmmu-vmsa";
351 reg = <0 0xe6c40000 0 64>; 282 reg = <0 0xe6280000 0 0x1000>;
352 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 283 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>,
353 clocks = <&cpg CPG_MOD 204>; 284 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
354 clock-names = "fck"; 285 #iommu-cells = <1>;
355 dmas = <&dmac0 0x21>, <&dmac0 0x22>, 286 status = "disabled";
356 <&dmac1 0x21>, <&dmac1 0x22>; 287 };
357 dma-names = "tx", "rx", "tx", "rx";
358 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
359 resets = <&cpg 204>;
360 status = "disabled";
361 };
362 288
363 scifa1: serial@e6c50000 { 289 ipmmu_sy1: mmu@e6290000 {
364 compatible = "renesas,scifa-r8a7794", 290 compatible = "renesas,ipmmu-r8a7794",
365 "renesas,rcar-gen2-scifa", "renesas,scifa"; 291 "renesas,ipmmu-vmsa";
366 reg = <0 0xe6c50000 0 64>; 292 reg = <0 0xe6290000 0 0x1000>;
367 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; 293 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
368 clocks = <&cpg CPG_MOD 203>; 294 #iommu-cells = <1>;
369 clock-names = "fck"; 295 status = "disabled";
370 dmas = <&dmac0 0x25>, <&dmac0 0x26>, 296 };
371 <&dmac1 0x25>, <&dmac1 0x26>;
372 dma-names = "tx", "rx", "tx", "rx";
373 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
374 resets = <&cpg 203>;
375 status = "disabled";
376 };
377 297
378 scifa2: serial@e6c60000 { 298 ipmmu_ds: mmu@e6740000 {
379 compatible = "renesas,scifa-r8a7794", 299 compatible = "renesas,ipmmu-r8a7794",
380 "renesas,rcar-gen2-scifa", "renesas,scifa"; 300 "renesas,ipmmu-vmsa";
381 reg = <0 0xe6c60000 0 64>; 301 reg = <0 0xe6740000 0 0x1000>;
382 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; 302 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
383 clocks = <&cpg CPG_MOD 202>; 303 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
384 clock-names = "fck"; 304 #iommu-cells = <1>;
385 dmas = <&dmac0 0x27>, <&dmac0 0x28>, 305 status = "disabled";
386 <&dmac1 0x27>, <&dmac1 0x28>; 306 };
387 dma-names = "tx", "rx", "tx", "rx";
388 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
389 resets = <&cpg 202>;
390 status = "disabled";
391 };
392 307
393 scifa3: serial@e6c70000 { 308 ipmmu_mp: mmu@ec680000 {
394 compatible = "renesas,scifa-r8a7794", 309 compatible = "renesas,ipmmu-r8a7794",
395 "renesas,rcar-gen2-scifa", "renesas,scifa"; 310 "renesas,ipmmu-vmsa";
396 reg = <0 0xe6c70000 0 64>; 311 reg = <0 0xec680000 0 0x1000>;
397 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; 312 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
398 clocks = <&cpg CPG_MOD 1106>; 313 #iommu-cells = <1>;
399 clock-names = "fck"; 314 status = "disabled";
400 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>, 315 };
401 <&dmac1 0x1b>, <&dmac1 0x1c>;
402 dma-names = "tx", "rx", "tx", "rx";
403 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
404 resets = <&cpg 1106>;
405 status = "disabled";
406 };
407 316
408 scifa4: serial@e6c78000 { 317 ipmmu_mx: mmu@fe951000 {
409 compatible = "renesas,scifa-r8a7794", 318 compatible = "renesas,ipmmu-r8a7794",
410 "renesas,rcar-gen2-scifa", "renesas,scifa"; 319 "renesas,ipmmu-vmsa";
411 reg = <0 0xe6c78000 0 64>; 320 reg = <0 0xfe951000 0 0x1000>;
412 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; 321 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>,
413 clocks = <&cpg CPG_MOD 1107>; 322 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
414 clock-names = "fck"; 323 #iommu-cells = <1>;
415 dmas = <&dmac0 0x1f>, <&dmac0 0x20>, 324 status = "disabled";
416 <&dmac1 0x1f>, <&dmac1 0x20>; 325 };
417 dma-names = "tx", "rx", "tx", "rx";
418 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
419 resets = <&cpg 1107>;
420 status = "disabled";
421 };
422 326
423 scifa5: serial@e6c80000 { 327 ipmmu_gp: mmu@e62a0000 {
424 compatible = "renesas,scifa-r8a7794", 328 compatible = "renesas,ipmmu-r8a7794",
425 "renesas,rcar-gen2-scifa", "renesas,scifa"; 329 "renesas,ipmmu-vmsa";
426 reg = <0 0xe6c80000 0 64>; 330 reg = <0 0xe62a0000 0 0x1000>;
427 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 331 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
428 clocks = <&cpg CPG_MOD 1108>; 332 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
429 clock-names = "fck"; 333 #iommu-cells = <1>;
430 dmas = <&dmac0 0x23>, <&dmac0 0x24>, 334 status = "disabled";
431 <&dmac1 0x23>, <&dmac1 0x24>; 335 };
432 dma-names = "tx", "rx", "tx", "rx";
433 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
434 resets = <&cpg 1108>;
435 status = "disabled";
436 };
437 336
438 scifb0: serial@e6c20000 { 337 icram0: sram@e63a0000 {
439 compatible = "renesas,scifb-r8a7794", 338 compatible = "mmio-sram";
440 "renesas,rcar-gen2-scifb", "renesas,scifb"; 339 reg = <0 0xe63a0000 0 0x12000>;
441 reg = <0 0xe6c20000 0 0x100>; 340 };
442 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
443 clocks = <&cpg CPG_MOD 206>;
444 clock-names = "fck";
445 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>,
446 <&dmac1 0x3d>, <&dmac1 0x3e>;
447 dma-names = "tx", "rx", "tx", "rx";
448 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
449 resets = <&cpg 206>;
450 status = "disabled";
451 };
452 341
453 scifb1: serial@e6c30000 { 342 icram1: sram@e63c0000 {
454 compatible = "renesas,scifb-r8a7794", 343 compatible = "mmio-sram";
455 "renesas,rcar-gen2-scifb", "renesas,scifb"; 344 reg = <0 0xe63c0000 0 0x1000>;
456 reg = <0 0xe6c30000 0 0x100>; 345 #address-cells = <1>;
457 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>; 346 #size-cells = <1>;
458 clocks = <&cpg CPG_MOD 207>; 347 ranges = <0 0 0xe63c0000 0x1000>;
459 clock-names = "fck";
460 dmas = <&dmac0 0x19>, <&dmac0 0x1a>,
461 <&dmac1 0x19>, <&dmac1 0x1a>;
462 dma-names = "tx", "rx", "tx", "rx";
463 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
464 resets = <&cpg 207>;
465 status = "disabled";
466 };
467 348
468 scifb2: serial@e6ce0000 { 349 smp-sram@0 {
469 compatible = "renesas,scifb-r8a7794", 350 compatible = "renesas,smp-sram";
470 "renesas,rcar-gen2-scifb", "renesas,scifb"; 351 reg = <0 0x10>;
471 reg = <0 0xe6ce0000 0 0x100>; 352 };
472 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>; 353 };
473 clocks = <&cpg CPG_MOD 216>;
474 clock-names = "fck";
475 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>,
476 <&dmac1 0x1d>, <&dmac1 0x1e>;
477 dma-names = "tx", "rx", "tx", "rx";
478 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
479 resets = <&cpg 216>;
480 status = "disabled";
481 };
482 354
483 scif0: serial@e6e60000 { 355 /* The memory map in the User's Manual maps the cores to
484 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 356 * bus numbers
485 "renesas,scif"; 357 */
486 reg = <0 0xe6e60000 0 64>; 358 i2c0: i2c@e6508000 {
487 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>; 359 compatible = "renesas,i2c-r8a7794",
488 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 360 "renesas,rcar-gen2-i2c";
489 <&scif_clk>; 361 reg = <0 0xe6508000 0 0x40>;
490 clock-names = "fck", "brg_int", "scif_clk"; 362 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
491 dmas = <&dmac0 0x29>, <&dmac0 0x2a>, 363 clocks = <&cpg CPG_MOD 931>;
492 <&dmac1 0x29>, <&dmac1 0x2a>; 364 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
493 dma-names = "tx", "rx", "tx", "rx"; 365 resets = <&cpg 931>;
494 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 366 #address-cells = <1>;
495 resets = <&cpg 721>; 367 #size-cells = <0>;
496 status = "disabled"; 368 i2c-scl-internal-delay-ns = <6>;
497 }; 369 status = "disabled";
370 };
498 371
499 scif1: serial@e6e68000 { 372 i2c1: i2c@e6518000 {
500 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 373 compatible = "renesas,i2c-r8a7794",
501 "renesas,scif"; 374 "renesas,rcar-gen2-i2c";
502 reg = <0 0xe6e68000 0 64>; 375 reg = <0 0xe6518000 0 0x40>;
503 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>; 376 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
504 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 377 clocks = <&cpg CPG_MOD 930>;
505 <&scif_clk>; 378 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
506 clock-names = "fck", "brg_int", "scif_clk"; 379 resets = <&cpg 930>;
507 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>, 380 #address-cells = <1>;
508 <&dmac1 0x2d>, <&dmac1 0x2e>; 381 #size-cells = <0>;
509 dma-names = "tx", "rx", "tx", "rx"; 382 i2c-scl-internal-delay-ns = <6>;
510 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 383 status = "disabled";
511 resets = <&cpg 720>; 384 };
512 status = "disabled";
513 };
514 385
515 scif2: serial@e6e58000 { 386 i2c2: i2c@e6530000 {
516 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 387 compatible = "renesas,i2c-r8a7794",
517 "renesas,scif"; 388 "renesas,rcar-gen2-i2c";
518 reg = <0 0xe6e58000 0 64>; 389 reg = <0 0xe6530000 0 0x40>;
519 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; 390 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
520 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 391 clocks = <&cpg CPG_MOD 929>;
521 <&scif_clk>; 392 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
522 clock-names = "fck", "brg_int", "scif_clk"; 393 resets = <&cpg 929>;
523 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>, 394 #address-cells = <1>;
524 <&dmac1 0x2b>, <&dmac1 0x2c>; 395 #size-cells = <0>;
525 dma-names = "tx", "rx", "tx", "rx"; 396 i2c-scl-internal-delay-ns = <6>;
526 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 397 status = "disabled";
527 resets = <&cpg 719>; 398 };
528 status = "disabled";
529 };
530 399
531 scif3: serial@e6ea8000 { 400 i2c3: i2c@e6540000 {
532 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 401 compatible = "renesas,i2c-r8a7794",
533 "renesas,scif"; 402 "renesas,rcar-gen2-i2c";
534 reg = <0 0xe6ea8000 0 64>; 403 reg = <0 0xe6540000 0 0x40>;
535 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 404 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
536 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 405 clocks = <&cpg CPG_MOD 928>;
537 <&scif_clk>; 406 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
538 clock-names = "fck", "brg_int", "scif_clk"; 407 resets = <&cpg 928>;
539 dmas = <&dmac0 0x2f>, <&dmac0 0x30>, 408 #address-cells = <1>;
540 <&dmac1 0x2f>, <&dmac1 0x30>; 409 #size-cells = <0>;
541 dma-names = "tx", "rx", "tx", "rx"; 410 i2c-scl-internal-delay-ns = <6>;
542 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 411 status = "disabled";
543 resets = <&cpg 718>; 412 };
544 status = "disabled";
545 };
546 413
547 scif4: serial@e6ee0000 { 414 i2c4: i2c@e6520000 {
548 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 415 compatible = "renesas,i2c-r8a7794",
549 "renesas,scif"; 416 "renesas,rcar-gen2-i2c";
550 reg = <0 0xe6ee0000 0 64>; 417 reg = <0 0xe6520000 0 0x40>;
551 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 418 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
552 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 419 clocks = <&cpg CPG_MOD 927>;
553 <&scif_clk>; 420 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
554 clock-names = "fck", "brg_int", "scif_clk"; 421 resets = <&cpg 927>;
555 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>, 422 #address-cells = <1>;
556 <&dmac1 0xfb>, <&dmac1 0xfc>; 423 #size-cells = <0>;
557 dma-names = "tx", "rx", "tx", "rx"; 424 i2c-scl-internal-delay-ns = <6>;
558 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 425 status = "disabled";
559 resets = <&cpg 715>; 426 };
560 status = "disabled";
561 };
562 427
563 scif5: serial@e6ee8000 { 428 i2c5: i2c@e6528000 {
564 compatible = "renesas,scif-r8a7794", "renesas,rcar-gen2-scif", 429 compatible = "renesas,i2c-r8a7794",
565 "renesas,scif"; 430 "renesas,rcar-gen2-i2c";
566 reg = <0 0xe6ee8000 0 64>; 431 reg = <0 0xe6528000 0 0x40>;
567 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; 432 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
568 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 433 clocks = <&cpg CPG_MOD 925>;
569 <&scif_clk>; 434 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
570 clock-names = "fck", "brg_int", "scif_clk"; 435 resets = <&cpg 925>;
571 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>, 436 #address-cells = <1>;
572 <&dmac1 0xfd>, <&dmac1 0xfe>; 437 #size-cells = <0>;
573 dma-names = "tx", "rx", "tx", "rx"; 438 i2c-scl-internal-delay-ns = <6>;
574 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 439 status = "disabled";
575 resets = <&cpg 714>; 440 };
576 status = "disabled";
577 };
578 441
579 hscif0: serial@e62c0000 { 442 i2c6: i2c@e6500000 {
580 compatible = "renesas,hscif-r8a7794", 443 compatible = "renesas,iic-r8a7794",
581 "renesas,rcar-gen2-hscif", "renesas,hscif"; 444 "renesas,rcar-gen2-iic",
582 reg = <0 0xe62c0000 0 96>; 445 "renesas,rmobile-iic";
583 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>; 446 reg = <0 0xe6500000 0 0x425>;
584 clocks = <&cpg CPG_MOD 717>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 447 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
585 <&scif_clk>; 448 clocks = <&cpg CPG_MOD 318>;
586 clock-names = "fck", "brg_int", "scif_clk"; 449 dmas = <&dmac0 0x61>, <&dmac0 0x62>,
587 dmas = <&dmac0 0x39>, <&dmac0 0x3a>, 450 <&dmac1 0x61>, <&dmac1 0x62>;
588 <&dmac1 0x39>, <&dmac1 0x3a>; 451 dma-names = "tx", "rx", "tx", "rx";
589 dma-names = "tx", "rx", "tx", "rx"; 452 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
590 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 453 resets = <&cpg 318>;
591 resets = <&cpg 717>; 454 #address-cells = <1>;
592 status = "disabled"; 455 #size-cells = <0>;
593 }; 456 status = "disabled";
457 };
594 458
595 hscif1: serial@e62c8000 { 459 i2c7: i2c@e6510000 {
596 compatible = "renesas,hscif-r8a7794", 460 compatible = "renesas,iic-r8a7794",
597 "renesas,rcar-gen2-hscif", "renesas,hscif"; 461 "renesas,rcar-gen2-iic",
598 reg = <0 0xe62c8000 0 96>; 462 "renesas,rmobile-iic";
599 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>; 463 reg = <0 0xe6510000 0 0x425>;
600 clocks = <&cpg CPG_MOD 716>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 464 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
601 <&scif_clk>; 465 clocks = <&cpg CPG_MOD 323>;
602 clock-names = "fck", "brg_int", "scif_clk"; 466 dmas = <&dmac0 0x65>, <&dmac0 0x66>,
603 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>, 467 <&dmac1 0x65>, <&dmac1 0x66>;
604 <&dmac1 0x4d>, <&dmac1 0x4e>; 468 dma-names = "tx", "rx", "tx", "rx";
605 dma-names = "tx", "rx", "tx", "rx"; 469 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
606 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 470 resets = <&cpg 323>;
607 resets = <&cpg 716>; 471 #address-cells = <1>;
608 status = "disabled"; 472 #size-cells = <0>;
609 }; 473 status = "disabled";
474 };
610 475
611 hscif2: serial@e62d0000 { 476 hsusb: usb@e6590000 {
612 compatible = "renesas,hscif-r8a7794", 477 compatible = "renesas,usbhs-r8a7794",
613 "renesas,rcar-gen2-hscif", "renesas,hscif"; 478 "renesas,rcar-gen2-usbhs";
614 reg = <0 0xe62d0000 0 96>; 479 reg = <0 0xe6590000 0 0x100>;
615 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; 480 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
616 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7794_CLK_ZS>, 481 clocks = <&cpg CPG_MOD 704>;
617 <&scif_clk>; 482 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
618 clock-names = "fck", "brg_int", "scif_clk"; 483 resets = <&cpg 704>;
619 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>, 484 renesas,buswait = <4>;
620 <&dmac1 0x3b>, <&dmac1 0x3c>; 485 phys = <&usb0 1>;
621 dma-names = "tx", "rx", "tx", "rx"; 486 phy-names = "usb";
622 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 487 status = "disabled";
623 resets = <&cpg 713>; 488 };
624 status = "disabled";
625 };
626 489
627 icram0: sram@e63a0000 { 490 usbphy: usb-phy@e6590100 {
628 compatible = "mmio-sram"; 491 compatible = "renesas,usb-phy-r8a7794",
629 reg = <0 0xe63a0000 0 0x12000>; 492 "renesas,rcar-gen2-usb-phy";
630 }; 493 reg = <0 0xe6590100 0 0x100>;
494 #address-cells = <1>;
495 #size-cells = <0>;
496 clocks = <&cpg CPG_MOD 704>;
497 clock-names = "usbhs";
498 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
499 resets = <&cpg 704>;
500 status = "disabled";
631 501
632 icram1: sram@e63c0000 { 502 usb0: usb-channel@0 {
633 compatible = "mmio-sram"; 503 reg = <0>;
634 reg = <0 0xe63c0000 0 0x1000>; 504 #phy-cells = <1>;
635 #address-cells = <1>; 505 };
636 #size-cells = <1>; 506 usb2: usb-channel@2 {
637 ranges = <0 0 0xe63c0000 0x1000>; 507 reg = <2>;
508 #phy-cells = <1>;
509 };
510 };
638 511
639 smp-sram@0 { 512 dmac0: dma-controller@e6700000 {
640 compatible = "renesas,smp-sram"; 513 compatible = "renesas,dmac-r8a7794",
641 reg = <0 0x10>; 514 "renesas,rcar-dmac";
515 reg = <0 0xe6700000 0 0x20000>;
516 interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH
517 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
518 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
519 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
520 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
521 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
522 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
523 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
524 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
525 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
526 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
527 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
528 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
529 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
530 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
531 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>;
532 interrupt-names = "error",
533 "ch0", "ch1", "ch2", "ch3",
534 "ch4", "ch5", "ch6", "ch7",
535 "ch8", "ch9", "ch10", "ch11",
536 "ch12", "ch13", "ch14";
537 clocks = <&cpg CPG_MOD 219>;
538 clock-names = "fck";
539 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
540 resets = <&cpg 219>;
541 #dma-cells = <1>;
542 dma-channels = <15>;
642 }; 543 };
643 };
644 544
645 ether: ethernet@ee700000 { 545 dmac1: dma-controller@e6720000 {
646 compatible = "renesas,ether-r8a7794", 546 compatible = "renesas,dmac-r8a7794",
647 "renesas,rcar-gen2-ether"; 547 "renesas,rcar-dmac";
648 reg = <0 0xee700000 0 0x400>; 548 reg = <0 0xe6720000 0 0x20000>;
649 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; 549 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
650 clocks = <&cpg CPG_MOD 813>; 550 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
651 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 551 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
652 resets = <&cpg 813>; 552 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
653 phy-mode = "rmii"; 553 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
654 #address-cells = <1>; 554 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
655 #size-cells = <0>; 555 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
656 status = "disabled"; 556 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
657 }; 557 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
558 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
559 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
560 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
561 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
562 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
563 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
564 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
565 interrupt-names = "error",
566 "ch0", "ch1", "ch2", "ch3",
567 "ch4", "ch5", "ch6", "ch7",
568 "ch8", "ch9", "ch10", "ch11",
569 "ch12", "ch13", "ch14";
570 clocks = <&cpg CPG_MOD 218>;
571 clock-names = "fck";
572 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
573 resets = <&cpg 218>;
574 #dma-cells = <1>;
575 dma-channels = <15>;
576 };
658 577
659 avb: ethernet@e6800000 { 578 avb: ethernet@e6800000 {
660 compatible = "renesas,etheravb-r8a7794", 579 compatible = "renesas,etheravb-r8a7794",
661 "renesas,etheravb-rcar-gen2"; 580 "renesas,etheravb-rcar-gen2";
662 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>; 581 reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>;
663 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>; 582 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
664 clocks = <&cpg CPG_MOD 812>; 583 clocks = <&cpg CPG_MOD 812>;
665 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 584 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
666 resets = <&cpg 812>; 585 resets = <&cpg 812>;
667 #address-cells = <1>; 586 #address-cells = <1>;
668 #size-cells = <0>; 587 #size-cells = <0>;
669 status = "disabled"; 588 status = "disabled";
670 }; 589 };
671 590
672 /* The memory map in the User's Manual maps the cores to bus numbers */ 591 qspi: spi@e6b10000 {
673 i2c0: i2c@e6508000 { 592 compatible = "renesas,qspi-r8a7794", "renesas,qspi";
674 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 593 reg = <0 0xe6b10000 0 0x2c>;
675 reg = <0 0xe6508000 0 0x40>; 594 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
676 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 595 clocks = <&cpg CPG_MOD 917>;
677 clocks = <&cpg CPG_MOD 931>; 596 dmas = <&dmac0 0x17>, <&dmac0 0x18>,
678 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 597 <&dmac1 0x17>, <&dmac1 0x18>;
679 resets = <&cpg 931>; 598 dma-names = "tx", "rx", "tx", "rx";
680 #address-cells = <1>; 599 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
681 #size-cells = <0>; 600 resets = <&cpg 917>;
682 i2c-scl-internal-delay-ns = <6>; 601 num-cs = <1>;
683 status = "disabled"; 602 #address-cells = <1>;
684 }; 603 #size-cells = <0>;
604 status = "disabled";
605 };
685 606
686 i2c1: i2c@e6518000 { 607 scifa0: serial@e6c40000 {
687 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 608 compatible = "renesas,scifa-r8a7794",
688 reg = <0 0xe6518000 0 0x40>; 609 "renesas,rcar-gen2-scifa", "renesas,scifa";
689 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>; 610 reg = <0 0xe6c40000 0 64>;
690 clocks = <&cpg CPG_MOD 930>; 611 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
691 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 612 clocks = <&cpg CPG_MOD 204>;
692 resets = <&cpg 930>; 613 clock-names = "fck";
693 #address-cells = <1>; 614 dmas = <&dmac0 0x21>, <&dmac0 0x22>,
694 #size-cells = <0>; 615 <&dmac1 0x21>, <&dmac1 0x22>;
695 i2c-scl-internal-delay-ns = <6>; 616 dma-names = "tx", "rx", "tx", "rx";
696 status = "disabled"; 617 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
697 }; 618 resets = <&cpg 204>;
619 status = "disabled";
620 };
698 621
699 i2c2: i2c@e6530000 { 622 scifa1: serial@e6c50000 {
700 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 623 compatible = "renesas,scifa-r8a7794",
701 reg = <0 0xe6530000 0 0x40>; 624 "renesas,rcar-gen2-scifa", "renesas,scifa";
702 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>; 625 reg = <0 0xe6c50000 0 64>;
703 clocks = <&cpg CPG_MOD 929>; 626 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
704 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 627 clocks = <&cpg CPG_MOD 203>;
705 resets = <&cpg 929>; 628 clock-names = "fck";
706 #address-cells = <1>; 629 dmas = <&dmac0 0x25>, <&dmac0 0x26>,
707 #size-cells = <0>; 630 <&dmac1 0x25>, <&dmac1 0x26>;
708 i2c-scl-internal-delay-ns = <6>; 631 dma-names = "tx", "rx", "tx", "rx";
709 status = "disabled"; 632 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
710 }; 633 resets = <&cpg 203>;
634 status = "disabled";
635 };
711 636
712 i2c3: i2c@e6540000 { 637 scifa2: serial@e6c60000 {
713 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 638 compatible = "renesas,scifa-r8a7794",
714 reg = <0 0xe6540000 0 0x40>; 639 "renesas,rcar-gen2-scifa", "renesas,scifa";
715 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>; 640 reg = <0 0xe6c60000 0 64>;
716 clocks = <&cpg CPG_MOD 928>; 641 interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
717 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 642 clocks = <&cpg CPG_MOD 202>;
718 resets = <&cpg 928>; 643 clock-names = "fck";
719 #address-cells = <1>; 644 dmas = <&dmac0 0x27>, <&dmac0 0x28>,
720 #size-cells = <0>; 645 <&dmac1 0x27>, <&dmac1 0x28>;
721 i2c-scl-internal-delay-ns = <6>; 646 dma-names = "tx", "rx", "tx", "rx";
722 status = "disabled"; 647 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
723 }; 648 resets = <&cpg 202>;
649 status = "disabled";
650 };
724 651
725 i2c4: i2c@e6520000 { 652 scifa3: serial@e6c70000 {
726 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 653 compatible = "renesas,scifa-r8a7794",
727 reg = <0 0xe6520000 0 0x40>; 654 "renesas,rcar-gen2-scifa", "renesas,scifa";
728 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; 655 reg = <0 0xe6c70000 0 64>;
729 clocks = <&cpg CPG_MOD 927>; 656 interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
730 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 657 clocks = <&cpg CPG_MOD 1106>;
731 resets = <&cpg 927>; 658 clock-names = "fck";
732 #address-cells = <1>; 659 dmas = <&dmac0 0x1b>, <&dmac0 0x1c>,
733 #size-cells = <0>; 660 <&dmac1 0x1b>, <&dmac1 0x1c>;
734 i2c-scl-internal-delay-ns = <6>; 661 dma-names = "tx", "rx", "tx", "rx";
735 status = "disabled"; 662 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
736 }; 663 resets = <&cpg 1106>;
664 status = "disabled";
665 };
737 666
738 i2c5: i2c@e6528000 { 667 scifa4: serial@e6c78000 {
739 compatible = "renesas,i2c-r8a7794", "renesas,rcar-gen2-i2c"; 668 compatible = "renesas,scifa-r8a7794",
740 reg = <0 0xe6528000 0 0x40>; 669 "renesas,rcar-gen2-scifa", "renesas,scifa";
741 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; 670 reg = <0 0xe6c78000 0 64>;
742 clocks = <&cpg CPG_MOD 925>; 671 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
743 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 672 clocks = <&cpg CPG_MOD 1107>;
744 resets = <&cpg 925>; 673 clock-names = "fck";
745 #address-cells = <1>; 674 dmas = <&dmac0 0x1f>, <&dmac0 0x20>,
746 #size-cells = <0>; 675 <&dmac1 0x1f>, <&dmac1 0x20>;
747 i2c-scl-internal-delay-ns = <6>; 676 dma-names = "tx", "rx", "tx", "rx";
748 status = "disabled"; 677 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
749 }; 678 resets = <&cpg 1107>;
679 status = "disabled";
680 };
750 681
751 i2c6: i2c@e6500000 { 682 scifa5: serial@e6c80000 {
752 compatible = "renesas,iic-r8a7794", "renesas,rcar-gen2-iic", 683 compatible = "renesas,scifa-r8a7794",
753 "renesas,rmobile-iic"; 684 "renesas,rcar-gen2-scifa", "renesas,scifa";
754 reg = <0 0xe6500000 0 0x425>; 685 reg = <0 0xe6c80000 0 64>;
755 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; 686 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
756 clocks = <&cpg CPG_MOD 318>; 687 clocks = <&cpg CPG_MOD 1108>;
757 dmas = <&dmac0 0x61>, <&dmac0 0x62>, 688 clock-names = "fck";
758 <&dmac1 0x61>, <&dmac1 0x62>; 689 dmas = <&dmac0 0x23>, <&dmac0 0x24>,
759 dma-names = "tx", "rx", "tx", "rx"; 690 <&dmac1 0x23>, <&dmac1 0x24>;
760 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 691 dma-names = "tx", "rx", "tx", "rx";
761 resets = <&cpg 318>; 692 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
762 #address-cells = <1>; 693 resets = <&cpg 1108>;
763 #size-cells = <0>; 694 status = "disabled";
764 status = "disabled"; 695 };
765 };
766 696
767 i2c7: i2c@e6510000 { 697 scifb0: serial@e6c20000 {
768 compatible = "renesas,iic-r8a7794", "renesas,rcar-gen2-iic", 698 compatible = "renesas,scifb-r8a7794",
769 "renesas,rmobile-iic"; 699 "renesas,rcar-gen2-scifb", "renesas,scifb";
770 reg = <0 0xe6510000 0 0x425>; 700 reg = <0 0xe6c20000 0 0x100>;
771 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; 701 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
772 clocks = <&cpg CPG_MOD 323>; 702 clocks = <&cpg CPG_MOD 206>;
773 dmas = <&dmac0 0x65>, <&dmac0 0x66>, 703 clock-names = "fck";
774 <&dmac1 0x65>, <&dmac1 0x66>; 704 dmas = <&dmac0 0x3d>, <&dmac0 0x3e>,
775 dma-names = "tx", "rx", "tx", "rx"; 705 <&dmac1 0x3d>, <&dmac1 0x3e>;
776 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 706 dma-names = "tx", "rx", "tx", "rx";
777 resets = <&cpg 323>; 707 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
778 #address-cells = <1>; 708 resets = <&cpg 206>;
779 #size-cells = <0>; 709 status = "disabled";
780 status = "disabled"; 710 };
781 };
782 711
783 mmcif0: mmc@ee200000 { 712 scifb1: serial@e6c30000 {
784 compatible = "renesas,mmcif-r8a7794", "renesas,sh-mmcif"; 713 compatible = "renesas,scifb-r8a7794",
785 reg = <0 0xee200000 0 0x80>; 714 "renesas,rcar-gen2-scifb", "renesas,scifb";
786 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; 715 reg = <0 0xe6c30000 0 0x100>;
787 clocks = <&cpg CPG_MOD 315>; 716 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
788 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>, 717 clocks = <&cpg CPG_MOD 207>;
789 <&dmac1 0xd1>, <&dmac1 0xd2>; 718 clock-names = "fck";
790 dma-names = "tx", "rx", "tx", "rx"; 719 dmas = <&dmac0 0x19>, <&dmac0 0x1a>,
791 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 720 <&dmac1 0x19>, <&dmac1 0x1a>;
792 resets = <&cpg 315>; 721 dma-names = "tx", "rx", "tx", "rx";
793 reg-io-width = <4>; 722 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
794 status = "disabled"; 723 resets = <&cpg 207>;
795 }; 724 status = "disabled";
725 };
796 726
797 sdhi0: sd@ee100000 { 727 scifb2: serial@e6ce0000 {
798 compatible = "renesas,sdhi-r8a7794", 728 compatible = "renesas,scifb-r8a7794",
799 "renesas,rcar-gen2-sdhi"; 729 "renesas,rcar-gen2-scifb", "renesas,scifb";
800 reg = <0 0xee100000 0 0x328>; 730 reg = <0 0xe6ce0000 0 0x100>;
801 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>; 731 interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
802 clocks = <&cpg CPG_MOD 314>; 732 clocks = <&cpg CPG_MOD 216>;
803 dmas = <&dmac0 0xcd>, <&dmac0 0xce>, 733 clock-names = "fck";
804 <&dmac1 0xcd>, <&dmac1 0xce>; 734 dmas = <&dmac0 0x1d>, <&dmac0 0x1e>,
805 dma-names = "tx", "rx", "tx", "rx"; 735 <&dmac1 0x1d>, <&dmac1 0x1e>;
806 max-frequency = <195000000>; 736 dma-names = "tx", "rx", "tx", "rx";
807 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 737 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
808 resets = <&cpg 314>; 738 resets = <&cpg 216>;
809 status = "disabled"; 739 status = "disabled";
810 }; 740 };
811 741
812 sdhi1: sd@ee140000 { 742 scif0: serial@e6e60000 {
813 compatible = "renesas,sdhi-r8a7794", 743 compatible = "renesas,scif-r8a7794",
814 "renesas,rcar-gen2-sdhi"; 744 "renesas,rcar-gen2-scif",
815 reg = <0 0xee140000 0 0x100>; 745 "renesas,scif";
816 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>; 746 reg = <0 0xe6e60000 0 64>;
817 clocks = <&cpg CPG_MOD 312>; 747 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
818 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>, 748 clocks = <&cpg CPG_MOD 721>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
819 <&dmac1 0xc1>, <&dmac1 0xc2>; 749 <&scif_clk>;
820 dma-names = "tx", "rx", "tx", "rx"; 750 clock-names = "fck", "brg_int", "scif_clk";
821 max-frequency = <97500000>; 751 dmas = <&dmac0 0x29>, <&dmac0 0x2a>,
822 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 752 <&dmac1 0x29>, <&dmac1 0x2a>;
823 resets = <&cpg 312>; 753 dma-names = "tx", "rx", "tx", "rx";
824 status = "disabled"; 754 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
825 }; 755 resets = <&cpg 721>;
756 status = "disabled";
757 };
826 758
827 sdhi2: sd@ee160000 { 759 scif1: serial@e6e68000 {
828 compatible = "renesas,sdhi-r8a7794", 760 compatible = "renesas,scif-r8a7794",
829 "renesas,rcar-gen2-sdhi"; 761 "renesas,rcar-gen2-scif",
830 reg = <0 0xee160000 0 0x100>; 762 "renesas,scif";
831 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; 763 reg = <0 0xe6e68000 0 64>;
832 clocks = <&cpg CPG_MOD 311>; 764 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
833 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>, 765 clocks = <&cpg CPG_MOD 720>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
834 <&dmac1 0xd3>, <&dmac1 0xd4>; 766 <&scif_clk>;
835 dma-names = "tx", "rx", "tx", "rx"; 767 clock-names = "fck", "brg_int", "scif_clk";
836 max-frequency = <97500000>; 768 dmas = <&dmac0 0x2d>, <&dmac0 0x2e>,
837 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 769 <&dmac1 0x2d>, <&dmac1 0x2e>;
838 resets = <&cpg 311>; 770 dma-names = "tx", "rx", "tx", "rx";
839 status = "disabled"; 771 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
840 }; 772 resets = <&cpg 720>;
773 status = "disabled";
774 };
841 775
842 qspi: spi@e6b10000 { 776 scif2: serial@e6e58000 {
843 compatible = "renesas,qspi-r8a7794", "renesas,qspi"; 777 compatible = "renesas,scif-r8a7794",
844 reg = <0 0xe6b10000 0 0x2c>; 778 "renesas,rcar-gen2-scif", "renesas,scif";
845 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; 779 reg = <0 0xe6e58000 0 64>;
846 clocks = <&cpg CPG_MOD 917>; 780 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
847 dmas = <&dmac0 0x17>, <&dmac0 0x18>, 781 clocks = <&cpg CPG_MOD 719>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
848 <&dmac1 0x17>, <&dmac1 0x18>; 782 <&scif_clk>;
849 dma-names = "tx", "rx", "tx", "rx"; 783 clock-names = "fck", "brg_int", "scif_clk";
850 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 784 dmas = <&dmac0 0x2b>, <&dmac0 0x2c>,
851 resets = <&cpg 917>; 785 <&dmac1 0x2b>, <&dmac1 0x2c>;
852 num-cs = <1>; 786 dma-names = "tx", "rx", "tx", "rx";
853 #address-cells = <1>; 787 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
854 #size-cells = <0>; 788 resets = <&cpg 719>;
855 status = "disabled"; 789 status = "disabled";
856 }; 790 };
857 791
858 vin0: video@e6ef0000 { 792 scif3: serial@e6ea8000 {
859 compatible = "renesas,vin-r8a7794", "renesas,rcar-gen2-vin"; 793 compatible = "renesas,scif-r8a7794",
860 reg = <0 0xe6ef0000 0 0x1000>; 794 "renesas,rcar-gen2-scif", "renesas,scif";
861 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 795 reg = <0 0xe6ea8000 0 64>;
862 clocks = <&cpg CPG_MOD 811>; 796 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
863 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 797 clocks = <&cpg CPG_MOD 718>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
864 resets = <&cpg 811>; 798 <&scif_clk>;
865 status = "disabled"; 799 clock-names = "fck", "brg_int", "scif_clk";
866 }; 800 dmas = <&dmac0 0x2f>, <&dmac0 0x30>,
801 <&dmac1 0x2f>, <&dmac1 0x30>;
802 dma-names = "tx", "rx", "tx", "rx";
803 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
804 resets = <&cpg 718>;
805 status = "disabled";
806 };
867 807
868 vin1: video@e6ef1000 { 808 scif4: serial@e6ee0000 {
869 compatible = "renesas,vin-r8a7794", "renesas,rcar-gen2-vin"; 809 compatible = "renesas,scif-r8a7794",
870 reg = <0 0xe6ef1000 0 0x1000>; 810 "renesas,rcar-gen2-scif", "renesas,scif";
871 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 811 reg = <0 0xe6ee0000 0 64>;
872 clocks = <&cpg CPG_MOD 810>; 812 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
873 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 813 clocks = <&cpg CPG_MOD 715>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
874 resets = <&cpg 810>; 814 <&scif_clk>;
875 status = "disabled"; 815 clock-names = "fck", "brg_int", "scif_clk";
876 }; 816 dmas = <&dmac0 0xfb>, <&dmac0 0xfc>,
817 <&dmac1 0xfb>, <&dmac1 0xfc>;
818 dma-names = "tx", "rx", "tx", "rx";
819 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
820 resets = <&cpg 715>;
821 status = "disabled";
822 };
877 823
878 pci0: pci@ee090000 { 824 scif5: serial@e6ee8000 {
879 compatible = "renesas,pci-r8a7794", "renesas,pci-rcar-gen2"; 825 compatible = "renesas,scif-r8a7794",
880 device_type = "pci"; 826 "renesas,rcar-gen2-scif", "renesas,scif";
881 reg = <0 0xee090000 0 0xc00>, 827 reg = <0 0xe6ee8000 0 64>;
882 <0 0xee080000 0 0x1100>; 828 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
883 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; 829 clocks = <&cpg CPG_MOD 714>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
884 clocks = <&cpg CPG_MOD 703>; 830 <&scif_clk>;
885 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 831 clock-names = "fck", "brg_int", "scif_clk";
886 resets = <&cpg 703>; 832 dmas = <&dmac0 0xfd>, <&dmac0 0xfe>,
887 status = "disabled"; 833 <&dmac1 0xfd>, <&dmac1 0xfe>;
888 834 dma-names = "tx", "rx", "tx", "rx";
889 bus-range = <0 0>; 835 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
890 #address-cells = <3>; 836 resets = <&cpg 714>;
891 #size-cells = <2>; 837 status = "disabled";
892 #interrupt-cells = <1>;
893 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
894 interrupt-map-mask = <0xff00 0 0 0x7>;
895 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
896 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
897 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
898
899 usb@1,0 {
900 reg = <0x800 0 0 0 0>;
901 phys = <&usb0 0>;
902 phy-names = "usb";
903 }; 838 };
904 839
905 usb@2,0 { 840 hscif0: serial@e62c0000 {
906 reg = <0x1000 0 0 0 0>; 841 compatible = "renesas,hscif-r8a7794",
907 phys = <&usb0 0>; 842 "renesas,rcar-gen2-hscif", "renesas,hscif";
908 phy-names = "usb"; 843 reg = <0 0xe62c0000 0 96>;
844 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
845 clocks = <&cpg CPG_MOD 717>,
846 <&cpg CPG_CORE R8A7794_CLK_ZS>, <&scif_clk>;
847 clock-names = "fck", "brg_int", "scif_clk";
848 dmas = <&dmac0 0x39>, <&dmac0 0x3a>,
849 <&dmac1 0x39>, <&dmac1 0x3a>;
850 dma-names = "tx", "rx", "tx", "rx";
851 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
852 resets = <&cpg 717>;
853 status = "disabled";
909 }; 854 };
910 };
911 855
912 pci1: pci@ee0d0000 { 856 hscif1: serial@e62c8000 {
913 compatible = "renesas,pci-r8a7794", "renesas,pci-rcar-gen2"; 857 compatible = "renesas,hscif-r8a7794",
914 device_type = "pci"; 858 "renesas,rcar-gen2-hscif", "renesas,hscif";
915 reg = <0 0xee0d0000 0 0xc00>, 859 reg = <0 0xe62c8000 0 96>;
916 <0 0xee0c0000 0 0x1100>; 860 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
917 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; 861 clocks = <&cpg CPG_MOD 716>,
918 clocks = <&cpg CPG_MOD 703>; 862 <&cpg CPG_CORE R8A7794_CLK_ZS>, <&scif_clk>;
919 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 863 clock-names = "fck", "brg_int", "scif_clk";
920 resets = <&cpg 703>; 864 dmas = <&dmac0 0x4d>, <&dmac0 0x4e>,
921 status = "disabled"; 865 <&dmac1 0x4d>, <&dmac1 0x4e>;
922 866 dma-names = "tx", "rx", "tx", "rx";
923 bus-range = <1 1>; 867 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
924 #address-cells = <3>; 868 resets = <&cpg 716>;
925 #size-cells = <2>; 869 status = "disabled";
926 #interrupt-cells = <1>;
927 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
928 interrupt-map-mask = <0xff00 0 0 0x7>;
929 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
930 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
931 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
932
933 usb@1,0 {
934 reg = <0x10800 0 0 0 0>;
935 phys = <&usb2 0>;
936 phy-names = "usb";
937 }; 870 };
938 871
939 usb@2,0 { 872 hscif2: serial@e62d0000 {
940 reg = <0x11000 0 0 0 0>; 873 compatible = "renesas,hscif-r8a7794",
941 phys = <&usb2 0>; 874 "renesas,rcar-gen2-hscif", "renesas,hscif";
942 phy-names = "usb"; 875 reg = <0 0xe62d0000 0 96>;
876 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
877 clocks = <&cpg CPG_MOD 713>, <&cpg CPG_CORE R8A7794_CLK_ZS>,
878 <&scif_clk>;
879 clock-names = "fck", "brg_int", "scif_clk";
880 dmas = <&dmac0 0x3b>, <&dmac0 0x3c>,
881 <&dmac1 0x3b>, <&dmac1 0x3c>;
882 dma-names = "tx", "rx", "tx", "rx";
883 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
884 resets = <&cpg 713>;
885 status = "disabled";
943 }; 886 };
944 };
945 887
946 hsusb: usb@e6590000 { 888 can0: can@e6e80000 {
947 compatible = "renesas,usbhs-r8a7794", "renesas,rcar-gen2-usbhs"; 889 compatible = "renesas,can-r8a7794",
948 reg = <0 0xe6590000 0 0x100>; 890 "renesas,rcar-gen2-can";
949 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; 891 reg = <0 0xe6e80000 0 0x1000>;
950 clocks = <&cpg CPG_MOD 704>; 892 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
951 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 893 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7794_CLK_RCAN>,
952 resets = <&cpg 704>; 894 <&can_clk>;
953 renesas,buswait = <4>; 895 clock-names = "clkp1", "clkp2", "can_clk";
954 phys = <&usb0 1>; 896 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
955 phy-names = "usb"; 897 resets = <&cpg 916>;
956 status = "disabled"; 898 status = "disabled";
957 }; 899 };
958 900
959 usbphy: usb-phy@e6590100 { 901 can1: can@e6e88000 {
960 compatible = "renesas,usb-phy-r8a7794", 902 compatible = "renesas,can-r8a7794",
961 "renesas,rcar-gen2-usb-phy"; 903 "renesas,rcar-gen2-can";
962 reg = <0 0xe6590100 0 0x100>; 904 reg = <0 0xe6e88000 0 0x1000>;
963 #address-cells = <1>; 905 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
964 #size-cells = <0>; 906 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7794_CLK_RCAN>,
965 clocks = <&cpg CPG_MOD 704>; 907 <&can_clk>;
966 clock-names = "usbhs"; 908 clock-names = "clkp1", "clkp2", "can_clk";
967 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 909 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
968 resets = <&cpg 704>; 910 resets = <&cpg 915>;
969 status = "disabled"; 911 status = "disabled";
912 };
970 913
971 usb0: usb-channel@0 { 914 vin0: video@e6ef0000 {
972 reg = <0>; 915 compatible = "renesas,vin-r8a7794",
973 #phy-cells = <1>; 916 "renesas,rcar-gen2-vin";
917 reg = <0 0xe6ef0000 0 0x1000>;
918 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
919 clocks = <&cpg CPG_MOD 811>;
920 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
921 resets = <&cpg 811>;
922 status = "disabled";
974 }; 923 };
975 usb2: usb-channel@2 { 924
976 reg = <2>; 925 vin1: video@e6ef1000 {
977 #phy-cells = <1>; 926 compatible = "renesas,vin-r8a7794",
927 "renesas,rcar-gen2-vin";
928 reg = <0 0xe6ef1000 0 0x1000>;
929 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
930 clocks = <&cpg CPG_MOD 810>;
931 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
932 resets = <&cpg 810>;
933 status = "disabled";
978 }; 934 };
979 };
980 935
981 vsp@fe928000 { 936 rcar_sound: sound@ec500000 {
982 compatible = "renesas,vsp1"; 937 /*
983 reg = <0 0xfe928000 0 0x8000>; 938 * #sound-dai-cells is required
984 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>; 939 *
985 clocks = <&cpg CPG_MOD 131>; 940 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
986 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 941 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
987 resets = <&cpg 131>; 942 */
988 }; 943 compatible = "renesas,rcar_sound-r8a7794",
944 "renesas,rcar_sound-gen2";
945 reg = <0 0xec500000 0 0x1000>, /* SCU */
946 <0 0xec5a0000 0 0x100>, /* ADG */
947 <0 0xec540000 0 0x1000>, /* SSIU */
948 <0 0xec541000 0 0x280>, /* SSI */
949 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri */
950 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
951
952 clocks = <&cpg CPG_MOD 1005>,
953 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
954 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
955 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
956 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
957 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
958 <&cpg CPG_MOD 1025>, <&cpg CPG_MOD 1026>,
959 <&cpg CPG_MOD 1027>, <&cpg CPG_MOD 1028>,
960 <&cpg CPG_MOD 1029>, <&cpg CPG_MOD 1030>,
961 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
962 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
963 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
964 <&audio_clka>, <&audio_clkb>, <&audio_clkc>,
965 <&cpg CPG_CORE R8A7794_CLK_M2>;
966 clock-names = "ssi-all",
967 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
968 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
969 "ssi.1", "ssi.0",
970 "src.6", "src.5", "src.4", "src.3",
971 "src.2", "src.1",
972 "ctu.0", "ctu.1",
973 "mix.0", "mix.1",
974 "dvc.0", "dvc.1",
975 "clk_a", "clk_b", "clk_c", "clk_i";
976 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
977 resets = <&cpg 1005>,
978 <&cpg 1006>, <&cpg 1007>,
979 <&cpg 1008>, <&cpg 1009>,
980 <&cpg 1010>, <&cpg 1011>,
981 <&cpg 1012>, <&cpg 1013>,
982 <&cpg 1014>, <&cpg 1015>;
983 reset-names = "ssi-all",
984 "ssi.9", "ssi.8", "ssi.7", "ssi.6",
985 "ssi.5", "ssi.4", "ssi.3", "ssi.2",
986 "ssi.1", "ssi.0";
987
988 status = "disabled";
989
990 rcar_sound,dvc {
991 dvc0: dvc-0 {
992 dmas = <&audma0 0xbc>;
993 dma-names = "tx";
994 };
995 dvc1: dvc-1 {
996 dmas = <&audma0 0xbe>;
997 dma-names = "tx";
998 };
999 };
989 1000
990 vsp@fe930000 { 1001 rcar_sound,mix {
991 compatible = "renesas,vsp1"; 1002 mix0: mix-0 { };
992 reg = <0 0xfe930000 0 0x8000>; 1003 mix1: mix-1 { };
993 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>; 1004 };
994 clocks = <&cpg CPG_MOD 128>;
995 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
996 resets = <&cpg 128>;
997 };
998 1005
999 du: display@feb00000 { 1006 rcar_sound,ctu {
1000 compatible = "renesas,du-r8a7794"; 1007 ctu00: ctu-0 { };
1001 reg = <0 0xfeb00000 0 0x40000>; 1008 ctu01: ctu-1 { };
1002 reg-names = "du"; 1009 ctu02: ctu-2 { };
1003 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>, 1010 ctu03: ctu-3 { };
1004 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>; 1011 ctu10: ctu-4 { };
1005 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>; 1012 ctu11: ctu-5 { };
1006 clock-names = "du.0", "du.1"; 1013 ctu12: ctu-6 { };
1007 status = "disabled"; 1014 ctu13: ctu-7 { };
1008 1015 };
1009 ports {
1010 #address-cells = <1>;
1011 #size-cells = <0>;
1012 1016
1013 port@0 { 1017 rcar_sound,src {
1014 reg = <0>; 1018 src-0 {
1015 du_out_rgb0: endpoint { 1019 status = "disabled";
1020 };
1021 src1: src-1 {
1022 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
1023 dmas = <&audma0 0x87>, <&audma0 0x9c>;
1024 dma-names = "rx", "tx";
1025 };
1026 src2: src-2 {
1027 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
1028 dmas = <&audma0 0x89>, <&audma0 0x9e>;
1029 dma-names = "rx", "tx";
1030 };
1031 src3: src-3 {
1032 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
1033 dmas = <&audma0 0x8b>, <&audma0 0xa0>;
1034 dma-names = "rx", "tx";
1035 };
1036 src4: src-4 {
1037 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1038 dmas = <&audma0 0x8d>, <&audma0 0xb0>;
1039 dma-names = "rx", "tx";
1040 };
1041 src5: src-5 {
1042 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1043 dmas = <&audma0 0x8f>, <&audma0 0xb2>;
1044 dma-names = "rx", "tx";
1045 };
1046 src6: src-6 {
1047 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1048 dmas = <&audma0 0x91>, <&audma0 0xb4>;
1049 dma-names = "rx", "tx";
1016 }; 1050 };
1017 }; 1051 };
1018 port@1 { 1052
1019 reg = <1>; 1053 rcar_sound,ssi {
1020 du_out_rgb1: endpoint { 1054 ssi0: ssi-0 {
1055 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
1056 dmas = <&audma0 0x01>, <&audma0 0x02>,
1057 <&audma0 0x15>, <&audma0 0x16>;
1058 dma-names = "rx", "tx", "rxu", "txu";
1059 };
1060 ssi1: ssi-1 {
1061 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
1062 dmas = <&audma0 0x03>, <&audma0 0x04>,
1063 <&audma0 0x49>, <&audma0 0x4a>;
1064 dma-names = "rx", "tx", "rxu", "txu";
1065 };
1066 ssi2: ssi-2 {
1067 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1068 dmas = <&audma0 0x05>, <&audma0 0x06>,
1069 <&audma0 0x63>, <&audma0 0x64>;
1070 dma-names = "rx", "tx", "rxu", "txu";
1071 };
1072 ssi3: ssi-3 {
1073 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1074 dmas = <&audma0 0x07>, <&audma0 0x08>,
1075 <&audma0 0x6f>, <&audma0 0x70>;
1076 dma-names = "rx", "tx", "rxu", "txu";
1077 };
1078 ssi4: ssi-4 {
1079 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1080 dmas = <&audma0 0x09>, <&audma0 0x0a>,
1081 <&audma0 0x71>, <&audma0 0x72>;
1082 dma-names = "rx", "tx", "rxu", "txu";
1083 };
1084 ssi5: ssi-5 {
1085 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1086 dmas = <&audma0 0x0b>, <&audma0 0x0c>,
1087 <&audma0 0x73>, <&audma0 0x74>;
1088 dma-names = "rx", "tx", "rxu", "txu";
1089 };
1090 ssi6: ssi-6 {
1091 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1092 dmas = <&audma0 0x0d>, <&audma0 0x0e>,
1093 <&audma0 0x75>, <&audma0 0x76>;
1094 dma-names = "rx", "tx", "rxu", "txu";
1095 };
1096 ssi7: ssi-7 {
1097 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1098 dmas = <&audma0 0x0f>, <&audma0 0x10>,
1099 <&audma0 0x79>, <&audma0 0x7a>;
1100 dma-names = "rx", "tx", "rxu", "txu";
1101 };
1102 ssi8: ssi-8 {
1103 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1104 dmas = <&audma0 0x11>, <&audma0 0x12>,
1105 <&audma0 0x7b>, <&audma0 0x7c>;
1106 dma-names = "rx", "tx", "rxu", "txu";
1107 };
1108 ssi9: ssi-9 {
1109 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1110 dmas = <&audma0 0x13>, <&audma0 0x14>,
1111 <&audma0 0x7d>, <&audma0 0x7e>;
1112 dma-names = "rx", "tx", "rxu", "txu";
1021 }; 1113 };
1022 }; 1114 };
1023 }; 1115 };
1024 };
1025
1026 can0: can@e6e80000 {
1027 compatible = "renesas,can-r8a7794", "renesas,rcar-gen2-can";
1028 reg = <0 0xe6e80000 0 0x1000>;
1029 interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
1030 clocks = <&cpg CPG_MOD 916>, <&cpg CPG_CORE R8A7794_CLK_RCAN>,
1031 <&can_clk>;
1032 clock-names = "clkp1", "clkp2", "can_clk";
1033 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1034 resets = <&cpg 916>;
1035 status = "disabled";
1036 };
1037 1116
1038 can1: can@e6e88000 { 1117 audma0: dma-controller@ec700000 {
1039 compatible = "renesas,can-r8a7794", "renesas,rcar-gen2-can"; 1118 compatible = "renesas,dmac-r8a7794",
1040 reg = <0 0xe6e88000 0 0x1000>; 1119 "renesas,rcar-dmac";
1041 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; 1120 reg = <0 0xec700000 0 0x10000>;
1042 clocks = <&cpg CPG_MOD 915>, <&cpg CPG_CORE R8A7794_CLK_RCAN>, 1121 interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
1043 <&can_clk>; 1122 GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
1044 clock-names = "clkp1", "clkp2", "can_clk"; 1123 GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
1045 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>; 1124 GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
1046 resets = <&cpg 915>; 1125 GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
1047 status = "disabled"; 1126 GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
1048 }; 1127 GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
1049 1128 GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
1050 /* External root clock */ 1129 GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
1051 extal_clk: extal { 1130 GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
1052 compatible = "fixed-clock"; 1131 GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
1053 #clock-cells = <0>; 1132 GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
1054 /* This value must be overridden by the board. */ 1133 GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
1055 clock-frequency = <0>; 1134 GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
1056 }; 1135 interrupt-names = "error",
1057 1136 "ch0", "ch1", "ch2", "ch3", "ch4",
1058 /* External USB clock - can be overridden by the board */ 1137 "ch5", "ch6", "ch7", "ch8", "ch9",
1059 usb_extal_clk: usb_extal { 1138 "ch10", "ch11",
1060 compatible = "fixed-clock"; 1139 "ch12";
1061 #clock-cells = <0>; 1140 clocks = <&cpg CPG_MOD 502>;
1062 clock-frequency = <48000000>; 1141 clock-names = "fck";
1063 }; 1142 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1064 1143 resets = <&cpg 502>;
1065 /* External CAN clock */ 1144 #dma-cells = <1>;
1066 can_clk: can { 1145 dma-channels = <13>;
1067 compatible = "fixed-clock"; 1146 };
1068 #clock-cells = <0>;
1069 /* This value must be overridden by the board. */
1070 clock-frequency = <0>;
1071 };
1072 1147
1073 /* External SCIF clock */ 1148 pci0: pci@ee090000 {
1074 scif_clk: scif { 1149 compatible = "renesas,pci-r8a7794",
1075 compatible = "fixed-clock"; 1150 "renesas,pci-rcar-gen2";
1076 #clock-cells = <0>; 1151 device_type = "pci";
1077 /* This value must be overridden by the board. */ 1152 reg = <0 0xee090000 0 0xc00>,
1078 clock-frequency = <0>; 1153 <0 0xee080000 0 0x1100>;
1079 }; 1154 interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1155 clocks = <&cpg CPG_MOD 703>;
1156 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1157 resets = <&cpg 703>;
1158 status = "disabled";
1159
1160 bus-range = <0 0>;
1161 #address-cells = <3>;
1162 #size-cells = <2>;
1163 #interrupt-cells = <1>;
1164 ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
1165 interrupt-map-mask = <0xff00 0 0 0x7>;
1166 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1167 0x0800 0 0 1 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH
1168 0x1000 0 0 2 &gic GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
1169
1170 usb@1,0 {
1171 reg = <0x800 0 0 0 0>;
1172 phys = <&usb0 0>;
1173 phy-names = "usb";
1174 };
1080 1175
1081 /* 1176 usb@2,0 {
1082 * The external audio clocks are configured as 0 Hz fixed 1177 reg = <0x1000 0 0 0 0>;
1083 * frequency clocks by default. Boards that provide audio 1178 phys = <&usb0 0>;
1084 * clocks should override them. 1179 phy-names = "usb";
1085 */ 1180 };
1086 audio_clka: audio_clka { 1181 };
1087 compatible = "fixed-clock";
1088 #clock-cells = <0>;
1089 clock-frequency = <0>;
1090 };
1091 audio_clkb: audio_clkb {
1092 compatible = "fixed-clock";
1093 #clock-cells = <0>;
1094 clock-frequency = <0>;
1095 };
1096 audio_clkc: audio_clkc {
1097 compatible = "fixed-clock";
1098 #clock-cells = <0>;
1099 clock-frequency = <0>;
1100 };
1101 1182
1102 cpg: clock-controller@e6150000 { 1183 pci1: pci@ee0d0000 {
1103 compatible = "renesas,r8a7794-cpg-mssr"; 1184 compatible = "renesas,pci-r8a7794",
1104 reg = <0 0xe6150000 0 0x1000>; 1185 "renesas,pci-rcar-gen2";
1105 clocks = <&extal_clk>, <&usb_extal_clk>; 1186 device_type = "pci";
1106 clock-names = "extal", "usb_extal"; 1187 reg = <0 0xee0d0000 0 0xc00>,
1107 #clock-cells = <2>; 1188 <0 0xee0c0000 0 0x1100>;
1108 #power-domain-cells = <0>; 1189 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1109 #reset-cells = <1>; 1190 clocks = <&cpg CPG_MOD 703>;
1110 }; 1191 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1192 resets = <&cpg 703>;
1193 status = "disabled";
1194
1195 bus-range = <1 1>;
1196 #address-cells = <3>;
1197 #size-cells = <2>;
1198 #interrupt-cells = <1>;
1199 ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
1200 interrupt-map-mask = <0xff00 0 0 0x7>;
1201 interrupt-map = <0x0000 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1202 0x0800 0 0 1 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH
1203 0x1000 0 0 2 &gic GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
1204
1205 usb@1,0 {
1206 reg = <0x10800 0 0 0 0>;
1207 phys = <&usb2 0>;
1208 phy-names = "usb";
1209 };
1111 1210
1112 rst: reset-controller@e6160000 { 1211 usb@2,0 {
1113 compatible = "renesas,r8a7794-rst"; 1212 reg = <0x11000 0 0 0 0>;
1114 reg = <0 0xe6160000 0 0x0100>; 1213 phys = <&usb2 0>;
1115 }; 1214 phy-names = "usb";
1215 };
1216 };
1116 1217
1117 prr: chipid@ff000044 { 1218 sdhi0: sd@ee100000 {
1118 compatible = "renesas,prr"; 1219 compatible = "renesas,sdhi-r8a7794",
1119 reg = <0 0xff000044 0 4>; 1220 "renesas,rcar-gen2-sdhi";
1120 }; 1221 reg = <0 0xee100000 0 0x328>;
1222 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
1223 clocks = <&cpg CPG_MOD 314>;
1224 dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
1225 <&dmac1 0xcd>, <&dmac1 0xce>;
1226 dma-names = "tx", "rx", "tx", "rx";
1227 max-frequency = <195000000>;
1228 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1229 resets = <&cpg 314>;
1230 status = "disabled";
1231 };
1121 1232
1122 sysc: system-controller@e6180000 { 1233 sdhi1: sd@ee140000 {
1123 compatible = "renesas,r8a7794-sysc"; 1234 compatible = "renesas,sdhi-r8a7794",
1124 reg = <0 0xe6180000 0 0x0200>; 1235 "renesas,rcar-gen2-sdhi";
1125 #power-domain-cells = <1>; 1236 reg = <0 0xee140000 0 0x100>;
1126 }; 1237 interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
1238 clocks = <&cpg CPG_MOD 312>;
1239 dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
1240 <&dmac1 0xc1>, <&dmac1 0xc2>;
1241 dma-names = "tx", "rx", "tx", "rx";
1242 max-frequency = <97500000>;
1243 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1244 resets = <&cpg 312>;
1245 status = "disabled";
1246 };
1127 1247
1128 ipmmu_sy0: mmu@e6280000 { 1248 sdhi2: sd@ee160000 {
1129 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1249 compatible = "renesas,sdhi-r8a7794",
1130 reg = <0 0xe6280000 0 0x1000>; 1250 "renesas,rcar-gen2-sdhi";
1131 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>, 1251 reg = <0 0xee160000 0 0x100>;
1132 <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 1252 interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
1133 #iommu-cells = <1>; 1253 clocks = <&cpg CPG_MOD 311>;
1134 status = "disabled"; 1254 dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
1135 }; 1255 <&dmac1 0xd3>, <&dmac1 0xd4>;
1256 dma-names = "tx", "rx", "tx", "rx";
1257 max-frequency = <97500000>;
1258 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1259 resets = <&cpg 311>;
1260 status = "disabled";
1261 };
1136 1262
1137 ipmmu_sy1: mmu@e6290000 { 1263 mmcif0: mmc@ee200000 {
1138 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1264 compatible = "renesas,mmcif-r8a7794",
1139 reg = <0 0xe6290000 0 0x1000>; 1265 "renesas,sh-mmcif";
1140 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 1266 reg = <0 0xee200000 0 0x80>;
1141 #iommu-cells = <1>; 1267 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
1142 status = "disabled"; 1268 clocks = <&cpg CPG_MOD 315>;
1143 }; 1269 dmas = <&dmac0 0xd1>, <&dmac0 0xd2>,
1270 <&dmac1 0xd1>, <&dmac1 0xd2>;
1271 dma-names = "tx", "rx", "tx", "rx";
1272 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1273 resets = <&cpg 315>;
1274 reg-io-width = <4>;
1275 status = "disabled";
1276 };
1144 1277
1145 ipmmu_ds: mmu@e6740000 { 1278 ether: ethernet@ee700000 {
1146 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1279 compatible = "renesas,ether-r8a7794",
1147 reg = <0 0xe6740000 0 0x1000>; 1280 "renesas,rcar-gen2-ether";
1148 interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, 1281 reg = <0 0xee700000 0 0x400>;
1149 <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>; 1282 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
1150 #iommu-cells = <1>; 1283 clocks = <&cpg CPG_MOD 813>;
1151 status = "disabled"; 1284 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1152 }; 1285 resets = <&cpg 813>;
1286 phy-mode = "rmii";
1287 #address-cells = <1>;
1288 #size-cells = <0>;
1289 status = "disabled";
1290 };
1153 1291
1154 ipmmu_mp: mmu@ec680000 { 1292 gic: interrupt-controller@f1001000 {
1155 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1293 compatible = "arm,gic-400";
1156 reg = <0 0xec680000 0 0x1000>; 1294 #interrupt-cells = <3>;
1157 interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>; 1295 #address-cells = <0>;
1158 #iommu-cells = <1>; 1296 interrupt-controller;
1159 status = "disabled"; 1297 reg = <0 0xf1001000 0 0x1000>,
1160 }; 1298 <0 0xf1002000 0 0x2000>,
1299 <0 0xf1004000 0 0x2000>,
1300 <0 0xf1006000 0 0x2000>;
1301 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
1302 clocks = <&cpg CPG_MOD 408>;
1303 clock-names = "clk";
1304 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1305 resets = <&cpg 408>;
1306 };
1161 1307
1162 ipmmu_mx: mmu@fe951000 { 1308 vsp@fe928000 {
1163 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1309 compatible = "renesas,vsp1";
1164 reg = <0 0xfe951000 0 0x1000>; 1310 reg = <0 0xfe928000 0 0x8000>;
1165 interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>, 1311 interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
1166 <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>; 1312 clocks = <&cpg CPG_MOD 131>;
1167 #iommu-cells = <1>; 1313 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1168 status = "disabled"; 1314 resets = <&cpg 131>;
1169 }; 1315 };
1170 1316
1171 ipmmu_gp: mmu@e62a0000 { 1317 vsp@fe930000 {
1172 compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; 1318 compatible = "renesas,vsp1";
1173 reg = <0 0xe62a0000 0 0x1000>; 1319 reg = <0 0xfe930000 0 0x8000>;
1174 interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>, 1320 interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
1175 <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>; 1321 clocks = <&cpg CPG_MOD 128>;
1176 #iommu-cells = <1>; 1322 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1177 status = "disabled"; 1323 resets = <&cpg 128>;
1178 }; 1324 };
1179 1325
1180 rcar_sound: sound@ec500000 { 1326 du: display@feb00000 {
1181 /* 1327 compatible = "renesas,du-r8a7794";
1182 * #sound-dai-cells is required 1328 reg = <0 0xfeb00000 0 0x40000>;
1183 * 1329 reg-names = "du";
1184 * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>; 1330 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
1185 * Multi DAI : #sound-dai-cells = <1>; <&rcar_sound N>; 1331 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
1186 */ 1332 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>;
1187 compatible = "renesas,rcar_sound-r8a7794", 1333 clock-names = "du.0", "du.1";
1188 "renesas,rcar_sound-gen2"; 1334 status = "disabled";
1189 reg = <0 0xec500000 0 0x1000>, /* SCU */ 1335
1190 <0 0xec5a0000 0 0x100>, /* ADG */ 1336 ports {
1191 <0 0xec540000 0 0x1000>, /* SSIU */ 1337 #address-cells = <1>;
1192 <0 0xec541000 0 0x280>, /* SSI */ 1338 #size-cells = <0>;
1193 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri */ 1339
1194 reg-names = "scu", "adg", "ssiu", "ssi", "audmapp"; 1340 port@0 {
1195 1341 reg = <0>;
1196 clocks = <&cpg CPG_MOD 1005>, 1342 du_out_rgb0: endpoint {
1197 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>, 1343 };
1198 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>, 1344 };
1199 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>, 1345 port@1 {
1200 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>, 1346 reg = <1>;
1201 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>, 1347 du_out_rgb1: endpoint {
1202 <&cpg CPG_MOD 1025>, <&cpg CPG_MOD 1026>, 1348 };
1203 <&cpg CPG_MOD 1027>, <&cpg CPG_MOD 1028>, 1349 };
1204 <&cpg CPG_MOD 1029>, <&cpg CPG_MOD 1030>,
1205 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1206 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
1207 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
1208 <&audio_clka>, <&audio_clkb>, <&audio_clkc>,
1209 <&cpg CPG_CORE R8A7794_CLK_M2>;
1210 clock-names = "ssi-all",
1211 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1212 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
1213 "src.6", "src.5", "src.4", "src.3", "src.2",
1214 "src.1",
1215 "ctu.0", "ctu.1",
1216 "mix.0", "mix.1",
1217 "dvc.0", "dvc.1",
1218 "clk_a", "clk_b", "clk_c", "clk_i";
1219 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1220 resets = <&cpg 1005>,
1221 <&cpg 1006>, <&cpg 1007>, <&cpg 1008>, <&cpg 1009>,
1222 <&cpg 1010>, <&cpg 1011>, <&cpg 1012>, <&cpg 1013>,
1223 <&cpg 1014>, <&cpg 1015>;
1224 reset-names = "ssi-all",
1225 "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
1226 "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0";
1227
1228 status = "disabled";
1229
1230 rcar_sound,dvc {
1231 dvc0: dvc-0 {
1232 dmas = <&audma0 0xbc>;
1233 dma-names = "tx";
1234 };
1235 dvc1: dvc-1 {
1236 dmas = <&audma0 0xbe>;
1237 dma-names = "tx";
1238 }; 1350 };
1239 }; 1351 };
1240 1352
1241 rcar_sound,mix { 1353 prr: chipid@ff000044 {
1242 mix0: mix-0 { }; 1354 compatible = "renesas,prr";
1243 mix1: mix-1 { }; 1355 reg = <0 0xff000044 0 4>;
1244 }; 1356 };
1245 1357
1246 rcar_sound,ctu { 1358 cmt0: timer@ffca0000 {
1247 ctu00: ctu-0 { }; 1359 compatible = "renesas,r8a7794-cmt0",
1248 ctu01: ctu-1 { }; 1360 "renesas,rcar-gen2-cmt0";
1249 ctu02: ctu-2 { }; 1361 reg = <0 0xffca0000 0 0x1004>;
1250 ctu03: ctu-3 { }; 1362 interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
1251 ctu10: ctu-4 { }; 1363 <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
1252 ctu11: ctu-5 { }; 1364 clocks = <&cpg CPG_MOD 124>;
1253 ctu12: ctu-6 { }; 1365 clock-names = "fck";
1254 ctu13: ctu-7 { }; 1366 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1367 resets = <&cpg 124>;
1368
1369 status = "disabled";
1255 }; 1370 };
1256 1371
1257 rcar_sound,src { 1372 cmt1: timer@e6130000 {
1258 src-0 { 1373 compatible = "renesas,r8a7794-cmt1",
1259 status = "disabled"; 1374 "renesas,rcar-gen2-cmt1";
1260 }; 1375 reg = <0 0xe6130000 0 0x1004>;
1261 src1: src-1 { 1376 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
1262 interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>; 1377 <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
1263 dmas = <&audma0 0x87>, <&audma0 0x9c>; 1378 <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
1264 dma-names = "rx", "tx"; 1379 <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
1265 }; 1380 <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
1266 src2: src-2 { 1381 <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
1267 interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>; 1382 <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
1268 dmas = <&audma0 0x89>, <&audma0 0x9e>; 1383 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
1269 dma-names = "rx", "tx"; 1384 clocks = <&cpg CPG_MOD 329>;
1270 }; 1385 clock-names = "fck";
1271 src3: src-3 { 1386 power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
1272 interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>; 1387 resets = <&cpg 329>;
1273 dmas = <&audma0 0x8b>, <&audma0 0xa0>; 1388
1274 dma-names = "rx", "tx"; 1389 status = "disabled";
1275 };
1276 src4: src-4 {
1277 interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
1278 dmas = <&audma0 0x8d>, <&audma0 0xb0>;
1279 dma-names = "rx", "tx";
1280 };
1281 src5: src-5 {
1282 interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
1283 dmas = <&audma0 0x8f>, <&audma0 0xb2>;
1284 dma-names = "rx", "tx";
1285 };
1286 src6: src-6 {
1287 interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
1288 dmas = <&audma0 0x91>, <&audma0 0xb4>;
1289 dma-names = "rx", "tx";
1290 };
1291 }; 1390 };
1391 };
1292 1392
1293 rcar_sound,ssi { 1393 timer {
1294 ssi0: ssi-0 { 1394 compatible = "arm,armv7-timer";
1295 interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>; 1395 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1296 dmas = <&audma0 0x01>, <&audma0 0x02>, 1396 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1297 <&audma0 0x15>, <&audma0 0x16>; 1397 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
1298 dma-names = "rx", "tx", "rxu", "txu"; 1398 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
1299 }; 1399 };
1300 ssi1: ssi-1 { 1400
1301 interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>; 1401 /* External USB clock - can be overridden by the board */
1302 dmas = <&audma0 0x03>, <&audma0 0x04>, 1402 usb_extal_clk: usb_extal {
1303 <&audma0 0x49>, <&audma0 0x4a>; 1403 compatible = "fixed-clock";
1304 dma-names = "rx", "tx", "rxu", "txu"; 1404 #clock-cells = <0>;
1305 }; 1405 clock-frequency = <48000000>;
1306 ssi2: ssi-2 {
1307 interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
1308 dmas = <&audma0 0x05>, <&audma0 0x06>,
1309 <&audma0 0x63>, <&audma0 0x64>;
1310 dma-names = "rx", "tx", "rxu", "txu";
1311 };
1312 ssi3: ssi-3 {
1313 interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
1314 dmas = <&audma0 0x07>, <&audma0 0x08>,
1315 <&audma0 0x6f>, <&audma0 0x70>;
1316 dma-names = "rx", "tx", "rxu", "txu";
1317 };
1318 ssi4: ssi-4 {
1319 interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
1320 dmas = <&audma0 0x09>, <&audma0 0x0a>,
1321 <&audma0 0x71>, <&audma0 0x72>;
1322 dma-names = "rx", "tx", "rxu", "txu";
1323 };
1324 ssi5: ssi-5 {
1325 interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
1326 dmas = <&audma0 0x0b>, <&audma0 0x0c>,
1327 <&audma0 0x73>, <&audma0 0x74>;
1328 dma-names = "rx", "tx", "rxu", "txu";
1329 };
1330 ssi6: ssi-6 {
1331 interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
1332 dmas = <&audma0 0x0d>, <&audma0 0x0e>,
1333 <&audma0 0x75>, <&audma0 0x76>;
1334 dma-names = "rx", "tx", "rxu", "txu";
1335 };
1336 ssi7: ssi-7 {
1337 interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
1338 dmas = <&audma0 0x0f>, <&audma0 0x10>,
1339 <&audma0 0x79>, <&audma0 0x7a>;
1340 dma-names = "rx", "tx", "rxu", "txu";
1341 };
1342 ssi8: ssi-8 {
1343 interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
1344 dmas = <&audma0 0x11>, <&audma0 0x12>,
1345 <&audma0 0x7b>, <&audma0 0x7c>;
1346 dma-names = "rx", "tx", "rxu", "txu";
1347 };
1348 ssi9: ssi-9 {
1349 interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
1350 dmas = <&audma0 0x13>, <&audma0 0x14>,
1351 <&audma0 0x7d>, <&audma0 0x7e>;
1352 dma-names = "rx", "tx", "rxu", "txu";
1353 };
1354 };
1355 }; 1406 };
1356}; 1407};
diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
index 3b704cfed69a..a97458112ff6 100644
--- a/arch/arm/boot/dts/rk3036.dtsi
+++ b/arch/arm/boot/dts/rk3036.dtsi
@@ -280,7 +280,7 @@
280 max-frequency = <37500000>; 280 max-frequency = <37500000>;
281 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, 281 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
282 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; 282 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
283 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 283 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
284 fifo-depth = <0x100>; 284 fifo-depth = <0x100>;
285 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; 285 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
286 resets = <&cru SRST_SDIO>; 286 resets = <&cru SRST_SDIO>;
@@ -298,7 +298,7 @@
298 max-frequency = <37500000>; 298 max-frequency = <37500000>;
299 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, 299 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
300 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; 300 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
301 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 301 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
302 default-sample-phase = <158>; 302 default-sample-phase = <158>;
303 disable-wp; 303 disable-wp;
304 dmas = <&pdma 12>; 304 dmas = <&pdma 12>;
diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
index 780ec3a99b21..341deaf62ff6 100644
--- a/arch/arm/boot/dts/rk322x.dtsi
+++ b/arch/arm/boot/dts/rk322x.dtsi
@@ -621,7 +621,7 @@
621 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; 621 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
622 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, 622 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
623 <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; 623 <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
624 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 624 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
625 fifo-depth = <0x100>; 625 fifo-depth = <0x100>;
626 pinctrl-names = "default"; 626 pinctrl-names = "default";
627 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; 627 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
@@ -634,7 +634,7 @@
634 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; 634 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
635 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, 635 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
636 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; 636 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
637 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 637 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
638 fifo-depth = <0x100>; 638 fifo-depth = <0x100>;
639 pinctrl-names = "default"; 639 pinctrl-names = "default";
640 pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>; 640 pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>;
@@ -649,7 +649,7 @@
649 max-frequency = <37500000>; 649 max-frequency = <37500000>;
650 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, 650 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
651 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; 651 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
652 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 652 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
653 bus-width = <8>; 653 bus-width = <8>;
654 default-sample-phase = <158>; 654 default-sample-phase = <158>;
655 fifo-depth = <0x100>; 655 fifo-depth = <0x100>;
diff --git a/arch/arm/boot/dts/rk3288-phycore-som.dtsi b/arch/arm/boot/dts/rk3288-phycore-som.dtsi
index 99cfae875e12..5eae4776ffde 100644
--- a/arch/arm/boot/dts/rk3288-phycore-som.dtsi
+++ b/arch/arm/boot/dts/rk3288-phycore-som.dtsi
@@ -110,26 +110,6 @@
110 }; 110 };
111}; 111};
112 112
113&cpu0 {
114 cpu0-supply = <&vdd_cpu>;
115 operating-points = <
116 /* KHz uV */
117 1800000 1400000
118 1608000 1350000
119 1512000 1300000
120 1416000 1200000
121 1200000 1100000
122 1008000 1050000
123 816000 1000000
124 696000 950000
125 600000 900000
126 408000 900000
127 312000 900000
128 216000 900000
129 126000 900000
130 >;
131};
132
133&emmc { 113&emmc {
134 status = "okay"; 114 status = "okay";
135 bus-width = <8>; 115 bus-width = <8>;
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index b9c05b57735e..eae5e1ee9cd8 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -861,24 +861,24 @@
861 uart0 { 861 uart0 {
862 pinctrl_uart0: uart0-0 { 862 pinctrl_uart0: uart0-0 {
863 atmel,pins = 863 atmel,pins =
864 <AT91_PIOC 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* conflicts with PWMFI2, ISI_D8 */ 864 <AT91_PIOC 29 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* conflicts with PWMFI2, ISI_D8 */
865 AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* conflicts with ISI_PCK */ 865 AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* conflicts with ISI_PCK */
866 }; 866 };
867 }; 867 };
868 868
869 uart1 { 869 uart1 {
870 pinctrl_uart1: uart1-0 { 870 pinctrl_uart1: uart1-0 {
871 atmel,pins = 871 atmel,pins =
872 <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE /* conflicts with TWD0, ISI_VSYNC */ 872 <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* conflicts with TWD0, ISI_VSYNC */
873 AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>; /* conflicts with TWCK0, ISI_HSYNC */ 873 AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with TWCK0, ISI_HSYNC */
874 }; 874 };
875 }; 875 };
876 876
877 usart0 { 877 usart0 {
878 pinctrl_usart0: usart0-0 { 878 pinctrl_usart0: usart0-0 {
879 atmel,pins = 879 atmel,pins =
880 <AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD17 periph A */ 880 <AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
881 AT91_PIOD 18 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PD18 periph A with pullup */ 881 AT91_PIOD 18 AT91_PERIPH_A AT91_PINCTRL_NONE>;
882 }; 882 };
883 883
884 pinctrl_usart0_rts_cts: usart0_rts_cts-0 { 884 pinctrl_usart0_rts_cts: usart0_rts_cts-0 {
@@ -891,8 +891,8 @@
891 usart1 { 891 usart1 {
892 pinctrl_usart1: usart1-0 { 892 pinctrl_usart1: usart1-0 {
893 atmel,pins = 893 atmel,pins =
894 <AT91_PIOB 28 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB28 periph A */ 894 <AT91_PIOB 28 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
895 AT91_PIOB 29 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PB29 periph A with pullup */ 895 AT91_PIOB 29 AT91_PERIPH_A AT91_PINCTRL_NONE>;
896 }; 896 };
897 897
898 pinctrl_usart1_rts_cts: usart1_rts_cts-0 { 898 pinctrl_usart1_rts_cts: usart1_rts_cts-0 {
@@ -905,8 +905,8 @@
905 usart2 { 905 usart2 {
906 pinctrl_usart2: usart2-0 { 906 pinctrl_usart2: usart2-0 {
907 atmel,pins = 907 atmel,pins =
908 <AT91_PIOE 25 AT91_PERIPH_B AT91_PINCTRL_NONE /* PE25 periph B, conflicts with A25 */ 908 <AT91_PIOE 25 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* conflicts with A25 */
909 AT91_PIOE 26 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>; /* PE26 periph B with pullup, conflicts NCS0 */ 909 AT91_PIOE 26 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts NCS0 */
910 }; 910 };
911 911
912 pinctrl_usart2_rts_cts: usart2_rts_cts-0 { 912 pinctrl_usart2_rts_cts: usart2_rts_cts-0 {
@@ -919,8 +919,8 @@
919 usart3 { 919 usart3 {
920 pinctrl_usart3: usart3-0 { 920 pinctrl_usart3: usart3-0 {
921 atmel,pins = 921 atmel,pins =
922 <AT91_PIOE 18 AT91_PERIPH_B AT91_PINCTRL_NONE /* PE18 periph B, conflicts with A18 */ 922 <AT91_PIOE 18 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* conflicts with A18 */
923 AT91_PIOE 19 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>; /* PE19 periph B with pullup, conflicts with A19 */ 923 AT91_PIOE 19 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with A19 */
924 }; 924 };
925 925
926 pinctrl_usart3_rts_cts: usart3_rts_cts-0 { 926 pinctrl_usart3_rts_cts: usart3_rts_cts-0 {
diff --git a/arch/arm/boot/dts/sama5d34ek.dts b/arch/arm/boot/dts/sama5d34ek.dts
index c8b8449fdc3e..15d5c46013a4 100644
--- a/arch/arm/boot/dts/sama5d34ek.dts
+++ b/arch/arm/boot/dts/sama5d34ek.dts
@@ -38,7 +38,7 @@
38 status = "okay"; 38 status = "okay";
39 39
40 24c256@50 { 40 24c256@50 {
41 compatible = "24c256"; 41 compatible = "atmel,24c256";
42 reg = <0x50>; 42 reg = <0x50>;
43 pagesize = <64>; 43 pagesize = <64>;
44 }; 44 };
diff --git a/arch/arm/boot/dts/sama5d3_uart.dtsi b/arch/arm/boot/dts/sama5d3_uart.dtsi
index 186377d41c91..f599f8a5f664 100644
--- a/arch/arm/boot/dts/sama5d3_uart.dtsi
+++ b/arch/arm/boot/dts/sama5d3_uart.dtsi
@@ -23,16 +23,16 @@
23 uart0 { 23 uart0 {
24 pinctrl_uart0: uart0-0 { 24 pinctrl_uart0: uart0-0 {
25 atmel,pins = 25 atmel,pins =
26 <AT91_PIOC 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* PC29 periph A, conflicts with PWMFI2, ISI_D8 */ 26 <AT91_PIOC 29 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* conflicts with PWMFI2, ISI_D8 */
27 AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PC30 periph A with pullup, conflicts with ISI_PCK */ 27 AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* conflicts with ISI_PCK */
28 }; 28 };
29 }; 29 };
30 30
31 uart1 { 31 uart1 {
32 pinctrl_uart1: uart1-0 { 32 pinctrl_uart1: uart1-0 {
33 atmel,pins = 33 atmel,pins =
34 <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA30 periph B, conflicts with TWD0, ISI_VSYNC */ 34 <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* conflicts with TWD0, ISI_VSYNC */
35 AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>; /* PA31 periph B with pullup, conflicts with TWCK0, ISI_HSYNC */ 35 AT91_PIOA 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with TWCK0, ISI_HSYNC */
36 }; 36 };
37 }; 37 };
38 }; 38 };
diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index 373b3621b536..0cf9beddd556 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -1379,7 +1379,7 @@
1379 pinctrl@fc06a000 { 1379 pinctrl@fc06a000 {
1380 #address-cells = <1>; 1380 #address-cells = <1>;
1381 #size-cells = <1>; 1381 #size-cells = <1>;
1382 compatible = "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl", "simple-bus"; 1382 compatible = "atmel,sama5d3-pinctrl", "atmel,at91sam9x5-pinctrl", "simple-bus";
1383 ranges = <0xfc068000 0xfc068000 0x100 1383 ranges = <0xfc068000 0xfc068000 0x100
1384 0xfc06a000 0xfc06a000 0x4000>; 1384 0xfc06a000 0xfc06a000 0x4000>;
1385 /* WARNING: revisit as pin spec has changed */ 1385 /* WARNING: revisit as pin spec has changed */
@@ -1926,8 +1926,8 @@
1926 uart0 { 1926 uart0 {
1927 pinctrl_uart0: uart0-0 { 1927 pinctrl_uart0: uart0-0 {
1928 atmel,pins = 1928 atmel,pins =
1929 <AT91_PIOE 29 AT91_PERIPH_B AT91_PINCTRL_NONE /* RXD */ 1929 <AT91_PIOE 29 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* RXD */
1930 AT91_PIOE 30 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* TXD */ 1930 AT91_PIOE 30 AT91_PERIPH_B AT91_PINCTRL_NONE /* TXD */
1931 >; 1931 >;
1932 }; 1932 };
1933 }; 1933 };
@@ -1935,8 +1935,8 @@
1935 uart1 { 1935 uart1 {
1936 pinctrl_uart1: uart1-0 { 1936 pinctrl_uart1: uart1-0 {
1937 atmel,pins = 1937 atmel,pins =
1938 <AT91_PIOC 25 AT91_PERIPH_C AT91_PINCTRL_NONE /* RXD */ 1938 <AT91_PIOC 25 AT91_PERIPH_C AT91_PINCTRL_PULL_UP /* RXD */
1939 AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_PULL_UP /* TXD */ 1939 AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_NONE /* TXD */
1940 >; 1940 >;
1941 }; 1941 };
1942 }; 1942 };
@@ -1944,8 +1944,8 @@
1944 usart0 { 1944 usart0 {
1945 pinctrl_usart0: usart0-0 { 1945 pinctrl_usart0: usart0-0 {
1946 atmel,pins = 1946 atmel,pins =
1947 <AT91_PIOD 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* RXD */ 1947 <AT91_PIOD 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* RXD */
1948 AT91_PIOD 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* TXD */ 1948 AT91_PIOD 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* TXD */
1949 >; 1949 >;
1950 }; 1950 };
1951 pinctrl_usart0_rts: usart0_rts-0 { 1951 pinctrl_usart0_rts: usart0_rts-0 {
@@ -1959,8 +1959,8 @@
1959 usart1 { 1959 usart1 {
1960 pinctrl_usart1: usart1-0 { 1960 pinctrl_usart1: usart1-0 {
1961 atmel,pins = 1961 atmel,pins =
1962 <AT91_PIOD 16 AT91_PERIPH_A AT91_PINCTRL_NONE /* RXD */ 1962 <AT91_PIOD 16 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* RXD */
1963 AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* TXD */ 1963 AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* TXD */
1964 >; 1964 >;
1965 }; 1965 };
1966 pinctrl_usart1_rts: usart1_rts-0 { 1966 pinctrl_usart1_rts: usart1_rts-0 {
@@ -1974,8 +1974,8 @@
1974 usart2 { 1974 usart2 {
1975 pinctrl_usart2: usart2-0 { 1975 pinctrl_usart2: usart2-0 {
1976 atmel,pins = 1976 atmel,pins =
1977 <AT91_PIOB 4 AT91_PERIPH_B AT91_PINCTRL_NONE /* RXD - conflicts with G0_CRS, ISI_HSYNC */ 1977 <AT91_PIOB 4 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* RXD - conflicts with G0_CRS, ISI_HSYNC */
1978 AT91_PIOB 5 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* TXD - conflicts with G0_COL, PCK2 */ 1978 AT91_PIOB 5 AT91_PERIPH_B AT91_PINCTRL_NONE /* TXD - conflicts with G0_COL, PCK2 */
1979 >; 1979 >;
1980 }; 1980 };
1981 pinctrl_usart2_rts: usart2_rts-0 { 1981 pinctrl_usart2_rts: usart2_rts-0 {
@@ -1989,8 +1989,8 @@
1989 usart3 { 1989 usart3 {
1990 pinctrl_usart3: usart3-0 { 1990 pinctrl_usart3: usart3-0 {
1991 atmel,pins = 1991 atmel,pins =
1992 <AT91_PIOE 16 AT91_PERIPH_B AT91_PINCTRL_NONE /* RXD */ 1992 <AT91_PIOE 16 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* RXD */
1993 AT91_PIOE 17 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* TXD */ 1993 AT91_PIOE 17 AT91_PERIPH_B AT91_PINCTRL_NONE /* TXD */
1994 >; 1994 >;
1995 }; 1995 };
1996 }; 1996 };
@@ -1998,8 +1998,8 @@
1998 usart4 { 1998 usart4 {
1999 pinctrl_usart4: usart4-0 { 1999 pinctrl_usart4: usart4-0 {
2000 atmel,pins = 2000 atmel,pins =
2001 <AT91_PIOE 26 AT91_PERIPH_B AT91_PINCTRL_NONE /* RXD */ 2001 <AT91_PIOE 26 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* RXD */
2002 AT91_PIOE 27 AT91_PERIPH_B AT91_PINCTRL_PULL_UP /* TXD */ 2002 AT91_PIOE 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* TXD */
2003 >; 2003 >;
2004 }; 2004 };
2005 pinctrl_usart4_rts: usart4_rts-0 { 2005 pinctrl_usart4_rts: usart4_rts-0 {
diff --git a/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi b/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi
deleted file mode 100644
index dbdda36179ee..000000000000
--- a/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi
+++ /dev/null
@@ -1,68 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Timings and Geometry for Samsung K3PE0E000B memory part
4 */
5
6/ {
7 samsung_K3PE0E000B: lpddr2 {
8 compatible = "Samsung,K3PE0E000B","jedec,lpddr2-s4";
9 density = <4096>;
10 io-width = <32>;
11
12 tRPab-min-tck = <3>;
13 tRCD-min-tck = <3>;
14 tWR-min-tck = <3>;
15 tRASmin-min-tck = <3>;
16 tRRD-min-tck = <2>;
17 tWTR-min-tck = <2>;
18 tXP-min-tck = <2>;
19 tRTP-min-tck = <2>;
20 tCKE-min-tck = <3>;
21 tCKESR-min-tck = <3>;
22 tFAW-min-tck = <8>;
23
24 timings_samsung_K3PE0E000B_533MHz: lpddr2-timings@0 {
25 compatible = "jedec,lpddr2-timings";
26 min-freq = <10000000>;
27 max-freq = <533333333>;
28 tRPab = <21000>;
29 tRCD = <18000>;
30 tWR = <15000>;
31 tRAS-min = <42000>;
32 tRRD = <10000>;
33 tWTR = <7500>;
34 tXP = <7500>;
35 tRTP = <7500>;
36 tCKESR = <15000>;
37 tDQSCK-max = <5500>;
38 tFAW = <50000>;
39 tZQCS = <90000>;
40 tZQCL = <360000>;
41 tZQinit = <1000000>;
42 tRAS-max-ns = <70000>;
43 tDQSCK-max-derated = <6000>;
44 };
45
46 timings_samsung_K3PE0E000B_266MHz: lpddr2-timings@1 {
47 compatible = "jedec,lpddr2-timings";
48 min-freq = <10000000>;
49 max-freq = <266666666>;
50 tRPab = <21000>;
51 tRCD = <18000>;
52 tWR = <15000>;
53 tRAS-min = <42000>;
54 tRRD = <10000>;
55 tWTR = <7500>;
56 tXP = <7500>;
57 tRTP = <7500>;
58 tCKESR = <15000>;
59 tDQSCK-max = <5500>;
60 tFAW = <50000>;
61 tZQCS = <90000>;
62 tZQCL = <360000>;
63 tZQinit = <1000000>;
64 tRAS-max-ns = <70000>;
65 tDQSCK-max-derated = <6000>;
66 };
67 };
68};
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index c42ca7022e8c..486d4e7433ed 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -831,7 +831,7 @@
831 timer@fffec600 { 831 timer@fffec600 {
832 compatible = "arm,cortex-a9-twd-timer"; 832 compatible = "arm,cortex-a9-twd-timer";
833 reg = <0xfffec600 0x100>; 833 reg = <0xfffec600 0x100>;
834 interrupts = <1 13 0xf04>; 834 interrupts = <1 13 0xf01>;
835 clocks = <&mpu_periph_clk>; 835 clocks = <&mpu_periph_clk>;
836 }; 836 };
837 837
diff --git a/arch/arm/boot/dts/stih407-b2120.dts b/arch/arm/boot/dts/stih407-b2120.dts
index c8ad905d0309..de3c8bf129b5 100644
--- a/arch/arm/boot/dts/stih407-b2120.dts
+++ b/arch/arm/boot/dts/stih407-b2120.dts
@@ -15,10 +15,10 @@
15 15
16 chosen { 16 chosen {
17 bootargs = "console=ttyAS0,115200 clk_ignore_unused"; 17 bootargs = "console=ttyAS0,115200 clk_ignore_unused";
18 linux,stdout-path = &sbc_serial0; 18 stdout-path = &sbc_serial0;
19 }; 19 };
20 20
21 memory { 21 memory@40000000 {
22 device_type = "memory"; 22 device_type = "memory";
23 reg = <0x40000000 0x80000000>; 23 reg = <0x40000000 0x80000000>;
24 }; 24 };
diff --git a/arch/arm/boot/dts/stih407-clock.dtsi b/arch/arm/boot/dts/stih407-clock.dtsi
index d0a24d9e517a..ea7833489832 100644
--- a/arch/arm/boot/dts/stih407-clock.dtsi
+++ b/arch/arm/boot/dts/stih407-clock.dtsi
@@ -7,33 +7,27 @@
7 */ 7 */
8#include <dt-bindings/clock/stih407-clks.h> 8#include <dt-bindings/clock/stih407-clks.h>
9/ { 9/ {
10 /*
11 * Fixed 30MHz oscillator inputs to SoC
12 */
13 clk_sysin: clk-sysin {
14 #clock-cells = <0>;
15 compatible = "fixed-clock";
16 clock-frequency = <30000000>;
17 };
18
19 clk_tmdsout_hdmi: clk-tmdsout-hdmi {
20 #clock-cells = <0>;
21 compatible = "fixed-clock";
22 clock-frequency = <0>;
23 };
24
10 clocks { 25 clocks {
11 #address-cells = <1>; 26 #address-cells = <1>;
12 #size-cells = <1>; 27 #size-cells = <1>;
13 ranges; 28 ranges;
14 29
15 /* 30 /*
16 * Fixed 30MHz oscillator inputs to SoC
17 */
18 clk_sysin: clk-sysin {
19 #clock-cells = <0>;
20 compatible = "fixed-clock";
21 clock-frequency = <30000000>;
22 };
23
24 /*
25 * ARM Peripheral clock for timers
26 */
27 arm_periph_clk: clk-m-a9-periphs {
28 #clock-cells = <0>;
29 compatible = "fixed-factor-clock";
30
31 clocks = <&clk_m_a9>;
32 clock-div = <2>;
33 clock-mult = <1>;
34 };
35
36 /*
37 * A9 PLL. 31 * A9 PLL.
38 */ 32 */
39 clockgen-a9@92b0000 { 33 clockgen-a9@92b0000 {
@@ -62,32 +56,19 @@
62 <&clockgen_a9_pll 0>, 56 <&clockgen_a9_pll 0>,
63 <&clk_s_c0_flexgen 13>, 57 <&clk_s_c0_flexgen 13>,
64 <&clk_m_a9_ext2f_div2>; 58 <&clk_m_a9_ext2f_div2>;
65 };
66 59
67 /*
68 * ARM Peripheral clock for timers
69 */
70 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
71 #clock-cells = <0>;
72 compatible = "fixed-factor-clock";
73
74 clocks = <&clk_s_c0_flexgen 13>;
75
76 clock-output-names = "clk-m-a9-ext2f-div2";
77 60
78 clock-div = <2>; 61 /*
79 clock-mult = <1>; 62 * ARM Peripheral clock for timers
80 }; 63 */
64 arm_periph_clk: clk-m-a9-periphs {
65 #clock-cells = <0>;
66 compatible = "fixed-factor-clock";
81 67
82 /* 68 clocks = <&clk_m_a9>;
83 * Bootloader initialized system infrastructure clock for 69 clock-div = <2>;
84 * serial devices. 70 clock-mult = <1>;
85 */ 71 };
86 clk_ext2f_a9: clockgen-c0@13 {
87 #clock-cells = <0>;
88 compatible = "fixed-clock";
89 clock-frequency = <200000000>;
90 clock-output-names = "clk-s-icn-reg-0";
91 }; 72 };
92 73
93 clockgen-a@90ff000 { 74 clockgen-a@90ff000 {
@@ -204,6 +185,21 @@
204 <CLK_EXT2F_A9>, 185 <CLK_EXT2F_A9>,
205 <CLK_ICN_LMI>, 186 <CLK_ICN_LMI>,
206 <CLK_ICN_SBC>; 187 <CLK_ICN_SBC>;
188
189 /*
190 * ARM Peripheral clock for timers
191 */
192 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
193 #clock-cells = <0>;
194 compatible = "fixed-factor-clock";
195
196 clocks = <&clk_s_c0_flexgen 13>;
197
198 clock-output-names = "clk-m-a9-ext2f-div2";
199
200 clock-div = <2>;
201 clock-mult = <1>;
202 };
207 }; 203 };
208 }; 204 };
209 205
@@ -254,13 +250,7 @@
254 "clk-s-d2-fs0-ch3"; 250 "clk-s-d2-fs0-ch3";
255 }; 251 };
256 252
257 clk_tmdsout_hdmi: clk-tmdsout-hdmi { 253 clockgen-d2@9106000 {
258 #clock-cells = <0>;
259 compatible = "fixed-clock";
260 clock-frequency = <0>;
261 };
262
263 clockgen-d2@x9106000 {
264 compatible = "st,clkgen-c32"; 254 compatible = "st,clkgen-c32";
265 reg = <0x9106000 0x1000>; 255 reg = <0x9106000 0x1000>;
266 256
diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
index cf3756976c39..f7362c31de29 100644
--- a/arch/arm/boot/dts/stih407-family.dtsi
+++ b/arch/arm/boot/dts/stih407-family.dtsi
@@ -92,7 +92,7 @@
92 clocks = <&arm_periph_clk>; 92 clocks = <&arm_periph_clk>;
93 }; 93 };
94 94
95 l2: cache-controller { 95 l2: cache-controller@8762000 {
96 compatible = "arm,pl310-cache"; 96 compatible = "arm,pl310-cache";
97 reg = <0x08762000 0x1000>; 97 reg = <0x08762000 0x1000>;
98 arm,data-latency = <3 3 3>; 98 arm,data-latency = <3 3 3>;
@@ -125,24 +125,28 @@
125 ranges; 125 ranges;
126 compatible = "simple-bus"; 126 compatible = "simple-bus";
127 127
128 restart { 128 restart: restart-controller@0 {
129 compatible = "st,stih407-restart"; 129 compatible = "st,stih407-restart";
130 reg = <0 0>;
130 st,syscfg = <&syscfg_sbc_reg>; 131 st,syscfg = <&syscfg_sbc_reg>;
131 status = "okay"; 132 status = "okay";
132 }; 133 };
133 134
134 powerdown: powerdown-controller { 135 powerdown: powerdown-controller@0 {
135 compatible = "st,stih407-powerdown"; 136 compatible = "st,stih407-powerdown";
137 reg = <0 0>;
136 #reset-cells = <1>; 138 #reset-cells = <1>;
137 }; 139 };
138 140
139 softreset: softreset-controller { 141 softreset: softreset-controller@0 {
140 compatible = "st,stih407-softreset"; 142 compatible = "st,stih407-softreset";
143 reg = <0 0>;
141 #reset-cells = <1>; 144 #reset-cells = <1>;
142 }; 145 };
143 146
144 picophyreset: picophyreset-controller { 147 picophyreset: picophyreset-controller@0 {
145 compatible = "st,stih407-picophyreset"; 148 compatible = "st,stih407-picophyreset";
149 reg = <0 0>;
146 #reset-cells = <1>; 150 #reset-cells = <1>;
147 }; 151 };
148 152
@@ -174,6 +178,13 @@
174 syscfg_core: core-syscfg@92b0000 { 178 syscfg_core: core-syscfg@92b0000 {
175 compatible = "st,stih407-core-syscfg", "syscon"; 179 compatible = "st,stih407-core-syscfg", "syscon";
176 reg = <0x92b0000 0x1000>; 180 reg = <0x92b0000 0x1000>;
181
182 sti_sasg_codec: sti-sasg-codec {
183 compatible = "st,stih407-sas-codec";
184 #sound-dai-cells = <1>;
185 status = "disabled";
186 st,syscfg = <&syscfg_core>;
187 };
177 }; 188 };
178 189
179 syscfg_lpm: lpm-syscfg@94b5100 { 190 syscfg_lpm: lpm-syscfg@94b5100 {
@@ -181,8 +192,9 @@
181 reg = <0x94b5100 0x1000>; 192 reg = <0x94b5100 0x1000>;
182 }; 193 };
183 194
184 irq-syscfg { 195 irq-syscfg@0 {
185 compatible = "st,stih407-irq-syscfg"; 196 compatible = "st,stih407-irq-syscfg";
197 reg = <0 0>;
186 st,syscfg = <&syscfg_core>; 198 st,syscfg = <&syscfg_core>;
187 st,irq-device = <ST_IRQ_SYSCFG_PMU_0>, 199 st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
188 <ST_IRQ_SYSCFG_PMU_1>; 200 <ST_IRQ_SYSCFG_PMU_1>;
@@ -380,8 +392,9 @@
380 status = "disabled"; 392 status = "disabled";
381 }; 393 };
382 394
383 usb2_picophy0: phy1 { 395 usb2_picophy0: phy1@0 {
384 compatible = "st,stih407-usb2-phy"; 396 compatible = "st,stih407-usb2-phy";
397 reg = <0 0>;
385 #phy-cells = <0>; 398 #phy-cells = <0>;
386 st,syscfg = <&syscfg_core 0x100 0xf4>; 399 st,syscfg = <&syscfg_core 0x100 0xf4>;
387 resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 400 resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
@@ -389,12 +402,13 @@
389 reset-names = "global", "port"; 402 reset-names = "global", "port";
390 }; 403 };
391 404
392 miphy28lp_phy: miphy28lp@9b22000 { 405 miphy28lp_phy: miphy28lp@0 {
393 compatible = "st,miphy28lp-phy"; 406 compatible = "st,miphy28lp-phy";
394 st,syscfg = <&syscfg_core>; 407 st,syscfg = <&syscfg_core>;
395 #address-cells = <1>; 408 #address-cells = <1>;
396 #size-cells = <1>; 409 #size-cells = <1>;
397 ranges; 410 ranges;
411 reg = <0 0>;
398 412
399 phy_port0: port@9b22000 { 413 phy_port0: port@9b22000 {
400 reg = <0x9b22000 0xff>, 414 reg = <0x9b22000 0xff>,
@@ -805,6 +819,7 @@
805 819
806 st231_gp0: st231-gp0@0 { 820 st231_gp0: st231-gp0@0 {
807 compatible = "st,st231-rproc"; 821 compatible = "st,st231-rproc";
822 reg = <0 0>;
808 memory-region = <&gp0_reserved>; 823 memory-region = <&gp0_reserved>;
809 resets = <&softreset STIH407_ST231_GP0_SOFTRESET>; 824 resets = <&softreset STIH407_ST231_GP0_SOFTRESET>;
810 reset-names = "sw_reset"; 825 reset-names = "sw_reset";
@@ -818,6 +833,7 @@
818 833
819 st231_delta: st231-delta@0 { 834 st231_delta: st231-delta@0 {
820 compatible = "st,st231-rproc"; 835 compatible = "st,st231-rproc";
836 reg = <0 0>;
821 memory-region = <&delta_reserved>; 837 memory-region = <&delta_reserved>;
822 resets = <&softreset STIH407_ST231_DMU_SOFTRESET>; 838 resets = <&softreset STIH407_ST231_DMU_SOFTRESET>;
823 reset-names = "sw_reset"; 839 reset-names = "sw_reset";
@@ -885,13 +901,6 @@
885 status = "disabled"; 901 status = "disabled";
886 }; 902 };
887 903
888 sti_sasg_codec: sti-sasg-codec {
889 compatible = "st,stih407-sas-codec";
890 #sound-dai-cells = <1>;
891 status = "disabled";
892 st,syscfg = <&syscfg_core>;
893 };
894
895 sti_uni_player0: sti-uni-player@8d80000 { 904 sti_uni_player0: sti-uni-player@8d80000 {
896 compatible = "st,stih407-uni-player-hdmi"; 905 compatible = "st,stih407-uni-player-hdmi";
897 #sound-dai-cells = <0>; 906 #sound-dai-cells = <0>;
@@ -980,8 +989,9 @@
980 status = "disabled"; 989 status = "disabled";
981 }; 990 };
982 991
983 delta0 { 992 delta0@0 {
984 compatible = "st,st-delta"; 993 compatible = "st,st-delta";
994 reg = <0 0>;
985 clock-names = "delta", 995 clock-names = "delta",
986 "delta-st231", 996 "delta-st231",
987 "delta-flash-promip"; 997 "delta-flash-promip";
diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi b/arch/arm/boot/dts/stih407-pinctrl.dtsi
index a29090077fdf..53c6888d1fc0 100644
--- a/arch/arm/boot/dts/stih407-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stih407-pinctrl.dtsi
@@ -45,7 +45,7 @@
45 }; 45 };
46 46
47 soc { 47 soc {
48 pin-controller-sbc { 48 pin-controller-sbc@961f080 {
49 #address-cells = <1>; 49 #address-cells = <1>;
50 #size-cells = <1>; 50 #size-cells = <1>;
51 compatible = "st,stih407-sbc-pinctrl"; 51 compatible = "st,stih407-sbc-pinctrl";
@@ -369,7 +369,7 @@
369 }; 369 };
370 }; 370 };
371 371
372 pin-controller-front0 { 372 pin-controller-front0@920f080 {
373 #address-cells = <1>; 373 #address-cells = <1>;
374 #size-cells = <1>; 374 #size-cells = <1>;
375 compatible = "st,stih407-front-pinctrl"; 375 compatible = "st,stih407-front-pinctrl";
@@ -929,7 +929,7 @@
929 }; 929 };
930 }; 930 };
931 931
932 pin-controller-front1 { 932 pin-controller-front1@921f080 {
933 #address-cells = <1>; 933 #address-cells = <1>;
934 #size-cells = <1>; 934 #size-cells = <1>;
935 compatible = "st,stih407-front-pinctrl"; 935 compatible = "st,stih407-front-pinctrl";
@@ -962,7 +962,7 @@
962 }; 962 };
963 }; 963 };
964 964
965 pin-controller-rear { 965 pin-controller-rear@922f080 {
966 #address-cells = <1>; 966 #address-cells = <1>;
967 #size-cells = <1>; 967 #size-cells = <1>;
968 compatible = "st,stih407-rear-pinctrl"; 968 compatible = "st,stih407-rear-pinctrl";
@@ -1157,7 +1157,7 @@
1157 }; 1157 };
1158 }; 1158 };
1159 1159
1160 pin-controller-flash { 1160 pin-controller-flash@923f080 {
1161 #address-cells = <1>; 1161 #address-cells = <1>;
1162 #size-cells = <1>; 1162 #size-cells = <1>;
1163 compatible = "st,stih407-flash-pinctrl"; 1163 compatible = "st,stih407-flash-pinctrl";
diff --git a/arch/arm/boot/dts/stih407.dtsi b/arch/arm/boot/dts/stih407.dtsi
index 11fdecd9312e..57efc87dec2b 100644
--- a/arch/arm/boot/dts/stih407.dtsi
+++ b/arch/arm/boot/dts/stih407.dtsi
@@ -11,11 +11,11 @@
11#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/gpio/gpio.h>
12/ { 12/ {
13 soc { 13 soc {
14 sti-display-subsystem { 14 sti-display-subsystem@0 {
15 compatible = "st,sti-display-subsystem"; 15 compatible = "st,sti-display-subsystem";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 18 reg = <0 0>;
19 assigned-clocks = <&clk_s_d2_quadfs 0>, 19 assigned-clocks = <&clk_s_d2_quadfs 0>,
20 <&clk_s_d2_quadfs 1>, 20 <&clk_s_d2_quadfs 1>,
21 <&clk_s_c0_pll1 0>, 21 <&clk_s_c0_pll1 0>,
@@ -107,6 +107,7 @@
107 compatible = "st,stih407-hdmi"; 107 compatible = "st,stih407-hdmi";
108 reg = <0x8d04000 0x1000>; 108 reg = <0x8d04000 0x1000>;
109 reg-names = "hdmi-reg"; 109 reg-names = "hdmi-reg";
110 #sound-dai-cells = <0>;
110 interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>; 111 interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
111 interrupt-names = "irq"; 112 interrupt-names = "irq";
112 clock-names = "pix", 113 clock-names = "pix",
diff --git a/arch/arm/boot/dts/stih410-b2120.dts b/arch/arm/boot/dts/stih410-b2120.dts
index 9830be577433..0a59b7b0f4b2 100644
--- a/arch/arm/boot/dts/stih410-b2120.dts
+++ b/arch/arm/boot/dts/stih410-b2120.dts
@@ -15,10 +15,10 @@
15 15
16 chosen { 16 chosen {
17 bootargs = "console=ttyAS0,115200 clk_ignore_unused"; 17 bootargs = "console=ttyAS0,115200 clk_ignore_unused";
18 linux,stdout-path = &sbc_serial0; 18 stdout-path = &sbc_serial0;
19 }; 19 };
20 20
21 memory { 21 memory@40000000 {
22 device_type = "memory"; 22 device_type = "memory";
23 reg = <0x40000000 0x80000000>; 23 reg = <0x40000000 0x80000000>;
24 }; 24 };
@@ -37,11 +37,11 @@
37 sd-uhs-ddr50; 37 sd-uhs-ddr50;
38 }; 38 };
39 39
40 usb2_picophy1: phy2 { 40 usb2_picophy1: phy2@0 {
41 status = "okay"; 41 status = "okay";
42 }; 42 };
43 43
44 usb2_picophy2: phy3 { 44 usb2_picophy2: phy3@0 {
45 status = "okay"; 45 status = "okay";
46 }; 46 };
47 47
@@ -61,7 +61,7 @@
61 status = "okay"; 61 status = "okay";
62 }; 62 };
63 63
64 sti-display-subsystem { 64 sti-display-subsystem@0 {
65 sti-hda@8d02000 { 65 sti-hda@8d02000 {
66 status = "okay"; 66 status = "okay";
67 }; 67 };
diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index c663b70c43a7..feb8834478fa 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -16,10 +16,10 @@
16 16
17 chosen { 17 chosen {
18 bootargs = "console=ttyAS1,115200 clk_ignore_unused"; 18 bootargs = "console=ttyAS1,115200 clk_ignore_unused";
19 linux,stdout-path = &uart1; 19 stdout-path = &uart1;
20 }; 20 };
21 21
22 memory { 22 memory@40000000 {
23 device_type = "memory"; 23 device_type = "memory";
24 reg = <0x40000000 0x40000000>; 24 reg = <0x40000000 0x40000000>;
25 }; 25 };
@@ -29,36 +29,54 @@
29 ethernet0 = &ethernet0; 29 ethernet0 = &ethernet0;
30 }; 30 };
31 31
32 soc { 32 leds {
33 compatible = "gpio-leds";
34 user_green_1 {
35 label = "User_green_1";
36 gpios = <&pio1 3 GPIO_ACTIVE_LOW>;
37 linux,default-trigger = "heartbeat";
38 default-state = "off";
39 };
33 40
34 leds { 41 user_green_2 {
35 compatible = "gpio-leds"; 42 label = "User_green_2";
36 user_green_1 { 43 gpios = <&pio4 1 GPIO_ACTIVE_LOW>;
37 label = "User_green_1"; 44 default-state = "off";
38 gpios = <&pio1 3 GPIO_ACTIVE_LOW>; 45 };
39 linux,default-trigger = "heartbeat";
40 default-state = "off";
41 };
42 46
43 user_green_2 { 47 user_green_3 {
44 label = "User_green_2"; 48 label = "User_green_3";
45 gpios = <&pio4 1 GPIO_ACTIVE_LOW>; 49 gpios = <&pio2 1 GPIO_ACTIVE_LOW>;
46 default-state = "off"; 50 default-state = "off";
47 }; 51 };
52
53 user_green_4 {
54 label = "User_green_4";
55 gpios = <&pio2 5 GPIO_ACTIVE_LOW>;
56 default-state = "off";
57 };
58 };
48 59
49 user_green_3 { 60 sound: sound {
50 label = "User_green_3"; 61 compatible = "simple-audio-card";
51 gpios = <&pio2 1 GPIO_ACTIVE_LOW>; 62 simple-audio-card,name = "STI-B2260";
52 default-state = "off"; 63 status = "okay";
64
65 simple-audio-card,dai-link0 {
66 /* DAC */
67 format = "i2s";
68 mclk-fs = <128>;
69 cpu {
70 sound-dai = <&sti_uni_player0>;
53 }; 71 };
54 72
55 user_green_4 { 73 codec {
56 label = "User_green_4"; 74 sound-dai = <&sti_hdmi>;
57 gpios = <&pio2 5 GPIO_ACTIVE_LOW>;
58 default-state = "off";
59 }; 75 };
60 }; 76 };
77 };
61 78
79 soc {
62 /* Low speed expansion connector */ 80 /* Low speed expansion connector */
63 uart0: serial@9830000 { 81 uart0: serial@9830000 {
64 label = "LS-UART0"; 82 label = "LS-UART0";
@@ -128,11 +146,11 @@
128 status = "okay"; 146 status = "okay";
129 }; 147 };
130 148
131 usb2_picophy1: phy2 { 149 usb2_picophy1: phy2@0 {
132 status = "okay"; 150 status = "okay";
133 }; 151 };
134 152
135 usb2_picophy2: phy3 { 153 usb2_picophy2: phy3@0 {
136 status = "okay"; 154 status = "okay";
137 }; 155 };
138 156
@@ -182,26 +200,7 @@
182 status = "okay"; 200 status = "okay";
183 }; 201 };
184 202
185 sound { 203 miphy28lp_phy: miphy28lp@0 {
186 compatible = "simple-audio-card";
187 simple-audio-card,name = "STI-B2260";
188 status = "okay";
189
190 simple-audio-card,dai-link@0 {
191 /* DAC */
192 format = "i2s";
193 mclk-fs = <128>;
194 cpu {
195 sound-dai = <&sti_uni_player0>;
196 };
197
198 codec {
199 sound-dai = <&sti_hdmi>;
200 };
201 };
202 };
203
204 miphy28lp_phy: miphy28lp@9b22000 {
205 204
206 phy_port1: port@9b2a000 { 205 phy_port1: port@9b2a000 {
207 st,osc-force-ext; 206 st,osc-force-ext;
diff --git a/arch/arm/boot/dts/stih410-clock.dtsi b/arch/arm/boot/dts/stih410-clock.dtsi
index fde5df17f575..5f11d09cb030 100644
--- a/arch/arm/boot/dts/stih410-clock.dtsi
+++ b/arch/arm/boot/dts/stih410-clock.dtsi
@@ -7,6 +7,22 @@
7 */ 7 */
8#include <dt-bindings/clock/stih410-clks.h> 8#include <dt-bindings/clock/stih410-clks.h>
9/ { 9/ {
10 /*
11 * Fixed 30MHz oscillator inputs to SoC
12 */
13 clk_sysin: clk-sysin {
14 #clock-cells = <0>;
15 compatible = "fixed-clock";
16 clock-frequency = <30000000>;
17 clock-output-names = "CLK_SYSIN";
18 };
19
20 clk_tmdsout_hdmi: clk-tmdsout-hdmi {
21 #clock-cells = <0>;
22 compatible = "fixed-clock";
23 clock-frequency = <0>;
24 };
25
10 clocks { 26 clocks {
11 #address-cells = <1>; 27 #address-cells = <1>;
12 #size-cells = <1>; 28 #size-cells = <1>;
@@ -15,27 +31,6 @@
15 compatible = "st,stih410-clk", "simple-bus"; 31 compatible = "st,stih410-clk", "simple-bus";
16 32
17 /* 33 /*
18 * Fixed 30MHz oscillator inputs to SoC
19 */
20 clk_sysin: clk-sysin {
21 #clock-cells = <0>;
22 compatible = "fixed-clock";
23 clock-frequency = <30000000>;
24 clock-output-names = "CLK_SYSIN";
25 };
26
27 /*
28 * ARM Peripheral clock for timers
29 */
30 arm_periph_clk: clk-m-a9-periphs {
31 #clock-cells = <0>;
32 compatible = "fixed-factor-clock";
33 clocks = <&clk_m_a9>;
34 clock-div = <2>;
35 clock-mult = <1>;
36 };
37
38 /*
39 * A9 PLL. 34 * A9 PLL.
40 */ 35 */
41 clockgen-a9@92b0000 { 36 clockgen-a9@92b0000 {
@@ -64,32 +59,16 @@
64 <&clockgen_a9_pll 0>, 59 <&clockgen_a9_pll 0>,
65 <&clk_s_c0_flexgen 13>, 60 <&clk_s_c0_flexgen 13>,
66 <&clk_m_a9_ext2f_div2>; 61 <&clk_m_a9_ext2f_div2>;
67 }; 62 /*
68 63 * ARM Peripheral clock for timers
69 /* 64 */
70 * ARM Peripheral clock for timers 65 arm_periph_clk: clk-m-a9-periphs {
71 */ 66 #clock-cells = <0>;
72 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s { 67 compatible = "fixed-factor-clock";
73 #clock-cells = <0>; 68 clocks = <&clk_m_a9>;
74 compatible = "fixed-factor-clock"; 69 clock-div = <2>;
75 70 clock-mult = <1>;
76 clocks = <&clk_s_c0_flexgen 13>; 71 };
77
78 clock-output-names = "clk-m-a9-ext2f-div2";
79
80 clock-div = <2>;
81 clock-mult = <1>;
82 };
83
84 /*
85 * Bootloader initialized system infrastructure clock for
86 * serial devices.
87 */
88 clk_ext2f_a9: clockgen-c0@13 {
89 #clock-cells = <0>;
90 compatible = "fixed-clock";
91 clock-frequency = <200000000>;
92 clock-output-names = "clk-s-icn-reg-0";
93 }; 72 };
94 73
95 clockgen-a@90ff000 { 74 clockgen-a@90ff000 {
@@ -214,6 +193,21 @@
214 <CLK_EXT2F_A9>, 193 <CLK_EXT2F_A9>,
215 <CLK_ICN_LMI>, 194 <CLK_ICN_LMI>,
216 <CLK_ICN_SBC>; 195 <CLK_ICN_SBC>;
196
197 /*
198 * ARM Peripheral clock for timers
199 */
200 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
201 #clock-cells = <0>;
202 compatible = "fixed-factor-clock";
203
204 clocks = <&clk_s_c0_flexgen 13>;
205
206 clock-output-names = "clk-m-a9-ext2f-div2";
207
208 clock-div = <2>;
209 clock-mult = <1>;
210 };
217 }; 211 };
218 }; 212 };
219 213
@@ -266,13 +260,7 @@
266 "clk-s-d2-fs0-ch3"; 260 "clk-s-d2-fs0-ch3";
267 }; 261 };
268 262
269 clk_tmdsout_hdmi: clk-tmdsout-hdmi { 263 clockgen-d2@9106000 {
270 #clock-cells = <0>;
271 compatible = "fixed-clock";
272 clock-frequency = <0>;
273 };
274
275 clockgen-d2@x9106000 {
276 compatible = "st,clkgen-c32"; 264 compatible = "st,clkgen-c32";
277 reg = <0x9106000 0x1000>; 265 reg = <0x9106000 0x1000>;
278 266
diff --git a/arch/arm/boot/dts/stih410-pinctrl.dtsi b/arch/arm/boot/dts/stih410-pinctrl.dtsi
index b3e9dfc81c07..5ae1fd66c0b8 100644
--- a/arch/arm/boot/dts/stih410-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stih410-pinctrl.dtsi
@@ -10,7 +10,7 @@
10/ { 10/ {
11 11
12 soc { 12 soc {
13 pin-controller-rear { 13 pin-controller-rear@922f080 {
14 14
15 usb0 { 15 usb0 {
16 pinctrl_usb0: usb2-0 { 16 pinctrl_usb0: usb2-0 {
diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
index 68b5ff91d6a7..3313005ee15c 100644
--- a/arch/arm/boot/dts/stih410.dtsi
+++ b/arch/arm/boot/dts/stih410.dtsi
@@ -16,8 +16,9 @@
16 }; 16 };
17 17
18 soc { 18 soc {
19 usb2_picophy1: phy2 { 19 usb2_picophy1: phy2@0 {
20 compatible = "st,stih407-usb2-phy"; 20 compatible = "st,stih407-usb2-phy";
21 reg = <0 0>;
21 #phy-cells = <0>; 22 #phy-cells = <0>;
22 st,syscfg = <&syscfg_core 0xf8 0xf4>; 23 st,syscfg = <&syscfg_core 0xf8 0xf4>;
23 resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 24 resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
@@ -27,8 +28,9 @@
27 status = "disabled"; 28 status = "disabled";
28 }; 29 };
29 30
30 usb2_picophy2: phy3 { 31 usb2_picophy2: phy3@0 {
31 compatible = "st,stih407-usb2-phy"; 32 compatible = "st,stih407-usb2-phy";
33 reg = <0 0>;
32 #phy-cells = <0>; 34 #phy-cells = <0>;
33 st,syscfg = <&syscfg_core 0xfc 0xf4>; 35 st,syscfg = <&syscfg_core 0xfc 0xf4>;
34 resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 36 resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
@@ -102,11 +104,12 @@
102 status = "disabled"; 104 status = "disabled";
103 }; 105 };
104 106
105 sti-display-subsystem { 107 sti-display-subsystem@0 {
106 compatible = "st,sti-display-subsystem"; 108 compatible = "st,sti-display-subsystem";
107 #address-cells = <1>; 109 #address-cells = <1>;
108 #size-cells = <1>; 110 #size-cells = <1>;
109 111
112 reg = <0 0>;
110 assigned-clocks = <&clk_s_d2_quadfs 0>, 113 assigned-clocks = <&clk_s_d2_quadfs 0>,
111 <&clk_s_d2_quadfs 1>, 114 <&clk_s_d2_quadfs 1>,
112 <&clk_s_c0_pll1 0>, 115 <&clk_s_c0_pll1 0>,
@@ -198,6 +201,7 @@
198 compatible = "st,stih407-hdmi"; 201 compatible = "st,stih407-hdmi";
199 reg = <0x8d04000 0x1000>; 202 reg = <0x8d04000 0x1000>;
200 reg-names = "hdmi-reg"; 203 reg-names = "hdmi-reg";
204 #sound-dai-cells = <0>;
201 interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>; 205 interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
202 interrupt-names = "irq"; 206 interrupt-names = "irq";
203 clock-names = "pix", 207 clock-names = "pix",
@@ -235,7 +239,7 @@
235 <&clk_s_d2_quadfs 1>; 239 <&clk_s_d2_quadfs 1>;
236 }; 240 };
237 241
238 sti-hqvdp@9c000000 { 242 sti-hqvdp@9c00000 {
239 compatible = "st,stih407-hqvdp"; 243 compatible = "st,stih407-hqvdp";
240 reg = <0x9C00000 0x100000>; 244 reg = <0x9C00000 0x100000>;
241 clock-names = "hqvdp", "pix_main"; 245 clock-names = "hqvdp", "pix_main";
@@ -273,7 +277,7 @@
273 interrupts = <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>; 277 interrupts = <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>;
274 }; 278 };
275 279
276 delta0 { 280 delta0@0 {
277 compatible = "st,st-delta"; 281 compatible = "st,st-delta";
278 clock-names = "delta", 282 clock-names = "delta",
279 "delta-st231", 283 "delta-st231",
diff --git a/arch/arm/boot/dts/stih418-b2199.dts b/arch/arm/boot/dts/stih418-b2199.dts
index 4e6d915c85ff..39b4db2e3507 100644
--- a/arch/arm/boot/dts/stih418-b2199.dts
+++ b/arch/arm/boot/dts/stih418-b2199.dts
@@ -15,10 +15,10 @@
15 15
16 chosen { 16 chosen {
17 bootargs = "console=ttyAS0,115200 clk_ignore_unused"; 17 bootargs = "console=ttyAS0,115200 clk_ignore_unused";
18 linux,stdout-path = &sbc_serial0; 18 stdout-path = &sbc_serial0;
19 }; 19 };
20 20
21 memory { 21 memory@40000000 {
22 device_type = "memory"; 22 device_type = "memory";
23 reg = <0x40000000 0xc0000000>; 23 reg = <0x40000000 0xc0000000>;
24 }; 24 };
@@ -28,24 +28,24 @@
28 ethernet0 = &ethernet0; 28 ethernet0 = &ethernet0;
29 }; 29 };
30 30
31 leds {
32 compatible = "gpio-leds";
33 red {
34 label = "Front Panel LED";
35 gpios = <&pio4 1 GPIO_ACTIVE_HIGH>;
36 linux,default-trigger = "heartbeat";
37 };
38 green {
39 gpios = <&pio1 3 GPIO_ACTIVE_HIGH>;
40 default-state = "off";
41 };
42 };
43
31 soc { 44 soc {
32 sbc_serial0: serial@9530000 { 45 sbc_serial0: serial@9530000 {
33 status = "okay"; 46 status = "okay";
34 }; 47 };
35 48
36 leds {
37 compatible = "gpio-leds";
38 red {
39 label = "Front Panel LED";
40 gpios = <&pio4 1 GPIO_ACTIVE_HIGH>;
41 linux,default-trigger = "heartbeat";
42 };
43 green {
44 gpios = <&pio1 3 GPIO_ACTIVE_HIGH>;
45 default-state = "off";
46 };
47 };
48
49 i2c@9842000 { 49 i2c@9842000 {
50 status = "okay"; 50 status = "okay";
51 }; 51 };
@@ -88,7 +88,7 @@
88 non-removable; 88 non-removable;
89 }; 89 };
90 90
91 miphy28lp_phy: miphy28lp@9b22000 { 91 miphy28lp_phy: miphy28lp@0 {
92 92
93 phy_port0: port@9b22000 { 93 phy_port0: port@9b22000 {
94 st,osc-rdy; 94 st,osc-rdy;
diff --git a/arch/arm/boot/dts/stih418-clock.dtsi b/arch/arm/boot/dts/stih418-clock.dtsi
index 9a157c1a99b1..13fb8db52fc1 100644
--- a/arch/arm/boot/dts/stih418-clock.dtsi
+++ b/arch/arm/boot/dts/stih418-clock.dtsi
@@ -7,6 +7,22 @@
7 */ 7 */
8#include <dt-bindings/clock/stih418-clks.h> 8#include <dt-bindings/clock/stih418-clks.h>
9/ { 9/ {
10 /*
11 * Fixed 30MHz oscillator inputs to SoC
12 */
13 clk_sysin: clk-sysin {
14 #clock-cells = <0>;
15 compatible = "fixed-clock";
16 clock-frequency = <30000000>;
17 clock-output-names = "CLK_SYSIN";
18 };
19
20 clk_tmdsout_hdmi: clk-tmdsout-hdmi {
21 #clock-cells = <0>;
22 compatible = "fixed-clock";
23 clock-frequency = <0>;
24 };
25
10 clocks { 26 clocks {
11 #address-cells = <1>; 27 #address-cells = <1>;
12 #size-cells = <1>; 28 #size-cells = <1>;
@@ -15,27 +31,6 @@
15 compatible = "st,stih418-clk", "simple-bus"; 31 compatible = "st,stih418-clk", "simple-bus";
16 32
17 /* 33 /*
18 * Fixed 30MHz oscillator inputs to SoC
19 */
20 clk_sysin: clk-sysin {
21 #clock-cells = <0>;
22 compatible = "fixed-clock";
23 clock-frequency = <30000000>;
24 clock-output-names = "CLK_SYSIN";
25 };
26
27 /*
28 * ARM Peripheral clock for timers
29 */
30 arm_periph_clk: clk-m-a9-periphs {
31 #clock-cells = <0>;
32 compatible = "fixed-factor-clock";
33 clocks = <&clk_m_a9>;
34 clock-div = <2>;
35 clock-mult = <1>;
36 };
37
38 /*
39 * A9 PLL. 34 * A9 PLL.
40 */ 35 */
41 clockgen-a9@92b0000 { 36 clockgen-a9@92b0000 {
@@ -64,32 +59,17 @@
64 <&clockgen_a9_pll 0>, 59 <&clockgen_a9_pll 0>,
65 <&clk_s_c0_flexgen 13>, 60 <&clk_s_c0_flexgen 13>,
66 <&clk_m_a9_ext2f_div2>; 61 <&clk_m_a9_ext2f_div2>;
67 };
68
69 /*
70 * ARM Peripheral clock for timers
71 */
72 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
73 #clock-cells = <0>;
74 compatible = "fixed-factor-clock";
75
76 clocks = <&clk_s_c0_flexgen 13>;
77 62
78 clock-output-names = "clk-m-a9-ext2f-div2"; 63 /*
79 64 * ARM Peripheral clock for timers
80 clock-div = <2>; 65 */
81 clock-mult = <1>; 66 arm_periph_clk: clk-m-a9-periphs {
82 }; 67 #clock-cells = <0>;
83 68 compatible = "fixed-factor-clock";
84 /* 69 clocks = <&clk_m_a9>;
85 * Bootloader initialized system infrastructure clock for 70 clock-div = <2>;
86 * serial devices. 71 clock-mult = <1>;
87 */ 72 };
88 clk_ext2f_a9: clockgen-c0@13 {
89 #clock-cells = <0>;
90 compatible = "fixed-clock";
91 clock-frequency = <200000000>;
92 clock-output-names = "clk-s-icn-reg-0";
93 }; 73 };
94 74
95 clockgen-a@90ff000 { 75 clockgen-a@90ff000 {
@@ -207,6 +187,21 @@
207 "clk-proc-mixer", 187 "clk-proc-mixer",
208 "clk-proc-sc", 188 "clk-proc-sc",
209 "clk-avsp-hevc"; 189 "clk-avsp-hevc";
190
191 /*
192 * ARM Peripheral clock for timers
193 */
194 clk_m_a9_ext2f_div2: clk-m-a9-ext2f-div2s {
195 #clock-cells = <0>;
196 compatible = "fixed-factor-clock";
197
198 clocks = <&clk_s_c0_flexgen 13>;
199
200 clock-output-names = "clk-m-a9-ext2f-div2";
201
202 clock-div = <2>;
203 clock-mult = <1>;
204 };
210 }; 205 };
211 }; 206 };
212 207
@@ -259,13 +254,7 @@
259 "clk-s-d2-fs0-ch3"; 254 "clk-s-d2-fs0-ch3";
260 }; 255 };
261 256
262 clk_tmdsout_hdmi: clk-tmdsout-hdmi { 257 clockgen-d2@9106000 {
263 #clock-cells = <0>;
264 compatible = "fixed-clock";
265 clock-frequency = <0>;
266 };
267
268 clockgen-d2@x9106000 {
269 compatible = "st,clkgen-c32"; 258 compatible = "st,clkgen-c32";
270 reg = <0x9106000 0x1000>; 259 reg = <0x9106000 0x1000>;
271 260
diff --git a/arch/arm/boot/dts/stih418.dtsi b/arch/arm/boot/dts/stih418.dtsi
index e6525ab4d9bb..0efb3cd6a86e 100644
--- a/arch/arm/boot/dts/stih418.dtsi
+++ b/arch/arm/boot/dts/stih418.dtsi
@@ -30,8 +30,9 @@
30 }; 30 };
31 31
32 soc { 32 soc {
33 usb2_picophy1: phy2 { 33 usb2_picophy1: phy2@0 {
34 compatible = "st,stih407-usb2-phy"; 34 compatible = "st,stih407-usb2-phy";
35 reg = <0 0>;
35 #phy-cells = <0>; 36 #phy-cells = <0>;
36 st,syscfg = <&syscfg_core 0xf8 0xf4>; 37 st,syscfg = <&syscfg_core 0xf8 0xf4>;
37 resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 38 resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
@@ -39,8 +40,9 @@
39 reset-names = "global", "port"; 40 reset-names = "global", "port";
40 }; 41 };
41 42
42 usb2_picophy2: phy3 { 43 usb2_picophy2: phy3@0 {
43 compatible = "st,stih407-usb2-phy"; 44 compatible = "st,stih407-usb2-phy";
45 reg = <0 0>;
44 #phy-cells = <0>; 46 #phy-cells = <0>;
45 st,syscfg = <&syscfg_core 0xfc 0xf4>; 47 st,syscfg = <&syscfg_core 0xfc 0xf4>;
46 resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 48 resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi
index 7f80c2c414c8..c67edb1a8121 100644
--- a/arch/arm/boot/dts/stihxxx-b2120.dtsi
+++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi
@@ -10,23 +10,69 @@
10#include <dt-bindings/gpio/gpio.h> 10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/media/c8sectpfe.h> 11#include <dt-bindings/media/c8sectpfe.h>
12/ { 12/ {
13 soc { 13 leds {
14 sbc_serial0: serial@9530000 { 14 compatible = "gpio-leds";
15 status = "okay"; 15 red {
16 label = "Front Panel LED";
17 gpios = <&pio4 1 GPIO_ACTIVE_HIGH>;
18 linux,default-trigger = "heartbeat";
19 };
20 green {
21 gpios = <&pio1 3 GPIO_ACTIVE_HIGH>;
22 default-state = "off";
23 };
24 };
25
26 sound: sound {
27 compatible = "simple-audio-card";
28 simple-audio-card,name = "STI-B2120";
29 status = "okay";
30
31 simple-audio-card,dai-link0 {
32 /* HDMI */
33 format = "i2s";
34 mclk-fs = <128>;
35 cpu {
36 sound-dai = <&sti_uni_player0>;
37 };
38
39 codec {
40 sound-dai = <&sti_hdmi>;
41 };
42 };
43
44 simple-audio-card,dai-link1 {
45 /* DAC */
46 format = "i2s";
47 mclk-fs = <256>;
48 frame-inversion = <1>;
49 cpu {
50 sound-dai = <&sti_uni_player2>;
51 };
52
53 codec {
54 sound-dai = <&sti_sasg_codec 1>;
55 };
16 }; 56 };
17 57
18 leds { 58 simple-audio-card,dai-link2 {
19 compatible = "gpio-leds"; 59 /* SPDIF */
20 red { 60 format = "left_j";
21 label = "Front Panel LED"; 61 mclk-fs = <128>;
22 gpios = <&pio4 1 GPIO_ACTIVE_HIGH>; 62 cpu {
23 linux,default-trigger = "heartbeat"; 63 sound-dai = <&sti_uni_player3>;
24 }; 64 };
25 green { 65
26 gpios = <&pio1 3 GPIO_ACTIVE_HIGH>; 66 codec {
27 default-state = "off"; 67 sound-dai = <&sti_sasg_codec 0>;
28 }; 68 };
29 }; 69 };
70 };
71
72 soc {
73 sbc_serial0: serial@9530000 {
74 status = "okay";
75 };
30 76
31 pwm0: pwm@9810000 { 77 pwm0: pwm@9810000 {
32 status = "okay"; 78 status = "okay";
@@ -80,7 +126,7 @@
80 st,i2c-min-sda-pulse-width-us = <5>; 126 st,i2c-min-sda-pulse-width-us = <5>;
81 }; 127 };
82 128
83 miphy28lp_phy: miphy28lp@9b22000 { 129 miphy28lp_phy: miphy28lp@0 {
84 130
85 phy_port0: port@9b22000 { 131 phy_port0: port@9b22000 {
86 st,osc-rdy; 132 st,osc-rdy;
@@ -126,7 +172,7 @@
126 clock-names = "c8sectpfe"; 172 clock-names = "c8sectpfe";
127 173
128 /* tsin0 is TSA on NIMA */ 174 /* tsin0 is TSA on NIMA */
129 tsin0: port@0 { 175 tsin0: port {
130 tsin-num = <0>; 176 tsin-num = <0>;
131 serial-not-parallel; 177 serial-not-parallel;
132 i2c-bus = <&ssc2>; 178 i2c-bus = <&ssc2>;
@@ -147,53 +193,11 @@
147 status = "okay"; 193 status = "okay";
148 }; 194 };
149 195
150 sti_sasg_codec: sti-sasg-codec { 196 syscfg_core: core-syscfg@92b0000 {
151 status = "okay"; 197 sti_sasg_codec: sti-sasg-codec {
152 pinctrl-names = "default"; 198 status = "okay";
153 pinctrl-0 = <&pinctrl_spdif_out>; 199 pinctrl-names = "default";
154 }; 200 pinctrl-0 = <&pinctrl_spdif_out>;
155
156 sound {
157 compatible = "simple-audio-card";
158 simple-audio-card,name = "STI-B2120";
159 status = "okay";
160
161 simple-audio-card,dai-link@0 {
162 /* HDMI */
163 format = "i2s";
164 mclk-fs = <128>;
165 cpu {
166 sound-dai = <&sti_uni_player0>;
167 };
168
169 codec {
170 sound-dai = <&sti_hdmi>;
171 };
172 };
173 simple-audio-card,dai-link@1 {
174 /* DAC */
175 format = "i2s";
176 mclk-fs = <256>;
177 frame-inversion = <1>;
178 cpu {
179 sound-dai = <&sti_uni_player2>;
180 };
181
182 codec {
183 sound-dai = <&sti_sasg_codec 1>;
184 };
185 };
186 simple-audio-card,dai-link@2 {
187 /* SPDIF */
188 format = "left_j";
189 mclk-fs = <128>;
190 cpu {
191 sound-dai = <&sti_uni_player3>;
192 };
193
194 codec {
195 sound-dai = <&sti_sasg_codec 0>;
196 };
197 }; 201 };
198 }; 202 };
199 }; 203 };
diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
index 293ecb957227..7eb786a2d624 100644
--- a/arch/arm/boot/dts/stm32429i-eval.dts
+++ b/arch/arm/boot/dts/stm32429i-eval.dts
@@ -144,6 +144,13 @@
144 }; 144 };
145 }; 145 };
146 }; 146 };
147
148 mmc_vcard: mmc_vcard {
149 compatible = "regulator-fixed";
150 regulator-name = "mmc_vcard";
151 regulator-min-microvolt = <3300000>;
152 regulator-max-microvolt = <3300000>;
153 };
147}; 154};
148 155
149&adc { 156&adc {
@@ -254,6 +261,18 @@
254 status = "okay"; 261 status = "okay";
255}; 262};
256 263
264&sdio {
265 status = "okay";
266 vmmc-supply = <&mmc_vcard>;
267 cd-gpios = <&stmpegpio 15 GPIO_ACTIVE_HIGH>;
268 cd-inverted;
269 pinctrl-names = "default", "opendrain";
270 pinctrl-0 = <&sdio_pins>;
271 pinctrl-1 = <&sdio_pins_od>;
272 bus-width = <4>;
273 max-frequency = <12500000>;
274};
275
257&timers1 { 276&timers1 {
258 status = "okay"; 277 status = "okay";
259 278
diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index 2d4e71717694..8c081eaf20fe 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -42,6 +42,7 @@
42 42
43/dts-v1/; 43/dts-v1/;
44#include "stm32f746.dtsi" 44#include "stm32f746.dtsi"
45#include "stm32f746-pinctrl.dtsi"
45#include <dt-bindings/input/input.h> 46#include <dt-bindings/input/input.h>
46 47
47/ { 48/ {
@@ -90,6 +91,13 @@
90 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHSULPI)>; 91 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHSULPI)>;
91 clock-names = "main_clk"; 92 clock-names = "main_clk";
92 }; 93 };
94
95 mmc_vcard: mmc_vcard {
96 compatible = "regulator-fixed";
97 regulator-name = "mmc_vcard";
98 regulator-min-microvolt = <3300000>;
99 regulator-max-microvolt = <3300000>;
100 };
93}; 101};
94 102
95&clk_hse { 103&clk_hse {
@@ -112,6 +120,16 @@
112 status = "okay"; 120 status = "okay";
113}; 121};
114 122
123&sdio1 {
124 status = "okay";
125 vmmc-supply = <&mmc_vcard>;
126 broken-cd;
127 pinctrl-names = "default", "opendrain";
128 pinctrl-0 = <&sdio_pins_a>;
129 pinctrl-1 = <&sdio_pins_od_a>;
130 bus-width = <4>;
131};
132
115&usart1 { 133&usart1 {
116 pinctrl-0 = <&usart1_pins_a>; 134 pinctrl-0 = <&usart1_pins_a>;
117 pinctrl-names = "default"; 135 pinctrl-names = "default";
@@ -119,7 +137,7 @@
119}; 137};
120 138
121&usbotg_hs { 139&usbotg_hs {
122 dr_mode = "host"; 140 dr_mode = "otg";
123 phys = <&usbotg_hs_phy>; 141 phys = <&usbotg_hs_phy>;
124 phy-names = "usb2-phy"; 142 phy-names = "usb2-phy";
125 pinctrl-0 = <&usbotg_hs_pins_a>; 143 pinctrl-0 = <&usbotg_hs_pins_a>;
diff --git a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
index ae94d86c53c4..35202896c093 100644
--- a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
@@ -338,6 +338,37 @@
338 slew-rate = <3>; 338 slew-rate = <3>;
339 }; 339 };
340 }; 340 };
341
342 sdio_pins: sdio_pins@0 {
343 pins {
344 pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDIO_D0 */
345 <STM32_PINMUX('C', 9, AF12)>, /* SDIO_D1 */
346 <STM32_PINMUX('C', 10, AF12)>, /* SDIO_D2 */
347 <STM32_PINMUX('C', 11, AF12)>, /* SDIO_D3 */
348 <STM32_PINMUX('C', 12, AF12)>, /* SDIO_CK */
349 <STM32_PINMUX('D', 2, AF12)>; /* SDIO_CMD */
350 drive-push-pull;
351 slew-rate = <2>;
352 };
353 };
354
355 sdio_pins_od: sdio_pins_od@0 {
356 pins1 {
357 pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDIO_D0 */
358 <STM32_PINMUX('C', 9, AF12)>, /* SDIO_D1 */
359 <STM32_PINMUX('C', 10, AF12)>, /* SDIO_D2 */
360 <STM32_PINMUX('C', 11, AF12)>, /* SDIO_D3 */
361 <STM32_PINMUX('C', 12, AF12)>; /* SDIO_CK */
362 drive-push-pull;
363 slew-rate = <2>;
364 };
365
366 pins2 {
367 pinmux = <STM32_PINMUX('D', 2, AF12)>; /* SDIO_CMD */
368 drive-open-drain;
369 slew-rate = <2>;
370 };
371 };
341 }; 372 };
342 }; 373 };
343}; 374};
diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
index 10099df8b73e..ede77e0f1c41 100644
--- a/arch/arm/boot/dts/stm32f429.dtsi
+++ b/arch/arm/boot/dts/stm32f429.dtsi
@@ -511,6 +511,17 @@
511 }; 511 };
512 }; 512 };
513 513
514 sdio: sdio@40012c00 {
515 compatible = "arm,pl180", "arm,primecell";
516 arm,primecell-periphid = <0x00880180>;
517 reg = <0x40012c00 0x400>;
518 clocks = <&rcc 0 STM32F4_APB2_CLOCK(SDIO)>;
519 clock-names = "apb_pclk";
520 interrupts = <49>;
521 max-frequency = <48000000>;
522 status = "disabled";
523 };
524
514 syscfg: system-config@40013800 { 525 syscfg: system-config@40013800 {
515 compatible = "syscon"; 526 compatible = "syscon";
516 reg = <0x40013800 0x400>; 527 reg = <0x40013800 0x400>;
diff --git a/arch/arm/boot/dts/stm32f469-disco.dts b/arch/arm/boot/dts/stm32f469-disco.dts
index c18acbe4cf4e..2f76726bf335 100644
--- a/arch/arm/boot/dts/stm32f469-disco.dts
+++ b/arch/arm/boot/dts/stm32f469-disco.dts
@@ -48,6 +48,8 @@
48/dts-v1/; 48/dts-v1/;
49#include "stm32f429.dtsi" 49#include "stm32f429.dtsi"
50#include "stm32f469-pinctrl.dtsi" 50#include "stm32f469-pinctrl.dtsi"
51#include <dt-bindings/gpio/gpio.h>
52#include <dt-bindings/input/input.h>
51 53
52/ { 54/ {
53 model = "STMicroelectronics STM32F469i-DISCO board"; 55 model = "STMicroelectronics STM32F469i-DISCO board";
@@ -66,10 +68,46 @@
66 serial0 = &usart3; 68 serial0 = &usart3;
67 }; 69 };
68 70
71 mmc_vcard: mmc_vcard {
72 compatible = "regulator-fixed";
73 regulator-name = "mmc_vcard";
74 regulator-min-microvolt = <3300000>;
75 regulator-max-microvolt = <3300000>;
76 };
77
69 soc { 78 soc {
70 dma-ranges = <0xc0000000 0x0 0x10000000>; 79 dma-ranges = <0xc0000000 0x0 0x10000000>;
71 }; 80 };
72 81
82 leds {
83 compatible = "gpio-leds";
84 green {
85 gpios = <&gpiog 6 GPIO_ACTIVE_LOW>;
86 linux,default-trigger = "heartbeat";
87 };
88 orange {
89 gpios = <&gpiod 4 GPIO_ACTIVE_LOW>;
90 };
91 red {
92 gpios = <&gpiod 5 GPIO_ACTIVE_LOW>;
93 };
94 blue {
95 gpios = <&gpiok 3 GPIO_ACTIVE_LOW>;
96 };
97 };
98
99 gpio_keys {
100 compatible = "gpio-keys";
101 #address-cells = <1>;
102 #size-cells = <0>;
103 autorepeat;
104 button@0 {
105 label = "User";
106 linux,code = <KEY_WAKEUP>;
107 gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>;
108 };
109 };
110
73 /* This turns on vbus for otg for host mode (dwc2) */ 111 /* This turns on vbus for otg for host mode (dwc2) */
74 vcc5v_otg: vcc5v-otg-regulator { 112 vcc5v_otg: vcc5v-otg-regulator {
75 compatible = "regulator-fixed"; 113 compatible = "regulator-fixed";
@@ -120,6 +158,18 @@
120 }; 158 };
121}; 159};
122 160
161&sdio {
162 status = "okay";
163 vmmc-supply = <&mmc_vcard>;
164 cd-gpios = <&gpiog 2 GPIO_ACTIVE_HIGH>;
165 cd-inverted;
166 broken-cd;
167 pinctrl-names = "default", "opendrain";
168 pinctrl-0 = <&sdio_pins>;
169 pinctrl-1 = <&sdio_pins_od>;
170 bus-width = <4>;
171};
172
123&usart3 { 173&usart3 {
124 pinctrl-0 = <&usart3_pins_a>; 174 pinctrl-0 = <&usart3_pins_a>;
125 pinctrl-names = "default"; 175 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi
new file mode 100644
index 000000000000..9314128df185
--- /dev/null
+++ b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi
@@ -0,0 +1,289 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
5 */
6
7#include <dt-bindings/pinctrl/stm32-pinfunc.h>
8#include <dt-bindings/mfd/stm32f7-rcc.h>
9
10/ {
11 soc {
12 pinctrl: pin-controller {
13 #address-cells = <1>;
14 #size-cells = <1>;
15 ranges = <0 0x40020000 0x3000>;
16 interrupt-parent = <&exti>;
17 st,syscfg = <&syscfg 0x8>;
18 pins-are-numbered;
19
20 gpioa: gpio@40020000 {
21 gpio-controller;
22 #gpio-cells = <2>;
23 interrupt-controller;
24 #interrupt-cells = <2>;
25 reg = <0x0 0x400>;
26 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOA)>;
27 st,bank-name = "GPIOA";
28 };
29
30 gpiob: gpio@40020400 {
31 gpio-controller;
32 #gpio-cells = <2>;
33 interrupt-controller;
34 #interrupt-cells = <2>;
35 reg = <0x400 0x400>;
36 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOB)>;
37 st,bank-name = "GPIOB";
38 };
39
40 gpioc: gpio@40020800 {
41 gpio-controller;
42 #gpio-cells = <2>;
43 interrupt-controller;
44 #interrupt-cells = <2>;
45 reg = <0x800 0x400>;
46 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOC)>;
47 st,bank-name = "GPIOC";
48 };
49
50 gpiod: gpio@40020c00 {
51 gpio-controller;
52 #gpio-cells = <2>;
53 interrupt-controller;
54 #interrupt-cells = <2>;
55 reg = <0xc00 0x400>;
56 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOD)>;
57 st,bank-name = "GPIOD";
58 };
59
60 gpioe: gpio@40021000 {
61 gpio-controller;
62 #gpio-cells = <2>;
63 interrupt-controller;
64 #interrupt-cells = <2>;
65 reg = <0x1000 0x400>;
66 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOE)>;
67 st,bank-name = "GPIOE";
68 };
69
70 gpiof: gpio@40021400 {
71 gpio-controller;
72 #gpio-cells = <2>;
73 interrupt-controller;
74 #interrupt-cells = <2>;
75 reg = <0x1400 0x400>;
76 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOF)>;
77 st,bank-name = "GPIOF";
78 };
79
80 gpiog: gpio@40021800 {
81 gpio-controller;
82 #gpio-cells = <2>;
83 interrupt-controller;
84 #interrupt-cells = <2>;
85 reg = <0x1800 0x400>;
86 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOG)>;
87 st,bank-name = "GPIOG";
88 };
89
90 gpioh: gpio@40021c00 {
91 gpio-controller;
92 #gpio-cells = <2>;
93 interrupt-controller;
94 #interrupt-cells = <2>;
95 reg = <0x1c00 0x400>;
96 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOH)>;
97 st,bank-name = "GPIOH";
98 };
99
100 gpioi: gpio@40022000 {
101 gpio-controller;
102 #gpio-cells = <2>;
103 interrupt-controller;
104 #interrupt-cells = <2>;
105 reg = <0x2000 0x400>;
106 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOI)>;
107 st,bank-name = "GPIOI";
108 };
109
110 gpioj: gpio@40022400 {
111 gpio-controller;
112 #gpio-cells = <2>;
113 interrupt-controller;
114 #interrupt-cells = <2>;
115 reg = <0x2400 0x400>;
116 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOJ)>;
117 st,bank-name = "GPIOJ";
118 };
119
120 gpiok: gpio@40022800 {
121 gpio-controller;
122 #gpio-cells = <2>;
123 interrupt-controller;
124 #interrupt-cells = <2>;
125 reg = <0x2800 0x400>;
126 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOK)>;
127 st,bank-name = "GPIOK";
128 };
129
130 cec_pins_a: cec@0 {
131 pins {
132 pinmux = <STM32_PINMUX('A', 15, AF4)>; /* HDMI CEC */
133 slew-rate = <0>;
134 drive-open-drain;
135 bias-disable;
136 };
137 };
138
139 usart1_pins_a: usart1@0 {
140 pins1 {
141 pinmux = <STM32_PINMUX('A', 9, AF7)>; /* USART1_TX */
142 bias-disable;
143 drive-push-pull;
144 slew-rate = <0>;
145 };
146 pins2 {
147 pinmux = <STM32_PINMUX('A', 10, AF7)>; /* USART1_RX */
148 bias-disable;
149 };
150 };
151
152 usart1_pins_b: usart1@1 {
153 pins1 {
154 pinmux = <STM32_PINMUX('A', 9, AF7)>; /* USART1_TX */
155 bias-disable;
156 drive-push-pull;
157 slew-rate = <0>;
158 };
159 pins2 {
160 pinmux = <STM32_PINMUX('B', 7, AF7)>; /* USART1_RX */
161 bias-disable;
162 };
163 };
164
165 i2c1_pins_b: i2c1@0 {
166 pins {
167 pinmux = <STM32_PINMUX('B', 9, AF4)>, /* I2C1 SDA */
168 <STM32_PINMUX('B', 8, AF4)>; /* I2C1 SCL */
169 bias-disable;
170 drive-open-drain;
171 slew-rate = <0>;
172 };
173 };
174
175 usbotg_hs_pins_a: usbotg-hs@0 {
176 pins {
177 pinmux = <STM32_PINMUX('H', 4, AF10)>, /* OTG_HS_ULPI_NXT */
178 <STM32_PINMUX('I', 11, AF10)>, /* OTG_HS_ULPI_DIR */
179 <STM32_PINMUX('C', 0, AF10)>, /* OTG_HS_ULPI_STP */
180 <STM32_PINMUX('A', 5, AF10)>, /* OTG_HS_ULPI_CK */
181 <STM32_PINMUX('A', 3, AF10)>, /* OTG_HS_ULPI_D0 */
182 <STM32_PINMUX('B', 0, AF10)>, /* OTG_HS_ULPI_D1 */
183 <STM32_PINMUX('B', 1, AF10)>, /* OTG_HS_ULPI_D2 */
184 <STM32_PINMUX('B', 10, AF10)>, /* OTG_HS_ULPI_D3 */
185 <STM32_PINMUX('B', 11, AF10)>, /* OTG_HS_ULPI_D4 */
186 <STM32_PINMUX('B', 12, AF10)>, /* OTG_HS_ULPI_D5 */
187 <STM32_PINMUX('B', 13, AF10)>, /* OTG_HS_ULPI_D6 */
188 <STM32_PINMUX('B', 5, AF10)>; /* OTG_HS_ULPI_D7 */
189 bias-disable;
190 drive-push-pull;
191 slew-rate = <2>;
192 };
193 };
194
195 usbotg_hs_pins_b: usbotg-hs@1 {
196 pins {
197 pinmux = <STM32_PINMUX('H', 4, AF10)>, /* OTG_HS_ULPI_NXT */
198 <STM32_PINMUX('C', 2, AF10)>, /* OTG_HS_ULPI_DIR */
199 <STM32_PINMUX('C', 0, AF10)>, /* OTG_HS_ULPI_STP */
200 <STM32_PINMUX('A', 5, AF10)>, /* OTG_HS_ULPI_CK */
201 <STM32_PINMUX('A', 3, AF10)>, /* OTG_HS_ULPI_D0 */
202 <STM32_PINMUX('B', 0, AF10)>, /* OTG_HS_ULPI_D1 */
203 <STM32_PINMUX('B', 1, AF10)>, /* OTG_HS_ULPI_D2 */
204 <STM32_PINMUX('B', 10, AF10)>, /* OTG_HS_ULPI_D3 */
205 <STM32_PINMUX('B', 11, AF10)>, /* OTG_HS_ULPI_D4 */
206 <STM32_PINMUX('B', 12, AF10)>, /* OTG_HS_ULPI_D5 */
207 <STM32_PINMUX('B', 13, AF10)>, /* OTG_HS_ULPI_D6 */
208 <STM32_PINMUX('B', 5, AF10)>; /* OTG_HS_ULPI_D7 */
209 bias-disable;
210 drive-push-pull;
211 slew-rate = <2>;
212 };
213 };
214
215 usbotg_fs_pins_a: usbotg-fs@0 {
216 pins {
217 pinmux = <STM32_PINMUX('A', 10, AF10)>, /* OTG_FS_ID */
218 <STM32_PINMUX('A', 11, AF10)>, /* OTG_FS_DM */
219 <STM32_PINMUX('A', 12, AF10)>; /* OTG_FS_DP */
220 bias-disable;
221 drive-push-pull;
222 slew-rate = <2>;
223 };
224 };
225
226 sdio_pins_a: sdio_pins_a@0 {
227 pins {
228 pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1 D0 */
229 <STM32_PINMUX('C', 9, AF12)>, /* SDMMC1 D1 */
230 <STM32_PINMUX('C', 10, AF12)>, /* SDMMC1 D2 */
231 <STM32_PINMUX('C', 11, AF12)>, /* SDMMC1 D3 */
232 <STM32_PINMUX('C', 12, AF12)>, /* SDMMC1 CLK */
233 <STM32_PINMUX('D', 2, AF12)>; /* SDMMC1 CMD */
234 drive-push-pull;
235 slew-rate = <2>;
236 };
237 };
238
239 sdio_pins_od_a: sdio_pins_od_a@0 {
240 pins1 {
241 pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1 D0 */
242 <STM32_PINMUX('C', 9, AF12)>, /* SDMMC1 D1 */
243 <STM32_PINMUX('C', 10, AF12)>, /* SDMMC1 D2 */
244 <STM32_PINMUX('C', 11, AF12)>, /* SDMMC1 D3 */
245 <STM32_PINMUX('C', 12, AF12)>; /* SDMMC1 CLK */
246 drive-push-pull;
247 slew-rate = <2>;
248 };
249
250 pins2 {
251 pinmux = <STM32_PINMUX('D', 2, AF12)>; /* SDMMC1 CMD */
252 drive-open-drain;
253 slew-rate = <2>;
254 };
255 };
256
257 sdio_pins_b: sdio_pins_b@0 {
258 pins {
259 pinmux = <STM32_PINMUX('G', 9, AF11)>, /* SDMMC2 D0 */
260 <STM32_PINMUX('G', 10, AF11)>, /* SDMMC2 D1 */
261 <STM32_PINMUX('B', 3, AF10)>, /* SDMMC2 D2 */
262 <STM32_PINMUX('B', 4, AF10)>, /* SDMMC2 D3 */
263 <STM32_PINMUX('D', 6, AF11)>, /* SDMMC2 CLK */
264 <STM32_PINMUX('D', 7, AF11)>; /* SDMMC2 CMD */
265 drive-push-pull;
266 slew-rate = <2>;
267 };
268 };
269
270 sdio_pins_od_b: sdio_pins_od_b@0 {
271 pins1 {
272 pinmux = <STM32_PINMUX('G', 9, AF11)>, /* SDMMC2 D0 */
273 <STM32_PINMUX('G', 10, AF11)>, /* SDMMC2 D1 */
274 <STM32_PINMUX('B', 3, AF10)>, /* SDMMC2 D2 */
275 <STM32_PINMUX('B', 4, AF10)>, /* SDMMC2 D3 */
276 <STM32_PINMUX('D', 6, AF11)>; /* SDMMC2 CLK */
277 drive-push-pull;
278 slew-rate = <2>;
279 };
280
281 pins2 {
282 pinmux = <STM32_PINMUX('D', 7, AF11)>; /* SDMMC2 CMD */
283 drive-open-drain;
284 slew-rate = <2>;
285 };
286 };
287 };
288 };
289};
diff --git a/arch/arm/boot/dts/stm32f746-disco.dts b/arch/arm/boot/dts/stm32f746-disco.dts
index 4d85dba59e1d..be94c6ad7e94 100644
--- a/arch/arm/boot/dts/stm32f746-disco.dts
+++ b/arch/arm/boot/dts/stm32f746-disco.dts
@@ -42,7 +42,9 @@
42 42
43/dts-v1/; 43/dts-v1/;
44#include "stm32f746.dtsi" 44#include "stm32f746.dtsi"
45#include "stm32f746-pinctrl.dtsi"
45#include <dt-bindings/input/input.h> 46#include <dt-bindings/input/input.h>
47#include <dt-bindings/gpio/gpio.h>
46 48
47/ { 49/ {
48 model = "STMicroelectronics STM32F746-DISCO board"; 50 model = "STMicroelectronics STM32F746-DISCO board";
@@ -75,12 +77,30 @@
75 regulator-name = "vcc5_host1"; 77 regulator-name = "vcc5_host1";
76 regulator-always-on; 78 regulator-always-on;
77 }; 79 };
80
81 mmc_vcard: mmc_vcard {
82 compatible = "regulator-fixed";
83 regulator-name = "mmc_vcard";
84 regulator-min-microvolt = <3300000>;
85 regulator-max-microvolt = <3300000>;
86 };
78}; 87};
79 88
80&clk_hse { 89&clk_hse {
81 clock-frequency = <25000000>; 90 clock-frequency = <25000000>;
82}; 91};
83 92
93&sdio1 {
94 status = "okay";
95 vmmc-supply = <&mmc_vcard>;
96 cd-gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
97 cd-inverted;
98 pinctrl-names = "default", "opendrain";
99 pinctrl-0 = <&sdio_pins_a>;
100 pinctrl-1 = <&sdio_pins_od_a>;
101 bus-width = <4>;
102};
103
84&usart1 { 104&usart1 {
85 pinctrl-0 = <&usart1_pins_b>; 105 pinctrl-0 = <&usart1_pins_b>;
86 pinctrl-names = "default"; 106 pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f746-pinctrl.dtsi b/arch/arm/boot/dts/stm32f746-pinctrl.dtsi
new file mode 100644
index 000000000000..fcfd2ac7239b
--- /dev/null
+++ b/arch/arm/boot/dts/stm32f746-pinctrl.dtsi
@@ -0,0 +1,11 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
5 */
6
7#include "stm32f7-pinctrl.dtsi"
8
9&pinctrl{
10 compatible = "st,stm32f746-pinctrl";
11};
diff --git a/arch/arm/boot/dts/stm32f746.dtsi b/arch/arm/boot/dts/stm32f746.dtsi
index 5f66d151eedb..4be2ee575b19 100644
--- a/arch/arm/boot/dts/stm32f746.dtsi
+++ b/arch/arm/boot/dts/stm32f746.dtsi
@@ -42,7 +42,6 @@
42 42
43#include "skeleton.dtsi" 43#include "skeleton.dtsi"
44#include "armv7-m.dtsi" 44#include "armv7-m.dtsi"
45#include <dt-bindings/pinctrl/stm32-pinfunc.h>
46#include <dt-bindings/clock/stm32fx-clock.h> 45#include <dt-bindings/clock/stm32fx-clock.h>
47#include <dt-bindings/mfd/stm32f7-rcc.h> 46#include <dt-bindings/mfd/stm32f7-rcc.h>
48 47
@@ -429,6 +428,28 @@
429 status = "disabled"; 428 status = "disabled";
430 }; 429 };
431 430
431 sdio2: sdio2@40011c00 {
432 compatible = "arm,pl180", "arm,primecell";
433 arm,primecell-periphid = <0x00880180>;
434 reg = <0x40011c00 0x400>;
435 clocks = <&rcc 0 STM32F7_APB2_CLOCK(SDMMC2)>;
436 clock-names = "apb_pclk";
437 interrupts = <103>;
438 max-frequency = <48000000>;
439 status = "disabled";
440 };
441
442 sdio1: sdio1@40012c00 {
443 compatible = "arm,pl180", "arm,primecell";
444 arm,primecell-periphid = <0x00880180>;
445 reg = <0x40012c00 0x400>;
446 clocks = <&rcc 0 STM32F7_APB2_CLOCK(SDMMC1)>;
447 clock-names = "apb_pclk";
448 interrupts = <49>;
449 max-frequency = <48000000>;
450 status = "disabled";
451 };
452
432 syscfg: system-config@40013800 { 453 syscfg: system-config@40013800 {
433 compatible = "syscon"; 454 compatible = "syscon";
434 reg = <0x40013800 0x400>; 455 reg = <0x40013800 0x400>;
@@ -498,222 +519,6 @@
498 reg = <0x40007000 0x400>; 519 reg = <0x40007000 0x400>;
499 }; 520 };
500 521
501 pin-controller {
502 #address-cells = <1>;
503 #size-cells = <1>;
504 compatible = "st,stm32f746-pinctrl";
505 ranges = <0 0x40020000 0x3000>;
506 interrupt-parent = <&exti>;
507 st,syscfg = <&syscfg 0x8>;
508 pins-are-numbered;
509
510 gpioa: gpio@40020000 {
511 gpio-controller;
512 #gpio-cells = <2>;
513 interrupt-controller;
514 #interrupt-cells = <2>;
515 reg = <0x0 0x400>;
516 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOA)>;
517 st,bank-name = "GPIOA";
518 };
519
520 gpiob: gpio@40020400 {
521 gpio-controller;
522 #gpio-cells = <2>;
523 interrupt-controller;
524 #interrupt-cells = <2>;
525 reg = <0x400 0x400>;
526 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOB)>;
527 st,bank-name = "GPIOB";
528 };
529
530 gpioc: gpio@40020800 {
531 gpio-controller;
532 #gpio-cells = <2>;
533 interrupt-controller;
534 #interrupt-cells = <2>;
535 reg = <0x800 0x400>;
536 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOC)>;
537 st,bank-name = "GPIOC";
538 };
539
540 gpiod: gpio@40020c00 {
541 gpio-controller;
542 #gpio-cells = <2>;
543 interrupt-controller;
544 #interrupt-cells = <2>;
545 reg = <0xc00 0x400>;
546 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOD)>;
547 st,bank-name = "GPIOD";
548 };
549
550 gpioe: gpio@40021000 {
551 gpio-controller;
552 #gpio-cells = <2>;
553 interrupt-controller;
554 #interrupt-cells = <2>;
555 reg = <0x1000 0x400>;
556 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOE)>;
557 st,bank-name = "GPIOE";
558 };
559
560 gpiof: gpio@40021400 {
561 gpio-controller;
562 #gpio-cells = <2>;
563 interrupt-controller;
564 #interrupt-cells = <2>;
565 reg = <0x1400 0x400>;
566 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOF)>;
567 st,bank-name = "GPIOF";
568 };
569
570 gpiog: gpio@40021800 {
571 gpio-controller;
572 #gpio-cells = <2>;
573 interrupt-controller;
574 #interrupt-cells = <2>;
575 reg = <0x1800 0x400>;
576 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOG)>;
577 st,bank-name = "GPIOG";
578 };
579
580 gpioh: gpio@40021c00 {
581 gpio-controller;
582 #gpio-cells = <2>;
583 interrupt-controller;
584 #interrupt-cells = <2>;
585 reg = <0x1c00 0x400>;
586 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOH)>;
587 st,bank-name = "GPIOH";
588 };
589
590 gpioi: gpio@40022000 {
591 gpio-controller;
592 #gpio-cells = <2>;
593 interrupt-controller;
594 #interrupt-cells = <2>;
595 reg = <0x2000 0x400>;
596 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOI)>;
597 st,bank-name = "GPIOI";
598 };
599
600 gpioj: gpio@40022400 {
601 gpio-controller;
602 #gpio-cells = <2>;
603 interrupt-controller;
604 #interrupt-cells = <2>;
605 reg = <0x2400 0x400>;
606 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOJ)>;
607 st,bank-name = "GPIOJ";
608 };
609
610 gpiok: gpio@40022800 {
611 gpio-controller;
612 #gpio-cells = <2>;
613 interrupt-controller;
614 #interrupt-cells = <2>;
615 reg = <0x2800 0x400>;
616 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOK)>;
617 st,bank-name = "GPIOK";
618 };
619
620 cec_pins_a: cec@0 {
621 pins {
622 pinmux = <STM32_PINMUX('A', 15, AF4)>; /* HDMI CEC */
623 slew-rate = <0>;
624 drive-open-drain;
625 bias-disable;
626 };
627 };
628
629 usart1_pins_a: usart1@0 {
630 pins1 {
631 pinmux = <STM32_PINMUX('A', 9, AF7)>; /* USART1_TX */
632 bias-disable;
633 drive-push-pull;
634 slew-rate = <0>;
635 };
636 pins2 {
637 pinmux = <STM32_PINMUX('A', 10, AF7)>; /* USART1_RX */
638 bias-disable;
639 };
640 };
641
642 usart1_pins_b: usart1@1 {
643 pins1 {
644 pinmux = <STM32_PINMUX('A', 9, AF7)>; /* USART1_TX */
645 bias-disable;
646 drive-push-pull;
647 slew-rate = <0>;
648 };
649 pins2 {
650 pinmux = <STM32_PINMUX('B', 7, AF7)>; /* USART1_RX */
651 bias-disable;
652 };
653 };
654
655 i2c1_pins_b: i2c1@0 {
656 pins {
657 pinmux = <STM32_PINMUX('B', 9, AF4)>, /* I2C1 SDA */
658 <STM32_PINMUX('B', 8, AF4)>; /* I2C1 SCL */
659 bias-disable;
660 drive-open-drain;
661 slew-rate = <0>;
662 };
663 };
664
665 usbotg_hs_pins_a: usbotg-hs@0 {
666 pins {
667 pinmux = <STM32_PINMUX('H', 4, AF10)>, /* OTG_HS_ULPI_NXT */
668 <STM32_PINMUX('I', 11, AF10)>, /* OTG_HS_ULPI_DIR */
669 <STM32_PINMUX('C', 0, AF10)>, /* OTG_HS_ULPI_STP */
670 <STM32_PINMUX('A', 5, AF10)>, /* OTG_HS_ULPI_CK */
671 <STM32_PINMUX('A', 3, AF10)>, /* OTG_HS_ULPI_D0 */
672 <STM32_PINMUX('B', 0, AF10)>, /* OTG_HS_ULPI_D1 */
673 <STM32_PINMUX('B', 1, AF10)>, /* OTG_HS_ULPI_D2 */
674 <STM32_PINMUX('B', 10, AF10)>, /* OTG_HS_ULPI_D3 */
675 <STM32_PINMUX('B', 11, AF10)>, /* OTG_HS_ULPI_D4 */
676 <STM32_PINMUX('B', 12, AF10)>, /* OTG_HS_ULPI_D5 */
677 <STM32_PINMUX('B', 13, AF10)>, /* OTG_HS_ULPI_D6 */
678 <STM32_PINMUX('B', 5, AF10)>; /* OTG_HS_ULPI_D7 */
679 bias-disable;
680 drive-push-pull;
681 slew-rate = <2>;
682 };
683 };
684
685 usbotg_hs_pins_b: usbotg-hs@1 {
686 pins {
687 pinmux = <STM32_PINMUX('H', 4, AF10)>, /* OTG_HS_ULPI_NXT */
688 <STM32_PINMUX('C', 2, AF10)>, /* OTG_HS_ULPI_DIR */
689 <STM32_PINMUX('C', 0, AF10)>, /* OTG_HS_ULPI_STP */
690 <STM32_PINMUX('A', 5, AF10)>, /* OTG_HS_ULPI_CK */
691 <STM32_PINMUX('A', 3, AF10)>, /* OTG_HS_ULPI_D0 */
692 <STM32_PINMUX('B', 0, AF10)>, /* OTG_HS_ULPI_D1 */
693 <STM32_PINMUX('B', 1, AF10)>, /* OTG_HS_ULPI_D2 */
694 <STM32_PINMUX('B', 10, AF10)>, /* OTG_HS_ULPI_D3 */
695 <STM32_PINMUX('B', 11, AF10)>, /* OTG_HS_ULPI_D4 */
696 <STM32_PINMUX('B', 12, AF10)>, /* OTG_HS_ULPI_D5 */
697 <STM32_PINMUX('B', 13, AF10)>, /* OTG_HS_ULPI_D6 */
698 <STM32_PINMUX('B', 5, AF10)>; /* OTG_HS_ULPI_D7 */
699 bias-disable;
700 drive-push-pull;
701 slew-rate = <2>;
702 };
703 };
704
705 usbotg_fs_pins_a: usbotg-fs@0 {
706 pins {
707 pinmux = <STM32_PINMUX('A', 10, AF10)>, /* OTG_FS_ID */
708 <STM32_PINMUX('A', 11, AF10)>, /* OTG_FS_DM */
709 <STM32_PINMUX('A', 12, AF10)>; /* OTG_FS_DP */
710 bias-disable;
711 drive-push-pull;
712 slew-rate = <2>;
713 };
714 };
715 };
716
717 crc: crc@40023000 { 522 crc: crc@40023000 {
718 compatible = "st,stm32f7-crc"; 523 compatible = "st,stm32f7-crc";
719 reg = <0x40023000 0x400>; 524 reg = <0x40023000 0x400>;
@@ -771,6 +576,9 @@
771 interrupts = <77>; 576 interrupts = <77>;
772 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHS)>; 577 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHS)>;
773 clock-names = "otg"; 578 clock-names = "otg";
579 g-rx-fifo-size = <256>;
580 g-np-tx-fifo-size = <32>;
581 g-tx-fifo-size = <128 128 64 64 64 64 32 32>;
774 status = "disabled"; 582 status = "disabled";
775 }; 583 };
776 584
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index 4463ca13a740..2241eecdabfe 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -42,11 +42,13 @@
42 42
43/dts-v1/; 43/dts-v1/;
44#include "stm32f746.dtsi" 44#include "stm32f746.dtsi"
45#include "stm32f769-pinctrl.dtsi"
45#include <dt-bindings/input/input.h> 46#include <dt-bindings/input/input.h>
47#include <dt-bindings/gpio/gpio.h>
46 48
47/ { 49/ {
48 model = "STMicroelectronics STM32F769-DISCO board"; 50 model = "STMicroelectronics STM32F769-DISCO board";
49 compatible = "st,stm32f769-disco", "st,stm32f7"; 51 compatible = "st,stm32f769-disco", "st,stm32f769";
50 52
51 chosen { 53 chosen {
52 bootargs = "root=/dev/ram"; 54 bootargs = "root=/dev/ram";
@@ -61,6 +63,42 @@
61 serial0 = &usart1; 63 serial0 = &usart1;
62 }; 64 };
63 65
66 leds {
67 compatible = "gpio-leds";
68 green {
69 gpios = <&gpioj 5 GPIO_ACTIVE_HIGH>;
70 linux,default-trigger = "heartbeat";
71 };
72 red {
73 gpios = <&gpioj 13 GPIO_ACTIVE_HIGH>;
74 };
75 };
76
77 gpio_keys {
78 compatible = "gpio-keys";
79 #address-cells = <1>;
80 #size-cells = <0>;
81 autorepeat;
82 button@0 {
83 label = "User";
84 linux,code = <KEY_HOME>;
85 gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>;
86 };
87 };
88
89 usbotg_hs_phy: usb-phy {
90 #phy-cells = <0>;
91 compatible = "usb-nop-xceiv";
92 clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHSULPI)>;
93 clock-names = "main_clk";
94 };
95
96 mmc_vcard: mmc_vcard {
97 compatible = "regulator-fixed";
98 regulator-name = "mmc_vcard";
99 regulator-min-microvolt = <3300000>;
100 regulator-max-microvolt = <3300000>;
101 };
64}; 102};
65 103
66&cec { 104&cec {
@@ -73,8 +111,33 @@
73 clock-frequency = <25000000>; 111 clock-frequency = <25000000>;
74}; 112};
75 113
114&rtc {
115 status = "okay";
116};
117
118&sdio2 {
119 status = "okay";
120 vmmc-supply = <&mmc_vcard>;
121 cd-gpios = <&gpioi 15 GPIO_ACTIVE_HIGH>;
122 cd-inverted;
123 broken-cd;
124 pinctrl-names = "default", "opendrain";
125 pinctrl-0 = <&sdio_pins_b>;
126 pinctrl-1 = <&sdio_pins_od_b>;
127 bus-width = <4>;
128};
129
76&usart1 { 130&usart1 {
77 pinctrl-0 = <&usart1_pins_a>; 131 pinctrl-0 = <&usart1_pins_a>;
78 pinctrl-names = "default"; 132 pinctrl-names = "default";
79 status = "okay"; 133 status = "okay";
80}; 134};
135
136&usbotg_hs {
137 dr_mode = "otg";
138 phys = <&usbotg_hs_phy>;
139 phy-names = "usb2-phy";
140 pinctrl-0 = <&usbotg_hs_pins_a>;
141 pinctrl-names = "default";
142 status = "okay";
143};
diff --git a/arch/arm/boot/dts/stm32f769-pinctrl.dtsi b/arch/arm/boot/dts/stm32f769-pinctrl.dtsi
new file mode 100644
index 000000000000..31005dd9929c
--- /dev/null
+++ b/arch/arm/boot/dts/stm32f769-pinctrl.dtsi
@@ -0,0 +1,11 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
5 */
6
7#include "stm32f7-pinctrl.dtsi"
8
9&pinctrl{
10 compatible = "st,stm32f769-pinctrl";
11};
diff --git a/arch/arm/boot/dts/stm32h743-pinctrl.dtsi b/arch/arm/boot/dts/stm32h743-pinctrl.dtsi
index 65c1cd043987..0f15dfb98381 100644
--- a/arch/arm/boot/dts/stm32h743-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32h743-pinctrl.dtsi
@@ -49,6 +49,8 @@
49 #size-cells = <1>; 49 #size-cells = <1>;
50 compatible = "st,stm32h743-pinctrl"; 50 compatible = "st,stm32h743-pinctrl";
51 ranges = <0 0x58020000 0x3000>; 51 ranges = <0 0x58020000 0x3000>;
52 interrupt-parent = <&exti>;
53 st,syscfg = <&syscfg 0x8>;
52 pins-are-numbered; 54 pins-are-numbered;
53 55
54 gpioa: gpio@58020000 { 56 gpioa: gpio@58020000 {
@@ -57,6 +59,8 @@
57 reg = <0x0 0x400>; 59 reg = <0x0 0x400>;
58 clocks = <&rcc GPIOA_CK>; 60 clocks = <&rcc GPIOA_CK>;
59 st,bank-name = "GPIOA"; 61 st,bank-name = "GPIOA";
62 interrupt-controller;
63 #interrupt-cells = <2>;
60 }; 64 };
61 65
62 gpiob: gpio@58020400 { 66 gpiob: gpio@58020400 {
@@ -65,6 +69,8 @@
65 reg = <0x400 0x400>; 69 reg = <0x400 0x400>;
66 clocks = <&rcc GPIOB_CK>; 70 clocks = <&rcc GPIOB_CK>;
67 st,bank-name = "GPIOB"; 71 st,bank-name = "GPIOB";
72 interrupt-controller;
73 #interrupt-cells = <2>;
68 }; 74 };
69 75
70 gpioc: gpio@58020800 { 76 gpioc: gpio@58020800 {
@@ -73,6 +79,8 @@
73 reg = <0x800 0x400>; 79 reg = <0x800 0x400>;
74 clocks = <&rcc GPIOC_CK>; 80 clocks = <&rcc GPIOC_CK>;
75 st,bank-name = "GPIOC"; 81 st,bank-name = "GPIOC";
82 interrupt-controller;
83 #interrupt-cells = <2>;
76 }; 84 };
77 85
78 gpiod: gpio@58020c00 { 86 gpiod: gpio@58020c00 {
@@ -81,6 +89,8 @@
81 reg = <0xc00 0x400>; 89 reg = <0xc00 0x400>;
82 clocks = <&rcc GPIOD_CK>; 90 clocks = <&rcc GPIOD_CK>;
83 st,bank-name = "GPIOD"; 91 st,bank-name = "GPIOD";
92 interrupt-controller;
93 #interrupt-cells = <2>;
84 }; 94 };
85 95
86 gpioe: gpio@58021000 { 96 gpioe: gpio@58021000 {
@@ -89,6 +99,8 @@
89 reg = <0x1000 0x400>; 99 reg = <0x1000 0x400>;
90 clocks = <&rcc GPIOE_CK>; 100 clocks = <&rcc GPIOE_CK>;
91 st,bank-name = "GPIOE"; 101 st,bank-name = "GPIOE";
102 interrupt-controller;
103 #interrupt-cells = <2>;
92 }; 104 };
93 105
94 gpiof: gpio@58021400 { 106 gpiof: gpio@58021400 {
@@ -97,6 +109,8 @@
97 reg = <0x1400 0x400>; 109 reg = <0x1400 0x400>;
98 clocks = <&rcc GPIOF_CK>; 110 clocks = <&rcc GPIOF_CK>;
99 st,bank-name = "GPIOF"; 111 st,bank-name = "GPIOF";
112 interrupt-controller;
113 #interrupt-cells = <2>;
100 }; 114 };
101 115
102 gpiog: gpio@58021800 { 116 gpiog: gpio@58021800 {
@@ -105,6 +119,8 @@
105 reg = <0x1800 0x400>; 119 reg = <0x1800 0x400>;
106 clocks = <&rcc GPIOG_CK>; 120 clocks = <&rcc GPIOG_CK>;
107 st,bank-name = "GPIOG"; 121 st,bank-name = "GPIOG";
122 interrupt-controller;
123 #interrupt-cells = <2>;
108 }; 124 };
109 125
110 gpioh: gpio@58021c00 { 126 gpioh: gpio@58021c00 {
@@ -113,6 +129,8 @@
113 reg = <0x1c00 0x400>; 129 reg = <0x1c00 0x400>;
114 clocks = <&rcc GPIOH_CK>; 130 clocks = <&rcc GPIOH_CK>;
115 st,bank-name = "GPIOH"; 131 st,bank-name = "GPIOH";
132 interrupt-controller;
133 #interrupt-cells = <2>;
116 }; 134 };
117 135
118 gpioi: gpio@58022000 { 136 gpioi: gpio@58022000 {
@@ -121,6 +139,8 @@
121 reg = <0x2000 0x400>; 139 reg = <0x2000 0x400>;
122 clocks = <&rcc GPIOI_CK>; 140 clocks = <&rcc GPIOI_CK>;
123 st,bank-name = "GPIOI"; 141 st,bank-name = "GPIOI";
142 interrupt-controller;
143 #interrupt-cells = <2>;
124 }; 144 };
125 145
126 gpioj: gpio@58022400 { 146 gpioj: gpio@58022400 {
@@ -129,6 +149,8 @@
129 reg = <0x2400 0x400>; 149 reg = <0x2400 0x400>;
130 clocks = <&rcc GPIOJ_CK>; 150 clocks = <&rcc GPIOJ_CK>;
131 st,bank-name = "GPIOJ"; 151 st,bank-name = "GPIOJ";
152 interrupt-controller;
153 #interrupt-cells = <2>;
132 }; 154 };
133 155
134 gpiok: gpio@58022800 { 156 gpiok: gpio@58022800 {
@@ -137,6 +159,8 @@
137 reg = <0x2800 0x400>; 159 reg = <0x2800 0x400>;
138 clocks = <&rcc GPIOK_CK>; 160 clocks = <&rcc GPIOK_CK>;
139 st,bank-name = "GPIOK"; 161 st,bank-name = "GPIOK";
162 interrupt-controller;
163 #interrupt-cells = <2>;
140 }; 164 };
141 165
142 usart1_pins: usart1@0 { 166 usart1_pins: usart1@0 {
@@ -164,6 +188,26 @@
164 bias-disable; 188 bias-disable;
165 }; 189 };
166 }; 190 };
191
192 usbotg_hs_pins_a: usbotg-hs@0 {
193 pins {
194 pinmux = <STM32_PINMUX('H', 4, AF10)>, /* ULPI_NXT */
195 <STM32_PINMUX('I', 11, AF10)>, /* ULPI_DIR> */
196 <STM32_PINMUX('C', 0, AF10)>, /* ULPI_STP> */
197 <STM32_PINMUX('A', 5, AF10)>, /* ULPI_CK> */
198 <STM32_PINMUX('A', 3, AF10)>, /* ULPI_D0> */
199 <STM32_PINMUX('B', 0, AF10)>, /* ULPI_D1> */
200 <STM32_PINMUX('B', 1, AF10)>, /* ULPI_D2> */
201 <STM32_PINMUX('B', 10, AF10)>, /* ULPI_D3> */
202 <STM32_PINMUX('B', 11, AF10)>, /* ULPI_D4> */
203 <STM32_PINMUX('B', 12, AF10)>, /* ULPI_D5> */
204 <STM32_PINMUX('B', 13, AF10)>, /* ULPI_D6> */
205 <STM32_PINMUX('B', 5, AF10)>; /* ULPI_D7> */
206 bias-disable;
207 drive-push-pull;
208 slew-rate = <2>;
209 };
210 };
167 }; 211 };
168 }; 212 };
169}; 213};
diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi
index bbfcbaca0b36..2bb103e1194d 100644
--- a/arch/arm/boot/dts/stm32h743.dtsi
+++ b/arch/arm/boot/dts/stm32h743.dtsi
@@ -44,6 +44,7 @@
44#include "armv7-m.dtsi" 44#include "armv7-m.dtsi"
45#include <dt-bindings/clock/stm32h7-clks.h> 45#include <dt-bindings/clock/stm32h7-clks.h>
46#include <dt-bindings/mfd/stm32h7-rcc.h> 46#include <dt-bindings/mfd/stm32h7-rcc.h>
47#include <dt-bindings/interrupt-controller/irq.h>
47 48
48/ { 49/ {
49 clocks { 50 clocks {
@@ -100,6 +101,27 @@
100 }; 101 };
101 }; 102 };
102 103
104 spi2: spi@40003800 {
105 #address-cells = <1>;
106 #size-cells = <0>;
107 compatible = "st,stm32h7-spi";
108 reg = <0x40003800 0x400>;
109 interrupts = <36>;
110 clocks = <&rcc SPI2_CK>;
111 status = "disabled";
112
113 };
114
115 spi3: spi@40003c00 {
116 #address-cells = <1>;
117 #size-cells = <0>;
118 compatible = "st,stm32h7-spi";
119 reg = <0x40003c00 0x400>;
120 interrupts = <51>;
121 clocks = <&rcc SPI3_CK>;
122 status = "disabled";
123 };
124
103 usart2: serial@40004400 { 125 usart2: serial@40004400 {
104 compatible = "st,stm32f7-uart"; 126 compatible = "st,stm32f7-uart";
105 reg = <0x40004400 0x400>; 127 reg = <0x40004400 0x400>;
@@ -140,6 +162,36 @@
140 clocks = <&rcc USART1_CK>; 162 clocks = <&rcc USART1_CK>;
141 }; 163 };
142 164
165 spi1: spi@40013000 {
166 #address-cells = <1>;
167 #size-cells = <0>;
168 compatible = "st,stm32h7-spi";
169 reg = <0x40013000 0x400>;
170 interrupts = <35>;
171 clocks = <&rcc SPI1_CK>;
172 status = "disabled";
173 };
174
175 spi4: spi@40013400 {
176 #address-cells = <1>;
177 #size-cells = <0>;
178 compatible = "st,stm32h7-spi";
179 reg = <0x40013400 0x400>;
180 interrupts = <84>;
181 clocks = <&rcc SPI4_CK>;
182 status = "disabled";
183 };
184
185 spi5: spi@40015000 {
186 #address-cells = <1>;
187 #size-cells = <0>;
188 compatible = "st,stm32h7-spi";
189 reg = <0x40015000 0x400>;
190 interrupts = <85>;
191 clocks = <&rcc SPI5_CK>;
192 status = "disabled";
193 };
194
143 dma1: dma@40020000 { 195 dma1: dma@40020000 {
144 compatible = "st,stm32-dma"; 196 compatible = "st,stm32-dma";
145 reg = <0x40020000 0x400>; 197 reg = <0x40020000 0x400>;
@@ -217,6 +269,27 @@
217 }; 269 };
218 }; 270 };
219 271
272 usbotg_hs: usb@40040000 {
273 compatible = "st,stm32f7-hsotg";
274 reg = <0x40040000 0x40000>;
275 interrupts = <77>;
276 clocks = <&rcc USB1OTG_CK>;
277 clock-names = "otg";
278 g-rx-fifo-size = <256>;
279 g-np-tx-fifo-size = <32>;
280 g-tx-fifo-size = <128 128 64 64 64 64 32 32>;
281 status = "disabled";
282 };
283
284 usbotg_fs: usb@40080000 {
285 compatible = "st,stm32f4x9-fsotg";
286 reg = <0x40080000 0x40000>;
287 interrupts = <101>;
288 clocks = <&rcc USB2OTG_CK>;
289 clock-names = "otg";
290 status = "disabled";
291 };
292
220 mdma1: dma@52000000 { 293 mdma1: dma@52000000 {
221 compatible = "st,stm32h7-mdma"; 294 compatible = "st,stm32h7-mdma";
222 reg = <0x52000000 0x1000>; 295 reg = <0x52000000 0x1000>;
@@ -227,6 +300,29 @@
227 dma-requests = <32>; 300 dma-requests = <32>;
228 }; 301 };
229 302
303 exti: interrupt-controller@58000000 {
304 compatible = "st,stm32h7-exti";
305 interrupt-controller;
306 #interrupt-cells = <2>;
307 reg = <0x58000000 0x400>;
308 interrupts = <1>, <2>, <3>, <6>, <7>, <8>, <9>, <10>, <23>, <40>, <41>, <62>, <76>;
309 };
310
311 syscfg: system-config@58000400 {
312 compatible = "syscon";
313 reg = <0x58000400 0x400>;
314 };
315
316 spi6: spi@58001400 {
317 #address-cells = <1>;
318 #size-cells = <0>;
319 compatible = "st,stm32h7-spi";
320 reg = <0x58001400 0x400>;
321 interrupts = <86>;
322 clocks = <&rcc SPI6_CK>;
323 status = "disabled";
324 };
325
230 lptimer2: timer@58002400 { 326 lptimer2: timer@58002400 {
231 #address-cells = <1>; 327 #address-cells = <1>;
232 #size-cells = <0>; 328 #size-cells = <0>;
@@ -304,7 +400,7 @@
304 }; 400 };
305 }; 401 };
306 402
307 vrefbuf: regulator@58003C00 { 403 vrefbuf: regulator@58003c00 {
308 compatible = "st,stm32-vrefbuf"; 404 compatible = "st,stm32-vrefbuf";
309 reg = <0x58003C00 0x8>; 405 reg = <0x58003C00 0x8>;
310 clocks = <&rcc VREF_CK>; 406 clocks = <&rcc VREF_CK>;
@@ -313,6 +409,20 @@
313 status = "disabled"; 409 status = "disabled";
314 }; 410 };
315 411
412 rtc: rtc@58004000 {
413 compatible = "st,stm32h7-rtc";
414 reg = <0x58004000 0x400>;
415 clocks = <&rcc RTCAPB_CK>, <&rcc RTC_CK>;
416 clock-names = "pclk", "rtc_ck";
417 assigned-clocks = <&rcc RTC_CK>;
418 assigned-clock-parents = <&rcc LSE_CK>;
419 interrupt-parent = <&exti>;
420 interrupts = <17 IRQ_TYPE_EDGE_RISING>;
421 interrupt-names = "alarm";
422 st,syscfg = <&pwrcfg>;
423 status = "disabled";
424 };
425
316 rcc: reset-clock-controller@58024400 { 426 rcc: reset-clock-controller@58024400 {
317 compatible = "st,stm32h743-rcc", "st,stm32-rcc"; 427 compatible = "st,stm32h743-rcc", "st,stm32-rcc";
318 reg = <0x58024400 0x400>; 428 reg = <0x58024400 0x400>;
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 79e841d94079..45e088c55741 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -63,7 +63,7 @@
63}; 63};
64 64
65&clk_hse { 65&clk_hse {
66 clock-frequency = <125000000>; 66 clock-frequency = <25000000>;
67}; 67};
68 68
69&usart2 { 69&usart2 {
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index 9f0e72c67219..c7187e18ea16 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -68,6 +68,14 @@
68 regulator-max-microvolt = <3300000>; 68 regulator-max-microvolt = <3300000>;
69 regulator-always-on; 69 regulator-always-on;
70 }; 70 };
71
72 usbotg_hs_phy: usb-phy {
73 #phy-cells = <0>;
74 compatible = "usb-nop-xceiv";
75 clocks = <&rcc USB1ULPI_CK>;
76 clock-names = "main_clk";
77 };
78
71}; 79};
72 80
73&adc_12 { 81&adc_12 {
@@ -84,9 +92,21 @@
84 clock-frequency = <25000000>; 92 clock-frequency = <25000000>;
85}; 93};
86 94
95&rtc {
96 status = "okay";
97};
98
87&usart1 { 99&usart1 {
88 pinctrl-0 = <&usart1_pins>; 100 pinctrl-0 = <&usart1_pins>;
89 pinctrl-names = "default"; 101 pinctrl-names = "default";
90 status = "okay"; 102 status = "okay";
91}; 103};
92 104
105&usbotg_hs {
106 pinctrl-0 = <&usbotg_hs_pins_a>;
107 pinctrl-names = "default";
108 phys = <&usbotg_hs_phy>;
109 phy-names = "usb2-phy";
110 dr_mode = "otg";
111 status = "okay";
112};
diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
new file mode 100644
index 000000000000..c0743305f31b
--- /dev/null
+++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi
@@ -0,0 +1,185 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5 */
6#include <dt-bindings/pinctrl/stm32-pinfunc.h>
7
8/ {
9 soc {
10 pinctrl: pin-controller {
11 #address-cells = <1>;
12 #size-cells = <1>;
13 compatible = "st,stm32mp157-pinctrl";
14 ranges = <0 0x50002000 0xa400>;
15 pins-are-numbered;
16
17 gpioa: gpio@50002000 {
18 gpio-controller;
19 #gpio-cells = <2>;
20 interrupt-controller;
21 #interrupt-cells = <2>;
22 reg = <0x0 0x400>;
23 clocks = <&clk_pll3_p>;
24 st,bank-name = "GPIOA";
25 ngpios = <16>;
26 gpio-ranges = <&pinctrl 0 0 16>;
27 };
28
29 gpiob: gpio@50003000 {
30 gpio-controller;
31 #gpio-cells = <2>;
32 interrupt-controller;
33 #interrupt-cells = <2>;
34 reg = <0x1000 0x400>;
35 clocks = <&clk_pll3_p>;
36 st,bank-name = "GPIOB";
37 ngpios = <16>;
38 gpio-ranges = <&pinctrl 0 16 16>;
39 };
40
41 gpioc: gpio@50004000 {
42 gpio-controller;
43 #gpio-cells = <2>;
44 interrupt-controller;
45 #interrupt-cells = <2>;
46 reg = <0x2000 0x400>;
47 clocks = <&clk_pll3_p>;
48 st,bank-name = "GPIOC";
49 ngpios = <16>;
50 gpio-ranges = <&pinctrl 0 32 16>;
51 };
52
53 gpiod: gpio@50005000 {
54 gpio-controller;
55 #gpio-cells = <2>;
56 interrupt-controller;
57 #interrupt-cells = <2>;
58 reg = <0x3000 0x400>;
59 clocks = <&clk_pll3_p>;
60 st,bank-name = "GPIOD";
61 ngpios = <16>;
62 gpio-ranges = <&pinctrl 0 48 16>;
63 };
64
65 gpioe: gpio@50006000 {
66 gpio-controller;
67 #gpio-cells = <2>;
68 interrupt-controller;
69 #interrupt-cells = <2>;
70 reg = <0x4000 0x400>;
71 clocks = <&clk_pll3_p>;
72 st,bank-name = "GPIOE";
73 ngpios = <16>;
74 gpio-ranges = <&pinctrl 0 64 16>;
75 };
76
77 gpiof: gpio@50007000 {
78 gpio-controller;
79 #gpio-cells = <2>;
80 interrupt-controller;
81 #interrupt-cells = <2>;
82 reg = <0x5000 0x400>;
83 clocks = <&clk_pll3_p>;
84 st,bank-name = "GPIOF";
85 ngpios = <16>;
86 gpio-ranges = <&pinctrl 0 80 16>;
87 };
88
89 gpiog: gpio@50008000 {
90 gpio-controller;
91 #gpio-cells = <2>;
92 interrupt-controller;
93 #interrupt-cells = <2>;
94 reg = <0x6000 0x400>;
95 clocks = <&clk_pll3_p>;
96 st,bank-name = "GPIOG";
97 ngpios = <16>;
98 gpio-ranges = <&pinctrl 0 96 16>;
99 };
100
101 gpioh: gpio@50009000 {
102 gpio-controller;
103 #gpio-cells = <2>;
104 interrupt-controller;
105 #interrupt-cells = <2>;
106 reg = <0x7000 0x400>;
107 clocks = <&clk_pll3_p>;
108 st,bank-name = "GPIOH";
109 ngpios = <16>;
110 gpio-ranges = <&pinctrl 0 112 16>;
111 };
112
113 gpioi: gpio@5000a000 {
114 gpio-controller;
115 #gpio-cells = <2>;
116 interrupt-controller;
117 #interrupt-cells = <2>;
118 reg = <0x8000 0x400>;
119 clocks = <&clk_pll3_p>;
120 st,bank-name = "GPIOI";
121 ngpios = <16>;
122 gpio-ranges = <&pinctrl 0 128 16>;
123 };
124
125 gpioj: gpio@5000b000 {
126 gpio-controller;
127 #gpio-cells = <2>;
128 interrupt-controller;
129 #interrupt-cells = <2>;
130 reg = <0x9000 0x400>;
131 clocks = <&clk_pll3_p>;
132 st,bank-name = "GPIOJ";
133 ngpios = <16>;
134 gpio-ranges = <&pinctrl 0 144 16>;
135 };
136
137 gpiok: gpio@5000c000 {
138 gpio-controller;
139 #gpio-cells = <2>;
140 interrupt-controller;
141 #interrupt-cells = <2>;
142 reg = <0xa000 0x400>;
143 clocks = <&clk_pll3_p>;
144 st,bank-name = "GPIOK";
145 ngpios = <8>;
146 gpio-ranges = <&pinctrl 0 160 8>;
147 };
148
149 uart4_pins_a: uart4@0 {
150 pins1 {
151 pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
152 bias-disable;
153 drive-push-pull;
154 slew-rate = <0>;
155 };
156 pins2 {
157 pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
158 bias-disable;
159 };
160 };
161 };
162
163 pinctrl_z: pin-controller-z {
164 #address-cells = <1>;
165 #size-cells = <1>;
166 compatible = "st,stm32mp157-z-pinctrl";
167 ranges = <0 0x54004000 0x400>;
168 pins-are-numbered;
169 status = "disabled";
170
171 gpioz: gpio@54004000 {
172 gpio-controller;
173 #gpio-cells = <2>;
174 interrupt-controller;
175 #interrupt-cells = <2>;
176 reg = <0 0x400>;
177 clocks = <&clk_pll2_p>;
178 st,bank-name = "GPIOZ";
179 st,bank-ioport = <11>;
180 ngpios = <8>;
181 gpio-ranges = <&pinctrl_z 0 400 8>;
182 };
183 };
184 };
185};
diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
new file mode 100644
index 000000000000..9f90337a22e3
--- /dev/null
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -0,0 +1,32 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5 */
6/dts-v1/;
7
8#include "stm32mp157c.dtsi"
9#include "stm32mp157-pinctrl.dtsi"
10
11/ {
12 model = "STMicroelectronics STM32MP157C eval daughter";
13 compatible = "st,stm32mp157c-ed1", "st,stm32mp157";
14
15 chosen {
16 stdout-path = "serial0:115200n8";
17 };
18
19 memory {
20 reg = <0xC0000000 0x40000000>;
21 };
22
23 aliases {
24 serial0 = &uart4;
25 };
26};
27
28&uart4 {
29 pinctrl-names = "default";
30 pinctrl-0 = <&uart4_pins_a>;
31 status = "okay";
32};
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
new file mode 100644
index 000000000000..57e6dbc52e09
--- /dev/null
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5 */
6/dts-v1/;
7
8#include "stm32mp157c-ed1.dts"
9
10/ {
11 model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
12 compatible = "st,stm32mp157c-ev1", "st,stm32mp157c-ed1", "st,stm32mp157";
13
14 chosen {
15 stdout-path = "serial0:115200n8";
16 };
17
18 aliases {
19 serial0 = &uart4;
20 };
21};
diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi
new file mode 100644
index 000000000000..9e17e42b02b2
--- /dev/null
+++ b/arch/arm/boot/dts/stm32mp157c.dtsi
@@ -0,0 +1,194 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5 */
6#include <dt-bindings/interrupt-controller/arm-gic.h>
7
8/ {
9 #address-cells = <1>;
10 #size-cells = <1>;
11
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 cpu0: cpu@0 {
17 compatible = "arm,cortex-a7";
18 device_type = "cpu";
19 reg = <0>;
20 };
21
22 cpu1: cpu@1 {
23 compatible = "arm,cortex-a7";
24 device_type = "cpu";
25 reg = <1>;
26 };
27 };
28
29 psci {
30 compatible = "arm,psci";
31 method = "smc";
32 cpu_off = <0x84000002>;
33 cpu_on = <0x84000003>;
34 };
35
36 aliases {
37 gpio0 = &gpioa;
38 gpio1 = &gpiob;
39 gpio2 = &gpioc;
40 gpio3 = &gpiod;
41 gpio4 = &gpioe;
42 gpio5 = &gpiof;
43 gpio6 = &gpiog;
44 gpio7 = &gpioh;
45 gpio8 = &gpioi;
46 gpio9 = &gpioj;
47 gpio10 = &gpiok;
48 };
49
50 intc: interrupt-controller@a0021000 {
51 compatible = "arm,cortex-a7-gic";
52 #interrupt-cells = <3>;
53 interrupt-controller;
54 reg = <0xa0021000 0x1000>,
55 <0xa0022000 0x2000>;
56 };
57
58 timer {
59 compatible = "arm,armv7-timer";
60 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
61 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
62 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
63 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
64 interrupt-parent = <&intc>;
65 };
66
67 clocks {
68 clk_hse: clk-hse {
69 #clock-cells = <0>;
70 compatible = "fixed-clock";
71 clock-frequency = <24000000>;
72 };
73
74 clk_pll_per: clk-pll-per {
75 #clock-cells = <0>;
76 compatible = "fixed-clock";
77 clock-frequency = <64000000>;
78 };
79
80 clk_hsi: clk-hsi {
81 #clock-cells = <0>;
82 compatible = "fixed-clock";
83 clock-frequency = <64000000>;
84 };
85
86 clk_lse: clk-lse {
87 #clock-cells = <0>;
88 compatible = "fixed-clock";
89 clock-frequency = <32768>;
90 };
91
92 clk_lsi: clk-lsi {
93 #clock-cells = <0>;
94 compatible = "fixed-clock";
95 clock-frequency = <32000>;
96 };
97
98 clk_csi: clk-csi {
99 #clock-cells = <0>;
100 compatible = "fixed-clock";
101 clock-frequency = <4000000>;
102 };
103
104 clk_pclk1: clk-pclk1 {
105 #clock-cells = <0>;
106 compatible = "fixed-clock";
107 clock-frequency = <86000000>;
108 };
109
110 clk_pll3_p: clk-pll3_p {
111 #clock-cells = <0>;
112 compatible = "fixed-clock";
113 clock-frequency = <172000000>;
114 };
115
116 clk_pll2_p: clk-pll2_p {
117 #clock-cells = <0>;
118 compatible = "fixed-clock";
119 clock-frequency = <264000000>;
120 };
121 };
122
123 soc {
124 compatible = "simple-bus";
125 #address-cells = <1>;
126 #size-cells = <1>;
127 interrupt-parent = <&intc>;
128 ranges;
129
130 usart2: serial@4000e000 {
131 compatible = "st,stm32h7-uart";
132 reg = <0x4000e000 0x400>;
133 interrupts = <GIC_SPI 38 IRQ_TYPE_NONE>;
134 clocks = <&clk_pclk1>;
135 status = "disabled";
136 };
137
138 usart3: serial@4000f000 {
139 compatible = "st,stm32h7-uart";
140 reg = <0x4000f000 0x400>;
141 interrupts = <GIC_SPI 39 IRQ_TYPE_NONE>;
142 clocks = <&clk_pclk1>;
143 status = "disabled";
144 };
145
146 uart4: serial@40010000 {
147 compatible = "st,stm32h7-uart";
148 reg = <0x40010000 0x400>;
149 interrupts = <GIC_SPI 52 IRQ_TYPE_NONE>;
150 clocks = <&clk_pclk1>;
151 status = "disabled";
152 };
153
154 uart5: serial@40011000 {
155 compatible = "st,stm32h7-uart";
156 reg = <0x40011000 0x400>;
157 interrupts = <GIC_SPI 53 IRQ_TYPE_NONE>;
158 clocks = <&clk_pclk1>;
159 status = "disabled";
160 };
161
162 uart7: serial@40018000 {
163 compatible = "st,stm32h7-uart";
164 reg = <0x40018000 0x400>;
165 interrupts = <GIC_SPI 82 IRQ_TYPE_NONE>;
166 clocks = <&clk_pclk1>;
167 status = "disabled";
168 };
169
170 uart8: serial@40019000 {
171 compatible = "st,stm32h7-uart";
172 reg = <0x40019000 0x400>;
173 interrupts = <GIC_SPI 83 IRQ_TYPE_NONE>;
174 clocks = <&clk_pclk1>;
175 status = "disabled";
176 };
177
178 usart6: serial@44003000 {
179 compatible = "st,stm32h7-uart";
180 reg = <0x44003000 0x400>;
181 interrupts = <GIC_SPI 71 IRQ_TYPE_NONE>;
182 clocks = <&clk_pclk1>;
183 status = "disabled";
184 };
185
186 usart1: serial@5c000000 {
187 compatible = "st,stm32h7-uart";
188 reg = <0x5c000000 0x400>;
189 interrupts = <GIC_SPI 37 IRQ_TYPE_NONE>;
190 clocks = <&clk_pclk1>;
191 status = "disabled";
192 };
193 };
194};
diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
index 09e909576c61..6c254ec4c85b 100644
--- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
+++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
@@ -164,8 +164,7 @@
164&mmc0 { 164&mmc0 {
165 vmmc-supply = <&reg_vcc3v3>; 165 vmmc-supply = <&reg_vcc3v3>;
166 bus-width = <4>; 166 bus-width = <4>;
167 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 167 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
168 cd-inverted;
169 status = "okay"; 168 status = "okay";
170}; 169};
171 170
diff --git a/arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts b/arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts
index 39ba4ccb9e2e..38a2c4134952 100644
--- a/arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts
+++ b/arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts
@@ -106,8 +106,7 @@
106&mmc0 { 106&mmc0 {
107 vmmc-supply = <&reg_vcc3v3>; 107 vmmc-supply = <&reg_vcc3v3>;
108 bus-width = <4>; 108 bus-width = <4>;
109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
110 cd-inverted;
111 status = "okay"; 110 status = "okay";
112}; 111};
113 112
diff --git a/arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts b/arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts
index dfc88aee4fe3..cf7b392dff31 100644
--- a/arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts
+++ b/arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts
@@ -123,8 +123,7 @@
123&mmc0 { 123&mmc0 {
124 vmmc-supply = <&reg_vcc3v3>; 124 vmmc-supply = <&reg_vcc3v3>;
125 bus-width = <4>; 125 bus-width = <4>;
126 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 126 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
127 cd-inverted;
128 status = "okay"; 127 status = "okay";
129}; 128};
130 129
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index 1982c8c238c5..197a1f2b75ff 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -162,8 +162,7 @@
162&mmc0 { 162&mmc0 {
163 vmmc-supply = <&reg_vcc3v3>; 163 vmmc-supply = <&reg_vcc3v3>;
164 bus-width = <4>; 164 bus-width = <4>;
165 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 165 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
166 cd-inverted;
167 status = "okay"; 166 status = "okay";
168}; 167};
169 168
diff --git a/arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dts b/arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dts
index 147cbc5e08ac..896e27a08727 100644
--- a/arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dts
+++ b/arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dts
@@ -150,8 +150,7 @@
150&mmc0 { 150&mmc0 {
151 vmmc-supply = <&reg_vcc3v3>; 151 vmmc-supply = <&reg_vcc3v3>;
152 bus-width = <4>; 152 bus-width = <4>;
153 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 153 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
154 cd-inverted;
155 status = "okay"; 154 status = "okay";
156}; 155};
157 156
diff --git a/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts b/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts
index 41ca8bded89f..ea7a59dcf8f9 100644
--- a/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts
+++ b/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts
@@ -141,8 +141,7 @@
141&mmc0 { 141&mmc0 {
142 vmmc-supply = <&reg_vcc3v3>; 142 vmmc-supply = <&reg_vcc3v3>;
143 bus-width = <4>; 143 bus-width = <4>;
144 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH01 */ 144 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH01 */
145 cd-inverted;
146 status = "okay"; 145 status = "okay";
147}; 146};
148 147
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
index f33e42d6ce8b..cc988ccd5ca7 100644
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -106,8 +106,7 @@
106&mmc0 { 106&mmc0 {
107 vmmc-supply = <&reg_vcc3v3>; 107 vmmc-supply = <&reg_vcc3v3>;
108 bus-width = <4>; 108 bus-width = <4>;
109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
110 cd-inverted;
111 status = "okay"; 110 status = "okay";
112}; 111};
113 112
diff --git a/arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts b/arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts
index 35c57d065dd8..f63767cddd8e 100644
--- a/arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts
@@ -78,8 +78,7 @@
78&mmc0 { 78&mmc0 {
79 vmmc-supply = <&reg_vcc3v3>; 79 vmmc-supply = <&reg_vcc3v3>;
80 bus-width = <4>; 80 bus-width = <4>;
81 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 81 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
82 cd-inverted;
83 status = "okay"; 82 status = "okay";
84}; 83};
85 84
diff --git a/arch/arm/boot/dts/sun4i-a10-inet1.dts b/arch/arm/boot/dts/sun4i-a10-inet1.dts
index 9482e831a9a1..26d0c1d6a02b 100644
--- a/arch/arm/boot/dts/sun4i-a10-inet1.dts
+++ b/arch/arm/boot/dts/sun4i-a10-inet1.dts
@@ -152,8 +152,7 @@
152&mmc0 { 152&mmc0 {
153 vmmc-supply = <&reg_vcc3v3>; 153 vmmc-supply = <&reg_vcc3v3>;
154 bus-width = <4>; 154 bus-width = <4>;
155 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 155 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
156 cd-inverted;
157 status = "okay"; 156 status = "okay";
158}; 157};
159 158
diff --git a/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
index 4b5c91c8e85b..5d096528e75a 100644
--- a/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
+++ b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
@@ -142,8 +142,7 @@
142&mmc0 { 142&mmc0 {
143 vmmc-supply = <&reg_vcc3v3>; 143 vmmc-supply = <&reg_vcc3v3>;
144 bus-width = <4>; 144 bus-width = <4>;
145 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 145 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
146 cd-inverted;
147 status = "okay"; 146 status = "okay";
148}; 147};
149 148
diff --git a/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts b/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts
index 13224f5ac166..221acd10f6c8 100644
--- a/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts
+++ b/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts
@@ -300,8 +300,7 @@
300&mmc0 { 300&mmc0 {
301 vmmc-supply = <&reg_vcc3v3>; 301 vmmc-supply = <&reg_vcc3v3>;
302 bus-width = <4>; 302 bus-width = <4>;
303 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 303 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
304 cd-inverted;
305 status = "okay"; 304 status = "okay";
306}; 305};
307 306
diff --git a/arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dts b/arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dts
index d22bd79562d8..80ecd78247ac 100644
--- a/arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dts
+++ b/arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dts
@@ -106,8 +106,7 @@
106 pinctrl-0 = <&mmc0_pins>; 106 pinctrl-0 = <&mmc0_pins>;
107 vmmc-supply = <&reg_vcc3v3>; 107 vmmc-supply = <&reg_vcc3v3>;
108 bus-width = <4>; 108 bus-width = <4>;
109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 109 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
110 cd-inverted;
111 status = "okay"; 110 status = "okay";
112}; 111};
113 112
diff --git a/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts b/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts
index 879141ca6027..247fa27ef717 100644
--- a/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts
+++ b/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts
@@ -133,8 +133,7 @@
133&mmc0 { 133&mmc0 {
134 vmmc-supply = <&reg_vcc3v3>; 134 vmmc-supply = <&reg_vcc3v3>;
135 bus-width = <4>; 135 bus-width = <4>;
136 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 136 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
137 cd-inverted;
138 status = "okay"; 137 status = "okay";
139}; 138};
140 139
diff --git a/arch/arm/boot/dts/sun4i-a10-marsboard.dts b/arch/arm/boot/dts/sun4i-a10-marsboard.dts
index 435c551aef0f..0dbf69576512 100644
--- a/arch/arm/boot/dts/sun4i-a10-marsboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-marsboard.dts
@@ -132,8 +132,7 @@
132&mmc0 { 132&mmc0 {
133 vmmc-supply = <&reg_vcc3v3>; 133 vmmc-supply = <&reg_vcc3v3>;
134 bus-width = <4>; 134 bus-width = <4>;
135 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 135 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
136 cd-inverted;
137 status = "okay"; 136 status = "okay";
138}; 137};
139 138
diff --git a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
index 1b639e5f9172..f9d74e21031d 100644
--- a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
+++ b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
@@ -96,8 +96,7 @@
96&mmc0 { 96&mmc0 {
97 vmmc-supply = <&reg_vcc3v3>; 97 vmmc-supply = <&reg_vcc3v3>;
98 bus-width = <4>; 98 bus-width = <4>;
99 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 99 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
100 cd-inverted;
101 status = "okay"; 100 status = "okay";
102}; 101};
103 102
diff --git a/arch/arm/boot/dts/sun4i-a10-mk802.dts b/arch/arm/boot/dts/sun4i-a10-mk802.dts
index 7198b34e2e50..059fe9c5d024 100644
--- a/arch/arm/boot/dts/sun4i-a10-mk802.dts
+++ b/arch/arm/boot/dts/sun4i-a10-mk802.dts
@@ -56,12 +56,27 @@
56 chosen { 56 chosen {
57 stdout-path = "serial0:115200n8"; 57 stdout-path = "serial0:115200n8";
58 }; 58 };
59
60 hdmi-connector {
61 compatible = "hdmi-connector";
62 type = "a";
63
64 port {
65 hdmi_con_in: endpoint {
66 remote-endpoint = <&hdmi_out_con>;
67 };
68 };
69 };
59}; 70};
60 71
61&codec { 72&codec {
62 status = "okay"; 73 status = "okay";
63}; 74};
64 75
76&de {
77 status = "okay";
78};
79
65&ehci0 { 80&ehci0 {
66 status = "okay"; 81 status = "okay";
67}; 82};
@@ -70,11 +85,20 @@
70 status = "okay"; 85 status = "okay";
71}; 86};
72 87
88&hdmi {
89 status = "okay";
90};
91
92&hdmi_out {
93 hdmi_out_con: endpoint {
94 remote-endpoint = <&hdmi_con_in>;
95 };
96};
97
73&mmc0 { 98&mmc0 {
74 vmmc-supply = <&reg_vcc3v3>; 99 vmmc-supply = <&reg_vcc3v3>;
75 bus-width = <4>; 100 bus-width = <4>;
76 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 101 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
77 cd-inverted;
78 status = "okay"; 102 status = "okay";
79}; 103};
80 104
diff --git a/arch/arm/boot/dts/sun4i-a10-mk802ii.dts b/arch/arm/boot/dts/sun4i-a10-mk802ii.dts
index e460da2eb139..17dcdf031118 100644
--- a/arch/arm/boot/dts/sun4i-a10-mk802ii.dts
+++ b/arch/arm/boot/dts/sun4i-a10-mk802ii.dts
@@ -82,8 +82,7 @@
82&mmc0 { 82&mmc0 {
83 vmmc-supply = <&reg_vcc3v3>; 83 vmmc-supply = <&reg_vcc3v3>;
84 bus-width = <4>; 84 bus-width = <4>;
85 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 85 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
86 cd-inverted;
87 status = "okay"; 86 status = "okay";
88}; 87};
89 88
diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
index 49247fbe6acd..b74a61496537 100644
--- a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
+++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
@@ -97,7 +97,6 @@
97 864000 1300000 97 864000 1300000
98 624000 1250000 98 624000 1250000
99 >; 99 >;
100 cooling-max-level = <2>;
101}; 100};
102 101
103&de { 102&de {
@@ -165,8 +164,7 @@
165&mmc0 { 164&mmc0 {
166 vmmc-supply = <&reg_vcc3v3>; 165 vmmc-supply = <&reg_vcc3v3>;
167 bus-width = <4>; 166 bus-width = <4>;
168 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 167 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
169 cd-inverted;
170 status = "okay"; 168 status = "okay";
171}; 169};
172 170
diff --git a/arch/arm/boot/dts/sun4i-a10-pcduino.dts b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
index 6e140547b638..b97a0f2f20b9 100644
--- a/arch/arm/boot/dts/sun4i-a10-pcduino.dts
+++ b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
@@ -140,8 +140,7 @@
140&mmc0 { 140&mmc0 {
141 vmmc-supply = <&reg_vcc3v3>; 141 vmmc-supply = <&reg_vcc3v3>;
142 bus-width = <4>; 142 bus-width = <4>;
143 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 143 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
144 cd-inverted;
145 status = "okay"; 144 status = "okay";
146}; 145};
147 146
diff --git a/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts b/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts
index 5081303f79e7..84b25be1ac94 100644
--- a/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts
+++ b/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts
@@ -138,8 +138,7 @@
138&mmc0 { 138&mmc0 {
139 vmmc-supply = <&reg_vcc3v3>; 139 vmmc-supply = <&reg_vcc3v3>;
140 bus-width = <4>; 140 bus-width = <4>;
141 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 141 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
142 cd-inverted;
143 status = "okay"; 142 status = "okay";
144}; 143};
145 144
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 4f2f2eea0755..77e8436beed4 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -123,8 +123,6 @@
123 624000 1250000 123 624000 1250000
124 >; 124 >;
125 #cooling-cells = <2>; 125 #cooling-cells = <2>;
126 cooling-min-level = <0>;
127 cooling-max-level = <3>;
128 }; 126 };
129 }; 127 };
130 128
diff --git a/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts b/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts
index d2dee8d434bf..39504d720efc 100644
--- a/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts
@@ -93,8 +93,7 @@
93 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t003>; 93 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t003>;
94 vmmc-supply = <&reg_vcc3v3>; 94 vmmc-supply = <&reg_vcc3v3>;
95 bus-width = <4>; 95 bus-width = <4>;
96 cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 96 cd-gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
97 cd-inverted;
98 status = "okay"; 97 status = "okay";
99}; 98};
100 99
diff --git a/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts b/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
index 16f839df4227..8d4fb9331212 100644
--- a/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
@@ -104,8 +104,7 @@
104 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>; 104 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>;
105 vmmc-supply = <&reg_vcc3v3>; 105 vmmc-supply = <&reg_vcc3v3>;
106 bus-width = <4>; 106 bus-width = <4>;
107 cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 107 cd-gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
108 cd-inverted;
109 status = "okay"; 108 status = "okay";
110}; 109};
111 110
diff --git a/arch/arm/boot/dts/sun5i-a10s-mk802.dts b/arch/arm/boot/dts/sun5i-a10s-mk802.dts
index 020aa9d6c31d..dd7fd5c3d76f 100644
--- a/arch/arm/boot/dts/sun5i-a10s-mk802.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-mk802.dts
@@ -92,8 +92,7 @@
92 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_mk802>; 92 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_mk802>;
93 vmmc-supply = <&reg_vcc3v3>; 93 vmmc-supply = <&reg_vcc3v3>;
94 bus-width = <4>; 94 bus-width = <4>;
95 cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 95 cd-gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
96 cd-inverted;
97 status = "okay"; 96 status = "okay";
98}; 97};
99 98
diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index da95118af4dc..2c902ed2c87a 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -201,8 +201,7 @@
201 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino_micro>; 201 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino_micro>;
202 vmmc-supply = <&reg_vcc3v3>; 202 vmmc-supply = <&reg_vcc3v3>;
203 bus-width = <4>; 203 bus-width = <4>;
204 cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 204 cd-gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
205 cd-inverted;
206 status = "okay"; 205 status = "okay";
207}; 206};
208 207
@@ -211,8 +210,7 @@
211 pinctrl-0 = <&mmc1_pins_a>, <&mmc1_cd_pin_olinuxino_micro>; 210 pinctrl-0 = <&mmc1_pins_a>, <&mmc1_cd_pin_olinuxino_micro>;
212 vmmc-supply = <&reg_vcc3v3>; 211 vmmc-supply = <&reg_vcc3v3>;
213 bus-width = <4>; 212 bus-width = <4>;
214 cd-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ 213 cd-gpios = <&pio 6 13 GPIO_ACTIVE_LOW>; /* PG13 */
215 cd-inverted;
216 status = "okay"; 214 status = "okay";
217}; 215};
218 216
diff --git a/arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts b/arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts
index 262b3669f04d..034853d1c08f 100644
--- a/arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts
@@ -80,8 +80,7 @@
80 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_r7>; 80 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_r7>;
81 vmmc-supply = <&reg_vcc3v3>; 81 vmmc-supply = <&reg_vcc3v3>;
82 bus-width = <4>; 82 bus-width = <4>;
83 cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 83 cd-gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
84 cd-inverted;
85 status = "okay"; 84 status = "okay";
86}; 85};
87 86
diff --git a/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts b/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts
index 5482be174e12..3f68ef5d92a0 100644
--- a/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts
@@ -130,8 +130,7 @@
130 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_wobo_i5>; 130 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_wobo_i5>;
131 vmmc-supply = <&reg_vcc3v3>; 131 vmmc-supply = <&reg_vcc3v3>;
132 bus-width = <4>; 132 bus-width = <4>;
133 cd-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ 133 cd-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 */
134 cd-inverted;
135 status = "okay"; 134 status = "okay";
136}; 135};
137 136
diff --git a/arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts b/arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts
index 3dbb0d7c2f8c..378214d8316e 100644
--- a/arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts
+++ b/arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dts
@@ -125,8 +125,7 @@
125 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>; 125 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>;
126 vmmc-supply = <&reg_vcc3v3>; 126 vmmc-supply = <&reg_vcc3v3>;
127 bus-width = <4>; 127 bus-width = <4>;
128 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 128 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
129 cd-inverted;
130 status = "okay"; 129 status = "okay";
131}; 130};
132 131
diff --git a/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts b/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts
index 584fa579ded2..7ee0c3f6d7a1 100644
--- a/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts
+++ b/arch/arm/boot/dts/sun5i-a13-hsg-h702.dts
@@ -120,8 +120,7 @@
120 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>; 120 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>;
121 vmmc-supply = <&reg_vcc3v3>; 121 vmmc-supply = <&reg_vcc3v3>;
122 bus-width = <4>; 122 bus-width = <4>;
123 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 123 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
124 cd-inverted;
125 status = "okay"; 124 status = "okay";
126}; 125};
127 126
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
index 3a831eaf1dfc..aa4b34fd9126 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
@@ -99,8 +99,7 @@
99 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>; 99 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>;
100 vmmc-supply = <&reg_vcc3v3>; 100 vmmc-supply = <&reg_vcc3v3>;
101 bus-width = <4>; 101 bus-width = <4>;
102 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 102 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
103 cd-inverted;
104 status = "okay"; 103 status = "okay";
105}; 104};
106 105
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
index 4b9af423c6d5..437ad913a373 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
@@ -194,8 +194,7 @@
194 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>; 194 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>;
195 vmmc-supply = <&reg_vcc3v3>; 195 vmmc-supply = <&reg_vcc3v3>;
196 bus-width = <4>; 196 bus-width = <4>;
197 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 197 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
198 cd-inverted;
199 status = "okay"; 198 status = "okay";
200}; 199};
201 200
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index 4e830f5cb7f1..b1d827765530 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -116,8 +116,6 @@
116 432000 1200000 116 432000 1200000
117 >; 117 >;
118 #cooling-cells = <2>; 118 #cooling-cells = <2>;
119 cooling-min-level = <0>;
120 cooling-max-level = <5>;
121}; 119};
122 120
123&pio { 121&pio {
diff --git a/arch/arm/boot/dts/sun5i-gr8-evb.dts b/arch/arm/boot/dts/sun5i-gr8-evb.dts
index 558c16a30543..5f0adc0f7bb4 100644
--- a/arch/arm/boot/dts/sun5i-gr8-evb.dts
+++ b/arch/arm/boot/dts/sun5i-gr8-evb.dts
@@ -236,8 +236,7 @@
236 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gr8_evb>; 236 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gr8_evb>;
237 vmmc-supply = <&reg_vcc3v3>; 237 vmmc-supply = <&reg_vcc3v3>;
238 bus-width = <4>; 238 bus-width = <4>;
239 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 239 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
240 cd-inverted;
241 status = "okay"; 240 status = "okay";
242}; 241};
243 242
diff --git a/arch/arm/boot/dts/sun5i-reference-design-tablet.dtsi b/arch/arm/boot/dts/sun5i-reference-design-tablet.dtsi
index 49229b3d5492..8acbaab14fe5 100644
--- a/arch/arm/boot/dts/sun5i-reference-design-tablet.dtsi
+++ b/arch/arm/boot/dts/sun5i-reference-design-tablet.dtsi
@@ -127,8 +127,7 @@
127 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; 127 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
128 vmmc-supply = <&reg_vcc3v0>; 128 vmmc-supply = <&reg_vcc3v0>;
129 bus-width = <4>; 129 bus-width = <4>;
130 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 130 cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
131 cd-inverted;
132 status = "okay"; 131 status = "okay";
133}; 132};
134 133
diff --git a/arch/arm/boot/dts/sun6i-a31-colombus.dts b/arch/arm/boot/dts/sun6i-a31-colombus.dts
index 85eff0307ca4..939c497a6f70 100644
--- a/arch/arm/boot/dts/sun6i-a31-colombus.dts
+++ b/arch/arm/boot/dts/sun6i-a31-colombus.dts
@@ -117,8 +117,7 @@
117 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_colombus>; 117 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_colombus>;
118 vmmc-supply = <&reg_vcc3v0>; 118 vmmc-supply = <&reg_vcc3v0>;
119 bus-width = <4>; 119 bus-width = <4>;
120 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ 120 cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
121 cd-inverted;
122 status = "okay"; 121 status = "okay";
123}; 122};
124 123
diff --git a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
index 19e382a11297..ce4f9e9834bf 100644
--- a/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
+++ b/arch/arm/boot/dts/sun6i-a31-hummingbird.dts
@@ -218,8 +218,7 @@
218 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; 218 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
219 vmmc-supply = <&reg_dcdc1>; 219 vmmc-supply = <&reg_dcdc1>;
220 bus-width = <4>; 220 bus-width = <4>;
221 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ 221 cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
222 cd-inverted;
223 status = "okay"; 222 status = "okay";
224}; 223};
225 224
diff --git a/arch/arm/boot/dts/sun6i-a31-i7.dts b/arch/arm/boot/dts/sun6i-a31-i7.dts
index 010a84c7c012..d659be9dbc50 100644
--- a/arch/arm/boot/dts/sun6i-a31-i7.dts
+++ b/arch/arm/boot/dts/sun6i-a31-i7.dts
@@ -58,6 +58,17 @@
58 stdout-path = "serial0:115200n8"; 58 stdout-path = "serial0:115200n8";
59 }; 59 };
60 60
61 hdmi-connector {
62 compatible = "hdmi-connector";
63 type = "a";
64
65 port {
66 hdmi_con_in: endpoint {
67 remote-endpoint = <&hdmi_out_con>;
68 };
69 };
70 };
71
61 leds { 72 leds {
62 compatible = "gpio-leds"; 73 compatible = "gpio-leds";
63 pinctrl-names = "default"; 74 pinctrl-names = "default";
@@ -93,6 +104,10 @@
93 status = "okay"; 104 status = "okay";
94}; 105};
95 106
107&de {
108 status = "okay";
109};
110
96&ehci0 { 111&ehci0 {
97 status = "okay"; 112 status = "okay";
98}; 113};
@@ -113,6 +128,16 @@
113 }; 128 };
114}; 129};
115 130
131&hdmi {
132 status = "okay";
133};
134
135&hdmi_out {
136 hdmi_out_con: endpoint {
137 remote-endpoint = <&hdmi_con_in>;
138 };
139};
140
116&ir { 141&ir {
117 pinctrl-names = "default"; 142 pinctrl-names = "default";
118 pinctrl-0 = <&ir_pins_a>; 143 pinctrl-0 = <&ir_pins_a>;
@@ -124,8 +149,7 @@
124 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_i7>; 149 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_i7>;
125 vmmc-supply = <&reg_vcc3v3>; 150 vmmc-supply = <&reg_vcc3v3>;
126 bus-width = <4>; 151 bus-width = <4>;
127 cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */ 152 cd-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
128 cd-inverted;
129 status = "okay"; 153 status = "okay";
130}; 154};
131 155
@@ -161,6 +185,10 @@
161 status = "okay"; 185 status = "okay";
162}; 186};
163 187
188&tcon0 {
189 status = "okay";
190};
191
164&uart0 { 192&uart0 {
165 pinctrl-names = "default"; 193 pinctrl-names = "default";
166 pinctrl-0 = <&uart0_pins_a>; 194 pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm/boot/dts/sun6i-a31-m9.dts b/arch/arm/boot/dts/sun6i-a31-m9.dts
index 50605fd4449e..9698f6d38d03 100644
--- a/arch/arm/boot/dts/sun6i-a31-m9.dts
+++ b/arch/arm/boot/dts/sun6i-a31-m9.dts
@@ -107,8 +107,7 @@
107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>; 107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
108 vmmc-supply = <&reg_dcdc1>; 108 vmmc-supply = <&reg_dcdc1>;
109 bus-width = <4>; 109 bus-width = <4>;
110 cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */ 110 cd-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
111 cd-inverted;
112 status = "okay"; 111 status = "okay";
113}; 112};
114 113
diff --git a/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts b/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts
index 5219556e9f73..bb14b171b160 100644
--- a/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts
+++ b/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts
@@ -107,8 +107,7 @@
107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>; 107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
108 vmmc-supply = <&reg_dcdc1>; 108 vmmc-supply = <&reg_dcdc1>;
109 bus-width = <4>; 109 bus-width = <4>;
110 cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */ 110 cd-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
111 cd-inverted;
112 status = "okay"; 111 status = "okay";
113}; 112};
114 113
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 72d3fe44ecaf..c72992556a86 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -113,8 +113,6 @@
113 480000 1000000 113 480000 1000000
114 >; 114 >;
115 #cooling-cells = <2>; 115 #cooling-cells = <2>;
116 cooling-min-level = <0>;
117 cooling-max-level = <3>;
118 }; 116 };
119 117
120 cpu@1 { 118 cpu@1 {
diff --git a/arch/arm/boot/dts/sun6i-a31s-primo81.dts b/arch/arm/boot/dts/sun6i-a31s-primo81.dts
index 0cdb38ab3377..4cb9664cdb29 100644
--- a/arch/arm/boot/dts/sun6i-a31s-primo81.dts
+++ b/arch/arm/boot/dts/sun6i-a31s-primo81.dts
@@ -151,8 +151,7 @@
151 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>; 151 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>;
152 vmmc-supply = <&reg_dcdc1>; 152 vmmc-supply = <&reg_dcdc1>;
153 bus-width = <4>; 153 bus-width = <4>;
154 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ 154 cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
155 cd-inverted;
156 status = "okay"; 155 status = "okay";
157}; 156};
158 157
diff --git a/arch/arm/boot/dts/sun6i-a31s-sina31s.dts b/arch/arm/boot/dts/sun6i-a31s-sina31s.dts
index 298476485bb4..da0ccf5a2c44 100644
--- a/arch/arm/boot/dts/sun6i-a31s-sina31s.dts
+++ b/arch/arm/boot/dts/sun6i-a31s-sina31s.dts
@@ -167,8 +167,7 @@
167 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>; 167 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>;
168 vmmc-supply = <&reg_dcdc1>; 168 vmmc-supply = <&reg_dcdc1>;
169 bus-width = <4>; 169 bus-width = <4>;
170 cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ 170 cd-gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
171 cd-inverted;
172 status = "okay"; 171 status = "okay";
173}; 172};
174 173
diff --git a/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts b/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts
index 51e6f1d21c32..3077e8ec9cd9 100644
--- a/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts
+++ b/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts
@@ -120,8 +120,7 @@
120 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m2>; 120 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m2>;
121 vmmc-supply = <&reg_vcc3v0>; 121 vmmc-supply = <&reg_vcc3v0>;
122 bus-width = <4>; 122 bus-width = <4>;
123 cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ 123 cd-gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
124 cd-inverted;
125 status = "okay"; 124 status = "okay";
126}; 125};
127 126
diff --git a/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts b/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
index f3edf9ca435c..aab6c1720ef7 100644
--- a/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
+++ b/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
@@ -102,8 +102,7 @@
102 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>; 102 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>;
103 vmmc-supply = <&reg_vcc3v0>; 103 vmmc-supply = <&reg_vcc3v0>;
104 bus-width = <4>; 104 bus-width = <4>;
105 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ 105 cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
106 cd-inverted;
107 status = "okay"; 106 status = "okay";
108}; 107};
109 108
diff --git a/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi b/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
index 3cc4046b904a..4e72e4f3ef96 100644
--- a/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
+++ b/arch/arm/boot/dts/sun6i-reference-design-tablet.dtsi
@@ -69,8 +69,7 @@
69 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_e708_q1>; 69 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_e708_q1>;
70 vmmc-supply = <&reg_dcdc1>; 70 vmmc-supply = <&reg_dcdc1>;
71 bus-width = <4>; 71 bus-width = <4>;
72 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ 72 cd-gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
73 cd-inverted;
74 status = "okay"; 73 status = "okay";
75}; 74};
76 75
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
index 4ed3162e3e5a..763cb03033c4 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
@@ -184,8 +184,7 @@
184 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m1p>; 184 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m1p>;
185 vmmc-supply = <&reg_vcc3v3>; 185 vmmc-supply = <&reg_vcc3v3>;
186 bus-width = <4>; 186 bus-width = <4>;
187 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 187 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
188 cd-inverted;
189 status = "okay"; 188 status = "okay";
190}; 189};
191 190
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
index 88a1c2363c6c..70dfc4ac0bb5 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
@@ -63,6 +63,17 @@
63 stdout-path = "serial0:115200n8"; 63 stdout-path = "serial0:115200n8";
64 }; 64 };
65 65
66 hdmi-connector {
67 compatible = "hdmi-connector";
68 type = "a";
69
70 port {
71 hdmi_con_in: endpoint {
72 remote-endpoint = <&hdmi_out_con>;
73 };
74 };
75 };
76
66 leds { 77 leds {
67 compatible = "gpio-leds"; 78 compatible = "gpio-leds";
68 pinctrl-names = "default"; 79 pinctrl-names = "default";
@@ -109,6 +120,10 @@
109 >; 120 >;
110}; 121};
111 122
123&de {
124 status = "okay";
125};
126
112&ehci0 { 127&ehci0 {
113 status = "okay"; 128 status = "okay";
114}; 129};
@@ -130,6 +145,16 @@
130 }; 145 };
131}; 146};
132 147
148&hdmi {
149 status = "okay";
150};
151
152&hdmi_out {
153 hdmi_out_con: endpoint {
154 remote-endpoint = <&hdmi_con_in>;
155 };
156};
157
133&i2c0 { 158&i2c0 {
134 pinctrl-names = "default"; 159 pinctrl-names = "default";
135 pinctrl-0 = <&i2c0_pins_a>; 160 pinctrl-0 = <&i2c0_pins_a>;
@@ -159,8 +184,7 @@
159 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>; 184 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
160 vmmc-supply = <&reg_vcc3v3>; 185 vmmc-supply = <&reg_vcc3v3>;
161 bus-width = <4>; 186 bus-width = <4>;
162 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 187 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
163 cd-inverted;
164 status = "okay"; 188 status = "okay";
165}; 189};
166 190
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index e7af1b7c33d5..0898eb6162f5 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -158,8 +158,7 @@
158 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapro>; 158 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapro>;
159 vmmc-supply = <&reg_vcc3v3>; 159 vmmc-supply = <&reg_vcc3v3>;
160 bus-width = <4>; 160 bus-width = <4>;
161 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 161 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
162 cd-inverted;
163 status = "okay"; 162 status = "okay";
164}; 163};
165 164
diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
index 39f43e4eb742..942ac9dfd4a5 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
@@ -165,8 +165,7 @@
165 pinctrl-0 = <&mmc0_pins_a>; 165 pinctrl-0 = <&mmc0_pins_a>;
166 vmmc-supply = <&reg_vcc3v3>; 166 vmmc-supply = <&reg_vcc3v3>;
167 bus-width = <4>; 167 bus-width = <4>;
168 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 168 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
169 cd-inverted;
170 status = "okay"; 169 status = "okay";
171}; 170};
172 171
diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
index 8c9bedc602ec..5649161de1d7 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -206,8 +206,7 @@
206 pinctrl-0 = <&mmc0_pins_a>; 206 pinctrl-0 = <&mmc0_pins_a>;
207 vmmc-supply = <&reg_vcc3v3>; 207 vmmc-supply = <&reg_vcc3v3>;
208 bus-width = <4>; 208 bus-width = <4>;
209 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 209 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
210 cd-inverted;
211 status = "okay"; 210 status = "okay";
212}; 211};
213 212
diff --git a/arch/arm/boot/dts/sun7i-a20-hummingbird.dts b/arch/arm/boot/dts/sun7i-a20-hummingbird.dts
index 6e6264cd69f8..1f0e5ecbf0c4 100644
--- a/arch/arm/boot/dts/sun7i-a20-hummingbird.dts
+++ b/arch/arm/boot/dts/sun7i-a20-hummingbird.dts
@@ -163,8 +163,7 @@
163 pinctrl-0 = <&mmc0_pins_a>; 163 pinctrl-0 = <&mmc0_pins_a>;
164 vmmc-supply = <&reg_vcc3v0>; 164 vmmc-supply = <&reg_vcc3v0>;
165 bus-width = <4>; 165 bus-width = <4>;
166 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 166 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
167 cd-inverted;
168 status = "okay"; 167 status = "okay";
169}; 168};
170 169
diff --git a/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts b/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
index 55809973a568..2e3f2f29d124 100644
--- a/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
+++ b/arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
@@ -160,8 +160,7 @@
160 pinctrl-0 = <&mmc0_pins_a>; 160 pinctrl-0 = <&mmc0_pins_a>;
161 vmmc-supply = <&reg_vcc3v3>; 161 vmmc-supply = <&reg_vcc3v3>;
162 bus-width = <4>; 162 bus-width = <4>;
163 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 163 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
164 cd-inverted;
165 status = "okay"; 164 status = "okay";
166}; 165};
167 166
diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-swac.dts b/arch/arm/boot/dts/sun7i-a20-icnova-swac.dts
index 794e7617f545..926fa194eb1b 100644
--- a/arch/arm/boot/dts/sun7i-a20-icnova-swac.dts
+++ b/arch/arm/boot/dts/sun7i-a20-icnova-swac.dts
@@ -107,8 +107,7 @@
107 pinctrl-0 = <&mmc0_pins_a>; 107 pinctrl-0 = <&mmc0_pins_a>;
108 vmmc-supply = <&reg_vcc3v3>; 108 vmmc-supply = <&reg_vcc3v3>;
109 bus-width = <4>; 109 bus-width = <4>;
110 cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */ 110 cd-gpios = <&pio 8 5 GPIO_ACTIVE_LOW>; /* PI5 */
111 cd-inverted;
112 status = "okay"; 111 status = "okay";
113}; 112};
114 113
diff --git a/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts b/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts
index 8a8a6dbcd414..1b05ba466e7d 100644
--- a/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts
+++ b/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts
@@ -124,8 +124,7 @@
124 pinctrl-0 = <&mmc0_pins_a>; 124 pinctrl-0 = <&mmc0_pins_a>;
125 vmmc-supply = <&reg_vcc3v3>; 125 vmmc-supply = <&reg_vcc3v3>;
126 bus-width = <4>; 126 bus-width = <4>;
127 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 127 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
128 cd-inverted;
129 status = "okay"; 128 status = "okay";
130}; 129};
131 130
diff --git a/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
index 442f3c755f36..b1ab7c1c33e3 100644
--- a/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
+++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
@@ -227,8 +227,7 @@
227 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>; 227 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
228 vmmc-supply = <&reg_vcc3v3>; 228 vmmc-supply = <&reg_vcc3v3>;
229 bus-width = <4>; 229 bus-width = <4>;
230 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 230 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
231 cd-inverted;
232 status = "okay"; 231 status = "okay";
233}; 232};
234 233
diff --git a/arch/arm/boot/dts/sun7i-a20-m3.dts b/arch/arm/boot/dts/sun7i-a20-m3.dts
index 43c94787ef07..e91a209850bc 100644
--- a/arch/arm/boot/dts/sun7i-a20-m3.dts
+++ b/arch/arm/boot/dts/sun7i-a20-m3.dts
@@ -120,8 +120,7 @@
120 pinctrl-0 = <&mmc0_pins_a>; 120 pinctrl-0 = <&mmc0_pins_a>;
121 vmmc-supply = <&reg_vcc3v3>; 121 vmmc-supply = <&reg_vcc3v3>;
122 bus-width = <4>; 122 bus-width = <4>;
123 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 123 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
124 cd-inverted;
125 status = "okay"; 124 status = "okay";
126}; 125};
127 126
diff --git a/arch/arm/boot/dts/sun7i-a20-mk808c.dts b/arch/arm/boot/dts/sun7i-a20-mk808c.dts
index f7413094183c..6109f794a9c1 100644
--- a/arch/arm/boot/dts/sun7i-a20-mk808c.dts
+++ b/arch/arm/boot/dts/sun7i-a20-mk808c.dts
@@ -66,12 +66,27 @@
66 chosen { 66 chosen {
67 stdout-path = "serial0:115200n8"; 67 stdout-path = "serial0:115200n8";
68 }; 68 };
69
70 hdmi-connector {
71 compatible = "hdmi-connector";
72 type = "a";
73
74 port {
75 hdmi_con_in: endpoint {
76 remote-endpoint = <&hdmi_out_con>;
77 };
78 };
79 };
69}; 80};
70 81
71&codec { 82&codec {
72 status = "okay"; 83 status = "okay";
73}; 84};
74 85
86&de {
87 status = "okay";
88};
89
75&ehci0 { 90&ehci0 {
76 status = "okay"; 91 status = "okay";
77}; 92};
@@ -80,6 +95,16 @@
80 status = "okay"; 95 status = "okay";
81}; 96};
82 97
98&hdmi {
99 status = "okay";
100};
101
102&hdmi_out {
103 hdmi_out_con: endpoint {
104 remote-endpoint = <&hdmi_con_in>;
105 };
106};
107
83&i2c0 { 108&i2c0 {
84 pinctrl-names = "default"; 109 pinctrl-names = "default";
85 pinctrl-0 = <&i2c0_pins_a>; 110 pinctrl-0 = <&i2c0_pins_a>;
@@ -112,8 +137,7 @@
112 pinctrl-0 = <&mmc0_pins_a>; 137 pinctrl-0 = <&mmc0_pins_a>;
113 vmmc-supply = <&reg_vcc3v0>; 138 vmmc-supply = <&reg_vcc3v0>;
114 bus-width = <4>; 139 bus-width = <4>;
115 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 140 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
116 cd-inverted;
117 status = "okay"; 141 status = "okay";
118}; 142};
119 143
diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
index 64c8ef9a2756..f080f82b58ef 100644
--- a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
@@ -61,6 +61,17 @@
61 stdout-path = "serial0:115200n8"; 61 stdout-path = "serial0:115200n8";
62 }; 62 };
63 63
64 hdmi-connector {
65 compatible = "hdmi-connector";
66 type = "a";
67
68 port {
69 hdmi_con_in: endpoint {
70 remote-endpoint = <&hdmi_out_con>;
71 };
72 };
73 };
74
64 leds { 75 leds {
65 compatible = "gpio-leds"; 76 compatible = "gpio-leds";
66 pinctrl-names = "default"; 77 pinctrl-names = "default";
@@ -79,6 +90,10 @@
79 status = "okay"; 90 status = "okay";
80}; 91};
81 92
93&de {
94 status = "okay";
95};
96
82&ehci0 { 97&ehci0 {
83 status = "okay"; 98 status = "okay";
84}; 99};
@@ -107,6 +122,16 @@
107 }; 122 };
108}; 123};
109 124
125&hdmi {
126 status = "okay";
127};
128
129&hdmi_out {
130 hdmi_out_con: endpoint {
131 remote-endpoint = <&hdmi_con_in>;
132 };
133};
134
110&i2c0 { 135&i2c0 {
111 pinctrl-names = "default"; 136 pinctrl-names = "default";
112 pinctrl-0 = <&i2c0_pins_a>; 137 pinctrl-0 = <&i2c0_pins_a>;
@@ -190,8 +215,7 @@
190 pinctrl-0 = <&mmc0_pins_a>; 215 pinctrl-0 = <&mmc0_pins_a>;
191 vmmc-supply = <&reg_vcc3v3>; 216 vmmc-supply = <&reg_vcc3v3>;
192 bus-width = <4>; 217 bus-width = <4>;
193 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 218 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
194 cd-inverted;
195 status = "okay"; 219 status = "okay";
196}; 220};
197 221
@@ -200,8 +224,7 @@
200 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>; 224 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
201 vmmc-supply = <&reg_vcc3v3>; 225 vmmc-supply = <&reg_vcc3v3>;
202 bus-width = <4>; 226 bus-width = <4>;
203 cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ 227 cd-gpios = <&pio 7 0 GPIO_ACTIVE_LOW>; /* PH0 */
204 cd-inverted;
205 status = "okay"; 228 status = "okay";
206}; 229};
207 230
diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb-emmc.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb-emmc.dts
new file mode 100644
index 000000000000..c56620a8fb20
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb-emmc.dts
@@ -0,0 +1,36 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Device Tree Source for A20-SOM204-EVB-eMMC Board
4 *
5 * Copyright (C) 2018 Olimex Ltd.
6 * Author: Stefan Mavrodiev <stefan@olimex.com>
7 */
8
9/dts-v1/;
10#include "sun7i-a20-olimex-som204-evb.dts"
11
12/ {
13 model = "Olimex A20-SOM204-EVB-eMMC";
14 compatible = "olimex,a20-olimex-som204-evb-emmc", "allwinner,sun7i-a20";
15
16 mmc2_pwrseq: mmc2_pwrseq {
17 compatible = "mmc-pwrseq-emmc";
18 reset-gpios = <&pio 2 16 GPIO_ACTIVE_LOW>;
19 };
20};
21
22&mmc2 {
23 pinctrl-names = "default";
24 pinctrl-0 = <&mmc2_pins_a>;
25 vmmc-supply = <&reg_vcc3v3>;
26 mmc-pwrseq = <&mmc2_pwrseq>;
27 bus-width = <4>;
28 non-removable;
29 status = "okay";
30
31 emmc: emmc@0 {
32 reg = <0>;
33 compatible = "mmc-card";
34 broken-hpi;
35 };
36};
diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb.dts
new file mode 100644
index 000000000000..eae8e267b9ef
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-olimex-som204-evb.dts
@@ -0,0 +1,335 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Device Tree Source for A20-SOM204-EVB Board
4 *
5 * Copyright (C) 2018 Olimex Ltd.
6 * Author: Stefan Mavrodiev <stefan@olimex.com>
7 */
8
9/dts-v1/;
10#include "sun7i-a20.dtsi"
11#include "sunxi-common-regulators.dtsi"
12
13
14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/interrupt-controller/irq.h>
16#include <dt-bindings/pwm/pwm.h>
17
18/ {
19 model = "Olimex A20-SOM204-EVB";
20 compatible = "olimex,a20-olimex-som204-evb", "allwinner,sun7i-a20";
21
22 aliases {
23 serial0 = &uart0;
24 serial1 = &uart4;
25 serial2 = &uart7;
26 spi0 = &spi1;
27 spi1 = &spi2;
28 ethernet1 = &rtl8723bs;
29 };
30
31 chosen {
32 stdout-path = "serial0:115200n8";
33 };
34
35 hdmi-connector {
36 compatible = "hdmi-connector";
37 type = "a";
38
39 port {
40 hdmi_con_in: endpoint {
41 remote-endpoint = <&hdmi_out_con>;
42 };
43 };
44 };
45
46 leds {
47 compatible = "gpio-leds";
48
49 stat {
50 label = "a20-som204-evb:green:stat";
51 gpios = <&pio 8 0 GPIO_ACTIVE_HIGH>;
52 default-state = "on";
53 };
54
55 led1 {
56 label = "a20-som204-evb:green:led1";
57 gpios = <&pio 8 10 GPIO_ACTIVE_HIGH>;
58 default-state = "on";
59 };
60
61 led2 {
62 label = "a20-som204-evb:yellow:led2";
63 gpios = <&pio 8 11 GPIO_ACTIVE_HIGH>;
64 default-state = "on";
65 };
66 };
67
68 rtl_pwrseq: rtl_pwrseq {
69 compatible = "mmc-pwrseq-simple";
70 reset-gpios = <&pio 6 9 GPIO_ACTIVE_LOW>;
71 };
72};
73
74&ahci {
75 target-supply = <&reg_ahci_5v>;
76 status = "okay";
77};
78
79&can0 {
80 pinctrl-names = "default";
81 pinctrl-0 = <&can0_pins_a>;
82 status = "okay";
83};
84
85&codec {
86 status = "okay";
87};
88
89&cpu0 {
90 cpu-supply = <&reg_dcdc2>;
91};
92
93&de {
94 status = "okay";
95};
96
97&ehci0 {
98 status = "okay";
99};
100
101&ehci1 {
102 status = "okay";
103};
104
105&gmac {
106 pinctrl-names = "default";
107 pinctrl-0 = <&gmac_pins_rgmii_a>;
108 phy = <&phy3>;
109 phy-mode = "rgmii";
110 phy-supply = <&reg_vcc3v3>;
111
112 snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>;
113 snps,reset-active-low;
114 snps,reset-delays-us = <0 10000 1000000>;
115 status = "okay";
116
117 phy3: ethernet-phy@3 {
118 reg = <3>;
119 };
120};
121
122&hdmi {
123 status = "okay";
124};
125
126&hdmi_out {
127 hdmi_out_con: endpoint {
128 remote-endpoint = <&hdmi_con_in>;
129 };
130};
131
132&i2c0 {
133 pinctrl-names = "default";
134 pinctrl-0 = <&i2c0_pins_a>;
135 status = "okay";
136
137 axp209: pmic@34 {
138 reg = <0x34>;
139 interrupt-parent = <&nmi_intc>;
140 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
141 };
142};
143
144/* Exposed to UEXT1 */
145&i2c1 {
146 pinctrl-names = "default";
147 pinctrl-0 = <&i2c1_pins_a>;
148 status = "okay";
149
150 eeprom: eeprom@50 {
151 compatible = "atmel,24c16";
152 reg = <0x50>;
153 pagesize = <16>;
154 };
155};
156
157/* Exposed to UEXT2 */
158&i2c2 {
159 pinctrl-names = "default";
160 pinctrl-0 = <&i2c2_pins_a>;
161 status = "okay";
162};
163
164&ir0 {
165 pinctrl-names = "default";
166 pinctrl-0 = <&ir0_rx_pins_a>;
167 status = "okay";
168};
169
170&mmc0 {
171 pinctrl-names = "default";
172 pinctrl-0 = <&mmc0_pins_a>;
173 vmmc-supply = <&reg_vcc3v3>;
174 bus-width = <4>;
175 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
176 cd-inverted;
177 status = "okay";
178};
179
180&mmc3 {
181 pinctrl-names = "default";
182 pinctrl-0 = <&mmc3_pins_a>;
183 vmmc-supply = <&reg_vcc3v3>;
184 mmc-pwrseq = <&rtl_pwrseq>;
185 bus-width = <4>;
186 non-removable;
187 status = "okay";
188
189 rtl8723bs: sdio_wifi@1 {
190 reg = <1>;
191 };
192};
193
194&ohci0 {
195 status = "okay";
196};
197
198&ohci1 {
199 status = "okay";
200};
201
202&otg_sram {
203 status = "okay";
204};
205
206&pio {
207 bt_uart_pins: bt_uart_pins@0 {
208 pins = "PG6", "PG7", "PG8";
209 function = "uart3";
210 };
211};
212
213#include "axp209.dtsi"
214
215&ac_power_supply {
216 status = "okay";
217};
218
219&battery_power_supply {
220 status = "okay";
221};
222
223&reg_ahci_5v {
224 gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
225 status = "okay";
226};
227
228&reg_dcdc2 {
229 regulator-always-on;
230 regulator-min-microvolt = <1000000>;
231 regulator-max-microvolt = <1400000>;
232 regulator-name = "vdd-cpu";
233};
234
235&reg_dcdc3 {
236 regulator-always-on;
237 regulator-min-microvolt = <1000000>;
238 regulator-max-microvolt = <1400000>;
239 regulator-name = "vdd-int-dll";
240};
241
242&reg_ldo1 {
243 regulator-always-on;
244 regulator-min-microvolt = <1300000>;
245 regulator-max-microvolt = <1300000>;
246 regulator-name = "vdd-rtc";
247};
248
249&reg_ldo2 {
250 regulator-always-on;
251 regulator-min-microvolt = <3000000>;
252 regulator-max-microvolt = <3000000>;
253 regulator-name = "avcc";
254};
255
256&reg_ldo4 {
257 regulator-min-microvolt = <3300000>;
258 regulator-max-microvolt = <3300000>;
259 regulator-name = "vcc-pg";
260};
261
262&reg_usb0_vbus {
263 gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
264 status = "okay";
265};
266
267&reg_usb1_vbus {
268 status = "okay";
269};
270
271&reg_usb2_vbus {
272 status = "okay";
273};
274
275/* Exposed to UEXT1 */
276&spi1 {
277 pinctrl-names = "default";
278 pinctrl-0 = <&spi1_pins_a>,
279 <&spi1_cs0_pins_a>;
280 status = "okay";
281};
282
283/* Exposed to UEXT2 */
284&spi2 {
285 pinctrl-names = "default";
286 pinctrl-0 = <&spi2_pins_a>,
287 <&spi2_cs0_pins_a>;
288 status = "okay";
289};
290
291&uart0 {
292 pinctrl-names = "default";
293 pinctrl-0 = <&uart0_pins_a>;
294 status = "okay";
295};
296
297/* Used for RTL8723BS bluetooth */
298&uart3 {
299 pinctrl-names = "default";
300 pinctrl-0 = <&bt_uart_pins>;
301 status = "okay";
302};
303
304/* Exposed to UEXT1 */
305&uart4 {
306 pinctrl-names = "default";
307 pinctrl-0 = <&uart4_pins_a>;
308 status = "okay";
309};
310
311/* Exposed to UEXT2 */
312&uart7 {
313 pinctrl-names = "default";
314 pinctrl-0 = <&uart7_pins_a>;
315 status = "okay";
316};
317
318&usb_otg {
319 dr_mode = "otg";
320 status = "okay";
321};
322
323&usb_power_supply {
324 status = "okay";
325};
326
327&usbphy {
328 usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
329 usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
330 usb0_vbus_power-supply = <&usb_power_supply>;
331 usb0_vbus-supply = <&reg_usb0_vbus>;
332 usb1_vbus-supply = <&reg_usb1_vbus>;
333 usb2_vbus-supply = <&reg_usb2_vbus>;
334 status = "okay";
335};
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
index edf9c3c6c0d7..d20fd03596e9 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
@@ -158,8 +158,7 @@
158 pinctrl-0 = <&mmc0_pins_a>; 158 pinctrl-0 = <&mmc0_pins_a>;
159 vmmc-supply = <&reg_vcc3v3>; 159 vmmc-supply = <&reg_vcc3v3>;
160 bus-width = <4>; 160 bus-width = <4>;
161 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 161 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
162 cd-inverted;
163 status = "okay"; 162 status = "okay";
164}; 163};
165 164
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
index ba250189d07f..b828677f331d 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
@@ -159,8 +159,7 @@
159 pinctrl-0 = <&mmc0_pins_a>; 159 pinctrl-0 = <&mmc0_pins_a>;
160 vmmc-supply = <&reg_vcc3v3>; 160 vmmc-supply = <&reg_vcc3v3>;
161 bus-width = <4>; 161 bus-width = <4>;
162 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 162 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
163 cd-inverted;
164 status = "okay"; 163 status = "okay";
165}; 164};
166 165
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
index dffbaa24b3ee..866d230593be 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
@@ -226,8 +226,7 @@
226 pinctrl-0 = <&mmc0_pins_a>; 226 pinctrl-0 = <&mmc0_pins_a>;
227 vmmc-supply = <&reg_vcc3v3>; 227 vmmc-supply = <&reg_vcc3v3>;
228 bus-width = <4>; 228 bus-width = <4>;
229 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 229 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
230 cd-inverted;
231 status = "okay"; 230 status = "okay";
232}; 231};
233 232
@@ -236,8 +235,7 @@
236 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olinuxinom>; 235 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olinuxinom>;
237 vmmc-supply = <&reg_vcc3v3>; 236 vmmc-supply = <&reg_vcc3v3>;
238 bus-width = <4>; 237 bus-width = <4>;
239 cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ 238 cd-gpios = <&pio 7 11 GPIO_ACTIVE_LOW>; /* PH11 */
240 cd-inverted;
241 status = "okay"; 239 status = "okay";
242}; 240};
243 241
diff --git a/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts b/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
index 7af4c8fc1865..f5c7178eb063 100644
--- a/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
+++ b/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
@@ -61,6 +61,17 @@
61 stdout-path = "serial0:115200n8"; 61 stdout-path = "serial0:115200n8";
62 }; 62 };
63 63
64 hdmi-connector {
65 compatible = "hdmi-connector";
66 type = "a";
67
68 port {
69 hdmi_con_in: endpoint {
70 remote-endpoint = <&hdmi_out_con>;
71 };
72 };
73 };
74
64 leds { 75 leds {
65 compatible = "gpio-leds"; 76 compatible = "gpio-leds";
66 pinctrl-names = "default"; 77 pinctrl-names = "default";
@@ -98,6 +109,10 @@
98 status = "okay"; 109 status = "okay";
99}; 110};
100 111
112&de {
113 status = "okay";
114};
115
101&ehci0 { 116&ehci0 {
102 status = "okay"; 117 status = "okay";
103}; 118};
@@ -119,6 +134,16 @@
119 }; 134 };
120}; 135};
121 136
137&hdmi {
138 status = "okay";
139};
140
141&hdmi_out {
142 hdmi_out_con: endpoint {
143 remote-endpoint = <&hdmi_con_in>;
144 };
145};
146
122&i2c0 { 147&i2c0 {
123 pinctrl-names = "default"; 148 pinctrl-names = "default";
124 pinctrl-0 = <&i2c0_pins_a>; 149 pinctrl-0 = <&i2c0_pins_a>;
@@ -144,8 +169,7 @@
144 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>; 169 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>;
145 vmmc-supply = <&reg_vcc3v3>; 170 vmmc-supply = <&reg_vcc3v3>;
146 bus-width = <4>; 171 bus-width = <4>;
147 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 172 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
148 cd-inverted;
149 status = "okay"; 173 status = "okay";
150}; 174};
151 175
@@ -154,8 +178,7 @@
154 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_orangepi>; 178 pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_orangepi>;
155 vmmc-supply = <&reg_vcc3v3>; 179 vmmc-supply = <&reg_vcc3v3>;
156 bus-width = <4>; 180 bus-width = <4>;
157 cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ 181 cd-gpios = <&pio 7 11 GPIO_ACTIVE_LOW>; /* PH11 */
158 cd-inverted;
159 status = "okay"; 182 status = "okay";
160}; 183};
161 184
diff --git a/arch/arm/boot/dts/sun7i-a20-orangepi.dts b/arch/arm/boot/dts/sun7i-a20-orangepi.dts
index 0a8d4a05e8a0..7a4244e57589 100644
--- a/arch/arm/boot/dts/sun7i-a20-orangepi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-orangepi.dts
@@ -135,8 +135,7 @@
135 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>; 135 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>;
136 vmmc-supply = <&reg_vcc3v3>; 136 vmmc-supply = <&reg_vcc3v3>;
137 bus-width = <4>; 137 bus-width = <4>;
138 cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ 138 cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
139 cd-inverted;
140 status = "okay"; 139 status = "okay";
141}; 140};
142 141
diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
index fb591f32252c..bfca960b03e0 100644
--- a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
@@ -158,8 +158,7 @@
158 pinctrl-0 = <&mmc0_pins_a>; 158 pinctrl-0 = <&mmc0_pins_a>;
159 vmmc-supply = <&reg_vcc3v3>; 159 vmmc-supply = <&reg_vcc3v3>;
160 bus-width = <4>; 160 bus-width = <4>;
161 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 161 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
162 cd-inverted;
163 status = "okay"; 162 status = "okay";
164}; 163};
165 164
diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
index 777152a3df0f..c576f101fbde 100644
--- a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts
@@ -159,8 +159,7 @@
159 pinctrl-0 = <&mmc0_pins_a>; 159 pinctrl-0 = <&mmc0_pins_a>;
160 vmmc-supply = <&reg_vcc3v3>; 160 vmmc-supply = <&reg_vcc3v3>;
161 bus-width = <4>; 161 bus-width = <4>;
162 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 162 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
163 cd-inverted;
164 status = "okay"; 163 status = "okay";
165}; 164};
166 165
diff --git a/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts b/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts
index f8d0aafb9f88..8202c87ca6a3 100644
--- a/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts
+++ b/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts
@@ -154,8 +154,7 @@
154 pinctrl-0 = <&mmc0_pins_a>; 154 pinctrl-0 = <&mmc0_pins_a>;
155 vmmc-supply = <&reg_vcc3v3>; 155 vmmc-supply = <&reg_vcc3v3>;
156 bus-width = <4>; 156 bus-width = <4>;
157 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 157 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
158 cd-inverted;
159 status = "okay"; 158 status = "okay";
160}; 159};
161 160
diff --git a/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts b/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts
index 7f8405a0dd0f..ff5c1086585c 100644
--- a/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts
+++ b/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts
@@ -123,8 +123,7 @@
123 pinctrl-0 = <&mmc0_pins_a>; 123 pinctrl-0 = <&mmc0_pins_a>;
124 vmmc-supply = <&reg_vcc3v3>; 124 vmmc-supply = <&reg_vcc3v3>;
125 bus-width = <4>; 125 bus-width = <4>;
126 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 126 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
127 cd-inverted;
128 status = "okay"; 127 status = "okay";
129}; 128};
130 129
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index bd0cd3204273..e529e4ff2174 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -47,7 +47,7 @@
47#include <dt-bindings/interrupt-controller/arm-gic.h> 47#include <dt-bindings/interrupt-controller/arm-gic.h>
48#include <dt-bindings/thermal/thermal.h> 48#include <dt-bindings/thermal/thermal.h>
49#include <dt-bindings/dma/sun4i-a10.h> 49#include <dt-bindings/dma/sun4i-a10.h>
50#include <dt-bindings/clock/sun4i-a10-ccu.h> 50#include <dt-bindings/clock/sun7i-a20-ccu.h>
51#include <dt-bindings/reset/sun4i-a10-ccu.h> 51#include <dt-bindings/reset/sun4i-a10-ccu.h>
52 52
53/ { 53/ {
@@ -116,8 +116,6 @@
116 144000 1000000 116 144000 1000000
117 >; 117 >;
118 #cooling-cells = <2>; 118 #cooling-cells = <2>;
119 cooling-min-level = <0>;
120 cooling-max-level = <6>;
121 }; 119 };
122 120
123 cpu@1 { 121 cpu@1 {
@@ -1217,6 +1215,31 @@
1217 #size-cells = <0>; 1215 #size-cells = <0>;
1218 }; 1216 };
1219 1217
1218 mali: gpu@1c40000 {
1219 compatible = "allwinner,sun7i-a20-mali", "arm,mali-400";
1220 reg = <0x01c40000 0x10000>;
1221 interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
1222 <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
1223 <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
1224 <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
1225 <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
1226 <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
1227 <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
1228 interrupt-names = "gp",
1229 "gpmmu",
1230 "pp0",
1231 "ppmmu0",
1232 "pp1",
1233 "ppmmu1",
1234 "pmu";
1235 clocks = <&ccu CLK_AHB_GPU>, <&ccu CLK_GPU>;
1236 clock-names = "bus", "core";
1237 resets = <&ccu RST_GPU>;
1238
1239 assigned-clocks = <&ccu CLK_GPU>;
1240 assigned-clock-rates = <384000000>;
1241 };
1242
1220 gmac: ethernet@1c50000 { 1243 gmac: ethernet@1c50000 {
1221 compatible = "allwinner,sun7i-a20-gmac"; 1244 compatible = "allwinner,sun7i-a20-gmac";
1222 reg = <0x01c50000 0x10000>; 1245 reg = <0x01c50000 0x10000>;
diff --git a/arch/arm/boot/dts/sun8i-a23-evb.dts b/arch/arm/boot/dts/sun8i-a23-evb.dts
index 87289a60c520..8a93697df3a5 100644
--- a/arch/arm/boot/dts/sun8i-a23-evb.dts
+++ b/arch/arm/boot/dts/sun8i-a23-evb.dts
@@ -107,8 +107,7 @@
107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_evb>; 107 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_evb>;
108 vmmc-supply = <&reg_vcc3v0>; 108 vmmc-supply = <&reg_vcc3v0>;
109 bus-width = <4>; 109 bus-width = <4>;
110 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 110 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
111 cd-inverted;
112 status = "okay"; 111 status = "okay";
113}; 112};
114 113
diff --git a/arch/arm/boot/dts/sun8i-a33-olinuxino.dts b/arch/arm/boot/dts/sun8i-a33-olinuxino.dts
index be9a6b8d7a1e..a1a1eb64caeb 100644
--- a/arch/arm/boot/dts/sun8i-a33-olinuxino.dts
+++ b/arch/arm/boot/dts/sun8i-a33-olinuxino.dts
@@ -43,7 +43,6 @@
43 43
44/dts-v1/; 44/dts-v1/;
45#include "sun8i-a33.dtsi" 45#include "sun8i-a33.dtsi"
46#include "sunxi-common-regulators.dtsi"
47 46
48#include <dt-bindings/gpio/gpio.h> 47#include <dt-bindings/gpio/gpio.h>
49#include <dt-bindings/input/input.h> 48#include <dt-bindings/input/input.h>
@@ -62,8 +61,6 @@
62 61
63 leds { 62 leds {
64 compatible = "gpio-leds"; 63 compatible = "gpio-leds";
65 pinctrl-names = "default";
66 pinctrl-0 = <&led_pin_olinuxino>;
67 64
68 green { 65 green {
69 label = "a33-olinuxino:green:usr"; 66 label = "a33-olinuxino:green:usr";
@@ -72,17 +69,24 @@
72 }; 69 };
73}; 70};
74 71
72&codec {
73 status = "okay";
74};
75
76&dai {
77 status = "okay";
78};
79
75&ehci0 { 80&ehci0 {
76 status = "okay"; 81 status = "okay";
77}; 82};
78 83
79&mmc0 { 84&mmc0 {
80 pinctrl-names = "default"; 85 pinctrl-names = "default";
81 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>; 86 pinctrl-0 = <&mmc0_pins_a>;
82 vmmc-supply = <&reg_dcdc1>; 87 vmmc-supply = <&reg_dcdc1>;
83 bus-width = <4>; 88 bus-width = <4>;
84 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 89 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
85 cd-inverted;
86 status = "okay"; 90 status = "okay";
87}; 91};
88 92
@@ -90,23 +94,6 @@
90 status = "okay"; 94 status = "okay";
91}; 95};
92 96
93&pio {
94 led_pin_olinuxino: led_pins@0 {
95 pins = "PB7";
96 function = "gpio_out";
97 };
98
99 mmc0_cd_pin_olinuxino: mmc0_cd_pin@0 {
100 pins = "PB4";
101 function = "gpio_in";
102 };
103
104 usb0_id_detect_pin: usb0_id_detect_pin@0 {
105 pins = "PB3";
106 function = "gpio_in";
107 };
108};
109
110&r_rsb { 97&r_rsb {
111 status = "okay"; 98 status = "okay";
112 99
@@ -122,6 +109,14 @@
122 109
123#include "axp223.dtsi" 110#include "axp223.dtsi"
124 111
112&ac_power_supply {
113 status = "okay";
114};
115
116&battery_power_supply {
117 status = "okay";
118};
119
125&reg_aldo1 { 120&reg_aldo1 {
126 regulator-always-on; 121 regulator-always-on;
127 regulator-min-microvolt = <3300000>; 122 regulator-min-microvolt = <3300000>;
@@ -195,6 +190,21 @@
195 vcc-lcd-supply = <&reg_dc1sw>; 190 vcc-lcd-supply = <&reg_dc1sw>;
196}; 191};
197 192
193&sound {
194 /* Board level jack widgets */
195 simple-audio-card,widgets = "Microphone", "Microphone Jack",
196 "Headphone", "Headphone Jack";
197 /* Board level routing. First 2 routes copied from SoC level */
198 simple-audio-card,routing =
199 "Left DAC", "AIF1 Slot 0 Left",
200 "Right DAC", "AIF1 Slot 0 Right",
201 "HP", "HPCOM",
202 "Headphone Jack", "HP",
203 "MIC1", "Microphone Jack",
204 "Microphone Jack", "MBIAS";
205 status = "okay";
206};
207
198&uart0 { 208&uart0 {
199 pinctrl-names = "default"; 209 pinctrl-names = "default";
200 pinctrl-0 = <&uart0_pins_b>; 210 pinctrl-0 = <&uart0_pins_b>;
@@ -211,8 +221,6 @@
211}; 221};
212 222
213&usbphy { 223&usbphy {
214 pinctrl-names = "default";
215 pinctrl-0 = <&usb0_id_detect_pin>;
216 usb0_id_det-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ 224 usb0_id_det-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
217 usb0_vbus_power-supply = <&usb_power_supply>; 225 usb0_vbus_power-supply = <&usb_power_supply>;
218 usb0_vbus-supply = <&reg_drivevbus>; 226 usb0_vbus-supply = <&reg_drivevbus>;
diff --git a/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts b/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts
index 433cf2a2a9a2..541acb4d2b91 100644
--- a/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts
+++ b/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts
@@ -144,8 +144,7 @@
144 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>; 144 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>;
145 vmmc-supply = <&reg_dcdc1>; 145 vmmc-supply = <&reg_dcdc1>;
146 bus-width = <4>; 146 bus-width = <4>;
147 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 147 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
148 cd-inverted;
149 status = "okay"; 148 status = "okay";
150}; 149};
151 150
diff --git a/arch/arm/boot/dts/sun8i-a33.dtsi b/arch/arm/boot/dts/sun8i-a33.dtsi
index 50eb84fa246a..a21f2ed07a52 100644
--- a/arch/arm/boot/dts/sun8i-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a33.dtsi
@@ -289,7 +289,6 @@
289 clock-names = "ahb", "mod", 289 clock-names = "ahb", "mod",
290 "ram"; 290 "ram";
291 resets = <&ccu RST_BUS_DE_FE>; 291 resets = <&ccu RST_BUS_DE_FE>;
292 status = "disabled";
293 292
294 ports { 293 ports {
295 #address-cells = <1>; 294 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
index 5091cecbcd1e..36ecebaff3c0 100644
--- a/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
@@ -87,9 +87,8 @@
87 pinctrl-names = "default"; 87 pinctrl-names = "default";
88 pinctrl-0 = <&mmc0_pins>; 88 pinctrl-0 = <&mmc0_pins>;
89 vmmc-supply = <&reg_dcdc1>; 89 vmmc-supply = <&reg_dcdc1>;
90 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 90 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
91 bus-width = <4>; 91 bus-width = <4>;
92 cd-inverted;
93 status = "okay"; 92 status = "okay";
94}; 93};
95 94
diff --git a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
index 6550bf0e594b..3b579d7567c8 100644
--- a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
@@ -60,6 +60,31 @@
60 stdout-path = "serial0:115200n8"; 60 stdout-path = "serial0:115200n8";
61 }; 61 };
62 62
63 connector {
64 compatible = "hdmi-connector";
65 type = "a";
66
67 port {
68 hdmi_con_in: endpoint {
69 remote-endpoint = <&hdmi_out_con>;
70 };
71 };
72 };
73
74 leds {
75 compatible = "gpio-leds";
76
77 blue {
78 label = "bananapi-m3:blue:usr";
79 gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
80 };
81
82 green {
83 label = "bananapi-m3:green:usr";
84 gpios = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
85 };
86 };
87
63 reg_usb1_vbus: reg-usb1-vbus { 88 reg_usb1_vbus: reg-usb1-vbus {
64 compatible = "regulator-fixed"; 89 compatible = "regulator-fixed";
65 regulator-name = "usb1-vbus"; 90 regulator-name = "usb1-vbus";
@@ -82,6 +107,10 @@
82 }; 107 };
83}; 108};
84 109
110&de {
111 status = "okay";
112};
113
85&ehci0 { 114&ehci0 {
86 /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */ 115 /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
87 status = "okay"; 116 status = "okay";
@@ -100,6 +129,16 @@
100 status = "okay"; 129 status = "okay";
101}; 130};
102 131
132&hdmi {
133 status = "okay";
134};
135
136&hdmi_out {
137 hdmi_out_con: endpoint {
138 remote-endpoint = <&hdmi_con_in>;
139 };
140};
141
103&mdio { 142&mdio {
104 rgmii_phy: ethernet-phy@1 { 143 rgmii_phy: ethernet-phy@1 {
105 compatible = "ethernet-phy-ieee802.3-c22"; 144 compatible = "ethernet-phy-ieee802.3-c22";
@@ -112,8 +151,7 @@
112 pinctrl-0 = <&mmc0_pins>; 151 pinctrl-0 = <&mmc0_pins>;
113 vmmc-supply = <&reg_dcdc1>; 152 vmmc-supply = <&reg_dcdc1>;
114 bus-width = <4>; 153 bus-width = <4>;
115 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 154 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
116 cd-inverted;
117 status = "okay"; 155 status = "okay";
118}; 156};
119 157
diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
index 6da08cd0e107..88decb0747ac 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -176,8 +176,7 @@
176 pinctrl-0 = <&mmc0_pins>; 176 pinctrl-0 = <&mmc0_pins>;
177 vmmc-supply = <&reg_dcdc1>; 177 vmmc-supply = <&reg_dcdc1>;
178 bus-width = <4>; 178 bus-width = <4>;
179 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 179 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
180 cd-inverted;
181 status = "okay"; 180 status = "okay";
182}; 181};
183 182
diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
index 511fca491fe8..1537ce148cc1 100644
--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
@@ -128,6 +128,14 @@
128 }; 128 };
129}; 129};
130 130
131&cpu0 {
132 cpu-supply = <&reg_dcdc2>;
133};
134
135&cpu100 {
136 cpu-supply = <&reg_dcdc3>;
137};
138
131&de { 139&de {
132 status = "okay"; 140 status = "okay";
133}; 141};
@@ -231,6 +239,10 @@
231 239
232#include "axp81x.dtsi" 240#include "axp81x.dtsi"
233 241
242&battery_power_supply {
243 status = "okay";
244};
245
234&reg_aldo1 { 246&reg_aldo1 {
235 regulator-min-microvolt = <1800000>; 247 regulator-min-microvolt = <1800000>;
236 regulator-max-microvolt = <1800000>; 248 regulator-max-microvolt = <1800000>;
diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 7f4955a5fab7..568307639be8 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -60,51 +60,63 @@
60 #address-cells = <1>; 60 #address-cells = <1>;
61 #size-cells = <0>; 61 #size-cells = <0>;
62 62
63 cpu@0 { 63 cpu0: cpu@0 {
64 clocks = <&ccu CLK_C0CPUX>;
65 clock-names = "cpu";
64 compatible = "arm,cortex-a7"; 66 compatible = "arm,cortex-a7";
65 device_type = "cpu"; 67 device_type = "cpu";
68 operating-points-v2 = <&cpu0_opp_table>;
66 reg = <0>; 69 reg = <0>;
67 }; 70 };
68 71
69 cpu@1 { 72 cpu@1 {
70 compatible = "arm,cortex-a7"; 73 compatible = "arm,cortex-a7";
71 device_type = "cpu"; 74 device_type = "cpu";
75 operating-points-v2 = <&cpu0_opp_table>;
72 reg = <1>; 76 reg = <1>;
73 }; 77 };
74 78
75 cpu@2 { 79 cpu@2 {
76 compatible = "arm,cortex-a7"; 80 compatible = "arm,cortex-a7";
77 device_type = "cpu"; 81 device_type = "cpu";
82 operating-points-v2 = <&cpu0_opp_table>;
78 reg = <2>; 83 reg = <2>;
79 }; 84 };
80 85
81 cpu@3 { 86 cpu@3 {
82 compatible = "arm,cortex-a7"; 87 compatible = "arm,cortex-a7";
83 device_type = "cpu"; 88 device_type = "cpu";
89 operating-points-v2 = <&cpu0_opp_table>;
84 reg = <3>; 90 reg = <3>;
85 }; 91 };
86 92
87 cpu@100 { 93 cpu100: cpu@100 {
94 clocks = <&ccu CLK_C1CPUX>;
95 clock-names = "cpu";
88 compatible = "arm,cortex-a7"; 96 compatible = "arm,cortex-a7";
89 device_type = "cpu"; 97 device_type = "cpu";
98 operating-points-v2 = <&cpu1_opp_table>;
90 reg = <0x100>; 99 reg = <0x100>;
91 }; 100 };
92 101
93 cpu@101 { 102 cpu@101 {
94 compatible = "arm,cortex-a7"; 103 compatible = "arm,cortex-a7";
95 device_type = "cpu"; 104 device_type = "cpu";
105 operating-points-v2 = <&cpu1_opp_table>;
96 reg = <0x101>; 106 reg = <0x101>;
97 }; 107 };
98 108
99 cpu@102 { 109 cpu@102 {
100 compatible = "arm,cortex-a7"; 110 compatible = "arm,cortex-a7";
101 device_type = "cpu"; 111 device_type = "cpu";
112 operating-points-v2 = <&cpu1_opp_table>;
102 reg = <0x102>; 113 reg = <0x102>;
103 }; 114 };
104 115
105 cpu@103 { 116 cpu@103 {
106 compatible = "arm,cortex-a7"; 117 compatible = "arm,cortex-a7";
107 device_type = "cpu"; 118 device_type = "cpu";
119 operating-points-v2 = <&cpu1_opp_table>;
108 reg = <0x103>; 120 reg = <0x103>;
109 }; 121 };
110 }; 122 };
@@ -155,7 +167,7 @@
155 167
156 de: display-engine { 168 de: display-engine {
157 compatible = "allwinner,sun8i-a83t-display-engine"; 169 compatible = "allwinner,sun8i-a83t-display-engine";
158 allwinner,pipelines = <&mixer0>; 170 allwinner,pipelines = <&mixer0>, <&mixer1>;
159 status = "disabled"; 171 status = "disabled";
160 }; 172 };
161 173
@@ -164,6 +176,112 @@
164 device_type = "memory"; 176 device_type = "memory";
165 }; 177 };
166 178
179 cpu0_opp_table: opp_table0 {
180 compatible = "operating-points-v2";
181 opp-shared;
182
183 opp-480000000 {
184 opp-hz = /bits/ 64 <480000000>;
185 opp-microvolt = <840000>;
186 clock-latency-ns = <244144>; /* 8 32k periods */
187 };
188
189 opp-600000000 {
190 opp-hz = /bits/ 64 <600000000>;
191 opp-microvolt = <840000>;
192 clock-latency-ns = <244144>; /* 8 32k periods */
193 };
194
195 opp-720000000 {
196 opp-hz = /bits/ 64 <720000000>;
197 opp-microvolt = <840000>;
198 clock-latency-ns = <244144>; /* 8 32k periods */
199 };
200
201 opp-864000000 {
202 opp-hz = /bits/ 64 <864000000>;
203 opp-microvolt = <840000>;
204 clock-latency-ns = <244144>; /* 8 32k periods */
205 };
206
207 opp-912000000 {
208 opp-hz = /bits/ 64 <912000000>;
209 opp-microvolt = <840000>;
210 clock-latency-ns = <244144>; /* 8 32k periods */
211 };
212
213 opp-1008000000 {
214 opp-hz = /bits/ 64 <1008000000>;
215 opp-microvolt = <840000>;
216 clock-latency-ns = <244144>; /* 8 32k periods */
217 };
218
219 opp-1128000000 {
220 opp-hz = /bits/ 64 <1128000000>;
221 opp-microvolt = <840000>;
222 clock-latency-ns = <244144>; /* 8 32k periods */
223 };
224
225 opp-1200000000 {
226 opp-hz = /bits/ 64 <1200000000>;
227 opp-microvolt = <840000>;
228 clock-latency-ns = <244144>; /* 8 32k periods */
229 };
230 };
231
232 cpu1_opp_table: opp_table1 {
233 compatible = "operating-points-v2";
234 opp-shared;
235
236 opp-480000000 {
237 opp-hz = /bits/ 64 <480000000>;
238 opp-microvolt = <840000>;
239 clock-latency-ns = <244144>; /* 8 32k periods */
240 };
241
242 opp-600000000 {
243 opp-hz = /bits/ 64 <600000000>;
244 opp-microvolt = <840000>;
245 clock-latency-ns = <244144>; /* 8 32k periods */
246 };
247
248 opp-720000000 {
249 opp-hz = /bits/ 64 <720000000>;
250 opp-microvolt = <840000>;
251 clock-latency-ns = <244144>; /* 8 32k periods */
252 };
253
254 opp-864000000 {
255 opp-hz = /bits/ 64 <864000000>;
256 opp-microvolt = <840000>;
257 clock-latency-ns = <244144>; /* 8 32k periods */
258 };
259
260 opp-912000000 {
261 opp-hz = /bits/ 64 <912000000>;
262 opp-microvolt = <840000>;
263 clock-latency-ns = <244144>; /* 8 32k periods */
264 };
265
266 opp-1008000000 {
267 opp-hz = /bits/ 64 <1008000000>;
268 opp-microvolt = <840000>;
269 clock-latency-ns = <244144>; /* 8 32k periods */
270 };
271
272 opp-1128000000 {
273 opp-hz = /bits/ 64 <1128000000>;
274 opp-microvolt = <840000>;
275 clock-latency-ns = <244144>; /* 8 32k periods */
276 };
277
278 opp-1200000000 {
279 opp-hz = /bits/ 64 <1200000000>;
280 opp-microvolt = <840000>;
281 clock-latency-ns = <244144>; /* 8 32k periods */
282 };
283 };
284
167 soc { 285 soc {
168 compatible = "simple-bus"; 286 compatible = "simple-bus";
169 #address-cells = <1>; 287 #address-cells = <1>;
@@ -208,6 +326,29 @@
208 }; 326 };
209 }; 327 };
210 328
329 mixer1: mixer@1200000 {
330 compatible = "allwinner,sun8i-a83t-de2-mixer-1";
331 reg = <0x01200000 0x100000>;
332 clocks = <&display_clocks CLK_BUS_MIXER1>,
333 <&display_clocks CLK_MIXER1>;
334 clock-names = "bus",
335 "mod";
336 resets = <&display_clocks RST_WB>;
337
338 ports {
339 #address-cells = <1>;
340 #size-cells = <0>;
341
342 mixer1_out: port@1 {
343 reg = <1>;
344
345 mixer1_out_tcon1: endpoint {
346 remote-endpoint = <&tcon1_in_mixer1>;
347 };
348 };
349 };
350 };
351
211 syscon: syscon@1c00000 { 352 syscon: syscon@1c00000 {
212 compatible = "allwinner,sun8i-a83t-system-controller", 353 compatible = "allwinner,sun8i-a83t-system-controller",
213 "syscon"; 354 "syscon";
@@ -256,6 +397,40 @@
256 }; 397 };
257 }; 398 };
258 399
400 tcon1: lcd-controller@1c0d000 {
401 compatible = "allwinner,sun8i-a83t-tcon-tv";
402 reg = <0x01c0d000 0x1000>;
403 interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
404 clocks = <&ccu CLK_BUS_TCON1>, <&ccu CLK_TCON1>;
405 clock-names = "ahb", "tcon-ch1";
406 resets = <&ccu RST_BUS_TCON1>;
407 reset-names = "lcd";
408
409 ports {
410 #address-cells = <1>;
411 #size-cells = <0>;
412
413 tcon1_in: port@0 {
414 reg = <0>;
415
416 tcon1_in_mixer1: endpoint {
417 remote-endpoint = <&mixer1_out_tcon1>;
418 };
419 };
420
421 tcon1_out: port@1 {
422 #address-cells = <1>;
423 #size-cells = <0>;
424 reg = <1>;
425
426 tcon1_out_hdmi: endpoint@1 {
427 reg = <1>;
428 remote-endpoint = <&hdmi_in_tcon1>;
429 };
430 };
431 };
432 };
433
259 mmc0: mmc@1c0f000 { 434 mmc0: mmc@1c0f000 {
260 compatible = "allwinner,sun8i-a83t-mmc", 435 compatible = "allwinner,sun8i-a83t-mmc",
261 "allwinner,sun7i-a20-mmc"; 436 "allwinner,sun7i-a20-mmc";
@@ -427,6 +602,11 @@
427 drive-strength = <40>; 602 drive-strength = <40>;
428 }; 603 };
429 604
605 hdmi_pins: hdmi-pins {
606 pins = "PH6", "PH7", "PH8";
607 function = "hdmi";
608 };
609
430 i2c0_pins: i2c0-pins { 610 i2c0_pins: i2c0-pins {
431 pins = "PH0", "PH1"; 611 pins = "PH0", "PH1";
432 function = "i2c0"; 612 function = "i2c0";
@@ -685,6 +865,50 @@
685 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>; 865 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
686 }; 866 };
687 867
868 hdmi: hdmi@1ee0000 {
869 compatible = "allwinner,sun8i-a83t-dw-hdmi";
870 reg = <0x01ee0000 0x10000>;
871 reg-io-width = <1>;
872 interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
873 clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>,
874 <&ccu CLK_HDMI>;
875 clock-names = "iahb", "isfr", "tmds";
876 resets = <&ccu RST_BUS_HDMI1>;
877 reset-names = "ctrl";
878 phys = <&hdmi_phy>;
879 phy-names = "hdmi-phy";
880 pinctrl-names = "default";
881 pinctrl-0 = <&hdmi_pins>;
882 status = "disabled";
883
884 ports {
885 #address-cells = <1>;
886 #size-cells = <0>;
887
888 hdmi_in: port@0 {
889 reg = <0>;
890
891 hdmi_in_tcon1: endpoint {
892 remote-endpoint = <&tcon1_out_hdmi>;
893 };
894 };
895
896 hdmi_out: port@1 {
897 reg = <1>;
898 };
899 };
900 };
901
902 hdmi_phy: hdmi-phy@1ef0000 {
903 compatible = "allwinner,sun8i-a83t-hdmi-phy";
904 reg = <0x01ef0000 0x10000>;
905 clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>;
906 clock-names = "bus", "mod";
907 resets = <&ccu RST_BUS_HDMI0>;
908 reset-names = "phy";
909 #phy-cells = <0>;
910 };
911
688 r_intc: interrupt-controller@1f00c00 { 912 r_intc: interrupt-controller@1f00c00 {
689 compatible = "allwinner,sun8i-a83t-r-intc", 913 compatible = "allwinner,sun8i-a83t-r-intc",
690 "allwinner,sun6i-a31-r-intc"; 914 "allwinner,sun6i-a31-r-intc";
diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts
new file mode 100644
index 000000000000..7d01f9322658
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts
@@ -0,0 +1,121 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4 *
5 * Based on sun8i-h3-bananapi-m2-plus.dts, which is:
6 * Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
7 */
8
9/dts-v1/;
10#include "sun8i-h3.dtsi"
11#include "sunxi-common-regulators.dtsi"
12
13#include <dt-bindings/gpio/gpio.h>
14#include <dt-bindings/input/input.h>
15
16/ {
17 model = "Banana Pi BPI-M2-Zero";
18 compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus";
19
20 aliases {
21 serial0 = &uart0;
22 serial1 = &uart1;
23 };
24
25 chosen {
26 stdout-path = "serial0:115200n8";
27 };
28
29 leds {
30 compatible = "gpio-leds";
31 pinctrl-names = "default";
32
33 pwr_led {
34 label = "bananapi-m2-zero:red:pwr";
35 gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
36 default-state = "on";
37 };
38 };
39
40 gpio_keys {
41 compatible = "gpio-keys";
42 pinctrl-names = "default";
43
44 sw4 {
45 label = "power";
46 linux,code = <BTN_0>;
47 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 wifi_pwrseq: wifi_pwrseq {
52 compatible = "mmc-pwrseq-simple";
53 pinctrl-names = "default";
54 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
55 };
56};
57
58&ehci0 {
59 status = "okay";
60};
61
62&mmc0 {
63 vmmc-supply = <&reg_vcc3v3>;
64 bus-width = <4>;
65 /*
66 * On the production batch of this board the card detect GPIO is
67 * high active (card inserted), although on the early samples it's
68 * low active.
69 */
70 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
71 status = "okay";
72};
73
74&mmc1 {
75 vmmc-supply = <&reg_vcc3v3>;
76 vqmmc-supply = <&reg_vcc3v3>;
77 mmc-pwrseq = <&wifi_pwrseq>;
78 bus-width = <4>;
79 non-removable;
80 status = "okay";
81
82 brcmf: wifi@1 {
83 reg = <1>;
84 compatible = "brcm,bcm4329-fmac";
85 interrupt-parent = <&pio>;
86 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
87 interrupt-names = "host-wake";
88 };
89};
90
91&ohci0 {
92 status = "okay";
93};
94
95&uart0 {
96 pinctrl-names = "default";
97 pinctrl-0 = <&uart0_pins_a>;
98 status = "okay";
99};
100
101&uart1 {
102 pinctrl-names = "default";
103 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
104 status = "okay";
105};
106
107&usb_otg {
108 dr_mode = "otg";
109 status = "okay";
110};
111
112&usbphy {
113 usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
114 /*
115 * There're two micro-USB connectors, one is power-only and another is
116 * OTG. The Vbus of these two connectors are connected together, so
117 * the external USB device will be powered just by the power input
118 * from the power-only USB port.
119 */
120 status = "okay";
121};
diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
index 112f09c67d67..3356f4210d45 100644
--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
@@ -68,6 +68,14 @@
68 }; 68 };
69}; 69};
70 70
71&spi0 {
72 status = "okay";
73
74 flash@0 {
75 compatible = "mxicy,mx25l12805d", "jedec,spi-nor";
76 };
77};
78
71&ohci1 { 79&ohci1 {
72 /* 80 /*
73 * RTL8152B USB-Ethernet adapter is connected to USB1, 81 * RTL8152B USB-Ethernet adapter is connected to USB1,
diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
index 6713d0f2b3f4..0bc031fe4c56 100644
--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -112,18 +112,13 @@
112}; 112};
113 113
114&mmc0 { 114&mmc0 {
115 pinctrl-names = "default";
116 pinctrl-0 = <&mmc0_pins_a>;
117 vmmc-supply = <&reg_vcc3v3>; 115 vmmc-supply = <&reg_vcc3v3>;
118 bus-width = <4>; 116 bus-width = <4>;
119 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 117 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
120 cd-inverted;
121 status = "okay"; 118 status = "okay";
122}; 119};
123 120
124&mmc1 { 121&mmc1 {
125 pinctrl-names = "default";
126 pinctrl-0 = <&mmc1_pins_a>;
127 vmmc-supply = <&reg_vcc_wifi>; 122 vmmc-supply = <&reg_vcc_wifi>;
128 mmc-pwrseq = <&wifi_pwrseq>; 123 mmc-pwrseq = <&wifi_pwrseq>;
129 bus-width = <4>; 124 bus-width = <4>;
@@ -139,10 +134,6 @@
139 }; 134 };
140}; 135};
141 136
142&mmc1_pins_a {
143 bias-pull-up;
144};
145
146&ohci0 { 137&ohci0 {
147 status = "okay"; 138 status = "okay";
148}; 139};
diff --git a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
index f1c3f1cc4d97..30540dc8e0c5 100644
--- a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
@@ -61,6 +61,17 @@
61 stdout-path = "serial0:115200n8"; 61 stdout-path = "serial0:115200n8";
62 }; 62 };
63 63
64 connector {
65 compatible = "hdmi-connector";
66 type = "a";
67
68 port {
69 hdmi_con_in: endpoint {
70 remote-endpoint = <&hdmi_out_con>;
71 };
72 };
73 };
74
64 leds { 75 leds {
65 compatible = "gpio-leds"; 76 compatible = "gpio-leds";
66 pinctrl-names = "default"; 77 pinctrl-names = "default";
@@ -100,6 +111,10 @@
100 }; 111 };
101}; 112};
102 113
114&de {
115 status = "okay";
116};
117
103&ehci0 { 118&ehci0 {
104 status = "okay"; 119 status = "okay";
105}; 120};
@@ -129,6 +144,16 @@
129 }; 144 };
130}; 145};
131 146
147&hdmi {
148 status = "okay";
149};
150
151&hdmi_out {
152 hdmi_out_con: endpoint {
153 remote-endpoint = <&hdmi_con_in>;
154 };
155};
156
132&ir { 157&ir {
133 pinctrl-names = "default"; 158 pinctrl-names = "default";
134 pinctrl-0 = <&ir_pins_a>; 159 pinctrl-0 = <&ir_pins_a>;
@@ -136,18 +161,13 @@
136}; 161};
137 162
138&mmc0 { 163&mmc0 {
139 pinctrl-names = "default";
140 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
141 vmmc-supply = <&reg_vcc3v3>; 164 vmmc-supply = <&reg_vcc3v3>;
142 bus-width = <4>; 165 bus-width = <4>;
143 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 166 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
144 cd-inverted;
145 status = "okay"; 167 status = "okay";
146}; 168};
147 169
148&mmc1 { 170&mmc1 {
149 pinctrl-names = "default";
150 pinctrl-0 = <&mmc1_pins_a>;
151 vmmc-supply = <&reg_vcc3v3>; 171 vmmc-supply = <&reg_vcc3v3>;
152 vqmmc-supply = <&reg_vcc3v3>; 172 vqmmc-supply = <&reg_vcc3v3>;
153 mmc-pwrseq = <&wifi_pwrseq>; 173 mmc-pwrseq = <&wifi_pwrseq>;
diff --git a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
index 10da56e86ab8..cf1f970b0c6f 100644
--- a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
@@ -61,6 +61,17 @@
61 stdout-path = "serial0:115200n8"; 61 stdout-path = "serial0:115200n8";
62 }; 62 };
63 63
64 connector {
65 compatible = "hdmi-connector";
66 type = "a";
67
68 port {
69 hdmi_con_in: endpoint {
70 remote-endpoint = <&hdmi_out_con>;
71 };
72 };
73 };
74
64 leds { 75 leds {
65 compatible = "gpio-leds"; 76 compatible = "gpio-leds";
66 77
@@ -100,6 +111,10 @@
100 }; 111 };
101}; 112};
102 113
114&de {
115 status = "okay";
116};
117
103&ehci0 { 118&ehci0 {
104 status = "okay"; 119 status = "okay";
105}; 120};
@@ -108,6 +123,16 @@
108 status = "okay"; 123 status = "okay";
109}; 124};
110 125
126&hdmi {
127 status = "okay";
128};
129
130&hdmi_out {
131 hdmi_out_con: endpoint {
132 remote-endpoint = <&hdmi_con_in>;
133 };
134};
135
111&ir { 136&ir {
112 pinctrl-names = "default"; 137 pinctrl-names = "default";
113 pinctrl-0 = <&ir_pins_a>; 138 pinctrl-0 = <&ir_pins_a>;
@@ -115,18 +140,13 @@
115}; 140};
116 141
117&mmc0 { 142&mmc0 {
118 pinctrl-names = "default";
119 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
120 vmmc-supply = <&reg_vcc3v3>; 143 vmmc-supply = <&reg_vcc3v3>;
121 bus-width = <4>; 144 bus-width = <4>;
122 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 145 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
123 cd-inverted;
124 status = "okay"; 146 status = "okay";
125}; 147};
126 148
127&mmc1 { 149&mmc1 {
128 pinctrl-names = "default";
129 pinctrl-0 = <&mmc1_pins_a>;
130 vmmc-supply = <&reg_vcc3v3>; 150 vmmc-supply = <&reg_vcc3v3>;
131 bus-width = <4>; 151 bus-width = <4>;
132 non-removable; 152 non-removable;
diff --git a/arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts b/arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts
index d406571a0dd6..b20a710da7bc 100644
--- a/arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts
+++ b/arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts
@@ -23,6 +23,17 @@
23 stdout-path = "serial0:115200n8"; 23 stdout-path = "serial0:115200n8";
24 }; 24 };
25 25
26 connector {
27 compatible = "hdmi-connector";
28 type = "a";
29
30 port {
31 hdmi_con_in: endpoint {
32 remote-endpoint = <&hdmi_out_con>;
33 };
34 };
35 };
36
26 leds { 37 leds {
27 compatible = "gpio-leds"; 38 compatible = "gpio-leds";
28 39
@@ -120,6 +131,10 @@
120 status = "okay"; 131 status = "okay";
121}; 132};
122 133
134&de {
135 status = "okay";
136};
137
123&ehci0 { 138&ehci0 {
124 status = "okay"; 139 status = "okay";
125}; 140};
@@ -143,6 +158,16 @@
143 status = "okay"; 158 status = "okay";
144}; 159};
145 160
161&hdmi {
162 status = "okay";
163};
164
165&hdmi_out {
166 hdmi_out_con: endpoint {
167 remote-endpoint = <&hdmi_con_in>;
168 };
169};
170
146&ir { 171&ir {
147 pinctrl-names = "default"; 172 pinctrl-names = "default";
148 pinctrl-0 = <&ir_pins_a>; 173 pinctrl-0 = <&ir_pins_a>;
@@ -150,12 +175,9 @@
150}; 175};
151 176
152&mmc0 { 177&mmc0 {
153 pinctrl-names = "default";
154 pinctrl-0 = <&mmc0_pins_a>;
155 vmmc-supply = <&reg_vcc_io>; 178 vmmc-supply = <&reg_vcc_io>;
156 bus-width = <4>; 179 bus-width = <4>;
157 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 180 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
158 cd-inverted;
159 status = "okay"; 181 status = "okay";
160}; 182};
161 183
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
index a6e61915d648..65cba1050802 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
@@ -101,8 +101,6 @@
101}; 101};
102 102
103&mmc1 { 103&mmc1 {
104 pinctrl-names = "default";
105 pinctrl-0 = <&mmc1_pins_a>;
106 vmmc-supply = <&reg_vcc3v3>; 104 vmmc-supply = <&reg_vcc3v3>;
107 vqmmc-supply = <&reg_vcc3v3>; 105 vqmmc-supply = <&reg_vcc3v3>;
108 mmc-pwrseq = <&wifi_pwrseq>; 106 mmc-pwrseq = <&wifi_pwrseq>;
@@ -119,6 +117,16 @@
119 }; 117 };
120}; 118};
121 119
120&mmc2 {
121 pinctrl-names = "default";
122 pinctrl-0 = <&mmc2_8bit_pins>;
123 vmmc-supply = <&reg_vcc3v3>;
124 vqmmc-supply = <&reg_vcc3v3>;
125 bus-width = <8>;
126 non-removable;
127 status = "okay";
128};
129
122&ohci1 { 130&ohci1 {
123 status = "okay"; 131 status = "okay";
124}; 132};
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
index c77fbca4f227..9412668bb888 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
@@ -49,6 +49,21 @@
49 aliases { 49 aliases {
50 ethernet0 = &emac; 50 ethernet0 = &emac;
51 }; 51 };
52
53 connector {
54 compatible = "hdmi-connector";
55 type = "a";
56
57 port {
58 hdmi_con_in: endpoint {
59 remote-endpoint = <&hdmi_out_con>;
60 };
61 };
62 };
63};
64
65&de {
66 status = "okay";
52}; 67};
53 68
54&ehci1 { 69&ehci1 {
@@ -66,6 +81,16 @@
66 status = "okay"; 81 status = "okay";
67}; 82};
68 83
84&hdmi {
85 status = "okay";
86};
87
88&hdmi_out {
89 hdmi_out_con: endpoint {
90 remote-endpoint = <&hdmi_con_in>;
91 };
92};
93
69&ir { 94&ir {
70 pinctrl-names = "default"; 95 pinctrl-names = "default";
71 pinctrl-0 = <&ir_pins_a>; 96 pinctrl-0 = <&ir_pins_a>;
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
index 03ff6f8b93ff..6246d3eff39d 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
@@ -72,16 +72,35 @@
72 gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */ 72 gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
73 }; 73 };
74 }; 74 };
75
76 wifi_pwrseq: wifi_pwrseq {
77 compatible = "mmc-pwrseq-simple";
78 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
79 };
75}; 80};
76 81
77&mmc0 { 82&mmc0 {
78 pinctrl-names = "default";
79 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
80 vmmc-supply = <&reg_vcc3v3>; 83 vmmc-supply = <&reg_vcc3v3>;
81 bus-width = <4>; 84 bus-width = <4>;
82 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 85 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
83 cd-inverted; 86 status = "okay";
87};
88
89&mmc1 {
90 vmmc-supply = <&reg_vcc3v3>;
91 vqmmc-supply = <&reg_vcc3v3>;
92 mmc-pwrseq = <&wifi_pwrseq>;
93 bus-width = <4>;
94 non-removable;
84 status = "okay"; 95 status = "okay";
96
97 brcmf: bcrmf@1 {
98 reg = <1>;
99 compatible = "brcm,bcm4329-fmac";
100 interrupt-parent = <&pio>;
101 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
102 interrupt-names = "host-wake";
103 };
85}; 104};
86 105
87&uart0 { 106&uart0 {
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi
index 7646e331bd29..f110ee382239 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi
@@ -95,10 +95,7 @@
95 95
96&mmc0 { 96&mmc0 {
97 bus-width = <4>; 97 bus-width = <4>;
98 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 98 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
99 cd-inverted;
100 pinctrl-names = "default";
101 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
102 status = "okay"; 99 status = "okay";
103 vmmc-supply = <&reg_vcc3v3>; 100 vmmc-supply = <&reg_vcc3v3>;
104}; 101};
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
index b20be95b49d5..f1fc6bdca8be 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
@@ -62,6 +62,17 @@
62 stdout-path = "serial0:115200n8"; 62 stdout-path = "serial0:115200n8";
63 }; 63 };
64 64
65 connector {
66 compatible = "hdmi-connector";
67 type = "a";
68
69 port {
70 hdmi_con_in: endpoint {
71 remote-endpoint = <&hdmi_out_con>;
72 };
73 };
74 };
75
65 leds { 76 leds {
66 compatible = "gpio-leds"; 77 compatible = "gpio-leds";
67 pinctrl-names = "default"; 78 pinctrl-names = "default";
@@ -114,6 +125,10 @@
114 status = "okay"; 125 status = "okay";
115}; 126};
116 127
128&de {
129 status = "okay";
130};
131
117&ehci1 { 132&ehci1 {
118 status = "okay"; 133 status = "okay";
119}; 134};
@@ -125,6 +140,16 @@
125 status = "okay"; 140 status = "okay";
126}; 141};
127 142
143&hdmi {
144 status = "okay";
145};
146
147&hdmi_out {
148 hdmi_out_con: endpoint {
149 remote-endpoint = <&hdmi_con_in>;
150 };
151};
152
128&ir { 153&ir {
129 pinctrl-names = "default"; 154 pinctrl-names = "default";
130 pinctrl-0 = <&ir_pins_a>; 155 pinctrl-0 = <&ir_pins_a>;
@@ -132,18 +157,13 @@
132}; 157};
133 158
134&mmc0 { 159&mmc0 {
135 pinctrl-names = "default";
136 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
137 vmmc-supply = <&reg_vcc3v3>; 160 vmmc-supply = <&reg_vcc3v3>;
138 bus-width = <4>; 161 bus-width = <4>;
139 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 162 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
140 cd-inverted;
141 status = "okay"; 163 status = "okay";
142}; 164};
143 165
144&mmc1 { 166&mmc1 {
145 pinctrl-names = "default";
146 pinctrl-0 = <&mmc1_pins_a>;
147 vmmc-supply = <&reg_vcc3v3>; 167 vmmc-supply = <&reg_vcc3v3>;
148 mmc-pwrseq = <&wifi_pwrseq>; 168 mmc-pwrseq = <&wifi_pwrseq>;
149 bus-width = <4>; 169 bus-width = <4>;
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts
index a70a1daf4e2c..476ae8e387ca 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts
@@ -61,6 +61,17 @@
61 stdout-path = "serial0:115200n8"; 61 stdout-path = "serial0:115200n8";
62 }; 62 };
63 63
64 connector {
65 compatible = "hdmi-connector";
66 type = "a";
67
68 port {
69 hdmi_con_in: endpoint {
70 remote-endpoint = <&hdmi_out_con>;
71 };
72 };
73 };
74
64 leds { 75 leds {
65 compatible = "gpio-leds"; 76 compatible = "gpio-leds";
66 pinctrl-names = "default"; 77 pinctrl-names = "default";
@@ -91,6 +102,10 @@
91 }; 102 };
92}; 103};
93 104
105&de {
106 status = "okay";
107};
108
94&ehci1 { 109&ehci1 {
95 status = "okay"; 110 status = "okay";
96}; 111};
@@ -99,6 +114,16 @@
99 status = "okay"; 114 status = "okay";
100}; 115};
101 116
117&hdmi {
118 status = "okay";
119};
120
121&hdmi_out {
122 hdmi_out_con: endpoint {
123 remote-endpoint = <&hdmi_con_in>;
124 };
125};
126
102&ir { 127&ir {
103 pinctrl-names = "default"; 128 pinctrl-names = "default";
104 pinctrl-0 = <&ir_pins_a>; 129 pinctrl-0 = <&ir_pins_a>;
@@ -106,18 +131,13 @@
106}; 131};
107 132
108&mmc0 { 133&mmc0 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
111 vmmc-supply = <&reg_vcc3v3>; 134 vmmc-supply = <&reg_vcc3v3>;
112 bus-width = <4>; 135 bus-width = <4>;
113 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 136 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
114 cd-inverted;
115 status = "okay"; 137 status = "okay";
116}; 138};
117 139
118&mmc1 { 140&mmc1 {
119 pinctrl-names = "default";
120 pinctrl-0 = <&mmc1_pins_a>;
121 vmmc-supply = <&reg_vcc3v3>; 141 vmmc-supply = <&reg_vcc3v3>;
122 bus-width = <4>; 142 bus-width = <4>;
123 non-removable; 143 non-removable;
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
index 82e5d28cd698..3328fe583c9b 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
@@ -60,6 +60,17 @@
60 stdout-path = "serial0:115200n8"; 60 stdout-path = "serial0:115200n8";
61 }; 61 };
62 62
63 connector {
64 compatible = "hdmi-connector";
65 type = "a";
66
67 port {
68 hdmi_con_in: endpoint {
69 remote-endpoint = <&hdmi_out_con>;
70 };
71 };
72 };
73
63 leds { 74 leds {
64 compatible = "gpio-leds"; 75 compatible = "gpio-leds";
65 pinctrl-names = "default"; 76 pinctrl-names = "default";
@@ -90,6 +101,10 @@
90 }; 101 };
91}; 102};
92 103
104&de {
105 status = "okay";
106};
107
93&ehci0 { 108&ehci0 {
94 status = "okay"; 109 status = "okay";
95}; 110};
@@ -102,16 +117,22 @@
102 phy-handle = <&int_mii_phy>; 117 phy-handle = <&int_mii_phy>;
103 phy-mode = "mii"; 118 phy-mode = "mii";
104 allwinner,leds-active-low; 119 allwinner,leds-active-low;
120};
121
122&hdmi {
105 status = "okay"; 123 status = "okay";
106}; 124};
107 125
126&hdmi_out {
127 hdmi_out_con: endpoint {
128 remote-endpoint = <&hdmi_con_in>;
129 };
130};
131
108&mmc0 { 132&mmc0 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
111 vmmc-supply = <&reg_vcc3v3>; 133 vmmc-supply = <&reg_vcc3v3>;
112 bus-width = <4>; 134 bus-width = <4>;
113 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 135 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
114 cd-inverted;
115 status = "okay"; 136 status = "okay";
116}; 137};
117 138
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts
index a10281b455f5..71fb73208939 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts
@@ -59,8 +59,6 @@
59}; 59};
60 60
61&mmc1 { 61&mmc1 {
62 pinctrl-names = "default";
63 pinctrl-0 = <&mmc1_pins_a>;
64 vmmc-supply = <&reg_vcc3v3>; 62 vmmc-supply = <&reg_vcc3v3>;
65 bus-width = <4>; 63 bus-width = <4>;
66 non-removable; 64 non-removable;
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
index d22546df1b82..cea4d647ecbf 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
@@ -60,6 +60,17 @@
60 stdout-path = "serial0:115200n8"; 60 stdout-path = "serial0:115200n8";
61 }; 61 };
62 62
63 connector {
64 compatible = "hdmi-connector";
65 type = "a";
66
67 port {
68 hdmi_con_in: endpoint {
69 remote-endpoint = <&hdmi_out_con>;
70 };
71 };
72 };
73
63 leds { 74 leds {
64 compatible = "gpio-leds"; 75 compatible = "gpio-leds";
65 pinctrl-names = "default"; 76 pinctrl-names = "default";
@@ -98,6 +109,10 @@
98 status = "okay"; 109 status = "okay";
99}; 110};
100 111
112&de {
113 status = "okay";
114};
115
101&ehci0 { 116&ehci0 {
102 status = "okay"; 117 status = "okay";
103}; 118};
@@ -121,6 +136,16 @@
121 status = "okay"; 136 status = "okay";
122}; 137};
123 138
139&hdmi {
140 status = "okay";
141};
142
143&hdmi_out {
144 hdmi_out_con: endpoint {
145 remote-endpoint = <&hdmi_con_in>;
146 };
147};
148
124&ir { 149&ir {
125 pinctrl-names = "default"; 150 pinctrl-names = "default";
126 pinctrl-0 = <&ir_pins_a>; 151 pinctrl-0 = <&ir_pins_a>;
@@ -128,12 +153,9 @@
128}; 153};
129 154
130&mmc0 { 155&mmc0 {
131 pinctrl-names = "default";
132 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
133 vmmc-supply = <&reg_vcc3v3>; 156 vmmc-supply = <&reg_vcc3v3>;
134 bus-width = <4>; 157 bus-width = <4>;
135 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ 158 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
136 cd-inverted;
137 status = "okay"; 159 status = "okay";
138}; 160};
139 161
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index 8495deecedad..10da8ed7db81 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -79,6 +79,33 @@
79 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 79 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
80 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; 80 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
81 }; 81 };
82
83 soc {
84 mali: gpu@1c40000 {
85 compatible = "allwinner,sun8i-h3-mali", "arm,mali-400";
86 reg = <0x01c40000 0x10000>;
87 interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
88 <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
89 <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
90 <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
91 <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
92 <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
93 <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
94 interrupt-names = "gp",
95 "gpmmu",
96 "pp0",
97 "ppmmu0",
98 "pp1",
99 "ppmmu1",
100 "pmu";
101 clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
102 clock-names = "bus", "core";
103 resets = <&ccu RST_BUS_GPU>;
104
105 assigned-clocks = <&ccu CLK_GPU>;
106 assigned-clock-rates = <384000000>;
107 };
108 };
82}; 109};
83 110
84&ccu { 111&ccu {
diff --git a/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts b/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts
index eaf09666720d..0dbdb29a8fff 100644
--- a/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts
+++ b/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts
@@ -150,8 +150,7 @@
150 pinctrl-0 = <&mmc0_pins_a>; 150 pinctrl-0 = <&mmc0_pins_a>;
151 vmmc-supply = <&reg_dcdc1>; 151 vmmc-supply = <&reg_dcdc1>;
152 bus-width = <4>; 152 bus-width = <4>;
153 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 153 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
154 cd-inverted;
155 status = "okay"; 154 status = "okay";
156}; 155};
157 156
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index 8c5efe2a9881..27d9ccd0ef2f 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -164,8 +164,7 @@
164&mmc0 { 164&mmc0 {
165 vmmc-supply = <&reg_dcdc1>; 165 vmmc-supply = <&reg_dcdc1>;
166 bus-width = <4>; 166 bus-width = <4>;
167 cd-gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ 167 cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
168 cd-inverted;
169 status = "okay"; 168 status = "okay";
170}; 169};
171 170
diff --git a/arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi b/arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi
index d6bd15898db6..880096c7e252 100644
--- a/arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi
+++ b/arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi
@@ -85,8 +85,7 @@
85 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; 85 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
86 vmmc-supply = <&reg_dcdc1>; 86 vmmc-supply = <&reg_dcdc1>;
87 bus-width = <4>; 87 bus-width = <4>;
88 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 88 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
89 cd-inverted;
90 status = "okay"; 89 status = "okay";
91}; 90};
92 91
@@ -125,6 +124,14 @@
125 124
126#include "axp223.dtsi" 125#include "axp223.dtsi"
127 126
127&ac_power_supply {
128 status = "okay";
129};
130
131&battery_power_supply {
132 status = "okay";
133};
134
128&reg_aldo1 { 135&reg_aldo1 {
129 regulator-always-on; 136 regulator-always-on;
130 regulator-min-microvolt = <3000000>; 137 regulator-min-microvolt = <3000000>;
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index fe16fc0eb518..a26d72c3f9b5 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -150,8 +150,7 @@
150&mmc0 { 150&mmc0 {
151 vmmc-supply = <&reg_dcdc1>; 151 vmmc-supply = <&reg_dcdc1>;
152 bus-width = <4>; 152 bus-width = <4>;
153 cd-gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ 153 cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
154 cd-inverted;
155 status = "okay"; 154 status = "okay";
156}; 155};
157 156
diff --git a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
index 4024639aa005..85da85faf869 100644
--- a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
+++ b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
@@ -74,6 +74,52 @@
74 }; 74 };
75 }; 75 };
76 76
77 vga-connector {
78 compatible = "vga-connector";
79 label = "vga";
80 ddc-i2c-bus = <&i2c3>;
81
82 port {
83 vga_con_in: endpoint {
84 remote-endpoint = <&vga_dac_out>;
85 };
86 };
87 };
88
89 vga-dac {
90 compatible = "corpro,gm7123", "adi,adv7123", "dumb-vga-dac";
91 vdd-supply = <&reg_dcdc1>;
92 #address-cells = <1>;
93 #size-cells = <0>;
94
95 ports {
96 #address-cells = <1>;
97 #size-cells = <0>;
98
99 port@0 {
100 #address-cells = <1>;
101 #size-cells = <0>;
102 reg = <0>;
103
104 vga_dac_in: endpoint@0 {
105 reg = <0>;
106 remote-endpoint = <&tcon0_out_vga>;
107 };
108 };
109
110 port@1 {
111 #address-cells = <1>;
112 #size-cells = <0>;
113 reg = <1>;
114
115 vga_dac_out: endpoint@0 {
116 reg = <0>;
117 remote-endpoint = <&vga_con_in>;
118 };
119 };
120 };
121 };
122
77 wifi_pwrseq: wifi-pwrseq { 123 wifi_pwrseq: wifi-pwrseq {
78 compatible = "mmc-pwrseq-simple"; 124 compatible = "mmc-pwrseq-simple";
79 clocks = <&ac100_rtc 1>; 125 clocks = <&ac100_rtc 1>;
@@ -83,13 +129,22 @@
83 }; 129 };
84}; 130};
85 131
132&de {
133 status = "okay";
134};
135
136&i2c3 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&i2c3_pins>;
139 status = "okay";
140};
141
86&mmc0 { 142&mmc0 {
87 pinctrl-names = "default"; 143 pinctrl-names = "default";
88 pinctrl-0 = <&mmc0_pins>; 144 pinctrl-0 = <&mmc0_pins>;
89 vmmc-supply = <&reg_dcdc1>; 145 vmmc-supply = <&reg_dcdc1>;
90 bus-width = <4>; 146 bus-width = <4>;
91 cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */ 147 cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH18 */
92 cd-inverted;
93 status = "okay"; 148 status = "okay";
94}; 149};
95 150
@@ -403,6 +458,18 @@
403 458
404#include "axp809.dtsi" 459#include "axp809.dtsi"
405 460
461&tcon0 {
462 pinctrl-names = "default";
463 pinctrl-0 = <&lcd0_rgb888_pins>;
464};
465
466&tcon0_out {
467 tcon0_out_vga: endpoint@0 {
468 reg = <0>;
469 remote-endpoint = <&vga_dac_in>;
470 };
471};
472
406&uart0 { 473&uart0 {
407 pinctrl-names = "default"; 474 pinctrl-names = "default";
408 pinctrl-0 = <&uart0_ph_pins>; 475 pinctrl-0 = <&uart0_ph_pins>;
diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index a9b807be99a0..58a199b0e494 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -125,8 +125,7 @@
125 pinctrl-0 = <&mmc0_pins>; 125 pinctrl-0 = <&mmc0_pins>;
126 vmmc-supply = <&reg_dcdc1>; 126 vmmc-supply = <&reg_dcdc1>;
127 bus-width = <4>; 127 bus-width = <4>;
128 cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH8 */ 128 cd-gpios = <&pio 7 18 GPIO_ACTIVE_LOW>; /* PH8 */
129 cd-inverted;
130 status = "okay"; 129 status = "okay";
131}; 130};
132 131
diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index 90eac0b2a193..25591d6883ef 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -63,48 +63,72 @@
63 cpu0: cpu@0 { 63 cpu0: cpu@0 {
64 compatible = "arm,cortex-a7"; 64 compatible = "arm,cortex-a7";
65 device_type = "cpu"; 65 device_type = "cpu";
66 cci-control-port = <&cci_control0>;
67 clock-frequency = <12000000>;
68 enable-method = "allwinner,sun9i-a80-smp";
66 reg = <0x0>; 69 reg = <0x0>;
67 }; 70 };
68 71
69 cpu1: cpu@1 { 72 cpu1: cpu@1 {
70 compatible = "arm,cortex-a7"; 73 compatible = "arm,cortex-a7";
71 device_type = "cpu"; 74 device_type = "cpu";
75 cci-control-port = <&cci_control0>;
76 clock-frequency = <12000000>;
77 enable-method = "allwinner,sun9i-a80-smp";
72 reg = <0x1>; 78 reg = <0x1>;
73 }; 79 };
74 80
75 cpu2: cpu@2 { 81 cpu2: cpu@2 {
76 compatible = "arm,cortex-a7"; 82 compatible = "arm,cortex-a7";
77 device_type = "cpu"; 83 device_type = "cpu";
84 cci-control-port = <&cci_control0>;
85 clock-frequency = <12000000>;
86 enable-method = "allwinner,sun9i-a80-smp";
78 reg = <0x2>; 87 reg = <0x2>;
79 }; 88 };
80 89
81 cpu3: cpu@3 { 90 cpu3: cpu@3 {
82 compatible = "arm,cortex-a7"; 91 compatible = "arm,cortex-a7";
83 device_type = "cpu"; 92 device_type = "cpu";
93 cci-control-port = <&cci_control0>;
94 clock-frequency = <12000000>;
95 enable-method = "allwinner,sun9i-a80-smp";
84 reg = <0x3>; 96 reg = <0x3>;
85 }; 97 };
86 98
87 cpu4: cpu@100 { 99 cpu4: cpu@100 {
88 compatible = "arm,cortex-a15"; 100 compatible = "arm,cortex-a15";
89 device_type = "cpu"; 101 device_type = "cpu";
102 cci-control-port = <&cci_control1>;
103 clock-frequency = <18000000>;
104 enable-method = "allwinner,sun9i-a80-smp";
90 reg = <0x100>; 105 reg = <0x100>;
91 }; 106 };
92 107
93 cpu5: cpu@101 { 108 cpu5: cpu@101 {
94 compatible = "arm,cortex-a15"; 109 compatible = "arm,cortex-a15";
95 device_type = "cpu"; 110 device_type = "cpu";
111 cci-control-port = <&cci_control1>;
112 clock-frequency = <18000000>;
113 enable-method = "allwinner,sun9i-a80-smp";
96 reg = <0x101>; 114 reg = <0x101>;
97 }; 115 };
98 116
99 cpu6: cpu@102 { 117 cpu6: cpu@102 {
100 compatible = "arm,cortex-a15"; 118 compatible = "arm,cortex-a15";
101 device_type = "cpu"; 119 device_type = "cpu";
120 cci-control-port = <&cci_control1>;
121 clock-frequency = <18000000>;
122 enable-method = "allwinner,sun9i-a80-smp";
102 reg = <0x102>; 123 reg = <0x102>;
103 }; 124 };
104 125
105 cpu7: cpu@103 { 126 cpu7: cpu@103 {
106 compatible = "arm,cortex-a15"; 127 compatible = "arm,cortex-a15";
107 device_type = "cpu"; 128 device_type = "cpu";
129 cci-control-port = <&cci_control1>;
130 clock-frequency = <18000000>;
131 enable-method = "allwinner,sun9i-a80-smp";
108 reg = <0x103>; 132 reg = <0x103>;
109 }; 133 };
110 }; 134 };
@@ -224,6 +248,12 @@
224 }; 248 };
225 }; 249 };
226 250
251 de: display-engine {
252 compatible = "allwinner,sun9i-a80-display-engine";
253 allwinner,pipelines = <&fe0>, <&fe1>;
254 status = "disabled";
255 };
256
227 soc { 257 soc {
228 compatible = "simple-bus"; 258 compatible = "simple-bus";
229 #address-cells = <1>; 259 #address-cells = <1>;
@@ -234,6 +264,25 @@
234 */ 264 */
235 ranges = <0 0 0 0x20000000>; 265 ranges = <0 0 0 0x20000000>;
236 266
267 sram_b: sram@20000 {
268 /* 256 KiB secure SRAM at 0x20000 */
269 compatible = "mmio-sram";
270 reg = <0x00020000 0x40000>;
271
272 #address-cells = <1>;
273 #size-cells = <1>;
274 ranges = <0 0x00020000 0x40000>;
275
276 smp-sram@1000 {
277 /*
278 * This is checked by BROM to determine if
279 * cpu0 should jump to SMP entry vector
280 */
281 compatible = "allwinner,sun9i-a80-smp-sram";
282 reg = <0x1000 0x8>;
283 };
284 };
285
237 ehci0: usb@a00000 { 286 ehci0: usb@a00000 {
238 compatible = "allwinner,sun9i-a80-ehci", "generic-ehci"; 287 compatible = "allwinner,sun9i-a80-ehci", "generic-ehci";
239 reg = <0x00a00000 0x100>; 288 reg = <0x00a00000 0x100>;
@@ -347,6 +396,11 @@
347 #reset-cells = <1>; 396 #reset-cells = <1>;
348 }; 397 };
349 398
399 cpucfg@1700000 {
400 compatible = "allwinner,sun9i-a80-cpucfg";
401 reg = <0x01700000 0x100>;
402 };
403
350 mmc0: mmc@1c0f000 { 404 mmc0: mmc@1c0f000 {
351 compatible = "allwinner,sun9i-a80-mmc"; 405 compatible = "allwinner,sun9i-a80-mmc";
352 reg = <0x01c0f000 0x1000>; 406 reg = <0x01c0f000 0x1000>;
@@ -431,6 +485,36 @@
431 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; 485 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
432 }; 486 };
433 487
488 cci: cci@1c90000 {
489 compatible = "arm,cci-400";
490 #address-cells = <1>;
491 #size-cells = <1>;
492 reg = <0x01c90000 0x1000>;
493 ranges = <0x0 0x01c90000 0x10000>;
494
495 cci_control0: slave-if@4000 {
496 compatible = "arm,cci-400-ctrl-if";
497 interface-type = "ace";
498 reg = <0x4000 0x1000>;
499 };
500
501 cci_control1: slave-if@5000 {
502 compatible = "arm,cci-400-ctrl-if";
503 interface-type = "ace";
504 reg = <0x5000 0x1000>;
505 };
506
507 pmu@9000 {
508 compatible = "arm,cci-400-pmu,r1";
509 reg = <0x9000 0x5000>;
510 interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
511 <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
512 <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
513 <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
514 <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
515 };
516 };
517
434 de_clocks: clock@3000000 { 518 de_clocks: clock@3000000 {
435 compatible = "allwinner,sun9i-a80-de-clks"; 519 compatible = "allwinner,sun9i-a80-de-clks";
436 reg = <0x03000000 0x30>; 520 reg = <0x03000000 0x30>;
@@ -445,6 +529,381 @@
445 #reset-cells = <1>; 529 #reset-cells = <1>;
446 }; 530 };
447 531
532 fe0: display-frontend@3100000 {
533 compatible = "allwinner,sun9i-a80-display-frontend";
534 reg = <0x03100000 0x40000>;
535 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
536 clocks = <&de_clocks CLK_BUS_FE0>, <&de_clocks CLK_FE0>,
537 <&de_clocks CLK_DRAM_FE0>;
538 clock-names = "ahb", "mod",
539 "ram";
540 resets = <&de_clocks RST_FE0>;
541
542 ports {
543 #address-cells = <1>;
544 #size-cells = <0>;
545
546 fe0_out: port@1 {
547 #address-cells = <1>;
548 #size-cells = <0>;
549 reg = <1>;
550
551 fe0_out_deu0: endpoint@0 {
552 reg = <0>;
553 remote-endpoint = <&deu0_in_fe0>;
554 };
555 };
556 };
557 };
558
559 fe1: display-frontend@3140000 {
560 compatible = "allwinner,sun9i-a80-display-frontend";
561 reg = <0x03140000 0x40000>;
562 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
563 clocks = <&de_clocks CLK_BUS_FE1>, <&de_clocks CLK_FE1>,
564 <&de_clocks CLK_DRAM_FE1>;
565 clock-names = "ahb", "mod",
566 "ram";
567 resets = <&de_clocks RST_FE0>;
568
569 ports {
570 #address-cells = <1>;
571 #size-cells = <0>;
572
573 fe1_out: port@1 {
574 #address-cells = <1>;
575 #size-cells = <0>;
576 reg = <1>;
577
578 fe1_out_deu1: endpoint@0 {
579 reg = <0>;
580 remote-endpoint = <&deu1_in_fe1>;
581 };
582 };
583 };
584 };
585
586 be0: display-backend@3200000 {
587 compatible = "allwinner,sun9i-a80-display-backend";
588 reg = <0x03200000 0x40000>;
589 interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
590 clocks = <&de_clocks CLK_BUS_BE0>, <&de_clocks CLK_BE0>,
591 <&de_clocks CLK_DRAM_BE0>;
592 clock-names = "ahb", "mod",
593 "ram";
594 resets = <&de_clocks RST_BE0>;
595
596 ports {
597 #address-cells = <1>;
598 #size-cells = <0>;
599
600 be0_in: port@0 {
601 #address-cells = <1>;
602 #size-cells = <0>;
603 reg = <0>;
604
605 be0_in_deu0: endpoint@0 {
606 reg = <0>;
607 remote-endpoint = <&deu0_out_be0>;
608 };
609
610 be0_in_deu1: endpoint@1 {
611 reg = <1>;
612 remote-endpoint = <&deu1_out_be0>;
613 };
614 };
615
616 be0_out: port@1 {
617 #address-cells = <1>;
618 #size-cells = <0>;
619 reg = <1>;
620
621 be0_out_drc0: endpoint@0 {
622 reg = <0>;
623 remote-endpoint = <&drc0_in_be0>;
624 };
625 };
626 };
627 };
628
629 be1: display-backend@3240000 {
630 compatible = "allwinner,sun9i-a80-display-backend";
631 reg = <0x03240000 0x40000>;
632 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
633 clocks = <&de_clocks CLK_BUS_BE1>, <&de_clocks CLK_BE1>,
634 <&de_clocks CLK_DRAM_BE1>;
635 clock-names = "ahb", "mod",
636 "ram";
637 resets = <&de_clocks RST_BE1>;
638
639 ports {
640 #address-cells = <1>;
641 #size-cells = <0>;
642
643 be1_in: port@0 {
644 #address-cells = <1>;
645 #size-cells = <0>;
646 reg = <0>;
647
648 be1_in_deu0: endpoint@0 {
649 reg = <0>;
650 remote-endpoint = <&deu0_out_be1>;
651 };
652
653 be1_in_deu1: endpoint@1 {
654 reg = <1>;
655 remote-endpoint = <&deu1_out_be1>;
656 };
657 };
658
659 be1_out: port@1 {
660 #address-cells = <1>;
661 #size-cells = <0>;
662 reg = <1>;
663
664 be1_out_drc1: endpoint@0 {
665 reg = <0>;
666 remote-endpoint = <&drc1_in_be1>;
667 };
668 };
669 };
670 };
671
672 deu0: deu@3300000 {
673 compatible = "allwinner,sun9i-a80-deu";
674 reg = <0x03300000 0x40000>;
675 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
676 clocks = <&de_clocks CLK_BUS_DEU0>,
677 <&de_clocks CLK_IEP_DEU0>,
678 <&de_clocks CLK_DRAM_DEU0>;
679 clock-names = "ahb",
680 "mod",
681 "ram";
682 resets = <&de_clocks RST_DEU0>;
683
684 ports {
685 #address-cells = <1>;
686 #size-cells = <0>;
687
688 deu0_in: port@0 {
689 #address-cells = <1>;
690 #size-cells = <0>;
691 reg = <0>;
692
693 deu0_in_fe0: endpoint@0 {
694 reg = <0>;
695 remote-endpoint = <&fe0_out_deu0>;
696 };
697 };
698
699 deu0_out: port@1 {
700 #address-cells = <1>;
701 #size-cells = <0>;
702 reg = <1>;
703
704 deu0_out_be0: endpoint@0 {
705 reg = <0>;
706 remote-endpoint = <&be0_in_deu0>;
707 };
708
709 deu0_out_be1: endpoint@1 {
710 reg = <1>;
711 remote-endpoint = <&be1_in_deu0>;
712 };
713 };
714 };
715 };
716
717 deu1: deu@3340000 {
718 compatible = "allwinner,sun9i-a80-deu";
719 reg = <0x03340000 0x40000>;
720 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
721 clocks = <&de_clocks CLK_BUS_DEU1>,
722 <&de_clocks CLK_IEP_DEU1>,
723 <&de_clocks CLK_DRAM_DEU1>;
724 clock-names = "ahb",
725 "mod",
726 "ram";
727 resets = <&de_clocks RST_DEU1>;
728
729 ports {
730 #address-cells = <1>;
731 #size-cells = <0>;
732
733 deu1_in: port@0 {
734 #address-cells = <1>;
735 #size-cells = <0>;
736 reg = <0>;
737
738 deu1_in_fe1: endpoint@0 {
739 reg = <0>;
740 remote-endpoint = <&fe1_out_deu1>;
741 };
742 };
743
744 deu1_out: port@1 {
745 #address-cells = <1>;
746 #size-cells = <0>;
747 reg = <1>;
748
749 deu1_out_be0: endpoint@0 {
750 reg = <0>;
751 remote-endpoint = <&be0_in_deu1>;
752 };
753
754 deu1_out_be1: endpoint@1 {
755 reg = <1>;
756 remote-endpoint = <&be1_in_deu1>;
757 };
758 };
759 };
760 };
761
762 drc0: drc@3400000 {
763 compatible = "allwinner,sun9i-a80-drc";
764 reg = <0x03400000 0x40000>;
765 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
766 clocks = <&de_clocks CLK_BUS_DRC0>,
767 <&de_clocks CLK_IEP_DRC0>,
768 <&de_clocks CLK_DRAM_DRC0>;
769 clock-names = "ahb",
770 "mod",
771 "ram";
772 resets = <&de_clocks RST_DRC0>;
773
774 ports {
775 #address-cells = <1>;
776 #size-cells = <0>;
777
778 drc0_in: port@0 {
779 #address-cells = <1>;
780 #size-cells = <0>;
781 reg = <0>;
782
783 drc0_in_be0: endpoint@0 {
784 reg = <0>;
785 remote-endpoint = <&be0_out_drc0>;
786 };
787 };
788
789 drc0_out: port@1 {
790 #address-cells = <1>;
791 #size-cells = <0>;
792 reg = <1>;
793
794 drc0_out_tcon0: endpoint@0 {
795 reg = <0>;
796 remote-endpoint = <&tcon0_in_drc0>;
797 };
798 };
799 };
800 };
801
802 drc1: drc@3440000 {
803 compatible = "allwinner,sun9i-a80-drc";
804 reg = <0x03440000 0x40000>;
805 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
806 clocks = <&de_clocks CLK_BUS_DRC1>,
807 <&de_clocks CLK_IEP_DRC1>,
808 <&de_clocks CLK_DRAM_DRC1>;
809 clock-names = "ahb",
810 "mod",
811 "ram";
812 resets = <&de_clocks RST_DRC1>;
813
814 ports {
815 #address-cells = <1>;
816 #size-cells = <0>;
817
818 drc1_in: port@0 {
819 #address-cells = <1>;
820 #size-cells = <0>;
821 reg = <0>;
822
823 drc1_in_be1: endpoint@0 {
824 reg = <0>;
825 remote-endpoint = <&be1_out_drc1>;
826 };
827 };
828
829 drc1_out: port@1 {
830 #address-cells = <1>;
831 #size-cells = <0>;
832 reg = <1>;
833
834 drc1_out_tcon1: endpoint@0 {
835 reg = <0>;
836 remote-endpoint = <&tcon1_in_drc1>;
837 };
838 };
839 };
840 };
841
842 tcon0: lcd-controller@3c00000 {
843 compatible = "allwinner,sun9i-a80-tcon-lcd";
844 reg = <0x03c00000 0x10000>;
845 interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
846 clocks = <&ccu CLK_BUS_LCD0>, <&ccu CLK_LCD0>;
847 clock-names = "ahb", "tcon-ch0";
848 resets = <&ccu RST_BUS_LCD0>, <&ccu RST_BUS_EDP>;
849 reset-names = "lcd", "edp";
850 clock-output-names = "tcon0-pixel-clock";
851
852 ports {
853 #address-cells = <1>;
854 #size-cells = <0>;
855
856 tcon0_in: port@0 {
857 #address-cells = <1>;
858 #size-cells = <0>;
859 reg = <0>;
860
861 tcon0_in_drc0: endpoint@0 {
862 reg = <0>;
863 remote-endpoint = <&drc0_out_tcon0>;
864 };
865 };
866
867 tcon0_out: port@1 {
868 #address-cells = <1>;
869 #size-cells = <0>;
870 reg = <1>;
871 };
872 };
873 };
874
875 tcon1: lcd-controller@3c10000 {
876 compatible = "allwinner,sun9i-a80-tcon-tv";
877 reg = <0x03c10000 0x10000>;
878 interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
879 clocks = <&ccu CLK_BUS_LCD1>, <&ccu CLK_LCD1>;
880 clock-names = "ahb", "tcon-ch1";
881 resets = <&ccu RST_BUS_LCD1>, <&ccu RST_BUS_EDP>;
882 reset-names = "lcd", "edp";
883
884 ports {
885 #address-cells = <1>;
886 #size-cells = <0>;
887
888 tcon1_in: port@0 {
889 #address-cells = <1>;
890 #size-cells = <0>;
891 reg = <0>;
892
893 tcon1_in_drc1: endpoint@0 {
894 reg = <0>;
895 remote-endpoint = <&drc1_out_tcon1>;
896 };
897 };
898
899 tcon1_out: port@1 {
900 #address-cells = <1>;
901 #size-cells = <0>;
902 reg = <1>;
903 };
904 };
905 };
906
448 ccu: clock@6000000 { 907 ccu: clock@6000000 {
449 compatible = "allwinner,sun9i-a80-ccu"; 908 compatible = "allwinner,sun9i-a80-ccu";
450 reg = <0x06000000 0x800>; 909 reg = <0x06000000 0x800>;
@@ -494,6 +953,17 @@
494 function = "i2c3"; 953 function = "i2c3";
495 }; 954 };
496 955
956 lcd0_rgb888_pins: lcd0-rgb888-pins {
957 pins = "PD0", "PD1", "PD2", "PD3",
958 "PD4", "PD5", "PD6", "PD7",
959 "PD8", "PD9", "PD10", "PD11",
960 "PD12", "PD13", "PD14", "PD15",
961 "PD16", "PD17", "PD18", "PD19",
962 "PD20", "PD21", "PD22", "PD23",
963 "PD24", "PD25", "PD26", "PD27";
964 function = "lcd0";
965 };
966
497 mmc0_pins: mmc0-pins { 967 mmc0_pins: mmc0-pins {
498 pins = "PF0", "PF1" ,"PF2", "PF3", 968 pins = "PF0", "PF1" ,"PF2", "PF3",
499 "PF4", "PF5"; 969 "PF4", "PF5";
@@ -658,6 +1128,11 @@
658 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 1128 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
659 }; 1129 };
660 1130
1131 prcm@8001400 {
1132 compatible = "allwinner,sun9i-a80-prcm";
1133 reg = <0x08001400 0x200>;
1134 };
1135
661 apbs_rst: reset@80014b0 { 1136 apbs_rst: reset@80014b0 {
662 reg = <0x080014b0 0x4>; 1137 reg = <0x080014b0 0x4>;
663 compatible = "allwinner,sun6i-a31-clock-reset"; 1138 compatible = "allwinner,sun6i-a31-clock-reset";
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index 7a83b15225c7..1be1a02d6df2 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -105,6 +105,12 @@
105 }; 105 };
106 }; 106 };
107 107
108 de: display-engine {
109 compatible = "allwinner,sun8i-h3-display-engine";
110 allwinner,pipelines = <&mixer0>;
111 status = "disabled";
112 };
113
108 soc { 114 soc {
109 compatible = "simple-bus"; 115 compatible = "simple-bus";
110 #address-cells = <1>; 116 #address-cells = <1>;
@@ -123,6 +129,29 @@
123 #reset-cells = <1>; 129 #reset-cells = <1>;
124 }; 130 };
125 131
132 mixer0: mixer@1100000 {
133 compatible = "allwinner,sun8i-h3-de2-mixer-0";
134 reg = <0x01100000 0x100000>;
135 clocks = <&display_clocks CLK_BUS_MIXER0>,
136 <&display_clocks CLK_MIXER0>;
137 clock-names = "bus",
138 "mod";
139 resets = <&display_clocks RST_MIXER0>;
140
141 ports {
142 #address-cells = <1>;
143 #size-cells = <0>;
144
145 mixer0_out: port@1 {
146 reg = <1>;
147
148 mixer0_out_tcon0: endpoint {
149 remote-endpoint = <&tcon0_in_mixer0>;
150 };
151 };
152 };
153 };
154
126 syscon: syscon@1c00000 { 155 syscon: syscon@1c00000 {
127 compatible = "allwinner,sun8i-h3-system-controller", 156 compatible = "allwinner,sun8i-h3-system-controller",
128 "syscon"; 157 "syscon";
@@ -138,9 +167,46 @@
138 #dma-cells = <1>; 167 #dma-cells = <1>;
139 }; 168 };
140 169
170 tcon0: lcd-controller@1c0c000 {
171 compatible = "allwinner,sun8i-h3-tcon-tv",
172 "allwinner,sun8i-a83t-tcon-tv";
173 reg = <0x01c0c000 0x1000>;
174 interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
175 clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>;
176 clock-names = "ahb", "tcon-ch1";
177 resets = <&ccu RST_BUS_TCON0>;
178 reset-names = "lcd";
179
180 ports {
181 #address-cells = <1>;
182 #size-cells = <0>;
183
184 tcon0_in: port@0 {
185 reg = <0>;
186
187 tcon0_in_mixer0: endpoint {
188 remote-endpoint = <&mixer0_out_tcon0>;
189 };
190 };
191
192 tcon0_out: port@1 {
193 #address-cells = <1>;
194 #size-cells = <0>;
195 reg = <1>;
196
197 tcon0_out_hdmi: endpoint@1 {
198 reg = <1>;
199 remote-endpoint = <&hdmi_in_tcon0>;
200 };
201 };
202 };
203 };
204
141 mmc0: mmc@1c0f000 { 205 mmc0: mmc@1c0f000 {
142 /* compatible and clocks are in per SoC .dtsi file */ 206 /* compatible and clocks are in per SoC .dtsi file */
143 reg = <0x01c0f000 0x1000>; 207 reg = <0x01c0f000 0x1000>;
208 pinctrl-names = "default";
209 pinctrl-0 = <&mmc0_pins>;
144 resets = <&ccu RST_BUS_MMC0>; 210 resets = <&ccu RST_BUS_MMC0>;
145 reset-names = "ahb"; 211 reset-names = "ahb";
146 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>; 212 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
@@ -152,6 +218,8 @@
152 mmc1: mmc@1c10000 { 218 mmc1: mmc@1c10000 {
153 /* compatible and clocks are in per SoC .dtsi file */ 219 /* compatible and clocks are in per SoC .dtsi file */
154 reg = <0x01c10000 0x1000>; 220 reg = <0x01c10000 0x1000>;
221 pinctrl-names = "default";
222 pinctrl-0 = <&mmc1_pins>;
155 resets = <&ccu RST_BUS_MMC1>; 223 resets = <&ccu RST_BUS_MMC1>;
156 reset-names = "ahb"; 224 reset-names = "ahb";
157 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; 225 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
@@ -348,7 +416,7 @@
348 function = "i2c2"; 416 function = "i2c2";
349 }; 417 };
350 418
351 mmc0_pins_a: mmc0 { 419 mmc0_pins: mmc0 {
352 pins = "PF0", "PF1", "PF2", "PF3", 420 pins = "PF0", "PF1", "PF2", "PF3",
353 "PF4", "PF5"; 421 "PF4", "PF5";
354 function = "mmc0"; 422 function = "mmc0";
@@ -356,13 +424,7 @@
356 bias-pull-up; 424 bias-pull-up;
357 }; 425 };
358 426
359 mmc0_cd_pin: mmc0_cd_pin { 427 mmc1_pins: mmc1 {
360 pins = "PF6";
361 function = "gpio_in";
362 bias-pull-up;
363 };
364
365 mmc1_pins_a: mmc1 {
366 pins = "PG0", "PG1", "PG2", "PG3", 428 pins = "PG0", "PG1", "PG2", "PG3",
367 "PG4", "PG5"; 429 "PG4", "PG5";
368 function = "mmc1"; 430 function = "mmc1";
@@ -684,6 +746,50 @@
684 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; 746 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
685 }; 747 };
686 748
749 hdmi: hdmi@1ee0000 {
750 compatible = "allwinner,sun8i-h3-dw-hdmi",
751 "allwinner,sun8i-a83t-dw-hdmi";
752 reg = <0x01ee0000 0x10000>;
753 reg-io-width = <1>;
754 interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
755 clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
756 <&ccu CLK_HDMI>;
757 clock-names = "iahb", "isfr", "tmds";
758 resets = <&ccu RST_BUS_HDMI1>;
759 reset-names = "ctrl";
760 phys = <&hdmi_phy>;
761 phy-names = "hdmi-phy";
762 status = "disabled";
763
764 ports {
765 #address-cells = <1>;
766 #size-cells = <0>;
767
768 hdmi_in: port@0 {
769 reg = <0>;
770
771 hdmi_in_tcon0: endpoint {
772 remote-endpoint = <&tcon0_out_hdmi>;
773 };
774 };
775
776 hdmi_out: port@1 {
777 reg = <1>;
778 };
779 };
780 };
781
782 hdmi_phy: hdmi-phy@1ef0000 {
783 compatible = "allwinner,sun8i-h3-hdmi-phy";
784 reg = <0x01ef0000 0x10000>;
785 clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
786 <&ccu 6>;
787 clock-names = "bus", "mod", "pll-0";
788 resets = <&ccu RST_BUS_HDMI0>;
789 reset-names = "phy";
790 #phy-cells = <0>;
791 };
792
687 rtc: rtc@1f00000 { 793 rtc: rtc@1f00000 {
688 compatible = "allwinner,sun6i-a31-rtc"; 794 compatible = "allwinner,sun6i-a31-rtc";
689 reg = <0x01f00000 0x54>; 795 reg = <0x01f00000 0x54>;
diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index acd6cf51b15b..eafff16765b4 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -780,7 +780,7 @@
780 compatible = "realtek,rt5640"; 780 compatible = "realtek,rt5640";
781 reg = <0x1c>; 781 reg = <0x1c>;
782 interrupt-parent = <&gpio>; 782 interrupt-parent = <&gpio>;
783 interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>; 783 interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_EDGE_FALLING>;
784 realtek,ldo1-en-gpios = 784 realtek,ldo1-en-gpios =
785 <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>; 785 <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
786 }; 786 };
diff --git a/arch/arm/boot/dts/tegra124-apalis-eval.dts b/arch/arm/boot/dts/tegra124-apalis-eval.dts
index ecffcd115fa7..a6ad759dddb4 100644
--- a/arch/arm/boot/dts/tegra124-apalis-eval.dts
+++ b/arch/arm/boot/dts/tegra124-apalis-eval.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2016 Toradex AG 2 * Copyright 2016-2018 Toradex AG
3 * 3 *
4 * This file is dual-licensed: you can use it either under the terms 4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual 5 * of the GPL or the X11 license, at your option. Note that this dual
@@ -105,7 +105,7 @@
105 */ 105 */
106 i2c@7000c000 { 106 i2c@7000c000 {
107 status = "okay"; 107 status = "okay";
108 clock-frequency = <100000>; 108 clock-frequency = <400000>;
109 109
110 pcie-switch@58 { 110 pcie-switch@58 {
111 compatible = "plx,pex8605"; 111 compatible = "plx,pex8605";
@@ -114,7 +114,7 @@
114 114
115 /* M41T0M6 real time clock on carrier board */ 115 /* M41T0M6 real time clock on carrier board */
116 rtc@68 { 116 rtc@68 {
117 compatible = "st,m41t00"; 117 compatible = "st,m41t0";
118 reg = <0x68>; 118 reg = <0x68>;
119 }; 119 };
120 }; 120 };
@@ -124,7 +124,6 @@
124 */ 124 */
125 hdmi_ddc: i2c@7000c400 { 125 hdmi_ddc: i2c@7000c400 {
126 status = "okay"; 126 status = "okay";
127 clock-frequency = <100000>;
128 }; 127 };
129 128
130 /* 129 /*
@@ -133,7 +132,7 @@
133 */ 132 */
134 i2c@7000c500 { 133 i2c@7000c500 {
135 status = "okay"; 134 status = "okay";
136 clock-frequency = <100000>; 135 clock-frequency = <400000>;
137 }; 136 };
138 137
139 /* I2C4 (DDC): unused */ 138 /* I2C4 (DDC): unused */
@@ -226,9 +225,7 @@
226 225
227 backlight: backlight { 226 backlight: backlight {
228 compatible = "pwm-backlight"; 227 compatible = "pwm-backlight";
229 228 pwms = <&pwm 3 5000000>; /* BKL1_PWM */
230 /* BKL1_PWM */
231 pwms = <&pwm 3 5000000>;
232 brightness-levels = <255 231 223 207 191 159 127 0>; 229 brightness-levels = <255 231 223 207 191 159 127 0>;
233 default-brightness-level = <6>; 230 default-brightness-level = <6>;
234 /* BKL1_ON */ 231 /* BKL1_ON */
@@ -276,3 +273,13 @@
276 vin-supply = <&reg_5v0>; 273 vin-supply = <&reg_5v0>;
277 }; 274 };
278}; 275};
276
277&gpio {
278 /* Apalis GPIO7 MXM3 pin 15 PLX PEX 8605 PCIe Switch Reset */
279 pex_perst_n {
280 gpio-hog;
281 gpios = <TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
282 output-high;
283 line-name = "PEX_PERST_N";
284 };
285};
diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts b/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
new file mode 100644
index 000000000000..8a8d5fa0ecd1
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
@@ -0,0 +1,250 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2016-2018 Toradex AG
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/input/input.h>
9#include "tegra124-apalis-v1.2.dtsi"
10
11/ {
12 model = "Toradex Apalis TK1 on Apalis Evaluation Board";
13 compatible = "toradex,apalis-tk1-v1.2-eval", "toradex,apalis-tk1-eval",
14 "toradex,apalis-tk1", "nvidia,tegra124";
15
16 aliases {
17 rtc0 = "/i2c@7000c000/rtc@68";
18 rtc1 = "/i2c@7000d000/pmic@40";
19 rtc2 = "/rtc@7000e000";
20 serial0 = &uarta;
21 serial1 = &uartb;
22 serial2 = &uartc;
23 serial3 = &uartd;
24 };
25
26 chosen {
27 stdout-path = "serial0:115200n8";
28 };
29
30 pcie@1003000 {
31 pci@1,0 {
32 status = "okay";
33 };
34 };
35
36 host1x@50000000 {
37 hdmi@54280000 {
38 status = "okay";
39 };
40 };
41
42 /* Apalis UART1 */
43 serial@70006000 {
44 status = "okay";
45 };
46
47 /* Apalis UART2 */
48 serial@70006040 {
49 status = "okay";
50 };
51
52 /* Apalis UART3 */
53 serial@70006200 {
54 status = "okay";
55 };
56
57 /* Apalis UART4 */
58 serial@70006300 {
59 status = "okay";
60 };
61
62 pwm@7000a000 {
63 status = "okay";
64 };
65
66 /*
67 * GEN1_I2C: I2C1_SDA/SCL on MXM3 pin 209/211 (e.g. RTC on carrier
68 * board)
69 */
70 i2c@7000c000 {
71 status = "okay";
72 clock-frequency = <400000>;
73
74 pcie-switch@58 {
75 compatible = "plx,pex8605";
76 reg = <0x58>;
77 };
78
79 /* M41T0M6 real time clock on carrier board */
80 rtc@68 {
81 compatible = "st,m41t0";
82 reg = <0x68>;
83 };
84 };
85
86 /* GEN2_I2C: unused */
87
88 /*
89 * CAM_I2C: I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor
90 * on carrier board)
91 */
92 i2c@7000c500 {
93 status = "okay";
94 clock-frequency = <400000>;
95 };
96
97 /*
98 * I2C4 (DDC): I2C4_SDA/SCL (DDC) on MXM3 pin 205/207
99 * (e.g. display EDID)
100 */
101 hdmi_ddc: i2c@7000c700 {
102 status = "okay";
103 };
104
105 /* SPI1: Apalis SPI1 */
106 spi@7000d400 {
107 status = "okay";
108 spi-max-frequency = <50000000>;
109
110 spidev0: spidev@0 {
111 compatible = "spidev";
112 reg = <0>;
113 spi-max-frequency = <50000000>;
114 };
115 };
116
117 /* SPI4: Apalis SPI2 */
118 spi@7000da00 {
119 status = "okay";
120 spi-max-frequency = <50000000>;
121
122 spidev1: spidev@0 {
123 compatible = "spidev";
124 reg = <0>;
125 spi-max-frequency = <50000000>;
126 };
127 };
128
129 /* Apalis Serial ATA */
130 sata@70020000 {
131 status = "okay";
132 };
133
134 hda@70030000 {
135 status = "okay";
136 };
137
138 usb@70090000 {
139 status = "okay";
140 };
141
142 /* Apalis MMC1 */
143 sdhci@700b0000 {
144 status = "okay";
145 /* MMC1_CD# */
146 cd-gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_LOW>;
147 bus-width = <4>;
148 vqmmc-supply = <&vddio_sdmmc1>;
149 };
150
151 /* Apalis SD1 */
152 sdhci@700b0400 {
153 status = "okay";
154 /* SD1_CD# */
155 cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
156 bus-width = <4>;
157 vqmmc-supply = <&vddio_sdmmc3>;
158 };
159
160 /* EHCI instance 0: USB1_DP/N -> USBO1_DP/N */
161 usb@7d000000 {
162 status = "okay";
163 dr_mode = "otg";
164 };
165
166 usb-phy@7d000000 {
167 status = "okay";
168 vbus-supply = <&reg_usbo1_vbus>;
169 };
170
171 /* EHCI instance 1: USB2_DP/N -> USBH2_DP/N */
172 usb@7d004000 {
173 status = "okay";
174 };
175
176 usb-phy@7d004000 {
177 status = "okay";
178 vbus-supply = <&reg_usbh_vbus>;
179 };
180
181 /* EHCI instance 2: USB3_DP/N -> USBH4_DP/N */
182 usb@7d008000 {
183 status = "okay";
184 };
185
186 usb-phy@7d008000 {
187 status = "okay";
188 vbus-supply = <&reg_usbh_vbus>;
189 };
190
191 backlight: backlight {
192 compatible = "pwm-backlight";
193 pwms = <&pwm 3 5000000>; /* BKL1_PWM */
194 brightness-levels = <255 231 223 207 191 159 127 0>;
195 default-brightness-level = <6>;
196 /* BKL1_ON */
197 enable-gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_HIGH>;
198 };
199
200 gpio-keys {
201 compatible = "gpio-keys";
202
203 wakeup {
204 label = "WAKE1_MICO";
205 gpios = <&gpio TEGRA_GPIO(DD, 3) GPIO_ACTIVE_LOW>;
206 linux,code = <KEY_WAKEUP>;
207 debounce-interval = <10>;
208 wakeup-source;
209 };
210 };
211
212 reg_5v0: regulator-5v0 {
213 compatible = "regulator-fixed";
214 regulator-name = "5V_SW";
215 regulator-min-microvolt = <5000000>;
216 regulator-max-microvolt = <5000000>;
217 };
218
219 /* USBO1_EN */
220 reg_usbo1_vbus: regulator-usbo1-vbus {
221 compatible = "regulator-fixed";
222 regulator-name = "VCC_USBO1";
223 regulator-min-microvolt = <5000000>;
224 regulator-max-microvolt = <5000000>;
225 gpio = <&gpio TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
226 enable-active-high;
227 vin-supply = <&reg_5v0>;
228 };
229
230 /* USBH_EN */
231 reg_usbh_vbus: regulator-usbh-vbus {
232 compatible = "regulator-fixed";
233 regulator-name = "VCC_USBH(2A|2C|2D|3|4)";
234 regulator-min-microvolt = <5000000>;
235 regulator-max-microvolt = <5000000>;
236 gpio = <&gpio TEGRA_GPIO(T, 6) GPIO_ACTIVE_HIGH>;
237 enable-active-high;
238 vin-supply = <&reg_5v0>;
239 };
240};
241
242&gpio {
243 /* Apalis GPIO7 MXM3 pin 15 PLX PEX 8605 PCIe Switch Reset */
244 pex_perst_n {
245 gpio-hog;
246 gpios = <TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
247 output-high;
248 line-name = "PEX_PERST_N";
249 };
250};
diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
new file mode 100644
index 000000000000..bb67edb016c5
--- /dev/null
+++ b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
@@ -0,0 +1,2052 @@
1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2016-2018 Toradex AG
4 */
5
6#include "tegra124.dtsi"
7#include "tegra124-apalis-emc.dtsi"
8
9/*
10 * Toradex Apalis TK1 Module Device Tree
11 * Compatible for Revisions 2GB: V1.2A
12 */
13/ {
14 model = "Toradex Apalis TK1";
15 compatible = "toradex,apalis-tk1-v1.2", "toradex,apalis-tk1",
16 "nvidia,tegra124";
17
18 memory {
19 reg = <0x0 0x80000000 0x0 0x80000000>;
20 };
21
22 pcie@1003000 {
23 status = "okay";
24 avddio-pex-supply = <&vdd_1v05>;
25 avdd-pex-pll-supply = <&vdd_1v05>;
26 avdd-pll-erefe-supply = <&avdd_1v05>;
27 dvddio-pex-supply = <&vdd_1v05>;
28 hvdd-pex-pll-e-supply = <&reg_3v3>;
29 hvdd-pex-supply = <&reg_3v3>;
30 vddio-pex-ctl-supply = <&reg_3v3>;
31
32 /* Apalis PCIe (additional lane Apalis type specific) */
33 pci@1,0 {
34 /* PCIE1_RX/TX and TS_DIFF1/2 */
35 phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-4}>,
36 <&{/padctl@7009f000/pads/pcie/lanes/pcie-3}>;
37 phy-names = "pcie-0", "pcie-1";
38 };
39
40 /* I210 Gigabit Ethernet Controller (On-module) */
41 pci@2,0 {
42 phys = <&{/padctl@7009f000/pads/pcie/lanes/pcie-2}>;
43 phy-names = "pcie-0";
44 status = "okay";
45 };
46 };
47
48 host1x@50000000 {
49 hdmi@54280000 {
50 pll-supply = <&reg_1v05_avdd_hdmi_pll>;
51 vdd-supply = <&reg_3v3_avdd_hdmi>;
52 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
53 nvidia,hpd-gpio =
54 <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
55 };
56 };
57
58 gpu@0,57000000 {
59 /*
60 * Node left disabled on purpose - the bootloader will enable
61 * it after having set the VPR up
62 */
63 vdd-supply = <&vdd_gpu>;
64 };
65
66 pinmux: pinmux@70000868 {
67 pinctrl-names = "default";
68 pinctrl-0 = <&state_default>;
69
70 state_default: pinmux {
71 /* Analogue Audio (On-module) */
72 dap3_fs_pp0 {
73 nvidia,pins = "dap3_fs_pp0";
74 nvidia,function = "i2s2";
75 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
76 nvidia,tristate = <TEGRA_PIN_DISABLE>;
77 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
78 };
79 dap3_din_pp1 {
80 nvidia,pins = "dap3_din_pp1";
81 nvidia,function = "i2s2";
82 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
83 nvidia,tristate = <TEGRA_PIN_ENABLE>;
84 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
85 };
86 dap3_dout_pp2 {
87 nvidia,pins = "dap3_dout_pp2";
88 nvidia,function = "i2s2";
89 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
90 nvidia,tristate = <TEGRA_PIN_DISABLE>;
91 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
92 };
93 dap3_sclk_pp3 {
94 nvidia,pins = "dap3_sclk_pp3";
95 nvidia,function = "i2s2";
96 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
97 nvidia,tristate = <TEGRA_PIN_DISABLE>;
98 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
99 };
100 dap_mclk1_pw4 {
101 nvidia,pins = "dap_mclk1_pw4";
102 nvidia,function = "extperiph1";
103 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
104 nvidia,tristate = <TEGRA_PIN_DISABLE>;
105 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
106 };
107
108 /* Apalis BKL1_ON */
109 pbb5 {
110 nvidia,pins = "pbb5";
111 nvidia,function = "vgp5";
112 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
113 nvidia,tristate = <TEGRA_PIN_DISABLE>;
114 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
115 };
116
117 /* Apalis BKL1_PWM */
118 pu6 {
119 nvidia,pins = "pu6";
120 nvidia,function = "pwm3";
121 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
122 nvidia,tristate = <TEGRA_PIN_DISABLE>;
123 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
124 };
125
126 /* Apalis CAM1_MCLK */
127 cam_mclk_pcc0 {
128 nvidia,pins = "cam_mclk_pcc0";
129 nvidia,function = "vi_alt3";
130 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
131 nvidia,tristate = <TEGRA_PIN_DISABLE>;
132 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
133 };
134
135 /* Apalis Digital Audio */
136 dap2_fs_pa2 {
137 nvidia,pins = "dap2_fs_pa2";
138 nvidia,function = "hda";
139 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
140 nvidia,tristate = <TEGRA_PIN_DISABLE>;
141 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
142 };
143 dap2_sclk_pa3 {
144 nvidia,pins = "dap2_sclk_pa3";
145 nvidia,function = "hda";
146 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
147 nvidia,tristate = <TEGRA_PIN_DISABLE>;
148 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
149 };
150 dap2_din_pa4 {
151 nvidia,pins = "dap2_din_pa4";
152 nvidia,function = "hda";
153 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
154 nvidia,tristate = <TEGRA_PIN_ENABLE>;
155 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
156 };
157 dap2_dout_pa5 {
158 nvidia,pins = "dap2_dout_pa5";
159 nvidia,function = "hda";
160 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
161 nvidia,tristate = <TEGRA_PIN_DISABLE>;
162 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
163 };
164 pbb3 { /* DAP1_RESET */
165 nvidia,pins = "pbb3";
166 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
167 nvidia,tristate = <TEGRA_PIN_DISABLE>;
168 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
169 };
170 clk3_out_pee0 {
171 nvidia,pins = "clk3_out_pee0";
172 nvidia,function = "extperiph3";
173 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
174 nvidia,tristate = <TEGRA_PIN_DISABLE>;
175 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
176 };
177
178 /* Apalis GPIO */
179 usb_vbus_en0_pn4 {
180 nvidia,pins = "usb_vbus_en0_pn4";
181 nvidia,function = "rsvd2";
182 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
183 nvidia,tristate = <TEGRA_PIN_DISABLE>;
184 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
185 nvidia,open-drain = <TEGRA_PIN_DISABLE>;
186 };
187 usb_vbus_en1_pn5 {
188 nvidia,pins = "usb_vbus_en1_pn5";
189 nvidia,function = "rsvd2";
190 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
191 nvidia,tristate = <TEGRA_PIN_DISABLE>;
192 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
193 nvidia,open-drain = <TEGRA_PIN_DISABLE>;
194 };
195 pex_l0_rst_n_pdd1 {
196 nvidia,pins = "pex_l0_rst_n_pdd1";
197 nvidia,function = "rsvd2";
198 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
199 nvidia,tristate = <TEGRA_PIN_DISABLE>;
200 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
201 };
202 pex_l0_clkreq_n_pdd2 {
203 nvidia,pins = "pex_l0_clkreq_n_pdd2";
204 nvidia,function = "rsvd2";
205 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
206 nvidia,tristate = <TEGRA_PIN_DISABLE>;
207 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
208 };
209 pex_l1_rst_n_pdd5 {
210 nvidia,pins = "pex_l1_rst_n_pdd5";
211 nvidia,function = "rsvd2";
212 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
213 nvidia,tristate = <TEGRA_PIN_DISABLE>;
214 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
215 };
216 pex_l1_clkreq_n_pdd6 {
217 nvidia,pins = "pex_l1_clkreq_n_pdd6";
218 nvidia,function = "rsvd2";
219 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
220 nvidia,tristate = <TEGRA_PIN_DISABLE>;
221 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
222 };
223 dp_hpd_pff0 {
224 nvidia,pins = "dp_hpd_pff0";
225 nvidia,function = "dp";
226 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
227 nvidia,tristate = <TEGRA_PIN_DISABLE>;
228 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
229 };
230 pff2 {
231 nvidia,pins = "pff2";
232 nvidia,function = "rsvd2";
233 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
234 nvidia,tristate = <TEGRA_PIN_DISABLE>;
235 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
236 };
237 owr { /* PEX_L1_CLKREQ_N multiplexed GPIO6 */
238 nvidia,pins = "owr";
239 nvidia,function = "rsvd2";
240 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
241 nvidia,tristate = <TEGRA_PIN_ENABLE>;
242 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
243 nvidia,rcv-sel = <TEGRA_PIN_DISABLE>;
244 };
245
246 /* Apalis HDMI1_CEC */
247 hdmi_cec_pee3 {
248 nvidia,pins = "hdmi_cec_pee3";
249 nvidia,function = "cec";
250 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
251 nvidia,tristate = <TEGRA_PIN_DISABLE>;
252 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
253 nvidia,open-drain = <TEGRA_PIN_DISABLE>;
254 };
255
256 /* Apalis HDMI1_HPD */
257 hdmi_int_pn7 {
258 nvidia,pins = "hdmi_int_pn7";
259 nvidia,function = "rsvd1";
260 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
261 nvidia,tristate = <TEGRA_PIN_ENABLE>;
262 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
263 nvidia,rcv-sel = <TEGRA_PIN_DISABLE>;
264 };
265
266 /* Apalis I2C1 */
267 gen1_i2c_scl_pc4 {
268 nvidia,pins = "gen1_i2c_scl_pc4";
269 nvidia,function = "i2c1";
270 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
271 nvidia,tristate = <TEGRA_PIN_DISABLE>;
272 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
273 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
274 };
275 gen1_i2c_sda_pc5 {
276 nvidia,pins = "gen1_i2c_sda_pc5";
277 nvidia,function = "i2c1";
278 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
279 nvidia,tristate = <TEGRA_PIN_DISABLE>;
280 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
281 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
282 };
283
284 /* Apalis I2C3 (CAM) */
285 cam_i2c_scl_pbb1 {
286 nvidia,pins = "cam_i2c_scl_pbb1";
287 nvidia,function = "i2c3";
288 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
289 nvidia,tristate = <TEGRA_PIN_DISABLE>;
290 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
291 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
292 };
293 cam_i2c_sda_pbb2 {
294 nvidia,pins = "cam_i2c_sda_pbb2";
295 nvidia,function = "i2c3";
296 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
297 nvidia,tristate = <TEGRA_PIN_DISABLE>;
298 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
299 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
300 };
301
302 /* Apalis I2C4 (DDC) */
303 ddc_scl_pv4 {
304 nvidia,pins = "ddc_scl_pv4";
305 nvidia,function = "i2c4";
306 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
307 nvidia,tristate = <TEGRA_PIN_DISABLE>;
308 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
309 nvidia,rcv-sel = <TEGRA_PIN_ENABLE>;
310 };
311 ddc_sda_pv5 {
312 nvidia,pins = "ddc_sda_pv5";
313 nvidia,function = "i2c4";
314 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
315 nvidia,tristate = <TEGRA_PIN_DISABLE>;
316 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
317 nvidia,rcv-sel = <TEGRA_PIN_ENABLE>;
318 };
319
320 /* Apalis MMC1 */
321 sdmmc1_cd_n_pv3 { /* CD# GPIO */
322 nvidia,pins = "sdmmc1_wp_n_pv3";
323 nvidia,function = "sdmmc1";
324 nvidia,pull = <TEGRA_PIN_PULL_UP>;
325 nvidia,tristate = <TEGRA_PIN_ENABLE>;
326 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
327 };
328 clk2_out_pw5 { /* D5 GPIO */
329 nvidia,pins = "clk2_out_pw5";
330 nvidia,function = "rsvd2";
331 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
332 nvidia,tristate = <TEGRA_PIN_DISABLE>;
333 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
334 };
335 sdmmc1_dat3_py4 {
336 nvidia,pins = "sdmmc1_dat3_py4";
337 nvidia,function = "sdmmc1";
338 nvidia,pull = <TEGRA_PIN_PULL_UP>;
339 nvidia,tristate = <TEGRA_PIN_DISABLE>;
340 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
341 };
342 sdmmc1_dat2_py5 {
343 nvidia,pins = "sdmmc1_dat2_py5";
344 nvidia,function = "sdmmc1";
345 nvidia,pull = <TEGRA_PIN_PULL_UP>;
346 nvidia,tristate = <TEGRA_PIN_DISABLE>;
347 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
348 };
349 sdmmc1_dat1_py6 {
350 nvidia,pins = "sdmmc1_dat1_py6";
351 nvidia,function = "sdmmc1";
352 nvidia,pull = <TEGRA_PIN_PULL_UP>;
353 nvidia,tristate = <TEGRA_PIN_DISABLE>;
354 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
355 };
356 sdmmc1_dat0_py7 {
357 nvidia,pins = "sdmmc1_dat0_py7";
358 nvidia,function = "sdmmc1";
359 nvidia,pull = <TEGRA_PIN_PULL_UP>;
360 nvidia,tristate = <TEGRA_PIN_DISABLE>;
361 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
362 };
363 sdmmc1_clk_pz0 {
364 nvidia,pins = "sdmmc1_clk_pz0";
365 nvidia,function = "sdmmc1";
366 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
367 nvidia,tristate = <TEGRA_PIN_DISABLE>;
368 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
369 };
370 sdmmc1_cmd_pz1 {
371 nvidia,pins = "sdmmc1_cmd_pz1";
372 nvidia,function = "sdmmc1";
373 nvidia,pull = <TEGRA_PIN_PULL_UP>;
374 nvidia,tristate = <TEGRA_PIN_DISABLE>;
375 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
376 };
377 clk2_req_pcc5 { /* D4 GPIO */
378 nvidia,pins = "clk2_req_pcc5";
379 nvidia,function = "rsvd2";
380 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
381 nvidia,tristate = <TEGRA_PIN_DISABLE>;
382 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
383 };
384 sdmmc3_clk_lb_in_pee5 { /* D6 GPIO */
385 nvidia,pins = "sdmmc3_clk_lb_in_pee5";
386 nvidia,function = "rsvd2";
387 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
388 nvidia,tristate = <TEGRA_PIN_DISABLE>;
389 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
390 };
391 usb_vbus_en2_pff1 { /* D7 GPIO */
392 nvidia,pins = "usb_vbus_en2_pff1";
393 nvidia,function = "rsvd2";
394 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
395 nvidia,tristate = <TEGRA_PIN_DISABLE>;
396 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
397 };
398
399 /* Apalis PWM */
400 ph0 {
401 nvidia,pins = "ph0";
402 nvidia,function = "pwm0";
403 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
404 nvidia,tristate = <TEGRA_PIN_DISABLE>;
405 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
406 };
407 ph1 {
408 nvidia,pins = "ph1";
409 nvidia,function = "pwm1";
410 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
411 nvidia,tristate = <TEGRA_PIN_DISABLE>;
412 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
413 };
414 ph2 {
415 nvidia,pins = "ph2";
416 nvidia,function = "pwm2";
417 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
418 nvidia,tristate = <TEGRA_PIN_DISABLE>;
419 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
420 };
421 /* PWM3 active on pu6 being Apalis BKL1_PWM as well */
422 ph3 {
423 nvidia,pins = "ph3";
424 nvidia,function = "pwm3";
425 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
426 nvidia,tristate = <TEGRA_PIN_DISABLE>;
427 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
428 };
429
430 /* Apalis SATA1_ACT# */
431 dap1_dout_pn2 {
432 nvidia,pins = "dap1_dout_pn2";
433 nvidia,function = "gmi";
434 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
435 nvidia,tristate = <TEGRA_PIN_DISABLE>;
436 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
437 };
438
439 /* Apalis SD1 */
440 sdmmc3_clk_pa6 {
441 nvidia,pins = "sdmmc3_clk_pa6";
442 nvidia,function = "sdmmc3";
443 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
444 nvidia,tristate = <TEGRA_PIN_DISABLE>;
445 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
446 };
447 sdmmc3_cmd_pa7 {
448 nvidia,pins = "sdmmc3_cmd_pa7";
449 nvidia,function = "sdmmc3";
450 nvidia,pull = <TEGRA_PIN_PULL_UP>;
451 nvidia,tristate = <TEGRA_PIN_DISABLE>;
452 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
453 };
454 sdmmc3_dat3_pb4 {
455 nvidia,pins = "sdmmc3_dat3_pb4";
456 nvidia,function = "sdmmc3";
457 nvidia,pull = <TEGRA_PIN_PULL_UP>;
458 nvidia,tristate = <TEGRA_PIN_DISABLE>;
459 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
460 };
461 sdmmc3_dat2_pb5 {
462 nvidia,pins = "sdmmc3_dat2_pb5";
463 nvidia,function = "sdmmc3";
464 nvidia,pull = <TEGRA_PIN_PULL_UP>;
465 nvidia,tristate = <TEGRA_PIN_DISABLE>;
466 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
467 };
468 sdmmc3_dat1_pb6 {
469 nvidia,pins = "sdmmc3_dat1_pb6";
470 nvidia,function = "sdmmc3";
471 nvidia,pull = <TEGRA_PIN_PULL_UP>;
472 nvidia,tristate = <TEGRA_PIN_DISABLE>;
473 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
474 };
475 sdmmc3_dat0_pb7 {
476 nvidia,pins = "sdmmc3_dat0_pb7";
477 nvidia,function = "sdmmc3";
478 nvidia,pull = <TEGRA_PIN_PULL_UP>;
479 nvidia,tristate = <TEGRA_PIN_DISABLE>;
480 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
481 };
482 sdmmc3_cd_n_pv2 { /* CD# GPIO */
483 nvidia,pins = "sdmmc3_cd_n_pv2";
484 nvidia,function = "rsvd3";
485 nvidia,pull = <TEGRA_PIN_PULL_UP>;
486 nvidia,tristate = <TEGRA_PIN_ENABLE>;
487 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
488 };
489
490 /* Apalis SPDIF */
491 spdif_out_pk5 {
492 nvidia,pins = "spdif_out_pk5";
493 nvidia,function = "spdif";
494 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
495 nvidia,tristate = <TEGRA_PIN_DISABLE>;
496 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
497 };
498 spdif_in_pk6 {
499 nvidia,pins = "spdif_in_pk6";
500 nvidia,function = "spdif";
501 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
502 nvidia,tristate = <TEGRA_PIN_ENABLE>;
503 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
504 };
505
506 /* Apalis SPI1 */
507 ulpi_clk_py0 {
508 nvidia,pins = "ulpi_clk_py0";
509 nvidia,function = "spi1";
510 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
511 nvidia,tristate = <TEGRA_PIN_DISABLE>;
512 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
513 };
514 ulpi_dir_py1 {
515 nvidia,pins = "ulpi_dir_py1";
516 nvidia,function = "spi1";
517 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
518 nvidia,tristate = <TEGRA_PIN_ENABLE>;
519 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
520 };
521 ulpi_nxt_py2 {
522 nvidia,pins = "ulpi_nxt_py2";
523 nvidia,function = "spi1";
524 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
525 nvidia,tristate = <TEGRA_PIN_DISABLE>;
526 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
527 };
528 ulpi_stp_py3 {
529 nvidia,pins = "ulpi_stp_py3";
530 nvidia,function = "spi1";
531 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
532 nvidia,tristate = <TEGRA_PIN_DISABLE>;
533 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
534 };
535
536 /* Apalis SPI2 */
537 pg5 {
538 nvidia,pins = "pg5";
539 nvidia,function = "spi4";
540 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
541 nvidia,tristate = <TEGRA_PIN_DISABLE>;
542 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
543 };
544 pg6 {
545 nvidia,pins = "pg6";
546 nvidia,function = "spi4";
547 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
548 nvidia,tristate = <TEGRA_PIN_DISABLE>;
549 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
550 };
551 pg7 {
552 nvidia,pins = "pg7";
553 nvidia,function = "spi4";
554 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
555 nvidia,tristate = <TEGRA_PIN_ENABLE>;
556 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
557 };
558 pi3 {
559 nvidia,pins = "pi3";
560 nvidia,function = "spi4";
561 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
562 nvidia,tristate = <TEGRA_PIN_DISABLE>;
563 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
564 };
565
566 /* Apalis UART1 */
567 pb1 { /* DCD GPIO */
568 nvidia,pins = "pb1";
569 nvidia,function = "rsvd2";
570 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
571 nvidia,tristate = <TEGRA_PIN_ENABLE>;
572 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
573 };
574 pk7 { /* RI GPIO */
575 nvidia,pins = "pk7";
576 nvidia,function = "rsvd2";
577 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
578 nvidia,tristate = <TEGRA_PIN_ENABLE>;
579 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
580 };
581 uart1_txd_pu0 {
582 nvidia,pins = "pu0";
583 nvidia,function = "uarta";
584 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
585 nvidia,tristate = <TEGRA_PIN_DISABLE>;
586 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
587 };
588 uart1_rxd_pu1 {
589 nvidia,pins = "pu1";
590 nvidia,function = "uarta";
591 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
592 nvidia,tristate = <TEGRA_PIN_ENABLE>;
593 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
594 };
595 uart1_cts_n_pu2 {
596 nvidia,pins = "pu2";
597 nvidia,function = "uarta";
598 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
599 nvidia,tristate = <TEGRA_PIN_ENABLE>;
600 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
601 };
602 uart1_rts_n_pu3 {
603 nvidia,pins = "pu3";
604 nvidia,function = "uarta";
605 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
606 nvidia,tristate = <TEGRA_PIN_DISABLE>;
607 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
608 };
609 uart3_cts_n_pa1 { /* DSR GPIO */
610 nvidia,pins = "uart3_cts_n_pa1";
611 nvidia,function = "gmi";
612 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
613 nvidia,tristate = <TEGRA_PIN_ENABLE>;
614 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
615 };
616 uart3_rts_n_pc0 { /* DTR GPIO */
617 nvidia,pins = "uart3_rts_n_pc0";
618 nvidia,function = "gmi";
619 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
620 nvidia,tristate = <TEGRA_PIN_DISABLE>;
621 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
622 };
623
624 /* Apalis UART2 */
625 uart2_txd_pc2 {
626 nvidia,pins = "uart2_txd_pc2";
627 nvidia,function = "irda";
628 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
629 nvidia,tristate = <TEGRA_PIN_DISABLE>;
630 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
631 };
632 uart2_rxd_pc3 {
633 nvidia,pins = "uart2_rxd_pc3";
634 nvidia,function = "irda";
635 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
636 nvidia,tristate = <TEGRA_PIN_ENABLE>;
637 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
638 };
639 uart2_cts_n_pj5 {
640 nvidia,pins = "uart2_cts_n_pj5";
641 nvidia,function = "uartb";
642 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
643 nvidia,tristate = <TEGRA_PIN_ENABLE>;
644 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
645 };
646 uart2_rts_n_pj6 {
647 nvidia,pins = "uart2_rts_n_pj6";
648 nvidia,function = "uartb";
649 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
650 nvidia,tristate = <TEGRA_PIN_DISABLE>;
651 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
652 };
653
654 /* Apalis UART3 */
655 uart3_txd_pw6 {
656 nvidia,pins = "uart3_txd_pw6";
657 nvidia,function = "uartc";
658 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
659 nvidia,tristate = <TEGRA_PIN_DISABLE>;
660 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
661 };
662 uart3_rxd_pw7 {
663 nvidia,pins = "uart3_rxd_pw7";
664 nvidia,function = "uartc";
665 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
666 nvidia,tristate = <TEGRA_PIN_ENABLE>;
667 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
668 };
669
670 /* Apalis UART4 */
671 uart4_rxd_pb0 {
672 nvidia,pins = "pb0";
673 nvidia,function = "uartd";
674 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
675 nvidia,tristate = <TEGRA_PIN_ENABLE>;
676 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
677 };
678 uart4_txd_pj7 {
679 nvidia,pins = "pj7";
680 nvidia,function = "uartd";
681 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
682 nvidia,tristate = <TEGRA_PIN_DISABLE>;
683 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
684 };
685
686 /* Apalis USBH_EN */
687 gen2_i2c_sda_pt6 {
688 nvidia,pins = "gen2_i2c_sda_pt6";
689 nvidia,function = "rsvd2";
690 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
691 nvidia,tristate = <TEGRA_PIN_DISABLE>;
692 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
693 nvidia,open-drain = <TEGRA_PIN_DISABLE>;
694 };
695
696 /* Apalis USBH_OC# */
697 pbb0 {
698 nvidia,pins = "pbb0";
699 nvidia,function = "vgp6";
700 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
701 nvidia,tristate = <TEGRA_PIN_ENABLE>;
702 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
703 };
704
705 /* Apalis USBO1_EN */
706 gen2_i2c_scl_pt5 {
707 nvidia,pins = "gen2_i2c_scl_pt5";
708 nvidia,function = "rsvd2";
709 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
710 nvidia,tristate = <TEGRA_PIN_DISABLE>;
711 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
712 nvidia,open-drain = <TEGRA_PIN_DISABLE>;
713 };
714
715 /* Apalis USBO1_OC# */
716 pbb4 {
717 nvidia,pins = "pbb4";
718 nvidia,function = "vgp4";
719 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
720 nvidia,tristate = <TEGRA_PIN_ENABLE>;
721 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
722 };
723
724 /* Apalis WAKE1_MICO */
725 pex_wake_n_pdd3 {
726 nvidia,pins = "pex_wake_n_pdd3";
727 nvidia,function = "rsvd2";
728 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
729 nvidia,tristate = <TEGRA_PIN_ENABLE>;
730 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
731 };
732
733 /* CORE_PWR_REQ */
734 core_pwr_req {
735 nvidia,pins = "core_pwr_req";
736 nvidia,function = "pwron";
737 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
738 nvidia,tristate = <TEGRA_PIN_DISABLE>;
739 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
740 };
741
742 /* CPU_PWR_REQ */
743 cpu_pwr_req {
744 nvidia,pins = "cpu_pwr_req";
745 nvidia,function = "cpu";
746 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
747 nvidia,tristate = <TEGRA_PIN_DISABLE>;
748 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
749 };
750
751 /* DVFS */
752 dvfs_pwm_px0 {
753 nvidia,pins = "dvfs_pwm_px0";
754 nvidia,function = "cldvfs";
755 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
756 nvidia,tristate = <TEGRA_PIN_DISABLE>;
757 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
758 };
759 dvfs_clk_px2 {
760 nvidia,pins = "dvfs_clk_px2";
761 nvidia,function = "cldvfs";
762 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
763 nvidia,tristate = <TEGRA_PIN_DISABLE>;
764 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
765 };
766
767 /* eMMC */
768 sdmmc4_dat0_paa0 {
769 nvidia,pins = "sdmmc4_dat0_paa0";
770 nvidia,function = "sdmmc4";
771 nvidia,pull = <TEGRA_PIN_PULL_UP>;
772 nvidia,tristate = <TEGRA_PIN_DISABLE>;
773 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
774 };
775 sdmmc4_dat1_paa1 {
776 nvidia,pins = "sdmmc4_dat1_paa1";
777 nvidia,function = "sdmmc4";
778 nvidia,pull = <TEGRA_PIN_PULL_UP>;
779 nvidia,tristate = <TEGRA_PIN_DISABLE>;
780 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
781 };
782 sdmmc4_dat2_paa2 {
783 nvidia,pins = "sdmmc4_dat2_paa2";
784 nvidia,function = "sdmmc4";
785 nvidia,pull = <TEGRA_PIN_PULL_UP>;
786 nvidia,tristate = <TEGRA_PIN_DISABLE>;
787 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
788 };
789 sdmmc4_dat3_paa3 {
790 nvidia,pins = "sdmmc4_dat3_paa3";
791 nvidia,function = "sdmmc4";
792 nvidia,pull = <TEGRA_PIN_PULL_UP>;
793 nvidia,tristate = <TEGRA_PIN_DISABLE>;
794 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
795 };
796 sdmmc4_dat4_paa4 {
797 nvidia,pins = "sdmmc4_dat4_paa4";
798 nvidia,function = "sdmmc4";
799 nvidia,pull = <TEGRA_PIN_PULL_UP>;
800 nvidia,tristate = <TEGRA_PIN_DISABLE>;
801 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
802 };
803 sdmmc4_dat5_paa5 {
804 nvidia,pins = "sdmmc4_dat5_paa5";
805 nvidia,function = "sdmmc4";
806 nvidia,pull = <TEGRA_PIN_PULL_UP>;
807 nvidia,tristate = <TEGRA_PIN_DISABLE>;
808 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
809 };
810 sdmmc4_dat6_paa6 {
811 nvidia,pins = "sdmmc4_dat6_paa6";
812 nvidia,function = "sdmmc4";
813 nvidia,pull = <TEGRA_PIN_PULL_UP>;
814 nvidia,tristate = <TEGRA_PIN_DISABLE>;
815 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
816 };
817 sdmmc4_dat7_paa7 {
818 nvidia,pins = "sdmmc4_dat7_paa7";
819 nvidia,function = "sdmmc4";
820 nvidia,pull = <TEGRA_PIN_PULL_UP>;
821 nvidia,tristate = <TEGRA_PIN_DISABLE>;
822 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
823 };
824 sdmmc4_clk_pcc4 {
825 nvidia,pins = "sdmmc4_clk_pcc4";
826 nvidia,function = "sdmmc4";
827 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
828 nvidia,tristate = <TEGRA_PIN_DISABLE>;
829 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
830 };
831 sdmmc4_cmd_pt7 {
832 nvidia,pins = "sdmmc4_cmd_pt7";
833 nvidia,function = "sdmmc4";
834 nvidia,pull = <TEGRA_PIN_PULL_UP>;
835 nvidia,tristate = <TEGRA_PIN_DISABLE>;
836 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
837 };
838
839 /* JTAG_RTCK */
840 jtag_rtck {
841 nvidia,pins = "jtag_rtck";
842 nvidia,function = "rtck";
843 nvidia,pull = <TEGRA_PIN_PULL_UP>;
844 nvidia,tristate = <TEGRA_PIN_DISABLE>;
845 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
846 };
847
848 /* LAN_DEV_OFF# */
849 ulpi_data5_po6 {
850 nvidia,pins = "ulpi_data5_po6";
851 nvidia,function = "ulpi";
852 nvidia,pull = <TEGRA_PIN_PULL_UP>;
853 nvidia,tristate = <TEGRA_PIN_DISABLE>;
854 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
855 };
856
857 /* LAN_RESET# */
858 kb_row10_ps2 {
859 nvidia,pins = "kb_row10_ps2";
860 nvidia,function = "rsvd2";
861 nvidia,pull = <TEGRA_PIN_PULL_UP>;
862 nvidia,tristate = <TEGRA_PIN_DISABLE>;
863 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
864 };
865
866 /* LAN_WAKE# */
867 ulpi_data4_po5 {
868 nvidia,pins = "ulpi_data4_po5";
869 nvidia,function = "ulpi";
870 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
871 nvidia,tristate = <TEGRA_PIN_ENABLE>;
872 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
873 };
874
875 /* MCU_INT1# */
876 pk2 {
877 nvidia,pins = "pk2";
878 nvidia,function = "rsvd1";
879 nvidia,pull = <TEGRA_PIN_PULL_UP>;
880 nvidia,tristate = <TEGRA_PIN_ENABLE>;
881 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
882 };
883
884 /* MCU_INT2# */
885 pj2 {
886 nvidia,pins = "pj2";
887 nvidia,function = "rsvd1";
888 nvidia,pull = <TEGRA_PIN_PULL_UP>;
889 nvidia,tristate = <TEGRA_PIN_ENABLE>;
890 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
891 };
892
893 /* MCU_INT3# */
894 pi5 {
895 nvidia,pins = "pi5";
896 nvidia,function = "rsvd2";
897 nvidia,pull = <TEGRA_PIN_PULL_UP>;
898 nvidia,tristate = <TEGRA_PIN_ENABLE>;
899 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
900 };
901
902 /* MCU_INT4# */
903 pj0 {
904 nvidia,pins = "pj0";
905 nvidia,function = "rsvd1";
906 nvidia,pull = <TEGRA_PIN_PULL_UP>;
907 nvidia,tristate = <TEGRA_PIN_ENABLE>;
908 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
909 };
910
911 /* MCU_RESET */
912 pbb6 {
913 nvidia,pins = "pbb6";
914 nvidia,function = "rsvd2";
915 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
916 nvidia,tristate = <TEGRA_PIN_DISABLE>;
917 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
918 };
919
920 /* MCU SPI */
921 gpio_x4_aud_px4 {
922 nvidia,pins = "gpio_x4_aud_px4";
923 nvidia,function = "spi2";
924 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
925 nvidia,tristate = <TEGRA_PIN_DISABLE>;
926 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
927 };
928 gpio_x5_aud_px5 {
929 nvidia,pins = "gpio_x5_aud_px5";
930 nvidia,function = "spi2";
931 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
932 nvidia,tristate = <TEGRA_PIN_DISABLE>;
933 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
934 };
935 gpio_x6_aud_px6 { /* MCU_CS */
936 nvidia,pins = "gpio_x6_aud_px6";
937 nvidia,function = "spi2";
938 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
939 nvidia,tristate = <TEGRA_PIN_DISABLE>;
940 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
941 };
942 gpio_x7_aud_px7 {
943 nvidia,pins = "gpio_x7_aud_px7";
944 nvidia,function = "spi2";
945 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
946 nvidia,tristate = <TEGRA_PIN_ENABLE>;
947 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
948 };
949 gpio_w2_aud_pw2 { /* MCU_CSEZP */
950 nvidia,pins = "gpio_w2_aud_pw2";
951 nvidia,function = "spi2";
952 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
953 nvidia,tristate = <TEGRA_PIN_DISABLE>;
954 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
955 };
956
957 /* PMIC_CLK_32K */
958 clk_32k_in {
959 nvidia,pins = "clk_32k_in";
960 nvidia,function = "clk";
961 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
962 nvidia,tristate = <TEGRA_PIN_ENABLE>;
963 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
964 };
965
966 /* PMIC_CPU_OC_INT */
967 clk_32k_out_pa0 {
968 nvidia,pins = "clk_32k_out_pa0";
969 nvidia,function = "soc";
970 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
971 nvidia,tristate = <TEGRA_PIN_ENABLE>;
972 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
973 };
974
975 /* PWR_I2C */
976 pwr_i2c_scl_pz6 {
977 nvidia,pins = "pwr_i2c_scl_pz6";
978 nvidia,function = "i2cpwr";
979 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
980 nvidia,tristate = <TEGRA_PIN_DISABLE>;
981 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
982 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
983 };
984 pwr_i2c_sda_pz7 {
985 nvidia,pins = "pwr_i2c_sda_pz7";
986 nvidia,function = "i2cpwr";
987 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
988 nvidia,tristate = <TEGRA_PIN_DISABLE>;
989 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
990 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
991 };
992
993 /* PWR_INT_N */
994 pwr_int_n {
995 nvidia,pins = "pwr_int_n";
996 nvidia,function = "pmi";
997 nvidia,pull = <TEGRA_PIN_PULL_UP>;
998 nvidia,tristate = <TEGRA_PIN_ENABLE>;
999 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1000 };
1001
1002 /* RESET_MOCI_CTRL */
1003 pu4 {
1004 nvidia,pins = "pu4";
1005 nvidia,function = "gmi";
1006 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1007 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1008 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1009 };
1010
1011 /* RESET_OUT_N */
1012 reset_out_n {
1013 nvidia,pins = "reset_out_n";
1014 nvidia,function = "reset_out_n";
1015 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1016 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1017 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1018 };
1019
1020 /* SHIFT_CTRL_DIR_IN */
1021 kb_row0_pr0 {
1022 nvidia,pins = "kb_row0_pr0";
1023 nvidia,function = "rsvd2";
1024 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1025 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1026 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1027 };
1028 kb_row1_pr1 {
1029 nvidia,pins = "kb_row1_pr1";
1030 nvidia,function = "rsvd2";
1031 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1032 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1033 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1034 };
1035
1036 /* Configure level-shifter as output for HDA */
1037 kb_row11_ps3 {
1038 nvidia,pins = "kb_row11_ps3";
1039 nvidia,function = "rsvd2";
1040 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1041 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1042 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1043 };
1044
1045 /* SHIFT_CTRL_DIR_OUT */
1046 kb_col5_pq5 {
1047 nvidia,pins = "kb_col5_pq5";
1048 nvidia,function = "rsvd2";
1049 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1050 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1051 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1052 };
1053 kb_col6_pq6 {
1054 nvidia,pins = "kb_col6_pq6";
1055 nvidia,function = "rsvd2";
1056 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1057 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1058 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1059 };
1060 kb_col7_pq7 {
1061 nvidia,pins = "kb_col7_pq7";
1062 nvidia,function = "rsvd2";
1063 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1064 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1065 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1066 };
1067
1068 /* SHIFT_CTRL_OE */
1069 kb_col0_pq0 {
1070 nvidia,pins = "kb_col0_pq0";
1071 nvidia,function = "rsvd2";
1072 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1073 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1074 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1075 };
1076 kb_col1_pq1 {
1077 nvidia,pins = "kb_col1_pq1";
1078 nvidia,function = "rsvd2";
1079 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1080 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1081 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1082 };
1083 kb_col2_pq2 {
1084 nvidia,pins = "kb_col2_pq2";
1085 nvidia,function = "rsvd2";
1086 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1087 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1088 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1089 };
1090 kb_col4_pq4 {
1091 nvidia,pins = "kb_col4_pq4";
1092 nvidia,function = "kbc";
1093 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1094 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1095 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1096 };
1097 kb_row2_pr2 {
1098 nvidia,pins = "kb_row2_pr2";
1099 nvidia,function = "rsvd2";
1100 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1101 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1102 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1103 };
1104
1105 /* GPIO_PI6 aka TMP451 ALERT#/THERM2# */
1106 pi6 {
1107 nvidia,pins = "pi6";
1108 nvidia,function = "rsvd1";
1109 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1110 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1111 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1112 };
1113
1114 /* TOUCH_INT */
1115 gpio_w3_aud_pw3 {
1116 nvidia,pins = "gpio_w3_aud_pw3";
1117 nvidia,function = "spi6";
1118 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1119 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1120 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1121 };
1122
1123 pc7 { /* NC */
1124 nvidia,pins = "pc7";
1125 nvidia,function = "rsvd1";
1126 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1127 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1128 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1129 };
1130 pg0 { /* NC */
1131 nvidia,pins = "pg0";
1132 nvidia,function = "rsvd1";
1133 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1134 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1135 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1136 };
1137 pg1 { /* NC */
1138 nvidia,pins = "pg1";
1139 nvidia,function = "rsvd1";
1140 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1141 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1142 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1143 };
1144 pg2 { /* NC */
1145 nvidia,pins = "pg2";
1146 nvidia,function = "rsvd1";
1147 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1148 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1149 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1150 };
1151 pg3 { /* NC */
1152 nvidia,pins = "pg3";
1153 nvidia,function = "rsvd1";
1154 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1155 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1156 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1157 };
1158 pg4 { /* NC */
1159 nvidia,pins = "pg4";
1160 nvidia,function = "rsvd1";
1161 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1162 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1163 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1164 };
1165 ph4 { /* NC */
1166 nvidia,pins = "ph4";
1167 nvidia,function = "rsvd2";
1168 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1169 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1170 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1171 };
1172 ph5 { /* NC */
1173 nvidia,pins = "ph5";
1174 nvidia,function = "rsvd2";
1175 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1176 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1177 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1178 };
1179 ph6 { /* NC */
1180 nvidia,pins = "ph6";
1181 nvidia,function = "gmi";
1182 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1183 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1184 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1185 };
1186 ph7 { /* NC */
1187 nvidia,pins = "ph7";
1188 nvidia,function = "gmi";
1189 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1190 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1191 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1192 };
1193 pi0 { /* NC */
1194 nvidia,pins = "pi0";
1195 nvidia,function = "rsvd1";
1196 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1197 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1198 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1199 };
1200 pi1 { /* NC */
1201 nvidia,pins = "pi1";
1202 nvidia,function = "rsvd1";
1203 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1204 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1205 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1206 };
1207 pi2 { /* NC */
1208 nvidia,pins = "pi2";
1209 nvidia,function = "rsvd4";
1210 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1211 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1212 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1213 };
1214 pi4 { /* NC */
1215 nvidia,pins = "pi4";
1216 nvidia,function = "gmi";
1217 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1218 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1219 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1220 };
1221 pi7 { /* NC */
1222 nvidia,pins = "pi7";
1223 nvidia,function = "rsvd1";
1224 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1225 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1226 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1227 };
1228 pk0 { /* NC */
1229 nvidia,pins = "pk0";
1230 nvidia,function = "rsvd1";
1231 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1232 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1233 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1234 };
1235 pk1 { /* NC */
1236 nvidia,pins = "pk1";
1237 nvidia,function = "rsvd4";
1238 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1239 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1240 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1241 };
1242 pk3 { /* NC */
1243 nvidia,pins = "pk3";
1244 nvidia,function = "gmi";
1245 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1246 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1247 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1248 };
1249 pk4 { /* NC */
1250 nvidia,pins = "pk4";
1251 nvidia,function = "rsvd2";
1252 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1253 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1254 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1255 };
1256 dap1_fs_pn0 { /* NC */
1257 nvidia,pins = "dap1_fs_pn0";
1258 nvidia,function = "rsvd4";
1259 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1260 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1261 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1262 };
1263 dap1_din_pn1 { /* NC */
1264 nvidia,pins = "dap1_din_pn1";
1265 nvidia,function = "rsvd4";
1266 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1267 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1268 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1269 };
1270 dap1_sclk_pn3 { /* NC */
1271 nvidia,pins = "dap1_sclk_pn3";
1272 nvidia,function = "rsvd4";
1273 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1274 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1275 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1276 };
1277 ulpi_data7_po0 { /* NC */
1278 nvidia,pins = "ulpi_data7_po0";
1279 nvidia,function = "ulpi";
1280 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1281 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1282 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1283 };
1284 ulpi_data0_po1 { /* NC */
1285 nvidia,pins = "ulpi_data0_po1";
1286 nvidia,function = "ulpi";
1287 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1288 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1289 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1290 };
1291 ulpi_data1_po2 { /* NC */
1292 nvidia,pins = "ulpi_data1_po2";
1293 nvidia,function = "ulpi";
1294 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1295 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1296 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1297 };
1298 ulpi_data2_po3 { /* NC */
1299 nvidia,pins = "ulpi_data2_po3";
1300 nvidia,function = "ulpi";
1301 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1302 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1303 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1304 };
1305 ulpi_data3_po4 { /* NC */
1306 nvidia,pins = "ulpi_data3_po4";
1307 nvidia,function = "ulpi";
1308 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1309 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1310 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1311 };
1312 ulpi_data6_po7 { /* NC */
1313 nvidia,pins = "ulpi_data6_po7";
1314 nvidia,function = "ulpi";
1315 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1316 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1317 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1318 };
1319 dap4_fs_pp4 { /* NC */
1320 nvidia,pins = "dap4_fs_pp4";
1321 nvidia,function = "rsvd4";
1322 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1323 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1324 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1325 };
1326 dap4_din_pp5 { /* NC */
1327 nvidia,pins = "dap4_din_pp5";
1328 nvidia,function = "rsvd3";
1329 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1330 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1331 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1332 };
1333 dap4_dout_pp6 { /* NC */
1334 nvidia,pins = "dap4_dout_pp6";
1335 nvidia,function = "rsvd4";
1336 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1337 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1338 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1339 };
1340 dap4_sclk_pp7 { /* NC */
1341 nvidia,pins = "dap4_sclk_pp7";
1342 nvidia,function = "rsvd3";
1343 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1344 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1345 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1346 };
1347 kb_col3_pq3 { /* NC */
1348 nvidia,pins = "kb_col3_pq3";
1349 nvidia,function = "kbc";
1350 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1351 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1352 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1353 };
1354 kb_row3_pr3 { /* NC */
1355 nvidia,pins = "kb_row3_pr3";
1356 nvidia,function = "kbc";
1357 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1358 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1359 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1360 };
1361 kb_row4_pr4 { /* NC */
1362 nvidia,pins = "kb_row4_pr4";
1363 nvidia,function = "rsvd3";
1364 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1365 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1366 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1367 };
1368 kb_row5_pr5 { /* NC */
1369 nvidia,pins = "kb_row5_pr5";
1370 nvidia,function = "rsvd3";
1371 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1372 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1373 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1374 };
1375 kb_row6_pr6 { /* NC */
1376 nvidia,pins = "kb_row6_pr6";
1377 nvidia,function = "kbc";
1378 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1379 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1380 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1381 };
1382 kb_row7_pr7 { /* NC */
1383 nvidia,pins = "kb_row7_pr7";
1384 nvidia,function = "rsvd2";
1385 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1386 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1387 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1388 };
1389 kb_row8_ps0 { /* NC */
1390 nvidia,pins = "kb_row8_ps0";
1391 nvidia,function = "rsvd2";
1392 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1393 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1394 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1395 };
1396 kb_row9_ps1 { /* NC */
1397 nvidia,pins = "kb_row9_ps1";
1398 nvidia,function = "rsvd2";
1399 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1400 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1401 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1402 };
1403 kb_row12_ps4 { /* NC */
1404 nvidia,pins = "kb_row12_ps4";
1405 nvidia,function = "rsvd2";
1406 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1407 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1408 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1409 };
1410 kb_row13_ps5 { /* NC */
1411 nvidia,pins = "kb_row13_ps5";
1412 nvidia,function = "rsvd2";
1413 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1414 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1415 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1416 };
1417 kb_row14_ps6 { /* NC */
1418 nvidia,pins = "kb_row14_ps6";
1419 nvidia,function = "rsvd2";
1420 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1421 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1422 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1423 };
1424 kb_row15_ps7 { /* NC */
1425 nvidia,pins = "kb_row15_ps7";
1426 nvidia,function = "rsvd3";
1427 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1428 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1429 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1430 };
1431 kb_row16_pt0 { /* NC */
1432 nvidia,pins = "kb_row16_pt0";
1433 nvidia,function = "rsvd2";
1434 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1435 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1436 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1437 };
1438 kb_row17_pt1 { /* NC */
1439 nvidia,pins = "kb_row17_pt1";
1440 nvidia,function = "rsvd2";
1441 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1442 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1443 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1444 };
1445 pu5 { /* NC */
1446 nvidia,pins = "pu5";
1447 nvidia,function = "gmi";
1448 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1449 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1450 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1451 };
1452 /*
1453 * PCB Version Indication: V1.2 and later have GPIO_PV0
1454 * wired to GND, was NC before
1455 */
1456 pv0 {
1457 nvidia,pins = "pv0";
1458 nvidia,function = "rsvd1";
1459 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1460 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1461 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1462 };
1463 pv1 { /* NC */
1464 nvidia,pins = "pv1";
1465 nvidia,function = "rsvd1";
1466 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1467 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1468 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1469 };
1470 gpio_x1_aud_px1 { /* NC */
1471 nvidia,pins = "gpio_x1_aud_px1";
1472 nvidia,function = "rsvd2";
1473 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1474 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1475 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1476 };
1477 gpio_x3_aud_px3 { /* NC */
1478 nvidia,pins = "gpio_x3_aud_px3";
1479 nvidia,function = "rsvd4";
1480 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1481 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1482 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1483 };
1484 pbb7 { /* NC */
1485 nvidia,pins = "pbb7";
1486 nvidia,function = "rsvd2";
1487 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1488 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1489 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1490 };
1491 pcc1 { /* NC */
1492 nvidia,pins = "pcc1";
1493 nvidia,function = "rsvd2";
1494 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1495 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1496 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1497 };
1498 pcc2 { /* NC */
1499 nvidia,pins = "pcc2";
1500 nvidia,function = "rsvd2";
1501 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1502 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1503 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1504 };
1505 clk3_req_pee1 { /* NC */
1506 nvidia,pins = "clk3_req_pee1";
1507 nvidia,function = "rsvd2";
1508 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1509 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1510 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1511 };
1512 dap_mclk1_req_pee2 { /* NC */
1513 nvidia,pins = "dap_mclk1_req_pee2";
1514 nvidia,function = "rsvd4";
1515 nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
1516 nvidia,tristate = <TEGRA_PIN_ENABLE>;
1517 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
1518 };
1519 /*
1520 * Leave SDMMC3_CLK_LB_OUT muxed as SDMMC3 with output
1521 * driver enabled aka not tristated and input driver
1522 * enabled as well as it features some magic properties
1523 * even though the external loopback is disabled and the
1524 * internal loopback used as per
1525 * SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1
1526 * bits being set to 0xfffd according to the TRM!
1527 */
1528 sdmmc3_clk_lb_out_pee4 { /* NC */
1529 nvidia,pins = "sdmmc3_clk_lb_out_pee4";
1530 nvidia,function = "sdmmc3";
1531 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1532 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1533 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1534 };
1535 };
1536 };
1537
1538 serial@70006040 {
1539 compatible = "nvidia,tegra124-hsuart";
1540 };
1541
1542 serial@70006200 {
1543 compatible = "nvidia,tegra124-hsuart";
1544 };
1545
1546 serial@70006300 {
1547 compatible = "nvidia,tegra124-hsuart";
1548 };
1549
1550 hdmi_ddc: i2c@7000c700 {
1551 clock-frequency = <10000>;
1552 };
1553
1554 /* PWR_I2C: power I2C to audio codec, PMIC and temperature sensor */
1555 i2c@7000d000 {
1556 status = "okay";
1557 clock-frequency = <400000>;
1558
1559 /* SGTL5000 audio codec */
1560 sgtl5000: codec@a {
1561 compatible = "fsl,sgtl5000";
1562 reg = <0x0a>;
1563 VDDA-supply = <&reg_3v3>;
1564 VDDIO-supply = <&vddio_1v8>;
1565 clocks = <&tegra_car TEGRA124_CLK_EXTERN1>;
1566 };
1567
1568 pmic: pmic@40 {
1569 compatible = "ams,as3722";
1570 reg = <0x40>;
1571 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
1572 ams,system-power-controller;
1573 #interrupt-cells = <2>;
1574 interrupt-controller;
1575 gpio-controller;
1576 #gpio-cells = <2>;
1577 pinctrl-names = "default";
1578 pinctrl-0 = <&as3722_default>;
1579
1580 as3722_default: pinmux {
1581 gpio2_7 {
1582 pins = "gpio2", /* PWR_EN_+V3.3 */
1583 "gpio7"; /* +V1.6_LPO */
1584 function = "gpio";
1585 bias-pull-up;
1586 };
1587
1588 gpio0_1_3_4_5_6 {
1589 pins = "gpio0", "gpio1", "gpio3",
1590 "gpio4", "gpio5", "gpio6";
1591 bias-high-impedance;
1592 };
1593 };
1594
1595 regulators {
1596 vsup-sd2-supply = <&reg_3v3>;
1597 vsup-sd3-supply = <&reg_3v3>;
1598 vsup-sd4-supply = <&reg_3v3>;
1599 vsup-sd5-supply = <&reg_3v3>;
1600 vin-ldo0-supply = <&vddio_ddr_1v35>;
1601 vin-ldo1-6-supply = <&reg_3v3>;
1602 vin-ldo2-5-7-supply = <&vddio_1v8>;
1603 vin-ldo3-4-supply = <&reg_3v3>;
1604 vin-ldo9-10-supply = <&reg_3v3>;
1605 vin-ldo11-supply = <&reg_3v3>;
1606
1607 vdd_cpu: sd0 {
1608 regulator-name = "+VDD_CPU_AP";
1609 regulator-min-microvolt = <700000>;
1610 regulator-max-microvolt = <1400000>;
1611 regulator-min-microamp = <3500000>;
1612 regulator-max-microamp = <3500000>;
1613 regulator-always-on;
1614 regulator-boot-on;
1615 ams,ext-control = <2>;
1616 };
1617
1618 sd1 {
1619 regulator-name = "+VDD_CORE";
1620 regulator-min-microvolt = <700000>;
1621 regulator-max-microvolt = <1350000>;
1622 regulator-min-microamp = <2500000>;
1623 regulator-max-microamp = <4000000>;
1624 regulator-always-on;
1625 regulator-boot-on;
1626 ams,ext-control = <1>;
1627 };
1628
1629 vddio_ddr_1v35: sd2 {
1630 regulator-name =
1631 "+V1.35_VDDIO_DDR(sd2)";
1632 regulator-min-microvolt = <1350000>;
1633 regulator-max-microvolt = <1350000>;
1634 regulator-always-on;
1635 regulator-boot-on;
1636 };
1637
1638 sd3 {
1639 regulator-name =
1640 "+V1.35_VDDIO_DDR(sd3)";
1641 regulator-min-microvolt = <1350000>;
1642 regulator-max-microvolt = <1350000>;
1643 regulator-always-on;
1644 regulator-boot-on;
1645 };
1646
1647 vdd_1v05: sd4 {
1648 regulator-name = "+V1.05";
1649 regulator-min-microvolt = <1050000>;
1650 regulator-max-microvolt = <1050000>;
1651 };
1652
1653 vddio_1v8: sd5 {
1654 regulator-name = "+V1.8";
1655 regulator-min-microvolt = <1800000>;
1656 regulator-max-microvolt = <1800000>;
1657 regulator-boot-on;
1658 regulator-always-on;
1659 };
1660
1661 vdd_gpu: sd6 {
1662 regulator-name = "+VDD_GPU_AP";
1663 regulator-min-microvolt = <650000>;
1664 regulator-max-microvolt = <1200000>;
1665 regulator-min-microamp = <3500000>;
1666 regulator-max-microamp = <3500000>;
1667 regulator-boot-on;
1668 regulator-always-on;
1669 };
1670
1671 avdd_1v05: ldo0 {
1672 regulator-name = "+V1.05_AVDD";
1673 regulator-min-microvolt = <1050000>;
1674 regulator-max-microvolt = <1050000>;
1675 regulator-boot-on;
1676 regulator-always-on;
1677 ams,ext-control = <1>;
1678 };
1679
1680 vddio_sdmmc1: ldo1 {
1681 regulator-name = "VDDIO_SDMMC1";
1682 regulator-min-microvolt = <1800000>;
1683 regulator-max-microvolt = <3300000>;
1684 };
1685
1686 ldo2 {
1687 regulator-name = "+V1.2";
1688 regulator-min-microvolt = <1200000>;
1689 regulator-max-microvolt = <1200000>;
1690 regulator-boot-on;
1691 regulator-always-on;
1692 };
1693
1694 ldo3 {
1695 regulator-name = "+V1.05_RTC";
1696 regulator-min-microvolt = <1000000>;
1697 regulator-max-microvolt = <1000000>;
1698 regulator-boot-on;
1699 regulator-always-on;
1700 ams,enable-tracking;
1701 };
1702
1703 /* 1.8V for LVDS, 3.3V for eDP */
1704 ldo4 {
1705 regulator-name = "AVDD_LVDS0_PLL";
1706 regulator-min-microvolt = <1800000>;
1707 regulator-max-microvolt = <1800000>;
1708 };
1709
1710 /* LDO5 not used */
1711
1712 vddio_sdmmc3: ldo6 {
1713 regulator-name = "VDDIO_SDMMC3";
1714 regulator-min-microvolt = <1800000>;
1715 regulator-max-microvolt = <3300000>;
1716 };
1717
1718 /* LDO7 not used */
1719
1720 ldo9 {
1721 regulator-name = "+V3.3_ETH(ldo9)";
1722 regulator-min-microvolt = <3300000>;
1723 regulator-max-microvolt = <3300000>;
1724 regulator-always-on;
1725 };
1726
1727 ldo10 {
1728 regulator-name = "+V3.3_ETH(ldo10)";
1729 regulator-min-microvolt = <3300000>;
1730 regulator-max-microvolt = <3300000>;
1731 regulator-always-on;
1732 };
1733
1734 ldo11 {
1735 regulator-name = "+V1.8_VPP_FUSE";
1736 regulator-min-microvolt = <1800000>;
1737 regulator-max-microvolt = <1800000>;
1738 };
1739 };
1740 };
1741
1742 /*
1743 * TMP451 temperature sensor
1744 * Note: THERM_N directly connected to AS3722 PMIC THERM
1745 */
1746 temperature-sensor@4c {
1747 compatible = "ti,tmp451";
1748 reg = <0x4c>;
1749 interrupt-parent = <&gpio>;
1750 interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
1751 #thermal-sensor-cells = <1>;
1752 };
1753 };
1754
1755 /* SPI2: MCU SPI */
1756 spi@7000d600 {
1757 status = "okay";
1758 spi-max-frequency = <25000000>;
1759 };
1760
1761 pmc@7000e400 {
1762 nvidia,invert-interrupt;
1763 nvidia,suspend-mode = <1>;
1764 nvidia,cpu-pwr-good-time = <500>;
1765 nvidia,cpu-pwr-off-time = <300>;
1766 nvidia,core-pwr-good-time = <641 3845>;
1767 nvidia,core-pwr-off-time = <61036>;
1768 nvidia,core-power-req-active-high;
1769 nvidia,sys-clock-req-active-high;
1770
1771 /* Set power_off bit in ResetControl register of AS3722 PMIC */
1772 i2c-thermtrip {
1773 nvidia,i2c-controller-id = <4>;
1774 nvidia,bus-addr = <0x40>;
1775 nvidia,reg-addr = <0x36>;
1776 nvidia,reg-data = <0x2>;
1777 };
1778 };
1779
1780 sata@70020000 {
1781 phys = <&{/padctl@7009f000/pads/sata/lanes/sata-0}>;
1782 phy-names = "sata-0";
1783 avdd-supply = <&vdd_1v05>;
1784 hvdd-supply = <&reg_3v3>;
1785 vddio-supply = <&vdd_1v05>;
1786 };
1787
1788 usb@70090000 {
1789 /* USBO1, USBO1 (SS), USBH2, USBH4 and USBH4 (SS) */
1790 phys = <&{/padctl@7009f000/pads/usb2/lanes/usb2-0}>,
1791 <&{/padctl@7009f000/pads/pcie/lanes/pcie-1}>,
1792 <&{/padctl@7009f000/pads/usb2/lanes/usb2-1}>,
1793 <&{/padctl@7009f000/pads/usb2/lanes/usb2-2}>,
1794 <&{/padctl@7009f000/pads/pcie/lanes/pcie-0}>;
1795 phy-names = "usb2-0", "usb3-1", "usb2-1", "usb2-2", "usb3-0";
1796 avddio-pex-supply = <&vdd_1v05>;
1797 avdd-pll-erefe-supply = <&avdd_1v05>;
1798 avdd-pll-utmip-supply = <&vddio_1v8>;
1799 avdd-usb-ss-pll-supply = <&vdd_1v05>;
1800 avdd-usb-supply = <&reg_3v3>;
1801 dvddio-pex-supply = <&vdd_1v05>;
1802 hvdd-usb-ss-pll-e-supply = <&reg_3v3>;
1803 hvdd-usb-ss-supply = <&reg_3v3>;
1804 };
1805
1806 padctl@7009f000 {
1807 pads {
1808 usb2 {
1809 status = "okay";
1810
1811 lanes {
1812 usb2-0 {
1813 nvidia,function = "xusb";
1814 status = "okay";
1815 };
1816
1817 usb2-1 {
1818 nvidia,function = "xusb";
1819 status = "okay";
1820 };
1821
1822 usb2-2 {
1823 nvidia,function = "xusb";
1824 status = "okay";
1825 };
1826 };
1827 };
1828
1829 pcie {
1830 status = "okay";
1831
1832 lanes {
1833 pcie-0 {
1834 nvidia,function = "usb3-ss";
1835 status = "okay";
1836 };
1837
1838 pcie-1 {
1839 nvidia,function = "usb3-ss";
1840 status = "okay";
1841 };
1842
1843 pcie-2 {
1844 nvidia,function = "pcie";
1845 status = "okay";
1846 };
1847
1848 pcie-3 {
1849 nvidia,function = "pcie";
1850 status = "okay";
1851 };
1852
1853 pcie-4 {
1854 nvidia,function = "pcie";
1855 status = "okay";
1856 };
1857 };
1858 };
1859
1860 sata {
1861 status = "okay";
1862
1863 lanes {
1864 sata-0 {
1865 nvidia,function = "sata";
1866 status = "okay";
1867 };
1868 };
1869 };
1870 };
1871
1872 ports {
1873 /* USBO1 */
1874 usb2-0 {
1875 status = "okay";
1876 mode = "otg";
1877
1878 vbus-supply = <&reg_usbo1_vbus>;
1879 };
1880
1881 /* USBH2 */
1882 usb2-1 {
1883 status = "okay";
1884 mode = "host";
1885
1886 vbus-supply = <&reg_usbh_vbus>;
1887 };
1888
1889 /* USBH4 */
1890 usb2-2 {
1891 status = "okay";
1892 mode = "host";
1893
1894 vbus-supply = <&reg_usbh_vbus>;
1895 };
1896
1897 usb3-0 {
1898 nvidia,usb2-companion = <2>;
1899 status = "okay";
1900 };
1901
1902 usb3-1 {
1903 nvidia,usb2-companion = <0>;
1904 status = "okay";
1905 };
1906 };
1907 };
1908
1909 /* eMMC */
1910 sdhci@700b0600 {
1911 status = "okay";
1912 bus-width = <8>;
1913 non-removable;
1914 };
1915
1916 /* CPU DFLL clock */
1917 clock@70110000 {
1918 status = "okay";
1919 vdd-cpu-supply = <&vdd_cpu>;
1920 nvidia,i2c-fs-rate = <400000>;
1921 };
1922
1923 ahub@70300000 {
1924 i2s@70301200 {
1925 status = "okay";
1926 };
1927 };
1928
1929 clocks {
1930 compatible = "simple-bus";
1931 #address-cells = <1>;
1932 #size-cells = <0>;
1933
1934 clk32k_in: clock@0 {
1935 compatible = "fixed-clock";
1936 reg = <0>;
1937 #clock-cells = <0>;
1938 clock-frequency = <32768>;
1939 };
1940 };
1941
1942 cpus {
1943 cpu@0 {
1944 vdd-cpu-supply = <&vdd_cpu>;
1945 };
1946 };
1947
1948 reg_1v05_avdd_hdmi_pll: regulator-1v05-avdd-hdmi-pll {
1949 compatible = "regulator-fixed";
1950 regulator-name = "+V1.05_AVDD_HDMI_PLL";
1951 regulator-min-microvolt = <1050000>;
1952 regulator-max-microvolt = <1050000>;
1953 gpio = <&gpio TEGRA_GPIO(H, 7) GPIO_ACTIVE_LOW>;
1954 vin-supply = <&vdd_1v05>;
1955 };
1956
1957 reg_3v3_mxm: regulator-3v3-mxm {
1958 compatible = "regulator-fixed";
1959 regulator-name = "+V3.3_MXM";
1960 regulator-min-microvolt = <3300000>;
1961 regulator-max-microvolt = <3300000>;
1962 regulator-always-on;
1963 regulator-boot-on;
1964 };
1965
1966 reg_3v3: regulator-3v3 {
1967 compatible = "regulator-fixed";
1968 regulator-name = "+V3.3";
1969 regulator-min-microvolt = <3300000>;
1970 regulator-max-microvolt = <3300000>;
1971 regulator-always-on;
1972 regulator-boot-on;
1973 /* PWR_EN_+V3.3 */
1974 gpio = <&pmic 2 GPIO_ACTIVE_HIGH>;
1975 enable-active-high;
1976 vin-supply = <&reg_3v3_mxm>;
1977 };
1978
1979 reg_3v3_avdd_hdmi: regulator-3v3-avdd-hdmi {
1980 compatible = "regulator-fixed";
1981 regulator-name = "+V3.3_AVDD_HDMI";
1982 regulator-min-microvolt = <3300000>;
1983 regulator-max-microvolt = <3300000>;
1984 vin-supply = <&vdd_1v05>;
1985 };
1986
1987 sound {
1988 compatible = "toradex,tegra-audio-sgtl5000-apalis_tk1",
1989 "nvidia,tegra-audio-sgtl5000";
1990 nvidia,model = "Toradex Apalis TK1";
1991 nvidia,audio-routing =
1992 "Headphone Jack", "HP_OUT",
1993 "LINE_IN", "Line In Jack",
1994 "MIC_IN", "Mic Jack";
1995 nvidia,i2s-controller = <&tegra_i2s2>;
1996 nvidia,audio-codec = <&sgtl5000>;
1997 clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
1998 <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
1999 <&tegra_car TEGRA124_CLK_EXTERN1>;
2000 clock-names = "pll_a", "pll_a_out0", "mclk";
2001 };
2002
2003 thermal-zones {
2004 cpu {
2005 trips {
2006 cpu-shutdown-trip {
2007 temperature = <101000>;
2008 hysteresis = <0>;
2009 type = "critical";
2010 };
2011 };
2012 };
2013
2014 mem {
2015 trips {
2016 mem-shutdown-trip {
2017 temperature = <101000>;
2018 hysteresis = <0>;
2019 type = "critical";
2020 };
2021 };
2022 };
2023
2024 gpu {
2025 trips {
2026 gpu-shutdown-trip {
2027 temperature = <101000>;
2028 hysteresis = <0>;
2029 type = "critical";
2030 };
2031 };
2032 };
2033 };
2034};
2035
2036&gpio {
2037 /* I210 Gigabit Ethernet Controller Reset */
2038 lan_reset_n {
2039 gpio-hog;
2040 gpios = <TEGRA_GPIO(S, 2) GPIO_ACTIVE_HIGH>;
2041 output-high;
2042 line-name = "LAN_RESET_N";
2043 };
2044
2045 /* Control MXM3 pin 26 Reset Module Output Carrier Input */
2046 reset_moci_ctrl {
2047 gpio-hog;
2048 gpios = <TEGRA_GPIO(U, 4) GPIO_ACTIVE_HIGH>;
2049 output-high;
2050 line-name = "RESET_MOCI_CTRL";
2051 };
2052};
diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi b/arch/arm/boot/dts/tegra124-apalis.dtsi
index 5d9b18ef5af6..65a2161b9b8e 100644
--- a/arch/arm/boot/dts/tegra124-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2016 Toradex AG 2 * Copyright 2016-2018 Toradex AG
3 * 3 *
4 * This file is dual-licensed: you can use it either under the terms 4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual 5 * of the GPL or the X11 license, at your option. Note that this dual
@@ -56,7 +56,6 @@
56 56
57 pcie@1003000 { 57 pcie@1003000 {
58 status = "okay"; 58 status = "okay";
59
60 avddio-pex-supply = <&vdd_1v05>; 59 avddio-pex-supply = <&vdd_1v05>;
61 avdd-pex-pll-supply = <&vdd_1v05>; 60 avdd-pex-pll-supply = <&vdd_1v05>;
62 avdd-pll-erefe-supply = <&avdd_1v05>; 61 avdd-pll-erefe-supply = <&avdd_1v05>;
@@ -85,7 +84,6 @@
85 hdmi@54280000 { 84 hdmi@54280000 {
86 pll-supply = <&reg_1v05_avdd_hdmi_pll>; 85 pll-supply = <&reg_1v05_avdd_hdmi_pll>;
87 vdd-supply = <&reg_3v3_avdd_hdmi>; 86 vdd-supply = <&reg_3v3_avdd_hdmi>;
88
89 nvidia,ddc-i2c-bus = <&hdmi_ddc>; 87 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
90 nvidia,hpd-gpio = 88 nvidia,hpd-gpio =
91 <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>; 89 <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
@@ -453,12 +451,12 @@
453 nvidia,tristate = <TEGRA_PIN_DISABLE>; 451 nvidia,tristate = <TEGRA_PIN_DISABLE>;
454 nvidia,enable-input = <TEGRA_PIN_DISABLE>; 452 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
455 }; 453 };
456 /* PWM3 active on pu6 being Apalis BKL1_PWM */ 454 /* PWM3 active on pu6 being Apalis BKL1_PWM as well */
457 ph3 { 455 ph3 {
458 nvidia,pins = "ph3"; 456 nvidia,pins = "ph3";
459 nvidia,function = "gmi"; 457 nvidia,function = "pwm3";
460 nvidia,pull = <TEGRA_PIN_PULL_DOWN>; 458 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
461 nvidia,tristate = <TEGRA_PIN_ENABLE>; 459 nvidia,tristate = <TEGRA_PIN_DISABLE>;
462 nvidia,enable-input = <TEGRA_PIN_DISABLE>; 460 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
463 }; 461 };
464 462
@@ -1579,7 +1577,7 @@
1579 }; 1577 };
1580 1578
1581 hdmi_ddc: i2c@7000c400 { 1579 hdmi_ddc: i2c@7000c400 {
1582 clock-frequency = <100000>; 1580 clock-frequency = <10000>;
1583 }; 1581 };
1584 1582
1585 /* PWR_I2C: power I2C to audio codec, PMIC and temperature sensor */ 1583 /* PWR_I2C: power I2C to audio codec, PMIC and temperature sensor */
@@ -1600,15 +1598,11 @@
1600 compatible = "ams,as3722"; 1598 compatible = "ams,as3722";
1601 reg = <0x40>; 1599 reg = <0x40>;
1602 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; 1600 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
1603
1604 ams,system-power-controller; 1601 ams,system-power-controller;
1605
1606 #interrupt-cells = <2>; 1602 #interrupt-cells = <2>;
1607 interrupt-controller; 1603 interrupt-controller;
1608
1609 gpio-controller; 1604 gpio-controller;
1610 #gpio-cells = <2>; 1605 #gpio-cells = <2>;
1611
1612 pinctrl-names = "default"; 1606 pinctrl-names = "default";
1613 pinctrl-0 = <&as3722_default>; 1607 pinctrl-0 = <&as3722_default>;
1614 1608
@@ -1620,9 +1614,9 @@
1620 bias-pull-up; 1614 bias-pull-up;
1621 }; 1615 };
1622 1616
1623 gpio1_3_4_5_6 { 1617 gpio0_1_3_4_5_6 {
1624 pins = "gpio1", "gpio3", "gpio4", 1618 pins = "gpio0", "gpio1", "gpio3",
1625 "gpio5", "gpio6"; 1619 "gpio4", "gpio5", "gpio6";
1626 bias-high-impedance; 1620 bias-high-impedance;
1627 }; 1621 };
1628 }; 1622 };
@@ -1783,7 +1777,6 @@
1783 reg = <0x4c>; 1777 reg = <0x4c>;
1784 interrupt-parent = <&gpio>; 1778 interrupt-parent = <&gpio>;
1785 interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>; 1779 interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
1786
1787 #thermal-sensor-cells = <1>; 1780 #thermal-sensor-cells = <1>;
1788 }; 1781 };
1789 }; 1782 };
@@ -1816,7 +1809,6 @@
1816 sata@70020000 { 1809 sata@70020000 {
1817 phys = <&{/padctl@7009f000/pads/sata/lanes/sata-0}>; 1810 phys = <&{/padctl@7009f000/pads/sata/lanes/sata-0}>;
1818 phy-names = "sata-0"; 1811 phy-names = "sata-0";
1819
1820 avdd-supply = <&vdd_1v05>; 1812 avdd-supply = <&vdd_1v05>;
1821 hvdd-supply = <&reg_3v3>; 1813 hvdd-supply = <&reg_3v3>;
1822 vddio-supply = <&vdd_1v05>; 1814 vddio-supply = <&vdd_1v05>;
@@ -1830,7 +1822,6 @@
1830 <&{/padctl@7009f000/pads/usb2/lanes/usb2-2}>, 1822 <&{/padctl@7009f000/pads/usb2/lanes/usb2-2}>,
1831 <&{/padctl@7009f000/pads/pcie/lanes/pcie-0}>; 1823 <&{/padctl@7009f000/pads/pcie/lanes/pcie-0}>;
1832 phy-names = "usb2-0", "usb3-1", "usb2-1", "usb2-2", "usb3-0"; 1824 phy-names = "usb2-0", "usb3-1", "usb2-1", "usb2-2", "usb3-0";
1833
1834 avddio-pex-supply = <&vdd_1v05>; 1825 avddio-pex-supply = <&vdd_1v05>;
1835 avdd-pll-erefe-supply = <&avdd_1v05>; 1826 avdd-pll-erefe-supply = <&avdd_1v05>;
1836 avdd-pll-utmip-supply = <&vddio_1v8>; 1827 avdd-pll-utmip-supply = <&vddio_1v8>;
@@ -2041,53 +2032,50 @@
2041 thermal-zones { 2032 thermal-zones {
2042 cpu { 2033 cpu {
2043 trips { 2034 trips {
2044 trip@0 { 2035 cpu-shutdown-trip {
2045 temperature = <101000>; 2036 temperature = <101000>;
2046 hysteresis = <0>; 2037 hysteresis = <0>;
2047 type = "critical"; 2038 type = "critical";
2048 }; 2039 };
2049 }; 2040 };
2050
2051 cooling-maps {
2052 /*
2053 * There are currently no cooling maps because
2054 * there are no cooling devices
2055 */
2056 };
2057 }; 2041 };
2058 2042
2059 mem { 2043 mem {
2060 trips { 2044 trips {
2061 trip@0 { 2045 mem-shutdown-trip {
2062 temperature = <101000>; 2046 temperature = <101000>;
2063 hysteresis = <0>; 2047 hysteresis = <0>;
2064 type = "critical"; 2048 type = "critical";
2065 }; 2049 };
2066 }; 2050 };
2067
2068 cooling-maps {
2069 /*
2070 * There are currently no cooling maps because
2071 * there are no cooling devices
2072 */
2073 };
2074 }; 2051 };
2075 2052
2076 gpu { 2053 gpu {
2077 trips { 2054 trips {
2078 trip@0 { 2055 gpu-shutdown-trip {
2079 temperature = <101000>; 2056 temperature = <101000>;
2080 hysteresis = <0>; 2057 hysteresis = <0>;
2081 type = "critical"; 2058 type = "critical";
2082 }; 2059 };
2083 }; 2060 };
2084
2085 cooling-maps {
2086 /*
2087 * There are currently no cooling maps because
2088 * there are no cooling devices
2089 */
2090 };
2091 }; 2061 };
2092 }; 2062 };
2093}; 2063};
2064
2065&gpio {
2066 /* I210 Gigabit Ethernet Controller Reset */
2067 lan_reset_n {
2068 gpio-hog;
2069 gpios = <TEGRA_GPIO(S, 2) GPIO_ACTIVE_HIGH>;
2070 output-high;
2071 line-name = "LAN_RESET_N";
2072 };
2073
2074 /* Control MXM3 pin 26 Reset Module Output Carrier Input */
2075 reset_moci_ctrl {
2076 gpio-hog;
2077 gpios = <TEGRA_GPIO(U, 4) GPIO_ACTIVE_HIGH>;
2078 output-high;
2079 line-name = "RESET_MOCI_CTRL";
2080 };
2081};
diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index d112f85e66ed..6dbcf84dafbc 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -1418,7 +1418,7 @@
1418 compatible = "realtek,rt5639"; 1418 compatible = "realtek,rt5639";
1419 reg = <0x1c>; 1419 reg = <0x1c>;
1420 interrupt-parent = <&gpio>; 1420 interrupt-parent = <&gpio>;
1421 interrupts = <TEGRA_GPIO(H, 4) GPIO_ACTIVE_HIGH>; 1421 interrupts = <TEGRA_GPIO(H, 4) IRQ_TYPE_EDGE_FALLING>;
1422 realtek,ldo1-en-gpios = 1422 realtek,ldo1-en-gpios =
1423 <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>; 1423 <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
1424 }; 1424 };
diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
index 32d9079f025b..89bcc178994d 100644
--- a/arch/arm/boot/dts/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/tegra124-venice2.dts
@@ -613,7 +613,7 @@
613 compatible = "maxim,max98090"; 613 compatible = "maxim,max98090";
614 reg = <0x10>; 614 reg = <0x10>;
615 interrupt-parent = <&gpio>; 615 interrupt-parent = <&gpio>;
616 interrupts = <TEGRA_GPIO(H, 4) GPIO_ACTIVE_HIGH>; 616 interrupts = <TEGRA_GPIO(H, 4) IRQ_TYPE_EDGE_FALLING>;
617 }; 617 };
618 }; 618 };
619 619
@@ -859,7 +859,7 @@
859 reg = <0x9>; 859 reg = <0x9>;
860 interrupt-parent = <&gpio>; 860 interrupt-parent = <&gpio>;
861 interrupts = <TEGRA_GPIO(J, 0) 861 interrupts = <TEGRA_GPIO(J, 0)
862 GPIO_ACTIVE_HIGH>; 862 IRQ_TYPE_EDGE_BOTH>;
863 ti,ac-detect-gpios = <&gpio 863 ti,ac-detect-gpios = <&gpio
864 TEGRA_GPIO(J, 0) 864 TEGRA_GPIO(J, 0)
865 GPIO_ACTIVE_HIGH>; 865 GPIO_ACTIVE_HIGH>;
@@ -956,11 +956,6 @@
956 nvidia,function = "usb3-ss"; 956 nvidia,function = "usb3-ss";
957 status = "okay"; 957 status = "okay";
958 }; 958 };
959
960 pcie-1 {
961 nvidia,function = "usb3-ss";
962 status = "okay";
963 };
964 }; 959 };
965 }; 960 };
966 }; 961 };
diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
index 813ae34edd6a..5c202b3e3bb1 100644
--- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
+++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
@@ -213,21 +213,27 @@
213 GPIO_ACTIVE_HIGH>; 213 GPIO_ACTIVE_HIGH>;
214 }; 214 };
215 215
216 /*
217 * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier
218 * board)
219 */
216 i2c@7000c000 { 220 i2c@7000c000 {
217 clock-frequency = <400000>; 221 clock-frequency = <400000>;
218 }; 222 };
219 223
224 /* DDC_SCL/SDA on X3 pin 15/16 (e.g. display EDID) */
220 i2c_ddc: i2c@7000c400 { 225 i2c_ddc: i2c@7000c400 {
221 clock-frequency = <100000>; 226 clock-frequency = <10000>;
222 }; 227 };
223 228
224 i2c@7000c500 { 229 /* GEN2_I2C: unused */
225 clock-frequency = <400000>;
226 };
227 230
231 /* CAM/GEN3_I2C: used as EXT_IO1/2 GPIOs on SODIMM pin 133/127 */
232
233 /* PWR_I2C: power I2C to PMIC and temperature sensor (On-module) */
228 i2c@7000d000 { 234 i2c@7000d000 {
229 status = "okay"; 235 status = "okay";
230 clock-frequency = <400000>; 236 clock-frequency = <100000>;
231 237
232 pmic: tps6586x@34 { 238 pmic: tps6586x@34 {
233 compatible = "ti,tps6586x"; 239 compatible = "ti,tps6586x";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 864a95872b8d..0a7136462a1a 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -17,7 +17,7 @@
17 #size-cells = <1>; 17 #size-cells = <1>;
18 ranges = <0 0x40000000 0x40000>; 18 ranges = <0 0x40000000 0x40000>;
19 19
20 vde_pool: vde { 20 vde_pool: vde@400 {
21 reg = <0x400 0x3fc00>; 21 reg = <0x400 0x3fc00>;
22 pool; 22 pool;
23 }; 23 };
@@ -741,7 +741,7 @@
741 phy_type = "ulpi"; 741 phy_type = "ulpi";
742 clocks = <&tegra_car TEGRA20_CLK_USB2>, 742 clocks = <&tegra_car TEGRA20_CLK_USB2>,
743 <&tegra_car TEGRA20_CLK_PLL_U>, 743 <&tegra_car TEGRA20_CLK_PLL_U>,
744 <&tegra_car TEGRA20_CLK_CDEV2>; 744 <&tegra_car TEGRA20_CLK_PLL_P_OUT4>;
745 clock-names = "reg", "pll_u", "ulpi-link"; 745 clock-names = "reg", "pll_u", "ulpi-link";
746 resets = <&tegra_car 58>, <&tegra_car 22>; 746 resets = <&tegra_car 58>, <&tegra_car 22>;
747 reset-names = "usb", "utmi-pads"; 747 reset-names = "usb", "utmi-pads";
diff --git a/arch/arm/boot/dts/tegra30-apalis-eval.dts b/arch/arm/boot/dts/tegra30-apalis-eval.dts
index 07b945b0391a..0dc85a20bd45 100644
--- a/arch/arm/boot/dts/tegra30-apalis-eval.dts
+++ b/arch/arm/boot/dts/tegra30-apalis-eval.dts
@@ -79,7 +79,7 @@
79 */ 79 */
80 i2c@7000c000 { 80 i2c@7000c000 {
81 status = "okay"; 81 status = "okay";
82 clock-frequency = <100000>; 82 clock-frequency = <400000>;
83 83
84 pcie-switch@58 { 84 pcie-switch@58 {
85 compatible = "plx,pex8605"; 85 compatible = "plx,pex8605";
@@ -88,7 +88,7 @@
88 88
89 /* M41T0M6 real time clock on carrier board */ 89 /* M41T0M6 real time clock on carrier board */
90 rtc@68 { 90 rtc@68 {
91 compatible = "st,m41t00"; 91 compatible = "st,m41t0";
92 reg = <0x68>; 92 reg = <0x68>;
93 }; 93 };
94 }; 94 };
diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index faa8cd2914e8..d1d21ec2a844 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -437,7 +437,7 @@
437 }; 437 };
438 438
439 hdmiddc: i2c@7000c700 { 439 hdmiddc: i2c@7000c700 {
440 clock-frequency = <100000>; 440 clock-frequency = <10000>;
441 }; 441 };
442 442
443 /* 443 /*
@@ -597,7 +597,6 @@
597 597
598 stmpe_touchscreen@0 { 598 stmpe_touchscreen@0 {
599 compatible = "st,stmpe-ts"; 599 compatible = "st,stmpe-ts";
600 reg = <0>;
601 /* 3.25 MHz ADC clock speed */ 600 /* 3.25 MHz ADC clock speed */
602 st,adc-freq = <1>; 601 st,adc-freq = <1>;
603 /* 8 sample average control */ 602 /* 8 sample average control */
@@ -657,7 +656,7 @@
657 reg = <1>; 656 reg = <1>;
658 clocks = <&clk16m>; 657 clocks = <&clk16m>;
659 interrupt-parent = <&gpio>; 658 interrupt-parent = <&gpio>;
660 interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_LOW>; 659 interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_EDGE_RISING>;
661 spi-max-frequency = <10000000>; 660 spi-max-frequency = <10000000>;
662 }; 661 };
663 }; 662 };
@@ -672,7 +671,7 @@
672 reg = <0>; 671 reg = <0>;
673 clocks = <&clk16m>; 672 clocks = <&clk16m>;
674 interrupt-parent = <&gpio>; 673 interrupt-parent = <&gpio>;
675 interrupts = <TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>; 674 interrupts = <TEGRA_GPIO(W, 2) IRQ_TYPE_EDGE_RISING>;
676 spi-max-frequency = <10000000>; 675 spi-max-frequency = <10000000>;
677 }; 676 };
678 }; 677 };
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
index 5331a8f7dcf8..ae52a5039506 100644
--- a/arch/arm/boot/dts/tegra30-beaver.dts
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -260,14 +260,14 @@
260 }; 260 };
261 sdmmc3_dat6_pd3 { 261 sdmmc3_dat6_pd3 {
262 nvidia,pins = "sdmmc3_dat6_pd3"; 262 nvidia,pins = "sdmmc3_dat6_pd3";
263 nvidia,function = "rsvd1"; 263 nvidia,function = "spdif";
264 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 264 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
265 nvidia,tristate = <TEGRA_PIN_DISABLE>; 265 nvidia,tristate = <TEGRA_PIN_DISABLE>;
266 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 266 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
267 }; 267 };
268 sdmmc3_dat7_pd4 { 268 sdmmc3_dat7_pd4 {
269 nvidia,pins = "sdmmc3_dat7_pd4"; 269 nvidia,pins = "sdmmc3_dat7_pd4";
270 nvidia,function = "rsvd1"; 270 nvidia,function = "spdif";
271 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 271 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
272 nvidia,tristate = <TEGRA_PIN_DISABLE>; 272 nvidia,tristate = <TEGRA_PIN_DISABLE>;
273 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 273 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -281,14 +281,14 @@
281 }; 281 };
282 vi_vsync_pd6 { 282 vi_vsync_pd6 {
283 nvidia,pins = "vi_vsync_pd6"; 283 nvidia,pins = "vi_vsync_pd6";
284 nvidia,function = "rsvd1"; 284 nvidia,function = "ddr";
285 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 285 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
286 nvidia,tristate = <TEGRA_PIN_DISABLE>; 286 nvidia,tristate = <TEGRA_PIN_DISABLE>;
287 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 287 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
288 }; 288 };
289 vi_hsync_pd7 { 289 vi_hsync_pd7 {
290 nvidia,pins = "vi_hsync_pd7"; 290 nvidia,pins = "vi_hsync_pd7";
291 nvidia,function = "rsvd1"; 291 nvidia,function = "ddr";
292 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 292 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
293 nvidia,tristate = <TEGRA_PIN_DISABLE>; 293 nvidia,tristate = <TEGRA_PIN_DISABLE>;
294 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 294 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -806,7 +806,7 @@
806 }; 806 };
807 hdmi_int_pn7 { 807 hdmi_int_pn7 {
808 nvidia,pins = "hdmi_int_pn7"; 808 nvidia,pins = "hdmi_int_pn7";
809 nvidia,function = "rsvd1"; 809 nvidia,function = "hdmi";
810 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 810 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
811 nvidia,tristate = <TEGRA_PIN_ENABLE>; 811 nvidia,tristate = <TEGRA_PIN_ENABLE>;
812 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 812 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -841,7 +841,7 @@
841 }; 841 };
842 ulpi_data3_po4 { 842 ulpi_data3_po4 {
843 nvidia,pins = "ulpi_data3_po4"; 843 nvidia,pins = "ulpi_data3_po4";
844 nvidia,function = "rsvd1"; 844 nvidia,function = "uarta";
845 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 845 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
846 nvidia,tristate = <TEGRA_PIN_DISABLE>; 846 nvidia,tristate = <TEGRA_PIN_DISABLE>;
847 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 847 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1107,21 +1107,21 @@
1107 }; 1107 };
1108 vi_d10_pt2 { 1108 vi_d10_pt2 {
1109 nvidia,pins = "vi_d10_pt2"; 1109 nvidia,pins = "vi_d10_pt2";
1110 nvidia,function = "rsvd1"; 1110 nvidia,function = "ddr";
1111 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1111 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1112 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1112 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1113 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1113 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1114 }; 1114 };
1115 vi_d11_pt3 { 1115 vi_d11_pt3 {
1116 nvidia,pins = "vi_d11_pt3"; 1116 nvidia,pins = "vi_d11_pt3";
1117 nvidia,function = "rsvd1"; 1117 nvidia,function = "ddr";
1118 nvidia,pull = <TEGRA_PIN_PULL_UP>; 1118 nvidia,pull = <TEGRA_PIN_PULL_UP>;
1119 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1119 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1120 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1120 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
1121 }; 1121 };
1122 vi_d0_pt4 { 1122 vi_d0_pt4 {
1123 nvidia,pins = "vi_d0_pt4"; 1123 nvidia,pins = "vi_d0_pt4";
1124 nvidia,function = "rsvd1"; 1124 nvidia,function = "ddr";
1125 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1125 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1126 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1126 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1127 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1127 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1151,7 +1151,7 @@
1151 }; 1151 };
1152 pu0 { 1152 pu0 {
1153 nvidia,pins = "pu0"; 1153 nvidia,pins = "pu0";
1154 nvidia,function = "rsvd1"; 1154 nvidia,function = "owr";
1155 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1155 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1156 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1156 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1157 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1157 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1172,7 +1172,7 @@
1172 }; 1172 };
1173 pu3 { 1173 pu3 {
1174 nvidia,pins = "pu3"; 1174 nvidia,pins = "pu3";
1175 nvidia,function = "rsvd1"; 1175 nvidia,function = "pwm0";
1176 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1176 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1177 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1177 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1178 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1178 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1193,7 +1193,7 @@
1193 }; 1193 };
1194 pu6 { 1194 pu6 {
1195 nvidia,pins = "pu6"; 1195 nvidia,pins = "pu6";
1196 nvidia,function = "rsvd1"; 1196 nvidia,function = "pwm3";
1197 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1197 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1198 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1198 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1199 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1199 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1221,7 +1221,7 @@
1221 }; 1221 };
1222 pv3 { 1222 pv3 {
1223 nvidia,pins = "pv3"; 1223 nvidia,pins = "pv3";
1224 nvidia,function = "rsvd1"; 1224 nvidia,function = "clk_12m_out";
1225 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1225 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1226 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1226 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1227 nvidia,enable-input = <TEGRA_PIN_DISABLE>; 1227 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
@@ -1510,7 +1510,7 @@
1510 }; 1510 };
1511 pbb0 { 1511 pbb0 {
1512 nvidia,pins = "pbb0"; 1512 nvidia,pins = "pbb0";
1513 nvidia,function = "rsvd1"; 1513 nvidia,function = "i2s4";
1514 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1514 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1515 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1515 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1516 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1516 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1575,7 +1575,7 @@
1575 }; 1575 };
1576 pcc1 { 1576 pcc1 {
1577 nvidia,pins = "pcc1"; 1577 nvidia,pins = "pcc1";
1578 nvidia,function = "rsvd1"; 1578 nvidia,function = "i2s4";
1579 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 1579 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
1580 nvidia,tristate = <TEGRA_PIN_DISABLE>; 1580 nvidia,tristate = <TEGRA_PIN_DISABLE>;
1581 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 1581 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
@@ -1762,7 +1762,7 @@
1762 compatible = "realtek,rt5640"; 1762 compatible = "realtek,rt5640";
1763 reg = <0x1c>; 1763 reg = <0x1c>;
1764 interrupt-parent = <&gpio>; 1764 interrupt-parent = <&gpio>;
1765 interrupts = <TEGRA_GPIO(X, 3) GPIO_ACTIVE_HIGH>; 1765 interrupts = <TEGRA_GPIO(X, 3) IRQ_TYPE_EDGE_FALLING>;
1766 realtek,ldo1-en-gpios = 1766 realtek,ldo1-en-gpios =
1767 <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_HIGH>; 1767 <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_HIGH>;
1768 }; 1768 };
diff --git a/arch/arm/boot/dts/tegra30-colibri-eval-v3.dts b/arch/arm/boot/dts/tegra30-colibri-eval-v3.dts
index 3c5fb2430212..16e1f387aa6d 100644
--- a/arch/arm/boot/dts/tegra30-colibri-eval-v3.dts
+++ b/arch/arm/boot/dts/tegra30-colibri-eval-v3.dts
@@ -56,11 +56,11 @@
56 */ 56 */
57 i2c@7000c000 { 57 i2c@7000c000 {
58 status = "okay"; 58 status = "okay";
59 clock-frequency = <100000>; 59 clock-frequency = <400000>;
60 60
61 /* M41T0M6 real time clock on carrier board */ 61 /* M41T0M6 real time clock on carrier board */
62 rtc@68 { 62 rtc@68 {
63 compatible = "st,m41t00"; 63 compatible = "st,m41t0";
64 reg = <0x68>; 64 reg = <0x68>;
65 }; 65 };
66 }; 66 };
@@ -79,7 +79,7 @@
79 reg = <0>; 79 reg = <0>;
80 clocks = <&clk16m>; 80 clocks = <&clk16m>;
81 interrupt-parent = <&gpio>; 81 interrupt-parent = <&gpio>;
82 interrupts = <TEGRA_GPIO(S, 0) GPIO_ACTIVE_LOW>; 82 interrupts = <TEGRA_GPIO(S, 0) IRQ_TYPE_EDGE_RISING>;
83 spi-max-frequency = <10000000>; 83 spi-max-frequency = <10000000>;
84 }; 84 };
85 spidev0: spi@1 { 85 spidev0: spi@1 {
diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi b/arch/arm/boot/dts/tegra30-colibri.dtsi
index 139bfa028b04..c44d8c40c410 100644
--- a/arch/arm/boot/dts/tegra30-colibri.dtsi
+++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
@@ -215,7 +215,7 @@
215 }; 215 };
216 216
217 hdmiddc: i2c@7000c700 { 217 hdmiddc: i2c@7000c700 {
218 clock-frequency = <100000>; 218 clock-frequency = <10000>;
219 }; 219 };
220 220
221 /* 221 /*
@@ -363,7 +363,6 @@
363 363
364 stmpe_touchscreen { 364 stmpe_touchscreen {
365 compatible = "st,stmpe-ts"; 365 compatible = "st,stmpe-ts";
366 reg = <0>;
367 /* 3.25 MHz ADC clock speed */ 366 /* 3.25 MHz ADC clock speed */
368 st,adc-freq = <1>; 367 st,adc-freq = <1>;
369 /* 8 sample average control */ 368 /* 8 sample average control */
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index c3e9f1e847db..a110cf84d85f 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -91,6 +91,19 @@
91 }; 91 };
92 }; 92 };
93 93
94 iram@40000000 {
95 compatible = "mmio-sram";
96 reg = <0x40000000 0x40000>;
97 #address-cells = <1>;
98 #size-cells = <1>;
99 ranges = <0 0x40000000 0x40000>;
100
101 vde_pool: vde@400 {
102 reg = <0x400 0x3fc00>;
103 pool;
104 };
105 };
106
94 host1x@50000000 { 107 host1x@50000000 {
95 compatible = "nvidia,tegra30-host1x", "simple-bus"; 108 compatible = "nvidia,tegra30-host1x", "simple-bus";
96 reg = <0x50000000 0x00024000>; 109 reg = <0x50000000 0x00024000>;
@@ -358,6 +371,28 @@
358 */ 371 */
359 }; 372 };
360 373
374 vde@6001a000 {
375 compatible = "nvidia,tegra30-vde", "nvidia,tegra20-vde";
376 reg = <0x6001a000 0x1000 /* Syntax Engine */
377 0x6001b000 0x1000 /* Video Bitstream Engine */
378 0x6001c000 0x100 /* Macroblock Engine */
379 0x6001c200 0x100 /* Post-processing Engine */
380 0x6001c400 0x100 /* Motion Compensation Engine */
381 0x6001c600 0x100 /* Transform Engine */
382 0x6001c800 0x100 /* Pixel prediction block */
383 0x6001ca00 0x100 /* Video DMA */
384 0x6001d800 0x400>; /* Video frame controls */
385 reg-names = "sxe", "bsev", "mbe", "ppe", "mce",
386 "tfe", "ppb", "vdma", "frameid";
387 iram = <&vde_pool>; /* IRAM region */
388 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, /* Sync token interrupt */
389 <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, /* BSE-V interrupt */
390 <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; /* SXE interrupt */
391 interrupt-names = "sync-token", "bsev", "sxe";
392 clocks = <&tegra_car TEGRA30_CLK_VDE>;
393 resets = <&tegra_car 61>;
394 };
395
361 apbmisc@70000800 { 396 apbmisc@70000800 {
362 compatible = "nvidia,tegra30-apbmisc", "nvidia,tegra20-apbmisc"; 397 compatible = "nvidia,tegra30-apbmisc", "nvidia,tegra20-apbmisc";
363 reg = <0x70000800 0x64 /* Chip revision */ 398 reg = <0x70000800 0x64 /* Chip revision */
diff --git a/arch/arm/boot/dts/uniphier-ld4-ref.dts b/arch/arm/boot/dts/uniphier-ld4-ref.dts
index a3afd0cda42f..21407e159bf7 100644
--- a/arch/arm/boot/dts/uniphier-ld4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld4-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD4 Reference Board 2//
3 * 3// Device Tree Source for UniPhier LD4 Reference Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-ld4.dtsi" 9#include "uniphier-ld4.dtsi"
diff --git a/arch/arm/boot/dts/uniphier-ld4.dtsi b/arch/arm/boot/dts/uniphier-ld4.dtsi
index 0459e84d4d8e..37950ad2de7c 100644
--- a/arch/arm/boot/dts/uniphier-ld4.dtsi
+++ b/arch/arm/boot/dts/uniphier-ld4.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD4 SoC 2//
3 * 3// Device Tree Source for UniPhier LD4 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/uniphier-gpio.h> 8#include <dt-bindings/gpio/uniphier-gpio.h>
11 9
diff --git a/arch/arm/boot/dts/uniphier-ld6b-ref.dts b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
index 811b999800ed..a0a44a422e12 100644
--- a/arch/arm/boot/dts/uniphier-ld6b-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD6b Reference Board 2//
3 * 3// Device Tree Source for UniPhier LD6b Reference Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-ld6b.dtsi" 9#include "uniphier-ld6b.dtsi"
@@ -67,6 +65,17 @@
67 status = "okay"; 65 status = "okay";
68}; 66};
69 67
68&eth {
69 status = "okay";
70 phy-handle = <&ethphy>;
71};
72
73&mdio {
74 ethphy: ethphy@0 {
75 reg = <0>;
76 };
77};
78
70&nand { 79&nand {
71 status = "okay"; 80 status = "okay";
72}; 81};
diff --git a/arch/arm/boot/dts/uniphier-ld6b.dtsi b/arch/arm/boot/dts/uniphier-ld6b.dtsi
index 9a7b25cc8233..4d07a94c6b34 100644
--- a/arch/arm/boot/dts/uniphier-ld6b.dtsi
+++ b/arch/arm/boot/dts/uniphier-ld6b.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD6b SoC 2//
3 * 3// Device Tree Source for UniPhier LD6b SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/* 8/*
11 * LD6b consists of two silicon dies: D-chip and A-chip. 9 * LD6b consists of two silicon dies: D-chip and A-chip.
diff --git a/arch/arm/boot/dts/uniphier-pinctrl.dtsi b/arch/arm/boot/dts/uniphier-pinctrl.dtsi
index de481c372467..9847af85b542 100644
--- a/arch/arm/boot/dts/uniphier-pinctrl.dtsi
+++ b/arch/arm/boot/dts/uniphier-pinctrl.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier SoCs default pinctrl settings 2//
3 * 3// Device Tree Source for UniPhier SoCs default pinctrl settings
4 * Copyright (C) 2015-2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2017 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10&pinctrl { 8&pinctrl {
11 pinctrl_aout: aout { 9 pinctrl_aout: aout {
@@ -13,6 +11,46 @@
13 function = "aout"; 11 function = "aout";
14 }; 12 };
15 13
14 pinctrl_ain1: ain1 {
15 groups = "ain1";
16 function = "ain1";
17 };
18
19 pinctrl_ain2: ain2 {
20 groups = "ain2";
21 function = "ain2";
22 };
23
24 pinctrl_ainiec1: ainiec1 {
25 groups = "ainiec1";
26 function = "ainiec1";
27 };
28
29 pinctrl_aout1: aout1 {
30 groups = "aout1";
31 function = "aout1";
32 };
33
34 pinctrl_aout2: aout2 {
35 groups = "aout2";
36 function = "aout2";
37 };
38
39 pinctrl_aout3: aout3 {
40 groups = "aout3";
41 function = "aout3";
42 };
43
44 pinctrl_aoutiec1: aoutiec1 {
45 groups = "aoutiec1";
46 function = "aoutiec1";
47 };
48
49 pinctrl_aoutiec2: aoutiec2 {
50 groups = "aoutiec2";
51 function = "aoutiec2";
52 };
53
16 pinctrl_emmc: emmc { 54 pinctrl_emmc: emmc {
17 groups = "emmc", "emmc_dat8"; 55 groups = "emmc", "emmc_dat8";
18 function = "emmc"; 56 function = "emmc";
diff --git a/arch/arm/boot/dts/uniphier-pro4-ace.dts b/arch/arm/boot/dts/uniphier-pro4-ace.dts
index 089419cee273..db1b08935ae5 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ace.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ace.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Pro4 Ace Board 2//
3 * 3// Device Tree Source for UniPhier Pro4 Ace Board
4 * Copyright (C) 2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pro4.dtsi" 9#include "uniphier-pro4.dtsi"
@@ -77,3 +75,14 @@
77&usb3 { 75&usb3 {
78 status = "okay"; 76 status = "okay";
79}; 77};
78
79&eth {
80 status = "okay";
81 phy-handle = <&ethphy>;
82};
83
84&mdio {
85 ethphy: ethphy@1 {
86 reg = <1>;
87 };
88};
diff --git a/arch/arm/boot/dts/uniphier-pro4-ref.dts b/arch/arm/boot/dts/uniphier-pro4-ref.dts
index 6a004e5cf786..efb084983b82 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Pro4 Reference Board 2//
3 * 3// Device Tree Source for UniPhier Pro4 Reference Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pro4.dtsi" 9#include "uniphier-pro4.dtsi"
@@ -75,6 +73,17 @@
75 status = "okay"; 73 status = "okay";
76}; 74};
77 75
76&eth {
77 status = "okay";
78 phy-handle = <&ethphy>;
79};
80
81&mdio {
82 ethphy: ethphy@0 {
83 reg = <0>;
84 };
85};
86
78&nand { 87&nand {
79 status = "okay"; 88 status = "okay";
80}; 89};
diff --git a/arch/arm/boot/dts/uniphier-pro4-sanji.dts b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
index adef212b45b2..dac4d6679a32 100644
--- a/arch/arm/boot/dts/uniphier-pro4-sanji.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Pro4 Sanji Board 2//
3 * 3// Device Tree Source for UniPhier Pro4 Sanji Board
4 * Copyright (C) 2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pro4.dtsi" 9#include "uniphier-pro4.dtsi"
@@ -72,3 +70,14 @@
72&usb3 { 70&usb3 {
73 status = "okay"; 71 status = "okay";
74}; 72};
73
74&eth {
75 status = "okay";
76 phy-handle = <&ethphy>;
77};
78
79&mdio {
80 ethphy: ethphy@1 {
81 reg = <1>;
82 };
83};
diff --git a/arch/arm/boot/dts/uniphier-pro4.dtsi b/arch/arm/boot/dts/uniphier-pro4.dtsi
index 1a29a8619856..844124bc9c9c 100644
--- a/arch/arm/boot/dts/uniphier-pro4.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro4.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Pro4 SoC 2//
3 * 3// Device Tree Source for UniPhier Pro4 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/uniphier-gpio.h> 8#include <dt-bindings/gpio/uniphier-gpio.h>
11 9
@@ -366,6 +364,24 @@
366 }; 364 };
367 }; 365 };
368 366
367 eth: ethernet@65000000 {
368 compatible = "socionext,uniphier-pro4-ave4";
369 status = "disabled";
370 reg = <0x65000000 0x8500>;
371 interrupts = <0 66 4>;
372 pinctrl-names = "default";
373 pinctrl-0 = <&pinctrl_ether_rgmii>;
374 clocks = <&sys_clk 6>;
375 resets = <&sys_rst 6>;
376 phy-mode = "rgmii";
377 local-mac-address = [00 00 00 00 00 00];
378
379 mdio: mdio {
380 #address-cells = <1>;
381 #size-cells = <0>;
382 };
383 };
384
369 nand: nand@68000000 { 385 nand: nand@68000000 {
370 compatible = "socionext,uniphier-denali-nand-v5a"; 386 compatible = "socionext,uniphier-denali-nand-v5a";
371 status = "disabled"; 387 status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-pro5.dtsi b/arch/arm/boot/dts/uniphier-pro5.dtsi
index f291dd63de9c..06c2cef91ec7 100644
--- a/arch/arm/boot/dts/uniphier-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro5.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Pro5 SoC 2//
3 * 3// Device Tree Source for UniPhier Pro5 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/ { 8/ {
11 compatible = "socionext,uniphier-pro5"; 9 compatible = "socionext,uniphier-pro5";
diff --git a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
index 7dfae2667f50..bed26b8ed9a3 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier PXs2 Gentil Board 2//
3 * 3// Device Tree Source for UniPhier PXs2 Gentil Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pxs2.dtsi" 9#include "uniphier-pxs2.dtsi"
@@ -34,6 +32,12 @@
34 device_type = "memory"; 32 device_type = "memory";
35 reg = <0x80000000 0x80000000>; 33 reg = <0x80000000 0x80000000>;
36 }; 34 };
35
36 sound {
37 compatible = "audio-graph-card";
38 label = "UniPhier PXs2";
39 dais = <&i2s_port2>;
40 };
37}; 41};
38 42
39&serial2 { 43&serial2 {
@@ -50,6 +54,35 @@
50 }; 54 };
51}; 55};
52 56
57&i2s_aux {
58 dai-format = "i2s";
59 remote-endpoint = <&wm_speaker>;
60};
61
53&i2c2 { 62&i2c2 {
54 status = "okay"; 63 status = "okay";
64
65 wm8960@1a {
66 compatible = "wlf,wm8960";
67 reg = <0x1a>;
68 #sound-dai-cells = <0>;
69
70 port@0 {
71 wm_speaker: endpoint {
72 dai-format = "i2s";
73 remote-endpoint = <&i2s_aux>;
74 };
75 };
76 };
77};
78
79&eth {
80 status = "okay";
81 phy-handle = <&ethphy>;
82};
83
84&mdio {
85 ethphy: ethphy@1 {
86 reg = <1>;
87 };
55}; 88};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
index 0cf615463a82..b13d2d16ddad 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier PXs2 Vodka Board 2//
3 * 3// Device Tree Source for UniPhier PXs2 Vodka Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pxs2.dtsi" 9#include "uniphier-pxs2.dtsi"
@@ -32,12 +30,60 @@
32 device_type = "memory"; 30 device_type = "memory";
33 reg = <0x80000000 0x80000000>; 31 reg = <0x80000000 0x80000000>;
34 }; 32 };
33
34 sound {
35 compatible = "audio-graph-card";
36 label = "UniPhier PXs2";
37 dais = <&spdif_port0
38 &comp_spdif_port0>;
39 };
40
41 spdif-out {
42 compatible = "linux,spdif-dit";
43 #sound-dai-cells = <0>;
44
45 port@0 {
46 spdif_tx: endpoint {
47 remote-endpoint = <&spdif_hiecout1>;
48 };
49 };
50 };
51
52 comp-spdif-out {
53 compatible = "linux,spdif-dit";
54 #sound-dai-cells = <0>;
55
56 port@0 {
57 comp_spdif_tx: endpoint {
58 remote-endpoint = <&comp_spdif_hiecout1>;
59 };
60 };
61 };
35}; 62};
36 63
37&serial2 { 64&serial2 {
38 status = "okay"; 65 status = "okay";
39}; 66};
40 67
68&spdif_hiecout1 {
69 remote-endpoint = <&spdif_tx>;
70};
71
72&comp_spdif_hiecout1 {
73 remote-endpoint = <&comp_spdif_tx>;
74};
75
41&i2c0 { 76&i2c0 {
42 status = "okay"; 77 status = "okay";
43}; 78};
79
80&eth {
81 status = "okay";
82 phy-handle = <&ethphy>;
83};
84
85&mdio {
86 ethphy: ethphy@1 {
87 reg = <1>;
88 };
89};
diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index c083468c17db..595045441c9c 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier PXs2 SoC 2//
3 * 3// Device Tree Source for UniPhier PXs2 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/uniphier-gpio.h> 8#include <dt-bindings/gpio/uniphier-gpio.h>
11#include <dt-bindings/thermal/thermal.h> 9#include <dt-bindings/thermal/thermal.h>
@@ -227,6 +225,60 @@
227 <21 217 3>; 225 <21 217 3>;
228 }; 226 };
229 227
228 audio@56000000 {
229 compatible = "socionext,uniphier-pxs2-aio";
230 reg = <0x56000000 0x80000>;
231 interrupts = <0 144 4>;
232 pinctrl-names = "default";
233 pinctrl-0 = <&pinctrl_ain1>,
234 <&pinctrl_ain2>,
235 <&pinctrl_ainiec1>,
236 <&pinctrl_aout2>,
237 <&pinctrl_aout3>,
238 <&pinctrl_aoutiec1>,
239 <&pinctrl_aoutiec2>;
240 clock-names = "aio";
241 clocks = <&sys_clk 40>;
242 reset-names = "aio";
243 resets = <&sys_rst 40>;
244 #sound-dai-cells = <1>;
245
246 i2s_port0: port@0 {
247 i2s_hdmi: endpoint {
248 };
249 };
250
251 i2s_port1: port@1 {
252 i2s_line: endpoint {
253 };
254 };
255
256 i2s_port2: port@2 {
257 i2s_aux: endpoint {
258 };
259 };
260
261 spdif_port0: port@3 {
262 spdif_hiecout1: endpoint {
263 };
264 };
265
266 spdif_port1: port@4 {
267 spdif_iecout1: endpoint {
268 };
269 };
270
271 comp_spdif_port0: port@5 {
272 comp_spdif_hiecout1: endpoint {
273 };
274 };
275
276 comp_spdif_port1: port@6 {
277 comp_spdif_iecout1: endpoint {
278 };
279 };
280 };
281
230 i2c0: i2c@58780000 { 282 i2c0: i2c@58780000 {
231 compatible = "socionext,uniphier-fi2c"; 283 compatible = "socionext,uniphier-fi2c";
232 status = "disabled"; 284 status = "disabled";
@@ -446,6 +498,24 @@
446 }; 498 };
447 }; 499 };
448 500
501 eth: ethernet@65000000 {
502 compatible = "socionext,uniphier-pxs2-ave4";
503 status = "disabled";
504 reg = <0x65000000 0x8500>;
505 interrupts = <0 66 4>;
506 pinctrl-names = "default";
507 pinctrl-0 = <&pinctrl_ether_rgmii>;
508 clocks = <&sys_clk 6>;
509 resets = <&sys_rst 6>;
510 phy-mode = "rgmii";
511 local-mac-address = [00 00 00 00 00 00];
512
513 mdio: mdio {
514 #address-cells = <1>;
515 #size-cells = <0>;
516 };
517 };
518
449 nand: nand@68000000 { 519 nand: nand@68000000 {
450 compatible = "socionext,uniphier-denali-nand-v5b"; 520 compatible = "socionext,uniphier-denali-nand-v5b";
451 status = "disabled"; 521 status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-ref-daughter.dtsi b/arch/arm/boot/dts/uniphier-ref-daughter.dtsi
index 7a1c29b558d5..04e60c295319 100644
--- a/arch/arm/boot/dts/uniphier-ref-daughter.dtsi
+++ b/arch/arm/boot/dts/uniphier-ref-daughter.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Reference Daughter Board 2//
3 * 3// Device Tree Source for UniPhier Reference Daughter Board
4 * Copyright (C) 2015-2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2017 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10&i2c0 { 8&i2c0 {
11 eeprom@50 { 9 eeprom@50 {
diff --git a/arch/arm/boot/dts/uniphier-sld8-ref.dts b/arch/arm/boot/dts/uniphier-sld8-ref.dts
index e052ea3b4020..fe386fa2ea4b 100644
--- a/arch/arm/boot/dts/uniphier-sld8-ref.dts
+++ b/arch/arm/boot/dts/uniphier-sld8-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier sLD8 Reference Board 2//
3 * 3// Device Tree Source for UniPhier sLD8 Reference Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-sld8.dtsi" 9#include "uniphier-sld8.dtsi"
diff --git a/arch/arm/boot/dts/uniphier-sld8.dtsi b/arch/arm/boot/dts/uniphier-sld8.dtsi
index bc8c24078faa..e9b9b4f3c558 100644
--- a/arch/arm/boot/dts/uniphier-sld8.dtsi
+++ b/arch/arm/boot/dts/uniphier-sld8.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier sLD8 SoC 2//
3 * 3// Device Tree Source for UniPhier sLD8 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/uniphier-gpio.h> 8#include <dt-bindings/gpio/uniphier-gpio.h>
11 9
diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
index e4e7e1bb9172..bf441c2eff79 100644
--- a/arch/arm/boot/dts/uniphier-support-card.dtsi
+++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier Support Card (Expansion Board) 2//
3 * 3// Device Tree Source for UniPhier Support Card (Expansion Board)
4 * Copyright (C) 2015-2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2017 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10&system_bus { 8&system_bus {
11 status = "okay"; 9 status = "okay";
diff --git a/arch/arm/boot/dts/versatile-ab-ib2.dts b/arch/arm/boot/dts/versatile-ab-ib2.dts
new file mode 100644
index 000000000000..5890cb974f78
--- /dev/null
+++ b/arch/arm/boot/dts/versatile-ab-ib2.dts
@@ -0,0 +1,26 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * The Versatile AB with the IB2 expansion board mounted.
4 * This works as a superset of the Versatile AB.
5 */
6
7#include "versatile-ab.dts"
8
9/ {
10 model = "ARM Versatile AB + IB2 board";
11
12 /* Special IB2 control register */
13 ib2_syscon@27000000 {
14 compatible = "arm,versatile-ib2-syscon", "syscon", "simple-mfd";
15 reg = <0x27000000 0x4>;
16
17 led@00.4 {
18 compatible = "register-bit-led";
19 offset = <0x00>;
20 mask = <0x10>;
21 label = "versatile-ib2:0";
22 linux,default-trigger = "heartbeat";
23 default-state = "on";
24 };
25 };
26};
diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts
index 4a51612996bc..5f61d3609027 100644
--- a/arch/arm/boot/dts/versatile-ab.dts
+++ b/arch/arm/boot/dts/versatile-ab.dts
@@ -30,6 +30,43 @@
30 clock-frequency = <24000000>; 30 clock-frequency = <24000000>;
31 }; 31 };
32 32
33 bridge {
34 compatible = "ti,ths8134b", "ti,ths8134";
35 #address-cells = <1>;
36 #size-cells = <0>;
37
38 ports {
39 #address-cells = <1>;
40 #size-cells = <0>;
41
42 port@0 {
43 reg = <0>;
44
45 vga_bridge_in: endpoint {
46 remote-endpoint = <&clcd_pads_vga_dac>;
47 };
48 };
49
50 port@1 {
51 reg = <1>;
52
53 vga_bridge_out: endpoint {
54 remote-endpoint = <&vga_con_in>;
55 };
56 };
57 };
58 };
59
60 vga {
61 compatible = "vga-connector";
62
63 port {
64 vga_con_in: endpoint {
65 remote-endpoint = <&vga_bridge_out>;
66 };
67 };
68 };
69
33 core-module@10000000 { 70 core-module@10000000 {
34 compatible = "arm,core-module-versatile", "syscon", "simple-mfd"; 71 compatible = "arm,core-module-versatile", "syscon", "simple-mfd";
35 reg = <0x10000000 0x200>; 72 reg = <0x10000000 0x200>;
@@ -230,7 +267,39 @@
230 reg = <0x10120000 0x1000>; 267 reg = <0x10120000 0x1000>;
231 interrupts = <16>; 268 interrupts = <16>;
232 clocks = <&osc1>, <&pclk>; 269 clocks = <&osc1>, <&pclk>;
233 clock-names = "clcd", "apb_pclk"; 270 clock-names = "clcdclk", "apb_pclk";
271 /* 800x600 16bpp @ 36MHz works fine */
272 max-memory-bandwidth = <54000000>;
273
274 /*
275 * This port is routed through a PLD (Programmable
276 * Logic Device) that routes the output from the CLCD
277 * (after transformations) to the VGA DAC and also an
278 * external panel connector. The PLD is essential for
279 * supporting RGB565/BGR565.
280 *
281 * The signals from the port thus reaches two endpoints.
282 * The PLD is managed through a few special bits in the
283 * FPGA "sysreg".
284 *
285 * This arrangement can be clearly seen in
286 * ARM DUI 0225D, page 3-41, figure 3-19.
287 */
288 port@0 {
289 #address-cells = <1>;
290 #size-cells = <0>;
291
292 clcd_pads_panel: endpoint@0 {
293 reg = <0>;
294 remote-endpoint = <&panel_in>;
295 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
296 };
297 clcd_pads_vga_dac: endpoint@1 {
298 reg = <1>;
299 remote-endpoint = <&vga_bridge_in>;
300 arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
301 };
302 };
234 }; 303 };
235 304
236 sctl@101e0000 { 305 sctl@101e0000 {
@@ -319,8 +388,18 @@
319 ranges = <0 0x10000000 0x10000>; 388 ranges = <0 0x10000000 0x10000>;
320 389
321 sysreg@0 { 390 sysreg@0 {
322 compatible = "arm,versatile-sysreg", "syscon"; 391 compatible = "arm,versatile-sysreg", "syscon", "simple-mfd";
323 reg = <0x00000 0x1000>; 392 reg = <0x00000 0x1000>;
393
394 panel: display@0 {
395 compatible = "arm,versatile-tft-panel";
396
397 port {
398 panel_in: endpoint {
399 remote-endpoint = <&clcd_pads_panel>;
400 };
401 };
402 };
324 }; 403 };
325 404
326 aaci@4000 { 405 aaci@4000 {
diff --git a/arch/arm/boot/dts/vf500-colibri.dtsi b/arch/arm/boot/dts/vf500-colibri.dtsi
index 515c4d2f28b0..2e7e3cebba1c 100644
--- a/arch/arm/boot/dts/vf500-colibri.dtsi
+++ b/arch/arm/boot/dts/vf500-colibri.dtsi
@@ -46,7 +46,7 @@
46 model = "Toradex Colibri VF50 COM"; 46 model = "Toradex Colibri VF50 COM";
47 compatible = "toradex,vf610-colibri_vf50", "fsl,vf500"; 47 compatible = "toradex,vf610-colibri_vf50", "fsl,vf500";
48 48
49 memory { 49 memory@80000000 {
50 reg = <0x80000000 0x8000000>; 50 reg = <0x80000000 0x8000000>;
51 }; 51 };
52 52
diff --git a/arch/arm/boot/dts/vf500.dtsi b/arch/arm/boot/dts/vf500.dtsi
index 348bcd30c0f7..bbff0115e2fb 100644
--- a/arch/arm/boot/dts/vf500.dtsi
+++ b/arch/arm/boot/dts/vf500.dtsi
@@ -39,11 +39,16 @@
39 * OTHER DEALINGS IN THE SOFTWARE. 39 * OTHER DEALINGS IN THE SOFTWARE.
40 */ 40 */
41 41
42#include "skeleton.dtsi"
43#include "vfxxx.dtsi" 42#include "vfxxx.dtsi"
44#include <dt-bindings/interrupt-controller/arm-gic.h> 43#include <dt-bindings/interrupt-controller/arm-gic.h>
45 44
46/ { 45/ {
46 #address-cells = <1>;
47 #size-cells = <1>;
48 chosen { };
49 aliases { };
50 memory { device_type = "memory"; };
51
47 cpus { 52 cpus {
48 #address-cells = <1>; 53 #address-cells = <1>;
49 #size-cells = <0>; 54 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/vf610-colibri.dtsi b/arch/arm/boot/dts/vf610-colibri.dtsi
index 395812c52933..aeaf99f1f0fc 100644
--- a/arch/arm/boot/dts/vf610-colibri.dtsi
+++ b/arch/arm/boot/dts/vf610-colibri.dtsi
@@ -46,7 +46,7 @@
46 model = "Toradex Colibri VF61 COM"; 46 model = "Toradex Colibri VF61 COM";
47 compatible = "toradex,vf610-colibri_vf61", "fsl,vf610"; 47 compatible = "toradex,vf610-colibri_vf61", "fsl,vf610";
48 48
49 memory { 49 memory@80000000 {
50 reg = <0x80000000 0x10000000>; 50 reg = <0x80000000 0x10000000>;
51 }; 51 };
52}; 52};
diff --git a/arch/arm/boot/dts/vf610-cosmic.dts b/arch/arm/boot/dts/vf610-cosmic.dts
index 5447f2594659..a3014e8d97a9 100644
--- a/arch/arm/boot/dts/vf610-cosmic.dts
+++ b/arch/arm/boot/dts/vf610-cosmic.dts
@@ -19,7 +19,7 @@
19 bootargs = "console=ttyLP1,115200"; 19 bootargs = "console=ttyLP1,115200";
20 }; 20 };
21 21
22 memory { 22 memory@80000000 {
23 reg = <0x80000000 0x10000000>; 23 reg = <0x80000000 0x10000000>;
24 }; 24 };
25 25
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
index 6f787e67bd2e..6be7a828ae64 100644
--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -50,7 +50,7 @@
50 bootargs = "console=ttyLP1,115200"; 50 bootargs = "console=ttyLP1,115200";
51 }; 51 };
52 52
53 memory { 53 memory@80000000 {
54 reg = <0x80000000 0x8000000>; 54 reg = <0x80000000 0x8000000>;
55 }; 55 };
56 56
diff --git a/arch/arm/boot/dts/vf610-zii-dev.dtsi b/arch/arm/boot/dts/vf610-zii-dev.dtsi
index aadd36db0092..4890b8a5aa44 100644
--- a/arch/arm/boot/dts/vf610-zii-dev.dtsi
+++ b/arch/arm/boot/dts/vf610-zii-dev.dtsi
@@ -49,7 +49,7 @@
49 stdout-path = "serial0:115200n8"; 49 stdout-path = "serial0:115200n8";
50 }; 50 };
51 51
52 memory { 52 memory@80000000 {
53 reg = <0x80000000 0x20000000>; 53 reg = <0x80000000 0x20000000>;
54 }; 54 };
55 55
diff --git a/arch/arm/boot/dts/vf610m4-colibri.dts b/arch/arm/boot/dts/vf610m4-colibri.dts
index 7198e8cceb0d..41ec66a96990 100644
--- a/arch/arm/boot/dts/vf610m4-colibri.dts
+++ b/arch/arm/boot/dts/vf610m4-colibri.dts
@@ -51,10 +51,10 @@
51 51
52 chosen { 52 chosen {
53 bootargs = "console=ttyLP2,115200 clk_ignore_unused init=/linuxrc rw"; 53 bootargs = "console=ttyLP2,115200 clk_ignore_unused init=/linuxrc rw";
54 linux,stdout-path = "&uart2"; 54 stdout-path = "&uart2";
55 }; 55 };
56 56
57 memory { 57 memory@8c000000 {
58 reg = <0x8c000000 0x3000000>; 58 reg = <0x8c000000 0x3000000>;
59 }; 59 };
60}; 60};
diff --git a/arch/arm/boot/dts/vf610m4.dtsi b/arch/arm/boot/dts/vf610m4.dtsi
index 1474bd34d0f1..8293276b55a6 100644
--- a/arch/arm/boot/dts/vf610m4.dtsi
+++ b/arch/arm/boot/dts/vf610m4.dtsi
@@ -42,10 +42,17 @@
42 * OTHER DEALINGS IN THE SOFTWARE. 42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 43 */
44 44
45#include "skeleton.dtsi"
46#include "armv7-m.dtsi" 45#include "armv7-m.dtsi"
47#include "vfxxx.dtsi" 46#include "vfxxx.dtsi"
48 47
48/ {
49 #address-cells = <1>;
50 #size-cells = <1>;
51 chosen { };
52 aliases { };
53 memory { device_type = "memory"; };
54};
55
49&mscm_ir { 56&mscm_ir {
50 interrupt-parent = <&nvic>; 57 interrupt-parent = <&nvic>;
51}; 58};
diff --git a/arch/arm/boot/dts/zx296702.dtsi b/arch/arm/boot/dts/zx296702.dtsi
index 8a74efdb6360..240e7a23d81f 100644
--- a/arch/arm/boot/dts/zx296702.dtsi
+++ b/arch/arm/boot/dts/zx296702.dtsi
@@ -56,7 +56,7 @@
56 clocks = <&topclk ZX296702_A9_PERIPHCLK>; 56 clocks = <&topclk ZX296702_A9_PERIPHCLK>;
57 }; 57 };
58 58
59 l2cc: l2-cache-controller@0x00c00000 { 59 l2cc: l2-cache-controller@c00000 {
60 compatible = "arm,pl310-cache"; 60 compatible = "arm,pl310-cache";
61 reg = <0x00c00000 0x1000>; 61 reg = <0x00c00000 0x1000>;
62 cache-unified; 62 cache-unified;
@@ -67,30 +67,30 @@
67 arm,double-linefill-incr = <0>; 67 arm,double-linefill-incr = <0>;
68 }; 68 };
69 69
70 pcu: pcu@0xa0008000 { 70 pcu: pcu@a0008000 {
71 compatible = "zte,zx296702-pcu"; 71 compatible = "zte,zx296702-pcu";
72 reg = <0xa0008000 0x1000>; 72 reg = <0xa0008000 0x1000>;
73 }; 73 };
74 74
75 topclk: topclk@0x09800000 { 75 topclk: topclk@9800000 {
76 compatible = "zte,zx296702-topcrm-clk"; 76 compatible = "zte,zx296702-topcrm-clk";
77 reg = <0x09800000 0x1000>; 77 reg = <0x09800000 0x1000>;
78 #clock-cells = <1>; 78 #clock-cells = <1>;
79 }; 79 };
80 80
81 lsp1clk: lsp1clk@0x09400000 { 81 lsp1clk: lsp1clk@9400000 {
82 compatible = "zte,zx296702-lsp1crpm-clk"; 82 compatible = "zte,zx296702-lsp1crpm-clk";
83 reg = <0x09400000 0x1000>; 83 reg = <0x09400000 0x1000>;
84 #clock-cells = <1>; 84 #clock-cells = <1>;
85 }; 85 };
86 86
87 lsp0clk: lsp0clk@0x0b000000 { 87 lsp0clk: lsp0clk@b000000 {
88 compatible = "zte,zx296702-lsp0crpm-clk"; 88 compatible = "zte,zx296702-lsp0crpm-clk";
89 reg = <0x0b000000 0x1000>; 89 reg = <0x0b000000 0x1000>;
90 #clock-cells = <1>; 90 #clock-cells = <1>;
91 }; 91 };
92 92
93 uart0: serial@0x09405000 { 93 uart0: serial@9405000 {
94 compatible = "zte,zx296702-uart"; 94 compatible = "zte,zx296702-uart";
95 reg = <0x09405000 0x1000>; 95 reg = <0x09405000 0x1000>;
96 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; 96 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
@@ -98,7 +98,7 @@
98 status = "disabled"; 98 status = "disabled";
99 }; 99 };
100 100
101 uart1: serial@0x09406000 { 101 uart1: serial@9406000 {
102 compatible = "zte,zx296702-uart"; 102 compatible = "zte,zx296702-uart";
103 reg = <0x09406000 0x1000>; 103 reg = <0x09406000 0x1000>;
104 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; 104 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
@@ -106,7 +106,7 @@
106 status = "disabled"; 106 status = "disabled";
107 }; 107 };
108 108
109 mmc0: mmc@0x09408000 { 109 mmc0: mmc@9408000 {
110 compatible = "snps,dw-mshc"; 110 compatible = "snps,dw-mshc";
111 #address-cells = <1>; 111 #address-cells = <1>;
112 #size-cells = <0>; 112 #size-cells = <0>;
@@ -119,7 +119,7 @@
119 status = "disabled"; 119 status = "disabled";
120 }; 120 };
121 121
122 mmc1: mmc@0x0b003000 { 122 mmc1: mmc@b003000 {
123 compatible = "snps,dw-mshc"; 123 compatible = "snps,dw-mshc";
124 #address-cells = <1>; 124 #address-cells = <1>;
125 #size-cells = <0>; 125 #size-cells = <0>;
@@ -132,7 +132,7 @@
132 status = "disabled"; 132 status = "disabled";
133 }; 133 };
134 134
135 sysctrl: sysctrl@0xa0007000 { 135 sysctrl: sysctrl@a0007000 {
136 compatible = "zte,sysctrl", "syscon"; 136 compatible = "zte,sysctrl", "syscon";
137 reg = <0xa0007000 0x1000>; 137 reg = <0xa0007000 0x1000>;
138 }; 138 };
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index 0f79fe1ccd9d..e22507e23303 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -1,14 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */ 4 */
13 5
14/ { 6/ {
diff --git a/arch/arm/boot/dts/zynq-cc108.dts b/arch/arm/boot/dts/zynq-cc108.dts
new file mode 100644
index 000000000000..1a0f631c1d8d
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-cc108.dts
@@ -0,0 +1,75 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Xilinx CC108 board DTS
4 *
5 * (C) Copyright 2007-2018 Xilinx, Inc.
6 * (C) Copyright 2007-2013 Michal Simek
7 * (C) Copyright 2007-2012 PetaLogix Qld Pty Ltd
8 *
9 * Michal SIMEK <monstr@monstr.eu>
10 */
11/dts-v1/;
12/include/ "zynq-7000.dtsi"
13
14/ {
15 compatible = "xlnx,zynq-cc108", "xlnx,zynq-7000";
16 model = "Xilinx Zynq";
17
18 aliases {
19 ethernet0 = &gem0;
20 serial0 = &uart0;
21 };
22
23 chosen {
24 bootargs = "";
25 stdout-path = "serial0:115200n8";
26 };
27
28 memory@0 {
29 device_type = "memory";
30 reg = <0x0 0x20000000>;
31 };
32
33 usb_phy0: phy0 {
34 compatible = "usb-nop-xceiv";
35 #phy-cells = <0>;
36 };
37
38 usb_phy1: phy1 {
39 compatible = "usb-nop-xceiv";
40 #phy-cells = <0>;
41 };
42};
43
44&gem0 {
45 status = "okay";
46 phy-mode = "rgmii-id";
47 phy-handle = <&ethernet_phy>;
48
49 ethernet_phy: ethernet-phy@1 {
50 reg = <1>;
51 device_type = "ethernet-phy";
52 };
53};
54
55&sdhci1 {
56 status = "okay";
57 broken-cd ;
58 wp-inverted ;
59};
60
61&uart0 {
62 status = "okay";
63};
64
65&usb0 {
66 status = "okay";
67 dr_mode = "host";
68 usb-phy = <&usb_phy0>;
69};
70
71&usb1 {
72 status = "okay";
73 dr_mode = "host";
74 usb-phy = <&usb_phy1>;
75};
diff --git a/arch/arm/boot/dts/zynq-microzed.dts b/arch/arm/boot/dts/zynq-microzed.dts
index b9376a4904b4..aa4a0b6defb8 100644
--- a/arch/arm/boot/dts/zynq-microzed.dts
+++ b/arch/arm/boot/dts/zynq-microzed.dts
@@ -1,15 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 * Copyright (C) 2016 Jagan Teki <jteki@openedev.com> 4 * Copyright (C) 2016 Jagan Teki <jteki@openedev.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */ 5 */
14/dts-v1/; 6/dts-v1/;
15/include/ "zynq-7000.dtsi" 7/include/ "zynq-7000.dtsi"
@@ -23,7 +15,7 @@
23 serial0 = &uart1; 15 serial0 = &uart1;
24 }; 16 };
25 17
26 memory { 18 memory@0 {
27 device_type = "memory"; 19 device_type = "memory";
28 reg = <0x0 0x40000000>; 20 reg = <0x0 0x40000000>;
29 }; 21 };
diff --git a/arch/arm/boot/dts/zynq-parallella.dts b/arch/arm/boot/dts/zynq-parallella.dts
index 0144acfa9793..c05f4b67d4c1 100644
--- a/arch/arm/boot/dts/zynq-parallella.dts
+++ b/arch/arm/boot/dts/zynq-parallella.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (c) 2014 SUSE LINUX Products GmbH 3 * Copyright (c) 2014 SUSE LINUX Products GmbH
3 * 4 *
@@ -6,15 +7,6 @@
6 * Copyright (C) 2011 Xilinx 7 * Copyright (C) 2011 Xilinx
7 * Copyright (C) 2012 National Instruments Corp. 8 * Copyright (C) 2012 National Instruments Corp.
8 * Copyright (C) 2013 Xilinx 9 * Copyright (C) 2013 Xilinx
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */ 10 */
19/dts-v1/; 11/dts-v1/;
20/include/ "zynq-7000.dtsi" 12/include/ "zynq-7000.dtsi"
diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts
index 70a5de76b7db..f2330b0cb63d 100644
--- a/arch/arm/boot/dts/zynq-zc702.dts
+++ b/arch/arm/boot/dts/zynq-zc702.dts
@@ -1,15 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 * Copyright (C) 2012 National Instruments Corp. 4 * Copyright (C) 2012 National Instruments Corp.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */ 5 */
14/dts-v1/; 6/dts-v1/;
15#include "zynq-7000.dtsi" 7#include "zynq-7000.dtsi"
@@ -112,7 +104,7 @@
112 pinctrl-names = "default"; 104 pinctrl-names = "default";
113 pinctrl-0 = <&pinctrl_i2c0_default>; 105 pinctrl-0 = <&pinctrl_i2c0_default>;
114 106
115 i2cswitch@74 { 107 i2c-mux@74 {
116 compatible = "nxp,pca9548"; 108 compatible = "nxp,pca9548";
117 #address-cells = <1>; 109 #address-cells = <1>;
118 #size-cells = <0>; 110 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/zynq-zc706.dts b/arch/arm/boot/dts/zynq-zc706.dts
index cdc326ec3335..3ad1260ff2a1 100644
--- a/arch/arm/boot/dts/zynq-zc706.dts
+++ b/arch/arm/boot/dts/zynq-zc706.dts
@@ -1,15 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 * Copyright (C) 2012 National Instruments Corp. 4 * Copyright (C) 2012 National Instruments Corp.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */ 5 */
14/dts-v1/; 6/dts-v1/;
15#include "zynq-7000.dtsi" 7#include "zynq-7000.dtsi"
@@ -68,7 +60,7 @@
68 pinctrl-names = "default"; 60 pinctrl-names = "default";
69 pinctrl-0 = <&pinctrl_i2c0_default>; 61 pinctrl-0 = <&pinctrl_i2c0_default>;
70 62
71 i2cswitch@74 { 63 i2c-mux@74 {
72 compatible = "nxp,pca9548"; 64 compatible = "nxp,pca9548";
73 #address-cells = <1>; 65 #address-cells = <1>;
74 #size-cells = <0>; 66 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/zynq-zc770-xm010.dts b/arch/arm/boot/dts/zynq-zc770-xm010.dts
new file mode 100644
index 000000000000..6884f1ad66b7
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zc770-xm010.dts
@@ -0,0 +1,95 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Xilinx ZC770 XM010 board DTS
4 *
5 * Copyright (C) 2013-2018 Xilinx, Inc.
6 */
7/dts-v1/;
8#include "zynq-7000.dtsi"
9
10/ {
11 compatible = "xlnx,zynq-zc770-xm010", "xlnx,zynq-7000";
12 model = "Xilinx Zynq";
13
14 aliases {
15 ethernet0 = &gem0;
16 i2c0 = &i2c0;
17 serial0 = &uart1;
18 spi1 = &spi1;
19 };
20
21 chosen {
22 bootargs = "";
23 stdout-path = "serial0:115200n8";
24 };
25
26 memory@0 {
27 device_type = "memory";
28 reg = <0x0 0x40000000>;
29 };
30
31 usb_phy0: phy0 {
32 compatible = "usb-nop-xceiv";
33 #phy-cells = <0>;
34 };
35};
36
37&can0 {
38 status = "okay";
39};
40
41&gem0 {
42 status = "okay";
43 phy-mode = "rgmii-id";
44 phy-handle = <&ethernet_phy>;
45
46 ethernet_phy: ethernet-phy@7 {
47 reg = <7>;
48 device_type = "ethernet-phy";
49 };
50};
51
52&i2c0 {
53 status = "okay";
54 clock-frequency = <400000>;
55
56 eeprom: eeprom@52 {
57 compatible = "atmel,24c02";
58 reg = <0x52>;
59 };
60
61};
62
63&sdhci0 {
64 status = "okay";
65};
66
67&spi1 {
68 status = "okay";
69 num-cs = <4>;
70 is-decoded-cs = <0>;
71 flash@0 {
72 compatible = "sst25wf080", "jedec,spi-nor";
73 reg = <1>;
74 spi-max-frequency = <1000000>;
75 partitions {
76 compatible = "fixed-partitions";
77 #address-cells = <1>;
78 #size-cells = <1>;
79 partition@0 {
80 label = "data";
81 reg = <0x0 0x100000>;
82 };
83 };
84 };
85};
86
87&uart1 {
88 status = "okay";
89};
90
91&usb0 {
92 status = "okay";
93 dr_mode = "host";
94 usb-phy = <&usb_phy0>;
95};
diff --git a/arch/arm/boot/dts/zynq-zc770-xm011.dts b/arch/arm/boot/dts/zynq-zc770-xm011.dts
new file mode 100644
index 000000000000..b78883cee96a
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zc770-xm011.dts
@@ -0,0 +1,64 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Xilinx ZC770 XM013 board DTS
4 *
5 * Copyright (C) 2013-2018 Xilinx, Inc.
6 */
7/dts-v1/;
8#include "zynq-7000.dtsi"
9
10/ {
11 compatible = "xlnx,zynq-zc770-xm011", "xlnx,zynq-7000";
12 model = "Xilinx Zynq";
13
14 aliases {
15 i2c0 = &i2c1;
16 serial0 = &uart1;
17 spi0 = &spi0;
18 };
19
20 chosen {
21 bootargs = "";
22 stdout-path = "serial0:115200n8";
23 };
24
25 memory@0 {
26 device_type = "memory";
27 reg = <0x0 0x40000000>;
28 };
29
30 usb_phy1: phy1 {
31 compatible = "usb-nop-xceiv";
32 #phy-cells = <0>;
33 };
34};
35
36&can0 {
37 status = "okay";
38};
39
40&i2c1 {
41 status = "okay";
42 clock-frequency = <400000>;
43
44 eeprom: eeprom@52 {
45 compatible = "atmel,24c02";
46 reg = <0x52>;
47 };
48};
49
50&spi0 {
51 status = "okay";
52 num-cs = <4>;
53 is-decoded-cs = <0>;
54};
55
56&uart1 {
57 status = "okay";
58};
59
60&usb1 {
61 status = "okay";
62 dr_mode = "host";
63 usb-phy = <&usb_phy1>;
64};
diff --git a/arch/arm/boot/dts/zynq-zc770-xm012.dts b/arch/arm/boot/dts/zynq-zc770-xm012.dts
new file mode 100644
index 000000000000..c3169d63600d
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zc770-xm012.dts
@@ -0,0 +1,64 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Xilinx ZC770 XM012 board DTS
4 *
5 * Copyright (C) 2013-2018 Xilinx, Inc.
6 */
7/dts-v1/;
8#include "zynq-7000.dtsi"
9
10/ {
11 compatible = "xlnx,zynq-zc770-xm012", "xlnx,zynq-7000";
12 model = "Xilinx Zynq";
13
14 aliases {
15 i2c0 = &i2c0;
16 i2c1 = &i2c1;
17 serial0 = &uart1;
18 spi0 = &spi1;
19 };
20
21 chosen {
22 bootargs = "";
23 stdout-path = "serial0:115200n8";
24 };
25
26 memory@0 {
27 device_type = "memory";
28 reg = <0x0 0x40000000>;
29 };
30};
31
32&can1 {
33 status = "okay";
34};
35
36&i2c0 {
37 status = "okay";
38 clock-frequency = <400000>;
39
40 eeprom0: eeprom@52 {
41 compatible = "atmel,24c02";
42 reg = <0x52>;
43 };
44};
45
46&i2c1 {
47 status = "okay";
48 clock-frequency = <400000>;
49
50 eeprom1: eeprom@52 {
51 compatible = "atmel,24c02";
52 reg = <0x52>;
53 };
54};
55
56&spi1 {
57 status = "okay";
58 num-cs = <4>;
59 is-decoded-cs = <0>;
60};
61
62&uart1 {
63 status = "okay";
64};
diff --git a/arch/arm/boot/dts/zynq-zc770-xm013.dts b/arch/arm/boot/dts/zynq-zc770-xm013.dts
new file mode 100644
index 000000000000..8bb66859d774
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zc770-xm013.dts
@@ -0,0 +1,78 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Xilinx ZC770 XM013 board DTS
4 *
5 * Copyright (C) 2013 Xilinx, Inc.
6 */
7/dts-v1/;
8#include "zynq-7000.dtsi"
9
10/ {
11 compatible = "xlnx,zynq-zc770-xm013", "xlnx,zynq-7000";
12 model = "Xilinx Zynq";
13
14 aliases {
15 ethernet0 = &gem1;
16 i2c0 = &i2c1;
17 serial0 = &uart0;
18 spi1 = &spi0;
19 };
20
21 chosen {
22 bootargs = "";
23 stdout-path = "serial0:115200n8";
24 };
25
26 memory@0 {
27 device_type = "memory";
28 reg = <0x0 0x40000000>;
29 };
30};
31
32&can1 {
33 status = "okay";
34};
35
36&gem1 {
37 status = "okay";
38 phy-mode = "rgmii-id";
39 phy-handle = <&ethernet_phy>;
40
41 ethernet_phy: ethernet-phy@7 {
42 reg = <7>;
43 device_type = "ethernet-phy";
44 };
45};
46
47&i2c1 {
48 status = "okay";
49 clock-frequency = <400000>;
50
51 si570: clock-generator@55 {
52 #clock-cells = <0>;
53 compatible = "silabs,si570";
54 temperature-stability = <50>;
55 reg = <0x55>;
56 factory-fout = <156250000>;
57 clock-frequency = <148500000>;
58 };
59};
60
61&spi0 {
62 status = "okay";
63 num-cs = <4>;
64 is-decoded-cs = <0>;
65 eeprom: eeprom@0 {
66 at25,byte-len = <8192>;
67 at25,addr-mode = <2>;
68 at25,page-size = <32>;
69
70 compatible = "atmel,at25";
71 reg = <2>;
72 spi-max-frequency = <1000000>;
73 };
74};
75
76&uart0 {
77 status = "okay";
78};
diff --git a/arch/arm/boot/dts/zynq-zed.dts b/arch/arm/boot/dts/zynq-zed.dts
index 5e44dc12fd60..53c6883ce1f6 100644
--- a/arch/arm/boot/dts/zynq-zed.dts
+++ b/arch/arm/boot/dts/zynq-zed.dts
@@ -1,15 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 * Copyright (C) 2012 National Instruments Corp. 4 * Copyright (C) 2012 National Instruments Corp.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */ 5 */
14/dts-v1/; 6/dts-v1/;
15#include "zynq-7000.dtsi" 7#include "zynq-7000.dtsi"
diff --git a/arch/arm/boot/dts/zynq-zybo-z7.dts b/arch/arm/boot/dts/zynq-zybo-z7.dts
new file mode 100644
index 000000000000..1e713dc98920
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zybo-z7.dts
@@ -0,0 +1,58 @@
1// SPDX-License-Identifier: GPL-2.0+
2/dts-v1/;
3#include "zynq-7000.dtsi"
4
5/ {
6 model = "Zynq ZYBO Z7 Development Board";
7 compatible = "digilent,zynq-zybo-z7", "xlnx,zynq-7000";
8
9 aliases {
10 ethernet0 = &gem0;
11 serial0 = &uart1;
12 };
13
14 memory@0 {
15 device_type = "memory";
16 reg = <0x0 0x20000000>;
17 };
18
19 chosen {
20 bootargs = "";
21 stdout-path = "serial0:115200n8";
22 };
23
24 usb_phy0: phy0 {
25 #phy-cells = <0>;
26 compatible = "usb-nop-xceiv";
27 reset-gpios = <&gpio0 46 1>;
28 };
29};
30
31&clkc {
32 ps-clk-frequency = <33333333>;
33};
34
35&gem0 {
36 status = "okay";
37 phy-mode = "rgmii-id";
38 phy-handle = <&ethernet_phy>;
39
40 ethernet_phy: ethernet-phy@0 {
41 reg = <0>;
42 device_type = "ethernet-phy";
43 };
44};
45
46&sdhci0 {
47 status = "okay";
48};
49
50&uart1 {
51 status = "okay";
52};
53
54&usb0 {
55 status = "okay";
56 dr_mode = "host";
57 usb-phy = <&usb_phy0>;
58};
diff --git a/arch/arm/boot/dts/zynq-zybo.dts b/arch/arm/boot/dts/zynq-zybo.dts
index e40cafc5ee5b..a6c00e7fa767 100644
--- a/arch/arm/boot/dts/zynq-zybo.dts
+++ b/arch/arm/boot/dts/zynq-zybo.dts
@@ -1,15 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright (C) 2011 - 2014 Xilinx 3 * Copyright (C) 2011 - 2014 Xilinx
3 * Copyright (C) 2012 National Instruments Corp. 4 * Copyright (C) 2012 National Instruments Corp.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */ 5 */
14/dts-v1/; 6/dts-v1/;
15#include "zynq-7000.dtsi" 7#include "zynq-7000.dtsi"
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index da7387689b88..28f1d714e5b9 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -751,6 +751,7 @@ CONFIG_MMC_DW_ROCKCHIP=y
751CONFIG_MMC_SH_MMCIF=y 751CONFIG_MMC_SH_MMCIF=y
752CONFIG_MMC_SUNXI=y 752CONFIG_MMC_SUNXI=y
753CONFIG_MMC_BCM2835=y 753CONFIG_MMC_BCM2835=y
754CONFIG_MMC_SDHCI_OMAP=y
754CONFIG_NEW_LEDS=y 755CONFIG_NEW_LEDS=y
755CONFIG_LEDS_CLASS=y 756CONFIG_LEDS_CLASS=y
756CONFIG_LEDS_CLASS_FLASH=m 757CONFIG_LEDS_CLASS_FLASH=m
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 2f145c4af93a..bce7e5abcc05 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -319,7 +319,7 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
319CONFIG_RC_CORE=m 319CONFIG_RC_CORE=m
320CONFIG_MEDIA_CONTROLLER=y 320CONFIG_MEDIA_CONTROLLER=y
321CONFIG_VIDEO_V4L2_SUBDEV_API=y 321CONFIG_VIDEO_V4L2_SUBDEV_API=y
322CONFIG_LIRC=m 322CONFIG_LIRC=y
323CONFIG_RC_DEVICES=y 323CONFIG_RC_DEVICES=y
324CONFIG_IR_RX51=m 324CONFIG_IR_RX51=m
325CONFIG_V4L_PLATFORM_DRIVERS=y 325CONFIG_V4L_PLATFORM_DRIVERS=y
@@ -431,8 +431,11 @@ CONFIG_USB_ZERO=m
431CONFIG_USB_G_NOKIA=m 431CONFIG_USB_G_NOKIA=m
432CONFIG_MMC=y 432CONFIG_MMC=y
433CONFIG_SDIO_UART=y 433CONFIG_SDIO_UART=y
434CONFIG_MMC_SDHCI=y
435CONFIG_MMC_SDHCI_PLTFM=y
434CONFIG_MMC_OMAP=y 436CONFIG_MMC_OMAP=y
435CONFIG_MMC_OMAP_HS=y 437CONFIG_MMC_OMAP_HS=y
438CONFIG_MMC_SDHCI_OMAP=y
436CONFIG_NEW_LEDS=y 439CONFIG_NEW_LEDS=y
437CONFIG_LEDS_CLASS=m 440CONFIG_LEDS_CLASS=m
438CONFIG_LEDS_CPCAP=m 441CONFIG_LEDS_CPCAP=m
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 629f8e9981f1..cf2701cb0de8 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -83,7 +83,7 @@ static void dummy_clock_access(struct timespec64 *ts)
83} 83}
84 84
85static clock_access_fn __read_persistent_clock = dummy_clock_access; 85static clock_access_fn __read_persistent_clock = dummy_clock_access;
86static clock_access_fn __read_boot_clock = dummy_clock_access;; 86static clock_access_fn __read_boot_clock = dummy_clock_access;
87 87
88void read_persistent_clock64(struct timespec64 *ts) 88void read_persistent_clock64(struct timespec64 *ts)
89{ 89{
diff --git a/arch/arm/kvm/hyp/Makefile b/arch/arm/kvm/hyp/Makefile
index 5638ce0c9524..63d6b404d88e 100644
--- a/arch/arm/kvm/hyp/Makefile
+++ b/arch/arm/kvm/hyp/Makefile
@@ -7,6 +7,8 @@ ccflags-y += -fno-stack-protector -DDISABLE_BRANCH_PROFILING
7 7
8KVM=../../../../virt/kvm 8KVM=../../../../virt/kvm
9 9
10CFLAGS_ARMV7VE :=$(call cc-option, -march=armv7ve)
11
10obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o 12obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o
11obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v3-sr.o 13obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v3-sr.o
12obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/timer-sr.o 14obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/timer-sr.o
@@ -15,7 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o
15obj-$(CONFIG_KVM_ARM_HOST) += cp15-sr.o 17obj-$(CONFIG_KVM_ARM_HOST) += cp15-sr.o
16obj-$(CONFIG_KVM_ARM_HOST) += vfp.o 18obj-$(CONFIG_KVM_ARM_HOST) += vfp.o
17obj-$(CONFIG_KVM_ARM_HOST) += banked-sr.o 19obj-$(CONFIG_KVM_ARM_HOST) += banked-sr.o
20CFLAGS_banked-sr.o += $(CFLAGS_ARMV7VE)
21
18obj-$(CONFIG_KVM_ARM_HOST) += entry.o 22obj-$(CONFIG_KVM_ARM_HOST) += entry.o
19obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o 23obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o
20obj-$(CONFIG_KVM_ARM_HOST) += switch.o 24obj-$(CONFIG_KVM_ARM_HOST) += switch.o
25CFLAGS_switch.o += $(CFLAGS_ARMV7VE)
21obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o 26obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o
diff --git a/arch/arm/kvm/hyp/banked-sr.c b/arch/arm/kvm/hyp/banked-sr.c
index 111bda8cdebd..be4b8b0a40ad 100644
--- a/arch/arm/kvm/hyp/banked-sr.c
+++ b/arch/arm/kvm/hyp/banked-sr.c
@@ -20,6 +20,10 @@
20 20
21#include <asm/kvm_hyp.h> 21#include <asm/kvm_hyp.h>
22 22
23/*
24 * gcc before 4.9 doesn't understand -march=armv7ve, so we have to
25 * trick the assembler.
26 */
23__asm__(".arch_extension virt"); 27__asm__(".arch_extension virt");
24 28
25void __hyp_text __banked_save_state(struct kvm_cpu_context *ctxt) 29void __hyp_text __banked_save_state(struct kvm_cpu_context *ctxt)
diff --git a/arch/arm/mach-clps711x/board-dt.c b/arch/arm/mach-clps711x/board-dt.c
index ee1f83b1a332..4c89a8e9a2e3 100644
--- a/arch/arm/mach-clps711x/board-dt.c
+++ b/arch/arm/mach-clps711x/board-dt.c
@@ -69,7 +69,7 @@ static void clps711x_restart(enum reboot_mode mode, const char *cmd)
69 soft_restart(0); 69 soft_restart(0);
70} 70}
71 71
72static const char *clps711x_compat[] __initconst = { 72static const char *const clps711x_compat[] __initconst = {
73 "cirrus,ep7209", 73 "cirrus,ep7209",
74 NULL 74 NULL
75}; 75};
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index e457f299cd44..d6b11907380c 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -368,7 +368,7 @@ static struct spi_eeprom at25640a = {
368 .flags = EE_ADDR2, 368 .flags = EE_ADDR2,
369}; 369};
370 370
371static struct spi_board_info dm355_evm_spi_info[] __initconst = { 371static const struct spi_board_info dm355_evm_spi_info[] __initconst = {
372 { 372 {
373 .modalias = "at25", 373 .modalias = "at25",
374 .platform_data = &at25640a, 374 .platform_data = &at25640a,
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index be997243447b..fad9a5611a5d 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -217,7 +217,7 @@ static struct spi_eeprom at25640a = {
217 .flags = EE_ADDR2, 217 .flags = EE_ADDR2,
218}; 218};
219 219
220static struct spi_board_info dm355_leopard_spi_info[] __initconst = { 220static const struct spi_board_info dm355_leopard_spi_info[] __initconst = {
221 { 221 {
222 .modalias = "at25", 222 .modalias = "at25",
223 .platform_data = &at25640a, 223 .platform_data = &at25640a,
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index e75741fb2c1d..e3780986d2a3 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -726,7 +726,7 @@ static struct spi_eeprom at25640 = {
726 .flags = EE_ADDR2, 726 .flags = EE_ADDR2,
727}; 727};
728 728
729static struct spi_board_info dm365_evm_spi_info[] __initconst = { 729static const struct spi_board_info dm365_evm_spi_info[] __initconst = {
730 { 730 {
731 .modalias = "at25", 731 .modalias = "at25",
732 .platform_data = &at25640, 732 .platform_data = &at25640,
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 6b32dc527edc..2c20599cc350 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -41,7 +41,7 @@ config MACH_ARMADA_375
41 depends on ARCH_MULTI_V7 41 depends on ARCH_MULTI_V7
42 select ARMADA_370_XP_IRQ 42 select ARMADA_370_XP_IRQ
43 select ARM_ERRATA_720789 43 select ARM_ERRATA_720789
44 select ARM_ERRATA_753970 44 select PL310_ERRATA_753970
45 select ARM_GIC 45 select ARM_GIC
46 select ARMADA_375_CLK 46 select ARMADA_375_CLK
47 select HAVE_ARM_SCU 47 select HAVE_ARM_SCU
@@ -57,7 +57,7 @@ config MACH_ARMADA_38X
57 bool "Marvell Armada 380/385 boards" 57 bool "Marvell Armada 380/385 boards"
58 depends on ARCH_MULTI_V7 58 depends on ARCH_MULTI_V7
59 select ARM_ERRATA_720789 59 select ARM_ERRATA_720789
60 select ARM_ERRATA_753970 60 select PL310_ERRATA_753970
61 select ARM_GIC 61 select ARM_GIC
62 select ARM_GLOBAL_TIMER 62 select ARM_GLOBAL_TIMER
63 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 63 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 43e3e188f521..fa512413a471 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -1011,17 +1011,17 @@ static int clk_debugfs_register_one(struct clk *c)
1011 return -ENOMEM; 1011 return -ENOMEM;
1012 c->dent = d; 1012 c->dent = d;
1013 1013
1014 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount); 1014 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount);
1015 if (!d) { 1015 if (!d) {
1016 err = -ENOMEM; 1016 err = -ENOMEM;
1017 goto err_out; 1017 goto err_out;
1018 } 1018 }
1019 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 1019 d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate);
1020 if (!d) { 1020 if (!d) {
1021 err = -ENOMEM; 1021 err = -ENOMEM;
1022 goto err_out; 1022 goto err_out;
1023 } 1023 }
1024 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags); 1024 d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags);
1025 if (!d) { 1025 if (!d) {
1026 err = -ENOMEM; 1026 err = -ENOMEM;
1027 goto err_out; 1027 goto err_out;
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 4bb6751864a5..fc5fb776a710 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -299,8 +299,6 @@ static void irq_save_context(void)
299 if (soc_is_dra7xx()) 299 if (soc_is_dra7xx())
300 return; 300 return;
301 301
302 if (!sar_base)
303 sar_base = omap4_get_sar_ram_base();
304 if (wakeupgen_ops && wakeupgen_ops->save_context) 302 if (wakeupgen_ops && wakeupgen_ops->save_context)
305 wakeupgen_ops->save_context(); 303 wakeupgen_ops->save_context();
306} 304}
@@ -598,6 +596,8 @@ static int __init wakeupgen_init(struct device_node *node,
598 irq_hotplug_init(); 596 irq_hotplug_init();
599 irq_pm_init(); 597 irq_pm_init();
600 598
599 sar_base = omap4_get_sar_ram_base();
600
601 return 0; 601 return 0;
602} 602}
603IRQCHIP_DECLARE(ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init); 603IRQCHIP_DECLARE(ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 124f9af34a15..34156eca8e23 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -977,6 +977,9 @@ static int _enable_clocks(struct omap_hwmod *oh)
977 977
978 pr_debug("omap_hwmod: %s: enabling clocks\n", oh->name); 978 pr_debug("omap_hwmod: %s: enabling clocks\n", oh->name);
979 979
980 if (oh->flags & HWMOD_OPT_CLKS_NEEDED)
981 _enable_optional_clocks(oh);
982
980 if (oh->_clk) 983 if (oh->_clk)
981 clk_enable(oh->_clk); 984 clk_enable(oh->_clk);
982 985
@@ -985,9 +988,6 @@ static int _enable_clocks(struct omap_hwmod *oh)
985 clk_enable(os->_clk); 988 clk_enable(os->_clk);
986 } 989 }
987 990
988 if (oh->flags & HWMOD_OPT_CLKS_NEEDED)
989 _enable_optional_clocks(oh);
990
991 /* The opt clocks are controlled by the device driver. */ 991 /* The opt clocks are controlled by the device driver. */
992 992
993 return 0; 993 return 0;
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 366158a54fcd..6f68576e5695 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -186,7 +186,7 @@ static void omap_pm_end(void)
186 cpu_idle_poll_ctrl(false); 186 cpu_idle_poll_ctrl(false);
187} 187}
188 188
189static void omap_pm_finish(void) 189static void omap_pm_wake(void)
190{ 190{
191 if (soc_is_omap34xx()) 191 if (soc_is_omap34xx())
192 omap_prcm_irq_complete(); 192 omap_prcm_irq_complete();
@@ -196,7 +196,7 @@ static const struct platform_suspend_ops omap_pm_ops = {
196 .begin = omap_pm_begin, 196 .begin = omap_pm_begin,
197 .end = omap_pm_end, 197 .end = omap_pm_end,
198 .enter = omap_pm_enter, 198 .enter = omap_pm_enter,
199 .finish = omap_pm_finish, 199 .wake = omap_pm_wake,
200 .valid = suspend_valid_only_mem, 200 .valid = suspend_valid_only_mem,
201}; 201};
202 202
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index ece09c9461f7..d61fbd7a2840 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -156,12 +156,6 @@ static struct clock_event_device clockevent_gpt = {
156 .tick_resume = omap2_gp_timer_shutdown, 156 .tick_resume = omap2_gp_timer_shutdown,
157}; 157};
158 158
159static struct property device_disabled = {
160 .name = "status",
161 .length = sizeof("disabled"),
162 .value = "disabled",
163};
164
165static const struct of_device_id omap_timer_match[] __initconst = { 159static const struct of_device_id omap_timer_match[] __initconst = {
166 { .compatible = "ti,omap2420-timer", }, 160 { .compatible = "ti,omap2420-timer", },
167 { .compatible = "ti,omap3430-timer", }, 161 { .compatible = "ti,omap3430-timer", },
@@ -203,8 +197,17 @@ static struct device_node * __init omap_get_timer_dt(const struct of_device_id *
203 of_get_property(np, "ti,timer-secure", NULL))) 197 of_get_property(np, "ti,timer-secure", NULL)))
204 continue; 198 continue;
205 199
206 if (!of_device_is_compatible(np, "ti,omap-counter32k")) 200 if (!of_device_is_compatible(np, "ti,omap-counter32k")) {
207 of_add_property(np, &device_disabled); 201 struct property *prop;
202
203 prop = kzalloc(sizeof(*prop), GFP_KERNEL);
204 if (!prop)
205 return NULL;
206 prop->name = "status";
207 prop->value = "disabled";
208 prop->length = strlen(prop->value);
209 of_add_property(np, prop);
210 }
208 return np; 211 return np;
209 } 212 }
210 213
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 57058ac46f49..7e5d7a083707 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -23,7 +23,6 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_address.h> 24#include <linux/of_address.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/perf/arm_pmu.h>
27#include <linux/regulator/machine.h> 26#include <linux/regulator/machine.h>
28 27
29#include <asm/outercache.h> 28#include <asm/outercache.h>
@@ -112,37 +111,6 @@ static void ux500_restart(enum reboot_mode mode, const char *cmd)
112 prcmu_system_reset(0); 111 prcmu_system_reset(0);
113} 112}
114 113
115/*
116 * The PMU IRQ lines of two cores are wired together into a single interrupt.
117 * Bounce the interrupt to the other core if it's not ours.
118 */
119static irqreturn_t db8500_pmu_handler(int irq, void *dev, irq_handler_t handler)
120{
121 irqreturn_t ret = handler(irq, dev);
122 int other = !smp_processor_id();
123
124 if (ret == IRQ_NONE && cpu_online(other))
125 irq_set_affinity(irq, cpumask_of(other));
126
127 /*
128 * We should be able to get away with the amount of IRQ_NONEs we give,
129 * while still having the spurious IRQ detection code kick in if the
130 * interrupt really starts hitting spuriously.
131 */
132 return ret;
133}
134
135static struct arm_pmu_platdata db8500_pmu_platdata = {
136 .handle_irq = db8500_pmu_handler,
137 .irq_flags = IRQF_NOBALANCING | IRQF_NO_THREAD,
138};
139
140static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
141 /* Requires call-back bindings. */
142 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
143 {},
144};
145
146static struct of_dev_auxdata u8540_auxdata_lookup[] __initdata = { 114static struct of_dev_auxdata u8540_auxdata_lookup[] __initdata = {
147 OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", NULL), 115 OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu", NULL),
148 {}, 116 {},
@@ -165,9 +133,6 @@ static void __init u8500_init_machine(void)
165 if (of_machine_is_compatible("st-ericsson,u8540")) 133 if (of_machine_is_compatible("st-ericsson,u8540"))
166 of_platform_populate(NULL, u8500_local_bus_nodes, 134 of_platform_populate(NULL, u8500_local_bus_nodes,
167 u8540_auxdata_lookup, NULL); 135 u8540_auxdata_lookup, NULL);
168 else
169 of_platform_populate(NULL, u8500_local_bus_nodes,
170 u8500_auxdata_lookup, NULL);
171} 136}
172 137
173static const char * stericsson_dt_platform_compat[] = { 138static const char * stericsson_dt_platform_compat[] = {
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index aff6994950ba..a2399fd66e97 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -472,28 +472,27 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
472/***************************************************************************** 472/*****************************************************************************
473 * Ethernet switch 473 * Ethernet switch
474 ****************************************************************************/ 474 ****************************************************************************/
475static __initconst const char *orion_ge00_mvmdio_bus_name = "orion-mii"; 475static __initdata struct mdio_board_info orion_ge00_switch_board_info = {
476static __initdata struct mdio_board_info 476 .bus_id = "orion-mii",
477 orion_ge00_switch_board_info; 477 .modalias = "mv88e6085",
478};
478 479
479void __init orion_ge00_switch_init(struct dsa_chip_data *d) 480void __init orion_ge00_switch_init(struct dsa_chip_data *d)
480{ 481{
481 struct mdio_board_info *bd;
482 unsigned int i; 482 unsigned int i;
483 483
484 if (!IS_BUILTIN(CONFIG_PHYLIB)) 484 if (!IS_BUILTIN(CONFIG_PHYLIB))
485 return; 485 return;
486 486
487 for (i = 0; i < ARRAY_SIZE(d->port_names); i++) 487 for (i = 0; i < ARRAY_SIZE(d->port_names); i++) {
488 if (!strcmp(d->port_names[i], "cpu")) 488 if (!strcmp(d->port_names[i], "cpu")) {
489 d->netdev[i] = &orion_ge00.dev;
489 break; 490 break;
491 }
492 }
490 493
491 bd = &orion_ge00_switch_board_info; 494 orion_ge00_switch_board_info.mdio_addr = d->sw_addr;
492 bd->bus_id = orion_ge00_mvmdio_bus_name; 495 orion_ge00_switch_board_info.platform_data = d;
493 bd->mdio_addr = d->sw_addr;
494 d->netdev[i] = &orion_ge00.dev;
495 strcpy(bd->modalias, "mv88e6085");
496 bd->platform_data = d;
497 496
498 mdiobus_register_board_info(&orion_ge00_switch_board_info, 1); 497 mdiobus_register_board_info(&orion_ge00_switch_board_info, 1);
499} 498}
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index fbedbd8f619a..2b1535cdeb7c 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -190,12 +190,24 @@ config ARCH_R8A7796
190 help 190 help
191 This enables support for the Renesas R-Car M3-W SoC. 191 This enables support for the Renesas R-Car M3-W SoC.
192 192
193config ARCH_R8A77965
194 bool "Renesas R-Car M3-N SoC Platform"
195 depends on ARCH_RENESAS
196 help
197 This enables support for the Renesas R-Car M3-N SoC.
198
193config ARCH_R8A77970 199config ARCH_R8A77970
194 bool "Renesas R-Car V3M SoC Platform" 200 bool "Renesas R-Car V3M SoC Platform"
195 depends on ARCH_RENESAS 201 depends on ARCH_RENESAS
196 help 202 help
197 This enables support for the Renesas R-Car V3M SoC. 203 This enables support for the Renesas R-Car V3M SoC.
198 204
205config ARCH_R8A77980
206 bool "Renesas R-Car V3H SoC Platform"
207 depends on ARCH_RENESAS
208 help
209 This enables support for the Renesas R-Car V3H SoC.
210
199config ARCH_R8A77995 211config ARCH_R8A77995
200 bool "Renesas R-Car D3 SoC Platform" 212 bool "Renesas R-Car D3 SoC Platform"
201 depends on ARCH_RENESAS 213 depends on ARCH_RENESAS
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index f505227b0250..8bebe7da5ed9 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -5,8 +5,11 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
5dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb 5dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb
6dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb 6dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
7dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb 7dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
8dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
8dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb 9dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
9dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb 10dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
11dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
10dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb 12dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
11dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb 13dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
12dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb 14dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
15dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index a6975670cd1c..2250dec9974c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -120,8 +120,7 @@
120 pinctrl-names = "default"; 120 pinctrl-names = "default";
121 pinctrl-0 = <&mmc0_pins>; 121 pinctrl-0 = <&mmc0_pins>;
122 vmmc-supply = <&reg_dcdc1>; 122 vmmc-supply = <&reg_dcdc1>;
123 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 123 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
124 cd-inverted;
125 disable-wp; 124 disable-wp;
126 bus-width = <4>; 125 bus-width = <4>;
127 status = "okay"; 126 status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
index 2beef9e6cb88..e2dce48fa29a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -82,8 +82,7 @@
82 pinctrl-names = "default"; 82 pinctrl-names = "default";
83 pinctrl-0 = <&mmc0_pins>; 83 pinctrl-0 = <&mmc0_pins>;
84 vmmc-supply = <&reg_dcdc1>; 84 vmmc-supply = <&reg_dcdc1>;
85 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 85 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
86 cd-inverted;
87 disable-wp; 86 disable-wp;
88 bus-width = <4>; 87 bus-width = <4>;
89 status = "okay"; 88 status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
index 8807664f363a..3b3081b10ecb 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
@@ -68,8 +68,7 @@
68 pinctrl-names = "default"; 68 pinctrl-names = "default";
69 pinctrl-0 = <&mmc0_pins>; 69 pinctrl-0 = <&mmc0_pins>;
70 vmmc-supply = <&reg_dcdc1>; 70 vmmc-supply = <&reg_dcdc1>;
71 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 71 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
72 cd-inverted;
73 disable-wp; 72 disable-wp;
74 bus-width = <4>; 73 bus-width = <4>;
75 status = "okay"; 74 status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
index 240d35731d10..bf42690a3361 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
@@ -67,8 +67,7 @@
67 pinctrl-names = "default"; 67 pinctrl-names = "default";
68 pinctrl-0 = <&mmc0_pins>; 68 pinctrl-0 = <&mmc0_pins>;
69 vmmc-supply = <&reg_dcdc1>; 69 vmmc-supply = <&reg_dcdc1>;
70 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 70 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
71 cd-inverted;
72 status = "okay"; 71 status = "okay";
73}; 72};
74 73
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 604cdaedac38..a75825798a71 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -103,8 +103,7 @@
103 pinctrl-names = "default"; 103 pinctrl-names = "default";
104 pinctrl-0 = <&mmc0_pins>; 104 pinctrl-0 = <&mmc0_pins>;
105 vmmc-supply = <&reg_dcdc1>; 105 vmmc-supply = <&reg_dcdc1>;
106 cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; 106 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
107 cd-inverted;
108 disable-wp; 107 disable-wp;
109 bus-width = <4>; 108 bus-width = <4>;
110 status = "okay"; 109 status = "okay";
@@ -230,6 +229,11 @@
230 regulator-name = "vcc-rtc"; 229 regulator-name = "vcc-rtc";
231}; 230};
232 231
232/* On Euler connector */
233&spdif {
234 status = "disabled";
235};
236
233/* On Exp and Euler connectors */ 237/* On Exp and Euler connectors */
234&uart0 { 238&uart0 {
235 pinctrl-names = "default"; 239 pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
new file mode 100644
index 000000000000..d9baab3dc96b
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
@@ -0,0 +1,265 @@
1/*
2 * Copyright (C) Harald Geyer <harald@ccbib.org>
3 * based on sun50i-a64-olinuxino.dts by Jagan Teki <jteki@openedev.com>
4 *
5 * SPDX-License-Identifier: (GPL-2.0 OR MIT)
6 */
7
8/dts-v1/;
9
10#include "sun50i-a64.dtsi"
11
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14#include <dt-bindings/pwm/pwm.h>
15
16/ {
17 model = "Olimex A64 Teres-I";
18 compatible = "olimex,a64-teres-i", "allwinner,sun50i-a64";
19
20 aliases {
21 serial0 = &uart0;
22 };
23
24 chosen {
25 stdout-path = "serial0:115200n8";
26
27 framebuffer-lcd {
28 eDP25-supply = <&reg_dldo2>;
29 eDP12-supply = <&reg_dldo3>;
30 };
31 };
32
33 gpio-keys {
34 compatible = "gpio-keys";
35
36 lid-switch {
37 label = "Lid Switch";
38 gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */
39 linux,input-type = <EV_SW>;
40 linux,code = <SW_LID>;
41 };
42 };
43
44 leds {
45 compatible = "gpio-leds";
46
47 capslock {
48 label = "teres-i:green:capslock";
49 gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
50 };
51
52 numlock {
53 label = "teres-i:green:numlock";
54 gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
55 };
56 };
57
58 reg_usb1_vbus: usb1-vbus {
59 compatible = "regulator-fixed";
60 regulator-name = "usb1-vbus";
61 regulator-min-microvolt = <5000000>;
62 regulator-max-microvolt = <5000000>;
63 enable-active-high;
64 gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
65 status = "okay";
66 };
67
68 wifi_pwrseq: wifi_pwrseq {
69 compatible = "mmc-pwrseq-simple";
70 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
71 };
72};
73
74&ehci1 {
75 status = "okay";
76};
77
78
79/* The ANX6345 eDP-bridge is on i2c0. There is no linux (mainline)
80 * driver for this chip at the moment, the bootloader initializes it.
81 * However it can be accessed with the i2c-dev driver from user space.
82 */
83&i2c0 {
84 clock-frequency = <100000>;
85 pinctrl-names = "default";
86 pinctrl-0 = <&i2c0_pins>;
87 status = "okay";
88};
89
90&mmc0 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&mmc0_pins>;
93 vmmc-supply = <&reg_dcdc1>;
94 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
95 disable-wp;
96 bus-width = <4>;
97 status = "okay";
98};
99
100&mmc1 {
101 pinctrl-names = "default";
102 pinctrl-0 = <&mmc1_pins>;
103 vmmc-supply = <&reg_aldo2>;
104 vqmmc-supply = <&reg_dldo4>;
105 mmc-pwrseq = <&wifi_pwrseq>;
106 bus-width = <4>;
107 non-removable;
108 status = "okay";
109
110 rtl8723bs: wifi@1 {
111 reg = <1>;
112 interrupt-parent = <&r_pio>;
113 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
114 interrupt-names = "host-wake";
115 };
116};
117
118&mmc2 {
119 pinctrl-names = "default";
120 pinctrl-0 = <&mmc2_pins>;
121 vmmc-supply = <&reg_dcdc1>;
122 vqmmc-supply = <&reg_dcdc1>;
123 bus-width = <8>;
124 non-removable;
125 cap-mmc-hw-reset;
126 status = "okay";
127};
128
129&ohci1 {
130 status = "okay";
131};
132
133&r_rsb {
134 status = "okay";
135
136 axp803: pmic@3a3 {
137 compatible = "x-powers,axp803";
138 reg = <0x3a3>;
139 interrupt-parent = <&r_intc>;
140 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
141 wakeup-source;
142 };
143};
144
145#include "axp803.dtsi"
146
147&reg_aldo1 {
148 regulator-always-on;
149 regulator-min-microvolt = <2800000>;
150 regulator-max-microvolt = <2800000>;
151 regulator-name = "vcc-pe";
152};
153
154&reg_aldo2 {
155 regulator-always-on;
156 regulator-min-microvolt = <3300000>;
157 regulator-max-microvolt = <3300000>;
158 regulator-name = "vcc-pl";
159};
160
161&reg_aldo3 {
162 regulator-always-on;
163 regulator-min-microvolt = <3000000>;
164 regulator-max-microvolt = <3000000>;
165 regulator-name = "vcc-pll-avcc";
166};
167
168&reg_dcdc1 {
169 regulator-always-on;
170 regulator-min-microvolt = <3300000>;
171 regulator-max-microvolt = <3300000>;
172 regulator-name = "vcc-3v3";
173};
174
175&reg_dcdc2 {
176 regulator-always-on;
177 regulator-min-microvolt = <1040000>;
178 regulator-max-microvolt = <1300000>;
179 regulator-name = "vdd-cpux";
180};
181
182/* DCDC3 is polyphased with DCDC2 */
183
184&reg_dcdc5 {
185 regulator-always-on;
186 regulator-min-microvolt = <1500000>;
187 regulator-max-microvolt = <1500000>;
188 regulator-name = "vcc-ddr3";
189};
190
191&reg_dcdc6 {
192 regulator-always-on;
193 regulator-min-microvolt = <1100000>;
194 regulator-max-microvolt = <1100000>;
195 regulator-name = "vdd-sys";
196};
197
198&reg_dldo1 {
199 regulator-min-microvolt = <3300000>;
200 regulator-max-microvolt = <3300000>;
201 regulator-name = "vcc-hdmi";
202};
203
204&reg_dldo2 {
205 regulator-min-microvolt = <2500000>;
206 regulator-max-microvolt = <2500000>;
207 regulator-name = "vcc-pd";
208};
209
210&reg_dldo3 {
211 regulator-min-microvolt = <1200000>;
212 regulator-max-microvolt = <1200000>;
213 regulator-name = "eDP12";
214};
215
216&reg_dldo4 {
217 regulator-min-microvolt = <3300000>;
218 regulator-max-microvolt = <3300000>;
219 regulator-name = "vcc-wifi-io";
220};
221
222&reg_eldo1 {
223 regulator-min-microvolt = <1800000>;
224 regulator-max-microvolt = <1800000>;
225 regulator-name = "cpvdd";
226};
227
228&reg_eldo2 {
229 regulator-min-microvolt = <1800000>;
230 regulator-max-microvolt = <1800000>;
231 regulator-name = "vcc-dvdd-csi";
232};
233
234&reg_fldo1 {
235 regulator-min-microvolt = <1200000>;
236 regulator-max-microvolt = <1200000>;
237 regulator-name = "vcc-1v2-hsic";
238};
239
240/*
241 * The A64 chip cannot work without this regulator off, although
242 * it seems to be only driving the AR100 core.
243 * Maybe we don't still know well about CPUs domain.
244 */
245&reg_fldo2 {
246 regulator-always-on;
247 regulator-min-microvolt = <1100000>;
248 regulator-max-microvolt = <1100000>;
249 regulator-name = "vdd-cpus";
250};
251
252&reg_rtc_ldo {
253 regulator-name = "vcc-rtc";
254};
255
256&uart0 {
257 pinctrl-names = "default";
258 pinctrl-0 = <&uart0_pins_a>;
259 status = "okay";
260};
261
262&usbphy {
263 usb1_vbus-supply = <&reg_usb1_vbus>;
264 status = "okay";
265};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index d783d164b9c3..1b2ef28c42bd 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -52,6 +52,26 @@
52 #address-cells = <1>; 52 #address-cells = <1>;
53 #size-cells = <1>; 53 #size-cells = <1>;
54 54
55 chosen {
56 #address-cells = <1>;
57 #size-cells = <1>;
58 ranges;
59
60/*
61 * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2 CCU.
62 * However there is no support for this clock on A64 yet, so we depend
63 * on the upstream clocks here to keep them (and thus CLK_MIXER0) up.
64 */
65 simplefb_lcd: framebuffer-lcd {
66 compatible = "allwinner,simple-framebuffer",
67 "simple-framebuffer";
68 allwinner,pipeline = "mixer0-lcd0";
69 clocks = <&ccu CLK_TCON0>,
70 <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
71 status = "disabled";
72 };
73 };
74
55 cpus { 75 cpus {
56 #address-cells = <1>; 76 #address-cells = <1>;
57 #size-cells = <0>; 77 #size-cells = <0>;
@@ -112,6 +132,24 @@
112 method = "smc"; 132 method = "smc";
113 }; 133 };
114 134
135 sound_spdif {
136 compatible = "simple-audio-card";
137 simple-audio-card,name = "On-board SPDIF";
138
139 simple-audio-card,cpu {
140 sound-dai = <&spdif>;
141 };
142
143 simple-audio-card,codec {
144 sound-dai = <&spdif_out>;
145 };
146 };
147
148 spdif_out: spdif-out {
149 #sound-dai-cells = <0>;
150 compatible = "linux,spdif-dit";
151 };
152
115 timer { 153 timer {
116 compatible = "arm,armv8-timer"; 154 compatible = "arm,armv8-timer";
117 interrupts = <GIC_PPI 13 155 interrupts = <GIC_PPI 13
@@ -291,6 +329,11 @@
291 interrupt-controller; 329 interrupt-controller;
292 #interrupt-cells = <3>; 330 #interrupt-cells = <3>;
293 331
332 i2c0_pins: i2c0_pins {
333 pins = "PH0", "PH1";
334 function = "i2c0";
335 };
336
294 i2c1_pins: i2c1_pins { 337 i2c1_pins: i2c1_pins {
295 pins = "PH2", "PH3"; 338 pins = "PH2", "PH3";
296 function = "i2c1"; 339 function = "i2c1";
@@ -336,6 +379,11 @@
336 drive-strength = <40>; 379 drive-strength = <40>;
337 }; 380 };
338 381
382 spdif_tx_pin: spdif {
383 pins = "PH8";
384 function = "spdif";
385 };
386
339 spi0_pins: spi0 { 387 spi0_pins: spi0 {
340 pins = "PC0", "PC1", "PC2", "PC3"; 388 pins = "PC0", "PC1", "PC2", "PC3";
341 function = "spi0"; 389 function = "spi0";
@@ -382,6 +430,50 @@
382 }; 430 };
383 }; 431 };
384 432
433 spdif: spdif@1c21000 {
434 #sound-dai-cells = <0>;
435 compatible = "allwinner,sun50i-a64-spdif",
436 "allwinner,sun8i-h3-spdif";
437 reg = <0x01c21000 0x400>;
438 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
439 clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
440 resets = <&ccu RST_BUS_SPDIF>;
441 clock-names = "apb", "spdif";
442 dmas = <&dma 2>;
443 dma-names = "tx";
444 pinctrl-names = "default";
445 pinctrl-0 = <&spdif_tx_pin>;
446 status = "disabled";
447 };
448
449 i2s0: i2s@1c22000 {
450 #sound-dai-cells = <0>;
451 compatible = "allwinner,sun50i-a64-i2s",
452 "allwinner,sun8i-h3-i2s";
453 reg = <0x01c22000 0x400>;
454 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
455 clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
456 clock-names = "apb", "mod";
457 resets = <&ccu RST_BUS_I2S0>;
458 dma-names = "rx", "tx";
459 dmas = <&dma 3>, <&dma 3>;
460 status = "disabled";
461 };
462
463 i2s1: i2s@1c22400 {
464 #sound-dai-cells = <0>;
465 compatible = "allwinner,sun50i-a64-i2s",
466 "allwinner,sun8i-h3-i2s";
467 reg = <0x01c22400 0x400>;
468 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
469 clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
470 clock-names = "apb", "mod";
471 resets = <&ccu RST_BUS_I2S1>;
472 dma-names = "rx", "tx";
473 dmas = <&dma 4>, <&dma 4>;
474 status = "disabled";
475 };
476
385 uart0: serial@1c28000 { 477 uart0: serial@1c28000 {
386 compatible = "snps,dw-apb-uart"; 478 compatible = "snps,dw-apb-uart";
387 reg = <0x01c28000 0x400>; 479 reg = <0x01c28000 0x400>;
@@ -593,5 +685,12 @@
593 #address-cells = <1>; 685 #address-cells = <1>;
594 #size-cells = <0>; 686 #size-cells = <0>;
595 }; 687 };
688
689 wdt0: watchdog@1c20ca0 {
690 compatible = "allwinner,sun50i-a64-wdt",
691 "allwinner,sun6i-a31-wdt";
692 reg = <0x01c20ca0 0x20>;
693 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
694 };
596 }; 695 };
597}; 696};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
index 1ed9f219deaf..506e25ba028a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
@@ -151,8 +151,6 @@
151}; 151};
152 152
153&mmc0 { 153&mmc0 {
154 pinctrl-names = "default";
155 pinctrl-0 = <&mmc0_pins_a>;
156 vmmc-supply = <&reg_vcc3v3>; 154 vmmc-supply = <&reg_vcc3v3>;
157 bus-width = <4>; 155 bus-width = <4>;
158 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 156 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
@@ -160,8 +158,6 @@
160}; 158};
161 159
162&mmc1 { 160&mmc1 {
163 pinctrl-names = "default";
164 pinctrl-0 = <&mmc1_pins_a>;
165 vmmc-supply = <&reg_vcc3v3>; 161 vmmc-supply = <&reg_vcc3v3>;
166 vqmmc-supply = <&reg_vcc3v3>; 162 vqmmc-supply = <&reg_vcc3v3>;
167 mmc-pwrseq = <&wifi_pwrseq>; 163 mmc-pwrseq = <&wifi_pwrseq>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts
index f1447003ea3c..cc268a69786c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts
@@ -126,8 +126,6 @@
126}; 126};
127 127
128&mmc0 { 128&mmc0 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&mmc0_pins_a>;
131 vmmc-supply = <&reg_vcc3v3>; 129 vmmc-supply = <&reg_vcc3v3>;
132 bus-width = <4>; 130 bus-width = <4>;
133 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 131 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
index 9e51d3a5f4e6..98862c7c7258 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
@@ -67,6 +67,17 @@
67 stdout-path = "serial0:115200n8"; 67 stdout-path = "serial0:115200n8";
68 }; 68 };
69 69
70 connector {
71 compatible = "hdmi-connector";
72 type = "a";
73
74 port {
75 hdmi_con_in: endpoint {
76 remote-endpoint = <&hdmi_out_con>;
77 };
78 };
79 };
80
70 leds { 81 leds {
71 compatible = "gpio-leds"; 82 compatible = "gpio-leds";
72 83
@@ -121,6 +132,10 @@
121 status = "okay"; 132 status = "okay";
122}; 133};
123 134
135&de {
136 status = "okay";
137};
138
124&ehci0 { 139&ehci0 {
125 status = "okay"; 140 status = "okay";
126}; 141};
@@ -153,6 +168,16 @@
153 }; 168 };
154}; 169};
155 170
171&hdmi {
172 status = "okay";
173};
174
175&hdmi_out {
176 hdmi_out_con: endpoint {
177 remote-endpoint = <&hdmi_con_in>;
178 };
179};
180
156&ir { 181&ir {
157 pinctrl-names = "default"; 182 pinctrl-names = "default";
158 pinctrl-0 = <&ir_pins_a>; 183 pinctrl-0 = <&ir_pins_a>;
@@ -160,8 +185,6 @@
160}; 185};
161 186
162&mmc0 { 187&mmc0 {
163 pinctrl-names = "default";
164 pinctrl-0 = <&mmc0_pins_a>;
165 vmmc-supply = <&reg_vcc3v3>; 188 vmmc-supply = <&reg_vcc3v3>;
166 bus-width = <4>; 189 bus-width = <4>;
167 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 190 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
index 0f25c4a6f15d..b75ca4d7d001 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
@@ -62,6 +62,17 @@
62 stdout-path = "serial0:115200n8"; 62 stdout-path = "serial0:115200n8";
63 }; 63 };
64 64
65 connector {
66 compatible = "hdmi-connector";
67 type = "a";
68
69 port {
70 hdmi_con_in: endpoint {
71 remote-endpoint = <&hdmi_out_con>;
72 };
73 };
74 };
75
65 leds { 76 leds {
66 compatible = "gpio-leds"; 77 compatible = "gpio-leds";
67 78
@@ -128,6 +139,10 @@
128 status = "okay"; 139 status = "okay";
129}; 140};
130 141
142&de {
143 status = "okay";
144};
145
131&ehci0 { 146&ehci0 {
132 status = "okay"; 147 status = "okay";
133}; 148};
@@ -160,6 +175,16 @@
160 }; 175 };
161}; 176};
162 177
178&hdmi {
179 status = "okay";
180};
181
182&hdmi_out {
183 hdmi_out_con: endpoint {
184 remote-endpoint = <&hdmi_con_in>;
185 };
186};
187
163&ir { 188&ir {
164 pinctrl-names = "default"; 189 pinctrl-names = "default";
165 pinctrl-0 = <&ir_pins_a>; 190 pinctrl-0 = <&ir_pins_a>;
@@ -167,8 +192,6 @@
167}; 192};
168 193
169&mmc0 { 194&mmc0 {
170 pinctrl-names = "default";
171 pinctrl-0 = <&mmc0_pins_a>;
172 vmmc-supply = <&reg_vcc3v3>; 195 vmmc-supply = <&reg_vcc3v3>;
173 bus-width = <4>; 196 bus-width = <4>;
174 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 197 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
@@ -176,8 +199,6 @@
176}; 199};
177 200
178&mmc1 { 201&mmc1 {
179 pinctrl-names = "default";
180 pinctrl-0 = <&mmc1_pins_a>;
181 vmmc-supply = <&reg_vcc3v3>; 202 vmmc-supply = <&reg_vcc3v3>;
182 mmc-pwrseq = <&wifi_pwrseq>; 203 mmc-pwrseq = <&wifi_pwrseq>;
183 bus-width = <4>; 204 bus-width = <4>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
new file mode 100644
index 000000000000..1238de25a969
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
@@ -0,0 +1,143 @@
1/*
2 * Copyright (C) 2016 ARM Ltd.
3 * Copyright (C) 2018 Hauke Mehrtens <hauke@hauke-m.de>
4 *
5 * SPDX-License-Identifier: (GPL-2.0+ OR X11)
6 */
7
8/dts-v1/;
9#include "sun50i-h5.dtsi"
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/pinctrl/sun4i-a10.h>
14
15/ {
16 model = "Xunlong Orange Pi Zero Plus";
17 compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5";
18
19 reg_vcc3v3: vcc3v3 {
20 compatible = "regulator-fixed";
21 regulator-name = "vcc3v3";
22 regulator-min-microvolt = <3300000>;
23 regulator-max-microvolt = <3300000>;
24 };
25
26 aliases {
27 ethernet0 = &emac;
28 ethernet1 = &rtl8189ftv;
29 serial0 = &uart0;
30 };
31
32 chosen {
33 stdout-path = "serial0:115200n8";
34 };
35
36 leds {
37 compatible = "gpio-leds";
38
39 pwr {
40 label = "orangepi:green:pwr";
41 gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
42 default-state = "on";
43 };
44
45 status {
46 label = "orangepi:red:status";
47 gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
48 };
49 };
50
51 reg_gmac_3v3: gmac-3v3 {
52 compatible = "regulator-fixed";
53 regulator-name = "gmac-3v3";
54 regulator-min-microvolt = <3300000>;
55 regulator-max-microvolt = <3300000>;
56 startup-delay-us = <100000>;
57 enable-active-high;
58 gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
59 };
60};
61
62&ehci0 {
63 status = "okay";
64};
65
66&ehci1 {
67 status = "okay";
68};
69
70&emac {
71 pinctrl-names = "default";
72 pinctrl-0 = <&emac_rgmii_pins>;
73 phy-supply = <&reg_gmac_3v3>;
74 phy-handle = <&ext_rgmii_phy>;
75 phy-mode = "rgmii";
76 status = "okay";
77};
78
79&external_mdio {
80 ext_rgmii_phy: ethernet-phy@1 {
81 compatible = "ethernet-phy-ieee802.3-c22";
82 reg = <1>;
83 };
84};
85
86&mmc0 {
87 vmmc-supply = <&reg_vcc3v3>;
88 bus-width = <4>;
89 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
90 status = "okay";
91};
92
93&mmc1 {
94 vmmc-supply = <&reg_vcc3v3>;
95 bus-width = <4>;
96 non-removable;
97 status = "okay";
98
99 /*
100 * Explicitly define the sdio device, so that we can add an ethernet
101 * alias for it (which e.g. makes u-boot set a mac-address).
102 */
103 rtl8189ftv: sdio_wifi@1 {
104 reg = <1>;
105 };
106};
107
108&spi0 {
109 status = "okay";
110
111 flash@0 {
112 #address-cells = <1>;
113 #size-cells = <1>;
114 compatible = "mxicy,mx25l1606e", "winbond,w25q128";
115 reg = <0>;
116 spi-max-frequency = <40000000>;
117 };
118};
119
120&ohci0 {
121 status = "okay";
122};
123
124&ohci1 {
125 status = "okay";
126};
127
128&uart0 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&uart0_pins_a>;
131 status = "okay";
132};
133
134&usb_otg {
135 dr_mode = "peripheral";
136 status = "okay";
137};
138
139&usbphy {
140 /* USB Type-A ports' VBUS is always on */
141 usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
142 status = "okay";
143};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index af43533c7134..53c8c11620e0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -58,6 +58,17 @@
58 stdout-path = "serial0:115200n8"; 58 stdout-path = "serial0:115200n8";
59 }; 59 };
60 60
61 connector {
62 compatible = "hdmi-connector";
63 type = "a";
64
65 port {
66 hdmi_con_in: endpoint {
67 remote-endpoint = <&hdmi_out_con>;
68 };
69 };
70 };
71
61 reg_vcc3v3: vcc3v3 { 72 reg_vcc3v3: vcc3v3 {
62 compatible = "regulator-fixed"; 73 compatible = "regulator-fixed";
63 regulator-name = "vcc3v3"; 74 regulator-name = "vcc3v3";
@@ -73,9 +84,21 @@
73 }; 84 };
74}; 85};
75 86
87&de {
88 status = "okay";
89};
90
91&hdmi {
92 status = "okay";
93};
94
95&hdmi_out {
96 hdmi_out_con: endpoint {
97 remote-endpoint = <&hdmi_con_in>;
98 };
99};
100
76&mmc0 { 101&mmc0 {
77 pinctrl-names = "default";
78 pinctrl-0 = <&mmc0_pins_a>;
79 vmmc-supply = <&reg_vcc3v3>; 102 vmmc-supply = <&reg_vcc3v3>;
80 bus-width = <4>; 103 bus-width = <4>;
81 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; 104 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
@@ -83,8 +106,6 @@
83}; 106};
84 107
85&mmc1 { 108&mmc1 {
86 pinctrl-names = "default";
87 pinctrl-0 = <&mmc1_pins_a>;
88 vmmc-supply = <&reg_vcc3v3>; 109 vmmc-supply = <&reg_vcc3v3>;
89 vqmmc-supply = <&reg_vcc3v3>; 110 vqmmc-supply = <&reg_vcc3v3>;
90 mmc-pwrseq = <&wifi_pwrseq>; 111 mmc-pwrseq = <&wifi_pwrseq>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
new file mode 100644
index 000000000000..d36de5eb81f3
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
@@ -0,0 +1,29 @@
1// SPDX-License-Identifier: (GPL-2.0+ or MIT)
2/*
3 * Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.io>
4 */
5
6/dts-v1/;
7
8#include "sun50i-h6.dtsi"
9
10#include <dt-bindings/gpio/gpio.h>
11
12/ {
13 model = "Pine H64";
14 compatible = "pine64,pine-h64", "allwinner,sun50i-h6";
15
16 aliases {
17 serial0 = &uart0;
18 };
19
20 chosen {
21 stdout-path = "serial0:115200n8";
22 };
23};
24
25&uart0 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&uart0_ph_pins>;
28 status = "okay";
29};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
new file mode 100644
index 000000000000..56563150d61a
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -0,0 +1,175 @@
1// SPDX-License-Identifier: (GPL-2.0+ or MIT)
2/*
3 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4 */
5
6#include <dt-bindings/interrupt-controller/arm-gic.h>
7
8/ {
9 interrupt-parent = <&gic>;
10 #address-cells = <1>;
11 #size-cells = <1>;
12
13 cpus {
14 #address-cells = <1>;
15 #size-cells = <0>;
16
17 cpu0: cpu@0 {
18 compatible = "arm,cortex-a53", "arm,armv8";
19 device_type = "cpu";
20 reg = <0>;
21 enable-method = "psci";
22 };
23
24 cpu1: cpu@1 {
25 compatible = "arm,cortex-a53", "arm,armv8";
26 device_type = "cpu";
27 reg = <1>;
28 enable-method = "psci";
29 };
30
31 cpu2: cpu@2 {
32 compatible = "arm,cortex-a53", "arm,armv8";
33 device_type = "cpu";
34 reg = <2>;
35 enable-method = "psci";
36 };
37
38 cpu3: cpu@3 {
39 compatible = "arm,cortex-a53", "arm,armv8";
40 device_type = "cpu";
41 reg = <3>;
42 enable-method = "psci";
43 };
44 };
45
46 iosc: internal-osc-clk {
47 #clock-cells = <0>;
48 compatible = "fixed-clock";
49 clock-frequency = <16000000>;
50 clock-accuracy = <300000000>;
51 clock-output-names = "iosc";
52 };
53
54 osc24M: osc24M_clk {
55 #clock-cells = <0>;
56 compatible = "fixed-clock";
57 clock-frequency = <24000000>;
58 clock-output-names = "osc24M";
59 };
60
61 osc32k: osc32k_clk {
62 #clock-cells = <0>;
63 compatible = "fixed-clock";
64 clock-frequency = <32768>;
65 clock-output-names = "osc32k";
66 };
67
68 psci {
69 compatible = "arm,psci-0.2";
70 method = "smc";
71 };
72
73 timer {
74 compatible = "arm,armv8-timer";
75 interrupts = <GIC_PPI 13
76 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
77 <GIC_PPI 14
78 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
79 <GIC_PPI 11
80 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
81 <GIC_PPI 10
82 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
83 };
84
85 soc {
86 compatible = "simple-bus";
87 #address-cells = <1>;
88 #size-cells = <1>;
89 ranges;
90
91 ccu: clock@3001000 {
92 compatible = "allwinner,sun50i-h6-ccu";
93 reg = <0x03001000 0x1000>;
94 clocks = <&osc24M>, <&osc32k>, <&iosc>;
95 clock-names = "hosc", "losc", "iosc";
96 #clock-cells = <1>;
97 #reset-cells = <1>;
98 };
99
100 gic: interrupt-controller@3021000 {
101 compatible = "arm,gic-400";
102 reg = <0x03021000 0x1000>,
103 <0x03022000 0x2000>,
104 <0x03024000 0x2000>,
105 <0x03026000 0x2000>;
106 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
107 interrupt-controller;
108 #interrupt-cells = <3>;
109 };
110
111 pio: pinctrl@300b000 {
112 compatible = "allwinner,sun50i-h6-pinctrl";
113 reg = <0x0300b000 0x400>;
114 interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
115 <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
116 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
117 <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
118 clocks = <&ccu 26>, <&osc24M>, <&osc32k>;
119 clock-names = "apb", "hosc", "losc";
120 gpio-controller;
121 #gpio-cells = <3>;
122 interrupt-controller;
123 #interrupt-cells = <3>;
124
125 uart0_ph_pins: uart0-ph {
126 pins = "PH0", "PH1";
127 function = "uart0";
128 };
129 };
130
131 uart0: serial@5000000 {
132 compatible = "snps,dw-apb-uart";
133 reg = <0x05000000 0x400>;
134 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
135 reg-shift = <2>;
136 reg-io-width = <4>;
137 clocks = <&ccu 70>;
138 resets = <&ccu 21>;
139 status = "disabled";
140 };
141
142 uart1: serial@5000400 {
143 compatible = "snps,dw-apb-uart";
144 reg = <0x05000400 0x400>;
145 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
146 reg-shift = <2>;
147 reg-io-width = <4>;
148 clocks = <&ccu 71>;
149 resets = <&ccu 22>;
150 status = "disabled";
151 };
152
153 uart2: serial@5000800 {
154 compatible = "snps,dw-apb-uart";
155 reg = <0x05000800 0x400>;
156 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
157 reg-shift = <2>;
158 reg-io-width = <4>;
159 clocks = <&ccu 72>;
160 resets = <&ccu 23>;
161 status = "disabled";
162 };
163
164 uart3: serial@5000c00 {
165 compatible = "snps,dw-apb-uart";
166 reg = <0x05000c00 0x400>;
167 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
168 reg-shift = <2>;
169 reg-io-width = <4>;
170 clocks = <&ccu 73>;
171 resets = <&ccu 24>;
172 status = "disabled";
173 };
174 };
175};
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
index 000756429b77..54bf6a6c6f7b 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
@@ -100,4 +100,9 @@
100 100
101&usb0 { 101&usb0 {
102 status = "okay"; 102 status = "okay";
103 disable-over-current;
104};
105
106&watchdog0 {
107 status = "okay";
103}; 108};
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
index 447b98d30921..57eedced5a51 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts
@@ -1,7 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Amlogic, Inc. All rights reserved. 3 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5 */ 4 */
6 5
7/dts-v1/; 6/dts-v1/;
@@ -14,6 +13,7 @@
14 13
15 aliases { 14 aliases {
16 serial0 = &uart_AO; 15 serial0 = &uart_AO;
16 serial1 = &uart_A;
17 }; 17 };
18}; 18};
19 19
@@ -24,8 +24,16 @@
24 pinctrl-names = "default"; 24 pinctrl-names = "default";
25}; 25};
26 26
27&uart_A {
28 status = "okay";
29 pinctrl-0 = <&uart_a_pins>;
30 pinctrl-names = "default";
31};
32
27&uart_AO { 33&uart_AO {
28 status = "okay"; 34 status = "okay";
35 pinctrl-0 = <&uart_ao_a_pins>;
36 pinctrl-names = "default";
29}; 37};
30 38
31&ir { 39&ir {
@@ -33,3 +41,9 @@
33 pinctrl-0 = <&remote_input_ao_pins>; 41 pinctrl-0 = <&remote_input_ao_pins>;
34 pinctrl-names = "default"; 42 pinctrl-names = "default";
35}; 43};
44
45&i2c1 {
46 status = "okay";
47 pinctrl-0 = <&i2c1_z_pins>;
48 pinctrl-names = "default";
49};
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index a80632641b39..b58808eb3cc8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -1,7 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Amlogic, Inc. All rights reserved. 3 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5 */ 4 */
6 5
7#include <dt-bindings/gpio/gpio.h> 6#include <dt-bindings/gpio/gpio.h>
@@ -163,18 +162,70 @@
163 status = "disabled"; 162 status = "disabled";
164 }; 163 };
165 164
165 i2c0: i2c@1f000 {
166 compatible = "amlogic,meson-axg-i2c";
167 status = "disabled";
168 reg = <0x0 0x1f000 0x0 0x20>;
169 interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
170 <GIC_SPI 47 IRQ_TYPE_EDGE_RISING>;
171 #address-cells = <1>;
172 #size-cells = <0>;
173 clocks = <&clkc CLKID_I2C>;
174 clock-names = "clk_i2c";
175 };
176
177 i2c1: i2c@1e000 {
178 compatible = "amlogic,meson-axg-i2c";
179 #address-cells = <1>;
180 #size-cells = <0>;
181 reg = <0x0 0x1e000 0x0 0x20>;
182 status = "disabled";
183 interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>,
184 <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>;
185 clocks = <&clkc CLKID_I2C>;
186 clock-names = "clk_i2c";
187 };
188
189 i2c2: i2c@1d000 {
190 compatible = "amlogic,meson-axg-i2c";
191 status = "disabled";
192 reg = <0x0 0x1d000 0x0 0x20>;
193 interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>,
194 <GIC_SPI 49 IRQ_TYPE_EDGE_RISING>;
195 #address-cells = <1>;
196 #size-cells = <0>;
197 clocks = <&clkc CLKID_I2C>;
198 clock-names = "clk_i2c";
199 };
200
201 i2c3: i2c@1c000 {
202 compatible = "amlogic,meson-axg-i2c";
203 status = "disabled";
204 reg = <0x0 0x1c000 0x0 0x20>;
205 interrupts = <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>,
206 <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
207 #address-cells = <1>;
208 #size-cells = <0>;
209 clocks = <&clkc CLKID_I2C>;
210 clock-names = "clk_i2c";
211 };
212
166 uart_A: serial@24000 { 213 uart_A: serial@24000 {
167 compatible = "amlogic,meson-gx-uart", "amlogic,meson-uart"; 214 compatible = "amlogic,meson-gx-uart";
168 reg = <0x0 0x24000 0x0 0x14>; 215 reg = <0x0 0x24000 0x0 0x18>;
169 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>; 216 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
170 status = "disabled"; 217 status = "disabled";
218 clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>;
219 clock-names = "xtal", "pclk", "baud";
171 }; 220 };
172 221
173 uart_B: serial@23000 { 222 uart_B: serial@23000 {
174 compatible = "amlogic,meson-gx-uart", "amlogic,meson-uart"; 223 compatible = "amlogic,meson-gx-uart";
175 reg = <0x0 0x23000 0x0 0x14>; 224 reg = <0x0 0x23000 0x0 0x18>;
176 interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>; 225 interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
177 status = "disabled"; 226 status = "disabled";
227 clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>;
228 clock-names = "xtal", "pclk", "baud";
178 }; 229 };
179 }; 230 };
180 231
@@ -234,6 +285,13 @@
234 #size-cells = <2>; 285 #size-cells = <2>;
235 ranges = <0x0 0x0 0x0 0xff634000 0x0 0x2000>; 286 ranges = <0x0 0x0 0x0 0xff634000 0x0 0x2000>;
236 287
288 hwrng: rng {
289 compatible = "amlogic,meson-rng";
290 reg = <0x0 0x18 0x0 0x4>;
291 clocks = <&clkc CLKID_RNG0>;
292 clock-names = "core";
293 };
294
237 pinctrl_periphs: pinctrl@480 { 295 pinctrl_periphs: pinctrl@480 {
238 compatible = "amlogic,meson-axg-periphs-pinctrl"; 296 compatible = "amlogic,meson-axg-periphs-pinctrl";
239 #address-cells = <2>; 297 #address-cells = <2>;
@@ -251,6 +309,36 @@
251 gpio-ranges = <&pinctrl_periphs 0 0 86>; 309 gpio-ranges = <&pinctrl_periphs 0 0 86>;
252 }; 310 };
253 311
312 eth_rmii_x_pins: eth-x-rmii {
313 mux {
314 groups = "eth_mdio_x",
315 "eth_mdc_x",
316 "eth_rgmii_rx_clk_x",
317 "eth_rx_dv_x",
318 "eth_rxd0_x",
319 "eth_rxd1_x",
320 "eth_txen_x",
321 "eth_txd0_x",
322 "eth_txd1_x";
323 function = "eth";
324 };
325 };
326
327 eth_rmii_y_pins: eth-y-rmii {
328 mux {
329 groups = "eth_mdio_y",
330 "eth_mdc_y",
331 "eth_rgmii_rx_clk_y",
332 "eth_rx_dv_y",
333 "eth_rxd0_y",
334 "eth_rxd1_y",
335 "eth_txen_y",
336 "eth_txd0_y",
337 "eth_txd1_y";
338 function = "eth";
339 };
340 };
341
254 eth_rgmii_x_pins: eth-x-rgmii { 342 eth_rgmii_x_pins: eth-x-rgmii {
255 mux { 343 mux {
256 groups = "eth_mdio_x", 344 groups = "eth_mdio_x",
@@ -444,6 +532,134 @@
444 function = "spi1"; 532 function = "spi1";
445 }; 533 };
446 }; 534 };
535
536 i2c0_pins: i2c0 {
537 mux {
538 groups = "i2c0_sck",
539 "i2c0_sda";
540 function = "i2c0";
541 };
542 };
543
544 i2c1_z_pins: i2c1_z {
545 mux {
546 groups = "i2c1_sck_z",
547 "i2c1_sda_z";
548 function = "i2c1";
549 };
550 };
551
552 i2c1_x_pins: i2c1_x {
553 mux {
554 groups = "i2c1_sck_x",
555 "i2c1_sda_x";
556 function = "i2c1";
557 };
558 };
559
560 i2c2_x_pins: i2c2_x {
561 mux {
562 groups = "i2c2_sck_x",
563 "i2c2_sda_x";
564 function = "i2c2";
565 };
566 };
567
568 i2c2_a_pins: i2c2_a {
569 mux {
570 groups = "i2c2_sck_a",
571 "i2c2_sda_a";
572 function = "i2c2";
573 };
574 };
575
576 i2c3_a6_pins: i2c3_a6 {
577 mux {
578 groups = "i2c3_sda_a6",
579 "i2c3_sck_a7";
580 function = "i2c3";
581 };
582 };
583
584 i2c3_a12_pins: i2c3_a12 {
585 mux {
586 groups = "i2c3_sda_a12",
587 "i2c3_sck_a13";
588 function = "i2c3";
589 };
590 };
591
592 i2c3_a19_pins: i2c3_a19 {
593 mux {
594 groups = "i2c3_sda_a19",
595 "i2c3_sck_a20";
596 function = "i2c3";
597 };
598 };
599
600 uart_a_pins: uart_a {
601 mux {
602 groups = "uart_tx_a",
603 "uart_rx_a";
604 function = "uart_a";
605 };
606 };
607
608 uart_a_cts_rts_pins: uart_a_cts_rts {
609 mux {
610 groups = "uart_cts_a",
611 "uart_rts_a";
612 function = "uart_a";
613 };
614 };
615
616 uart_b_x_pins: uart_b_x {
617 mux {
618 groups = "uart_tx_b_x",
619 "uart_rx_b_x";
620 function = "uart_b";
621 };
622 };
623
624 uart_b_x_cts_rts_pins: uart_b_x_cts_rts {
625 mux {
626 groups = "uart_cts_b_x",
627 "uart_rts_b_x";
628 function = "uart_b";
629 };
630 };
631
632 uart_b_z_pins: uart_b_z {
633 mux {
634 groups = "uart_tx_b_z",
635 "uart_rx_b_z";
636 function = "uart_b";
637 };
638 };
639
640 uart_b_z_cts_rts_pins: uart_b_z_cts_rts {
641 mux {
642 groups = "uart_cts_b_z",
643 "uart_rts_b_z";
644 function = "uart_b";
645 };
646 };
647
648 uart_ao_b_z_pins: uart_ao_b_z {
649 mux {
650 groups = "uart_ao_tx_b_z",
651 "uart_ao_rx_b_z";
652 function = "uart_ao_b_z";
653 };
654 };
655
656 uart_ao_b_z_cts_rts_pins: uart_ao_b_z_cts_rts {
657 mux {
658 groups = "uart_ao_cts_b_z",
659 "uart_ao_rts_b_z";
660 function = "uart_ao_b_z";
661 };
662 };
447 }; 663 };
448 }; 664 };
449 665
@@ -494,6 +710,44 @@
494 function = "remote_input_ao"; 710 function = "remote_input_ao";
495 }; 711 };
496 }; 712 };
713
714 uart_ao_a_pins: uart_ao_a {
715 mux {
716 groups = "uart_ao_tx_a",
717 "uart_ao_rx_a";
718 function = "uart_ao_a";
719 };
720 };
721
722 uart_ao_a_cts_rts_pins: uart_ao_a_cts_rts {
723 mux {
724 groups = "uart_ao_cts_a",
725 "uart_ao_rts_a";
726 function = "uart_ao_a";
727 };
728 };
729
730 uart_ao_b_pins: uart_ao_b {
731 mux {
732 groups = "uart_ao_tx_b",
733 "uart_ao_rx_b";
734 function = "uart_ao_b";
735 };
736 };
737
738 uart_ao_b_cts_rts_pins: uart_ao_b_cts_rts {
739 mux {
740 groups = "uart_ao_cts_b",
741 "uart_ao_rts_b";
742 function = "uart_ao_b";
743 };
744 };
745 };
746
747 sec_AO: ao-secure@140 {
748 compatible = "amlogic,meson-gx-ao-secure", "syscon";
749 reg = <0x0 0x140 0x0 0x140>;
750 amlogic,has-chip-id;
497 }; 751 };
498 752
499 pwm_AO_ab: pwm@7000 { 753 pwm_AO_ab: pwm@7000 {
@@ -504,12 +758,23 @@
504 }; 758 };
505 759
506 pwm_AO_cd: pwm@2000 { 760 pwm_AO_cd: pwm@2000 {
507 compatible = "amlogic,axg-ao-pwm"; 761 compatible = "amlogic,meson-axg-ao-pwm";
508 reg = <0x0 0x02000 0x0 0x20>; 762 reg = <0x0 0x02000 0x0 0x20>;
509 #pwm-cells = <3>; 763 #pwm-cells = <3>;
510 status = "disabled"; 764 status = "disabled";
511 }; 765 };
512 766
767 i2c_AO: i2c@5000 {
768 compatible = "amlogic,meson-axg-i2c";
769 status = "disabled";
770 reg = <0x0 0x05000 0x0 0x20>;
771 interrupts = <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>;
772 #address-cells = <1>;
773 #size-cells = <0>;
774 clocks = <&clkc CLKID_I2C>;
775 clock-names = "clk_i2c";
776 };
777
513 uart_AO: serial@3000 { 778 uart_AO: serial@3000 {
514 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart"; 779 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart";
515 reg = <0x0 0x3000 0x0 0x18>; 780 reg = <0x0 0x3000 0x0 0x18>;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
index aeb6d21a3bec..4eef36b22538 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/* Common DTSI for same Amlogic Q200/Q201 and P230/P231 boards using either 7/* Common DTSI for same Amlogic Q200/Q201 and P230/P231 boards using either
@@ -48,6 +11,7 @@
48/ { 11/ {
49 aliases { 12 aliases {
50 serial0 = &uart_AO; 13 serial0 = &uart_AO;
14 ethernet0 = &ethmac;
51 }; 15 };
52 16
53 chosen { 17 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index 6cb3c2a52baf..3c31e21cbed7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * 4 *
@@ -6,44 +7,6 @@
6 * 7 *
7 * Copyright (c) 2016 Endless Computers, Inc. 8 * Copyright (c) 2016 Endless Computers, Inc.
8 * Author: Carlo Caione <carlo@endlessm.com> 9 * Author: Carlo Caione <carlo@endlessm.com>
9 *
10 * This file is dual-licensed: you can use it either under the terms
11 * of the GPL or the X11 license, at your option. Note that this dual
12 * licensing only applies to this file, and not this project as a
13 * whole.
14 *
15 * a) This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of the
18 * License, or (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * Or, alternatively,
26 *
27 * b) Permission is hereby granted, free of charge, to any person
28 * obtaining a copy of this software and associated documentation
29 * files (the "Software"), to deal in the Software without
30 * restriction, including without limitation the rights to use,
31 * copy, modify, merge, publish, distribute, sublicense, and/or
32 * sell copies of the Software, and to permit persons to whom the
33 * Software is furnished to do so, subject to the following
34 * conditions:
35 *
36 * The above copyright notice and this permission notice shall be
37 * included in all copies or substantial portions of the Software.
38 *
39 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
41 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
42 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
43 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
44 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46 * OTHER DEALINGS IN THE SOFTWARE.
47 */ 10 */
48 11
49#include <dt-bindings/gpio/gpio.h> 12#include <dt-bindings/gpio/gpio.h>
@@ -169,6 +132,7 @@
169 compatible = "amlogic,meson-gx-efuse", "amlogic,meson-gxbb-efuse"; 132 compatible = "amlogic,meson-gx-efuse", "amlogic,meson-gxbb-efuse";
170 #address-cells = <1>; 133 #address-cells = <1>;
171 #size-cells = <1>; 134 #size-cells = <1>;
135 read-only;
172 136
173 sn: sn@14 { 137 sn: sn@14 {
174 reg = <0x14 0x10>; 138 reg = <0x14 0x10>;
@@ -235,14 +199,14 @@
235 199
236 uart_A: serial@84c0 { 200 uart_A: serial@84c0 {
237 compatible = "amlogic,meson-gx-uart"; 201 compatible = "amlogic,meson-gx-uart";
238 reg = <0x0 0x84c0 0x0 0x14>; 202 reg = <0x0 0x84c0 0x0 0x18>;
239 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>; 203 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
240 status = "disabled"; 204 status = "disabled";
241 }; 205 };
242 206
243 uart_B: serial@84dc { 207 uart_B: serial@84dc {
244 compatible = "amlogic,meson-gx-uart"; 208 compatible = "amlogic,meson-gx-uart";
245 reg = <0x0 0x84dc 0x0 0x14>; 209 reg = <0x0 0x84dc 0x0 0x18>;
246 interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>; 210 interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
247 status = "disabled"; 211 status = "disabled";
248 }; 212 };
@@ -287,7 +251,7 @@
287 251
288 uart_C: serial@8700 { 252 uart_C: serial@8700 {
289 compatible = "amlogic,meson-gx-uart"; 253 compatible = "amlogic,meson-gx-uart";
290 reg = <0x0 0x8700 0x0 0x14>; 254 reg = <0x0 0x8700 0x0 0x18>;
291 interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>; 255 interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
292 status = "disabled"; 256 status = "disabled";
293 }; 257 };
@@ -404,14 +368,14 @@
404 368
405 uart_AO: serial@4c0 { 369 uart_AO: serial@4c0 {
406 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart"; 370 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart";
407 reg = <0x0 0x004c0 0x0 0x14>; 371 reg = <0x0 0x004c0 0x0 0x18>;
408 interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>; 372 interrupts = <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>;
409 status = "disabled"; 373 status = "disabled";
410 }; 374 };
411 375
412 uart_AO_B: serial@4e0 { 376 uart_AO_B: serial@4e0 {
413 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart"; 377 compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart";
414 reg = <0x0 0x004e0 0x0 0x14>; 378 reg = <0x0 0x004e0 0x0 0x18>;
415 interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>; 379 interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
416 status = "disabled"; 380 status = "disabled";
417 }; 381 };
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
index 011e8e08e429..7d5709c37e95 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
@@ -1,45 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Andreas Färber 3 * Copyright (c) 2017 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 *
42 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
43 */ 4 */
44 5
45/dts-v1/; 6/dts-v1/;
@@ -52,6 +13,7 @@
52 13
53 aliases { 14 aliases {
54 serial0 = &uart_AO; 15 serial0 = &uart_AO;
16 ethernet0 = &ethmac;
55 }; 17 };
56 18
57 chosen { 19 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
index 818954b1d57f..4cf7f6e80c6a 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Neil Armstrong <narmstrong@kernel.org> 5 * Author: Neil Armstrong <narmstrong@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45/dts-v1/; 8/dts-v1/;
@@ -54,6 +17,7 @@
54 17
55 aliases { 18 aliases {
56 serial0 = &uart_AO; 19 serial0 = &uart_AO;
20 ethernet0 = &ethmac;
57 }; 21 };
58 22
59 chosen { 23 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index ee4ada61c59c..54954b314a45 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Kevin Hilman <khilman@kernel.org> 5 * Author: Kevin Hilman <khilman@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45/dts-v1/; 8/dts-v1/;
@@ -53,6 +16,7 @@
53 16
54 aliases { 17 aliases {
55 serial0 = &uart_AO; 18 serial0 = &uart_AO;
19 ethernet0 = &ethmac;
56 }; 20 };
57 21
58 chosen { 22 chosen {
@@ -310,7 +274,7 @@
310 pinctrl-names = "default", "clk-gate"; 274 pinctrl-names = "default", "clk-gate";
311 275
312 bus-width = <8>; 276 bus-width = <8>;
313 max-frequency = <200000000>; 277 max-frequency = <100000000>;
314 non-removable; 278 non-removable;
315 disable-wp; 279 disable-wp;
316 cap-mmc-highspeed; 280 cap-mmc-highspeed;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
index 09f34f7ef084..9d2406a7c4fa 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Kevin Hilman <khilman@kernel.org> 5 * Author: Kevin Hilman <khilman@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45/dts-v1/; 8/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts
index ae3194663d64..56e0dd1ff55c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Kevin Hilman <khilman@kernel.org> 5 * Author: Kevin Hilman <khilman@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45/dts-v1/; 8/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index 932158a778ef..ce862266b9aa 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Kevin Hilman <khilman@kernel.org> 5 * Author: Kevin Hilman <khilman@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45#include "meson-gxbb.dtsi" 8#include "meson-gxbb.dtsi"
@@ -47,6 +10,7 @@
47/ { 10/ {
48 aliases { 11 aliases {
49 serial0 = &uart_AO; 12 serial0 = &uart_AO;
13 ethernet0 = &ethmac;
50 }; 14 };
51 15
52 chosen { 16 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
index 62fb4968d680..c928adf85388 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts
@@ -1,43 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */ 4 */
42 5
43/dts-v1/; 6/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
index 9a9663abdf5c..e81e1d68b5fa 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts
@@ -1,43 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */ 4 */
42 5
43/dts-v1/; 6/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
index 2fe167b2609d..a8fca0c6903f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts
@@ -1,43 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */ 4 */
42 5
43/dts-v1/; 6/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 1fe8e24cf675..93a4acf2c46c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -1,43 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */ 4 */
42 5
43#include "meson-gxbb.dtsi" 6#include "meson-gxbb.dtsi"
@@ -47,6 +10,7 @@
47 10
48 aliases { 11 aliases {
49 serial0 = &uart_AO; 12 serial0 = &uart_AO;
13 ethernet0 = &ethmac;
50 }; 14 };
51 15
52 chosen { 16 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
index 1878ac2b2b83..2bfe69902552 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
@@ -1,92 +1,14 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 BayLibre, Inc. 3 * Copyright (c) 2016 BayLibre, Inc.
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
45 8
46#include "meson-gxbb-p20x.dtsi" 9#include "meson-gxbb-wetek.dtsi"
47 10
48/ { 11/ {
49 compatible = "wetek,hub", "amlogic,meson-gxbb"; 12 compatible = "wetek,hub", "amlogic,meson-gxbb";
50 model = "WeTek Hub"; 13 model = "WeTek Hub";
51
52 leds {
53 compatible = "gpio-leds";
54
55 system {
56 label = "wetek-play:system-status";
57 gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
58 default-state = "on";
59 panic-indicator;
60 };
61 };
62};
63
64&cvbs_connector {
65 status = "disabled";
66};
67
68&ethmac {
69 status = "okay";
70 pinctrl-0 = <&eth_rgmii_pins>;
71 pinctrl-names = "default";
72
73 phy-handle = <&eth_phy0>;
74 phy-mode = "rgmii";
75
76 amlogic,tx-delay-ns = <2>;
77
78 snps,reset-gpio = <&gpio GPIOZ_14 0>;
79 snps,reset-delays-us = <0 10000 1000000>;
80 snps,reset-active-low;
81
82 mdio {
83 compatible = "snps,dwmac-mdio";
84 #address-cells = <1>;
85 #size-cells = <0>;
86
87 eth_phy0: ethernet-phy@0 {
88 /* Realtek RTL8211F (0x001cc916) */
89 reg = <0>;
90 };
91 };
92}; 14};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
index f7144fd5e03f..0038522315de 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
@@ -1,49 +1,12 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 BayLibre, Inc. 3 * Copyright (c) 2016 BayLibre, Inc.
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
45 8
46#include "meson-gxbb-p20x.dtsi" 9#include "meson-gxbb-wetek.dtsi"
47#include <dt-bindings/input/input.h> 10#include <dt-bindings/input/input.h>
48 11
49/ { 12/ {
@@ -51,15 +14,6 @@
51 model = "WeTek Play 2"; 14 model = "WeTek Play 2";
52 15
53 leds { 16 leds {
54 compatible = "gpio-leds";
55
56 system {
57 label = "wetek-play:system-status";
58 gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
59 default-state = "on";
60 panic-indicator;
61 };
62
63 wifi { 17 wifi {
64 label = "wetek-play:wifi-status"; 18 label = "wetek-play:wifi-status";
65 gpios = <&gpio GPIODV_26 GPIO_ACTIVE_HIGH>; 19 gpios = <&gpio GPIODV_26 GPIO_ACTIVE_HIGH>;
@@ -85,82 +39,18 @@
85 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>; 39 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
86 }; 40 };
87 }; 41 };
88
89 cvbs-connector {
90 compatible = "composite-video-connector";
91
92 port {
93 cvbs_connector_in: endpoint {
94 remote-endpoint = <&cvbs_vdac_out>;
95 };
96 };
97 };
98
99 hdmi-connector {
100 compatible = "hdmi-connector";
101 type = "a";
102
103 port {
104 hdmi_connector_in: endpoint {
105 remote-endpoint = <&hdmi_tx_tmds_out>;
106 };
107 };
108 };
109};
110
111&cec_AO {
112 status = "okay";
113 pinctrl-0 = <&ao_cec_pins>;
114 pinctrl-names = "default";
115 hdmi-phandle = <&hdmi_tx>;
116};
117
118&cvbs_vdac_port {
119 cvbs_vdac_out: endpoint {
120 remote-endpoint = <&cvbs_connector_in>;
121 };
122}; 42};
123 43
124&ethmac { 44&i2c_A {
125 status = "okay"; 45 status = "okay";
126 pinctrl-0 = <&eth_rgmii_pins>; 46 pinctrl-0 = <&i2c_a_pins>;
127 pinctrl-names = "default"; 47 pinctrl-names = "default";
128
129 phy-handle = <&eth_phy0>;
130 phy-mode = "rgmii";
131
132 amlogic,tx-delay-ns = <2>;
133
134 snps,reset-gpio = <&gpio GPIOZ_14 0>;
135 snps,reset-delays-us = <0 10000 1000000>;
136 snps,reset-active-low;
137
138 mdio {
139 compatible = "snps,dwmac-mdio";
140 #address-cells = <1>;
141 #size-cells = <0>;
142
143 eth_phy0: ethernet-phy@0 {
144 /* Realtek RTL8211F (0x001cc916) */
145 reg = <0>;
146 };
147 };
148}; 48};
149 49
150&hdmi_tx { 50&usb1_phy {
151 status = "okay"; 51 status = "okay";
152 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
153 pinctrl-names = "default";
154}; 52};
155 53
156&hdmi_tx_tmds_port { 54&usb1 {
157 hdmi_tx_tmds_out: endpoint {
158 remote-endpoint = <&hdmi_connector_in>;
159 };
160};
161
162&i2c_A {
163 status = "okay"; 55 status = "okay";
164 pinctrl-0 = <&i2c_a_pins>;
165 pinctrl-names = "default";
166}; 56};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
new file mode 100644
index 000000000000..70325b273bd2
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
@@ -0,0 +1,256 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Andreas Färber
4 * Copyright (c) 2016 BayLibre, Inc.
5 * Author: Kevin Hilman <khilman@kernel.org>
6 */
7
8#include "meson-gxbb.dtsi"
9
10/ {
11 aliases {
12 serial0 = &uart_AO;
13 ethernet0 = &ethmac;
14 };
15
16 chosen {
17 stdout-path = "serial0:115200n8";
18 };
19
20 memory@0 {
21 device_type = "memory";
22 reg = <0x0 0x0 0x0 0x40000000>;
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 system {
29 label = "wetek-play:system-status";
30 gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
31 default-state = "on";
32 panic-indicator;
33 };
34 };
35
36 usb_pwr: regulator-usb-pwrs {
37 compatible = "regulator-fixed";
38
39 regulator-name = "USB_PWR";
40
41 regulator-min-microvolt = <5000000>;
42 regulator-max-microvolt = <5000000>;
43
44 gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
45 enable-active-high;
46 };
47
48 vddio_boot: regulator-vddio_boot {
49 compatible = "regulator-fixed";
50 regulator-name = "VDDIO_BOOT";
51 regulator-min-microvolt = <1800000>;
52 regulator-max-microvolt = <1800000>;
53 };
54
55 vddao_3v3: regulator-vddao_3v3 {
56 compatible = "regulator-fixed";
57 regulator-name = "VDDAO_3V3";
58 regulator-min-microvolt = <3300000>;
59 regulator-max-microvolt = <3300000>;
60 };
61
62 vcc_3v3: regulator-vcc_3v3 {
63 compatible = "regulator-fixed";
64 regulator-name = "VCC_3V3";
65 regulator-min-microvolt = <3300000>;
66 regulator-max-microvolt = <3300000>;
67 };
68
69 emmc_pwrseq: emmc-pwrseq {
70 compatible = "mmc-pwrseq-emmc";
71 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
72 };
73
74 wifi32k: wifi32k {
75 compatible = "pwm-clock";
76 #clock-cells = <0>;
77 clock-frequency = <32768>;
78 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
79 };
80
81 sdio_pwrseq: sdio-pwrseq {
82 compatible = "mmc-pwrseq-simple";
83 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
84 clocks = <&wifi32k>;
85 clock-names = "ext_clock";
86 };
87
88 cvbs-connector {
89 compatible = "composite-video-connector";
90
91 port {
92 cvbs_connector_in: endpoint {
93 remote-endpoint = <&cvbs_vdac_out>;
94 };
95 };
96 };
97
98 hdmi-connector {
99 compatible = "hdmi-connector";
100 type = "a";
101
102 port {
103 hdmi_connector_in: endpoint {
104 remote-endpoint = <&hdmi_tx_tmds_out>;
105 };
106 };
107 };
108};
109
110&cec_AO {
111 status = "okay";
112 pinctrl-0 = <&ao_cec_pins>;
113 pinctrl-names = "default";
114 hdmi-phandle = <&hdmi_tx>;
115};
116
117&cvbs_vdac_port {
118 cvbs_vdac_out: endpoint {
119 remote-endpoint = <&cvbs_connector_in>;
120 };
121};
122
123&ethmac {
124 status = "okay";
125 pinctrl-0 = <&eth_rgmii_pins>;
126 pinctrl-names = "default";
127
128 phy-handle = <&eth_phy0>;
129 phy-mode = "rgmii";
130
131 amlogic,tx-delay-ns = <2>;
132
133 snps,reset-gpio = <&gpio GPIOZ_14 0>;
134 snps,reset-delays-us = <0 10000 1000000>;
135 snps,reset-active-low;
136
137 mdio {
138 compatible = "snps,dwmac-mdio";
139 #address-cells = <1>;
140 #size-cells = <0>;
141
142 eth_phy0: ethernet-phy@0 {
143 /* Realtek RTL8211F (0x001cc916) */
144 reg = <0>;
145 eee-broken-1000t;
146 };
147 };
148};
149
150&hdmi_tx {
151 status = "okay";
152 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
153 pinctrl-names = "default";
154};
155
156&hdmi_tx_tmds_port {
157 hdmi_tx_tmds_out: endpoint {
158 remote-endpoint = <&hdmi_connector_in>;
159 };
160};
161
162&ir {
163 status = "okay";
164 pinctrl-0 = <&remote_input_ao_pins>;
165 pinctrl-names = "default";
166};
167
168&pwm_ef {
169 status = "okay";
170 pinctrl-0 = <&pwm_e_pins>;
171 pinctrl-names = "default";
172 clocks = <&clkc CLKID_FCLK_DIV4>;
173 clock-names = "clkin0";
174};
175
176/* Wireless SDIO Module */
177&sd_emmc_a {
178 status = "okay";
179 pinctrl-0 = <&sdio_pins>;
180 pinctrl-1 = <&sdio_clk_gate_pins>;
181 pinctrl-names = "default", "clk-gate";
182 #address-cells = <1>;
183 #size-cells = <0>;
184
185 bus-width = <4>;
186 cap-sd-highspeed;
187 max-frequency = <100000000>;
188
189 non-removable;
190 disable-wp;
191
192 mmc-pwrseq = <&sdio_pwrseq>;
193
194 vmmc-supply = <&vddao_3v3>;
195 vqmmc-supply = <&vddio_boot>;
196
197 brcmf: wifi@1 {
198 reg = <1>;
199 compatible = "brcm,bcm4329-fmac";
200 };
201};
202
203/* SD card */
204&sd_emmc_b {
205 status = "okay";
206 pinctrl-0 = <&sdcard_pins>;
207 pinctrl-1 = <&sdcard_clk_gate_pins>;
208 pinctrl-names = "default", "clk-gate";
209
210 bus-width = <4>;
211 cap-sd-highspeed;
212 max-frequency = <100000000>;
213 disable-wp;
214
215 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
216 cd-inverted;
217
218 vmmc-supply = <&vddao_3v3>;
219 vqmmc-supply = <&vcc_3v3>;
220};
221
222/* eMMC */
223&sd_emmc_c {
224 status = "okay";
225 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
226 pinctrl-1 = <&emmc_clk_gate_pins>;
227 pinctrl-names = "default", "clk-gate";
228
229 bus-width = <8>;
230 cap-mmc-highspeed;
231 max-frequency = <200000000>;
232 non-removable;
233 disable-wp;
234 mmc-ddr-1_8v;
235 mmc-hs200-1_8v;
236
237 mmc-pwrseq = <&emmc_pwrseq>;
238 vmmc-supply = <&vcc_3v3>;
239 vqmmc-supply = <&vddio_boot>;
240};
241
242/* This UART is brought out to the DB9 connector */
243&uart_AO {
244 status = "okay";
245 pinctrl-0 = <&uart_ao_a_pins>;
246 pinctrl-names = "default";
247};
248
249&usb0_phy {
250 status = "okay";
251 phy-supply = <&usb_pwr>;
252};
253
254&usb0 {
255 status = "okay";
256};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 3290a4dc3522..562c26a0ba33 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -1,43 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */ 4 */
42 5
43#include "meson-gx.dtsi" 6#include "meson-gx.dtsi"
@@ -284,14 +247,17 @@
284 * MALI_0 and MALI_1 muxed to a single clock by a glitch 247 * MALI_0 and MALI_1 muxed to a single clock by a glitch
285 * free mux to safely change frequency while running. 248 * free mux to safely change frequency while running.
286 */ 249 */
287 assigned-clocks = <&clkc CLKID_MALI_0_SEL>, 250 assigned-clocks = <&clkc CLKID_GP0_PLL>,
251 <&clkc CLKID_MALI_0_SEL>,
288 <&clkc CLKID_MALI_0>, 252 <&clkc CLKID_MALI_0>,
289 <&clkc CLKID_MALI>; /* Glitch free mux */ 253 <&clkc CLKID_MALI>; /* Glitch free mux */
290 assigned-clock-parents = <&clkc CLKID_FCLK_DIV3>, 254 assigned-clock-parents = <0>, /* Do Nothing */
255 <&clkc CLKID_GP0_PLL>,
291 <0>, /* Do Nothing */ 256 <0>, /* Do Nothing */
292 <&clkc CLKID_MALI_0>; 257 <&clkc CLKID_MALI_0>;
293 assigned-clock-rates = <0>, /* Do Nothing */ 258 assigned-clock-rates = <744000000>,
294 <666666666>, 259 <0>, /* Do Nothing */
260 <744000000>,
295 <0>; /* Do Nothing */ 261 <0>; /* Do Nothing */
296 }; 262 };
297}; 263};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi
index f06cc234693b..eb327664a4d8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi
@@ -1,8 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 BayLibre SAS 3 * Copyright (c) 2017 BayLibre SAS
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 *
5 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
6 */ 5 */
7 6
8&apb { 7&apb {
@@ -30,14 +29,17 @@
30 * MALI_0 and MALI_1 muxed to a single clock by a glitch 29 * MALI_0 and MALI_1 muxed to a single clock by a glitch
31 * free mux to safely change frequency while running. 30 * free mux to safely change frequency while running.
32 */ 31 */
33 assigned-clocks = <&clkc CLKID_MALI_0_SEL>, 32 assigned-clocks = <&clkc CLKID_GP0_PLL>,
33 <&clkc CLKID_MALI_0_SEL>,
34 <&clkc CLKID_MALI_0>, 34 <&clkc CLKID_MALI_0>,
35 <&clkc CLKID_MALI>; /* Glitch free mux */ 35 <&clkc CLKID_MALI>; /* Glitch free mux */
36 assigned-clock-parents = <&clkc CLKID_FCLK_DIV3>, 36 assigned-clock-parents = <0>, /* Do Nothing */
37 <&clkc CLKID_GP0_PLL>,
37 <0>, /* Do Nothing */ 38 <0>, /* Do Nothing */
38 <&clkc CLKID_MALI_0>; 39 <&clkc CLKID_MALI_0>;
39 assigned-clock-rates = <0>, /* Do Nothing */ 40 assigned-clock-rates = <744000000>,
40 <666666666>, 41 <0>, /* Do Nothing */
42 <744000000>,
41 <0>; /* Do Nothing */ 43 <0>; /* Do Nothing */
42 }; 44 };
43}; 45};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
index 4f3f03fc31b0..a9f9bb90a877 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
index 95992cf1fe61..80a231476b80 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d.dtsi
index 5a90e30c1006..43321919547a 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d.dtsi
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44#include "meson-gxl.dtsi" 7#include "meson-gxl.dtsi"
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts
index e82582574160..f1c410e2da2b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts
@@ -1,9 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Carlo Caione 3 * Copyright (c) 2017 Carlo Caione
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Neil Armstrong <narmstrong@kernel.org> 5 * Author: Neil Armstrong <narmstrong@kernel.org>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */ 6 */
8 7
9/dts-v1/; 8/dts-v1/;
@@ -16,6 +15,7 @@
16 15
17 aliases { 16 aliases {
18 serial0 = &uart_AO; 17 serial0 = &uart_AO;
18 ethernet0 = &ethmac;
19 }; 19 };
20 20
21 chosen { 21 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
index 71a6e1ce7ad5..d32cf3846370 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
@@ -1,7 +1,6 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>. 3 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
3 *
4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5 */ 4 */
6 5
7/dts-v1/; 6/dts-v1/;
@@ -29,6 +28,7 @@
29 28
30 aliases { 29 aliases {
31 serial2 = &uart_AO_B; 30 serial2 = &uart_AO_B;
31 ethernet0 = &ethmac;
32 }; 32 };
33 33
34 gpio-keys-polled { 34 gpio-keys-polled {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
index 9671f1e3c74a..22bf37404ff1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
@@ -1,9 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 BayLibre, SAS. 3 * Copyright (c) 2017 BayLibre, SAS.
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 * Author: Jerome Brunet <jbrunet@baylibre.com> 5 * Author: Jerome Brunet <jbrunet@baylibre.com>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */ 6 */
8 7
9/dts-v1/; 8/dts-v1/;
@@ -18,6 +17,7 @@
18 17
19 aliases { 18 aliases {
20 serial0 = &uart_AO; 19 serial0 = &uart_AO;
20 ethernet0 = &ethmac;
21 }; 21 };
22 22
23 chosen { 23 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
index 271f14279180..69c721a70e44 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
@@ -1,45 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Andreas Färber 3 * Copyright (c) 2016 Andreas Färber
3 * Copyright (c) 2016 BayLibre, Inc. 4 * Copyright (c) 2016 BayLibre, Inc.
4 * Author: Neil Armstrong <narmstrong@kernel.org> 5 * Author: Neil Armstrong <narmstrong@kernel.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */ 6 */
44 7
45/dts-v1/; 8/dts-v1/;
@@ -52,6 +15,7 @@
52 15
53 aliases { 16 aliases {
54 serial0 = &uart_AO; 17 serial0 = &uart_AO;
18 ethernet0 = &ethmac;
55 }; 19 };
56 20
57 chosen { 21 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
index 6e2bf858291c..5896e8a5d86b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi
index 7005068346a0..0a0953fbc7d4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Martin Blumenstingl <martin.blumenstingl@googlemail.com>. 3 * Copyright (c) 2016 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
3 * Based on meson-gx-p23x-q20x.dtsi: 4 * Based on meson-gx-p23x-q20x.dtsi:
@@ -5,8 +6,6 @@
5 * Author: Carlo Caione <carlo@endlessm.com> 6 * Author: Carlo Caione <carlo@endlessm.com>
6 * - Copyright (c) 2016 BayLibre, SAS. 7 * - Copyright (c) 2016 BayLibre, SAS.
7 * Author: Neil Armstrong <narmstrong@baylibre.com> 8 * Author: Neil Armstrong <narmstrong@baylibre.com>
8 *
9 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
10 */ 9 */
11 10
12/* Common DTSI for devices which are based on the P212 reference board. */ 11/* Common DTSI for devices which are based on the P212 reference board. */
@@ -17,6 +16,7 @@
17 aliases { 16 aliases {
18 serial0 = &uart_AO; 17 serial0 = &uart_AO;
19 serial1 = &uart_A; 18 serial1 = &uart_A;
19 ethernet0 = &ethmac;
20 }; 20 };
21 21
22 chosen { 22 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
index 3314a0b3dad9..40c19f69e9dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44#include "meson-gxl.dtsi" 7#include "meson-gxl.dtsi"
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index 4f355f17eed6..e1a39cbed8c9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44#include "meson-gx.dtsi" 7#include "meson-gx.dtsi"
@@ -631,6 +594,7 @@
631 594
632 internal_phy: ethernet-phy@8 { 595 internal_phy: ethernet-phy@8 {
633 compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22"; 596 compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22";
597 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
634 reg = <8>; 598 reg = <8>;
635 max-speed = <100>; 599 max-speed = <100>;
636 }; 600 };
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index 1448c3dba08e..4fd46c1546a7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -1,9 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>. 3 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
3 * Copyright (c) 2017 BayLibre, SAS 4 * Copyright (c) 2017 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com> 5 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */ 6 */
8 7
9/dts-v1/; 8/dts-v1/;
@@ -59,8 +58,6 @@
59 1 1 58 1 1
60 2 2 59 2 2
61 3 3>; 60 3 3>;
62 cooling-min-level = <0>;
63 cooling-max-level = <3>;
64 #cooling-cells = <2>; 61 #cooling-cells = <2>;
65 }; 62 };
66 63
@@ -209,14 +206,10 @@
209}; 206};
210 207
211&cpu0 { 208&cpu0 {
212 cooling-min-level = <0>;
213 cooling-max-level = <6>;
214 #cooling-cells = <2>; 209 #cooling-cells = <2>;
215}; 210};
216 211
217&cpu4 { 212&cpu4 {
218 cooling-min-level = <0>;
219 cooling-max-level = <4>;
220 #cooling-cells = <2>; 213 #cooling-cells = <2>;
221}; 214};
222 215
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
index e7a228f6cc7e..f7a1cffab4a8 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
@@ -1,47 +1,10 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 BayLibre, SAS. 3 * Copyright (c) 2016 BayLibre, SAS.
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 * 5 *
5 * Copyright (c) 2016 Endless Computers, Inc. 6 * Copyright (c) 2016 Endless Computers, Inc.
6 * Author: Carlo Caione <carlo@endlessm.com> 7 * Author: Carlo Caione <carlo@endlessm.com>
7 *
8 * This file is dual-licensed: you can use it either under the terms
9 * of the GPL or the X11 license, at your option. Note that this dual
10 * licensing only applies to this file, and not this project as a
11 * whole.
12 *
13 * a) This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * Or, alternatively,
24 *
25 * b) Permission is hereby granted, free of charge, to any person
26 * obtaining a copy of this software and associated documentation
27 * files (the "Software"), to deal in the Software without
28 * restriction, including without limitation the rights to use,
29 * copy, modify, merge, publish, distribute, sublicense, and/or
30 * sell copies of the Software, and to permit persons to whom the
31 * Software is furnished to do so, subject to the following
32 * conditions:
33 *
34 * The above copyright notice and this permission notice shall be
35 * included in all copies or substantial portions of the Software.
36 *
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 * OTHER DEALINGS IN THE SOFTWARE.
45 */ 8 */
46 9
47/dts-v1/; 10/dts-v1/;
@@ -54,6 +17,7 @@
54 17
55 aliases { 18 aliases {
56 serial0 = &uart_AO; 19 serial0 = &uart_AO;
20 ethernet0 = &ethmac;
57 }; 21 };
58 22
59 chosen { 23 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
index 388fac4f2d97..101417298a1d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-q201.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-q201.dts
index 95e11d7faab8..8d132b17514a 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-q201.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-q201.dts
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44/dts-v1/; 7/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
index a5e9b955d5ed..7212dc4531e4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016-2017 Andreas Färber 3 * Copyright (c) 2016-2017 Andreas Färber
3 * 4 *
@@ -8,44 +9,6 @@
8 * 9 *
9 * Copyright (c) 2016 Endless Computers, Inc. 10 * Copyright (c) 2016 Endless Computers, Inc.
10 * Author: Carlo Caione <carlo@endlessm.com> 11 * Author: Carlo Caione <carlo@endlessm.com>
11 *
12 * This file is dual-licensed: you can use it either under the terms
13 * of the GPL or the X11 license, at your option. Note that this dual
14 * licensing only applies to this file, and not this project as a
15 * whole.
16 *
17 * a) This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of the
20 * License, or (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * Or, alternatively,
28 *
29 * b) Permission is hereby granted, free of charge, to any person
30 * obtaining a copy of this software and associated documentation
31 * files (the "Software"), to deal in the Software without
32 * restriction, including without limitation the rights to use,
33 * copy, modify, merge, publish, distribute, sublicense, and/or
34 * sell copies of the Software, and to permit persons to whom the
35 * Software is furnished to do so, subject to the following
36 * conditions:
37 *
38 * The above copyright notice and this permission notice shall be
39 * included in all copies or substantial portions of the Software.
40 *
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
43 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
44 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
45 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
46 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
47 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
48 * OTHER DEALINGS IN THE SOFTWARE.
49 */ 12 */
50 13
51/dts-v1/; 14/dts-v1/;
@@ -58,6 +21,7 @@
58 21
59 aliases { 22 aliases {
60 serial0 = &uart_AO; 23 serial0 = &uart_AO;
24 ethernet0 = &ethmac;
61 }; 25 };
62 26
63 chosen { 27 chosen {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-vega-s96.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-vega-s96.dts
index dc37eecb9514..e2ea6753263b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-vega-s96.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-vega-s96.dts
@@ -1,9 +1,8 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2017 BayLibre, SAS. 3 * Copyright (c) 2017 BayLibre, SAS.
3 * Author: Neil Armstrong <narmstrong@baylibre.com> 4 * Author: Neil Armstrong <narmstrong@baylibre.com>
4 * Copyright (c) 2017 Oleg <balbes-150@yandex.ru> 5 * Copyright (c) 2017 Oleg <balbes-150@yandex.ru>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */ 6 */
8 7
9/dts-v1/; 8/dts-v1/;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
index 19a798d2ae2f..d076a7c425dd 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
@@ -1,44 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (c) 2016 Endless Computers, Inc. 3 * Copyright (c) 2016 Endless Computers, Inc.
3 * Author: Carlo Caione <carlo@endlessm.com> 4 * Author: Carlo Caione <carlo@endlessm.com>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 * a) This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 * b) Permission is hereby granted, free of charge, to any person
23 * obtaining a copy of this software and associated documentation
24 * files (the "Software"), to deal in the Software without
25 * restriction, including without limitation the rights to use,
26 * copy, modify, merge, publish, distribute, sublicense, and/or
27 * sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following
29 * conditions:
30 *
31 * The above copyright notice and this permission notice shall be
32 * included in all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 * OTHER DEALINGS IN THE SOFTWARE.
42 */ 5 */
43 6
44#include "meson-gxl.dtsi" 7#include "meson-gxl.dtsi"
diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
index f165f04db0c9..eb749c50a736 100644
--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
@@ -68,10 +68,29 @@
68 interrupt-controller; 68 interrupt-controller;
69 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>; 69 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>;
70 ranges = <0 0 0 0x2c1c0000 0 0x40000>; 70 ranges = <0 0 0 0x2c1c0000 0 0x40000>;
71
71 v2m_0: v2m@0 { 72 v2m_0: v2m@0 {
72 compatible = "arm,gic-v2m-frame"; 73 compatible = "arm,gic-v2m-frame";
73 msi-controller; 74 msi-controller;
74 reg = <0 0 0 0x1000>; 75 reg = <0 0 0 0x10000>;
76 };
77
78 v2m@10000 {
79 compatible = "arm,gic-v2m-frame";
80 msi-controller;
81 reg = <0 0x10000 0 0x10000>;
82 };
83
84 v2m@20000 {
85 compatible = "arm,gic-v2m-frame";
86 msi-controller;
87 reg = <0 0x20000 0 0x10000>;
88 };
89
90 v2m@30000 {
91 compatible = "arm,gic-v2m-frame";
92 msi-controller;
93 reg = <0 0x30000 0 0x10000>;
75 }; 94 };
76 }; 95 };
77 96
diff --git a/arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi b/arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi
index 4220fbdcb24a..ff5c4c47b22b 100644
--- a/arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi
+++ b/arch/arm64/boot/dts/cavium/thunder2-99xx.dtsi
@@ -98,7 +98,7 @@
98 clock-output-names = "clk125mhz"; 98 clock-output-names = "clk125mhz";
99 }; 99 };
100 100
101 pci { 101 pcie@30000000 {
102 compatible = "pci-host-ecam-generic"; 102 compatible = "pci-host-ecam-generic";
103 device_type = "pci"; 103 device_type = "pci";
104 #interrupt-cells = <1>; 104 #interrupt-cells = <1>;
@@ -118,6 +118,7 @@
118 ranges = 118 ranges =
119 <0x02000000 0 0x40000000 0 0x40000000 0 0x20000000 119 <0x02000000 0 0x40000000 0 0x40000000 0 0x20000000
120 0x43000000 0x40 0x00000000 0x40 0x00000000 0x20 0x00000000>; 120 0x43000000 0x40 0x00000000 0x40 0x00000000 0x20 0x00000000>;
121 bus-range = <0 0xff>;
121 interrupt-map-mask = <0 0 0 7>; 122 interrupt-map-mask = <0 0 0 7>;
122 interrupt-map = 123 interrupt-map =
123 /* addr pin ic icaddr icintr */ 124 /* addr pin ic icaddr icintr */
diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi b/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
index a77462da4a36..a1e3194b7483 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi
@@ -14,6 +14,7 @@
14#include <dt-bindings/gpio/gpio.h> 14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/input/input.h> 15#include <dt-bindings/input/input.h>
16#include <dt-bindings/interrupt-controller/irq.h> 16#include <dt-bindings/interrupt-controller/irq.h>
17#include <dt-bindings/sound/samsung-i2s.h>
17 18
18/ { 19/ {
19 aliases { 20 aliases {
@@ -112,8 +113,8 @@
112 113
113 sound { 114 sound {
114 compatible = "samsung,tm2-audio"; 115 compatible = "samsung,tm2-audio";
115 audio-codec = <&wm5110>; 116 audio-codec = <&wm5110>, <&hdmi>;
116 i2s-controller = <&i2s0>; 117 i2s-controller = <&i2s0 0>, <&i2s1 0>;
117 audio-amplifier = <&max98504>; 118 audio-amplifier = <&max98504>;
118 mic-bias-gpios = <&gpr3 2 GPIO_ACTIVE_HIGH>; 119 mic-bias-gpios = <&gpr3 2 GPIO_ACTIVE_HIGH>;
119 model = "wm5110"; 120 model = "wm5110";
@@ -217,8 +218,40 @@
217}; 218};
218 219
219&cmu_aud { 220&cmu_aud {
220 assigned-clocks = <&cmu_aud CLK_MOUT_AUD_PLL_USER>; 221 assigned-clocks = <&cmu_aud CLK_MOUT_AUD_PLL_USER>,
221 assigned-clock-parents = <&cmu_top CLK_FOUT_AUD_PLL>; 222 <&cmu_aud CLK_MOUT_SCLK_AUD_I2S>,
223 <&cmu_aud CLK_MOUT_SCLK_AUD_PCM>,
224 <&cmu_top CLK_MOUT_AUD_PLL>,
225 <&cmu_top CLK_MOUT_AUD_PLL_USER_T>,
226 <&cmu_top CLK_MOUT_SCLK_AUDIO0>,
227 <&cmu_top CLK_MOUT_SCLK_AUDIO1>,
228 <&cmu_top CLK_MOUT_SCLK_SPDIF>,
229
230 <&cmu_aud CLK_DIV_AUD_CA5>,
231 <&cmu_aud CLK_DIV_ACLK_AUD>,
232 <&cmu_aud CLK_DIV_PCLK_DBG_AUD>,
233 <&cmu_aud CLK_DIV_SCLK_AUD_I2S>,
234 <&cmu_aud CLK_DIV_SCLK_AUD_PCM>,
235 <&cmu_aud CLK_DIV_SCLK_AUD_SLIMBUS>,
236 <&cmu_aud CLK_DIV_SCLK_AUD_UART>,
237 <&cmu_top CLK_DIV_SCLK_AUDIO0>,
238 <&cmu_top CLK_DIV_SCLK_AUDIO1>,
239 <&cmu_top CLK_DIV_SCLK_PCM1>,
240 <&cmu_top CLK_DIV_SCLK_I2S1>;
241
242 assigned-clock-parents = <&cmu_top CLK_FOUT_AUD_PLL>,
243 <&cmu_aud CLK_MOUT_AUD_PLL_USER>,
244 <&cmu_aud CLK_MOUT_AUD_PLL_USER>,
245 <&cmu_top CLK_FOUT_AUD_PLL>,
246 <&cmu_top CLK_MOUT_AUD_PLL>,
247 <&cmu_top CLK_MOUT_AUD_PLL_USER_T>,
248 <&cmu_top CLK_MOUT_AUD_PLL_USER_T>,
249 <&cmu_top CLK_SCLK_AUDIO0>;
250
251 assigned-clock-rates = <0>, <0>, <0>, <0>, <0>, <0>, <0>, <0>,
252 <196608001>, <65536001>, <32768001>, <49152001>,
253 <2048001>, <24576001>, <196608001>,
254 <24576001>, <98304001>, <2048001>, <49152001>;
222}; 255};
223 256
224&cmu_fsys { 257&cmu_fsys {
@@ -267,6 +300,11 @@
267 <&cmu_top CLK_MOUT_BUS_PLL_USER>; 300 <&cmu_top CLK_MOUT_BUS_PLL_USER>;
268}; 301};
269 302
303&cmu_top {
304 assigned-clocks = <&cmu_top CLK_FOUT_AUD_PLL>;
305 assigned-clock-rates = <196608001>;
306};
307
270&cpu0 { 308&cpu0 {
271 cpu-supply = <&buck3_reg>; 309 cpu-supply = <&buck3_reg>;
272}; 310};
@@ -779,9 +817,22 @@
779 clocks = <&pmu_system_controller 0>; 817 clocks = <&pmu_system_controller 0>;
780 clock-names = "xtal"; 818 clock-names = "xtal";
781 819
782 port { 820 ports {
783 mhl_to_hdmi: endpoint { 821 #address-cells = <1>;
784 remote-endpoint = <&hdmi_to_mhl>; 822 #size-cells = <0>;
823
824 port@0 {
825 reg = <0>;
826 mhl_to_hdmi: endpoint {
827 remote-endpoint = <&hdmi_to_mhl>;
828 };
829 };
830
831 port@1 {
832 reg = <1>;
833 mhl_to_musb_con: endpoint {
834 remote-endpoint = <&musb_con_to_mhl>;
835 };
785 }; 836 };
786 }; 837 };
787 }; 838 };
@@ -798,6 +849,25 @@
798 849
799 muic: max77843-muic { 850 muic: max77843-muic {
800 compatible = "maxim,max77843-muic"; 851 compatible = "maxim,max77843-muic";
852
853 musb_con: musb_connector {
854 compatible = "samsung,usb-connector-11pin",
855 "usb-b-connector";
856 label = "micro-USB";
857 type = "micro";
858
859 ports {
860 #address-cells = <1>;
861 #size-cells = <0>;
862
863 port@3 {
864 reg = <3>;
865 musb_con_to_mhl: endpoint {
866 remote-endpoint = <&mhl_to_musb_con>;
867 };
868 };
869 };
870 };
801 }; 871 };
802 872
803 regulators { 873 regulators {
@@ -838,6 +908,12 @@
838 status = "okay"; 908 status = "okay";
839}; 909};
840 910
911&i2s1 {
912 assigned-clocks = <&i2s1 CLK_I2S_RCLK_SRC>;
913 assigned-clock-parents = <&cmu_peric CLK_SCLK_I2S1>;
914 status = "okay";
915};
916
841&mshc_0 { 917&mshc_0 {
842 status = "okay"; 918 status = "okay";
843 mmc-hs200-1_8v; 919 mmc-hs200-1_8v;
diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 62f276970174..c0231d077fa6 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -969,6 +969,7 @@
969 ddc = <&hsi2c_11>; 969 ddc = <&hsi2c_11>;
970 samsung,syscon-phandle = <&pmu_system_controller>; 970 samsung,syscon-phandle = <&pmu_system_controller>;
971 samsung,sysreg-phandle = <&syscon_disp>; 971 samsung,sysreg-phandle = <&syscon_disp>;
972 #sound-dai-cells = <0>;
972 status = "disabled"; 973 status = "disabled";
973 }; 974 };
974 975
@@ -1311,6 +1312,25 @@
1311 status = "disabled"; 1312 status = "disabled";
1312 }; 1313 };
1313 1314
1315 i2s1: i2s@14d60000 {
1316 compatible = "samsung,exynos7-i2s";
1317 reg = <0x14d60000 0x100>;
1318 dmas = <&pdma0 31 &pdma0 30>;
1319 dma-names = "tx", "rx";
1320 interrupts = <GIC_SPI 435 IRQ_TYPE_NONE>;
1321 clocks = <&cmu_peric CLK_PCLK_I2S1>,
1322 <&cmu_peric CLK_PCLK_I2S1>,
1323 <&cmu_peric CLK_SCLK_I2S1>;
1324 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
1325 #clock-cells = <1>;
1326 samsung,supports-6ch;
1327 samsung,supports-rstclr;
1328 samsung,supports-tdm;
1329 samsung,supports-low-rfs;
1330 #sound-dai-cells = <1>;
1331 status = "disabled";
1332 };
1333
1314 pwm: pwm@14dd0000 { 1334 pwm: pwm@14dd0000 {
1315 compatible = "samsung,exynos4210-pwm"; 1335 compatible = "samsung,exynos4210-pwm";
1316 reg = <0x14dd0000 0x100>; 1336 reg = <0x14dd0000 0x100>;
@@ -1639,7 +1659,7 @@
1639 power-domains = <&pd_aud>; 1659 power-domains = <&pd_aud>;
1640 }; 1660 };
1641 1661
1642 i2s0: i2s0@11440000 { 1662 i2s0: i2s@11440000 {
1643 compatible = "samsung,exynos7-i2s"; 1663 compatible = "samsung,exynos7-i2s";
1644 reg = <0x11440000 0x100>; 1664 reg = <0x11440000 0x100>;
1645 dmas = <&adma 0 &adma 2>; 1665 dmas = <&adma 0 &adma 2>;
@@ -1651,9 +1671,11 @@
1651 <&cmu_aud CLK_SCLK_AUD_I2S>, 1671 <&cmu_aud CLK_SCLK_AUD_I2S>,
1652 <&cmu_aud CLK_SCLK_I2S_BCLK>; 1672 <&cmu_aud CLK_SCLK_I2S_BCLK>;
1653 clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; 1673 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
1674 #clock-cells = <1>;
1654 pinctrl-names = "default"; 1675 pinctrl-names = "default";
1655 pinctrl-0 = <&i2s0_bus>; 1676 pinctrl-0 = <&i2s0_bus>;
1656 power-domains = <&pd_aud>; 1677 power-domains = <&pd_aud>;
1678 #sound-dai-cells = <1>;
1657 status = "disabled"; 1679 status = "disabled";
1658 }; 1680 };
1659 1681
diff --git a/arch/arm64/boot/dts/exynos/exynos7-espresso.dts b/arch/arm64/boot/dts/exynos/exynos7-espresso.dts
index 22723527e626..00dd89b92b42 100644
--- a/arch/arm64/boot/dts/exynos/exynos7-espresso.dts
+++ b/arch/arm64/boot/dts/exynos/exynos7-espresso.dts
@@ -23,7 +23,7 @@
23 }; 23 };
24 24
25 chosen { 25 chosen {
26 linux,stdout-path = &serial_2; 26 stdout-path = &serial_2;
27 }; 27 };
28 28
29 memory@40000000 { 29 memory@40000000 {
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
index 82b272fb41b9..bb788eddf9f4 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
@@ -70,6 +70,24 @@
70 reg = <0x0>; 70 reg = <0x0>;
71 clocks = <&clockgen 1 0>; 71 clocks = <&clockgen 1 0>;
72 #cooling-cells = <2>; 72 #cooling-cells = <2>;
73 cpu-idle-states = <&CPU_PH20>;
74 };
75 };
76
77 idle-states {
78 /*
79 * PSCI node is not added default, U-boot will add missing
80 * parts if it determines to use PSCI.
81 */
82 entry-method = "arm,psci";
83
84 CPU_PH20: cpu-ph20 {
85 compatible = "arm,idle-state";
86 idle-state-name = "PH20";
87 arm,psci-suspend-param = <0x0>;
88 entry-latency-us = <1000>;
89 exit-latency-us = <1000>;
90 min-residency-us = <3000>;
73 }; 91 };
74 }; 92 };
75 93
@@ -118,6 +136,37 @@
118 mask = <0x02>; 136 mask = <0x02>;
119 }; 137 };
120 138
139 thermal-zones {
140 cpu_thermal: cpu-thermal {
141 polling-delay-passive = <1000>;
142 polling-delay = <5000>;
143 thermal-sensors = <&tmu 0>;
144
145 trips {
146 cpu_alert: cpu-alert {
147 temperature = <85000>;
148 hysteresis = <2000>;
149 type = "passive";
150 };
151
152 cpu_crit: cpu-crit {
153 temperature = <95000>;
154 hysteresis = <2000>;
155 type = "critical";
156 };
157 };
158
159 cooling-maps {
160 map0 {
161 trip = <&cpu_alert>;
162 cooling-device =
163 <&cpu0 THERMAL_NO_LIMIT
164 THERMAL_NO_LIMIT>;
165 };
166 };
167 };
168 };
169
121 soc { 170 soc {
122 compatible = "simple-bus"; 171 compatible = "simple-bus";
123 #address-cells = <2>; 172 #address-cells = <2>;
@@ -304,37 +353,6 @@
304 #thermal-sensor-cells = <1>; 353 #thermal-sensor-cells = <1>;
305 }; 354 };
306 355
307 thermal-zones {
308 cpu_thermal: cpu-thermal {
309 polling-delay-passive = <1000>;
310 polling-delay = <5000>;
311 thermal-sensors = <&tmu 0>;
312
313 trips {
314 cpu_alert: cpu-alert {
315 temperature = <85000>;
316 hysteresis = <2000>;
317 type = "passive";
318 };
319
320 cpu_crit: cpu-crit {
321 temperature = <95000>;
322 hysteresis = <2000>;
323 type = "critical";
324 };
325 };
326
327 cooling-maps {
328 map0 {
329 trip = <&cpu_alert>;
330 cooling-device =
331 <&cpu0 THERMAL_NO_LIMIT
332 THERMAL_NO_LIMIT>;
333 };
334 };
335 };
336 };
337
338 i2c0: i2c@2180000 { 356 i2c0: i2c@2180000 {
339 compatible = "fsl,vf610-i2c"; 357 compatible = "fsl,vf610-i2c";
340 #address-cells = <1>; 358 #address-cells = <1>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index 380e7c713395..1109f22bda5e 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -81,6 +81,7 @@
81 clocks = <&clockgen 1 0>; 81 clocks = <&clockgen 1 0>;
82 next-level-cache = <&l2>; 82 next-level-cache = <&l2>;
83 #cooling-cells = <2>; 83 #cooling-cells = <2>;
84 cpu-idle-states = <&CPU_PH20>;
84 }; 85 };
85 86
86 cpu1: cpu@1 { 87 cpu1: cpu@1 {
@@ -89,6 +90,7 @@
89 reg = <0x1>; 90 reg = <0x1>;
90 clocks = <&clockgen 1 0>; 91 clocks = <&clockgen 1 0>;
91 next-level-cache = <&l2>; 92 next-level-cache = <&l2>;
93 cpu-idle-states = <&CPU_PH20>;
92 }; 94 };
93 95
94 cpu2: cpu@2 { 96 cpu2: cpu@2 {
@@ -97,6 +99,7 @@
97 reg = <0x2>; 99 reg = <0x2>;
98 clocks = <&clockgen 1 0>; 100 clocks = <&clockgen 1 0>;
99 next-level-cache = <&l2>; 101 next-level-cache = <&l2>;
102 cpu-idle-states = <&CPU_PH20>;
100 }; 103 };
101 104
102 cpu3: cpu@3 { 105 cpu3: cpu@3 {
@@ -105,6 +108,7 @@
105 reg = <0x3>; 108 reg = <0x3>;
106 clocks = <&clockgen 1 0>; 109 clocks = <&clockgen 1 0>;
107 next-level-cache = <&l2>; 110 next-level-cache = <&l2>;
111 cpu-idle-states = <&CPU_PH20>;
108 }; 112 };
109 113
110 l2: l2-cache { 114 l2: l2-cache {
@@ -112,6 +116,23 @@
112 }; 116 };
113 }; 117 };
114 118
119 idle-states {
120 /*
121 * PSCI node is not added default, U-boot will add missing
122 * parts if it determines to use PSCI.
123 */
124 entry-method = "arm,psci";
125
126 CPU_PH20: cpu-ph20 {
127 compatible = "arm,idle-state";
128 idle-state-name = "PH20";
129 arm,psci-suspend-param = <0x0>;
130 entry-latency-us = <1000>;
131 exit-latency-us = <1000>;
132 min-residency-us = <3000>;
133 };
134 };
135
115 memory@80000000 { 136 memory@80000000 {
116 device_type = "memory"; 137 device_type = "memory";
117 reg = <0x0 0x80000000 0 0x80000000>; 138 reg = <0x0 0x80000000 0 0x80000000>;
@@ -159,6 +180,37 @@
159 mask = <0x02>; 180 mask = <0x02>;
160 }; 181 };
161 182
183 thermal-zones {
184 cpu_thermal: cpu-thermal {
185 polling-delay-passive = <1000>;
186 polling-delay = <5000>;
187
188 thermal-sensors = <&tmu 3>;
189
190 trips {
191 cpu_alert: cpu-alert {
192 temperature = <85000>;
193 hysteresis = <2000>;
194 type = "passive";
195 };
196 cpu_crit: cpu-crit {
197 temperature = <95000>;
198 hysteresis = <2000>;
199 type = "critical";
200 };
201 };
202
203 cooling-maps {
204 map0 {
205 trip = <&cpu_alert>;
206 cooling-device =
207 <&cpu0 THERMAL_NO_LIMIT
208 THERMAL_NO_LIMIT>;
209 };
210 };
211 };
212 };
213
162 timer { 214 timer {
163 compatible = "arm,armv8-timer"; 215 compatible = "arm,armv8-timer";
164 interrupts = <1 13 0xf08>, /* Physical Secure PPI */ 216 interrupts = <1 13 0xf08>, /* Physical Secure PPI */
@@ -342,37 +394,6 @@
342 #thermal-sensor-cells = <1>; 394 #thermal-sensor-cells = <1>;
343 }; 395 };
344 396
345 thermal-zones {
346 cpu_thermal: cpu-thermal {
347 polling-delay-passive = <1000>;
348 polling-delay = <5000>;
349
350 thermal-sensors = <&tmu 3>;
351
352 trips {
353 cpu_alert: cpu-alert {
354 temperature = <85000>;
355 hysteresis = <2000>;
356 type = "passive";
357 };
358 cpu_crit: cpu-crit {
359 temperature = <95000>;
360 hysteresis = <2000>;
361 type = "critical";
362 };
363 };
364
365 cooling-maps {
366 map0 {
367 trip = <&cpu_alert>;
368 cooling-device =
369 <&cpu0 THERMAL_NO_LIMIT
370 THERMAL_NO_LIMIT>;
371 };
372 };
373 };
374 };
375
376 qman: qman@1880000 { 397 qman: qman@1880000 {
377 compatible = "fsl,qman"; 398 compatible = "fsl,qman";
378 reg = <0x0 0x1880000 0x0 0x10000>; 399 reg = <0x0 0x1880000 0x0 0x10000>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index 06b5e12d04d8..136ebfa9b333 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -122,7 +122,7 @@
122 CPU_PH20: cpu-ph20 { 122 CPU_PH20: cpu-ph20 {
123 compatible = "arm,idle-state"; 123 compatible = "arm,idle-state";
124 idle-state-name = "PH20"; 124 idle-state-name = "PH20";
125 arm,psci-suspend-param = <0x00010000>; 125 arm,psci-suspend-param = <0x0>;
126 entry-latency-us = <1000>; 126 entry-latency-us = <1000>;
127 exit-latency-us = <1000>; 127 exit-latency-us = <1000>;
128 min-residency-us = <3000>; 128 min-residency-us = <3000>;
@@ -131,6 +131,8 @@
131 131
132 memory@80000000 { 132 memory@80000000 {
133 device_type = "memory"; 133 device_type = "memory";
134 /* Real size will be filled by bootloader */
135 reg = <0x0 0x80000000 0x0 0x0>;
134 }; 136 };
135 137
136 sysclk: sysclk { 138 sysclk: sysclk {
@@ -147,6 +149,37 @@
147 mask = <0x02>; 149 mask = <0x02>;
148 }; 150 };
149 151
152 thermal-zones {
153 cpu_thermal: cpu-thermal {
154 polling-delay-passive = <1000>;
155 polling-delay = <5000>;
156 thermal-sensors = <&tmu 3>;
157
158 trips {
159 cpu_alert: cpu-alert {
160 temperature = <85000>;
161 hysteresis = <2000>;
162 type = "passive";
163 };
164
165 cpu_crit: cpu-crit {
166 temperature = <95000>;
167 hysteresis = <2000>;
168 type = "critical";
169 };
170 };
171
172 cooling-maps {
173 map0 {
174 trip = <&cpu_alert>;
175 cooling-device =
176 <&cpu0 THERMAL_NO_LIMIT
177 THERMAL_NO_LIMIT>;
178 };
179 };
180 };
181 };
182
150 timer { 183 timer {
151 compatible = "arm,armv8-timer"; 184 compatible = "arm,armv8-timer";
152 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xf) | 185 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0xf) |
@@ -362,37 +395,6 @@
362 #thermal-sensor-cells = <1>; 395 #thermal-sensor-cells = <1>;
363 }; 396 };
364 397
365 thermal-zones {
366 cpu_thermal: cpu-thermal {
367 polling-delay-passive = <1000>;
368 polling-delay = <5000>;
369 thermal-sensors = <&tmu 3>;
370
371 trips {
372 cpu_alert: cpu-alert {
373 temperature = <85000>;
374 hysteresis = <2000>;
375 type = "passive";
376 };
377
378 cpu_crit: cpu-crit {
379 temperature = <95000>;
380 hysteresis = <2000>;
381 type = "critical";
382 };
383 };
384
385 cooling-maps {
386 map0 {
387 trip = <&cpu_alert>;
388 cooling-device =
389 <&cpu0 THERMAL_NO_LIMIT
390 THERMAL_NO_LIMIT>;
391 };
392 };
393 };
394 };
395
396 dspi: dspi@2100000 { 398 dspi: dspi@2100000 {
397 compatible = "fsl,ls1021a-v1.0-dspi"; 399 compatible = "fsl,ls1021a-v1.0-dspi";
398 #address-cells = <1>; 400 #address-cells = <1>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
index 4fc150cd4ca5..1c6556bcfddf 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
@@ -130,7 +130,7 @@
130 CPU_PH20: cpu-ph20 { 130 CPU_PH20: cpu-ph20 {
131 compatible = "arm,idle-state"; 131 compatible = "arm,idle-state";
132 idle-state-name = "PH20"; 132 idle-state-name = "PH20";
133 arm,psci-suspend-param = <0x00010000>; 133 arm,psci-suspend-param = <0x0>;
134 entry-latency-us = <1000>; 134 entry-latency-us = <1000>;
135 exit-latency-us = <1000>; 135 exit-latency-us = <1000>;
136 min-residency-us = <3000>; 136 min-residency-us = <3000>;
@@ -158,6 +158,44 @@
158 }; 158 };
159 }; 159 };
160 160
161 thermal-zones {
162 cpu_thermal: cpu-thermal {
163 polling-delay-passive = <1000>;
164 polling-delay = <5000>;
165 thermal-sensors = <&tmu 0>;
166
167 trips {
168 cpu_alert: cpu-alert {
169 temperature = <85000>;
170 hysteresis = <2000>;
171 type = "passive";
172 };
173
174 cpu_crit: cpu-crit {
175 temperature = <95000>;
176 hysteresis = <2000>;
177 type = "critical";
178 };
179 };
180
181 cooling-maps {
182 map0 {
183 trip = <&cpu_alert>;
184 cooling-device =
185 <&cpu0 THERMAL_NO_LIMIT
186 THERMAL_NO_LIMIT>;
187 };
188
189 map1 {
190 trip = <&cpu_alert>;
191 cooling-device =
192 <&cpu4 THERMAL_NO_LIMIT
193 THERMAL_NO_LIMIT>;
194 };
195 };
196 };
197 };
198
161 timer { 199 timer {
162 compatible = "arm,armv8-timer"; 200 compatible = "arm,armv8-timer";
163 interrupts = <1 13 IRQ_TYPE_LEVEL_LOW>,/* Physical Secure PPI */ 201 interrupts = <1 13 IRQ_TYPE_LEVEL_LOW>,/* Physical Secure PPI */
@@ -315,44 +353,6 @@
315 #thermal-sensor-cells = <1>; 353 #thermal-sensor-cells = <1>;
316 }; 354 };
317 355
318 thermal-zones {
319 cpu_thermal: cpu-thermal {
320 polling-delay-passive = <1000>;
321 polling-delay = <5000>;
322 thermal-sensors = <&tmu 0>;
323
324 trips {
325 cpu_alert: cpu-alert {
326 temperature = <85000>;
327 hysteresis = <2000>;
328 type = "passive";
329 };
330
331 cpu_crit: cpu-crit {
332 temperature = <95000>;
333 hysteresis = <2000>;
334 type = "critical";
335 };
336 };
337
338 cooling-maps {
339 map0 {
340 trip = <&cpu_alert>;
341 cooling-device =
342 <&cpu0 THERMAL_NO_LIMIT
343 THERMAL_NO_LIMIT>;
344 };
345
346 map1 {
347 trip = <&cpu_alert>;
348 cooling-device =
349 <&cpu4 THERMAL_NO_LIMIT
350 THERMAL_NO_LIMIT>;
351 };
352 };
353 };
354 };
355
356 duart0: serial@21c0500 { 356 duart0: serial@21c0500 {
357 compatible = "fsl,ns16550", "ns16550a"; 357 compatible = "fsl,ns16550", "ns16550a";
358 reg = <0x0 0x21c0500 0x0 0x100>; 358 reg = <0x0 0x21c0500 0x0 0x100>;
@@ -612,6 +612,62 @@
612 <0000 0 0 3 &gic 0 0 0 121 IRQ_TYPE_LEVEL_HIGH>, 612 <0000 0 0 3 &gic 0 0 0 121 IRQ_TYPE_LEVEL_HIGH>,
613 <0000 0 0 4 &gic 0 0 0 122 IRQ_TYPE_LEVEL_HIGH>; 613 <0000 0 0 4 &gic 0 0 0 122 IRQ_TYPE_LEVEL_HIGH>;
614 }; 614 };
615
616 cluster1_core0_watchdog: wdt@c000000 {
617 compatible = "arm,sp805-wdt", "arm,primecell";
618 reg = <0x0 0xc000000 0x0 0x1000>;
619 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
620 clock-names = "apb_pclk", "wdog_clk";
621 };
622
623 cluster1_core1_watchdog: wdt@c010000 {
624 compatible = "arm,sp805-wdt", "arm,primecell";
625 reg = <0x0 0xc010000 0x0 0x1000>;
626 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
627 clock-names = "apb_pclk", "wdog_clk";
628 };
629
630 cluster1_core2_watchdog: wdt@c020000 {
631 compatible = "arm,sp805-wdt", "arm,primecell";
632 reg = <0x0 0xc020000 0x0 0x1000>;
633 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
634 clock-names = "apb_pclk", "wdog_clk";
635 };
636
637 cluster1_core3_watchdog: wdt@c030000 {
638 compatible = "arm,sp805-wdt", "arm,primecell";
639 reg = <0x0 0xc030000 0x0 0x1000>;
640 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
641 clock-names = "apb_pclk", "wdog_clk";
642 };
643
644 cluster2_core0_watchdog: wdt@c100000 {
645 compatible = "arm,sp805-wdt", "arm,primecell";
646 reg = <0x0 0xc100000 0x0 0x1000>;
647 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
648 clock-names = "apb_pclk", "wdog_clk";
649 };
650
651 cluster2_core1_watchdog: wdt@c110000 {
652 compatible = "arm,sp805-wdt", "arm,primecell";
653 reg = <0x0 0xc110000 0x0 0x1000>;
654 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
655 clock-names = "apb_pclk", "wdog_clk";
656 };
657
658 cluster2_core2_watchdog: wdt@c120000 {
659 compatible = "arm,sp805-wdt", "arm,primecell";
660 reg = <0x0 0xc120000 0x0 0x1000>;
661 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
662 clock-names = "apb_pclk", "wdog_clk";
663 };
664
665 cluster2_core3_watchdog: wdt@c130000 {
666 compatible = "arm,sp805-wdt", "arm,primecell";
667 reg = <0x0 0xc130000 0x0 0x1000>;
668 clocks = <&clockgen 4 3>, <&clockgen 4 3>;
669 clock-names = "apb_pclk", "wdog_clk";
670 };
615 }; 671 };
616 672
617 firmware { 673 firmware {
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
index aeaef01d375f..0884e1a77901 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
@@ -143,7 +143,7 @@
143 CPU_PW20: cpu-pw20 { 143 CPU_PW20: cpu-pw20 {
144 compatible = "arm,idle-state"; 144 compatible = "arm,idle-state";
145 idle-state-name = "PW20"; 145 idle-state-name = "PW20";
146 arm,psci-suspend-param = <0x00010000>; 146 arm,psci-suspend-param = <0x0>;
147 entry-latency-us = <2000>; 147 entry-latency-us = <2000>;
148 exit-latency-us = <2000>; 148 exit-latency-us = <2000>;
149 min-residency-us = <6000>; 149 min-residency-us = <6000>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
index b2374469a830..1de618801c73 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
@@ -140,21 +140,21 @@
140 140
141&dspi { 141&dspi {
142 status = "okay"; 142 status = "okay";
143 dflash0: n25q128a { 143 dflash0: n25q128a@0 {
144 #address-cells = <1>; 144 #address-cells = <1>;
145 #size-cells = <1>; 145 #size-cells = <1>;
146 compatible = "st,m25p80"; 146 compatible = "st,m25p80";
147 spi-max-frequency = <3000000>; 147 spi-max-frequency = <3000000>;
148 reg = <0>; 148 reg = <0>;
149 }; 149 };
150 dflash1: sst25wf040b { 150 dflash1: sst25wf040b@1 {
151 #address-cells = <1>; 151 #address-cells = <1>;
152 #size-cells = <1>; 152 #size-cells = <1>;
153 compatible = "st,m25p80"; 153 compatible = "st,m25p80";
154 spi-max-frequency = <3000000>; 154 spi-max-frequency = <3000000>;
155 reg = <1>; 155 reg = <1>;
156 }; 156 };
157 dflash2: en25s64 { 157 dflash2: en25s64@2 {
158 #address-cells = <1>; 158 #address-cells = <1>;
159 #size-cells = <1>; 159 #size-cells = <1>;
160 compatible = "st,m25p80"; 160 compatible = "st,m25p80";
@@ -177,7 +177,7 @@
177 #size-cells = <1>; 177 #size-cells = <1>;
178 compatible = "st,m25p80"; 178 compatible = "st,m25p80";
179 spi-max-frequency = <20000000>; 179 spi-max-frequency = <20000000>;
180 reg = <0>; 180 reg = <2>;
181 }; 181 };
182}; 182};
183 183
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
index f3a40af33af8..137ef4dfc3e9 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
@@ -111,6 +111,55 @@
111 mask = <0x2>; 111 mask = <0x2>;
112 }; 112 };
113 113
114 thermal-zones {
115 cpu_thermal: cpu-thermal {
116 polling-delay-passive = <1000>;
117 polling-delay = <5000>;
118
119 thermal-sensors = <&tmu 4>;
120
121 trips {
122 cpu_alert: cpu-alert {
123 temperature = <75000>;
124 hysteresis = <2000>;
125 type = "passive";
126 };
127 cpu_crit: cpu-crit {
128 temperature = <85000>;
129 hysteresis = <2000>;
130 type = "critical";
131 };
132 };
133
134 cooling-maps {
135 map0 {
136 trip = <&cpu_alert>;
137 cooling-device =
138 <&cpu0 THERMAL_NO_LIMIT
139 THERMAL_NO_LIMIT>;
140 };
141 map1 {
142 trip = <&cpu_alert>;
143 cooling-device =
144 <&cpu2 THERMAL_NO_LIMIT
145 THERMAL_NO_LIMIT>;
146 };
147 map2 {
148 trip = <&cpu_alert>;
149 cooling-device =
150 <&cpu4 THERMAL_NO_LIMIT
151 THERMAL_NO_LIMIT>;
152 };
153 map3 {
154 trip = <&cpu_alert>;
155 cooling-device =
156 <&cpu6 THERMAL_NO_LIMIT
157 THERMAL_NO_LIMIT>;
158 };
159 };
160 };
161 };
162
114 timer { 163 timer {
115 compatible = "arm,armv8-timer"; 164 compatible = "arm,armv8-timer";
116 interrupts = <1 13 4>, /* Physical Secure PPI, active-low */ 165 interrupts = <1 13 4>, /* Physical Secure PPI, active-low */
@@ -194,55 +243,6 @@
194 #thermal-sensor-cells = <1>; 243 #thermal-sensor-cells = <1>;
195 }; 244 };
196 245
197 thermal-zones {
198 cpu_thermal: cpu-thermal {
199 polling-delay-passive = <1000>;
200 polling-delay = <5000>;
201
202 thermal-sensors = <&tmu 4>;
203
204 trips {
205 cpu_alert: cpu-alert {
206 temperature = <75000>;
207 hysteresis = <2000>;
208 type = "passive";
209 };
210 cpu_crit: cpu-crit {
211 temperature = <85000>;
212 hysteresis = <2000>;
213 type = "critical";
214 };
215 };
216
217 cooling-maps {
218 map0 {
219 trip = <&cpu_alert>;
220 cooling-device =
221 <&cpu0 THERMAL_NO_LIMIT
222 THERMAL_NO_LIMIT>;
223 };
224 map1 {
225 trip = <&cpu_alert>;
226 cooling-device =
227 <&cpu2 THERMAL_NO_LIMIT
228 THERMAL_NO_LIMIT>;
229 };
230 map2 {
231 trip = <&cpu_alert>;
232 cooling-device =
233 <&cpu4 THERMAL_NO_LIMIT
234 THERMAL_NO_LIMIT>;
235 };
236 map3 {
237 trip = <&cpu_alert>;
238 cooling-device =
239 <&cpu6 THERMAL_NO_LIMIT
240 THERMAL_NO_LIMIT>;
241 };
242 };
243 };
244 };
245
246 serial0: serial@21c0500 { 246 serial0: serial@21c0500 {
247 compatible = "fsl,ns16550", "ns16550a"; 247 compatible = "fsl,ns16550", "ns16550a";
248 reg = <0x0 0x21c0500 0x0 0x100>; 248 reg = <0x0 0x21c0500 0x0 0x100>;
diff --git a/arch/arm64/boot/dts/freescale/qoriq-bman-portals.dtsi b/arch/arm64/boot/dts/freescale/qoriq-bman-portals.dtsi
index c3c2be4f5072..ae15307f6e8b 100644
--- a/arch/arm64/boot/dts/freescale/qoriq-bman-portals.dtsi
+++ b/arch/arm64/boot/dts/freescale/qoriq-bman-portals.dtsi
@@ -68,4 +68,10 @@
68 reg = <0x80000 0x4000>, <0x4080000 0x4000>; 68 reg = <0x80000 0x4000>, <0x4080000 0x4000>;
69 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 69 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
70 }; 70 };
71
72 bman-portal@90000 {
73 compatible = "fsl,bman-portal";
74 reg = <0x90000 0x4000>, <0x4090000 0x4000>;
75 interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>;
76 };
71}; 77};
diff --git a/arch/arm64/boot/dts/freescale/qoriq-qman-portals.dtsi b/arch/arm64/boot/dts/freescale/qoriq-qman-portals.dtsi
index 2a9aa060efda..6a93a4a9be0e 100644
--- a/arch/arm64/boot/dts/freescale/qoriq-qman-portals.dtsi
+++ b/arch/arm64/boot/dts/freescale/qoriq-qman-portals.dtsi
@@ -77,4 +77,11 @@
77 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; 77 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
78 cell-index = <8>; 78 cell-index = <8>;
79 }; 79 };
80
81 qportal9: qman-portal@90000 {
82 compatible = "fsl,qman-portal";
83 reg = <0x90000 0x4000>, <0x4090000 0x4000>;
84 interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
85 cell-index = <9>;
86 };
80}; 87};
diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index 63d4f9dca77f..4ce4c282e19e 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -100,11 +100,7 @@
100 reg = <0x0 0x100>; 100 reg = <0x0 0x100>;
101 enable-method = "psci"; 101 enable-method = "psci";
102 next-level-cache = <&A73_L2>; 102 next-level-cache = <&A73_L2>;
103 cpu-idle-states = < 103 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
104 &CPU_NAP
105 &CPU_SLEEP
106 &CLUSTER_SLEEP_1
107 >;
108 capacity-dmips-mhz = <1024>; 104 capacity-dmips-mhz = <1024>;
109 }; 105 };
110 106
@@ -114,11 +110,7 @@
114 reg = <0x0 0x101>; 110 reg = <0x0 0x101>;
115 enable-method = "psci"; 111 enable-method = "psci";
116 next-level-cache = <&A73_L2>; 112 next-level-cache = <&A73_L2>;
117 cpu-idle-states = < 113 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
118 &CPU_NAP
119 &CPU_SLEEP
120 &CLUSTER_SLEEP_1
121 >;
122 capacity-dmips-mhz = <1024>; 114 capacity-dmips-mhz = <1024>;
123 }; 115 };
124 116
@@ -128,11 +120,7 @@
128 reg = <0x0 0x102>; 120 reg = <0x0 0x102>;
129 enable-method = "psci"; 121 enable-method = "psci";
130 next-level-cache = <&A73_L2>; 122 next-level-cache = <&A73_L2>;
131 cpu-idle-states = < 123 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
132 &CPU_NAP
133 &CPU_SLEEP
134 &CLUSTER_SLEEP_1
135 >;
136 capacity-dmips-mhz = <1024>; 124 capacity-dmips-mhz = <1024>;
137 }; 125 };
138 126
@@ -142,25 +130,13 @@
142 reg = <0x0 0x103>; 130 reg = <0x0 0x103>;
143 enable-method = "psci"; 131 enable-method = "psci";
144 next-level-cache = <&A73_L2>; 132 next-level-cache = <&A73_L2>;
145 cpu-idle-states = < 133 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>;
146 &CPU_NAP
147 &CPU_SLEEP
148 &CLUSTER_SLEEP_1
149 >;
150 capacity-dmips-mhz = <1024>; 134 capacity-dmips-mhz = <1024>;
151 }; 135 };
152 136
153 idle-states { 137 idle-states {
154 entry-method = "psci"; 138 entry-method = "psci";
155 139
156 CPU_NAP: cpu-nap {
157 compatible = "arm,idle-state";
158 arm,psci-suspend-param = <0x0000001>;
159 entry-latency-us = <7>;
160 exit-latency-us = <2>;
161 min-residency-us = <15>;
162 };
163
164 CPU_SLEEP: cpu-sleep { 140 CPU_SLEEP: cpu-sleep {
165 compatible = "arm,idle-state"; 141 compatible = "arm,idle-state";
166 local-timer-stop; 142 local-timer-stop;
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
index e94fa1a53192..724a0d3b7683 100644
--- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
+++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
@@ -51,7 +51,7 @@
51 #size-cells = <2>; 51 #size-cells = <2>;
52 ranges; 52 ranges;
53 53
54 ramoops@0x21f00000 { 54 ramoops@21f00000 {
55 compatible = "ramoops"; 55 compatible = "ramoops";
56 reg = <0x0 0x21f00000 0x0 0x00100000>; 56 reg = <0x0 0x21f00000 0x0 0x00100000>;
57 record-size = <0x00020000>; 57 record-size = <0x00020000>;
@@ -299,7 +299,9 @@
299 /* GPIO blocks 16 thru 19 do not appear to be routed to pins */ 299 /* GPIO blocks 16 thru 19 do not appear to be routed to pins */
300 300
301 dwmmc_0: dwmmc0@f723d000 { 301 dwmmc_0: dwmmc0@f723d000 {
302 max-frequency = <150000000>;
302 cap-mmc-highspeed; 303 cap-mmc-highspeed;
304 mmc-hs200-1_8v;
303 non-removable; 305 non-removable;
304 bus-width = <0x8>; 306 bus-width = <0x8>;
305 vmmc-supply = <&ldo19>; 307 vmmc-supply = <&ldo19>;
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
index 6a180d1926e8..586b281cd531 100644
--- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
@@ -88,8 +88,6 @@
88 next-level-cache = <&CLUSTER0_L2>; 88 next-level-cache = <&CLUSTER0_L2>;
89 clocks = <&stub_clock 0>; 89 clocks = <&stub_clock 0>;
90 operating-points-v2 = <&cpu_opp_table>; 90 operating-points-v2 = <&cpu_opp_table>;
91 cooling-min-level = <4>;
92 cooling-max-level = <0>;
93 #cooling-cells = <2>; /* min followed by max */ 91 #cooling-cells = <2>; /* min followed by max */
94 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>; 92 cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
95 dynamic-power-coefficient = <311>; 93 dynamic-power-coefficient = <311>;
@@ -817,6 +815,14 @@
817 pinctrl-1 = <&sdio_pmx_idle &sdio_clk_cfg_idle &sdio_cfg_idle>; 815 pinctrl-1 = <&sdio_pmx_idle &sdio_clk_cfg_idle &sdio_cfg_idle>;
818 }; 816 };
819 817
818 watchdog0: watchdog@f8005000 {
819 compatible = "arm,sp805-wdt", "arm,primecell";
820 reg = <0x0 0xf8005000 0x0 0x1000>;
821 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
822 clocks = <&ao_ctrl HI6220_WDT0_PCLK>;
823 clock-names = "apb_pclk";
824 };
825
820 tsensor: tsensor@0,f7030700 { 826 tsensor: tsensor@0,f7030700 {
821 compatible = "hisilicon,tsensor"; 827 compatible = "hisilicon,tsensor";
822 reg = <0x0 0xf7030700 0x0 0x1000>; 828 reg = <0x0 0xf7030700 0x0 0x1000>;
diff --git a/arch/arm64/boot/dts/hisilicon/hip06.dtsi b/arch/arm64/boot/dts/hisilicon/hip06.dtsi
index a049b64f2101..35202ebe62a7 100644
--- a/arch/arm64/boot/dts/hisilicon/hip06.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hip06.dtsi
@@ -291,6 +291,13 @@
291 #interrupt-cells = <2>; 291 #interrupt-cells = <2>;
292 num-pins = <128>; 292 num-pins = <128>;
293 }; 293 };
294
295 mbigen_pcie0: intc_pcie0 {
296 msi-parent = <&its_dsa 0x40085>;
297 interrupt-controller;
298 #interrupt-cells = <2>;
299 num-pins = <10>;
300 };
294 }; 301 };
295 302
296 mbigen_dsa@c0080000 { 303 mbigen_dsa@c0080000 {
@@ -312,6 +319,31 @@
312 }; 319 };
313 }; 320 };
314 321
322 /**
323 * HiSilicon erratum 161010801: This describes the limitation
324 * of HiSilicon platforms hip06/hip07 to support the SMMUv3
325 * mappings for PCIe MSI transactions.
326 * PCIe controller on these platforms has to differentiate the
327 * MSI payload against other DMA payload and has to modify the
328 * MSI payload. This makes it difficult for these platforms to
329 * have a SMMU translation for MSI. In order to workaround this,
330 * ARM SMMUv3 driver requires a quirk to treat the MSI regions
331 * separately. Such a quirk is currently missing for DT based
332 * systems. Hence please make sure that the smmu pcie node on
333 * hip06 is disabled as this will break the PCIe functionality
334 * when iommu-map entry is used along with the PCIe node.
335 * Refer:https://www.spinics.net/lists/arm-kernel/msg602812.html
336 */
337 smmu0: smmu_pcie {
338 compatible = "arm,smmu-v3";
339 reg = <0x0 0xa0040000 0x0 0x20000>;
340 #iommu-cells = <1>;
341 dma-coherent;
342 smmu-cb-memtype = <0x0 0x1>;
343 hisilicon,broken-prefetch-cmd;
344 status = "disabled";
345 };
346
315 soc { 347 soc {
316 compatible = "simple-bus"; 348 compatible = "simple-bus";
317 #address-cells = <2>; 349 #address-cells = <2>;
@@ -676,6 +708,30 @@
676 <637 1>,<638 1>,<639 1>; 708 <637 1>,<638 1>,<639 1>;
677 status = "disabled"; 709 status = "disabled";
678 }; 710 };
711
712 pcie0: pcie@a0090000 {
713 compatible = "hisilicon,hip06-pcie-ecam";
714 reg = <0 0xb0000000 0 0x2000000>,
715 <0 0xa0090000 0 0x10000>;
716 bus-range = <0 31>;
717 msi-map = <0x0000 &its_dsa 0x0000 0x2000>;
718 msi-map-mask = <0xffff>;
719 #address-cells = <3>;
720 #size-cells = <2>;
721 device_type = "pci";
722 dma-coherent;
723 ranges = <0x02000000 0 0xb2000000 0x0 0xb2000000 0
724 0x5ff0000 0x01000000 0 0 0 0xb7ff0000
725 0 0x10000>;
726 #interrupt-cells = <1>;
727 interrupt-map-mask = <0xf800 0 0 7>;
728 interrupt-map = <0x0 0 0 1 &mbigen_pcie0 650 4
729 0x0 0 0 2 &mbigen_pcie0 650 4
730 0x0 0 0 3 &mbigen_pcie0 650 4
731 0x0 0 0 4 &mbigen_pcie0 650 4>;
732 status = "disabled";
733 };
734
679 }; 735 };
680 736
681}; 737};
diff --git a/arch/arm64/boot/dts/hisilicon/hip07.dtsi b/arch/arm64/boot/dts/hisilicon/hip07.dtsi
index 2c01a21c3665..0600a6a84ab7 100644
--- a/arch/arm64/boot/dts/hisilicon/hip07.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hip07.dtsi
@@ -1083,6 +1083,31 @@
1083 }; 1083 };
1084 }; 1084 };
1085 1085
1086 /**
1087 * HiSilicon erratum 161010801: This describes the limitation
1088 * of HiSilicon platforms hip06/hip07 to support the SMMUv3
1089 * mappings for PCIe MSI transactions.
1090 * PCIe controller on these platforms has to differentiate the
1091 * MSI payload against other DMA payload and has to modify the
1092 * MSI payload. This makes it difficult for these platforms to
1093 * have a SMMU translation for MSI. In order to workaround this,
1094 * ARM SMMUv3 driver requires a quirk to treat the MSI regions
1095 * separately. Such a quirk is currently missing for DT based
1096 * systems. Hence please make sure that the smmu pcie node on
1097 * hip07 is disabled as this will break the PCIe functionality
1098 * when iommu-map entry is used along with the PCIe node.
1099 * Refer:https://www.spinics.net/lists/arm-kernel/msg602812.html
1100 */
1101 smmu0: smmu_pcie {
1102 compatible = "arm,smmu-v3";
1103 reg = <0x0 0xa0040000 0x0 0x20000>;
1104 #iommu-cells = <1>;
1105 dma-coherent;
1106 smmu-cb-memtype = <0x0 0x1>;
1107 hisilicon,broken-prefetch-cmd;
1108 status = "disabled";
1109 };
1110
1086 soc { 1111 soc {
1087 compatible = "simple-bus"; 1112 compatible = "simple-bus";
1088 #address-cells = <2>; 1113 #address-cells = <2>;
@@ -1127,6 +1152,12 @@
1127 reg = <0x0 0xc0000000 0x0 0x10000>; 1152 reg = <0x0 0xc0000000 0x0 0x10000>;
1128 }; 1153 };
1129 1154
1155 dsa_cpld: dsa_cpld@78000010 {
1156 compatible = "syscon";
1157 reg = <0x0 0x78000010 0x0 0x100>;
1158 reg-io-width = <2>;
1159 };
1160
1130 pcie_subctl: pcie_subctl@a0000000 { 1161 pcie_subctl: pcie_subctl@a0000000 {
1131 compatible = "hisilicon,pcie-sas-subctrl", "syscon"; 1162 compatible = "hisilicon,pcie-sas-subctrl", "syscon";
1132 reg = <0x0 0xa0000000 0x0 0x10000>; 1163 reg = <0x0 0xa0000000 0x0 0x10000>;
@@ -1258,6 +1289,7 @@
1258 port@0 { 1289 port@0 {
1259 reg = <0>; 1290 reg = <0>;
1260 serdes-syscon = <&serdes_ctrl>; 1291 serdes-syscon = <&serdes_ctrl>;
1292 cpld-syscon = <&dsa_cpld 0x0>;
1261 port-rst-offset = <0>; 1293 port-rst-offset = <0>;
1262 port-mode-offset = <0>; 1294 port-mode-offset = <0>;
1263 mc-mac-mask = [ff f0 00 00 00 00]; 1295 mc-mac-mask = [ff f0 00 00 00 00];
@@ -1267,6 +1299,7 @@
1267 port@1 { 1299 port@1 {
1268 reg = <1>; 1300 reg = <1>;
1269 serdes-syscon= <&serdes_ctrl>; 1301 serdes-syscon= <&serdes_ctrl>;
1302 cpld-syscon = <&dsa_cpld 0x4>;
1270 port-rst-offset = <1>; 1303 port-rst-offset = <1>;
1271 port-mode-offset = <1>; 1304 port-mode-offset = <1>;
1272 mc-mac-mask = [ff f0 00 00 00 00]; 1305 mc-mac-mask = [ff f0 00 00 00 00];
diff --git a/arch/arm64/boot/dts/marvell/armada-371x.dtsi b/arch/arm64/boot/dts/marvell/armada-371x.dtsi
index 11226f7b9ed9..dc1182ec9fa1 100644
--- a/arch/arm64/boot/dts/marvell/armada-371x.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-371x.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Device Tree Include file for Marvell Armada 371x family of SoCs 3 * Device Tree Include file for Marvell Armada 371x family of SoCs
3 * (also named 88F3710) 4 * (also named 88F3710)
@@ -6,43 +7,6 @@
6 * 7 *
7 * Gregory CLEMENT <gregory.clement@free-electrons.com> 8 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * 9 *
9 * This file is dual-licensed: you can use it either under the terms
10 * of the GPL or the X11 license, at your option. Note that this dual
11 * licensing only applies to this file, and not this project as a
12 * whole.
13 *
14 * a) This file is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * This file is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * Or, alternatively,
25 *
26 * b) Permission is hereby granted, free of charge, to any person
27 * obtaining a copy of this software and associated documentation
28 * files (the "Software"), to deal in the Software without
29 * restriction, including without limitation the rights to use,
30 * copy, modify, merge, publish, distribute, sublicense, and/or
31 * sell copies of the Software, and to permit persons to whom the
32 * Software is furnished to do so, subject to the following
33 * conditions:
34 *
35 * The above copyright notice and this permission notice shall be
36 * included in all copies or substantial portions of the Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45 * OTHER DEALINGS IN THE SOFTWARE.
46 */ 10 */
47 11
48#include "armada-37xx.dtsi" 12#include "armada-37xx.dtsi"
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-db.dts b/arch/arm64/boot/dts/marvell/armada-3720-db.dts
index 0f3468e777f7..f2cc00594d64 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Device Tree file for Marvell Armada 3720 development board 3 * Device Tree file for Marvell Armada 3720 development board
3 * (DB-88F3720-DDR3) 4 * (DB-88F3720-DDR3)
@@ -5,44 +6,6 @@
5 * 6 *
6 * Gregory CLEMENT <gregory.clement@free-electrons.com> 7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
7 * 8 *
8 * This file is dual-licensed: you can use it either under the terms
9 * of the GPL or the X11 license, at your option. Note that this dual
10 * licensing only applies to this file, and not this project as a
11 * whole.
12 *
13 * a) This file is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
17 *
18 * This file is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * Or, alternatively,
24 *
25 * b) Permission is hereby granted, free of charge, to any person
26 * obtaining a copy of this software and associated documentation
27 * files (the "Software"), to deal in the Software without
28 * restriction, including without limitation the rights to use,
29 * copy, modify, merge, publish, distribute, sublicense, and/or
30 * sell copies of the Software, and to permit persons to whom the
31 * Software is furnished to do so, subject to the following
32 * conditions:
33 *
34 * The above copyright notice and this permission notice shall be
35 * included in all copies or substantial portions of the Software.
36 *
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 * OTHER DEALINGS IN THE SOFTWARE.
45 *
46 * This file is compatible with the version 1.4 and the version 2.0 of 9 * This file is compatible with the version 1.4 and the version 2.0 of
47 * the board, however the CON numbers are different between the 2 10 * the board, however the CON numbers are different between the 2
48 * version 11 * version
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
index bdfb5553ddb5..ef7fd2ca2515 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
@@ -1,46 +1,13 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Device Tree file for Globalscale Marvell ESPRESSOBin Board 3 * Device Tree file for Globalscale Marvell ESPRESSOBin Board
3 * Copyright (C) 2016 Marvell 4 * Copyright (C) 2016 Marvell
4 * 5 *
5 * Romain Perier <romain.perier@free-electrons.com> 6 * Romain Perier <romain.perier@free-electrons.com>
6 * 7 *
7 * This file is dual-licensed: you can use it either under the terms 8 */
8 * of the GPL or the X11 license, at your option. Note that this dual 9/*
9 * licensing only applies to this file, and not this project as a 10 * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.pdf
10 * whole.
11 *
12 * a) This file is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
16 *
17 * This file is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 * b) Permission is hereby granted, free of charge, to any person
25 * obtaining a copy of this software and associated documentation
26 * files (the "Software"), to deal in the Software without
27 * restriction, including without limitation the rights to use,
28 * copy, modify, merge, publish, distribute, sublicense, and/or
29 * sell copies of the Software, and to permit persons to whom the
30 * Software is furnished to do so, subject to the following
31 * conditions:
32 *
33 * The above copyright notice and this permission notice shall be
34 * included in all copies or substantial portions of the Software.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 * OTHER DEALINGS IN THE SOFTWARE.
44 */ 11 */
45 12
46/dts-v1/; 13/dts-v1/;
diff --git a/arch/arm64/boot/dts/marvell/armada-372x.dtsi b/arch/arm64/boot/dts/marvell/armada-372x.dtsi
index 2554e0baea6b..97558a64e276 100644
--- a/arch/arm64/boot/dts/marvell/armada-372x.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-372x.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Device Tree Include file for Marvell Armada 372x family of SoCs 3 * Device Tree Include file for Marvell Armada 372x family of SoCs
3 * (also named 88F3720) 4 * (also named 88F3720)
@@ -6,43 +7,6 @@
6 * 7 *
7 * Gregory CLEMENT <gregory.clement@free-electrons.com> 8 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * 9 *
9 * This file is dual-licensed: you can use it either under the terms
10 * of the GPL or the X11 license, at your option. Note that this dual
11 * licensing only applies to this file, and not this project as a
12 * whole.
13 *
14 * a) This file is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * This file is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * Or, alternatively,
25 *
26 * b) Permission is hereby granted, free of charge, to any person
27 * obtaining a copy of this software and associated documentation
28 * files (the "Software"), to deal in the Software without
29 * restriction, including without limitation the rights to use,
30 * copy, modify, merge, publish, distribute, sublicense, and/or
31 * sell copies of the Software, and to permit persons to whom the
32 * Software is furnished to do so, subject to the following
33 * conditions:
34 *
35 * The above copyright notice and this permission notice shall be
36 * included in all copies or substantial portions of the Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45 * OTHER DEALINGS IN THE SOFTWARE.
46 */ 10 */
47 11
48#include "armada-37xx.dtsi" 12#include "armada-37xx.dtsi"
diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
index 375026867342..97207a61bc79 100644
--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Device Tree Include file for Marvell Armada 37xx family of SoCs. 3 * Device Tree Include file for Marvell Armada 37xx family of SoCs.
3 * 4 *
@@ -5,43 +6,6 @@
5 * 6 *
6 * Gregory CLEMENT <gregory.clement@free-electrons.com> 7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
7 * 8 *
8 * This file is dual-licensed: you can use it either under the terms
9 * of the GPL or the X11 license, at your option. Note that this dual
10 * licensing only applies to this file, and not this project as a
11 * whole.
12 *
13 * a) This file is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
17 *
18 * This file is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * Or, alternatively,
24 *
25 * b) Permission is hereby granted, free of charge, to any person
26 * obtaining a copy of this software and associated documentation
27 * files (the "Software"), to deal in the Software without
28 * restriction, including without limitation the rights to use,
29 * copy, modify, merge, publish, distribute, sublicense, and/or
30 * sell copies of the Software, and to permit persons to whom the
31 * Software is furnished to do so, subject to the following
32 * conditions:
33 *
34 * The above copyright notice and this permission notice shall be
35 * included in all copies or substantial portions of the Software.
36 *
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 * OTHER DEALINGS IN THE SOFTWARE.
45 */ 9 */
46 10
47#include <dt-bindings/interrupt-controller/arm-gic.h> 11#include <dt-bindings/interrupt-controller/arm-gic.h>
diff --git a/arch/arm64/boot/dts/marvell/armada-7020.dtsi b/arch/arm64/boot/dts/marvell/armada-7020.dtsi
index 4ab012991d9d..4e46326dd123 100644
--- a/arch/arm64/boot/dts/marvell/armada-7020.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-7020.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 7020 SoC, made of an AP806 Dual and 5 * Device Tree file for the Armada 7020 SoC, made of an AP806 Dual and
45 * one CP110. 6 * one CP110.
46 */ 7 */
diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
index 3ae05eee2c9a..d6bec058a30a 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada 7040 Development board platform 5 * Device Tree file for Marvell Armada 7040 Development board platform
45 */ 6 */
46 7
@@ -162,36 +123,48 @@
162 }; 123 };
163}; 124};
164 125
165&cp0_nand { 126&cp0_nand_controller {
166 /* 127 /*
167 * SPI on CPM and NAND have common pins on this board. We can 128 * SPI on CPM and NAND have common pins on this board. We can
168 * use only one at a time. To enable the NAND (whihch will 129 * use only one at a time. To enable the NAND (which will
169 * disable the SPI), the "status = "okay";" line have to be 130 * disable the SPI), the "status = "okay";" line have to be
170 * added here. 131 * added here.
171 */ 132 */
172 num-cs = <1>;
173 pinctrl-0 = <&nand_pins>, <&nand_rb>; 133 pinctrl-0 = <&nand_pins>, <&nand_rb>;
174 pinctrl-names = "default"; 134 pinctrl-names = "default";
175 nand-ecc-strength = <4>; 135
176 nand-ecc-step-size = <512>; 136 nand@0 {
177 marvell,nand-enable-arbiter; 137 reg = <0>;
178 nand-on-flash-bbt; 138 label = "pxa3xx_nand-0";
179 139 nand-rb = <0>;
180 partition@0 { 140 nand-on-flash-bbt;
181 label = "U-Boot"; 141 nand-ecc-strength = <4>;
182 reg = <0 0x200000>; 142 nand-ecc-step-size = <512>;
183 }; 143
184 partition@200000 { 144 partitions {
185 label = "Linux"; 145 compatible = "fixed-partitions";
186 reg = <0x200000 0xe00000>; 146 #address-cells = <1>;
187 }; 147 #size-cells = <1>;
188 partition@1000000 { 148
189 label = "Filesystem"; 149 partition@0 {
190 reg = <0x1000000 0x3f000000>; 150 label = "U-Boot";
151 reg = <0 0x200000>;
152 };
153
154 partition@200000 {
155 label = "Linux";
156 reg = <0x200000 0xe00000>;
157 };
158
159 partition@1000000 {
160 label = "Filesystem";
161 reg = <0x1000000 0x3f000000>;
162 };
163
164 };
191 }; 165 };
192}; 166};
193 167
194
195&cp0_spi1 { 168&cp0_spi1 {
196 status = "okay"; 169 status = "okay";
197 170
diff --git a/arch/arm64/boot/dts/marvell/armada-7040.dtsi b/arch/arm64/boot/dts/marvell/armada-7040.dtsi
index cbe460b8fc00..47247215770d 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-7040.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 7040 SoC, made of an AP806 Quad and 5 * Device Tree file for the Armada 7040 SoC, made of an AP806 Quad and
45 * one CP110. 6 * one CP110.
46 */ 7 */
diff --git a/arch/arm64/boot/dts/marvell/armada-70x0.dtsi b/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
index f63b4fbd642b..e5c6d7c25819 100644
--- a/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 70x0 SoC 5 * Device Tree file for the Armada 70x0 SoC
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-8020.dtsi b/arch/arm64/boot/dts/marvell/armada-8020.dtsi
index 3318d6b0214b..ba1307c0fadb 100644
--- a/arch/arm64/boot/dts/marvell/armada-8020.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-8020.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 8020 SoC, made of an AP806 Dual and 5 * Device Tree file for the Armada 8020 SoC, made of an AP806 Dual and
45 * two CP110. 6 * two CP110.
46 */ 7 */
diff --git a/arch/arm64/boot/dts/marvell/armada-8040-db.dts b/arch/arm64/boot/dts/marvell/armada-8040-db.dts
index dba55baff20f..5689fb23bbab 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-db.dts
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada 8040 Development board platform 5 * Device Tree file for Marvell Armada 8040 Development board platform
45 */ 6 */
46 7
@@ -279,27 +240,35 @@
279 * Proper NAND usage will require DPR-76 to be in position 1-2, which disables 240 * Proper NAND usage will require DPR-76 to be in position 1-2, which disables
280 * MDIO signal of CP1. 241 * MDIO signal of CP1.
281 */ 242 */
282&cp1_nand { 243&cp1_nand_controller {
283 num-cs = <1>;
284 pinctrl-0 = <&nand_pins>, <&nand_rb>; 244 pinctrl-0 = <&nand_pins>, <&nand_rb>;
285 pinctrl-names = "default"; 245 pinctrl-names = "default";
286 nand-ecc-strength = <4>; 246
287 nand-ecc-step-size = <512>; 247 nand@0 {
288 marvell,nand-enable-arbiter; 248 reg = <0>;
289 marvell,system-controller = <&cp1_syscon0>; 249 nand-rb = <0>;
290 nand-on-flash-bbt; 250 nand-on-flash-bbt;
291 251 nand-ecc-strength = <4>;
292 partition@0 { 252 nand-ecc-step-size = <512>;
293 label = "U-Boot"; 253
294 reg = <0 0x200000>; 254 partitions {
295 }; 255 compatible = "fixed-partitions";
296 partition@200000 { 256 #address-cells = <1>;
297 label = "Linux"; 257 #size-cells = <1>;
298 reg = <0x200000 0xe00000>; 258
299 }; 259 partition@0 {
300 partition@1000000 { 260 label = "U-Boot";
301 label = "Filesystem"; 261 reg = <0 0x200000>;
302 reg = <0x1000000 0x3f000000>; 262 };
263 partition@200000 {
264 label = "Linux";
265 reg = <0x200000 0xe00000>;
266 };
267 partition@1000000 {
268 label = "Filesystem";
269 reg = <0x1000000 0x3f000000>;
270 };
271 };
303 }; 272 };
304}; 273};
305 274
diff --git a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
index 626e9d0462c3..81de03ef860d 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for MACCHIATOBin Armada 8040 community board platform 5 * Device Tree file for MACCHIATOBin Armada 8040 community board platform
45 */ 6 */
46 7
@@ -49,7 +10,7 @@
49#include <dt-bindings/gpio/gpio.h> 10#include <dt-bindings/gpio/gpio.h>
50 11
51/ { 12/ {
52 model = "Marvell 8040 MACHIATOBin"; 13 model = "Marvell 8040 MACCHIATOBin";
53 compatible = "marvell,armada8040-mcbin", "marvell,armada8040", 14 compatible = "marvell,armada8040-mcbin", "marvell,armada8040",
54 "marvell,armada-ap806-quad", "marvell,armada-ap806"; 15 "marvell,armada-ap806-quad", "marvell,armada-ap806";
55 16
@@ -163,6 +124,13 @@
163 }; 124 };
164}; 125};
165 126
127/* J25 UART header */
128&cp0_uart1 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&cp0_uart1_pins>;
131 status = "okay";
132};
133
166&cp0_mdio { 134&cp0_mdio {
167 pinctrl-names = "default"; 135 pinctrl-names = "default";
168 pinctrl-0 = <&cp0_ge_mdio_pins>; 136 pinctrl-0 = <&cp0_ge_mdio_pins>;
@@ -195,6 +163,10 @@
195 marvell,pins = "mpp37", "mpp38"; 163 marvell,pins = "mpp37", "mpp38";
196 marvell,function = "i2c0"; 164 marvell,function = "i2c0";
197 }; 165 };
166 cp0_uart1_pins: uart1-pins {
167 marvell,pins = "mpp40", "mpp41";
168 marvell,function = "uart1";
169 };
198 cp0_xhci_vbus_pins: xhci0-vbus-pins { 170 cp0_xhci_vbus_pins: xhci0-vbus-pins {
199 marvell,pins = "mpp47"; 171 marvell,pins = "mpp47";
200 marvell,function = "gpio"; 172 marvell,function = "gpio";
@@ -290,6 +262,17 @@
290 marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15", "mpp16"; 262 marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15", "mpp16";
291 marvell,function = "spi1"; 263 marvell,function = "spi1";
292 }; 264 };
265 cp1_uart0_pins: uart0-pins {
266 marvell,pins = "mpp6", "mpp7";
267 marvell,function = "uart0";
268 };
269};
270
271/* J27 UART header */
272&cp1_uart0 {
273 pinctrl-names = "default";
274 pinctrl-0 = <&cp1_uart0_pins>;
275 status = "okay";
293}; 276};
294 277
295&cp1_sata0 { 278&cp1_sata0 {
diff --git a/arch/arm64/boot/dts/marvell/armada-8040.dtsi b/arch/arm64/boot/dts/marvell/armada-8040.dtsi
index 83d2b40e5981..7699b19224c2 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-8040.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 8040 SoC, made of an AP806 Quad and 5 * Device Tree file for the Armada 8040 SoC, made of an AP806 Quad and
45 * two CP110. 6 * two CP110.
46 */ 7 */
diff --git a/arch/arm64/boot/dts/marvell/armada-8080-db.dts b/arch/arm64/boot/dts/marvell/armada-8080-db.dts
index 85b58a19a9fb..4ba158f415ce 100644
--- a/arch/arm64/boot/dts/marvell/armada-8080-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8080-db.dts
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada-8080 Development board platform 5 * Device Tree file for Marvell Armada-8080 Development board platform
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-8080.dtsi b/arch/arm64/boot/dts/marvell/armada-8080.dtsi
index d5535b716735..299e814d1ded 100644
--- a/arch/arm64/boot/dts/marvell/armada-8080.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-8080.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada-8080 SoC, made of an AP810 OCTA. 5 * Device Tree file for Marvell Armada-8080 SoC, made of an AP810 OCTA.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-80x0.dtsi b/arch/arm64/boot/dts/marvell/armada-80x0.dtsi
index e9c84a1d3c4d..8129b40f12a4 100644
--- a/arch/arm64/boot/dts/marvell/armada-80x0.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-80x0.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for the Armada 80x0 SoC family 5 * Device Tree file for the Armada 80x0 SoC family
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
index b98ea137371d..64b5e61a698e 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada AP806. 5 * Device Tree file for Marvell Armada AP806.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi
index 116164ff260f..746e792767f5 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap806-quad.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada AP806. 5 * Device Tree file for Marvell Armada AP806.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
index f9b66b81f9fc..176e38d54872 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada AP806. 5 * Device Tree file for Marvell Armada AP806.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-ap810-ap0-octa-core.dtsi b/arch/arm64/boot/dts/marvell/armada-ap810-ap0-octa-core.dtsi
index 7f0661e12f5e..7d00ae78fc79 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap810-ap0-octa-core.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap810-ap0-octa-core.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada AP810 OCTA cores. 5 * Device Tree file for Marvell Armada AP810 OCTA cores.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-ap810-ap0.dtsi b/arch/arm64/boot/dts/marvell/armada-ap810-ap0.dtsi
index 7e6f039f0f80..8107d120a8a7 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap810-ap0.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap810-ap0.dtsi
@@ -1,46 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
1/* 2/*
2 * Copyright (C) 2017 Marvell Technology Group Ltd. 3 * Copyright (C) 2017 Marvell Technology Group Ltd.
3 * 4 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPLv2 or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/*
44 * Device Tree file for Marvell Armada AP810. 5 * Device Tree file for Marvell Armada AP810.
45 */ 6 */
46 7
diff --git a/arch/arm64/boot/dts/marvell/armada-common.dtsi b/arch/arm64/boot/dts/marvell/armada-common.dtsi
index c6dd1d81c68d..d5e8aedec188 100644
--- a/arch/arm64/boot/dts/marvell/armada-common.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-common.dtsi
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR X11) 1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/* 2/*
3 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
4 */ 4 */
diff --git a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
index a8af4136dbe7..48cad7919efa 100644
--- a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
@@ -1,9 +1,7 @@
1// SPDX-License-Identifier: (GPL-2.0+ OR X11) 1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/* 2/*
3 * Copyright (C) 2016 Marvell Technology Group Ltd. 3 * Copyright (C) 2016 Marvell Technology Group Ltd.
4 */ 4 *
5
6/*
7 * Device Tree file for Marvell Armada CP110. 5 * Device Tree file for Marvell Armada CP110.
8 */ 6 */
9 7
@@ -213,7 +211,9 @@
213 reg = <0x500000 0x4000>; 211 reg = <0x500000 0x4000>;
214 dma-coherent; 212 dma-coherent;
215 interrupts = <ICU_GRP_NSR 106 IRQ_TYPE_LEVEL_HIGH>; 213 interrupts = <ICU_GRP_NSR 106 IRQ_TYPE_LEVEL_HIGH>;
216 clocks = <&CP110_LABEL(clk) 1 22>; 214 clock-names = "core", "reg";
215 clocks = <&CP110_LABEL(clk) 1 22>,
216 <&CP110_LABEL(clk) 1 16>;
217 status = "disabled"; 217 status = "disabled";
218 }; 218 };
219 219
@@ -223,7 +223,9 @@
223 reg = <0x510000 0x4000>; 223 reg = <0x510000 0x4000>;
224 dma-coherent; 224 dma-coherent;
225 interrupts = <ICU_GRP_NSR 105 IRQ_TYPE_LEVEL_HIGH>; 225 interrupts = <ICU_GRP_NSR 105 IRQ_TYPE_LEVEL_HIGH>;
226 clocks = <&CP110_LABEL(clk) 1 23>; 226 clock-names = "core", "reg";
227 clocks = <&CP110_LABEL(clk) 1 23>,
228 <&CP110_LABEL(clk) 1 16>;
227 status = "disabled"; 229 status = "disabled";
228 }; 230 };
229 231
@@ -232,7 +234,8 @@
232 "generic-ahci"; 234 "generic-ahci";
233 reg = <0x540000 0x30000>; 235 reg = <0x540000 0x30000>;
234 interrupts = <ICU_GRP_NSR 107 IRQ_TYPE_LEVEL_HIGH>; 236 interrupts = <ICU_GRP_NSR 107 IRQ_TYPE_LEVEL_HIGH>;
235 clocks = <&CP110_LABEL(clk) 1 15>; 237 clocks = <&CP110_LABEL(clk) 1 15>,
238 <&CP110_LABEL(clk) 1 16>;
236 status = "disabled"; 239 status = "disabled";
237 }; 240 };
238 241
@@ -241,7 +244,9 @@
241 reg = <0x6a0000 0x1000>, <0x6b0000 0x1000>; 244 reg = <0x6a0000 0x1000>, <0x6b0000 0x1000>;
242 dma-coherent; 245 dma-coherent;
243 msi-parent = <&gic_v2m0>; 246 msi-parent = <&gic_v2m0>;
244 clocks = <&CP110_LABEL(clk) 1 8>; 247 clock-names = "core", "reg";
248 clocks = <&CP110_LABEL(clk) 1 8>,
249 <&CP110_LABEL(clk) 1 14>;
245 }; 250 };
246 251
247 CP110_LABEL(xor1): xor@6c0000 { 252 CP110_LABEL(xor1): xor@6c0000 {
@@ -249,7 +254,9 @@
249 reg = <0x6c0000 0x1000>, <0x6d0000 0x1000>; 254 reg = <0x6c0000 0x1000>, <0x6d0000 0x1000>;
250 dma-coherent; 255 dma-coherent;
251 msi-parent = <&gic_v2m0>; 256 msi-parent = <&gic_v2m0>;
252 clocks = <&CP110_LABEL(clk) 1 7>; 257 clock-names = "core", "reg";
258 clocks = <&CP110_LABEL(clk) 1 7>,
259 <&CP110_LABEL(clk) 1 14>;
253 }; 260 };
254 261
255 CP110_LABEL(spi0): spi@700600 { 262 CP110_LABEL(spi0): spi@700600 {
@@ -257,7 +264,9 @@
257 reg = <0x700600 0x50>; 264 reg = <0x700600 0x50>;
258 #address-cells = <0x1>; 265 #address-cells = <0x1>;
259 #size-cells = <0x0>; 266 #size-cells = <0x0>;
260 clocks = <&CP110_LABEL(clk) 1 21>; 267 clock-names = "core", "axi";
268 clocks = <&CP110_LABEL(clk) 1 21>,
269 <&CP110_LABEL(clk) 1 17>;
261 status = "disabled"; 270 status = "disabled";
262 }; 271 };
263 272
@@ -266,7 +275,9 @@
266 reg = <0x700680 0x50>; 275 reg = <0x700680 0x50>;
267 #address-cells = <1>; 276 #address-cells = <1>;
268 #size-cells = <0>; 277 #size-cells = <0>;
269 clocks = <&CP110_LABEL(clk) 1 21>; 278 clock-names = "core", "axi";
279 clocks = <&CP110_LABEL(clk) 1 21>,
280 <&CP110_LABEL(clk) 1 17>;
270 status = "disabled"; 281 status = "disabled";
271 }; 282 };
272 283
@@ -276,7 +287,9 @@
276 #address-cells = <1>; 287 #address-cells = <1>;
277 #size-cells = <0>; 288 #size-cells = <0>;
278 interrupts = <ICU_GRP_NSR 120 IRQ_TYPE_LEVEL_HIGH>; 289 interrupts = <ICU_GRP_NSR 120 IRQ_TYPE_LEVEL_HIGH>;
279 clocks = <&CP110_LABEL(clk) 1 21>; 290 clock-names = "core", "reg";
291 clocks = <&CP110_LABEL(clk) 1 21>,
292 <&CP110_LABEL(clk) 1 17>;
280 status = "disabled"; 293 status = "disabled";
281 }; 294 };
282 295
@@ -286,23 +299,75 @@
286 #address-cells = <1>; 299 #address-cells = <1>;
287 #size-cells = <0>; 300 #size-cells = <0>;
288 interrupts = <ICU_GRP_NSR 121 IRQ_TYPE_LEVEL_HIGH>; 301 interrupts = <ICU_GRP_NSR 121 IRQ_TYPE_LEVEL_HIGH>;
289 clocks = <&CP110_LABEL(clk) 1 21>; 302 clock-names = "core", "reg";
303 clocks = <&CP110_LABEL(clk) 1 21>,
304 <&CP110_LABEL(clk) 1 17>;
305 status = "disabled";
306 };
307
308 CP110_LABEL(uart0): serial@702000 {
309 compatible = "snps,dw-apb-uart";
310 reg = <0x702000 0x100>;
311 reg-shift = <2>;
312 interrupts = <ICU_GRP_NSR 122 IRQ_TYPE_LEVEL_HIGH>;
313 reg-io-width = <1>;
314 clock-names = "baudclk", "apb_pclk";
315 clocks = <&CP110_LABEL(clk) 1 21>,
316 <&CP110_LABEL(clk) 1 17>;
317 status = "disabled";
318 };
319
320 CP110_LABEL(uart1): serial@702100 {
321 compatible = "snps,dw-apb-uart";
322 reg = <0x702100 0x100>;
323 reg-shift = <2>;
324 interrupts = <ICU_GRP_NSR 123 IRQ_TYPE_LEVEL_HIGH>;
325 reg-io-width = <1>;
326 clock-names = "baudclk", "apb_pclk";
327 clocks = <&CP110_LABEL(clk) 1 21>,
328 <&CP110_LABEL(clk) 1 17>;
329 status = "disabled";
330 };
331
332 CP110_LABEL(uart2): serial@702200 {
333 compatible = "snps,dw-apb-uart";
334 reg = <0x702200 0x100>;
335 reg-shift = <2>;
336 interrupts = <ICU_GRP_NSR 124 IRQ_TYPE_LEVEL_HIGH>;
337 reg-io-width = <1>;
338 clock-names = "baudclk", "apb_pclk";
339 clocks = <&CP110_LABEL(clk) 1 21>,
340 <&CP110_LABEL(clk) 1 17>;
290 status = "disabled"; 341 status = "disabled";
291 }; 342 };
292 343
293 CP110_LABEL(nand): nand@720000 { 344 CP110_LABEL(uart3): serial@702300 {
345 compatible = "snps,dw-apb-uart";
346 reg = <0x702300 0x100>;
347 reg-shift = <2>;
348 interrupts = <ICU_GRP_NSR 125 IRQ_TYPE_LEVEL_HIGH>;
349 reg-io-width = <1>;
350 clock-names = "baudclk", "apb_pclk";
351 clocks = <&CP110_LABEL(clk) 1 21>,
352 <&CP110_LABEL(clk) 1 17>;
353 status = "disabled";
354 };
355
356 CP110_LABEL(nand_controller): nand@720000 {
294 /* 357 /*
295 * Due to the limitation of the pins available 358 * Due to the limitation of the pins available
296 * this controller is only usable on the CPM 359 * this controller is only usable on the CPM
297 * for A7K and on the CPS for A8K. 360 * for A7K and on the CPS for A8K.
298 */ 361 */
299 compatible = "marvell,armada-8k-nand", 362 compatible = "marvell,armada-8k-nand-controller",
300 "marvell,armada370-nand"; 363 "marvell,armada370-nand-controller";
301 reg = <0x720000 0x54>; 364 reg = <0x720000 0x54>;
302 #address-cells = <1>; 365 #address-cells = <1>;
303 #size-cells = <1>; 366 #size-cells = <0>;
304 interrupts = <ICU_GRP_NSR 115 IRQ_TYPE_LEVEL_HIGH>; 367 interrupts = <ICU_GRP_NSR 115 IRQ_TYPE_LEVEL_HIGH>;
305 clocks = <&CP110_LABEL(clk) 1 2>; 368 clock-names = "core", "reg";
369 clocks = <&CP110_LABEL(clk) 1 2>,
370 <&CP110_LABEL(clk) 1 17>;
306 marvell,system-controller = <&CP110_LABEL(syscon0)>; 371 marvell,system-controller = <&CP110_LABEL(syscon0)>;
307 status = "disabled"; 372 status = "disabled";
308 }; 373 };
@@ -312,7 +377,9 @@
312 "inside-secure,safexcel-eip76"; 377 "inside-secure,safexcel-eip76";
313 reg = <0x760000 0x7d>; 378 reg = <0x760000 0x7d>;
314 interrupts = <ICU_GRP_NSR 95 IRQ_TYPE_LEVEL_HIGH>; 379 interrupts = <ICU_GRP_NSR 95 IRQ_TYPE_LEVEL_HIGH>;
315 clocks = <&CP110_LABEL(clk) 1 25>; 380 clock-names = "core", "reg";
381 clocks = <&CP110_LABEL(clk) 1 25>,
382 <&CP110_LABEL(clk) 1 17>;
316 status = "okay"; 383 status = "okay";
317 }; 384 };
318 385
@@ -337,7 +404,9 @@
337 <ICU_GRP_NSR 92 IRQ_TYPE_LEVEL_HIGH>; 404 <ICU_GRP_NSR 92 IRQ_TYPE_LEVEL_HIGH>;
338 interrupt-names = "mem", "ring0", "ring1", 405 interrupt-names = "mem", "ring0", "ring1",
339 "ring2", "ring3", "eip"; 406 "ring2", "ring3", "eip";
340 clocks = <&CP110_LABEL(clk) 1 26>; 407 clock-names = "core", "reg";
408 clocks = <&CP110_LABEL(clk) 1 26>,
409 <&CP110_LABEL(clk) 1 17>;
341 dma-coherent; 410 dma-coherent;
342 }; 411 };
343 }; 412 };
@@ -364,7 +433,8 @@
364 interrupt-map = <0 0 0 0 &CP110_LABEL(icu) ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; 433 interrupt-map = <0 0 0 0 &CP110_LABEL(icu) ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
365 interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; 434 interrupts = <ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>;
366 num-lanes = <1>; 435 num-lanes = <1>;
367 clocks = <&CP110_LABEL(clk) 1 13>; 436 clock-names = "core", "reg";
437 clocks = <&CP110_LABEL(clk) 1 13>, <&CP110_LABEL(clk) 1 14>;
368 status = "disabled"; 438 status = "disabled";
369 }; 439 };
370 440
@@ -391,7 +461,8 @@
391 interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>; 461 interrupts = <ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>;
392 462
393 num-lanes = <1>; 463 num-lanes = <1>;
394 clocks = <&CP110_LABEL(clk) 1 11>; 464 clock-names = "core", "reg";
465 clocks = <&CP110_LABEL(clk) 1 11>, <&CP110_LABEL(clk) 1 14>;
395 status = "disabled"; 466 status = "disabled";
396 }; 467 };
397 468
@@ -418,7 +489,8 @@
418 interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>; 489 interrupts = <ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>;
419 490
420 num-lanes = <1>; 491 num-lanes = <1>;
421 clocks = <&CP110_LABEL(clk) 1 12>; 492 clock-names = "core", "reg";
493 clocks = <&CP110_LABEL(clk) 1 12>, <&CP110_LABEL(clk) 1 14>;
422 status = "disabled"; 494 status = "disabled";
423 }; 495 };
424}; 496};
diff --git a/arch/arm64/boot/dts/mediatek/mt2712-evb.dts b/arch/arm64/boot/dts/mediatek/mt2712-evb.dts
index 10f9c76cd105..4ce9d6ca0bf7 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712-evb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt2712-evb.dts
@@ -41,6 +41,10 @@
41 41
42}; 42};
43 43
44&auxadc {
45 status = "okay";
46};
47
44&cpu0 { 48&cpu0 {
45 proc-supply = <&cpus_fixed_vproc0>; 49 proc-supply = <&cpus_fixed_vproc0>;
46}; 50};
diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
index fdf66f4fe7c3..9d88f41aefa0 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
@@ -289,6 +289,15 @@
289 (GIC_CPU_MASK_RAW(0x13) | IRQ_TYPE_LEVEL_HIGH)>; 289 (GIC_CPU_MASK_RAW(0x13) | IRQ_TYPE_LEVEL_HIGH)>;
290 }; 290 };
291 291
292 auxadc: adc@11001000 {
293 compatible = "mediatek,mt2712-auxadc";
294 reg = <0 0x11001000 0 0x1000>;
295 clocks = <&pericfg CLK_PERI_AUXADC>;
296 clock-names = "main";
297 #io-channel-cells = <1>;
298 status = "disabled";
299 };
300
292 uart0: serial@11002000 { 301 uart0: serial@11002000 {
293 compatible = "mediatek,mt2712-uart", 302 compatible = "mediatek,mt2712-uart",
294 "mediatek,mt6577-uart"; 303 "mediatek,mt6577-uart";
diff --git a/arch/arm64/boot/dts/mediatek/mt6380.dtsi b/arch/arm64/boot/dts/mediatek/mt6380.dtsi
new file mode 100644
index 000000000000..53b335d2de5f
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt6380.dtsi
@@ -0,0 +1,86 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * dts file for MediaTek MT6380 regulator
4 *
5 * Copyright (c) 2018 MediaTek Inc.
6 * Author: Chenglin Xu <chenglin.xu@mediatek.com>
7 * Sean Wang <sean.wang@mediatek.com>
8 */
9
10&pwrap {
11 regulators {
12 compatible = "mediatek,mt6380-regulator";
13
14 mt6380_vcpu_reg: buck-vcore1 {
15 regulator-name = "vcore1";
16 regulator-min-microvolt = < 600000>;
17 regulator-max-microvolt = <1393750>;
18 regulator-ramp-delay = <6250>;
19 regulator-always-on;
20 regulator-boot-on;
21 };
22
23 mt6380_vcore_reg: buck-vcore {
24 regulator-name = "vcore";
25 regulator-min-microvolt = <600000>;
26 regulator-max-microvolt = <1393750>;
27 regulator-ramp-delay = <6250>;
28 regulator-always-on;
29 regulator-boot-on;
30 };
31
32 mt6380_vrf_reg: buck-vrf {
33 regulator-name = "vrf";
34 regulator-min-microvolt = <1200000>;
35 regulator-max-microvolt = <1575000>;
36 regulator-ramp-delay = <0>;
37 regulator-always-on;
38 regulator-boot-on;
39 };
40
41 mt6380_vm_reg: ldo-vm {
42 regulator-name = "vm";
43 regulator-min-microvolt = <1050000>;
44 regulator-max-microvolt = <1400000>;
45 regulator-ramp-delay = <0>;
46 regulator-always-on;
47 regulator-boot-on;
48 };
49
50 mt6380_va_reg: ldo-va {
51 regulator-name = "va";
52 regulator-min-microvolt = <2200000>;
53 regulator-max-microvolt = <3300000>;
54 regulator-ramp-delay = <0>;
55 regulator-always-on;
56 regulator-boot-on;
57 };
58
59 mt6380_vphy_reg: ldo-vphy {
60 regulator-name = "vphy";
61 regulator-min-microvolt = <1800000>;
62 regulator-max-microvolt = <1800000>;
63 regulator-ramp-delay = <0>;
64 regulator-always-on;
65 regulator-boot-on;
66 };
67
68 mt6380_vddr_reg: ldo-vddr {
69 regulator-name = "vddr";
70 regulator-min-microvolt = <1240000>;
71 regulator-max-microvolt = <1840000>;
72 regulator-ramp-delay = <0>;
73 regulator-always-on;
74 regulator-boot-on;
75 };
76
77 mt6380_vt_reg: ldo-vt {
78 regulator-name = "vt";
79 regulator-min-microvolt = <2200000>;
80 regulator-max-microvolt = <3300000>;
81 regulator-ramp-delay = <0>;
82 regulator-always-on;
83 regulator-boot-on;
84 };
85 };
86};
diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
index c08309df2cc7..45d8655ee423 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
@@ -7,7 +7,11 @@
7 */ 7 */
8 8
9/dts-v1/; 9/dts-v1/;
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/gpio/gpio.h>
12
10#include "mt7622.dtsi" 13#include "mt7622.dtsi"
14#include "mt6380.dtsi"
11 15
12/ { 16/ {
13 model = "MediaTek MT7622 RFB1 board"; 17 model = "MediaTek MT7622 RFB1 board";
@@ -17,11 +21,476 @@
17 bootargs = "console=ttyS0,115200n1"; 21 bootargs = "console=ttyS0,115200n1";
18 }; 22 };
19 23
24 cpus {
25 cpu@0 {
26 proc-supply = <&mt6380_vcpu_reg>;
27 sram-supply = <&mt6380_vm_reg>;
28 };
29
30 cpu@1 {
31 proc-supply = <&mt6380_vcpu_reg>;
32 sram-supply = <&mt6380_vm_reg>;
33 };
34 };
35
36 gpio-keys {
37 compatible = "gpio-keys-polled";
38 poll-interval = <100>;
39
40 factory {
41 label = "factory";
42 linux,code = <BTN_0>;
43 gpios = <&pio 0 0>;
44 };
45
46 wps {
47 label = "wps";
48 linux,code = <KEY_WPS_BUTTON>;
49 gpios = <&pio 102 0>;
50 };
51 };
52
20 memory { 53 memory {
21 reg = <0 0x40000000 0 0x3F000000>; 54 reg = <0 0x40000000 0 0x3F000000>;
22 }; 55 };
56
57 reg_1p8v: regulator-1p8v {
58 compatible = "regulator-fixed";
59 regulator-name = "fixed-1.8V";
60 regulator-min-microvolt = <1800000>;
61 regulator-max-microvolt = <1800000>;
62 regulator-always-on;
63 };
64
65 reg_3p3v: regulator-3p3v {
66 compatible = "regulator-fixed";
67 regulator-name = "fixed-3.3V";
68 regulator-min-microvolt = <3300000>;
69 regulator-max-microvolt = <3300000>;
70 regulator-boot-on;
71 regulator-always-on;
72 };
73
74 reg_5v: regulator-5v {
75 compatible = "regulator-fixed";
76 regulator-name = "fixed-5V";
77 regulator-min-microvolt = <5000000>;
78 regulator-max-microvolt = <5000000>;
79 regulator-boot-on;
80 regulator-always-on;
81 };
82};
83
84&pcie {
85 pinctrl-names = "default";
86 pinctrl-0 = <&pcie0_pins>;
87 status = "okay";
88
89 pcie@0,0 {
90 status = "okay";
91 };
92};
93
94&pio {
95 /* eMMC is shared pin with parallel NAND */
96 emmc_pins_default: emmc-pins-default {
97 mux {
98 function = "emmc", "emmc_rst";
99 groups = "emmc";
100 };
101
102 /* "NDL0","NDL1","NDL2","NDL3","NDL4","NDL5","NDL6","NDL7",
103 * "NRB","NCLE" pins are used as DAT0,DAT1,DAT2,DAT3,DAT4,
104 * DAT5,DAT6,DAT7,CMD,CLK for eMMC respectively
105 */
106 conf-cmd-dat {
107 pins = "NDL0", "NDL1", "NDL2",
108 "NDL3", "NDL4", "NDL5",
109 "NDL6", "NDL7", "NRB";
110 input-enable;
111 bias-pull-up;
112 };
113
114 conf-clk {
115 pins = "NCLE";
116 bias-pull-down;
117 };
118 };
119
120 emmc_pins_uhs: emmc-pins-uhs {
121 mux {
122 function = "emmc";
123 groups = "emmc";
124 };
125
126 conf-cmd-dat {
127 pins = "NDL0", "NDL1", "NDL2",
128 "NDL3", "NDL4", "NDL5",
129 "NDL6", "NDL7", "NRB";
130 input-enable;
131 drive-strength = <4>;
132 bias-pull-up;
133 };
134
135 conf-clk {
136 pins = "NCLE";
137 drive-strength = <4>;
138 bias-pull-down;
139 };
140 };
141
142 eth_pins: eth-pins {
143 mux {
144 function = "eth";
145 groups = "mdc_mdio", "rgmii_via_gmac2";
146 };
147 };
148
149 i2c1_pins: i2c1-pins {
150 mux {
151 function = "i2c";
152 groups = "i2c1_0";
153 };
154 };
155
156 i2c2_pins: i2c2-pins {
157 mux {
158 function = "i2c";
159 groups = "i2c2_0";
160 };
161 };
162
163 i2s1_pins: i2s1-pins {
164 mux {
165 function = "i2s";
166 groups = "i2s_out_bclk_ws_mclk",
167 "i2s1_in_data",
168 "i2s1_out_data";
169 };
170 };
171
172 irrx_pins: irrx-pins {
173 mux {
174 function = "ir";
175 groups = "ir_1_rx";
176 };
177 };
178
179 irtx_pins: irtx-pins {
180 mux {
181 function = "ir";
182 groups = "ir_1_tx";
183 };
184 };
185
186 /* Parallel nand is shared pin with eMMC */
187 parallel_nand_pins: parallel-nand-pins {
188 mux {
189 function = "flash";
190 groups = "par_nand";
191 };
192 };
193
194 pcie0_pins: pcie0-pins {
195 mux {
196 function = "pcie";
197 groups = "pcie0_pad_perst",
198 "pcie0_1_waken",
199 "pcie0_1_clkreq";
200 };
201 };
202
203 pcie1_pins: pcie1-pins {
204 mux {
205 function = "pcie";
206 groups = "pcie1_pad_perst",
207 "pcie1_0_waken",
208 "pcie1_0_clkreq";
209 };
210 };
211
212 pmic_bus_pins: pmic-bus-pins {
213 mux {
214 function = "pmic";
215 groups = "pmic_bus";
216 };
217 };
218
219 pwm7_pins: pwm1-2-pins {
220 mux {
221 function = "pwm";
222 groups = "pwm_ch7_2";
223 };
224 };
225
226 wled_pins: wled-pins {
227 mux {
228 function = "led";
229 groups = "wled";
230 };
231 };
232
233 sd0_pins_default: sd0-pins-default {
234 mux {
235 function = "sd";
236 groups = "sd_0";
237 };
238
239 /* "I2S2_OUT, "I2S4_IN"", "I2S3_IN", "I2S2_IN",
240 * "I2S4_OUT", "I2S3_OUT" are used as DAT0, DAT1,
241 * DAT2, DAT3, CMD, CLK for SD respectively.
242 */
243 conf-cmd-data {
244 pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
245 "I2S2_IN","I2S4_OUT";
246 input-enable;
247 drive-strength = <8>;
248 bias-pull-up;
249 };
250 conf-clk {
251 pins = "I2S3_OUT";
252 drive-strength = <12>;
253 bias-pull-down;
254 };
255 conf-cd {
256 pins = "TXD3";
257 bias-pull-up;
258 };
259 };
260
261 sd0_pins_uhs: sd0-pins-uhs {
262 mux {
263 function = "sd";
264 groups = "sd_0";
265 };
266
267 conf-cmd-data {
268 pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
269 "I2S2_IN","I2S4_OUT";
270 input-enable;
271 bias-pull-up;
272 };
273
274 conf-clk {
275 pins = "I2S3_OUT";
276 bias-pull-down;
277 };
278 };
279
280 /* Serial NAND is shared pin with SPI-NOR */
281 serial_nand_pins: serial-nand-pins {
282 mux {
283 function = "flash";
284 groups = "snfi";
285 };
286 };
287
288 spic0_pins: spic0-pins {
289 mux {
290 function = "spi";
291 groups = "spic0_0";
292 };
293 };
294
295 spic1_pins: spic1-pins {
296 mux {
297 function = "spi";
298 groups = "spic1_0";
299 };
300 };
301
302 /* SPI-NOR is shared pin with serial NAND */
303 spi_nor_pins: spi-nor-pins {
304 mux {
305 function = "flash";
306 groups = "spi_nor";
307 };
308 };
309
310 /* serial NAND is shared pin with SPI-NOR */
311 serial_nand_pins: serial-nand-pins {
312 mux {
313 function = "flash";
314 groups = "snfi";
315 };
316 };
317
318 uart0_pins: uart0-pins {
319 mux {
320 function = "uart";
321 groups = "uart0_0_tx_rx" ;
322 };
323 };
324
325 uart2_pins: uart2-pins {
326 mux {
327 function = "uart";
328 groups = "uart2_1_tx_rx" ;
329 };
330 };
331
332 watchdog_pins: watchdog-pins {
333 mux {
334 function = "watchdog";
335 groups = "watchdog";
336 };
337 };
338};
339
340&bch {
341 status = "disabled";
342};
343
344&btif {
345 status = "okay";
346};
347
348&cir {
349 pinctrl-names = "default";
350 pinctrl-0 = <&irrx_pins>;
351 status = "okay";
352};
353
354&eth {
355 pinctrl-names = "default";
356 pinctrl-0 = <&eth_pins>;
357 status = "okay";
358
359 gmac1: mac@1 {
360 compatible = "mediatek,eth-mac";
361 reg = <1>;
362 phy-handle = <&phy5>;
363 };
364
365 mdio-bus {
366 #address-cells = <1>;
367 #size-cells = <0>;
368
369 phy5: ethernet-phy@5 {
370 reg = <5>;
371 phy-mode = "sgmii";
372 };
373 };
374};
375
376&i2c1 {
377 pinctrl-names = "default";
378 pinctrl-0 = <&i2c1_pins>;
379 status = "okay";
380};
381
382&i2c2 {
383 pinctrl-names = "default";
384 pinctrl-0 = <&i2c2_pins>;
385 status = "okay";
386};
387
388&mmc0 {
389 pinctrl-names = "default", "state_uhs";
390 pinctrl-0 = <&emmc_pins_default>;
391 pinctrl-1 = <&emmc_pins_uhs>;
392 status = "okay";
393 bus-width = <8>;
394 max-frequency = <50000000>;
395 cap-mmc-highspeed;
396 mmc-hs200-1_8v;
397 vmmc-supply = <&reg_3p3v>;
398 vqmmc-supply = <&reg_1p8v>;
399 assigned-clocks = <&topckgen CLK_TOP_MSDC30_0_SEL>;
400 assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>;
401 non-removable;
402};
403
404&mmc1 {
405 pinctrl-names = "default", "state_uhs";
406 pinctrl-0 = <&sd0_pins_default>;
407 pinctrl-1 = <&sd0_pins_uhs>;
408 status = "okay";
409 bus-width = <4>;
410 max-frequency = <50000000>;
411 cap-sd-highspeed;
412 r_smpl = <1>;
413 cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>;
414 vmmc-supply = <&reg_3p3v>;
415 vqmmc-supply = <&reg_3p3v>;
416 assigned-clocks = <&topckgen CLK_TOP_MSDC30_1_SEL>;
417 assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>;
418};
419
420&nandc {
421 pinctrl-names = "default";
422 pinctrl-0 = <&parallel_nand_pins>;
423 status = "disabled";
424};
425
426&nor_flash {
427 pinctrl-names = "default";
428 pinctrl-0 = <&spi_nor_pins>;
429 status = "disabled";
430
431 flash@0 {
432 compatible = "jedec,spi-nor";
433 reg = <0>;
434 };
435};
436
437&pwm {
438 pinctrl-names = "default";
439 pinctrl-0 = <&pwm7_pins>;
440 status = "okay";
441};
442
443&pwrap {
444 pinctrl-names = "default";
445 pinctrl-0 = <&pmic_bus_pins>;
446
447 status = "okay";
448};
449
450&sata {
451 status = "okay";
452};
453
454&sata_phy {
455 status = "okay";
456};
457
458&spi0 {
459 pinctrl-names = "default";
460 pinctrl-0 = <&spic0_pins>;
461 status = "okay";
462};
463
464&spi1 {
465 pinctrl-names = "default";
466 pinctrl-0 = <&spic1_pins>;
467 status = "okay";
468};
469
470&ssusb {
471 vusb33-supply = <&reg_3p3v>;
472 vbus-supply = <&reg_5v>;
473 status = "okay";
474};
475
476&u3phy {
477 status = "okay";
23}; 478};
24 479
25&uart0 { 480&uart0 {
481 pinctrl-names = "default";
482 pinctrl-0 = <&uart0_pins>;
483 status = "okay";
484};
485
486&uart2 {
487 pinctrl-names = "default";
488 pinctrl-0 = <&uart2_pins>;
489 status = "okay";
490};
491
492&watchdog {
493 pinctrl-names = "default";
494 pinctrl-0 = <&watchdog_pins>;
26 status = "okay"; 495 status = "okay";
27}; 496};
diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
index b111fec2ed9d..e9d5130df8d1 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -8,6 +8,11 @@
8 8
9#include <dt-bindings/interrupt-controller/irq.h> 9#include <dt-bindings/interrupt-controller/irq.h>
10#include <dt-bindings/interrupt-controller/arm-gic.h> 10#include <dt-bindings/interrupt-controller/arm-gic.h>
11#include <dt-bindings/clock/mt7622-clk.h>
12#include <dt-bindings/phy/phy.h>
13#include <dt-bindings/power/mt7622-power.h>
14#include <dt-bindings/reset/mt7622-reset.h>
15#include <dt-bindings/thermal/thermal.h>
11 16
12/ { 17/ {
13 compatible = "mediatek,mt7622"; 18 compatible = "mediatek,mt7622";
@@ -15,6 +20,50 @@
15 #address-cells = <2>; 20 #address-cells = <2>;
16 #size-cells = <2>; 21 #size-cells = <2>;
17 22
23 cpu_opp_table: opp-table {
24 compatible = "operating-points-v2";
25 opp-shared;
26 opp-300000000 {
27 opp-hz = /bits/ 64 <30000000>;
28 opp-microvolt = <950000>;
29 };
30
31 opp-437500000 {
32 opp-hz = /bits/ 64 <437500000>;
33 opp-microvolt = <1000000>;
34 };
35
36 opp-600000000 {
37 opp-hz = /bits/ 64 <600000000>;
38 opp-microvolt = <1050000>;
39 };
40
41 opp-812500000 {
42 opp-hz = /bits/ 64 <812500000>;
43 opp-microvolt = <1100000>;
44 };
45
46 opp-1025000000 {
47 opp-hz = /bits/ 64 <1025000000>;
48 opp-microvolt = <1150000>;
49 };
50
51 opp-1137500000 {
52 opp-hz = /bits/ 64 <1137500000>;
53 opp-microvolt = <1200000>;
54 };
55
56 opp-1262500000 {
57 opp-hz = /bits/ 64 <1262500000>;
58 opp-microvolt = <1250000>;
59 };
60
61 opp-1350000000 {
62 opp-hz = /bits/ 64 <1350000000>;
63 opp-microvolt = <1310000>;
64 };
65 };
66
18 cpus { 67 cpus {
19 #address-cells = <2>; 68 #address-cells = <2>;
20 #size-cells = <0>; 69 #size-cells = <0>;
@@ -23,6 +72,11 @@
23 device_type = "cpu"; 72 device_type = "cpu";
24 compatible = "arm,cortex-a53", "arm,armv8"; 73 compatible = "arm,cortex-a53", "arm,armv8";
25 reg = <0x0 0x0>; 74 reg = <0x0 0x0>;
75 clocks = <&infracfg CLK_INFRA_MUX1_SEL>,
76 <&apmixedsys CLK_APMIXED_MAIN_CORE_EN>;
77 clock-names = "cpu", "intermediate";
78 operating-points-v2 = <&cpu_opp_table>;
79 #cooling-cells = <2>;
26 enable-method = "psci"; 80 enable-method = "psci";
27 clock-frequency = <1300000000>; 81 clock-frequency = <1300000000>;
28 }; 82 };
@@ -31,21 +85,26 @@
31 device_type = "cpu"; 85 device_type = "cpu";
32 compatible = "arm,cortex-a53", "arm,armv8"; 86 compatible = "arm,cortex-a53", "arm,armv8";
33 reg = <0x0 0x1>; 87 reg = <0x0 0x1>;
88 clocks = <&infracfg CLK_INFRA_MUX1_SEL>,
89 <&apmixedsys CLK_APMIXED_MAIN_CORE_EN>;
90 clock-names = "cpu", "intermediate";
91 operating-points-v2 = <&cpu_opp_table>;
34 enable-method = "psci"; 92 enable-method = "psci";
35 clock-frequency = <1300000000>; 93 clock-frequency = <1300000000>;
36 }; 94 };
37 }; 95 };
38 96
39 uart_clk: dummy25m { 97 pwrap_clk: dummy40m {
40 compatible = "fixed-clock"; 98 compatible = "fixed-clock";
99 clock-frequency = <40000000>;
41 #clock-cells = <0>; 100 #clock-cells = <0>;
42 clock-frequency = <25000000>;
43 }; 101 };
44 102
45 bus_clk: dummy280m { 103 clk25m: oscillator {
46 compatible = "fixed-clock"; 104 compatible = "fixed-clock";
47 #clock-cells = <0>; 105 #clock-cells = <0>;
48 clock-frequency = <280000000>; 106 clock-frequency = <25000000>;
107 clock-output-names = "clkxtal";
49 }; 108 };
50 109
51 psci { 110 psci {
@@ -65,6 +124,58 @@
65 }; 124 };
66 }; 125 };
67 126
127 thermal-zones {
128 cpu_thermal: cpu-thermal {
129 polling-delay-passive = <1000>;
130 polling-delay = <1000>;
131
132 thermal-sensors = <&thermal 0>;
133
134 trips {
135 cpu_passive: cpu-passive {
136 temperature = <47000>;
137 hysteresis = <2000>;
138 type = "passive";
139 };
140
141 cpu_active: cpu-active {
142 temperature = <67000>;
143 hysteresis = <2000>;
144 type = "active";
145 };
146
147 cpu_hot: cpu-hot {
148 temperature = <87000>;
149 hysteresis = <2000>;
150 type = "hot";
151 };
152
153 cpu-crit {
154 temperature = <107000>;
155 hysteresis = <2000>;
156 type = "critical";
157 };
158 };
159
160 cooling-maps {
161 map0 {
162 trip = <&cpu_passive>;
163 cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
164 };
165
166 map1 {
167 trip = <&cpu_active>;
168 cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
169 };
170
171 map2 {
172 trip = <&cpu_hot>;
173 cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
174 };
175 };
176 };
177 };
178
68 timer { 179 timer {
69 compatible = "arm,armv8-timer"; 180 compatible = "arm,armv8-timer";
70 interrupt-parent = <&gic>; 181 interrupt-parent = <&gic>;
@@ -78,6 +189,58 @@
78 IRQ_TYPE_LEVEL_HIGH)>; 189 IRQ_TYPE_LEVEL_HIGH)>;
79 }; 190 };
80 191
192 infracfg: infracfg@10000000 {
193 compatible = "mediatek,mt7622-infracfg",
194 "syscon";
195 reg = <0 0x10000000 0 0x1000>;
196 #clock-cells = <1>;
197 #reset-cells = <1>;
198 };
199
200 pwrap: pwrap@10001000 {
201 compatible = "mediatek,mt7622-pwrap";
202 reg = <0 0x10001000 0 0x250>;
203 reg-names = "pwrap";
204 clocks = <&infracfg CLK_INFRA_PMIC_PD>, <&pwrap_clk>;
205 clock-names = "spi", "wrap";
206 resets = <&infracfg MT7622_INFRA_PMIC_WRAP_RST>;
207 reset-names = "pwrap";
208 interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
209 status = "disabled";
210 };
211
212 pericfg: pericfg@10002000 {
213 compatible = "mediatek,mt7622-pericfg",
214 "syscon";
215 reg = <0 0x10002000 0 0x1000>;
216 #clock-cells = <1>;
217 #reset-cells = <1>;
218 };
219
220 scpsys: scpsys@10006000 {
221 compatible = "mediatek,mt7622-scpsys",
222 "syscon";
223 #power-domain-cells = <1>;
224 reg = <0 0x10006000 0 0x1000>;
225 interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>,
226 <GIC_SPI 166 IRQ_TYPE_LEVEL_LOW>,
227 <GIC_SPI 167 IRQ_TYPE_LEVEL_LOW>,
228 <GIC_SPI 168 IRQ_TYPE_LEVEL_LOW>;
229 infracfg = <&infracfg>;
230 clocks = <&topckgen CLK_TOP_HIF_SEL>;
231 clock-names = "hif_sel";
232 };
233
234 cir: cir@10009000 {
235 compatible = "mediatek,mt7622-cir";
236 reg = <0 0x10009000 0 0x1000>;
237 interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_LOW>;
238 clocks = <&infracfg CLK_INFRA_IRRX_PD>,
239 <&topckgen CLK_TOP_AXI_SEL>;
240 clock-names = "clk", "bus";
241 status = "disabled";
242 };
243
81 sysirq: interrupt-controller@10200620 { 244 sysirq: interrupt-controller@10200620 {
82 compatible = "mediatek,mt7622-sysirq", 245 compatible = "mediatek,mt7622-sysirq",
83 "mediatek,mt6577-sysirq"; 246 "mediatek,mt6577-sysirq";
@@ -87,6 +250,62 @@
87 reg = <0 0x10200620 0 0x20>; 250 reg = <0 0x10200620 0 0x20>;
88 }; 251 };
89 252
253 efuse: efuse@10206000 {
254 compatible = "mediatek,mt7622-efuse",
255 "mediatek,efuse";
256 reg = <0 0x10206000 0 0x1000>;
257 #address-cells = <1>;
258 #size-cells = <1>;
259
260 thermal_calibration: calib@198 {
261 reg = <0x198 0xc>;
262 };
263 };
264
265 apmixedsys: apmixedsys@10209000 {
266 compatible = "mediatek,mt7622-apmixedsys",
267 "syscon";
268 reg = <0 0x10209000 0 0x1000>;
269 #clock-cells = <1>;
270 };
271
272 topckgen: topckgen@10210000 {
273 compatible = "mediatek,mt7622-topckgen",
274 "syscon";
275 reg = <0 0x10210000 0 0x1000>;
276 #clock-cells = <1>;
277 };
278
279 rng: rng@1020f000 {
280 compatible = "mediatek,mt7622-rng",
281 "mediatek,mt7623-rng";
282 reg = <0 0x1020f000 0 0x1000>;
283 clocks = <&infracfg CLK_INFRA_TRNG>;
284 clock-names = "rng";
285 };
286
287 pio: pinctrl@10211000 {
288 compatible = "mediatek,mt7622-pinctrl";
289 reg = <0 0x10211000 0 0x1000>;
290 gpio-controller;
291 #gpio-cells = <2>;
292 };
293
294 watchdog: watchdog@10212000 {
295 compatible = "mediatek,mt7622-wdt",
296 "mediatek,mt6589-wdt";
297 reg = <0 0x10212000 0 0x800>;
298 };
299
300 rtc: rtc@10212800 {
301 compatible = "mediatek,mt7622-rtc",
302 "mediatek,soc-rtc";
303 reg = <0 0x10212800 0 0x200>;
304 interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_LOW>;
305 clocks = <&topckgen CLK_TOP_RTC>;
306 clock-names = "rtc";
307 };
308
90 gic: interrupt-controller@10300000 { 309 gic: interrupt-controller@10300000 {
91 compatible = "arm,gic-400"; 310 compatible = "arm,gic-400";
92 interrupt-controller; 311 interrupt-controller;
@@ -98,13 +317,459 @@
98 <0 0x10360000 0 0x2000>; 317 <0 0x10360000 0 0x2000>;
99 }; 318 };
100 319
320 auxadc: adc@11001000 {
321 compatible = "mediatek,mt7622-auxadc";
322 reg = <0 0x11001000 0 0x1000>;
323 clocks = <&pericfg CLK_PERI_AUXADC_PD>;
324 clock-names = "main";
325 #io-channel-cells = <1>;
326 };
327
101 uart0: serial@11002000 { 328 uart0: serial@11002000 {
102 compatible = "mediatek,mt7622-uart", 329 compatible = "mediatek,mt7622-uart",
103 "mediatek,mt6577-uart"; 330 "mediatek,mt6577-uart";
104 reg = <0 0x11002000 0 0x400>; 331 reg = <0 0x11002000 0 0x400>;
105 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>; 332 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
106 clocks = <&uart_clk>, <&bus_clk>; 333 clocks = <&topckgen CLK_TOP_UART_SEL>,
334 <&pericfg CLK_PERI_UART1_PD>;
335 clock-names = "baud", "bus";
336 status = "disabled";
337 };
338
339 uart1: serial@11003000 {
340 compatible = "mediatek,mt7622-uart",
341 "mediatek,mt6577-uart";
342 reg = <0 0x11003000 0 0x400>;
343 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
344 clocks = <&topckgen CLK_TOP_UART_SEL>,
345 <&pericfg CLK_PERI_UART1_PD>;
346 clock-names = "baud", "bus";
347 status = "disabled";
348 };
349
350 uart2: serial@11004000 {
351 compatible = "mediatek,mt7622-uart",
352 "mediatek,mt6577-uart";
353 reg = <0 0x11004000 0 0x400>;
354 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
355 clocks = <&topckgen CLK_TOP_UART_SEL>,
356 <&pericfg CLK_PERI_UART2_PD>;
357 clock-names = "baud", "bus";
358 status = "disabled";
359 };
360
361 uart3: serial@11005000 {
362 compatible = "mediatek,mt7622-uart",
363 "mediatek,mt6577-uart";
364 reg = <0 0x11005000 0 0x400>;
365 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
366 clocks = <&topckgen CLK_TOP_UART_SEL>,
367 <&pericfg CLK_PERI_UART3_PD>;
368 clock-names = "baud", "bus";
369 status = "disabled";
370 };
371
372 pwm: pwm@11006000 {
373 compatible = "mediatek,mt7622-pwm";
374 reg = <0 0x11006000 0 0x1000>;
375 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_LOW>;
376 clocks = <&topckgen CLK_TOP_PWM_SEL>,
377 <&pericfg CLK_PERI_PWM_PD>,
378 <&pericfg CLK_PERI_PWM1_PD>,
379 <&pericfg CLK_PERI_PWM2_PD>,
380 <&pericfg CLK_PERI_PWM3_PD>,
381 <&pericfg CLK_PERI_PWM4_PD>,
382 <&pericfg CLK_PERI_PWM5_PD>,
383 <&pericfg CLK_PERI_PWM6_PD>;
384 clock-names = "top", "main", "pwm1", "pwm2", "pwm3", "pwm4",
385 "pwm5", "pwm6";
386 status = "disabled";
387 };
388
389 i2c0: i2c@11007000 {
390 compatible = "mediatek,mt7622-i2c";
391 reg = <0 0x11007000 0 0x90>,
392 <0 0x11000100 0 0x80>;
393 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
394 clock-div = <16>;
395 clocks = <&pericfg CLK_PERI_I2C0_PD>,
396 <&pericfg CLK_PERI_AP_DMA_PD>;
397 clock-names = "main", "dma";
398 #address-cells = <1>;
399 #size-cells = <0>;
400 status = "disabled";
401 };
402
403 i2c1: i2c@11008000 {
404 compatible = "mediatek,mt7622-i2c";
405 reg = <0 0x11008000 0 0x90>,
406 <0 0x11000180 0 0x80>;
407 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
408 clock-div = <16>;
409 clocks = <&pericfg CLK_PERI_I2C1_PD>,
410 <&pericfg CLK_PERI_AP_DMA_PD>;
411 clock-names = "main", "dma";
412 #address-cells = <1>;
413 #size-cells = <0>;
414 status = "disabled";
415 };
416
417 i2c2: i2c@11009000 {
418 compatible = "mediatek,mt7622-i2c";
419 reg = <0 0x11009000 0 0x90>,
420 <0 0x11000200 0 0x80>;
421 interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
422 clock-div = <16>;
423 clocks = <&pericfg CLK_PERI_I2C2_PD>,
424 <&pericfg CLK_PERI_AP_DMA_PD>;
425 clock-names = "main", "dma";
426 #address-cells = <1>;
427 #size-cells = <0>;
428 status = "disabled";
429 };
430
431 spi0: spi@1100a000 {
432 compatible = "mediatek,mt7622-spi";
433 reg = <0 0x1100a000 0 0x100>;
434 interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_LOW>;
435 clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
436 <&topckgen CLK_TOP_SPI0_SEL>,
437 <&pericfg CLK_PERI_SPI0_PD>;
438 clock-names = "parent-clk", "sel-clk", "spi-clk";
439 #address-cells = <1>;
440 #size-cells = <0>;
441 status = "disabled";
442 };
443
444 thermal: thermal@1100b000 {
445 #thermal-sensor-cells = <1>;
446 compatible = "mediatek,mt7622-thermal";
447 reg = <0 0x1100b000 0 0x1000>;
448 interrupts = <0 78 IRQ_TYPE_LEVEL_LOW>;
449 clocks = <&pericfg CLK_PERI_THERM_PD>,
450 <&pericfg CLK_PERI_AUXADC_PD>;
451 clock-names = "therm", "auxadc";
452 resets = <&pericfg MT7622_PERI_THERM_SW_RST>;
453 reset-names = "therm";
454 mediatek,auxadc = <&auxadc>;
455 mediatek,apmixedsys = <&apmixedsys>;
456 nvmem-cells = <&thermal_calibration>;
457 nvmem-cell-names = "calibration-data";
458 };
459
460 btif: serial@1100c000 {
461 compatible = "mediatek,mt7622-btif",
462 "mediatek,mtk-btif";
463 reg = <0 0x1100c000 0 0x1000>;
464 interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_LOW>;
465 clocks = <&pericfg CLK_PERI_BTIF_PD>;
466 clock-names = "main";
467 reg-shift = <2>;
468 reg-io-width = <4>;
469 status = "disabled";
470 };
471
472 nandc: nfi@1100d000 {
473 compatible = "mediatek,mt7622-nfc";
474 reg = <0 0x1100D000 0 0x1000>;
475 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
476 clocks = <&pericfg CLK_PERI_NFI_PD>,
477 <&pericfg CLK_PERI_SNFI_PD>;
478 clock-names = "nfi_clk", "pad_clk";
479 ecc-engine = <&bch>;
480 #address-cells = <1>;
481 #size-cells = <0>;
482 status = "disabled";
483 };
484
485 bch: ecc@1100e000 {
486 compatible = "mediatek,mt7622-ecc";
487 reg = <0 0x1100e000 0 0x1000>;
488 interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_LOW>;
489 clocks = <&pericfg CLK_PERI_NFIECC_PD>;
490 clock-names = "nfiecc_clk";
491 status = "disabled";
492 };
493
494 nor_flash: spi@11014000 {
495 compatible = "mediatek,mt7622-nor",
496 "mediatek,mt8173-nor";
497 reg = <0 0x11014000 0 0xe0>;
498 clocks = <&pericfg CLK_PERI_FLASH_PD>,
499 <&topckgen CLK_TOP_FLASH_SEL>;
500 clock-names = "spi", "sf";
501 #address-cells = <1>;
502 #size-cells = <0>;
503 status = "disabled";
504 };
505
506 spi1: spi@11016000 {
507 compatible = "mediatek,mt7622-spi";
508 reg = <0 0x11016000 0 0x100>;
509 interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_LOW>;
510 clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
511 <&topckgen CLK_TOP_SPI1_SEL>,
512 <&pericfg CLK_PERI_SPI1_PD>;
513 clock-names = "parent-clk", "sel-clk", "spi-clk";
514 #address-cells = <1>;
515 #size-cells = <0>;
516 status = "disabled";
517 };
518
519 uart4: serial@11019000 {
520 compatible = "mediatek,mt7622-uart",
521 "mediatek,mt6577-uart";
522 reg = <0 0x11019000 0 0x400>;
523 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_LOW>;
524 clocks = <&topckgen CLK_TOP_UART_SEL>,
525 <&pericfg CLK_PERI_UART4_PD>;
107 clock-names = "baud", "bus"; 526 clock-names = "baud", "bus";
108 status = "disabled"; 527 status = "disabled";
109 }; 528 };
529
530 mmc0: mmc@11230000 {
531 compatible = "mediatek,mt7622-mmc";
532 reg = <0 0x11230000 0 0x1000>;
533 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_LOW>;
534 clocks = <&pericfg CLK_PERI_MSDC30_0_PD>,
535 <&topckgen CLK_TOP_MSDC50_0_SEL>;
536 clock-names = "source", "hclk";
537 status = "disabled";
538 };
539
540 mmc1: mmc@11240000 {
541 compatible = "mediatek,mt7622-mmc";
542 reg = <0 0x11240000 0 0x1000>;
543 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_LOW>;
544 clocks = <&pericfg CLK_PERI_MSDC30_1_PD>,
545 <&topckgen CLK_TOP_AXI_SEL>;
546 clock-names = "source", "hclk";
547 status = "disabled";
548 };
549
550 ssusbsys: ssusbsys@1a000000 {
551 compatible = "mediatek,mt7622-ssusbsys",
552 "syscon";
553 reg = <0 0x1a000000 0 0x1000>;
554 #clock-cells = <1>;
555 #reset-cells = <1>;
556 };
557
558 ssusb: usb@1a0c0000 {
559 compatible = "mediatek,mt7622-xhci",
560 "mediatek,mtk-xhci";
561 reg = <0 0x1a0c0000 0 0x01000>,
562 <0 0x1a0c4700 0 0x0100>;
563 reg-names = "mac", "ippc";
564 interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_LOW>;
565 power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF1>;
566 clocks = <&ssusbsys CLK_SSUSB_SYS_EN>,
567 <&ssusbsys CLK_SSUSB_REF_EN>,
568 <&ssusbsys CLK_SSUSB_MCU_EN>,
569 <&ssusbsys CLK_SSUSB_DMA_EN>;
570 clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck";
571 phys = <&u2port0 PHY_TYPE_USB2>,
572 <&u3port0 PHY_TYPE_USB3>,
573 <&u2port1 PHY_TYPE_USB2>;
574
575 status = "disabled";
576 };
577
578 u3phy: usb-phy@1a0c4000 {
579 compatible = "mediatek,mt7622-u3phy",
580 "mediatek,generic-tphy-v1";
581 reg = <0 0x1a0c4000 0 0x700>;
582 #address-cells = <2>;
583 #size-cells = <2>;
584 ranges;
585 status = "disabled";
586
587 u2port0: usb-phy@1a0c4800 {
588 reg = <0 0x1a0c4800 0 0x0100>;
589 #phy-cells = <1>;
590 clocks = <&ssusbsys CLK_SSUSB_U2_PHY_EN>;
591 clock-names = "ref";
592 };
593
594 u3port0: usb-phy@1a0c4900 {
595 reg = <0 0x1a0c4900 0 0x0700>;
596 #phy-cells = <1>;
597 clocks = <&clk25m>;
598 clock-names = "ref";
599 };
600
601 u2port1: usb-phy@1a0c5000 {
602 reg = <0 0x1a0c5000 0 0x0100>;
603 #phy-cells = <1>;
604 clocks = <&ssusbsys CLK_SSUSB_U2_PHY_1P_EN>;
605 clock-names = "ref";
606 };
607 };
608
609 pciesys: pciesys@1a100800 {
610 compatible = "mediatek,mt7622-pciesys",
611 "syscon";
612 reg = <0 0x1a100800 0 0x1000>;
613 #clock-cells = <1>;
614 #reset-cells = <1>;
615 };
616
617 pcie: pcie@1a140000 {
618 compatible = "mediatek,mt7622-pcie";
619 device_type = "pci";
620 reg = <0 0x1a140000 0 0x1000>,
621 <0 0x1a143000 0 0x1000>,
622 <0 0x1a145000 0 0x1000>;
623 reg-names = "subsys", "port0", "port1";
624 #address-cells = <3>;
625 #size-cells = <2>;
626 interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>,
627 <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>;
628 clocks = <&pciesys CLK_PCIE_P0_MAC_EN>,
629 <&pciesys CLK_PCIE_P1_MAC_EN>,
630 <&pciesys CLK_PCIE_P0_AHB_EN>,
631 <&pciesys CLK_PCIE_P0_AHB_EN>,
632 <&pciesys CLK_PCIE_P0_AUX_EN>,
633 <&pciesys CLK_PCIE_P1_AUX_EN>,
634 <&pciesys CLK_PCIE_P0_AXI_EN>,
635 <&pciesys CLK_PCIE_P1_AXI_EN>,
636 <&pciesys CLK_PCIE_P0_OBFF_EN>,
637 <&pciesys CLK_PCIE_P1_OBFF_EN>,
638 <&pciesys CLK_PCIE_P0_PIPE_EN>,
639 <&pciesys CLK_PCIE_P1_PIPE_EN>;
640 clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1",
641 "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1",
642 "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1";
643 power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>;
644 bus-range = <0x00 0xff>;
645 ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
646 status = "disabled";
647
648 pcie0: pcie@0,0 {
649 reg = <0x0000 0 0 0 0>;
650 #address-cells = <3>;
651 #size-cells = <2>;
652 #interrupt-cells = <1>;
653 ranges;
654 status = "disabled";
655
656 num-lanes = <1>;
657 interrupt-map-mask = <0 0 0 7>;
658 interrupt-map = <0 0 0 1 &pcie_intc0 0>,
659 <0 0 0 2 &pcie_intc0 1>,
660 <0 0 0 3 &pcie_intc0 2>,
661 <0 0 0 4 &pcie_intc0 3>;
662 pcie_intc0: interrupt-controller {
663 interrupt-controller;
664 #address-cells = <0>;
665 #interrupt-cells = <1>;
666 };
667 };
668
669 pcie1: pcie@1,0 {
670 reg = <0x0800 0 0 0 0>;
671 #address-cells = <3>;
672 #size-cells = <2>;
673 #interrupt-cells = <1>;
674 ranges;
675 status = "disabled";
676
677 num-lanes = <1>;
678 interrupt-map-mask = <0 0 0 7>;
679 interrupt-map = <0 0 0 1 &pcie_intc1 0>,
680 <0 0 0 2 &pcie_intc1 1>,
681 <0 0 0 3 &pcie_intc1 2>,
682 <0 0 0 4 &pcie_intc1 3>;
683 pcie_intc1: interrupt-controller {
684 interrupt-controller;
685 #address-cells = <0>;
686 #interrupt-cells = <1>;
687 };
688 };
689 };
690
691 sata: sata@1a200000 {
692 compatible = "mediatek,mt7622-ahci",
693 "mediatek,mtk-ahci";
694 reg = <0 0x1a200000 0 0x1100>;
695 interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
696 interrupt-names = "hostc";
697 clocks = <&pciesys CLK_SATA_AHB_EN>,
698 <&pciesys CLK_SATA_AXI_EN>,
699 <&pciesys CLK_SATA_ASIC_EN>,
700 <&pciesys CLK_SATA_RBC_EN>,
701 <&pciesys CLK_SATA_PM_EN>;
702 clock-names = "ahb", "axi", "asic", "rbc", "pm";
703 phys = <&sata_port PHY_TYPE_SATA>;
704 phy-names = "sata-phy";
705 ports-implemented = <0x1>;
706 power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>;
707 resets = <&pciesys MT7622_SATA_AXI_BUS_RST>,
708 <&pciesys MT7622_SATA_PHY_SW_RST>,
709 <&pciesys MT7622_SATA_PHY_REG_RST>;
710 reset-names = "axi", "sw", "reg";
711 mediatek,phy-mode = <&pciesys>;
712 status = "disabled";
713 };
714
715 sata_phy: sata-phy@1a243000 {
716 compatible = "mediatek,generic-tphy-v1";
717 #address-cells = <2>;
718 #size-cells = <2>;
719 ranges;
720 status = "disabled";
721
722 sata_port: sata-phy@1a243000 {
723 reg = <0 0x1a243000 0 0x0100>;
724 clocks = <&topckgen CLK_TOP_ETH_500M>;
725 clock-names = "ref";
726 #phy-cells = <1>;
727 };
728 };
729
730 ethsys: syscon@1b000000 {
731 compatible = "mediatek,mt7622-ethsys",
732 "syscon";
733 reg = <0 0x1b000000 0 0x1000>;
734 #clock-cells = <1>;
735 #reset-cells = <1>;
736 };
737
738 eth: ethernet@1b100000 {
739 compatible = "mediatek,mt7622-eth",
740 "mediatek,mt2701-eth",
741 "syscon";
742 reg = <0 0x1b100000 0 0x20000>;
743 interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
744 <GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,
745 <GIC_SPI 225 IRQ_TYPE_LEVEL_LOW>;
746 clocks = <&topckgen CLK_TOP_ETH_SEL>,
747 <&ethsys CLK_ETH_ESW_EN>,
748 <&ethsys CLK_ETH_GP0_EN>,
749 <&ethsys CLK_ETH_GP1_EN>,
750 <&ethsys CLK_ETH_GP2_EN>,
751 <&sgmiisys CLK_SGMII_TX250M_EN>,
752 <&sgmiisys CLK_SGMII_RX250M_EN>,
753 <&sgmiisys CLK_SGMII_CDR_REF>,
754 <&sgmiisys CLK_SGMII_CDR_FB>,
755 <&topckgen CLK_TOP_SGMIIPLL>,
756 <&apmixedsys CLK_APMIXED_ETH2PLL>;
757 clock-names = "ethif", "esw", "gp0", "gp1", "gp2",
758 "sgmii_tx250m", "sgmii_rx250m",
759 "sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii_ck",
760 "eth2pll";
761 power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
762 mediatek,ethsys = <&ethsys>;
763 mediatek,sgmiisys = <&sgmiisys>;
764 #address-cells = <1>;
765 #size-cells = <0>;
766 status = "disabled";
767 };
768
769 sgmiisys: sgmiisys@1b128000 {
770 compatible = "mediatek,mt7622-sgmiisys",
771 "syscon";
772 reg = <0 0x1b128000 0 0x1000>;
773 #clock-cells = <1>;
774 };
110}; 775};
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 9fbe4705ee88..94597e33c806 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -341,7 +341,7 @@
341 reg = <0 0x10005000 0 0x1000>; 341 reg = <0 0x10005000 0 0x1000>;
342 }; 342 };
343 343
344 pio: pinctrl@0x10005000 { 344 pio: pinctrl@10005000 {
345 compatible = "mediatek,mt8173-pinctrl"; 345 compatible = "mediatek,mt8173-pinctrl";
346 reg = <0 0x1000b000 0 0x1000>; 346 reg = <0 0x1000b000 0 0x1000>;
347 mediatek,pctl-regmap = <&syscfg_pctl_a>; 347 mediatek,pctl-regmap = <&syscfg_pctl_a>;
diff --git a/arch/arm64/boot/dts/nvidia/Makefile b/arch/arm64/boot/dts/nvidia/Makefile
index 676aa2f238d1..7c13d7df484e 100644
--- a/arch/arm64/boot/dts/nvidia/Makefile
+++ b/arch/arm64/boot/dts/nvidia/Makefile
@@ -5,3 +5,4 @@ dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb
5dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb 5dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
6dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb 6dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
7dtb-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-p2771-0000.dtb 7dtb-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-p2771-0000.dtb
8dtb-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra194-p2972-0000.dtb
diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
new file mode 100644
index 000000000000..ecb034177fc2
--- /dev/null
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -0,0 +1,248 @@
1// SPDX-License-Identifier: GPL-2.0
2#include "tegra194.dtsi"
3
4#include <dt-bindings/mfd/max77620.h>
5
6/ {
7 model = "NVIDIA Tegra194 P2888 Processor Module";
8 compatible = "nvidia,p2888", "nvidia,tegra194";
9
10 aliases {
11 sdhci0 = "/cbb/sdhci@3460000";
12 sdhci1 = "/cbb/sdhci@3400000";
13 serial0 = &uartb;
14 i2c0 = "/bpmp/i2c";
15 i2c1 = "/cbb/i2c@3160000";
16 i2c2 = "/cbb/i2c@c240000";
17 i2c3 = "/cbb/i2c@3180000";
18 i2c4 = "/cbb/i2c@3190000";
19 i2c5 = "/cbb/i2c@31c0000";
20 i2c6 = "/cbb/i2c@c250000";
21 i2c7 = "/cbb/i2c@31e0000";
22 };
23
24 chosen {
25 bootargs = "console=ttyS0,115200n8";
26 stdout-path = "serial0:115200n8";
27 };
28
29 cbb {
30 serial@3110000 {
31 status = "okay";
32 };
33
34 /* SDMMC1 (SD/MMC) */
35 sdhci@3400000 {
36/*
37 cd-gpios = <&gpio TEGRA194_MAIN_GPIO(A, 0) GPIO_ACTIVE_LOW>;
38*/
39 };
40
41 /* SDMMC4 (eMMC) */
42 sdhci@3460000 {
43 status = "okay";
44 bus-width = <8>;
45 non-removable;
46
47 vqmmc-supply = <&vdd_1v8ls>;
48 vmmc-supply = <&vdd_emmc_3v3>;
49 };
50
51 pmc@c360000 {
52 nvidia,invert-interrupt;
53 };
54 };
55
56 bpmp {
57 i2c {
58 status = "okay";
59
60 pmic: pmic@3c {
61 compatible = "maxim,max20024";
62 reg = <0x3c>;
63
64 interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
65 #interrupt-cells = <2>;
66 interrupt-controller;
67
68 #gpio-cells = <2>;
69 gpio-controller;
70
71 pinctrl-names = "default";
72 pinctrl-0 = <&max20024_default>;
73
74 max20024_default: pinmux {
75 gpio0 {
76 pins = "gpio0";
77 function = "gpio";
78 };
79
80 gpio1 {
81 pins = "gpio1";
82 function = "fps-out";
83 maxim,active-fps-source = <MAX77620_FPS_SRC_DEF>;
84 };
85
86 gpio2 {
87 pins = "gpio2";
88 function = "fps-out";
89 maxim,active-fps-source = <MAX77620_FPS_SRC_DEF>;
90 };
91
92 gpio3 {
93 pins = "gpio3";
94 function = "fps-out";
95 maxim,active-fps-source = <MAX77620_FPS_SRC_DEF>;
96 };
97
98 gpio4 {
99 pins = "gpio4";
100 function = "32k-out1";
101 drive-push-pull = <1>;
102 };
103
104 gpio6 {
105 pins = "gpio6";
106 function = "gpio";
107 drive-push-pull = <1>;
108 };
109
110 gpio7 {
111 pins = "gpio7";
112 function = "gpio";
113 drive-push-pull = <0>;
114 };
115 };
116
117 fps {
118 fps0 {
119 maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN0>;
120 maxim,shutdown-fps-time-period-us = <640>;
121 };
122
123 fps1 {
124 maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN1>;
125 maxim,shutdown-fps-time-period-us = <640>;
126 maxim,device-state-on-disabled-event = <MAX77620_FPS_INACTIVE_STATE_SLEEP>;
127 };
128
129 fps2 {
130 maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN0>;
131 maxim,shutdown-fps-time-period-us = <640>;
132 };
133 };
134
135 regulators {
136 in-sd0-supply = <&vdd_5v0_sys>;
137 in-sd1-supply = <&vdd_5v0_sys>;
138 in-sd2-supply = <&vdd_5v0_sys>;
139 in-sd3-supply = <&vdd_5v0_sys>;
140 in-sd4-supply = <&vdd_5v0_sys>;
141
142 in-ldo0-1-supply = <&vdd_5v0_sys>;
143 in-ldo2-supply = <&vdd_5v0_sys>;
144 in-ldo3-5-supply = <&vdd_5v0_sys>;
145 in-ldo4-6-supply = <&vdd_5v0_sys>;
146 in-ldo7-8-supply = <&vdd_1v8ls>;
147
148 sd0 {
149 regulator-name = "VDD_1V0";
150 regulator-min-microvolt = <1000000>;
151 regulator-max-microvolt = <1000000>;
152 regulator-always-on;
153 regulator-boot-on;
154 };
155
156 sd1 {
157 regulator-name = "VDD_1V8HS";
158 regulator-min-microvolt = <1800000>;
159 regulator-max-microvolt = <1800000>;
160 regulator-always-on;
161 regulator-boot-on;
162 };
163
164 vdd_1v8ls: sd2 {
165 regulator-name = "VDD_1V8LS";
166 regulator-min-microvolt = <1800000>;
167 regulator-max-microvolt = <1800000>;
168 regulator-always-on;
169 regulator-boot-on;
170 };
171
172 sd3 {
173 regulator-name = "VDD_1V8AO";
174 regulator-min-microvolt = <1800000>;
175 regulator-max-microvolt = <1800000>;
176 regulator-always-on;
177 regulator-boot-on;
178 };
179
180 sd4 {
181 regulator-name = "VDD_DDR_1V1";
182 regulator-min-microvolt = <1100000>;
183 regulator-max-microvolt = <1100000>;
184 regulator-always-on;
185 regulator-boot-on;
186 };
187
188 ldo0 {
189 regulator-name = "VDD_RTC";
190 regulator-min-microvolt = <800000>;
191 regulator-max-microvolt = <800000>;
192 regulator-always-on;
193 regulator-boot-on;
194 };
195
196 ldo2 {
197 regulator-name = "VDD_AO_3V3";
198 regulator-min-microvolt = <3300000>;
199 regulator-max-microvolt = <3300000>;
200 regulator-always-on;
201 regulator-boot-on;
202 };
203
204 vdd_emmc_3v3: ldo3 {
205 regulator-name = "VDD_EMMC_3V3";
206 regulator-min-microvolt = <3300000>;
207 regulator-max-microvolt = <3300000>;
208 };
209
210 ldo5 {
211 regulator-name = "VDD_USB_3V3";
212 regulator-min-microvolt = <3300000>;
213 regulator-max-microvolt = <3300000>;
214 };
215
216 ldo6 {
217 regulator-name = "VDD_SDIO_3V3";
218 regulator-min-microvolt = <3300000>;
219 regulator-max-microvolt = <3300000>;
220 };
221
222 ldo7 {
223 regulator-name = "VDD_CSI_1V2";
224 regulator-min-microvolt = <1200000>;
225 regulator-max-microvolt = <1200000>;
226 };
227 };
228 };
229 };
230 };
231
232 regulators {
233 compatible = "simple-bus";
234 #address-cells = <1>;
235 #size-cells = <0>;
236
237 vdd_5v0_sys: regulator@0 {
238 compatible = "regulator-fixed";
239 reg = <0>;
240
241 regulator-name = "VIN_SYS_5V0";
242 regulator-min-microvolt = <5000000>;
243 regulator-max-microvolt = <5000000>;
244 regulator-always-on;
245 regulator-boot-on;
246 };
247 };
248};
diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
new file mode 100644
index 000000000000..9ff3c18280c4
--- /dev/null
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
@@ -0,0 +1,16 @@
1// SPDX-License-Identifier: GPL-2.0
2/dts-v1/;
3
4#include "tegra194-p2888.dtsi"
5
6/ {
7 model = "NVIDIA Tegra194 P2972-0000 Development Board";
8 compatible = "nvidia,p2972-0000", "nvidia,tegra194";
9
10 cbb {
11 /* SDMMC1 (SD/MMC) */
12 sdhci@3400000 {
13 status = "okay";
14 };
15 };
16};
diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
new file mode 100644
index 000000000000..6322ef265c2f
--- /dev/null
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -0,0 +1,344 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/clock/tegra194-clock.h>
3#include <dt-bindings/gpio/tegra194-gpio.h>
4#include <dt-bindings/interrupt-controller/arm-gic.h>
5#include <dt-bindings/mailbox/tegra186-hsp.h>
6#include <dt-bindings/reset/tegra194-reset.h>
7
8/ {
9 compatible = "nvidia,tegra194";
10 interrupt-parent = <&gic>;
11 #address-cells = <2>;
12 #size-cells = <2>;
13
14 /* control backbone */
15 cbb {
16 compatible = "simple-bus";
17 #address-cells = <1>;
18 #size-cells = <1>;
19 ranges = <0x0 0x0 0x0 0x40000000>;
20
21 uarta: serial@3100000 {
22 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
23 reg = <0x03100000 0x40>;
24 reg-shift = <2>;
25 interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
26 clocks = <&bpmp TEGRA194_CLK_UARTA>;
27 clock-names = "serial";
28 resets = <&bpmp TEGRA194_RESET_UARTA>;
29 reset-names = "serial";
30 status = "disabled";
31 };
32
33 uartb: serial@3110000 {
34 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
35 reg = <0x03110000 0x40>;
36 reg-shift = <2>;
37 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
38 clocks = <&bpmp TEGRA194_CLK_UARTB>;
39 clock-names = "serial";
40 resets = <&bpmp TEGRA194_RESET_UARTB>;
41 reset-names = "serial";
42 status = "disabled";
43 };
44
45 uartd: serial@3130000 {
46 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
47 reg = <0x03130000 0x40>;
48 reg-shift = <2>;
49 interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
50 clocks = <&bpmp TEGRA194_CLK_UARTD>;
51 clock-names = "serial";
52 resets = <&bpmp TEGRA194_RESET_UARTD>;
53 reset-names = "serial";
54 status = "disabled";
55 };
56
57 uarte: serial@3140000 {
58 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
59 reg = <0x03140000 0x40>;
60 reg-shift = <2>;
61 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
62 clocks = <&bpmp TEGRA194_CLK_UARTE>;
63 clock-names = "serial";
64 resets = <&bpmp TEGRA194_RESET_UARTE>;
65 reset-names = "serial";
66 status = "disabled";
67 };
68
69 uartf: serial@3150000 {
70 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
71 reg = <0x03150000 0x40>;
72 reg-shift = <2>;
73 interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
74 clocks = <&bpmp TEGRA194_CLK_UARTF>;
75 clock-names = "serial";
76 resets = <&bpmp TEGRA194_RESET_UARTF>;
77 reset-names = "serial";
78 status = "disabled";
79 };
80
81 gen1_i2c: i2c@3160000 {
82 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
83 reg = <0x03160000 0x10000>;
84 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
85 #address-cells = <1>;
86 #size-cells = <0>;
87 clocks = <&bpmp TEGRA194_CLK_I2C1>;
88 clock-names = "div-clk";
89 resets = <&bpmp TEGRA194_RESET_I2C1>;
90 reset-names = "i2c";
91 status = "disabled";
92 };
93
94 uarth: serial@3170000 {
95 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
96 reg = <0x03170000 0x40>;
97 reg-shift = <2>;
98 interrupts = <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>;
99 clocks = <&bpmp TEGRA194_CLK_UARTH>;
100 clock-names = "serial";
101 resets = <&bpmp TEGRA194_RESET_UARTH>;
102 reset-names = "serial";
103 status = "disabled";
104 };
105
106 cam_i2c: i2c@3180000 {
107 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
108 reg = <0x03180000 0x10000>;
109 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
110 #address-cells = <1>;
111 #size-cells = <0>;
112 clocks = <&bpmp TEGRA194_CLK_I2C3>;
113 clock-names = "div-clk";
114 resets = <&bpmp TEGRA194_RESET_I2C3>;
115 reset-names = "i2c";
116 status = "disabled";
117 };
118
119 /* shares pads with dpaux1 */
120 dp_aux_ch1_i2c: i2c@3190000 {
121 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
122 reg = <0x03190000 0x10000>;
123 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
124 #address-cells = <1>;
125 #size-cells = <0>;
126 clocks = <&bpmp TEGRA194_CLK_I2C4>;
127 clock-names = "div-clk";
128 resets = <&bpmp TEGRA194_RESET_I2C4>;
129 reset-names = "i2c";
130 status = "disabled";
131 };
132
133 /* shares pads with dpaux0 */
134 dp_aux_ch0_i2c: i2c@31b0000 {
135 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
136 reg = <0x031b0000 0x10000>;
137 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
138 #address-cells = <1>;
139 #size-cells = <0>;
140 clocks = <&bpmp TEGRA194_CLK_I2C6>;
141 clock-names = "div-clk";
142 resets = <&bpmp TEGRA194_RESET_I2C6>;
143 reset-names = "i2c";
144 status = "disabled";
145 };
146
147 gen7_i2c: i2c@31c0000 {
148 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
149 reg = <0x031c0000 0x10000>;
150 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
151 #address-cells = <1>;
152 #size-cells = <0>;
153 clocks = <&bpmp TEGRA194_CLK_I2C7>;
154 clock-names = "div-clk";
155 resets = <&bpmp TEGRA194_RESET_I2C7>;
156 reset-names = "i2c";
157 status = "disabled";
158 };
159
160 gen9_i2c: i2c@31e0000 {
161 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
162 reg = <0x031e0000 0x10000>;
163 interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
164 #address-cells = <1>;
165 #size-cells = <0>;
166 clocks = <&bpmp TEGRA194_CLK_I2C9>;
167 clock-names = "div-clk";
168 resets = <&bpmp TEGRA194_RESET_I2C9>;
169 reset-names = "i2c";
170 status = "disabled";
171 };
172
173 sdmmc1: sdhci@3400000 {
174 compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
175 reg = <0x03400000 0x10000>;
176 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
177 clocks = <&bpmp TEGRA194_CLK_SDMMC1>;
178 clock-names = "sdhci";
179 resets = <&bpmp TEGRA194_RESET_SDMMC1>;
180 reset-names = "sdhci";
181 status = "disabled";
182 };
183
184 sdmmc3: sdhci@3440000 {
185 compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
186 reg = <0x03440000 0x10000>;
187 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
188 clocks = <&bpmp TEGRA194_CLK_SDMMC3>;
189 clock-names = "sdhci";
190 resets = <&bpmp TEGRA194_RESET_SDMMC3>;
191 reset-names = "sdhci";
192 status = "disabled";
193 };
194
195 sdmmc4: sdhci@3460000 {
196 compatible = "nvidia,tegra194-sdhci", "nvidia,tegra186-sdhci";
197 reg = <0x03460000 0x10000>;
198 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
199 clocks = <&bpmp TEGRA194_CLK_SDMMC4>;
200 clock-names = "sdhci";
201 resets = <&bpmp TEGRA194_RESET_SDMMC4>;
202 reset-names = "sdhci";
203 status = "disabled";
204 };
205
206 gic: interrupt-controller@3881000 {
207 compatible = "arm,gic-400";
208 #interrupt-cells = <3>;
209 interrupt-controller;
210 reg = <0x03881000 0x1000>,
211 <0x03882000 0x2000>,
212 <0x03884000 0x2000>,
213 <0x03886000 0x2000>;
214 interrupts = <GIC_PPI 9
215 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
216 interrupt-parent = <&gic>;
217 };
218
219 hsp_top0: hsp@3c00000 {
220 compatible = "nvidia,tegra186-hsp";
221 reg = <0x03c00000 0xa0000>;
222 interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
223 interrupt-names = "doorbell";
224 #mbox-cells = <2>;
225 };
226
227 gen2_i2c: i2c@c240000 {
228 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
229 reg = <0x0c240000 0x10000>;
230 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
231 #address-cells = <1>;
232 #size-cells = <0>;
233 clocks = <&bpmp TEGRA194_CLK_I2C2>;
234 clock-names = "div-clk";
235 resets = <&bpmp TEGRA194_RESET_I2C2>;
236 reset-names = "i2c";
237 status = "disabled";
238 };
239
240 gen8_i2c: i2c@c250000 {
241 compatible = "nvidia,tegra194-i2c", "nvidia,tegra114-i2c";
242 reg = <0x0c250000 0x10000>;
243 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
244 #address-cells = <1>;
245 #size-cells = <0>;
246 clocks = <&bpmp TEGRA194_CLK_I2C8>;
247 clock-names = "div-clk";
248 resets = <&bpmp TEGRA194_RESET_I2C8>;
249 reset-names = "i2c";
250 status = "disabled";
251 };
252
253 uartc: serial@c280000 {
254 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
255 reg = <0x0c280000 0x40>;
256 reg-shift = <2>;
257 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
258 clocks = <&bpmp TEGRA194_CLK_UARTC>;
259 clock-names = "serial";
260 resets = <&bpmp TEGRA194_RESET_UARTC>;
261 reset-names = "serial";
262 status = "disabled";
263 };
264
265 uartg: serial@c290000 {
266 compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
267 reg = <0x0c290000 0x40>;
268 reg-shift = <2>;
269 interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
270 clocks = <&bpmp TEGRA194_CLK_UARTG>;
271 clock-names = "serial";
272 resets = <&bpmp TEGRA194_RESET_UARTG>;
273 reset-names = "serial";
274 status = "disabled";
275 };
276
277 pmc@c360000 {
278 compatible = "nvidia,tegra194-pmc";
279 reg = <0x0c360000 0x10000>,
280 <0x0c370000 0x10000>,
281 <0x0c380000 0x10000>,
282 <0x0c390000 0x10000>,
283 <0x0c3a0000 0x10000>;
284 reg-names = "pmc", "wake", "aotag", "scratch", "misc";
285 };
286 };
287
288 sysram@40000000 {
289 compatible = "nvidia,tegra194-sysram", "mmio-sram";
290 reg = <0x0 0x40000000 0x0 0x50000>;
291 #address-cells = <1>;
292 #size-cells = <1>;
293 ranges = <0x0 0x0 0x40000000 0x50000>;
294
295 cpu_bpmp_tx: shmem@4e000 {
296 compatible = "nvidia,tegra194-bpmp-shmem";
297 reg = <0x4e000 0x1000>;
298 label = "cpu-bpmp-tx";
299 pool;
300 };
301
302 cpu_bpmp_rx: shmem@4f000 {
303 compatible = "nvidia,tegra194-bpmp-shmem";
304 reg = <0x4f000 0x1000>;
305 label = "cpu-bpmp-rx";
306 pool;
307 };
308 };
309
310 bpmp: bpmp {
311 compatible = "nvidia,tegra186-bpmp";
312 mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB
313 TEGRA_HSP_DB_MASTER_BPMP>;
314 shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>;
315 #clock-cells = <1>;
316 #reset-cells = <1>;
317 #power-domain-cells = <1>;
318
319 bpmp_i2c: i2c {
320 compatible = "nvidia,tegra186-bpmp-i2c";
321 nvidia,bpmp-bus-id = <5>;
322 #address-cells = <1>;
323 #size-cells = <0>;
324 };
325
326 bpmp_thermal: thermal {
327 compatible = "nvidia,tegra186-bpmp-thermal";
328 #thermal-sensor-cells = <1>;
329 };
330 };
331
332 timer {
333 compatible = "arm,armv8-timer";
334 interrupts = <GIC_PPI 13
335 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
336 <GIC_PPI 14
337 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
338 <GIC_PPI 11
339 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
340 <GIC_PPI 10
341 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
342 interrupt-parent = <&gic>;
343 };
344};
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
index d67ef4319f3b..9d5a0e6b2ca4 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
@@ -1325,6 +1325,11 @@
1325 status = "okay"; 1325 status = "okay";
1326 }; 1326 };
1327 1327
1328 sata@70020000 {
1329 status = "okay";
1330 phys = <&{/padctl@7009f000/pads/sata/lanes/sata-0}>;
1331 };
1332
1328 padctl@7009f000 { 1333 padctl@7009f000 {
1329 status = "okay"; 1334 status = "okay";
1330 1335
diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
index 9c2402108772..3be920efee82 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
@@ -798,6 +798,22 @@
798 #iommu-cells = <1>; 798 #iommu-cells = <1>;
799 }; 799 };
800 800
801 sata@70020000 {
802 compatible = "nvidia,tegra210-ahci";
803 reg = <0x0 0x70027000 0x0 0x2000>, /* AHCI */
804 <0x0 0x70020000 0x0 0x7000>, /* SATA */
805 <0x0 0x70001100 0x0 0x1000>; /* SATA AUX */
806 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
807 clocks = <&tegra_car TEGRA210_CLK_SATA>,
808 <&tegra_car TEGRA210_CLK_SATA_OOB>;
809 clock-names = "sata", "sata-oob";
810 resets = <&tegra_car 124>,
811 <&tegra_car 123>,
812 <&tegra_car 129>;
813 reset-names = "sata", "sata-oob", "sata-cold";
814 status = "disabled";
815 };
816
801 hda@70030000 { 817 hda@70030000 {
802 compatible = "nvidia,tegra210-hda", "nvidia,tegra30-hda"; 818 compatible = "nvidia,tegra210-hda", "nvidia,tegra30-hda";
803 reg = <0x0 0x70030000 0x0 0x10000>; 819 reg = <0x0 0x70030000 0x0 0x10000>;
diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
index 492a011f14f6..1c8f1b86472d 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
@@ -140,16 +140,16 @@
140 }; 140 };
141 141
142 agnoc@0 { 142 agnoc@0 {
143 qcom,pcie@00600000 { 143 qcom,pcie@600000 {
144 perst-gpio = <&msmgpio 35 GPIO_ACTIVE_LOW>; 144 perst-gpio = <&msmgpio 35 GPIO_ACTIVE_LOW>;
145 }; 145 };
146 146
147 qcom,pcie@00608000 { 147 qcom,pcie@608000 {
148 status = "okay"; 148 status = "okay";
149 perst-gpio = <&msmgpio 130 GPIO_ACTIVE_LOW>; 149 perst-gpio = <&msmgpio 130 GPIO_ACTIVE_LOW>;
150 }; 150 };
151 151
152 qcom,pcie@00610000 { 152 qcom,pcie@610000 {
153 status = "okay"; 153 status = "okay";
154 perst-gpio = <&msmgpio 114 GPIO_ACTIVE_LOW>; 154 perst-gpio = <&msmgpio 114 GPIO_ACTIVE_LOW>;
155 }; 155 };
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index e51b04900726..66b318e1de80 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -15,6 +15,7 @@
15#include <dt-bindings/clock/qcom,gcc-msm8916.h> 15#include <dt-bindings/clock/qcom,gcc-msm8916.h>
16#include <dt-bindings/reset/qcom,gcc-msm8916.h> 16#include <dt-bindings/reset/qcom,gcc-msm8916.h>
17#include <dt-bindings/clock/qcom,rpmcc.h> 17#include <dt-bindings/clock/qcom,rpmcc.h>
18#include <dt-bindings/thermal/thermal.h>
18 19
19/ { 20/ {
20 model = "Qualcomm Technologies, Inc. MSM8916"; 21 model = "Qualcomm Technologies, Inc. MSM8916";
@@ -113,6 +114,9 @@
113 next-level-cache = <&L2_0>; 114 next-level-cache = <&L2_0>;
114 enable-method = "psci"; 115 enable-method = "psci";
115 cpu-idle-states = <&CPU_SPC>; 116 cpu-idle-states = <&CPU_SPC>;
117 clocks = <&apcs 0>;
118 operating-points-v2 = <&cpu_opp_table>;
119 #cooling-cells = <2>;
116 }; 120 };
117 121
118 CPU1: cpu@1 { 122 CPU1: cpu@1 {
@@ -122,6 +126,9 @@
122 next-level-cache = <&L2_0>; 126 next-level-cache = <&L2_0>;
123 enable-method = "psci"; 127 enable-method = "psci";
124 cpu-idle-states = <&CPU_SPC>; 128 cpu-idle-states = <&CPU_SPC>;
129 clocks = <&apcs 0>;
130 operating-points-v2 = <&cpu_opp_table>;
131 #cooling-cells = <2>;
125 }; 132 };
126 133
127 CPU2: cpu@2 { 134 CPU2: cpu@2 {
@@ -131,6 +138,9 @@
131 next-level-cache = <&L2_0>; 138 next-level-cache = <&L2_0>;
132 enable-method = "psci"; 139 enable-method = "psci";
133 cpu-idle-states = <&CPU_SPC>; 140 cpu-idle-states = <&CPU_SPC>;
141 clocks = <&apcs 0>;
142 operating-points-v2 = <&cpu_opp_table>;
143 #cooling-cells = <2>;
134 }; 144 };
135 145
136 CPU3: cpu@3 { 146 CPU3: cpu@3 {
@@ -140,6 +150,9 @@
140 next-level-cache = <&L2_0>; 150 next-level-cache = <&L2_0>;
141 enable-method = "psci"; 151 enable-method = "psci";
142 cpu-idle-states = <&CPU_SPC>; 152 cpu-idle-states = <&CPU_SPC>;
153 clocks = <&apcs 0>;
154 operating-points-v2 = <&cpu_opp_table>;
155 #cooling-cells = <2>;
143 }; 156 };
144 157
145 L2_0: l2-cache { 158 L2_0: l2-cache {
@@ -188,6 +201,13 @@
188 type = "critical"; 201 type = "critical";
189 }; 202 };
190 }; 203 };
204
205 cooling-maps {
206 map0 {
207 trip = <&cpu_alert0>;
208 cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
209 };
210 };
191 }; 211 };
192 212
193 cpu-thermal1 { 213 cpu-thermal1 {
@@ -208,10 +228,35 @@
208 type = "critical"; 228 type = "critical";
209 }; 229 };
210 }; 230 };
231
232 cooling-maps {
233 map0 {
234 trip = <&cpu_alert1>;
235 cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
236 };
237 };
211 }; 238 };
212 239
213 }; 240 };
214 241
242 cpu_opp_table: cpu_opp_table {
243 compatible = "operating-points-v2";
244 opp-shared;
245
246 opp-200000000 {
247 opp-hz = /bits/ 64 <200000000>;
248 };
249 opp-400000000 {
250 opp-hz = /bits/ 64 <400000000>;
251 };
252 opp-800000000 {
253 opp-hz = /bits/ 64 <800000000>;
254 };
255 opp-998400000 {
256 opp-hz = /bits/ 64 <998400000>;
257 };
258 };
259
215 gpu_opp_table: opp_table { 260 gpu_opp_table: opp_table {
216 compatible = "operating-points-v2"; 261 compatible = "operating-points-v2";
217 262
@@ -326,9 +371,18 @@
326 status = "disabled"; 371 status = "disabled";
327 }; 372 };
328 373
329 apcs: syscon@b011000 { 374 a53pll: clock@b016000 {
330 compatible = "syscon"; 375 compatible = "qcom,msm8916-a53pll";
331 reg = <0x0b011000 0x1000>; 376 reg = <0xb016000 0x40>;
377 #clock-cells = <0>;
378 };
379
380 apcs: mailbox@b011000 {
381 compatible = "qcom,msm8916-apcs-kpss-global", "syscon";
382 reg = <0xb011000 0x1000>;
383 #mbox-cells = <1>;
384 clocks = <&a53pll>;
385 #clock-cells = <0>;
332 }; 386 };
333 387
334 blsp1_uart2: serial@78b0000 { 388 blsp1_uart2: serial@78b0000 {
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 4b2afcc4fdf4..410ae787ebb4 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -75,6 +75,17 @@
75 reg = <0x0 0x86200000 0x0 0x2600000>; 75 reg = <0x0 0x86200000 0x0 0x2600000>;
76 no-map; 76 no-map;
77 }; 77 };
78
79 rmtfs@86700000 {
80 compatible = "qcom,rmtfs-mem";
81
82 size = <0x0 0x200000>;
83 alloc-ranges = <0x0 0xa0000000 0x0 0x2000000>;
84 no-map;
85
86 qcom,client-id = <1>;
87 qcom,vmid = <15>;
88 };
78 }; 89 };
79 90
80 cpus { 91 cpus {
@@ -232,10 +243,10 @@
232 243
233 timer { 244 timer {
234 compatible = "arm,armv8-timer"; 245 compatible = "arm,armv8-timer";
235 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 246 interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
236 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 247 <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
237 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 248 <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
238 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; 249 <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
239 }; 250 };
240 251
241 clocks { 252 clocks {
@@ -497,8 +508,8 @@
497 blsp2_spi5: spi@75ba000{ 508 blsp2_spi5: spi@75ba000{
498 compatible = "qcom,spi-qup-v2.2.1"; 509 compatible = "qcom,spi-qup-v2.2.1";
499 reg = <0x075ba000 0x600>; 510 reg = <0x075ba000 0x600>;
500 interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; 511 interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
501 clocks = <&gcc GCC_BLSP2_QUP5_SPI_APPS_CLK>, 512 clocks = <&gcc GCC_BLSP2_QUP6_SPI_APPS_CLK>,
502 <&gcc GCC_BLSP2_AHB_CLK>; 513 <&gcc GCC_BLSP2_AHB_CLK>;
503 clock-names = "core", "iface"; 514 clock-names = "core", "iface";
504 pinctrl-names = "default", "sleep"; 515 pinctrl-names = "default", "sleep";
@@ -840,7 +851,7 @@
840 #size-cells = <1>; 851 #size-cells = <1>;
841 ranges; 852 ranges;
842 853
843 pcie0: qcom,pcie@00600000 { 854 pcie0: qcom,pcie@600000 {
844 compatible = "qcom,pcie-msm8996", "snps,dw-pcie"; 855 compatible = "qcom,pcie-msm8996", "snps,dw-pcie";
845 status = "disabled"; 856 status = "disabled";
846 power-domains = <&gcc PCIE0_GDSC>; 857 power-domains = <&gcc PCIE0_GDSC>;
@@ -893,7 +904,7 @@
893 904
894 }; 905 };
895 906
896 pcie1: qcom,pcie@00608000 { 907 pcie1: qcom,pcie@608000 {
897 compatible = "qcom,pcie-msm8996", "snps,dw-pcie"; 908 compatible = "qcom,pcie-msm8996", "snps,dw-pcie";
898 power-domains = <&gcc PCIE1_GDSC>; 909 power-domains = <&gcc PCIE1_GDSC>;
899 bus-range = <0x00 0xff>; 910 bus-range = <0x00 0xff>;
@@ -946,7 +957,7 @@
946 "bus_slave"; 957 "bus_slave";
947 }; 958 };
948 959
949 pcie2: qcom,pcie@00610000 { 960 pcie2: qcom,pcie@610000 {
950 compatible = "qcom,pcie-msm8996", "snps,dw-pcie"; 961 compatible = "qcom,pcie-msm8996", "snps,dw-pcie";
951 power-domains = <&gcc PCIE2_GDSC>; 962 power-domains = <&gcc PCIE2_GDSC>;
952 bus-range = <0x00 0xff>; 963 bus-range = <0x00 0xff>;
diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 2186d0193b73..5ede06000ea4 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -7,5 +7,7 @@ dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-es1-h3ulcb-kf.dtb
7dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-x.dtb r8a7796-m3ulcb.dtb 7dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-x.dtb r8a7796-m3ulcb.dtb
8dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-m3ulcb-kf.dtb 8dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-m3ulcb-kf.dtb
9dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-xs.dtb 9dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-xs.dtb
10dtb-$(CONFIG_ARCH_R8A77965) += r8a77965-salvator-x.dtb r8a77965-salvator-xs.dtb
10dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb r8a77970-v3msk.dtb 11dtb-$(CONFIG_ARCH_R8A77970) += r8a77970-eagle.dtb r8a77970-v3msk.dtb
12dtb-$(CONFIG_ARCH_R8A77980) += r8a77980-condor.dtb
11dtb-$(CONFIG_ARCH_R8A77995) += r8a77995-draak.dtb 13dtb-$(CONFIG_ARCH_R8A77995) += r8a77995-draak.dtb
diff --git a/arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi b/arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi
index 26769a11a190..f9acd125d687 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi
@@ -23,6 +23,7 @@
23 23
24 /delete-node/ mmu@febe0000; 24 /delete-node/ mmu@febe0000;
25 /delete-node/ mmu@fe980000; 25 /delete-node/ mmu@fe980000;
26 /delete-node/ mmu@fd950000;
26 /delete-node/ mmu@fd960000; 27 /delete-node/ mmu@fd960000;
27 /delete-node/ mmu@fd970000; 28 /delete-node/ mmu@fd970000;
28 29
@@ -80,7 +81,7 @@
80 81
81 vspd3: vsp@fea38000 { 82 vspd3: vsp@fea38000 {
82 compatible = "renesas,vsp2"; 83 compatible = "renesas,vsp2";
83 reg = <0 0xfea38000 0 0x4000>; 84 reg = <0 0xfea38000 0 0x8000>;
84 interrupts = <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>; 85 interrupts = <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>;
85 clocks = <&cpg CPG_MOD 620>; 86 clocks = <&cpg CPG_MOD 620>;
86 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 87 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index d12df6f2ff09..1d5e3ac0231c 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -41,6 +41,9 @@
41 power-domains = <&sysc R8A7795_PD_CA57_CPU0>; 41 power-domains = <&sysc R8A7795_PD_CA57_CPU0>;
42 next-level-cache = <&L2_CA57>; 42 next-level-cache = <&L2_CA57>;
43 enable-method = "psci"; 43 enable-method = "psci";
44 clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
45 operating-points-v2 = <&cluster0_opp>;
46 #cooling-cells = <2>;
44 }; 47 };
45 48
46 a57_1: cpu@1 { 49 a57_1: cpu@1 {
@@ -50,6 +53,9 @@
50 power-domains = <&sysc R8A7795_PD_CA57_CPU1>; 53 power-domains = <&sysc R8A7795_PD_CA57_CPU1>;
51 next-level-cache = <&L2_CA57>; 54 next-level-cache = <&L2_CA57>;
52 enable-method = "psci"; 55 enable-method = "psci";
56 clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
57 operating-points-v2 = <&cluster0_opp>;
58 #cooling-cells = <2>;
53 }; 59 };
54 60
55 a57_2: cpu@2 { 61 a57_2: cpu@2 {
@@ -59,6 +65,9 @@
59 power-domains = <&sysc R8A7795_PD_CA57_CPU2>; 65 power-domains = <&sysc R8A7795_PD_CA57_CPU2>;
60 next-level-cache = <&L2_CA57>; 66 next-level-cache = <&L2_CA57>;
61 enable-method = "psci"; 67 enable-method = "psci";
68 clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
69 operating-points-v2 = <&cluster0_opp>;
70 #cooling-cells = <2>;
62 }; 71 };
63 72
64 a57_3: cpu@3 { 73 a57_3: cpu@3 {
@@ -68,6 +77,9 @@
68 power-domains = <&sysc R8A7795_PD_CA57_CPU3>; 77 power-domains = <&sysc R8A7795_PD_CA57_CPU3>;
69 next-level-cache = <&L2_CA57>; 78 next-level-cache = <&L2_CA57>;
70 enable-method = "psci"; 79 enable-method = "psci";
80 clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
81 operating-points-v2 = <&cluster0_opp>;
82 #cooling-cells = <2>;
71 }; 83 };
72 84
73 a53_0: cpu@100 { 85 a53_0: cpu@100 {
@@ -77,6 +89,8 @@
77 power-domains = <&sysc R8A7795_PD_CA53_CPU0>; 89 power-domains = <&sysc R8A7795_PD_CA53_CPU0>;
78 next-level-cache = <&L2_CA53>; 90 next-level-cache = <&L2_CA53>;
79 enable-method = "psci"; 91 enable-method = "psci";
92 clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
93 operating-points-v2 = <&cluster1_opp>;
80 }; 94 };
81 95
82 a53_1: cpu@101 { 96 a53_1: cpu@101 {
@@ -86,6 +100,8 @@
86 power-domains = <&sysc R8A7795_PD_CA53_CPU1>; 100 power-domains = <&sysc R8A7795_PD_CA53_CPU1>;
87 next-level-cache = <&L2_CA53>; 101 next-level-cache = <&L2_CA53>;
88 enable-method = "psci"; 102 enable-method = "psci";
103 clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
104 operating-points-v2 = <&cluster1_opp>;
89 }; 105 };
90 106
91 a53_2: cpu@102 { 107 a53_2: cpu@102 {
@@ -95,6 +111,8 @@
95 power-domains = <&sysc R8A7795_PD_CA53_CPU2>; 111 power-domains = <&sysc R8A7795_PD_CA53_CPU2>;
96 next-level-cache = <&L2_CA53>; 112 next-level-cache = <&L2_CA53>;
97 enable-method = "psci"; 113 enable-method = "psci";
114 clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
115 operating-points-v2 = <&cluster1_opp>;
98 }; 116 };
99 117
100 a53_3: cpu@103 { 118 a53_3: cpu@103 {
@@ -104,6 +122,8 @@
104 power-domains = <&sysc R8A7795_PD_CA53_CPU3>; 122 power-domains = <&sysc R8A7795_PD_CA53_CPU3>;
105 next-level-cache = <&L2_CA53>; 123 next-level-cache = <&L2_CA53>;
106 enable-method = "psci"; 124 enable-method = "psci";
125 clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
126 operating-points-v2 = <&cluster1_opp>;
107 }; 127 };
108 128
109 L2_CA57: cache-controller-0 { 129 L2_CA57: cache-controller-0 {
@@ -165,11 +185,59 @@
165 clock-frequency = <0>; 185 clock-frequency = <0>;
166 }; 186 };
167 187
168 /* External SCIF clock - to be overridden by boards that provide it */ 188 cluster0_opp: opp_table0 {
169 scif_clk: scif { 189 compatible = "operating-points-v2";
170 compatible = "fixed-clock"; 190 opp-shared;
171 #clock-cells = <0>; 191
172 clock-frequency = <0>; 192 opp-500000000 {
193 opp-hz = /bits/ 64 <500000000>;
194 opp-microvolt = <830000>;
195 clock-latency-ns = <300000>;
196 };
197 opp-1000000000 {
198 opp-hz = /bits/ 64 <1000000000>;
199 opp-microvolt = <830000>;
200 clock-latency-ns = <300000>;
201 };
202 opp-1500000000 {
203 opp-hz = /bits/ 64 <1500000000>;
204 opp-microvolt = <830000>;
205 clock-latency-ns = <300000>;
206 opp-suspend;
207 };
208 opp-1600000000 {
209 opp-hz = /bits/ 64 <1600000000>;
210 opp-microvolt = <900000>;
211 clock-latency-ns = <300000>;
212 turbo-mode;
213 };
214 opp-1700000000 {
215 opp-hz = /bits/ 64 <1700000000>;
216 opp-microvolt = <960000>;
217 clock-latency-ns = <300000>;
218 turbo-mode;
219 };
220 };
221
222 cluster1_opp: opp_table1 {
223 compatible = "operating-points-v2";
224 opp-shared;
225
226 opp-800000000 {
227 opp-hz = /bits/ 64 <800000000>;
228 opp-microvolt = <820000>;
229 clock-latency-ns = <300000>;
230 };
231 opp-1000000000 {
232 opp-hz = /bits/ 64 <1000000000>;
233 opp-microvolt = <820000>;
234 clock-latency-ns = <300000>;
235 };
236 opp-1200000000 {
237 opp-hz = /bits/ 64 <1200000000>;
238 opp-microvolt = <820000>;
239 clock-latency-ns = <300000>;
240 };
173 }; 241 };
174 242
175 /* External PCIe clock - can be overridden by the board */ 243 /* External PCIe clock - can be overridden by the board */
@@ -208,6 +276,13 @@
208 method = "smc"; 276 method = "smc";
209 }; 277 };
210 278
279 /* External SCIF clock - to be overridden by boards that provide it */
280 scif_clk: scif {
281 compatible = "fixed-clock";
282 #clock-cells = <0>;
283 clock-frequency = <0>;
284 };
285
211 soc: soc { 286 soc: soc {
212 compatible = "simple-bus"; 287 compatible = "simple-bus";
213 interrupt-parent = <&gic>; 288 interrupt-parent = <&gic>;
@@ -470,6 +545,15 @@
470 status = "disabled"; 545 status = "disabled";
471 }; 546 };
472 547
548 ipmmu_pv1: mmu@fd950000 {
549 compatible = "renesas,ipmmu-r8a7795";
550 reg = <0 0xfd950000 0 0x1000>;
551 renesas,ipmmu-main = <&ipmmu_mm 7>;
552 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
553 #iommu-cells = <1>;
554 status = "disabled";
555 };
556
473 ipmmu_pv2: mmu@fd960000 { 557 ipmmu_pv2: mmu@fd960000 {
474 compatible = "renesas,ipmmu-r8a7795"; 558 compatible = "renesas,ipmmu-r8a7795";
475 reg = <0 0xfd960000 0 0x1000>; 559 reg = <0 0xfd960000 0 0x1000>;
@@ -798,7 +882,7 @@
798 clocks = <&cpg CPG_MOD 812>; 882 clocks = <&cpg CPG_MOD 812>;
799 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 883 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
800 resets = <&cpg 812>; 884 resets = <&cpg 812>;
801 phy-mode = "rgmii-txid"; 885 phy-mode = "rgmii";
802 iommus = <&ipmmu_ds0 16>; 886 iommus = <&ipmmu_ds0 16>;
803 #address-cells = <1>; 887 #address-cells = <1>;
804 #size-cells = <0>; 888 #size-cells = <0>;
@@ -992,8 +1076,9 @@
992 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1076 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
993 <&scif_clk>; 1077 <&scif_clk>;
994 clock-names = "fck", "brg_int", "scif_clk"; 1078 clock-names = "fck", "brg_int", "scif_clk";
995 dmas = <&dmac1 0x31>, <&dmac1 0x30>; 1079 dmas = <&dmac1 0x31>, <&dmac1 0x30>,
996 dma-names = "tx", "rx"; 1080 <&dmac2 0x31>, <&dmac2 0x30>;
1081 dma-names = "tx", "rx", "tx", "rx";
997 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1082 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
998 resets = <&cpg 520>; 1083 resets = <&cpg 520>;
999 status = "disabled"; 1084 status = "disabled";
@@ -1009,8 +1094,9 @@
1009 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1094 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1010 <&scif_clk>; 1095 <&scif_clk>;
1011 clock-names = "fck", "brg_int", "scif_clk"; 1096 clock-names = "fck", "brg_int", "scif_clk";
1012 dmas = <&dmac1 0x33>, <&dmac1 0x32>; 1097 dmas = <&dmac1 0x33>, <&dmac1 0x32>,
1013 dma-names = "tx", "rx"; 1098 <&dmac2 0x33>, <&dmac2 0x32>;
1099 dma-names = "tx", "rx", "tx", "rx";
1014 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1100 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1015 resets = <&cpg 519>; 1101 resets = <&cpg 519>;
1016 status = "disabled"; 1102 status = "disabled";
@@ -1026,8 +1112,9 @@
1026 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1112 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1027 <&scif_clk>; 1113 <&scif_clk>;
1028 clock-names = "fck", "brg_int", "scif_clk"; 1114 clock-names = "fck", "brg_int", "scif_clk";
1029 dmas = <&dmac1 0x35>, <&dmac1 0x34>; 1115 dmas = <&dmac1 0x35>, <&dmac1 0x34>,
1030 dma-names = "tx", "rx"; 1116 <&dmac2 0x35>, <&dmac2 0x34>;
1117 dma-names = "tx", "rx", "tx", "rx";
1031 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1118 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1032 resets = <&cpg 518>; 1119 resets = <&cpg 518>;
1033 status = "disabled"; 1120 status = "disabled";
@@ -1138,8 +1225,9 @@
1138 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1225 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1139 <&scif_clk>; 1226 <&scif_clk>;
1140 clock-names = "fck", "brg_int", "scif_clk"; 1227 clock-names = "fck", "brg_int", "scif_clk";
1141 dmas = <&dmac1 0x51>, <&dmac1 0x50>; 1228 dmas = <&dmac1 0x51>, <&dmac1 0x50>,
1142 dma-names = "tx", "rx"; 1229 <&dmac2 0x51>, <&dmac2 0x50>;
1230 dma-names = "tx", "rx", "tx", "rx";
1143 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1231 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1144 resets = <&cpg 207>; 1232 resets = <&cpg 207>;
1145 status = "disabled"; 1233 status = "disabled";
@@ -1154,8 +1242,9 @@
1154 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1242 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1155 <&scif_clk>; 1243 <&scif_clk>;
1156 clock-names = "fck", "brg_int", "scif_clk"; 1244 clock-names = "fck", "brg_int", "scif_clk";
1157 dmas = <&dmac1 0x53>, <&dmac1 0x52>; 1245 dmas = <&dmac1 0x53>, <&dmac1 0x52>,
1158 dma-names = "tx", "rx"; 1246 <&dmac2 0x53>, <&dmac2 0x52>;
1247 dma-names = "tx", "rx", "tx", "rx";
1159 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1248 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1160 resets = <&cpg 206>; 1249 resets = <&cpg 206>;
1161 status = "disabled"; 1250 status = "disabled";
@@ -1170,8 +1259,9 @@
1170 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1259 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1171 <&scif_clk>; 1260 <&scif_clk>;
1172 clock-names = "fck", "brg_int", "scif_clk"; 1261 clock-names = "fck", "brg_int", "scif_clk";
1173 dmas = <&dmac1 0x13>, <&dmac1 0x12>; 1262 dmas = <&dmac1 0x13>, <&dmac1 0x12>,
1174 dma-names = "tx", "rx"; 1263 <&dmac2 0x13>, <&dmac2 0x12>;
1264 dma-names = "tx", "rx", "tx", "rx";
1175 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1265 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1176 resets = <&cpg 310>; 1266 resets = <&cpg 310>;
1177 status = "disabled"; 1267 status = "disabled";
@@ -1218,8 +1308,9 @@
1218 <&cpg CPG_CORE R8A7795_CLK_S3D1>, 1308 <&cpg CPG_CORE R8A7795_CLK_S3D1>,
1219 <&scif_clk>; 1309 <&scif_clk>;
1220 clock-names = "fck", "brg_int", "scif_clk"; 1310 clock-names = "fck", "brg_int", "scif_clk";
1221 dmas = <&dmac1 0x5b>, <&dmac1 0x5a>; 1311 dmas = <&dmac1 0x5b>, <&dmac1 0x5a>,
1222 dma-names = "tx", "rx"; 1312 <&dmac2 0x5b>, <&dmac2 0x5a>;
1313 dma-names = "tx", "rx", "tx", "rx";
1223 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1314 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1224 resets = <&cpg 202>; 1315 resets = <&cpg 202>;
1225 status = "disabled"; 1316 status = "disabled";
@@ -1251,8 +1342,9 @@
1251 clocks = <&cpg CPG_MOD 931>; 1342 clocks = <&cpg CPG_MOD 931>;
1252 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1343 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1253 resets = <&cpg 931>; 1344 resets = <&cpg 931>;
1254 dmas = <&dmac1 0x91>, <&dmac1 0x90>; 1345 dmas = <&dmac1 0x91>, <&dmac1 0x90>,
1255 dma-names = "tx", "rx"; 1346 <&dmac2 0x91>, <&dmac2 0x90>;
1347 dma-names = "tx", "rx", "tx", "rx";
1256 i2c-scl-internal-delay-ns = <110>; 1348 i2c-scl-internal-delay-ns = <110>;
1257 status = "disabled"; 1349 status = "disabled";
1258 }; 1350 };
@@ -1267,8 +1359,9 @@
1267 clocks = <&cpg CPG_MOD 930>; 1359 clocks = <&cpg CPG_MOD 930>;
1268 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1360 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1269 resets = <&cpg 930>; 1361 resets = <&cpg 930>;
1270 dmas = <&dmac1 0x93>, <&dmac1 0x92>; 1362 dmas = <&dmac1 0x93>, <&dmac1 0x92>,
1271 dma-names = "tx", "rx"; 1363 <&dmac2 0x93>, <&dmac2 0x92>;
1364 dma-names = "tx", "rx", "tx", "rx";
1272 i2c-scl-internal-delay-ns = <6>; 1365 i2c-scl-internal-delay-ns = <6>;
1273 status = "disabled"; 1366 status = "disabled";
1274 }; 1367 };
@@ -1283,8 +1376,9 @@
1283 clocks = <&cpg CPG_MOD 929>; 1376 clocks = <&cpg CPG_MOD 929>;
1284 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 1377 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
1285 resets = <&cpg 929>; 1378 resets = <&cpg 929>;
1286 dmas = <&dmac1 0x95>, <&dmac1 0x94>; 1379 dmas = <&dmac1 0x95>, <&dmac1 0x94>,
1287 dma-names = "tx", "rx"; 1380 <&dmac2 0x95>, <&dmac2 0x94>;
1381 dma-names = "tx", "rx", "tx", "rx";
1288 i2c-scl-internal-delay-ns = <6>; 1382 i2c-scl-internal-delay-ns = <6>;
1289 status = "disabled"; 1383 status = "disabled";
1290 }; 1384 };
@@ -2143,7 +2237,7 @@
2143 2237
2144 vspd0: vsp@fea20000 { 2238 vspd0: vsp@fea20000 {
2145 compatible = "renesas,vsp2"; 2239 compatible = "renesas,vsp2";
2146 reg = <0 0xfea20000 0 0x4000>; 2240 reg = <0 0xfea20000 0 0x8000>;
2147 interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>; 2241 interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>;
2148 clocks = <&cpg CPG_MOD 623>; 2242 clocks = <&cpg CPG_MOD 623>;
2149 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 2243 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
@@ -2163,7 +2257,7 @@
2163 2257
2164 vspd1: vsp@fea28000 { 2258 vspd1: vsp@fea28000 {
2165 compatible = "renesas,vsp2"; 2259 compatible = "renesas,vsp2";
2166 reg = <0 0xfea28000 0 0x4000>; 2260 reg = <0 0xfea28000 0 0x8000>;
2167 interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>; 2261 interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>;
2168 clocks = <&cpg CPG_MOD 622>; 2262 clocks = <&cpg CPG_MOD 622>;
2169 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 2263 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
@@ -2183,7 +2277,7 @@
2183 2277
2184 vspd2: vsp@fea30000 { 2278 vspd2: vsp@fea30000 {
2185 compatible = "renesas,vsp2"; 2279 compatible = "renesas,vsp2";
2186 reg = <0 0xfea30000 0 0x4000>; 2280 reg = <0 0xfea30000 0 0x8000>;
2187 interrupts = <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>; 2281 interrupts = <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>;
2188 clocks = <&cpg CPG_MOD 621>; 2282 clocks = <&cpg CPG_MOD 621>;
2189 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; 2283 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
@@ -2320,9 +2414,9 @@
2320 2414
2321 tsc: thermal@e6198000 { 2415 tsc: thermal@e6198000 {
2322 compatible = "renesas,r8a7795-thermal"; 2416 compatible = "renesas,r8a7795-thermal";
2323 reg = <0 0xe6198000 0 0x68>, 2417 reg = <0 0xe6198000 0 0x100>,
2324 <0 0xe61a0000 0 0x5c>, 2418 <0 0xe61a0000 0 0x100>,
2325 <0 0xe61a8000 0 0x5c>; 2419 <0 0xe61a8000 0 0x100>;
2326 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, 2420 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
2327 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, 2421 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
2328 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; 2422 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
@@ -2357,12 +2451,24 @@
2357 thermal-sensors = <&tsc 0>; 2451 thermal-sensors = <&tsc 0>;
2358 2452
2359 trips { 2453 trips {
2454 sensor1_passive: sensor1-passive {
2455 temperature = <95000>;
2456 hysteresis = <2000>;
2457 type = "passive";
2458 };
2360 sensor1_crit: sensor1-crit { 2459 sensor1_crit: sensor1-crit {
2361 temperature = <120000>; 2460 temperature = <120000>;
2362 hysteresis = <2000>; 2461 hysteresis = <2000>;
2363 type = "critical"; 2462 type = "critical";
2364 }; 2463 };
2365 }; 2464 };
2465
2466 cooling-maps {
2467 map0 {
2468 trip = <&sensor1_passive>;
2469 cooling-device = <&a57_0 4 4>;
2470 };
2471 };
2366 }; 2472 };
2367 2473
2368 sensor_thermal2: sensor-thermal2 { 2474 sensor_thermal2: sensor-thermal2 {
@@ -2371,12 +2477,24 @@
2371 thermal-sensors = <&tsc 1>; 2477 thermal-sensors = <&tsc 1>;
2372 2478
2373 trips { 2479 trips {
2480 sensor2_passive: sensor2-passive {
2481 temperature = <95000>;
2482 hysteresis = <2000>;
2483 type = "passive";
2484 };
2374 sensor2_crit: sensor2-crit { 2485 sensor2_crit: sensor2-crit {
2375 temperature = <120000>; 2486 temperature = <120000>;
2376 hysteresis = <2000>; 2487 hysteresis = <2000>;
2377 type = "critical"; 2488 type = "critical";
2378 }; 2489 };
2379 }; 2490 };
2491
2492 cooling-maps {
2493 map0 {
2494 trip = <&sensor2_passive>;
2495 cooling-device = <&a57_0 4 4>;
2496 };
2497 };
2380 }; 2498 };
2381 2499
2382 sensor_thermal3: sensor-thermal3 { 2500 sensor_thermal3: sensor-thermal3 {
@@ -2385,12 +2503,24 @@
2385 thermal-sensors = <&tsc 2>; 2503 thermal-sensors = <&tsc 2>;
2386 2504
2387 trips { 2505 trips {
2506 sensor3_passive: sensor3-passive {
2507 temperature = <95000>;
2508 hysteresis = <2000>;
2509 type = "passive";
2510 };
2388 sensor3_crit: sensor3-crit { 2511 sensor3_crit: sensor3-crit {
2389 temperature = <120000>; 2512 temperature = <120000>;
2390 hysteresis = <2000>; 2513 hysteresis = <2000>;
2391 type = "critical"; 2514 type = "critical";
2392 }; 2515 };
2393 }; 2516 };
2517
2518 cooling-maps {
2519 map0 {
2520 trip = <&sensor3_passive>;
2521 cooling-device = <&a57_0 4 4>;
2522 };
2523 };
2394 }; 2524 };
2395 }; 2525 };
2396 2526
diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index c5192d513d7d..556eb8e45499 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -71,6 +71,9 @@
71 power-domains = <&sysc R8A7796_PD_CA57_CPU0>; 71 power-domains = <&sysc R8A7796_PD_CA57_CPU0>;
72 next-level-cache = <&L2_CA57>; 72 next-level-cache = <&L2_CA57>;
73 enable-method = "psci"; 73 enable-method = "psci";
74 clocks =<&cpg CPG_CORE R8A7796_CLK_Z>;
75 operating-points-v2 = <&cluster0_opp>;
76 #cooling-cells = <2>;
74 }; 77 };
75 78
76 a57_1: cpu@1 { 79 a57_1: cpu@1 {
@@ -80,6 +83,9 @@
80 power-domains = <&sysc R8A7796_PD_CA57_CPU1>; 83 power-domains = <&sysc R8A7796_PD_CA57_CPU1>;
81 next-level-cache = <&L2_CA57>; 84 next-level-cache = <&L2_CA57>;
82 enable-method = "psci"; 85 enable-method = "psci";
86 clocks =<&cpg CPG_CORE R8A7796_CLK_Z>;
87 operating-points-v2 = <&cluster0_opp>;
88 #cooling-cells = <2>;
83 }; 89 };
84 90
85 a53_0: cpu@100 { 91 a53_0: cpu@100 {
@@ -89,6 +95,8 @@
89 power-domains = <&sysc R8A7796_PD_CA53_CPU0>; 95 power-domains = <&sysc R8A7796_PD_CA53_CPU0>;
90 next-level-cache = <&L2_CA53>; 96 next-level-cache = <&L2_CA53>;
91 enable-method = "psci"; 97 enable-method = "psci";
98 clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
99 operating-points-v2 = <&cluster1_opp>;
92 }; 100 };
93 101
94 a53_1: cpu@101 { 102 a53_1: cpu@101 {
@@ -98,6 +106,8 @@
98 power-domains = <&sysc R8A7796_PD_CA53_CPU1>; 106 power-domains = <&sysc R8A7796_PD_CA53_CPU1>;
99 next-level-cache = <&L2_CA53>; 107 next-level-cache = <&L2_CA53>;
100 enable-method = "psci"; 108 enable-method = "psci";
109 clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
110 operating-points-v2 = <&cluster1_opp>;
101 }; 111 };
102 112
103 a53_2: cpu@102 { 113 a53_2: cpu@102 {
@@ -107,6 +117,8 @@
107 power-domains = <&sysc R8A7796_PD_CA53_CPU2>; 117 power-domains = <&sysc R8A7796_PD_CA53_CPU2>;
108 next-level-cache = <&L2_CA53>; 118 next-level-cache = <&L2_CA53>;
109 enable-method = "psci"; 119 enable-method = "psci";
120 clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
121 operating-points-v2 = <&cluster1_opp>;
110 }; 122 };
111 123
112 a53_3: cpu@103 { 124 a53_3: cpu@103 {
@@ -116,6 +128,8 @@
116 power-domains = <&sysc R8A7796_PD_CA53_CPU3>; 128 power-domains = <&sysc R8A7796_PD_CA53_CPU3>;
117 next-level-cache = <&L2_CA53>; 129 next-level-cache = <&L2_CA53>;
118 enable-method = "psci"; 130 enable-method = "psci";
131 clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
132 operating-points-v2 = <&cluster1_opp>;
119 }; 133 };
120 134
121 L2_CA57: cache-controller-0 { 135 L2_CA57: cache-controller-0 {
@@ -147,6 +161,72 @@
147 clock-frequency = <0>; 161 clock-frequency = <0>;
148 }; 162 };
149 163
164 cluster0_opp: opp_table0 {
165 compatible = "operating-points-v2";
166 opp-shared;
167
168 opp-500000000 {
169 opp-hz = /bits/ 64 <500000000>;
170 opp-microvolt = <820000>;
171 clock-latency-ns = <300000>;
172 };
173 opp-1000000000 {
174 opp-hz = /bits/ 64 <1000000000>;
175 opp-microvolt = <820000>;
176 clock-latency-ns = <300000>;
177 };
178 opp-1500000000 {
179 opp-hz = /bits/ 64 <1500000000>;
180 opp-microvolt = <820000>;
181 clock-latency-ns = <300000>;
182 };
183 opp-1600000000 {
184 opp-hz = /bits/ 64 <1600000000>;
185 opp-microvolt = <900000>;
186 clock-latency-ns = <300000>;
187 turbo-mode;
188 };
189 opp-1700000000 {
190 opp-hz = /bits/ 64 <1700000000>;
191 opp-microvolt = <900000>;
192 clock-latency-ns = <300000>;
193 turbo-mode;
194 };
195 opp-1800000000 {
196 opp-hz = /bits/ 64 <1800000000>;
197 opp-microvolt = <960000>;
198 clock-latency-ns = <300000>;
199 turbo-mode;
200 };
201 };
202
203 cluster1_opp: opp_table1 {
204 compatible = "operating-points-v2";
205 opp-shared;
206
207 opp-800000000 {
208 opp-hz = /bits/ 64 <800000000>;
209 opp-microvolt = <820000>;
210 clock-latency-ns = <300000>;
211 };
212 opp-1000000000 {
213 opp-hz = /bits/ 64 <1000000000>;
214 opp-microvolt = <820000>;
215 clock-latency-ns = <300000>;
216 };
217 opp-1200000000 {
218 opp-hz = /bits/ 64 <1200000000>;
219 opp-microvolt = <820000>;
220 clock-latency-ns = <300000>;
221 };
222 opp-1300000000 {
223 opp-hz = /bits/ 64 <1300000000>;
224 opp-microvolt = <820000>;
225 clock-latency-ns = <300000>;
226 turbo-mode;
227 };
228 };
229
150 /* External PCIe clock - can be overridden by the board */ 230 /* External PCIe clock - can be overridden by the board */
151 pcie_bus_clk: pcie_bus { 231 pcie_bus_clk: pcie_bus {
152 compatible = "fixed-clock"; 232 compatible = "fixed-clock";
@@ -894,7 +974,7 @@
894 clocks = <&cpg CPG_MOD 812>; 974 clocks = <&cpg CPG_MOD 812>;
895 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; 975 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
896 resets = <&cpg 812>; 976 resets = <&cpg 812>;
897 phy-mode = "rgmii-txid"; 977 phy-mode = "rgmii";
898 iommus = <&ipmmu_ds0 16>; 978 iommus = <&ipmmu_ds0 16>;
899 #address-cells = <1>; 979 #address-cells = <1>;
900 #size-cells = <0>; 980 #size-cells = <0>;
@@ -1561,9 +1641,9 @@
1561 1641
1562 tsc: thermal@e6198000 { 1642 tsc: thermal@e6198000 {
1563 compatible = "renesas,r8a7796-thermal"; 1643 compatible = "renesas,r8a7796-thermal";
1564 reg = <0 0xe6198000 0 0x68>, 1644 reg = <0 0xe6198000 0 0x100>,
1565 <0 0xe61a0000 0 0x5c>, 1645 <0 0xe61a0000 0 0x100>,
1566 <0 0xe61a8000 0 0x5c>; 1646 <0 0xe61a8000 0 0x100>;
1567 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, 1647 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
1568 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, 1648 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
1569 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; 1649 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
@@ -1839,7 +1919,7 @@
1839 1919
1840 vspd0: vsp@fea20000 { 1920 vspd0: vsp@fea20000 {
1841 compatible = "renesas,vsp2"; 1921 compatible = "renesas,vsp2";
1842 reg = <0 0xfea20000 0 0x4000>; 1922 reg = <0 0xfea20000 0 0x8000>;
1843 interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>; 1923 interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>;
1844 clocks = <&cpg CPG_MOD 623>; 1924 clocks = <&cpg CPG_MOD 623>;
1845 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; 1925 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
@@ -1859,7 +1939,7 @@
1859 1939
1860 vspd1: vsp@fea28000 { 1940 vspd1: vsp@fea28000 {
1861 compatible = "renesas,vsp2"; 1941 compatible = "renesas,vsp2";
1862 reg = <0 0xfea28000 0 0x4000>; 1942 reg = <0 0xfea28000 0 0x8000>;
1863 interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>; 1943 interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>;
1864 clocks = <&cpg CPG_MOD 622>; 1944 clocks = <&cpg CPG_MOD 622>;
1865 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; 1945 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
@@ -1879,7 +1959,7 @@
1879 1959
1880 vspd2: vsp@fea30000 { 1960 vspd2: vsp@fea30000 {
1881 compatible = "renesas,vsp2"; 1961 compatible = "renesas,vsp2";
1882 reg = <0 0xfea30000 0 0x4000>; 1962 reg = <0 0xfea30000 0 0x8000>;
1883 interrupts = <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>; 1963 interrupts = <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>;
1884 clocks = <&cpg CPG_MOD 621>; 1964 clocks = <&cpg CPG_MOD 621>;
1885 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; 1965 power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
@@ -1998,12 +2078,24 @@
1998 thermal-sensors = <&tsc 0>; 2078 thermal-sensors = <&tsc 0>;
1999 2079
2000 trips { 2080 trips {
2081 sensor1_passive: sensor1-passive {
2082 temperature = <95000>;
2083 hysteresis = <2000>;
2084 type = "passive";
2085 };
2001 sensor1_crit: sensor1-crit { 2086 sensor1_crit: sensor1-crit {
2002 temperature = <120000>; 2087 temperature = <120000>;
2003 hysteresis = <2000>; 2088 hysteresis = <2000>;
2004 type = "critical"; 2089 type = "critical";
2005 }; 2090 };
2006 }; 2091 };
2092
2093 cooling-maps {
2094 map0 {
2095 trip = <&sensor1_passive>;
2096 cooling-device = <&a57_0 5 5>;
2097 };
2098 };
2007 }; 2099 };
2008 2100
2009 sensor_thermal2: sensor-thermal2 { 2101 sensor_thermal2: sensor-thermal2 {
@@ -2012,12 +2104,24 @@
2012 thermal-sensors = <&tsc 1>; 2104 thermal-sensors = <&tsc 1>;
2013 2105
2014 trips { 2106 trips {
2107 sensor2_passive: sensor2-passive {
2108 temperature = <95000>;
2109 hysteresis = <2000>;
2110 type = "passive";
2111 };
2015 sensor2_crit: sensor2-crit { 2112 sensor2_crit: sensor2-crit {
2016 temperature = <120000>; 2113 temperature = <120000>;
2017 hysteresis = <2000>; 2114 hysteresis = <2000>;
2018 type = "critical"; 2115 type = "critical";
2019 }; 2116 };
2020 }; 2117 };
2118
2119 cooling-maps {
2120 map0 {
2121 trip = <&sensor2_passive>;
2122 cooling-device = <&a57_0 5 5>;
2123 };
2124 };
2021 }; 2125 };
2022 2126
2023 sensor_thermal3: sensor-thermal3 { 2127 sensor_thermal3: sensor-thermal3 {
@@ -2026,12 +2130,24 @@
2026 thermal-sensors = <&tsc 2>; 2130 thermal-sensors = <&tsc 2>;
2027 2131
2028 trips { 2132 trips {
2133 sensor3_passive: sensor3-passive {
2134 temperature = <95000>;
2135 hysteresis = <2000>;
2136 type = "passive";
2137 };
2029 sensor3_crit: sensor3-crit { 2138 sensor3_crit: sensor3-crit {
2030 temperature = <120000>; 2139 temperature = <120000>;
2031 hysteresis = <2000>; 2140 hysteresis = <2000>;
2032 type = "critical"; 2141 type = "critical";
2033 }; 2142 };
2034 }; 2143 };
2144
2145 cooling-maps {
2146 map0 {
2147 trip = <&sensor3_passive>;
2148 cooling-device = <&a57_0 5 5>;
2149 };
2150 };
2035 }; 2151 };
2036 }; 2152 };
2037 2153
diff --git a/arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dts
new file mode 100644
index 000000000000..75d890d91df9
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dts
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Salvator-X board with R-Car M3-N
4 *
5 * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
6 */
7
8/dts-v1/;
9#include "r8a77965.dtsi"
10#include "salvator-x.dtsi"
11
12/ {
13 model = "Renesas Salvator-X board based on r8a77965";
14 compatible = "renesas,salvator-x", "renesas,r8a77965";
15
16 memory@48000000 {
17 device_type = "memory";
18 /* first 128MB is reserved for secure area. */
19 reg = <0x0 0x48000000 0x0 0x78000000>;
20 };
21};
diff --git a/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
new file mode 100644
index 000000000000..a83a00deed9e
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77965-salvator-xs.dts
@@ -0,0 +1,21 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Salvator-X 2nd version board with R-Car M3-N
4 *
5 * Copyright (C) 2017 Renesas Electronics Corp.
6 */
7
8/dts-v1/;
9#include "r8a77965.dtsi"
10#include "salvator-xs.dtsi"
11
12/ {
13 model = "Renesas Salvator-X 2nd version board based on r8a77965";
14 compatible = "renesas,salvator-xs", "renesas,r8a77965";
15
16 memory@48000000 {
17 device_type = "memory";
18 /* first 128MB is reserved for secure area. */
19 reg = <0x0 0x48000000 0x0 0x78000000>;
20 };
21};
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
new file mode 100644
index 000000000000..f0871fcdd984
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -0,0 +1,878 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the r8a77965 SoC
4 *
5 * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
6 *
7 * Based on r8a7796.dtsi
8 * Copyright (C) 2016 Renesas Electronics Corp.
9 */
10
11#include <dt-bindings/clock/renesas-cpg-mssr.h>
12#include <dt-bindings/interrupt-controller/arm-gic.h>
13
14#define CPG_AUDIO_CLK_I 10
15
16/ {
17 compatible = "renesas,r8a77965";
18 #address-cells = <2>;
19 #size-cells = <2>;
20
21 aliases {
22 i2c7 = &i2c_dvfs;
23 };
24
25 psci {
26 compatible = "arm,psci-1.0", "arm,psci-0.2";
27 method = "smc";
28 };
29
30 cpus {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 a57_0: cpu@0 {
35 compatible = "arm,cortex-a57", "arm,armv8";
36 reg = <0x0>;
37 device_type = "cpu";
38 power-domains = <&sysc 0>;
39 next-level-cache = <&L2_CA57>;
40 enable-method = "psci";
41 };
42
43 a57_1: cpu@1 {
44 compatible = "arm,cortex-a57","arm,armv8";
45 reg = <0x1>;
46 device_type = "cpu";
47 power-domains = <&sysc 1>;
48 next-level-cache = <&L2_CA57>;
49 enable-method = "psci";
50 };
51
52 L2_CA57: cache-controller-0 {
53 compatible = "cache";
54 power-domains = <&sysc 12>;
55 cache-unified;
56 cache-level = <2>;
57 };
58 };
59
60 extal_clk: extal {
61 compatible = "fixed-clock";
62 #clock-cells = <0>;
63 /* This value must be overridden by the board */
64 clock-frequency = <0>;
65 };
66
67 extalr_clk: extalr {
68 compatible = "fixed-clock";
69 #clock-cells = <0>;
70 /* This value must be overridden by the board */
71 clock-frequency = <0>;
72 };
73
74 /*
75 * The external audio clocks are configured as 0 Hz fixed frequency
76 * clocks by default.
77 * Boards that provide audio clocks should override them.
78 */
79 audio_clk_a: audio_clk_a {
80 compatible = "fixed-clock";
81 #clock-cells = <0>;
82 clock-frequency = <0>;
83 };
84
85 audio_clk_b: audio_clk_b {
86 compatible = "fixed-clock";
87 #clock-cells = <0>;
88 clock-frequency = <0>;
89 };
90
91 audio_clk_c: audio_clk_c {
92 compatible = "fixed-clock";
93 #clock-cells = <0>;
94 clock-frequency = <0>;
95 };
96
97 /* External CAN clock - to be overridden by boards that provide it */
98 can_clk: can {
99 compatible = "fixed-clock";
100 #clock-cells = <0>;
101 clock-frequency = <0>;
102 };
103
104 /* External SCIF clock - to be overridden by boards that provide it */
105 scif_clk: scif {
106 compatible = "fixed-clock";
107 #clock-cells = <0>;
108 clock-frequency = <0>;
109 };
110
111 /* External PCIe clock - can be overridden by the board */
112 pcie_bus_clk: pcie_bus {
113 compatible = "fixed-clock";
114 #clock-cells = <0>;
115 clock-frequency = <0>;
116 };
117
118 /* External USB clocks - can be overridden by the board */
119 usb3s0_clk: usb3s0 {
120 compatible = "fixed-clock";
121 #clock-cells = <0>;
122 clock-frequency = <0>;
123 };
124
125 usb_extal_clk: usb_extal {
126 compatible = "fixed-clock";
127 #clock-cells = <0>;
128 clock-frequency = <0>;
129 };
130
131 timer {
132 compatible = "arm,armv8-timer";
133 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
134 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
135 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
136 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
137 };
138
139 pmu_a57 {
140 compatible = "arm,cortex-a57-pmu";
141 interrupts-extended = <&gic GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
142 <&gic GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
143 interrupt-affinity = <&a57_0>,
144 <&a57_1>;
145 };
146
147 soc {
148 compatible = "simple-bus";
149 interrupt-parent = <&gic>;
150 #address-cells = <2>;
151 #size-cells = <2>;
152 ranges;
153
154 gic: interrupt-controller@f1010000 {
155 compatible = "arm,gic-400";
156 #interrupt-cells = <3>;
157 #address-cells = <0>;
158 interrupt-controller;
159 reg = <0x0 0xf1010000 0 0x1000>,
160 <0x0 0xf1020000 0 0x20000>,
161 <0x0 0xf1040000 0 0x20000>,
162 <0x0 0xf1060000 0 0x20000>;
163 interrupts = <GIC_PPI 9
164 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
165 clocks = <&cpg CPG_MOD 408>;
166 clock-names = "clk";
167 power-domains = <&sysc 32>;
168 resets = <&cpg 408>;
169 };
170
171 pfc: pin-controller@e6060000 {
172 compatible = "renesas,pfc-r8a77965";
173 reg = <0 0xe6060000 0 0x50c>;
174 };
175
176 cpg: clock-controller@e6150000 {
177 compatible = "renesas,r8a77965-cpg-mssr";
178 reg = <0 0xe6150000 0 0x1000>;
179 clocks = <&extal_clk>, <&extalr_clk>;
180 clock-names = "extal", "extalr";
181 #clock-cells = <2>;
182 #power-domain-cells = <0>;
183 #reset-cells = <1>;
184 };
185
186 rst: reset-controller@e6160000 {
187 compatible = "renesas,r8a77965-rst";
188 reg = <0 0xe6160000 0 0x0200>;
189 };
190
191 prr: chipid@fff00044 {
192 compatible = "renesas,prr";
193 reg = <0 0xfff00044 0 4>;
194 };
195
196 sysc: system-controller@e6180000 {
197 compatible = "renesas,r8a77965-sysc";
198 reg = <0 0xe6180000 0 0x0400>;
199 #power-domain-cells = <1>;
200 };
201
202 gpio0: gpio@e6050000 {
203 compatible = "renesas,gpio-r8a77965",
204 "renesas,rcar-gen3-gpio";
205 reg = <0 0xe6050000 0 0x50>;
206 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
207 #gpio-cells = <2>;
208 gpio-controller;
209 gpio-ranges = <&pfc 0 0 16>;
210 #interrupt-cells = <2>;
211 interrupt-controller;
212 clocks = <&cpg CPG_MOD 912>;
213 power-domains = <&sysc 32>;
214 resets = <&cpg 912>;
215 };
216
217 gpio1: gpio@e6051000 {
218 compatible = "renesas,gpio-r8a77965",
219 "renesas,rcar-gen3-gpio";
220 reg = <0 0xe6051000 0 0x50>;
221 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
222 #gpio-cells = <2>;
223 gpio-controller;
224 gpio-ranges = <&pfc 0 32 29>;
225 #interrupt-cells = <2>;
226 interrupt-controller;
227 clocks = <&cpg CPG_MOD 911>;
228 power-domains = <&sysc 32>;
229 resets = <&cpg 911>;
230 };
231
232 gpio2: gpio@e6052000 {
233 compatible = "renesas,gpio-r8a77965",
234 "renesas,rcar-gen3-gpio";
235 reg = <0 0xe6052000 0 0x50>;
236 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
237 #gpio-cells = <2>;
238 gpio-controller;
239 gpio-ranges = <&pfc 0 64 15>;
240 #interrupt-cells = <2>;
241 interrupt-controller;
242 clocks = <&cpg CPG_MOD 910>;
243 power-domains = <&sysc 32>;
244 resets = <&cpg 910>;
245 };
246
247 gpio3: gpio@e6053000 {
248 compatible = "renesas,gpio-r8a77965",
249 "renesas,rcar-gen3-gpio";
250 reg = <0 0xe6053000 0 0x50>;
251 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
252 #gpio-cells = <2>;
253 gpio-controller;
254 gpio-ranges = <&pfc 0 96 16>;
255 #interrupt-cells = <2>;
256 interrupt-controller;
257 clocks = <&cpg CPG_MOD 909>;
258 power-domains = <&sysc 32>;
259 resets = <&cpg 909>;
260 };
261
262 gpio4: gpio@e6054000 {
263 compatible = "renesas,gpio-r8a77965",
264 "renesas,rcar-gen3-gpio";
265 reg = <0 0xe6054000 0 0x50>;
266 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
267 #gpio-cells = <2>;
268 gpio-controller;
269 gpio-ranges = <&pfc 0 128 18>;
270 #interrupt-cells = <2>;
271 interrupt-controller;
272 clocks = <&cpg CPG_MOD 908>;
273 power-domains = <&sysc 32>;
274 resets = <&cpg 908>;
275 };
276
277 gpio5: gpio@e6055000 {
278 compatible = "renesas,gpio-r8a77965",
279 "renesas,rcar-gen3-gpio";
280 reg = <0 0xe6055000 0 0x50>;
281 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
282 #gpio-cells = <2>;
283 gpio-controller;
284 gpio-ranges = <&pfc 0 160 26>;
285 #interrupt-cells = <2>;
286 interrupt-controller;
287 clocks = <&cpg CPG_MOD 907>;
288 power-domains = <&sysc 32>;
289 resets = <&cpg 907>;
290 };
291
292 gpio6: gpio@e6055400 {
293 compatible = "renesas,gpio-r8a77965",
294 "renesas,rcar-gen3-gpio";
295 reg = <0 0xe6055400 0 0x50>;
296 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
297 #gpio-cells = <2>;
298 gpio-controller;
299 gpio-ranges = <&pfc 0 192 32>;
300 #interrupt-cells = <2>;
301 interrupt-controller;
302 clocks = <&cpg CPG_MOD 906>;
303 power-domains = <&sysc 32>;
304 resets = <&cpg 906>;
305 };
306
307 gpio7: gpio@e6055800 {
308 compatible = "renesas,gpio-r8a77965",
309 "renesas,rcar-gen3-gpio";
310 reg = <0 0xe6055800 0 0x50>;
311 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
312 #gpio-cells = <2>;
313 gpio-controller;
314 gpio-ranges = <&pfc 0 224 4>;
315 #interrupt-cells = <2>;
316 interrupt-controller;
317 clocks = <&cpg CPG_MOD 905>;
318 power-domains = <&sysc 32>;
319 resets = <&cpg 905>;
320 };
321
322 intc_ex: interrupt-controller@e61c0000 {
323 compatible = "renesas,intc-ex-r8a77965", "renesas,irqc";
324 #interrupt-cells = <2>;
325 interrupt-controller;
326 reg = <0 0xe61c0000 0 0x200>;
327 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH
328 GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH
329 GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH
330 GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH
331 GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH
332 GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>;
333 clocks = <&cpg CPG_MOD 407>;
334 power-domains = <&sysc 32>;
335 resets = <&cpg 407>;
336 };
337
338 dmac0: dma-controller@e6700000 {
339 compatible = "renesas,dmac-r8a77965",
340 "renesas,rcar-dmac";
341 reg = <0 0xe6700000 0 0x10000>;
342 interrupts = <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH
343 GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
344 GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
345 GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
346 GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
347 GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
348 GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
349 GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
350 GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
351 GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
352 GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
353 GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
354 GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
355 GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
356 GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
357 GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH
358 GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>;
359 interrupt-names = "error",
360 "ch0", "ch1", "ch2", "ch3",
361 "ch4", "ch5", "ch6", "ch7",
362 "ch8", "ch9", "ch10", "ch11",
363 "ch12", "ch13", "ch14", "ch15";
364 clocks = <&cpg CPG_MOD 219>;
365 clock-names = "fck";
366 power-domains = <&sysc 32>;
367 resets = <&cpg 219>;
368 #dma-cells = <1>;
369 dma-channels = <16>;
370 };
371
372 dmac1: dma-controller@e7300000 {
373 compatible = "renesas,dmac-r8a77965",
374 "renesas,rcar-dmac";
375 reg = <0 0xe7300000 0 0x10000>;
376 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
377 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
378 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
379 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
380 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
381 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
382 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
383 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
384 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
385 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
386 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
387 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
388 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
389 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
390 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
391 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH
392 GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>;
393 interrupt-names = "error",
394 "ch0", "ch1", "ch2", "ch3",
395 "ch4", "ch5", "ch6", "ch7",
396 "ch8", "ch9", "ch10", "ch11",
397 "ch12", "ch13", "ch14", "ch15";
398 clocks = <&cpg CPG_MOD 218>;
399 clock-names = "fck";
400 power-domains = <&sysc 32>;
401 resets = <&cpg 218>;
402 #dma-cells = <1>;
403 dma-channels = <16>;
404 };
405
406 dmac2: dma-controller@e7310000 {
407 compatible = "renesas,dmac-r8a77965",
408 "renesas,rcar-dmac";
409 reg = <0 0xe7310000 0 0x10000>;
410 interrupts = <GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH
411 GIC_SPI 417 IRQ_TYPE_LEVEL_HIGH
412 GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH
413 GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH
414 GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH
415 GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH
416 GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH
417 GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH
418 GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH
419 GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH
420 GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH
421 GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH
422 GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH
423 GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH
424 GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH
425 GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH
426 GIC_SPI 397 IRQ_TYPE_LEVEL_HIGH>;
427 interrupt-names = "error",
428 "ch0", "ch1", "ch2", "ch3",
429 "ch4", "ch5", "ch6", "ch7",
430 "ch8", "ch9", "ch10", "ch11",
431 "ch12", "ch13", "ch14", "ch15";
432 clocks = <&cpg CPG_MOD 217>;
433 clock-names = "fck";
434 power-domains = <&sysc 32>;
435 resets = <&cpg 217>;
436 #dma-cells = <1>;
437 dma-channels = <16>;
438 };
439
440 scif0: serial@e6e60000 {
441 compatible = "renesas,scif-r8a77965",
442 "renesas,rcar-gen3-scif", "renesas,scif";
443 reg = <0 0xe6e60000 0 64>;
444 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
445 clocks = <&cpg CPG_MOD 207>,
446 <&cpg CPG_CORE 20>,
447 <&scif_clk>;
448 clock-names = "fck", "brg_int", "scif_clk";
449 dmas = <&dmac1 0x51>, <&dmac1 0x50>,
450 <&dmac2 0x51>, <&dmac2 0x50>;
451 dma-names = "tx", "rx", "tx", "rx";
452 power-domains = <&sysc 32>;
453 resets = <&cpg 207>;
454 status = "disabled";
455 };
456
457 scif1: serial@e6e68000 {
458 compatible = "renesas,scif-r8a77965",
459 "renesas,rcar-gen3-scif", "renesas,scif";
460 reg = <0 0xe6e68000 0 64>;
461 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
462 clocks = <&cpg CPG_MOD 206>,
463 <&cpg CPG_CORE 20>,
464 <&scif_clk>;
465 clock-names = "fck", "brg_int", "scif_clk";
466 dmas = <&dmac1 0x53>, <&dmac1 0x52>,
467 <&dmac2 0x53>, <&dmac2 0x52>;
468 dma-names = "tx", "rx", "tx", "rx";
469 power-domains = <&sysc 32>;
470 resets = <&cpg 206>;
471 status = "disabled";
472 };
473
474 scif2: serial@e6e88000 {
475 compatible = "renesas,scif-r8a77965",
476 "renesas,rcar-gen3-scif", "renesas,scif";
477 reg = <0 0xe6e88000 0 64>;
478 interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
479 clocks = <&cpg CPG_MOD 310>,
480 <&cpg CPG_CORE 20>,
481 <&scif_clk>;
482 clock-names = "fck", "brg_int", "scif_clk";
483 power-domains = <&sysc 32>;
484 resets = <&cpg 310>;
485 status = "disabled";
486 };
487
488 scif3: serial@e6c50000 {
489 compatible = "renesas,scif-r8a77965",
490 "renesas,rcar-gen3-scif", "renesas,scif";
491 reg = <0 0xe6c50000 0 64>;
492 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
493 clocks = <&cpg CPG_MOD 204>,
494 <&cpg CPG_CORE 20>,
495 <&scif_clk>;
496 clock-names = "fck", "brg_int", "scif_clk";
497 dmas = <&dmac0 0x57>, <&dmac0 0x56>;
498 dma-names = "tx", "rx";
499 power-domains = <&sysc 32>;
500 resets = <&cpg 204>;
501 status = "disabled";
502 };
503
504 scif4: serial@e6c40000 {
505 compatible = "renesas,scif-r8a77965",
506 "renesas,rcar-gen3-scif", "renesas,scif";
507 reg = <0 0xe6c40000 0 64>;
508 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
509 clocks = <&cpg CPG_MOD 203>,
510 <&cpg CPG_CORE 20>,
511 <&scif_clk>;
512 clock-names = "fck", "brg_int", "scif_clk";
513 dmas = <&dmac0 0x59>, <&dmac0 0x58>;
514 dma-names = "tx", "rx";
515 power-domains = <&sysc 32>;
516 resets = <&cpg 203>;
517 status = "disabled";
518 };
519
520 scif5: serial@e6f30000 {
521 compatible = "renesas,scif-r8a77965",
522 "renesas,rcar-gen3-scif", "renesas,scif";
523 reg = <0 0xe6f30000 0 64>;
524 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
525 clocks = <&cpg CPG_MOD 202>,
526 <&cpg CPG_CORE 20>,
527 <&scif_clk>;
528 clock-names = "fck", "brg_int", "scif_clk";
529 dmas = <&dmac1 0x5b>, <&dmac1 0x5a>,
530 <&dmac2 0x5b>, <&dmac2 0x5a>;
531 dma-names = "tx", "rx", "tx", "rx";
532 power-domains = <&sysc 32>;
533 resets = <&cpg 202>;
534 status = "disabled";
535 };
536
537 avb: ethernet@e6800000 {
538 compatible = "renesas,etheravb-r8a77965",
539 "renesas,etheravb-rcar-gen3";
540 reg = <0 0xe6800000 0 0x800>, <0 0xe6a00000 0 0x10000>;
541 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
542 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
543 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
544 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
545 <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
546 <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
547 <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
548 <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>,
549 <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
550 <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>,
551 <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
552 <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>,
553 <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
554 <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
555 <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
556 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
557 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
558 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
559 <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
560 <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
561 <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
562 <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
563 <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
564 <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,
565 <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
566 interrupt-names = "ch0", "ch1", "ch2", "ch3",
567 "ch4", "ch5", "ch6", "ch7",
568 "ch8", "ch9", "ch10", "ch11",
569 "ch12", "ch13", "ch14", "ch15",
570 "ch16", "ch17", "ch18", "ch19",
571 "ch20", "ch21", "ch22", "ch23",
572 "ch24";
573 clocks = <&cpg CPG_MOD 812>;
574 power-domains = <&sysc 32>;
575 resets = <&cpg 812>;
576 phy-mode = "rgmii";
577 #address-cells = <1>;
578 #size-cells = <0>;
579 status = "disabled";
580 };
581
582 csi20: csi2@fea80000 {
583 reg = <0 0xfea80000 0 0x10000>;
584 /* placeholder */
585
586 ports {
587 #address-cells = <1>;
588 #size-cells = <0>;
589 };
590 };
591
592 csi40: csi2@feaa0000 {
593 reg = <0 0xfeaa0000 0 0x10000>;
594 /* placeholder */
595
596 ports {
597 #address-cells = <1>;
598 #size-cells = <0>;
599 };
600 };
601
602 vin0: video@e6ef0000 {
603 reg = <0 0xe6ef0000 0 0x1000>;
604 /* placeholder */
605 };
606
607 vin1: video@e6ef1000 {
608 reg = <0 0xe6ef1000 0 0x1000>;
609 /* placeholder */
610 };
611
612 vin2: video@e6ef2000 {
613 reg = <0 0xe6ef2000 0 0x1000>;
614 /* placeholder */
615 };
616
617 vin3: video@e6ef3000 {
618 reg = <0 0xe6ef3000 0 0x1000>;
619 /* placeholder */
620 };
621
622 vin4: video@e6ef4000 {
623 reg = <0 0xe6ef4000 0 0x1000>;
624 /* placeholder */
625 };
626
627 vin5: video@e6ef5000 {
628 reg = <0 0xe6ef5000 0 0x1000>;
629 /* placeholder */
630 };
631
632 vin6: video@e6ef6000 {
633 reg = <0 0xe6ef6000 0 0x1000>;
634 /* placeholder */
635 };
636
637 vin7: video@e6ef7000 {
638 reg = <0 0xe6ef7000 0 0x1000>;
639 /* placeholder */
640 };
641
642 ohci0: usb@ee080000 {
643 reg = <0 0xee080000 0 0x100>;
644 /* placeholder */
645 };
646
647 ehci0: usb@ee080100 {
648 reg = <0 0xee080100 0 0x100>;
649 /* placeholder */
650 };
651
652 usb2_phy0: usb-phy@ee080200 {
653 reg = <0 0xee080200 0 0x700>;
654 /* placeholder */
655 };
656
657 usb2_phy1: usb-phy@ee0a0200 {
658 reg = <0 0xee0a0200 0 0x700>;
659 /* placeholder */
660 };
661
662 ohci1: usb@ee0a0000 {
663 reg = <0 0xee0a0000 0 0x100>;
664 /* placeholder */
665 };
666
667 ehci1: usb@ee0a0100 {
668 reg = <0 0xee0a0100 0 0x100>;
669 /* placeholder */
670 };
671
672 i2c0: i2c@e6500000 {
673 reg = <0 0xe6500000 0 0x40>;
674 /* placeholder */
675 };
676
677 i2c1: i2c@e6508000 {
678 reg = <0 0xe6508000 0 0x40>;
679 /* placeholder */
680 };
681
682 i2c2: i2c@e6510000 {
683 #address-cells = <1>;
684 #size-cells = <0>;
685
686 reg = <0 0xe6510000 0 0x40>;
687 /* placeholder */
688 };
689
690 i2c3: i2c@e66d0000 {
691 reg = <0 0xe66d0000 0 0x40>;
692 /* placeholder */
693 };
694
695 i2c4: i2c@e66d8000 {
696 #address-cells = <1>;
697 #size-cells = <0>;
698
699 reg = <0 0xe66d8000 0 0x40>;
700 /* placeholder */
701 };
702
703 i2c5: i2c@e66e0000 {
704 reg = <0 0xe66e0000 0 0x40>;
705 /* placeholder */
706 };
707
708 i2c6: i2c@e66e8000 {
709 reg = <0 0xe66e8000 0 0x40>;
710 /* placeholder */
711 };
712
713 i2c_dvfs: i2c@e60b0000 {
714 #address-cells = <1>;
715 #size-cells = <0>;
716 compatible = "renesas,iic-r8a77965",
717 "renesas,rcar-gen3-iic",
718 "renesas,rmobile-iic";
719 reg = <0 0xe60b0000 0 0x425>;
720 interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
721 clocks = <&cpg CPG_MOD 926>;
722 power-domains = <&sysc 32>;
723 resets = <&cpg 926>;
724 dmas = <&dmac0 0x11>, <&dmac0 0x10>;
725 dma-names = "tx", "rx";
726 status = "disabled";
727 };
728
729 pwm0: pwm@e6e30000 {
730 reg = <0 0xe6e30000 0 8>;
731 /* placeholder */
732 };
733
734 pwm1: pwm@e6e31000 {
735 reg = <0 0xe6e31000 0 8>;
736 #pwm-cells = <2>;
737 /* placeholder */
738 };
739
740 pwm2: pwm@e6e32000 {
741 reg = <0 0xe6e32000 0 8>;
742 /* placeholder */
743 };
744
745 pwm3: pwm@e6e33000 {
746 reg = <0 0xe6e33000 0 8>;
747 /* placeholder */
748 };
749
750 pwm4: pwm@e6e34000 {
751 reg = <0 0xe6e34000 0 8>;
752 /* placeholder */
753 };
754
755 pwm5: pwm@e6e35000 {
756 reg = <0 0xe6e35000 0 8>;
757 /* placeholder */
758 };
759
760 pwm6: pwm@e6e36000 {
761 reg = <0 0xe6e36000 0 8>;
762 /* placeholder */
763 };
764
765 du: display@feb00000 {
766 reg = <0 0xfeb00000 0 0x80000>,
767 <0 0xfeb90000 0 0x14>;
768 /* placeholder */
769
770 ports {
771 #address-cells = <1>;
772 #size-cells = <0>;
773
774 port@0 {
775 reg = <0>;
776 du_out_rgb: endpoint {
777 };
778 };
779 port@1 {
780 reg = <1>;
781 du_out_hdmi0: endpoint {
782 };
783 };
784 port@2 {
785 reg = <2>;
786 du_out_lvds0: endpoint {
787 };
788 };
789 };
790 };
791
792 hsusb: usb@e6590000 {
793 reg = <0 0xe6590000 0 0x100>;
794 /* placeholder */
795 };
796
797 pciec0: pcie@fe000000 {
798 reg = <0 0xfe000000 0 0x80000>;
799 /* placeholder */
800 };
801
802 pciec1: pcie@ee800000 {
803 reg = <0 0xee800000 0 0x80000>;
804 /* placeholder */
805 };
806
807 rcar_sound: sound@ec500000 {
808 reg = <0 0xec500000 0 0x1000>, /* SCU */
809 <0 0xec5a0000 0 0x100>, /* ADG */
810 <0 0xec540000 0 0x1000>, /* SSIU */
811 <0 0xec541000 0 0x280>, /* SSI */
812 <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
813 /* placeholder */
814
815 rcar_sound,dvc {
816 dvc0: dvc-0 {
817 };
818 dvc1: dvc-1 {
819 };
820 };
821
822 rcar_sound,src {
823 src0: src-0 {
824 };
825 src1: src-1 {
826 };
827 };
828
829 rcar_sound,ssi {
830 ssi0: ssi-0 {
831 };
832 ssi1: ssi-1 {
833 };
834 };
835 };
836
837 sdhi0: sd@ee100000 {
838 reg = <0 0xee100000 0 0x2000>;
839 /* placeholder */
840 };
841
842 sdhi1: sd@ee120000 {
843 reg = <0 0xee120000 0 0x2000>;
844 /* placeholder */
845 };
846
847 sdhi2: sd@ee140000 {
848 reg = <0 0xee140000 0 0x2000>;
849 /* placeholder */
850 };
851
852 sdhi3: sd@ee160000 {
853 reg = <0 0xee160000 0 0x2000>;
854 /* placeholder */
855 };
856
857 usb3_phy0: usb-phy@e65ee000 {
858 reg = <0 0xe65ee000 0 0x90>;
859 #phy-cells = <0>;
860 /* placeholder */
861 };
862
863 usb3_peri0: usb@ee020000 {
864 reg = <0 0xee020000 0 0x400>;
865 /* placeholder */
866 };
867
868 xhci0: usb@ee000000 {
869 reg = <0 0xee000000 0 0xc00>;
870 /* placeholder */
871 };
872
873 wdt0: watchdog@e6020000 {
874 reg = <0 0xe6020000 0 0x0c>;
875 /* placeholder */
876 };
877 };
878};
diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
index 8fe5c193e049..3c5f598c9766 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
@@ -36,11 +36,14 @@
36&avb { 36&avb {
37 renesas,no-ether-link; 37 renesas,no-ether-link;
38 phy-handle = <&phy0>; 38 phy-handle = <&phy0>;
39 phy-mode = "rgmii-id";
39 status = "okay"; 40 status = "okay";
40 41
41 phy0: ethernet-phy@0 { 42 phy0: ethernet-phy@0 {
42 rxc-skew-ps = <1500>; 43 rxc-skew-ps = <1500>;
43 reg = <0>; 44 reg = <0>;
45 interrupt-parent = <&gpio1>;
46 interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
44 }; 47 };
45}; 48};
46 49
@@ -52,11 +55,41 @@
52 clock-frequency = <32768>; 55 clock-frequency = <32768>;
53}; 56};
54 57
58&i2c0 {
59 pinctrl-0 = <&i2c0_pins>;
60 pinctrl-names = "default";
61
62 status = "okay";
63 clock-frequency = <400000>;
64
65 io_expander: gpio@20 {
66 compatible = "onnn,pca9654";
67 reg = <0x20>;
68 gpio-controller;
69 #gpio-cells = <2>;
70 };
71};
72
73&pfc {
74 i2c0_pins: i2c0 {
75 groups = "i2c0";
76 function = "i2c0";
77 };
78
79 scif0_pins: scif0 {
80 groups = "scif0_data";
81 function = "scif0";
82 };
83};
84
55&rwdt { 85&rwdt {
56 timeout-sec = <60>; 86 timeout-sec = <60>;
57 status = "okay"; 87 status = "okay";
58}; 88};
59 89
60&scif0 { 90&scif0 {
91 pinctrl-0 = <&scif0_pins>;
92 pinctrl-names = "default";
93
61 status = "okay"; 94 status = "okay";
62}; 95};
diff --git a/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts b/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
index 8624ca87d6b2..a8ceeac77992 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
@@ -34,6 +34,7 @@
34&avb { 34&avb {
35 renesas,no-ether-link; 35 renesas,no-ether-link;
36 phy-handle = <&phy0>; 36 phy-handle = <&phy0>;
37 phy-mode = "rgmii-id";
37 status = "okay"; 38 status = "okay";
38 39
39 phy0: ethernet-phy@0 { 40 phy0: ethernet-phy@0 {
@@ -50,6 +51,16 @@
50 clock-frequency = <32768>; 51 clock-frequency = <32768>;
51}; 52};
52 53
54&pfc {
55 scif0_pins: scif0 {
56 groups = "scif0_data";
57 function = "scif0";
58 };
59};
60
53&scif0 { 61&scif0 {
62 pinctrl-0 = <&scif0_pins>;
63 pinctrl-names = "default";
64
54 status = "okay"; 65 status = "okay";
55}; 66};
diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index c35a117fc447..c6db8ea43906 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -19,9 +19,12 @@
19 #address-cells = <2>; 19 #address-cells = <2>;
20 #size-cells = <2>; 20 #size-cells = <2>;
21 21
22 psci { 22 aliases {
23 compatible = "arm,psci-1.0", "arm,psci-0.2"; 23 i2c0 = &i2c0;
24 method = "smc"; 24 i2c1 = &i2c1;
25 i2c2 = &i2c2;
26 i2c3 = &i2c3;
27 i2c4 = &i2c4;
25 }; 28 };
26 29
27 cpus { 30 cpus {
@@ -60,6 +63,11 @@
60 clock-frequency = <0>; 63 clock-frequency = <0>;
61 }; 64 };
62 65
66 psci {
67 compatible = "arm,psci-1.0", "arm,psci-0.2";
68 method = "smc";
69 };
70
63 /* External SCIF clock - to be overridden by boards that provide it */ 71 /* External SCIF clock - to be overridden by boards that provide it */
64 scif_clk: scif { 72 scif_clk: scif {
65 compatible = "fixed-clock"; 73 compatible = "fixed-clock";
@@ -92,18 +100,6 @@
92 resets = <&cpg 408>; 100 resets = <&cpg 408>;
93 }; 101 };
94 102
95 timer {
96 compatible = "arm,armv8-timer";
97 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) |
98 IRQ_TYPE_LEVEL_LOW)>,
99 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) |
100 IRQ_TYPE_LEVEL_LOW)>,
101 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) |
102 IRQ_TYPE_LEVEL_LOW)>,
103 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) |
104 IRQ_TYPE_LEVEL_LOW)>;
105 };
106
107 rwdt: watchdog@e6020000 { 103 rwdt: watchdog@e6020000 {
108 compatible = "renesas,r8a77970-wdt", 104 compatible = "renesas,r8a77970-wdt",
109 "renesas,rcar-gen3-wdt"; 105 "renesas,rcar-gen3-wdt";
@@ -178,6 +174,101 @@
178 #iommu-cells = <1>; 174 #iommu-cells = <1>;
179 }; 175 };
180 176
177 pfc: pin-controller@e6060000 {
178 compatible = "renesas,pfc-r8a77970";
179 reg = <0 0xe6060000 0 0x504>;
180 };
181
182 gpio0: gpio@e6050000 {
183 compatible = "renesas,gpio-r8a77970",
184 "renesas,rcar-gen3-gpio";
185 reg = <0 0xe6050000 0 0x50>;
186 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
187 #gpio-cells = <2>;
188 gpio-controller;
189 gpio-ranges = <&pfc 0 0 22>;
190 #interrupt-cells = <2>;
191 interrupt-controller;
192 clocks = <&cpg CPG_MOD 912>;
193 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
194 resets = <&cpg 912>;
195 };
196
197 gpio1: gpio@e6051000 {
198 compatible = "renesas,gpio-r8a77970",
199 "renesas,rcar-gen3-gpio";
200 reg = <0 0xe6051000 0 0x50>;
201 interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
202 #gpio-cells = <2>;
203 gpio-controller;
204 gpio-ranges = <&pfc 0 32 28>;
205 #interrupt-cells = <2>;
206 interrupt-controller;
207 clocks = <&cpg CPG_MOD 911>;
208 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
209 resets = <&cpg 911>;
210 };
211
212 gpio2: gpio@e6052000 {
213 compatible = "renesas,gpio-r8a77970",
214 "renesas,rcar-gen3-gpio";
215 reg = <0 0xe6052000 0 0x50>;
216 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
217 #gpio-cells = <2>;
218 gpio-controller;
219 gpio-ranges = <&pfc 0 64 17>;
220 #interrupt-cells = <2>;
221 interrupt-controller;
222 clocks = <&cpg CPG_MOD 910>;
223 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
224 resets = <&cpg 910>;
225 };
226
227 gpio3: gpio@e6053000 {
228 compatible = "renesas,gpio-r8a77970",
229 "renesas,rcar-gen3-gpio";
230 reg = <0 0xe6053000 0 0x50>;
231 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
232 #gpio-cells = <2>;
233 gpio-controller;
234 gpio-ranges = <&pfc 0 96 17>;
235 #interrupt-cells = <2>;
236 interrupt-controller;
237 clocks = <&cpg CPG_MOD 909>;
238 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
239 resets = <&cpg 909>;
240 };
241
242 gpio4: gpio@e6054000 {
243 compatible = "renesas,gpio-r8a77970",
244 "renesas,rcar-gen3-gpio";
245 reg = <0 0xe6054000 0 0x50>;
246 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
247 #gpio-cells = <2>;
248 gpio-controller;
249 gpio-ranges = <&pfc 0 128 6>;
250 #interrupt-cells = <2>;
251 interrupt-controller;
252 clocks = <&cpg CPG_MOD 908>;
253 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
254 resets = <&cpg 908>;
255 };
256
257 gpio5: gpio@e6055000 {
258 compatible = "renesas,gpio-r8a77970",
259 "renesas,rcar-gen3-gpio";
260 reg = <0 0xe6055000 0 0x50>;
261 interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
262 #gpio-cells = <2>;
263 gpio-controller;
264 gpio-ranges = <&pfc 0 160 15>;
265 #interrupt-cells = <2>;
266 interrupt-controller;
267 clocks = <&cpg CPG_MOD 907>;
268 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
269 resets = <&cpg 907>;
270 };
271
181 intc_ex: interrupt-controller@e61c0000 { 272 intc_ex: interrupt-controller@e61c0000 {
182 compatible = "renesas,intc-ex-r8a77970", "renesas,irqc"; 273 compatible = "renesas,intc-ex-r8a77970", "renesas,irqc";
183 #interrupt-cells = <2>; 274 #interrupt-cells = <2>;
@@ -255,6 +346,91 @@
255 <&ipmmu_ds1 22>, <&ipmmu_ds1 23>; 346 <&ipmmu_ds1 22>, <&ipmmu_ds1 23>;
256 }; 347 };
257 348
349 i2c0: i2c@e6500000 {
350 compatible = "renesas,i2c-r8a77970",
351 "renesas,rcar-gen3-i2c";
352 reg = <0 0xe6500000 0 0x40>;
353 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
354 clocks = <&cpg CPG_MOD 931>;
355 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
356 resets = <&cpg 931>;
357 dmas = <&dmac1 0x91>, <&dmac1 0x90>,
358 <&dmac2 0x91>, <&dmac2 0x90>;
359 dma-names = "tx", "rx", "tx", "rx";
360 i2c-scl-internal-delay-ns = <6>;
361 #address-cells = <1>;
362 #size-cells = <0>;
363 status = "disabled";
364 };
365
366 i2c1: i2c@e6508000 {
367 compatible = "renesas,i2c-r8a77970",
368 "renesas,rcar-gen3-i2c";
369 reg = <0 0xe6508000 0 0x40>;
370 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
371 clocks = <&cpg CPG_MOD 930>;
372 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
373 resets = <&cpg 930>;
374 dmas = <&dmac1 0x93>, <&dmac1 0x92>,
375 <&dmac2 0x93>, <&dmac2 0x92>;
376 dma-names = "tx", "rx", "tx", "rx";
377 i2c-scl-internal-delay-ns = <6>;
378 #address-cells = <1>;
379 #size-cells = <0>;
380 status = "disabled";
381 };
382
383 i2c2: i2c@e6510000 {
384 compatible = "renesas,i2c-r8a77970",
385 "renesas,rcar-gen3-i2c";
386 reg = <0 0xe6510000 0 0x40>;
387 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
388 clocks = <&cpg CPG_MOD 929>;
389 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
390 resets = <&cpg 929>;
391 dmas = <&dmac1 0x95>, <&dmac1 0x94>,
392 <&dmac2 0x95>, <&dmac2 0x94>;
393 dma-names = "tx", "rx", "tx", "rx";
394 i2c-scl-internal-delay-ns = <6>;
395 #address-cells = <1>;
396 #size-cells = <0>;
397 status = "disabled";
398 };
399
400 i2c3: i2c@e66d0000 {
401 compatible = "renesas,i2c-r8a77970",
402 "renesas,rcar-gen3-i2c";
403 reg = <0 0xe66d0000 0 0x40>;
404 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
405 clocks = <&cpg CPG_MOD 928>;
406 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
407 resets = <&cpg 928>;
408 dmas = <&dmac1 0x97>, <&dmac1 0x96>,
409 <&dmac2 0x97>, <&dmac2 0x96>;
410 dma-names = "tx", "rx", "tx", "rx";
411 i2c-scl-internal-delay-ns = <6>;
412 #address-cells = <1>;
413 #size-cells = <0>;
414 status = "disabled";
415 };
416
417 i2c4: i2c@e66d8000 {
418 compatible = "renesas,i2c-r8a77970",
419 "renesas,rcar-gen3-i2c";
420 reg = <0 0xe66d8000 0 0x40>;
421 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
422 clocks = <&cpg CPG_MOD 927>;
423 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
424 resets = <&cpg 927>;
425 dmas = <&dmac1 0x99>, <&dmac1 0x98>,
426 <&dmac2 0x99>, <&dmac2 0x98>;
427 dma-names = "tx", "rx", "tx", "rx";
428 i2c-scl-internal-delay-ns = <6>;
429 #address-cells = <1>;
430 #size-cells = <0>;
431 status = "disabled";
432 };
433
258 hscif0: serial@e6540000 { 434 hscif0: serial@e6540000 {
259 compatible = "renesas,hscif-r8a77970", 435 compatible = "renesas,hscif-r8a77970",
260 "renesas,rcar-gen3-hscif", 436 "renesas,rcar-gen3-hscif",
@@ -400,7 +576,7 @@
400 avb: ethernet@e6800000 { 576 avb: ethernet@e6800000 {
401 compatible = "renesas,etheravb-r8a77970", 577 compatible = "renesas,etheravb-r8a77970",
402 "renesas,etheravb-rcar-gen3"; 578 "renesas,etheravb-rcar-gen3";
403 reg = <0 0xe6800000 0 0x800>, <0 0xe6a00000 0 0x10000>; 579 reg = <0 0xe6800000 0 0x800>;
404 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 580 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
405 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 581 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
406 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 582 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
@@ -436,10 +612,18 @@
436 clocks = <&cpg CPG_MOD 812>; 612 clocks = <&cpg CPG_MOD 812>;
437 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>; 613 power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
438 resets = <&cpg 812>; 614 resets = <&cpg 812>;
439 phy-mode = "rgmii-id"; 615 phy-mode = "rgmii";
440 iommus = <&ipmmu_rt 3>; 616 iommus = <&ipmmu_rt 3>;
441 #address-cells = <1>; 617 #address-cells = <1>;
442 #size-cells = <0>; 618 #size-cells = <0>;
443 }; 619 };
444 }; 620 };
621
622 timer {
623 compatible = "arm,armv8-timer";
624 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
625 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
626 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
627 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
628 };
445}; 629};
diff --git a/arch/arm64/boot/dts/renesas/r8a77980-condor.dts b/arch/arm64/boot/dts/renesas/r8a77980-condor.dts
new file mode 100644
index 000000000000..06cf6845765a
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77980-condor.dts
@@ -0,0 +1,58 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Condor board
4 *
5 * Copyright (C) 2018 Renesas Electronics Corp.
6 * Copyright (C) 2018 Cogent Embedded, Inc.
7 */
8
9/dts-v1/;
10#include "r8a77980.dtsi"
11
12/ {
13 model = "Renesas Condor board based on r8a77980";
14 compatible = "renesas,condor", "renesas,r8a77980";
15
16 aliases {
17 serial0 = &scif0;
18 ethernet0 = &avb;
19 };
20
21 chosen {
22 stdout-path = "serial0:115200n8";
23 };
24
25 memory@48000000 {
26 device_type = "memory";
27 /* first 128MB is reserved for secure area. */
28 reg = <0 0x48000000 0 0x78000000>;
29 };
30};
31
32&avb {
33 phy-mode = "rgmii-id";
34 phy-handle = <&phy0>;
35 renesas,no-ether-link;
36 status = "okay";
37
38 phy0: ethernet-phy@0 {
39 rxc-skew-ps = <1500>;
40 reg = <0>;
41 };
42};
43
44&extal_clk {
45 clock-frequency = <16666666>;
46};
47
48&extalr_clk {
49 clock-frequency = <32768>;
50};
51
52&scif0 {
53 status = "okay";
54};
55
56&scif_clk {
57 clock-frequency = <14745600>;
58};
diff --git a/arch/arm64/boot/dts/renesas/r8a77980.dtsi b/arch/arm64/boot/dts/renesas/r8a77980.dtsi
new file mode 100644
index 000000000000..03845fd74996
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a77980.dtsi
@@ -0,0 +1,385 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the r8a77980 SoC
4 *
5 * Copyright (C) 2018 Renesas Electronics Corp.
6 * Copyright (C) 2018 Cogent Embedded, Inc.
7 */
8
9#include <dt-bindings/interrupt-controller/irq.h>
10#include <dt-bindings/interrupt-controller/arm-gic.h>
11#include <dt-bindings/clock/renesas-cpg-mssr.h>
12
13/ {
14 compatible = "renesas,r8a77980";
15 #address-cells = <2>;
16 #size-cells = <2>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 a53_0: cpu@0 {
23 device_type = "cpu";
24 compatible = "arm,cortex-a53", "arm,armv8";
25 reg = <0>;
26 clocks = <&cpg CPG_CORE 0>;
27 power-domains = <&sysc 5>;
28 next-level-cache = <&L2_CA53>;
29 enable-method = "psci";
30 };
31
32 L2_CA53: cache-controller {
33 compatible = "cache";
34 power-domains = <&sysc 21>;
35 cache-unified;
36 cache-level = <2>;
37 };
38 };
39
40 extal_clk: extal {
41 compatible = "fixed-clock";
42 #clock-cells = <0>;
43 /* This value must be overridden by the board */
44 clock-frequency = <0>;
45 };
46
47 extalr_clk: extalr {
48 compatible = "fixed-clock";
49 #clock-cells = <0>;
50 /* This value must be overridden by the board */
51 clock-frequency = <0>;
52 };
53
54 psci {
55 compatible = "arm,psci-1.0", "arm,psci-0.2";
56 method = "smc";
57 };
58
59 /* External SCIF clock - to be overridden by boards that provide it */
60 scif_clk: scif {
61 compatible = "fixed-clock";
62 #clock-cells = <0>;
63 clock-frequency = <0>;
64 };
65
66 soc {
67 compatible = "simple-bus";
68 interrupt-parent = <&gic>;
69
70 #address-cells = <2>;
71 #size-cells = <2>;
72 ranges;
73
74 cpg: clock-controller@e6150000 {
75 compatible = "renesas,r8a77980-cpg-mssr";
76 reg = <0 0xe6150000 0 0x1000>;
77 clocks = <&extal_clk>, <&extalr_clk>;
78 clock-names = "extal", "extalr";
79 #clock-cells = <2>;
80 #power-domain-cells = <0>;
81 #reset-cells = <1>;
82 };
83
84 rst: reset-controller@e6160000 {
85 compatible = "renesas,r8a77980-rst";
86 reg = <0 0xe6160000 0 0x200>;
87 };
88
89 sysc: system-controller@e6180000 {
90 compatible = "renesas,r8a77980-sysc";
91 reg = <0 0xe6180000 0 0x440>;
92 #power-domain-cells = <1>;
93 };
94
95 hscif0: serial@e6540000 {
96 compatible = "renesas,hscif-r8a77980",
97 "renesas,rcar-gen3-hscif",
98 "renesas,hscif";
99 reg = <0 0xe6540000 0 0x60>;
100 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
101 clocks = <&cpg CPG_MOD 520>,
102 <&cpg CPG_CORE 19>,
103 <&scif_clk>;
104 clock-names = "fck", "brg_int", "scif_clk";
105 dmas = <&dmac1 0x31>, <&dmac1 0x30>,
106 <&dmac2 0x31>, <&dmac2 0x30>;
107 dma-names = "tx", "rx", "tx", "rx";
108 power-domains = <&sysc 32>;
109 resets = <&cpg 520>;
110 status = "disabled";
111 };
112
113 hscif1: serial@e6550000 {
114 compatible = "renesas,hscif-r8a77980",
115 "renesas,rcar-gen3-hscif",
116 "renesas,hscif";
117 reg = <0 0xe6550000 0 0x60>;
118 interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
119 clocks = <&cpg CPG_MOD 519>,
120 <&cpg CPG_CORE 19>,
121 <&scif_clk>;
122 clock-names = "fck", "brg_int", "scif_clk";
123 dmas = <&dmac1 0x33>, <&dmac1 0x32>,
124 <&dmac2 0x33>, <&dmac2 0x32>;
125 dma-names = "tx", "rx", "tx", "rx";
126 power-domains = <&sysc 32>;
127 resets = <&cpg 519>;
128 status = "disabled";
129 };
130
131 hscif2: serial@e6560000 {
132 compatible = "renesas,hscif-r8a77980",
133 "renesas,rcar-gen3-hscif",
134 "renesas,hscif";
135 reg = <0 0xe6560000 0 0x60>;
136 interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
137 clocks = <&cpg CPG_MOD 518>,
138 <&cpg CPG_CORE 19>,
139 <&scif_clk>;
140 clock-names = "fck", "brg_int", "scif_clk";
141 dmas = <&dmac1 0x35>, <&dmac1 0x34>,
142 <&dmac2 0x35>, <&dmac2 0x34>;
143 dma-names = "tx", "rx", "tx", "rx";
144 power-domains = <&sysc 32>;
145 resets = <&cpg 518>;
146 status = "disabled";
147 };
148
149 hscif3: serial@e66a0000 {
150 compatible = "renesas,hscif-r8a77980",
151 "renesas,rcar-gen3-hscif",
152 "renesas,hscif";
153 reg = <0 0xe66a0000 0 0x60>;
154 interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
155 clocks = <&cpg CPG_MOD 517>,
156 <&cpg CPG_CORE 19>,
157 <&scif_clk>;
158 clock-names = "fck", "brg_int", "scif_clk";
159 dmas = <&dmac1 0x37>, <&dmac1 0x36>,
160 <&dmac2 0x37>, <&dmac2 0x36>;
161 dma-names = "tx", "rx", "tx", "rx";
162 power-domains = <&sysc 32>;
163 resets = <&cpg 517>;
164 status = "disabled";
165 };
166
167 avb: ethernet@e6800000 {
168 compatible = "renesas,etheravb-r8a77980",
169 "renesas,etheravb-rcar-gen3";
170 reg = <0 0xe6800000 0 0x800>;
171 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
172 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
173 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
174 <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
175 <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
176 <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
177 <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
178 <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>,
179 <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
180 <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>,
181 <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
182 <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>,
183 <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
184 <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
185 <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
186 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
187 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
188 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
189 <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
190 <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
191 <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
192 <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
193 <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
194 <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,
195 <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
196 interrupt-names = "ch0", "ch1", "ch2", "ch3",
197 "ch4", "ch5", "ch6", "ch7",
198 "ch8", "ch9", "ch10", "ch11",
199 "ch12", "ch13", "ch14", "ch15",
200 "ch16", "ch17", "ch18", "ch19",
201 "ch20", "ch21", "ch22", "ch23",
202 "ch24";
203 clocks = <&cpg CPG_MOD 812>;
204 power-domains = <&sysc 32>;
205 resets = <&cpg 812>;
206 phy-mode = "rgmii";
207 #address-cells = <1>;
208 #size-cells = <0>;
209 };
210
211 scif0: serial@e6e60000 {
212 compatible = "renesas,scif-r8a77980",
213 "renesas,rcar-gen3-scif",
214 "renesas,scif";
215 reg = <0 0xe6e60000 0 0x40>;
216 interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
217 clocks = <&cpg CPG_MOD 207>,
218 <&cpg CPG_CORE 19>,
219 <&scif_clk>;
220 clock-names = "fck", "brg_int", "scif_clk";
221 dmas = <&dmac1 0x51>, <&dmac1 0x50>,
222 <&dmac2 0x51>, <&dmac2 0x50>;
223 dma-names = "tx", "rx", "tx", "rx";
224 power-domains = <&sysc 32>;
225 resets = <&cpg 207>;
226 status = "disabled";
227 };
228
229 scif1: serial@e6e68000 {
230 compatible = "renesas,scif-r8a77980",
231 "renesas,rcar-gen3-scif",
232 "renesas,scif";
233 reg = <0 0xe6e68000 0 0x40>;
234 interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
235 clocks = <&cpg CPG_MOD 206>,
236 <&cpg CPG_CORE 19>,
237 <&scif_clk>;
238 clock-names = "fck", "brg_int", "scif_clk";
239 dmas = <&dmac1 0x53>, <&dmac1 0x52>,
240 <&dmac2 0x53>, <&dmac2 0x52>;
241 dma-names = "tx", "rx", "tx", "rx";
242 power-domains = <&sysc 32>;
243 resets = <&cpg 206>;
244 status = "disabled";
245 };
246
247 scif3: serial@e6c50000 {
248 compatible = "renesas,scif-r8a77980",
249 "renesas,rcar-gen3-scif",
250 "renesas,scif";
251 reg = <0 0xe6c50000 0 0x40>;
252 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
253 clocks = <&cpg CPG_MOD 204>,
254 <&cpg CPG_CORE 19>,
255 <&scif_clk>;
256 clock-names = "fck", "brg_int", "scif_clk";
257 dmas = <&dmac1 0x57>, <&dmac1 0x56>,
258 <&dmac2 0x57>, <&dmac2 0x56>;
259 dma-names = "tx", "rx", "tx", "rx";
260 power-domains = <&sysc 32>;
261 resets = <&cpg 204>;
262 status = "disabled";
263 };
264
265 scif4: serial@e6c40000 {
266 compatible = "renesas,scif-r8a77980",
267 "renesas,rcar-gen3-scif",
268 "renesas,scif";
269 reg = <0 0xe6c40000 0 0x40>;
270 interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
271 clocks = <&cpg CPG_MOD 203>,
272 <&cpg CPG_CORE 19>,
273 <&scif_clk>;
274 clock-names = "fck", "brg_int", "scif_clk";
275 dmas = <&dmac1 0x59>, <&dmac1 0x58>,
276 <&dmac2 0x59>, <&dmac2 0x58>;
277 dma-names = "tx", "rx", "tx", "rx";
278 power-domains = <&sysc 32>;
279 resets = <&cpg 203>;
280 status = "disabled";
281 };
282
283 dmac1: dma-controller@e7300000 {
284 compatible = "renesas,dmac-r8a77980",
285 "renesas,rcar-dmac";
286 reg = <0 0xe7300000 0 0x10000>;
287 interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
288 GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
289 GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
290 GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
291 GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
292 GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
293 GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
294 GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
295 GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
296 GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH
297 GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH
298 GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH
299 GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH
300 GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH
301 GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH
302 GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH
303 GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
304 interrupt-names = "error",
305 "ch0", "ch1", "ch2", "ch3",
306 "ch4", "ch5", "ch6", "ch7",
307 "ch8", "ch9", "ch10", "ch11",
308 "ch12", "ch13", "ch14", "ch15";
309 clocks = <&cpg CPG_MOD 218>;
310 clock-names = "fck";
311 power-domains = <&sysc 32>;
312 resets = <&cpg 218>;
313 #dma-cells = <1>;
314 dma-channels = <16>;
315 };
316
317 dmac2: dma-controller@e7310000 {
318 compatible = "renesas,dmac-r8a77980",
319 "renesas,rcar-dmac";
320 reg = <0 0xe7310000 0 0x10000>;
321 interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH
322 GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
323 GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
324 GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
325 GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
326 GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
327 GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
328 GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH
329 GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH
330 GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH
331 GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH
332 GIC_SPI 363 IRQ_TYPE_LEVEL_HIGH
333 GIC_SPI 364 IRQ_TYPE_LEVEL_HIGH
334 GIC_SPI 365 IRQ_TYPE_LEVEL_HIGH
335 GIC_SPI 366 IRQ_TYPE_LEVEL_HIGH
336 GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH
337 GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>;
338 interrupt-names = "error",
339 "ch0", "ch1", "ch2", "ch3",
340 "ch4", "ch5", "ch6", "ch7",
341 "ch8", "ch9", "ch10", "ch11",
342 "ch12", "ch13", "ch14", "ch15";
343 clocks = <&cpg CPG_MOD 217>;
344 clock-names = "fck";
345 power-domains = <&sysc 32>;
346 resets = <&cpg 217>;
347 #dma-cells = <1>;
348 dma-channels = <16>;
349 };
350
351 gic: interrupt-controller@f1010000 {
352 compatible = "arm,gic-400";
353 #interrupt-cells = <3>;
354 #address-cells = <0>;
355 interrupt-controller;
356 reg = <0x0 0xf1010000 0 0x1000>,
357 <0x0 0xf1020000 0 0x20000>,
358 <0x0 0xf1040000 0 0x20000>,
359 <0x0 0xf1060000 0 0x20000>;
360 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(1) |
361 IRQ_TYPE_LEVEL_HIGH)>;
362 clocks = <&cpg CPG_MOD 408>;
363 clock-names = "clk";
364 power-domains = <&sysc 32>;
365 resets = <&cpg 408>;
366 };
367
368 prr: chipid@fff00044 {
369 compatible = "renesas,prr";
370 reg = <0 0xfff00044 0 4>;
371 };
372 };
373
374 timer {
375 compatible = "arm,armv8-timer";
376 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) |
377 IRQ_TYPE_LEVEL_LOW)>,
378 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) |
379 IRQ_TYPE_LEVEL_LOW)>,
380 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) |
381 IRQ_TYPE_LEVEL_LOW)>,
382 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) |
383 IRQ_TYPE_LEVEL_LOW)>;
384 };
385};
diff --git a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
index 09de73b11db8..d03f19414028 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
@@ -27,11 +27,61 @@
27 stdout-path = "serial0:115200n8"; 27 stdout-path = "serial0:115200n8";
28 }; 28 };
29 29
30 vga {
31 compatible = "vga-connector";
32
33 port {
34 vga_in: endpoint {
35 remote-endpoint = <&adv7123_out>;
36 };
37 };
38 };
39
40 vga-encoder {
41 compatible = "adi,adv7123";
42
43 ports {
44 #address-cells = <1>;
45 #size-cells = <0>;
46
47 port@0 {
48 reg = <0>;
49 adv7123_in: endpoint {
50 remote-endpoint = <&du_out_rgb>;
51 };
52 };
53 port@1 {
54 reg = <1>;
55 adv7123_out: endpoint {
56 remote-endpoint = <&vga_in>;
57 };
58 };
59 };
60 };
61
30 memory@48000000 { 62 memory@48000000 {
31 device_type = "memory"; 63 device_type = "memory";
32 /* first 128MB is reserved for secure area. */ 64 /* first 128MB is reserved for secure area. */
33 reg = <0x0 0x48000000 0x0 0x18000000>; 65 reg = <0x0 0x48000000 0x0 0x18000000>;
34 }; 66 };
67
68 reg_1p8v: regulator0 {
69 compatible = "regulator-fixed";
70 regulator-name = "fixed-1.8V";
71 regulator-min-microvolt = <1800000>;
72 regulator-max-microvolt = <1800000>;
73 regulator-boot-on;
74 regulator-always-on;
75 };
76
77 reg_3p3v: regulator1 {
78 compatible = "regulator-fixed";
79 regulator-name = "fixed-3.3V";
80 regulator-min-microvolt = <3300000>;
81 regulator-max-microvolt = <3300000>;
82 regulator-boot-on;
83 regulator-always-on;
84 };
35}; 85};
36 86
37&extal_clk { 87&extal_clk {
@@ -46,6 +96,21 @@
46 }; 96 };
47 }; 97 };
48 98
99 du_pins: du {
100 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
101 function = "du";
102 };
103
104 i2c0_pins: i2c0 {
105 groups = "i2c0";
106 function = "i2c0";
107 };
108
109 i2c1_pins: i2c1 {
110 groups = "i2c1";
111 function = "i2c1";
112 };
113
49 pwm0_pins: pwm0 { 114 pwm0_pins: pwm0 {
50 groups = "pwm0_c"; 115 groups = "pwm0_c";
51 function = "pwm0"; 116 function = "pwm0";
@@ -61,12 +126,56 @@
61 function = "scif2"; 126 function = "scif2";
62 }; 127 };
63 128
129 sdhi2_pins: sd2 {
130 groups = "mmc_data8", "mmc_ctrl";
131 function = "mmc";
132 power-source = <1800>;
133 };
134
135 sdhi2_pins_uhs: sd2_uhs {
136 groups = "mmc_data8", "mmc_ctrl";
137 function = "mmc";
138 power-source = <1800>;
139 };
140
64 usb0_pins: usb0 { 141 usb0_pins: usb0 {
65 groups = "usb0"; 142 groups = "usb0";
66 function = "usb0"; 143 function = "usb0";
67 }; 144 };
68}; 145};
69 146
147&i2c0 {
148 pinctrl-0 = <&i2c0_pins>;
149 pinctrl-names = "default";
150 status = "okay";
151
152 eeprom@50 {
153 compatible = "rohm,br24t01", "atmel,24c01";
154 reg = <0x50>;
155 pagesize = <8>;
156 };
157};
158
159&i2c1 {
160 pinctrl-0 = <&i2c1_pins>;
161 pinctrl-names = "default";
162 status = "okay";
163};
164
165&du {
166 pinctrl-0 = <&du_pins>;
167 pinctrl-names = "default";
168 status = "okay";
169
170 ports {
171 port@0 {
172 endpoint {
173 remote-endpoint = <&adv7123_in>;
174 };
175 };
176 };
177};
178
70&ehci0 { 179&ehci0 {
71 status = "okay"; 180 status = "okay";
72}; 181};
@@ -80,6 +189,7 @@
80 pinctrl-names = "default"; 189 pinctrl-names = "default";
81 renesas,no-ether-link; 190 renesas,no-ether-link;
82 phy-handle = <&phy0>; 191 phy-handle = <&phy0>;
192 phy-mode = "rgmii-txid";
83 status = "okay"; 193 status = "okay";
84 194
85 phy0: ethernet-phy@0 { 195 phy0: ethernet-phy@0 {
@@ -97,6 +207,20 @@
97 status = "okay"; 207 status = "okay";
98}; 208};
99 209
210&sdhi2 {
211 /* used for on-board eMMC */
212 pinctrl-0 = <&sdhi2_pins>;
213 pinctrl-1 = <&sdhi2_pins_uhs>;
214 pinctrl-names = "default", "state_uhs";
215
216 vmmc-supply = <&reg_3p3v>;
217 vqmmc-supply = <&reg_1p8v>;
218 bus-width = <8>;
219 mmc-hs200-1_8v;
220 non-removable;
221 status = "okay";
222};
223
100&usb2_phy0 { 224&usb2_phy0 {
101 pinctrl-0 = <&usb0_pins>; 225 pinctrl-0 = <&usb0_pins>;
102 pinctrl-names = "default"; 226 pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/renesas/r8a77995.dtsi b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
index cff42cd1a6c8..82aed7ee984c 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
@@ -58,6 +58,11 @@
58 clock-frequency = <0>; 58 clock-frequency = <0>;
59 }; 59 };
60 60
61 pmu_a53 {
62 compatible = "arm,cortex-a53-pmu";
63 interrupts-extended = <&gic GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
64 };
65
61 scif_clk: scif { 66 scif_clk: scif {
62 compatible = "fixed-clock"; 67 compatible = "fixed-clock";
63 #clock-cells = <0>; 68 #clock-cells = <0>;
@@ -88,18 +93,6 @@
88 resets = <&cpg 408>; 93 resets = <&cpg 408>;
89 }; 94 };
90 95
91 timer {
92 compatible = "arm,armv8-timer";
93 interrupts = <GIC_PPI 13
94 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
95 <GIC_PPI 14
96 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
97 <GIC_PPI 11
98 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
99 <GIC_PPI 10
100 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
101 };
102
103 rwdt: watchdog@e6020000 { 96 rwdt: watchdog@e6020000 {
104 compatible = "renesas,r8a77995-wdt", 97 compatible = "renesas,r8a77995-wdt",
105 "renesas,rcar-gen3-wdt"; 98 "renesas,rcar-gen3-wdt";
@@ -110,11 +103,6 @@
110 status = "disabled"; 103 status = "disabled";
111 }; 104 };
112 105
113 pmu_a53 {
114 compatible = "arm,cortex-a53-pmu";
115 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
116 };
117
118 ipmmu_vi0: mmu@febd0000 { 106 ipmmu_vi0: mmu@febd0000 {
119 compatible = "renesas,ipmmu-r8a77995"; 107 compatible = "renesas,ipmmu-r8a77995";
120 reg = <0 0xfebd0000 0 0x1000>; 108 reg = <0 0xfebd0000 0 0x1000>;
@@ -488,7 +476,7 @@
488 avb: ethernet@e6800000 { 476 avb: ethernet@e6800000 {
489 compatible = "renesas,etheravb-r8a77995", 477 compatible = "renesas,etheravb-r8a77995",
490 "renesas,etheravb-rcar-gen3"; 478 "renesas,etheravb-rcar-gen3";
491 reg = <0 0xe6800000 0 0x800>, <0 0xe6a00000 0 0x10000>; 479 reg = <0 0xe6800000 0 0x800>;
492 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 480 interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
493 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 481 <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
494 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 482 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
@@ -524,7 +512,7 @@
524 clocks = <&cpg CPG_MOD 812>; 512 clocks = <&cpg CPG_MOD 812>;
525 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>; 513 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
526 resets = <&cpg 812>; 514 resets = <&cpg 812>;
527 phy-mode = "rgmii-txid"; 515 phy-mode = "rgmii";
528 iommus = <&ipmmu_ds0 16>; 516 iommus = <&ipmmu_ds0 16>;
529 #address-cells = <1>; 517 #address-cells = <1>;
530 #size-cells = <0>; 518 #size-cells = <0>;
@@ -548,6 +536,73 @@
548 status = "disabled"; 536 status = "disabled";
549 }; 537 };
550 538
539 i2c0: i2c@e6500000 {
540 #address-cells = <1>;
541 #size-cells = <0>;
542 compatible = "renesas,i2c-r8a77995",
543 "renesas,rcar-gen3-i2c";
544 reg = <0 0xe6500000 0 0x40>;
545 interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
546 clocks = <&cpg CPG_MOD 931>;
547 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
548 resets = <&cpg 931>;
549 dmas = <&dmac1 0x91>, <&dmac1 0x90>,
550 <&dmac2 0x91>, <&dmac2 0x90>;
551 dma-names = "tx", "rx", "tx", "rx";
552 i2c-scl-internal-delay-ns = <6>;
553 status = "disabled";
554 };
555
556 i2c1: i2c@e6508000 {
557 #address-cells = <1>;
558 #size-cells = <0>;
559 compatible = "renesas,i2c-r8a77995",
560 "renesas,rcar-gen3-i2c";
561 reg = <0 0xe6508000 0 0x40>;
562 interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
563 clocks = <&cpg CPG_MOD 930>;
564 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
565 resets = <&cpg 930>;
566 dmas = <&dmac1 0x93>, <&dmac1 0x92>,
567 <&dmac2 0x93>, <&dmac2 0x92>;
568 dma-names = "tx", "rx", "tx", "rx";
569 i2c-scl-internal-delay-ns = <6>;
570 status = "disabled";
571 };
572
573 i2c2: i2c@e6510000 {
574 #address-cells = <1>;
575 #size-cells = <0>;
576 compatible = "renesas,i2c-r8a77995",
577 "renesas,rcar-gen3-i2c";
578 reg = <0 0xe6510000 0 0x40>;
579 interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
580 clocks = <&cpg CPG_MOD 929>;
581 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
582 resets = <&cpg 929>;
583 dmas = <&dmac1 0x95>, <&dmac1 0x94>,
584 <&dmac2 0x95>, <&dmac2 0x94>;
585 dma-names = "tx", "rx", "tx", "rx";
586 i2c-scl-internal-delay-ns = <6>;
587 status = "disabled";
588 };
589
590 i2c3: i2c@e66d0000 {
591 #address-cells = <1>;
592 #size-cells = <0>;
593 compatible = "renesas,i2c-r8a77995",
594 "renesas,rcar-gen3-i2c";
595 reg = <0 0xe66d0000 0 0x40>;
596 interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
597 clocks = <&cpg CPG_MOD 928>;
598 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
599 resets = <&cpg 928>;
600 dmas = <&dmac0 0x97>, <&dmac0 0x96>;
601 dma-names = "tx", "rx";
602 i2c-scl-internal-delay-ns = <6>;
603 status = "disabled";
604 };
605
551 pwm0: pwm@e6e30000 { 606 pwm0: pwm@e6e30000 {
552 compatible = "renesas,pwm-r8a77995", "renesas,pwm-rcar"; 607 compatible = "renesas,pwm-r8a77995", "renesas,pwm-rcar";
553 reg = <0 0xe6e30000 0 0x8>; 608 reg = <0 0xe6e30000 0 0x8>;
@@ -636,5 +691,105 @@
636 #phy-cells = <0>; 691 #phy-cells = <0>;
637 status = "disabled"; 692 status = "disabled";
638 }; 693 };
694
695 vspbs: vsp@fe960000 {
696 compatible = "renesas,vsp2";
697 reg = <0 0xfe960000 0 0x8000>;
698 interrupts = <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>;
699 clocks = <&cpg CPG_MOD 627>;
700 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
701 resets = <&cpg 627>;
702 renesas,fcp = <&fcpvb0>;
703 };
704
705 fcpvb0: fcp@fe96f000 {
706 compatible = "renesas,fcpv";
707 reg = <0 0xfe96f000 0 0x200>;
708 clocks = <&cpg CPG_MOD 607>;
709 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
710 resets = <&cpg 607>;
711 iommus = <&ipmmu_vp0 5>;
712 };
713
714 vspd0: vsp@fea20000 {
715 compatible = "renesas,vsp2";
716 reg = <0 0xfea20000 0 0x8000>;
717 interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>;
718 clocks = <&cpg CPG_MOD 623>;
719 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
720 resets = <&cpg 623>;
721 renesas,fcp = <&fcpvd0>;
722 };
723
724 fcpvd0: fcp@fea27000 {
725 compatible = "renesas,fcpv";
726 reg = <0 0xfea27000 0 0x200>;
727 clocks = <&cpg CPG_MOD 603>;
728 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
729 resets = <&cpg 603>;
730 iommus = <&ipmmu_vi0 8>;
731 };
732
733 vspd1: vsp@fea28000 {
734 compatible = "renesas,vsp2";
735 reg = <0 0xfea28000 0 0x8000>;
736 interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>;
737 clocks = <&cpg CPG_MOD 622>;
738 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
739 resets = <&cpg 622>;
740 renesas,fcp = <&fcpvd1>;
741 };
742
743 fcpvd1: fcp@fea2f000 {
744 compatible = "renesas,fcpv";
745 reg = <0 0xfea2f000 0 0x200>;
746 clocks = <&cpg CPG_MOD 602>;
747 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
748 resets = <&cpg 602>;
749 iommus = <&ipmmu_vi0 9>;
750 };
751
752 du: display@feb00000 {
753 compatible = "renesas,du-r8a77995";
754 reg = <0 0xfeb00000 0 0x80000>;
755 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
756 <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
757 clocks = <&cpg CPG_MOD 724>,
758 <&cpg CPG_MOD 723>;
759 clock-names = "du.0", "du.1";
760 vsps = <&vspd0 0 &vspd1 0>;
761 status = "disabled";
762
763 ports {
764 #address-cells = <1>;
765 #size-cells = <0>;
766
767 port@0 {
768 reg = <0>;
769 du_out_rgb: endpoint {
770 };
771 };
772
773 port@1 {
774 reg = <1>;
775 du_out_lvds0: endpoint {
776 };
777 };
778
779 port@2 {
780 reg = <2>;
781 du_out_lvds1: endpoint {
782 };
783 };
784 };
785 };
786 };
787
788 timer {
789 compatible = "arm,armv8-timer";
790 interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
791 <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
792 <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
793 <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
639 }; 794 };
640}; 795};
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index c3fafb6025b3..2a7f36abd2dd 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -256,6 +256,7 @@
256 pinctrl-0 = <&avb_pins>; 256 pinctrl-0 = <&avb_pins>;
257 pinctrl-names = "default"; 257 pinctrl-names = "default";
258 phy-handle = <&phy0>; 258 phy-handle = <&phy0>;
259 phy-mode = "rgmii-txid";
259 status = "okay"; 260 status = "okay";
260 261
261 phy0: ethernet-phy@0 { 262 phy0: ethernet-phy@0 {
@@ -338,6 +339,13 @@
338&i2c4 { 339&i2c4 {
339 status = "okay"; 340 status = "okay";
340 341
342 pca9654: gpio@20 {
343 compatible = "onnn,pca9654";
344 reg = <0x20>;
345 gpio-controller;
346 #gpio-cells = <2>;
347 };
348
341 csa_vdd: adc@7c { 349 csa_vdd: adc@7c {
342 compatible = "maxim,max9611"; 350 compatible = "maxim,max9611";
343 reg = <0x7c>; 351 reg = <0x7c>;
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index 3e7a6b94e9f8..6f814845f8b6 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -146,6 +146,7 @@
146 pinctrl-0 = <&avb_pins>; 146 pinctrl-0 = <&avb_pins>;
147 pinctrl-names = "default"; 147 pinctrl-names = "default";
148 phy-handle = <&phy0>; 148 phy-handle = <&phy0>;
149 phy-mode = "rgmii-txid";
149 status = "okay"; 150 status = "okay";
150 151
151 phy0: ethernet-phy@0 { 152 phy0: ethernet-phy@0 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
index 3890468678ce..28257724a56e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
@@ -132,17 +132,16 @@
132 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; 132 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
133 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>; 133 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
134 clock_in_out = "input"; 134 clock_in_out = "input";
135 /* shows instability at 1GBit right now */
136 max-speed = <100>;
137 phy-supply = <&vcc_io>; 135 phy-supply = <&vcc_io>;
138 phy-mode = "rgmii"; 136 phy-mode = "rgmii";
139 pinctrl-names = "default"; 137 pinctrl-names = "default";
140 pinctrl-0 = <&rgmiim1_pins>; 138 pinctrl-0 = <&rgmiim1_pins>;
139 snps,force_thresh_dma_mode;
141 snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 140 snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
142 snps,reset-active-low; 141 snps,reset-active-low;
143 snps,reset-delays-us = <0 10000 50000>; 142 snps,reset-delays-us = <0 10000 50000>;
144 tx_delay = <0x26>; 143 tx_delay = <0x24>;
145 rx_delay = <0x11>; 144 rx_delay = <0x18>;
146 status = "okay"; 145 status = "okay";
147}; 146};
148 147
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index a037ee56fead..cae341554486 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -730,7 +730,7 @@
730 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; 730 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
731 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, 731 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
732 <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; 732 <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
733 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 733 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
734 fifo-depth = <0x100>; 734 fifo-depth = <0x100>;
735 status = "disabled"; 735 status = "disabled";
736 }; 736 };
@@ -741,7 +741,7 @@
741 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; 741 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
742 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, 742 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
743 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; 743 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
744 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 744 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
745 fifo-depth = <0x100>; 745 fifo-depth = <0x100>;
746 status = "disabled"; 746 status = "disabled";
747 }; 747 };
@@ -752,7 +752,7 @@
752 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; 752 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
753 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, 753 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
754 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; 754 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
755 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 755 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
756 fifo-depth = <0x100>; 756 fifo-depth = <0x100>;
757 status = "disabled"; 757 status = "disabled";
758 }; 758 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index aa4d07046a7b..03458ac44201 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -257,7 +257,7 @@
257 max-frequency = <150000000>; 257 max-frequency = <150000000>;
258 clocks = <&cru HCLK_SDIO0>, <&cru SCLK_SDIO0>, 258 clocks = <&cru HCLK_SDIO0>, <&cru SCLK_SDIO0>,
259 <&cru SCLK_SDIO0_DRV>, <&cru SCLK_SDIO0_SAMPLE>; 259 <&cru SCLK_SDIO0_DRV>, <&cru SCLK_SDIO0_SAMPLE>;
260 clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; 260 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
261 fifo-depth = <0x100>; 261 fifo-depth = <0x100>;
262 interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; 262 interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
263 resets = <&cru SRST_SDIO0>; 263 resets = <&cru SRST_SDIO0>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
index 0f873c897d0d..ce592a4c0c4c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
@@ -457,7 +457,7 @@
457 assigned-clocks = <&cru SCLK_PCIEPHY_REF>; 457 assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
458 assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>; 458 assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
459 assigned-clock-rates = <100000000>; 459 assigned-clock-rates = <100000000>;
460 ep-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; 460 ep-gpios = <&gpio2 RK_PA4 GPIO_ACTIVE_HIGH>;
461 num-lanes = <4>; 461 num-lanes = <4>;
462 pinctrl-names = "default"; 462 pinctrl-names = "default";
463 pinctrl-0 = <&pcie_clkreqn_cpm>; 463 pinctrl-0 = <&pcie_clkreqn_cpm>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 7aa2144e0d47..2605118d4b4c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1739,8 +1739,8 @@
1739 compatible = "rockchip,rk3399-edp"; 1739 compatible = "rockchip,rk3399-edp";
1740 reg = <0x0 0xff970000 0x0 0x8000>; 1740 reg = <0x0 0xff970000 0x0 0x8000>;
1741 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH 0>; 1741 interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH 0>;
1742 clocks = <&cru PCLK_EDP>, <&cru PCLK_EDP_CTRL>; 1742 clocks = <&cru PCLK_EDP>, <&cru PCLK_EDP_CTRL>, <&cru PCLK_VIO_GRF>;
1743 clock-names = "dp", "pclk"; 1743 clock-names = "dp", "pclk", "grf";
1744 pinctrl-names = "default"; 1744 pinctrl-names = "default";
1745 pinctrl-0 = <&edp_hpd>; 1745 pinctrl-0 = <&edp_hpd>;
1746 power-domains = <&power RK3399_PD_EDP>; 1746 power-domains = <&power RK3399_PD_EDP>;
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
index 2452b2243f42..9b4dc41703e3 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
@@ -1,14 +1,13 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD11 Global Board 2//
3 * 3// Device Tree Source for UniPhier LD11 Global Board
4 * Copyright (C) 2016-2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2016-2017 Socionext Inc.
6 * Kunihiko Hayashi <hayashi.kunihiko@socionext.com> 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * 7// Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
8 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
9 */
10 8
11/dts-v1/; 9/dts-v1/;
10#include <dt-bindings/gpio/uniphier-gpio.h>
12#include "uniphier-ld11.dtsi" 11#include "uniphier-ld11.dtsi"
13 12
14/ { 13/ {
@@ -37,6 +36,53 @@
37 device_type = "memory"; 36 device_type = "memory";
38 reg = <0 0x80000000 0 0x40000000>; 37 reg = <0 0x80000000 0 0x40000000>;
39 }; 38 };
39
40 dvdd_reg: reg-fixed {
41 compatible = "regulator-fixed";
42 regulator-name = "DVDD";
43 regulator-min-microvolt = <3300000>;
44 regulator-max-microvolt = <3300000>;
45 };
46
47 amp_vcc_reg: reg-fixed {
48 compatible = "regulator-fixed";
49 regulator-name = "AMP_VCC";
50 regulator-min-microvolt = <24000000>;
51 regulator-max-microvolt = <24000000>;
52 };
53
54 sound {
55 compatible = "audio-graph-card";
56 label = "UniPhier LD11";
57 widgets = "Headphone", "Headphone Jack";
58 dais = <&i2s_port2
59 &i2s_port3
60 &i2s_port4
61 &spdif_port0
62 &comp_spdif_port0>;
63 };
64
65 spdif-out {
66 compatible = "linux,spdif-dit";
67 #sound-dai-cells = <0>;
68
69 port@0 {
70 spdif_tx: endpoint {
71 remote-endpoint = <&spdif_hiecout1>;
72 };
73 };
74 };
75
76 comp-spdif-out {
77 compatible = "linux,spdif-dit";
78 #sound-dai-cells = <0>;
79
80 port@0 {
81 comp_spdif_tx: endpoint {
82 remote-endpoint = <&comp_spdif_hiecout1>;
83 };
84 };
85 };
40}; 86};
41 87
42&serial0 { 88&serial0 {
@@ -47,9 +93,43 @@
47 status = "okay"; 93 status = "okay";
48}; 94};
49 95
96&i2s_hpcmout1 {
97 dai-format = "i2s";
98 remote-endpoint = <&tas_speaker>;
99};
100
101&spdif_hiecout1 {
102 remote-endpoint = <&spdif_tx>;
103};
104
105&comp_spdif_hiecout1 {
106 remote-endpoint = <&comp_spdif_tx>;
107};
108
50&i2c0 { 109&i2c0 {
51 status = "okay"; 110 status = "okay";
52 111
112 tas5707a@1d {
113 compatible = "ti,tas5711";
114 reg = <0x1d>;
115 reset-gpios = <&gpio UNIPHIER_GPIO_PORT(23, 4) GPIO_ACTIVE_LOW>;
116 pdn-gpios = <&gpio UNIPHIER_GPIO_PORT(23, 5) GPIO_ACTIVE_LOW>;
117 #sound-dai-cells = <0>;
118 AVDD-supply = <&dvdd_reg>;
119 DVDD-supply = <&dvdd_reg>;
120 PVDD_A-supply = <&amp_vcc_reg>;
121 PVDD_B-supply = <&amp_vcc_reg>;
122 PVDD_C-supply = <&amp_vcc_reg>;
123 PVDD_D-supply = <&amp_vcc_reg>;
124
125 port@0 {
126 tas_speaker: endpoint {
127 dai-format = "i2s";
128 remote-endpoint = <&i2s_hpcmout1>;
129 };
130 };
131 };
132
53 eeprom@50 { 133 eeprom@50 {
54 compatible = "st,24c64", "atmel,24c64"; 134 compatible = "st,24c64", "atmel,24c64";
55 reg = <0x50>; 135 reg = <0x50>;
@@ -69,6 +149,17 @@
69 status = "okay"; 149 status = "okay";
70}; 150};
71 151
152&eth {
153 status = "okay";
154 phy-handle = <&ethphy>;
155};
156
157&mdio {
158 ethphy: ethphy@1 {
159 reg = <1>;
160 };
161};
162
72&nand { 163&nand {
73 status = "okay"; 164 status = "okay";
74}; 165};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
index 54c53170699a..b8f627348448 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD11 Reference Board 2//
3 * 3// Device Tree Source for UniPhier LD11 Reference Board
4 * Copyright (C) 2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-ld11.dtsi" 9#include "uniphier-ld11.dtsi"
@@ -70,3 +68,14 @@
70&usb2 { 68&usb2 {
71 status = "okay"; 69 status = "okay";
72}; 70};
71
72&eth {
73 status = "okay";
74 phy-handle = <&ethphy>;
75};
76
77&mdio {
78 ethphy: ethphy@1 {
79 reg = <1>;
80 };
81};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
index cd7c2d0a1f64..efa95573b2aa 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD11 SoC 2//
3 * 3// Device Tree Source for UniPhier LD11 SoC
4 * Copyright (C) 2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/gpio.h> 8#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/gpio/uniphier-gpio.h> 9#include <dt-bindings/gpio/uniphier-gpio.h>
@@ -187,6 +185,91 @@
187 <21 217 3>; 185 <21 217 3>;
188 }; 186 };
189 187
188 audio@56000000 {
189 compatible = "socionext,uniphier-ld11-aio";
190 reg = <0x56000000 0x80000>;
191 interrupts = <0 144 4>;
192 pinctrl-names = "default";
193 pinctrl-0 = <&pinctrl_aout1>,
194 <&pinctrl_aoutiec1>;
195 clock-names = "aio";
196 clocks = <&sys_clk 40>;
197 reset-names = "aio";
198 resets = <&sys_rst 40>;
199 #sound-dai-cells = <1>;
200
201 i2s_port0: port@0 {
202 i2s_hdmi: endpoint {
203 };
204 };
205
206 i2s_port1: port@1 {
207 i2s_pcmin2: endpoint {
208 };
209 };
210
211 i2s_port2: port@2 {
212 i2s_line: endpoint {
213 dai-format = "i2s";
214 remote-endpoint = <&evea_line>;
215 };
216 };
217
218 i2s_port3: port@3 {
219 i2s_hpcmout1: endpoint {
220 };
221 };
222
223 i2s_port4: port@4 {
224 i2s_hp: endpoint {
225 dai-format = "i2s";
226 remote-endpoint = <&evea_hp>;
227 };
228 };
229
230 spdif_port0: port@5 {
231 spdif_hiecout1: endpoint {
232 };
233 };
234
235 src_port0: port@6 {
236 i2s_epcmout2: endpoint {
237 };
238 };
239
240 src_port1: port@7 {
241 i2s_epcmout3: endpoint {
242 };
243 };
244
245 comp_spdif_port0: port@8 {
246 comp_spdif_hiecout1: endpoint {
247 };
248 };
249 };
250
251 codec@57900000 {
252 compatible = "socionext,uniphier-evea";
253 reg = <0x57900000 0x1000>;
254 clock-names = "evea", "exiv";
255 clocks = <&sys_clk 41>, <&sys_clk 42>;
256 reset-names = "evea", "exiv", "adamv";
257 resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
258 #sound-dai-cells = <1>;
259
260 port@0 {
261 evea_line: endpoint {
262 remote-endpoint = <&i2s_line>;
263 };
264 };
265
266 port@1 {
267 evea_hp: endpoint {
268 remote-endpoint = <&i2s_hp>;
269 };
270 };
271 };
272
190 adamv@57920000 { 273 adamv@57920000 {
191 compatible = "socionext,uniphier-ld11-adamv", 274 compatible = "socionext,uniphier-ld11-adamv",
192 "simple-mfd", "syscon"; 275 "simple-mfd", "syscon";
@@ -460,6 +543,22 @@
460 }; 543 };
461 }; 544 };
462 545
546 eth: ethernet@65000000 {
547 compatible = "socionext,uniphier-ld11-ave4";
548 status = "disabled";
549 reg = <0x65000000 0x8500>;
550 interrupts = <0 66 4>;
551 clocks = <&sys_clk 6>;
552 resets = <&sys_rst 6>;
553 phy-mode = "rmii";
554 local-mac-address = [00 00 00 00 00 00];
555
556 mdio: mdio {
557 #address-cells = <1>;
558 #size-cells = <0>;
559 };
560 };
561
463 nand: nand@68000000 { 562 nand: nand@68000000 {
464 compatible = "socionext,uniphier-denali-nand-v5b"; 563 compatible = "socionext,uniphier-denali-nand-v5b";
465 status = "disabled"; 564 status = "disabled";
@@ -475,3 +574,12 @@
475}; 574};
476 575
477#include "uniphier-pinctrl.dtsi" 576#include "uniphier-pinctrl.dtsi"
577
578&pinctrl_aoutiec1 {
579 drive-strength = <4>; /* default: 4mA */
580
581 ao1arc {
582 pins = "AO1ARC";
583 drive-strength = <8>; /* 8mA */
584 };
585};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
index fc2bc9d75d35..fe6608ea3277 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
@@ -1,14 +1,13 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD20 Global Board 2//
3 * 3// Device Tree Source for UniPhier LD20 Global Board
4 * Copyright (C) 2015-2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2017 Socionext Inc.
6 * Kunihiko Hayashi <hayashi.kunihiko@socionext.com> 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * 7// Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
8 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
9 */
10 8
11/dts-v1/; 9/dts-v1/;
10#include <dt-bindings/gpio/uniphier-gpio.h>
12#include "uniphier-ld20.dtsi" 11#include "uniphier-ld20.dtsi"
13 12
14/ { 13/ {
@@ -37,6 +36,53 @@
37 device_type = "memory"; 36 device_type = "memory";
38 reg = <0 0x80000000 0 0xc0000000>; 37 reg = <0 0x80000000 0 0xc0000000>;
39 }; 38 };
39
40 dvdd_reg: reg-fixed {
41 compatible = "regulator-fixed";
42 regulator-name = "DVDD";
43 regulator-min-microvolt = <3300000>;
44 regulator-max-microvolt = <3300000>;
45 };
46
47 amp_vcc_reg: reg-fixed {
48 compatible = "regulator-fixed";
49 regulator-name = "AMP_VCC";
50 regulator-min-microvolt = <12000000>;
51 regulator-max-microvolt = <12000000>;
52 };
53
54 sound {
55 compatible = "audio-graph-card";
56 label = "UniPhier LD20";
57 widgets = "Headphone", "Headphone Jack";
58 dais = <&i2s_port2
59 &i2s_port3
60 &i2s_port4
61 &spdif_port0
62 &comp_spdif_port0>;
63 };
64
65 spdif-out {
66 compatible = "linux,spdif-dit";
67 #sound-dai-cells = <0>;
68
69 port@0 {
70 spdif_tx: endpoint {
71 remote-endpoint = <&spdif_hiecout1>;
72 };
73 };
74 };
75
76 comp-spdif-out {
77 compatible = "linux,spdif-dit";
78 #sound-dai-cells = <0>;
79
80 port@0 {
81 comp_spdif_tx: endpoint {
82 remote-endpoint = <&comp_spdif_hiecout1>;
83 };
84 };
85 };
40}; 86};
41 87
42&serial0 { 88&serial0 {
@@ -47,8 +93,55 @@
47 status = "okay"; 93 status = "okay";
48}; 94};
49 95
96&i2s_hpcmout1 {
97 dai-format = "i2s";
98 remote-endpoint = <&tas_speaker>;
99};
100
101&spdif_hiecout1 {
102 remote-endpoint = <&spdif_tx>;
103};
104
105&comp_spdif_hiecout1 {
106 remote-endpoint = <&comp_spdif_tx>;
107};
108
50&i2c0 { 109&i2c0 {
51 status = "okay"; 110 status = "okay";
111
112 tas5707@1b {
113 compatible = "ti,tas5711";
114 reg = <0x1b>;
115 reset-gpios = <&gpio UNIPHIER_GPIO_PORT(0, 0) GPIO_ACTIVE_LOW>;
116 pdn-gpios = <&gpio UNIPHIER_GPIO_PORT(0, 1) GPIO_ACTIVE_LOW>;
117 #sound-dai-cells = <0>;
118 AVDD-supply = <&dvdd_reg>;
119 DVDD-supply = <&dvdd_reg>;
120 PVDD_A-supply = <&amp_vcc_reg>;
121 PVDD_B-supply = <&amp_vcc_reg>;
122 PVDD_C-supply = <&amp_vcc_reg>;
123 PVDD_D-supply = <&amp_vcc_reg>;
124
125 port@0 {
126 tas_speaker: endpoint {
127 dai-format = "i2s";
128 remote-endpoint = <&i2s_hpcmout1>;
129 };
130 };
131 };
132};
133
134&eth {
135 status = "okay";
136 phy-mode = "rmii";
137 pinctrl-0 = <&pinctrl_ether_rmii>;
138 phy-handle = <&ethphy>;
139};
140
141&mdio {
142 ethphy: ethphy@1 {
143 reg = <1>;
144 };
52}; 145};
53 146
54&nand { 147&nand {
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
index 693371033c90..2c1a92fafbfb 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD20 Reference Board 2//
3 * 3// Device Tree Source for UniPhier LD20 Reference Board
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-ld20.dtsi" 9#include "uniphier-ld20.dtsi"
@@ -58,3 +56,14 @@
58&i2c0 { 56&i2c0 {
59 status = "okay"; 57 status = "okay";
60}; 58};
59
60&eth {
61 status = "okay";
62 phy-handle = <&ethphy>;
63};
64
65&mdio {
66 ethphy: ethphy@0 {
67 reg = <0>;
68 };
69};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
index 8a3276ba2da1..19c935688a77 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier LD20 SoC 2//
3 * 3// Device Tree Source for UniPhier LD20 SoC
4 * Copyright (C) 2015-2016 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2015-2016 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/gpio.h> 8#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/gpio/uniphier-gpio.h> 9#include <dt-bindings/gpio/uniphier-gpio.h>
@@ -287,6 +285,91 @@
287 <21 217 3>; 285 <21 217 3>;
288 }; 286 };
289 287
288 audio@56000000 {
289 compatible = "socionext,uniphier-ld20-aio";
290 reg = <0x56000000 0x80000>;
291 interrupts = <0 144 4>;
292 pinctrl-names = "default";
293 pinctrl-0 = <&pinctrl_aout1>,
294 <&pinctrl_aoutiec1>;
295 clock-names = "aio";
296 clocks = <&sys_clk 40>;
297 reset-names = "aio";
298 resets = <&sys_rst 40>;
299 #sound-dai-cells = <1>;
300
301 i2s_port0: port@0 {
302 i2s_hdmi: endpoint {
303 };
304 };
305
306 i2s_port1: port@1 {
307 i2s_pcmin2: endpoint {
308 };
309 };
310
311 i2s_port2: port@2 {
312 i2s_line: endpoint {
313 dai-format = "i2s";
314 remote-endpoint = <&evea_line>;
315 };
316 };
317
318 i2s_port3: port@3 {
319 i2s_hpcmout1: endpoint {
320 };
321 };
322
323 i2s_port4: port@4 {
324 i2s_hp: endpoint {
325 dai-format = "i2s";
326 remote-endpoint = <&evea_hp>;
327 };
328 };
329
330 spdif_port0: port@5 {
331 spdif_hiecout1: endpoint {
332 };
333 };
334
335 src_port0: port@6 {
336 i2s_epcmout2: endpoint {
337 };
338 };
339
340 src_port1: port@7 {
341 i2s_epcmout3: endpoint {
342 };
343 };
344
345 comp_spdif_port0: port@8 {
346 comp_spdif_hiecout1: endpoint {
347 };
348 };
349 };
350
351 codec@57900000 {
352 compatible = "socionext,uniphier-evea";
353 reg = <0x57900000 0x1000>;
354 clock-names = "evea", "exiv";
355 clocks = <&sys_clk 41>, <&sys_clk 42>;
356 reset-names = "evea", "exiv", "adamv";
357 resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
358 #sound-dai-cells = <1>;
359
360 port@0 {
361 evea_line: endpoint {
362 remote-endpoint = <&i2s_line>;
363 };
364 };
365
366 port@1 {
367 evea_hp: endpoint {
368 remote-endpoint = <&i2s_hp>;
369 };
370 };
371 };
372
290 adamv@57920000 { 373 adamv@57920000 {
291 compatible = "socionext,uniphier-ld20-adamv", 374 compatible = "socionext,uniphier-ld20-adamv",
292 "simple-mfd", "syscon"; 375 "simple-mfd", "syscon";
@@ -513,6 +596,24 @@
513 }; 596 };
514 }; 597 };
515 598
599 eth: ethernet@65000000 {
600 compatible = "socionext,uniphier-ld20-ave4";
601 status = "disabled";
602 reg = <0x65000000 0x8500>;
603 interrupts = <0 66 4>;
604 pinctrl-names = "default";
605 pinctrl-0 = <&pinctrl_ether_rgmii>;
606 clocks = <&sys_clk 6>;
607 resets = <&sys_rst 6>;
608 phy-mode = "rgmii";
609 local-mac-address = [00 00 00 00 00 00];
610
611 mdio: mdio {
612 #address-cells = <1>;
613 #size-cells = <0>;
614 };
615 };
616
516 nand: nand@68000000 { 617 nand: nand@68000000 {
517 compatible = "socionext,uniphier-denali-nand-v5b"; 618 compatible = "socionext,uniphier-denali-nand-v5b";
518 status = "disabled"; 619 status = "disabled";
@@ -528,3 +629,21 @@
528}; 629};
529 630
530#include "uniphier-pinctrl.dtsi" 631#include "uniphier-pinctrl.dtsi"
632
633&pinctrl_aout1 {
634 drive-strength = <4>; /* default: 3.5mA */
635
636 ao1dacck {
637 pins = "AO1DACCK";
638 drive-strength = <5>; /* 5mA */
639 };
640};
641
642&pinctrl_aoutiec1 {
643 drive-strength = <4>; /* default: 3.5mA */
644
645 ao1arc {
646 pins = "AO1ARC";
647 drive-strength = <11>; /* 11mA */
648 };
649};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
index 3c7108729827..e62d068776d5 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier PXs3 Reference Board 2//
3 * 3// Device Tree Source for UniPhier PXs3 Reference Board
4 * Copyright (C) 2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2017 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10/dts-v1/; 8/dts-v1/;
11#include "uniphier-pxs3.dtsi" 9#include "uniphier-pxs3.dtsi"
diff --git a/arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi b/arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi
index 234fc58cc599..b537a3c0071f 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-pxs3.dtsi
@@ -1,11 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2 * Device Tree Source for UniPhier PXs3 SoC 2//
3 * 3// Device Tree Source for UniPhier PXs3 SoC
4 * Copyright (C) 2017 Socionext Inc. 4//
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5// Copyright (C) 2017 Socionext Inc.
6 * 6// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
8 */
9 7
10#include <dt-bindings/gpio/gpio.h> 8#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/gpio/uniphier-gpio.h> 9#include <dt-bindings/gpio/uniphier-gpio.h>
diff --git a/arch/arm64/boot/dts/sprd/sc2731.dtsi b/arch/arm64/boot/dts/sprd/sc2731.dtsi
new file mode 100644
index 000000000000..4331006185bf
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd/sc2731.dtsi
@@ -0,0 +1,169 @@
1/*
2 * Spreadtrum SC2731 PMIC dts file
3 *
4 * Copyright (C) 2018, Spreadtrum Communications Inc.
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */
8
9&adi_bus {
10 sc2731_pmic: pmic@0 {
11 compatible = "sprd,sc2731";
12 reg = <0>;
13 spi-max-frequency = <26000000>;
14 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
15 interrupt-controller;
16 #interrupt-cells = <2>;
17 #address-cells = <1>;
18 #size-cells = <0>;
19
20 rtc@280 {
21 compatible = "sprd,sc27xx-rtc", "sprd,sc2731-rtc";
22 reg = <0x280>;
23 interrupt-parent = <&sc2731_pmic>;
24 interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
25 };
26
27 regulators {
28 compatible = "sprd,sc27xx-regulator";
29
30 vddarm0: BUCK_CPU0 {
31 regulator-name = "vddarm0";
32 regulator-min-microvolt = <400000>;
33 regulator-max-microvolt = <1996875>;
34 regulator-ramp-delay = <25000>;
35 regulator-always-on;
36 };
37
38 vddarm1: BUCK_CPU1 {
39 regulator-name = "vddarm1";
40 regulator-min-microvolt = <400000>;
41 regulator-max-microvolt = <1996875>;
42 regulator-ramp-delay = <25000>;
43 regulator-always-on;
44 };
45
46 dcdcrf: BUCK_RF {
47 regulator-name = "dcdcrf";
48 regulator-min-microvolt = <600000>;
49 regulator-max-microvolt = <2196875>;
50 regulator-ramp-delay = <25000>;
51 regulator-enable-ramp-delay = <100>;
52 regulator-always-on;
53 };
54
55 vddcama0: LDO_CAMA0 {
56 regulator-name = "vddcama0";
57 regulator-min-microvolt = <1200000>;
58 regulator-max-microvolt = <3750000>;
59 regulator-enable-ramp-delay = <100>;
60 };
61
62 vddcama1: LDO_CAMA1 {
63 regulator-name = "vddcama1";
64 regulator-min-microvolt = <1200000>;
65 regulator-max-microvolt = <3750000>;
66 regulator-enable-ramp-delay = <100>;
67 regulator-ramp-delay = <25000>;
68 };
69
70 vddcammot: LDO_CAMMOT {
71 regulator-name = "vddcammot";
72 regulator-min-microvolt = <1200000>;
73 regulator-max-microvolt = <3750000>;
74 regulator-enable-ramp-delay = <100>;
75 regulator-ramp-delay = <25000>;
76 };
77
78 vddvldo: LDO_VLDO {
79 regulator-name = "vddvldo";
80 regulator-min-microvolt = <1200000>;
81 regulator-max-microvolt = <3750000>;
82 regulator-enable-ramp-delay = <100>;
83 regulator-ramp-delay = <25000>;
84 };
85
86 vddemmccore: LDO_EMMCCORE {
87 regulator-name = "vddemmccore";
88 regulator-min-microvolt = <1200000>;
89 regulator-max-microvolt = <3750000>;
90 regulator-enable-ramp-delay = <100>;
91 regulator-ramp-delay = <25000>;
92 regulator-boot-on;
93 };
94
95 vddsdcore: LDO_SDCORE {
96 regulator-name = "vddsdcore";
97 regulator-min-microvolt = <1200000>;
98 regulator-max-microvolt = <3750000>;
99 regulator-enable-ramp-delay = <100>;
100 regulator-ramp-delay = <25000>;
101 };
102
103 vddsdio: LDO_SDIO {
104 regulator-name = "vddsdio";
105 regulator-min-microvolt = <1200000>;
106 regulator-max-microvolt = <3750000>;
107 regulator-enable-ramp-delay = <100>;
108 regulator-ramp-delay = <25000>;
109 };
110
111 vddwifipa: LDO_WIFIPA {
112 regulator-name = "vddwifipa";
113 regulator-min-microvolt = <1200000>;
114 regulator-max-microvolt = <3750000>;
115 regulator-enable-ramp-delay = <100>;
116 regulator-ramp-delay = <25000>;
117 };
118
119 vddusb33: LDO_USB33 {
120 regulator-name = "vddusb33";
121 regulator-min-microvolt = <1200000>;
122 regulator-max-microvolt = <3750000>;
123 regulator-enable-ramp-delay = <100>;
124 regulator-ramp-delay = <25000>;
125 };
126
127 vddcamd0: LDO_CAMD0 {
128 regulator-name = "vddcamd0";
129 regulator-min-microvolt = <1000000>;
130 regulator-max-microvolt = <1793750>;
131 regulator-enable-ramp-delay = <100>;
132 regulator-ramp-delay = <25000>;
133 };
134
135 vddcamd1: LDO_CAMD1 {
136 regulator-name = "vddcamd1";
137 regulator-min-microvolt = <1000000>;
138 regulator-max-microvolt = <1793750>;
139 regulator-enable-ramp-delay = <100>;
140 regulator-ramp-delay = <25000>;
141 };
142
143 vddcon: LDO_CON {
144 regulator-name = "vddcon";
145 regulator-min-microvolt = <1000000>;
146 regulator-max-microvolt = <1793750>;
147 regulator-enable-ramp-delay = <100>;
148 regulator-ramp-delay = <25000>;
149 };
150
151 vddcamio: LDO_CAMIO {
152 regulator-name = "vddcamio";
153 regulator-min-microvolt = <1000000>;
154 regulator-max-microvolt = <1793750>;
155 regulator-enable-ramp-delay = <100>;
156 regulator-ramp-delay = <25000>;
157 };
158
159 vddsram: LDO_SRAM {
160 regulator-name = "vddsram";
161 regulator-min-microvolt = <1000000>;
162 regulator-max-microvolt = <1793750>;
163 regulator-enable-ramp-delay = <100>;
164 regulator-ramp-delay = <25000>;
165 regulator-always-on;
166 };
167 };
168 };
169};
diff --git a/arch/arm64/boot/dts/sprd/sp9860g-1h10.dts b/arch/arm64/boot/dts/sprd/sp9860g-1h10.dts
index ae0b28ce6319..985ebb5d157e 100644
--- a/arch/arm64/boot/dts/sprd/sp9860g-1h10.dts
+++ b/arch/arm64/boot/dts/sprd/sp9860g-1h10.dts
@@ -9,6 +9,7 @@
9/dts-v1/; 9/dts-v1/;
10 10
11#include "sc9860.dtsi" 11#include "sc9860.dtsi"
12#include "sc2731.dtsi"
12 13
13/ { 14/ {
14 model = "Spreadtrum SP9860G 3GFHD Board"; 15 model = "Spreadtrum SP9860G 3GFHD Board";
@@ -20,6 +21,7 @@
20 serial1 = &uart1; /* UART console */ 21 serial1 = &uart1; /* UART console */
21 serial2 = &uart2; /* Reserved */ 22 serial2 = &uart2; /* Reserved */
22 serial3 = &uart3; /* for GPS */ 23 serial3 = &uart3; /* for GPS */
24 spi0 = &adi_bus;
23 }; 25 };
24 26
25 memory{ 27 memory{
diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
index 328009c4638c..66a881e6da92 100644
--- a/arch/arm64/boot/dts/sprd/whale2.dtsi
+++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
@@ -6,6 +6,8 @@
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */ 7 */
8 8
9#include <dt-bindings/clock/sprd,sc9860-clk.h>
10
9/ { 11/ {
10 interrupt-parent = <&gic>; 12 interrupt-parent = <&gic>;
11 #address-cells = <2>; 13 #address-cells = <2>;
@@ -104,6 +106,85 @@
104 status = "disabled"; 106 status = "disabled";
105 }; 107 };
106 }; 108 };
109
110 ap-ahb {
111 compatible = "simple-bus";
112 #address-cells = <2>;
113 #size-cells = <2>;
114 ranges;
115
116 ap_dma: dma-controller@20100000 {
117 compatible = "sprd,sc9860-dma";
118 reg = <0 0x20100000 0 0x4000>;
119 interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
120 #dma-cells = <1>;
121 #dma-channels = <32>;
122 clock-names = "enable";
123 clocks = <&apahb_gate CLK_DMA_EB>;
124 };
125 };
126
127 aon {
128 compatible = "simple-bus";
129 #address-cells = <2>;
130 #size-cells = <2>;
131 ranges;
132
133 adi_bus: spi@40030000 {
134 compatible = "sprd,sc9860-adi";
135 reg = <0 0x40030000 0 0x10000>;
136 hwlocks = <&hwlock 0>;
137 hwlock-names = "adi";
138 #address-cells = <1>;
139 #size-cells = <0>;
140 };
141
142 timer@40050000 {
143 compatible = "sprd,sc9860-timer";
144 reg = <0 0x40050000 0 0x20>;
145 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
146 clocks = <&ext_32k>;
147 };
148
149 hwlock: hwspinlock@40500000 {
150 compatible = "sprd,hwspinlock-r3p0";
151 reg = <0 0x40500000 0 0x1000>;
152 #hwlock-cells = <1>;
153 clock-names = "enable";
154 clocks = <&aon_gate CLK_SPLK_EB>;
155 };
156
157 pin_controller: pinctrl@402a0000 {
158 compatible = "sprd,sc9860-pinctrl";
159 reg = <0 0x402a0000 0 0x10000>;
160 };
161
162 watchdog@40310000 {
163 compatible = "sprd,sp9860-wdt";
164 reg = <0 0x40310000 0 0x1000>;
165 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
166 timeout-sec = <12>;
167 clock-names = "enable";
168 clocks = <&aon_gate CLK_APCPU_WDG_EB>;
169 };
170 };
171
172 agcp {
173 compatible = "simple-bus";
174 #address-cells = <2>;
175 #size-cells = <2>;
176 ranges;
177
178 agcp_dma: dma-controller@41580000 {
179 compatible = "sprd,sc9860-dma";
180 reg = <0 0x41580000 0 0x4000>;
181 #dma-cells = <1>;
182 #dma-channels = <32>;
183 clock-names = "enable", "ashb_eb";
184 clocks = <&agcp_gate CLK_AGCP_DMAAP_EB>,
185 <&agcp_gate CLK_AGCP_AP_ASHB_EB>;
186 };
187 };
107 }; 188 };
108 189
109 ext_32k: ext_32k { 190 ext_32k: ext_32k {
diff --git a/arch/arm64/boot/dts/xilinx/Makefile b/arch/arm64/boot/dts/xilinx/Makefile
index a2d67084a514..c2a0c00272e2 100644
--- a/arch/arm64/boot/dts/xilinx/Makefile
+++ b/arch/arm64/boot/dts/xilinx/Makefile
@@ -1 +1,17 @@
1# SPDX-License-Identifier: GPL-2.0
1dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-ep108.dtb 2dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-ep108.dtb
3dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1232-revA.dtb
4dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1254-revA.dtb
5dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1275-revA.dtb
6dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1751-xm015-dc1.dtb
7dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1751-xm016-dc2.dtb
8dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1751-xm017-dc3.dtb
9dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1751-xm018-dc4.dtb
10dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zc1751-xm019-dc5.dtb
11dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu100-revC.dtb
12dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-revA.dtb
13dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-revB.dtb
14dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-rev1.0.dtb
15dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu104-revA.dtb
16dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu106-revA.dtb
17dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu111-revA.dtb
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi
new file mode 100644
index 000000000000..9c09baca7dd7
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi
@@ -0,0 +1,213 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Clock specification for Xilinx ZynqMP
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/ {
11 clk100: clk100 {
12 compatible = "fixed-clock";
13 #clock-cells = <0>;
14 clock-frequency = <100000000>;
15 };
16
17 clk125: clk125 {
18 compatible = "fixed-clock";
19 #clock-cells = <0>;
20 clock-frequency = <125000000>;
21 };
22
23 clk200: clk200 {
24 compatible = "fixed-clock";
25 #clock-cells = <0>;
26 clock-frequency = <200000000>;
27 };
28
29 clk250: clk250 {
30 compatible = "fixed-clock";
31 #clock-cells = <0>;
32 clock-frequency = <250000000>;
33 };
34
35 clk300: clk300 {
36 compatible = "fixed-clock";
37 #clock-cells = <0>;
38 clock-frequency = <300000000>;
39 };
40
41 clk600: clk600 {
42 compatible = "fixed-clock";
43 #clock-cells = <0>;
44 clock-frequency = <600000000>;
45 };
46
47 dp_aclk: clock0 {
48 compatible = "fixed-clock";
49 #clock-cells = <0>;
50 clock-frequency = <100000000>;
51 clock-accuracy = <100>;
52 };
53
54 dp_aud_clk: clock1 {
55 compatible = "fixed-clock";
56 #clock-cells = <0>;
57 clock-frequency = <24576000>;
58 clock-accuracy = <100>;
59 };
60
61 dpdma_clk: dpdma_clk {
62 compatible = "fixed-clock";
63 #clock-cells = <0x0>;
64 clock-frequency = <533000000>;
65 };
66
67 drm_clock: drm_clock {
68 compatible = "fixed-clock";
69 #clock-cells = <0x0>;
70 clock-frequency = <262750000>;
71 clock-accuracy = <0x64>;
72 };
73};
74
75&can0 {
76 clocks = <&clk100 &clk100>;
77};
78
79&can1 {
80 clocks = <&clk100 &clk100>;
81};
82
83&fpd_dma_chan1 {
84 clocks = <&clk600>, <&clk100>;
85};
86
87&fpd_dma_chan2 {
88 clocks = <&clk600>, <&clk100>;
89};
90
91&fpd_dma_chan3 {
92 clocks = <&clk600>, <&clk100>;
93};
94
95&fpd_dma_chan4 {
96 clocks = <&clk600>, <&clk100>;
97};
98
99&fpd_dma_chan5 {
100 clocks = <&clk600>, <&clk100>;
101};
102
103&fpd_dma_chan6 {
104 clocks = <&clk600>, <&clk100>;
105};
106
107&fpd_dma_chan7 {
108 clocks = <&clk600>, <&clk100>;
109};
110
111&fpd_dma_chan8 {
112 clocks = <&clk600>, <&clk100>;
113};
114
115&lpd_dma_chan1 {
116 clocks = <&clk600>, <&clk100>;
117};
118
119&lpd_dma_chan2 {
120 clocks = <&clk600>, <&clk100>;
121};
122
123&lpd_dma_chan3 {
124 clocks = <&clk600>, <&clk100>;
125};
126
127&lpd_dma_chan4 {
128 clocks = <&clk600>, <&clk100>;
129};
130
131&lpd_dma_chan5 {
132 clocks = <&clk600>, <&clk100>;
133};
134
135&lpd_dma_chan6 {
136 clocks = <&clk600>, <&clk100>;
137};
138
139&lpd_dma_chan7 {
140 clocks = <&clk600>, <&clk100>;
141};
142
143&lpd_dma_chan8 {
144 clocks = <&clk600>, <&clk100>;
145};
146
147&gem0 {
148 clocks = <&clk125>, <&clk125>, <&clk125>;
149};
150
151&gem1 {
152 clocks = <&clk125>, <&clk125>, <&clk125>;
153};
154
155&gem2 {
156 clocks = <&clk125>, <&clk125>, <&clk125>;
157};
158
159&gem3 {
160 clocks = <&clk125>, <&clk125>, <&clk125>;
161};
162
163&gpio {
164 clocks = <&clk100>;
165};
166
167&i2c0 {
168 clocks = <&clk100>;
169};
170
171&i2c1 {
172 clocks = <&clk100>;
173};
174
175&sata {
176 clocks = <&clk250>;
177};
178
179&sdhci0 {
180 clocks = <&clk200 &clk200>;
181};
182
183&sdhci1 {
184 clocks = <&clk200 &clk200>;
185};
186
187&spi0 {
188 clocks = <&clk200 &clk200>;
189};
190
191&spi1 {
192 clocks = <&clk200 &clk200>;
193};
194
195&uart0 {
196 clocks = <&clk100 &clk100>;
197};
198
199&uart1 {
200 clocks = <&clk100 &clk100>;
201};
202
203&usb0 {
204 clocks = <&clk250>, <&clk250>;
205};
206
207&usb1 {
208 clocks = <&clk250>, <&clk250>;
209};
210
211&watchdog0 {
212 clocks = <&clk250>;
213};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-ep108-clk.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-ep108-clk.dtsi
index b87b8316f4ac..9f5eedbc2139 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp-ep108-clk.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-ep108-clk.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0+
1/* 2/*
2 * clock specification for Xilinx ZynqMP ep108 development board 3 * clock specification for Xilinx ZynqMP ep108 development board
3 * 4 *
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts b/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
index bf552674a834..4b0684911626 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0+
1/* 2/*
2 * dts file for Xilinx ZynqMP ep108 development board 3 * dts file for Xilinx ZynqMP ep108 development board
3 * 4 *
@@ -47,7 +48,7 @@
47 status = "okay"; 48 status = "okay";
48 phy-handle = <&phy0>; 49 phy-handle = <&phy0>;
49 phy-mode = "rgmii-id"; 50 phy-mode = "rgmii-id";
50 phy0: phy@0{ 51 phy0: phy@0 {
51 reg = <0>; 52 reg = <0>;
52 max-speed = <100>; 53 max-speed = <100>;
53 }; 54 };
@@ -78,10 +79,20 @@
78&sata { 79&sata {
79 status = "okay"; 80 status = "okay";
80 ceva,broken-gen2; 81 ceva,broken-gen2;
82 /* SATA Phy OOB timing settings */
83 ceva,p0-cominit-params = /bits/ 8 <0x0F 0x25 0x18 0x29>;
84 ceva,p0-comwake-params = /bits/ 8 <0x04 0x0B 0x08 0x0F>;
85 ceva,p0-burst-params = /bits/ 8 <0x0A 0x08 0x4A 0x06>;
86 ceva,p0-retry-params = /bits/ 16 <0x0216 0x7F06>;
87 ceva,p1-cominit-params = /bits/ 8 <0x0F 0x25 0x18 0x29>;
88 ceva,p1-comwake-params = /bits/ 8 <0x04 0x0B 0x08 0x0F>;
89 ceva,p1-burst-params = /bits/ 8 <0x0A 0x08 0x4A 0x06>;
90 ceva,p1-retry-params = /bits/ 16 <0x0216 0x7F06>;
81}; 91};
82 92
83&sdhci0 { 93&sdhci0 {
84 status = "okay"; 94 status = "okay";
95 bus-width = <8>;
85}; 96};
86 97
87&sdhci1 { 98&sdhci1 {
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dts
new file mode 100644
index 000000000000..0f7b4cf6078e
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dts
@@ -0,0 +1,54 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZC1232
4 *
5 * (C) Copyright 2017 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14
15/ {
16 model = "ZynqMP ZC1232 RevA";
17 compatible = "xlnx,zynqmp-zc1232-revA", "xlnx,zynqmp-zc1232", "xlnx,zynqmp";
18
19 aliases {
20 serial0 = &uart0;
21 serial1 = &dcc;
22 };
23
24 chosen {
25 bootargs = "earlycon";
26 stdout-path = "serial0:115200n8";
27 };
28
29 memory@0 {
30 device_type = "memory";
31 reg = <0x0 0x0 0x0 0x80000000>;
32 };
33};
34
35&dcc {
36 status = "okay";
37};
38
39&sata {
40 status = "okay";
41 /* SATA OOB timing settings */
42 ceva,p0-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
43 ceva,p0-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
44 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
45 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
46 ceva,p1-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
47 ceva,p1-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
48 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
49 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
50};
51
52&uart0 {
53 status = "okay";
54};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dts
new file mode 100644
index 000000000000..9092828f92ec
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dts
@@ -0,0 +1,42 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZC1254
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 * Siva Durga Prasad Paladugu <sivadur@xilinx.com>
9 */
10
11/dts-v1/;
12
13#include "zynqmp.dtsi"
14#include "zynqmp-clk.dtsi"
15
16/ {
17 model = "ZynqMP ZC1254 RevA";
18 compatible = "xlnx,zynqmp-zc1254-revA", "xlnx,zynqmp-zc1254", "xlnx,zynqmp";
19
20 aliases {
21 serial0 = &uart0;
22 serial1 = &dcc;
23 };
24
25 chosen {
26 bootargs = "earlycon";
27 stdout-path = "serial0:115200n8";
28 };
29
30 memory@0 {
31 device_type = "memory";
32 reg = <0x0 0x0 0x0 0x80000000>;
33 };
34};
35
36&dcc {
37 status = "okay";
38};
39
40&uart0 {
41 status = "okay";
42};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dts
new file mode 100644
index 000000000000..4f404c580eec
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dts
@@ -0,0 +1,42 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZC1275
4 *
5 * (C) Copyright 2017 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 * Siva Durga Prasad Paladugu <sivadur@xilinx.com>
9 */
10
11/dts-v1/;
12
13#include "zynqmp.dtsi"
14#include "zynqmp-clk.dtsi"
15
16/ {
17 model = "ZynqMP ZC1275 RevA";
18 compatible = "xlnx,zynqmp-zc1275-revA", "xlnx,zynqmp-zc1275", "xlnx,zynqmp";
19
20 aliases {
21 serial0 = &uart0;
22 serial1 = &dcc;
23 };
24
25 chosen {
26 bootargs = "earlycon";
27 stdout-path = "serial0:115200n8";
28 };
29
30 memory@0 {
31 device_type = "memory";
32 reg = <0x0 0x0 0x0 0x80000000>;
33 };
34};
35
36&dcc {
37 status = "okay";
38};
39
40&uart0 {
41 status = "okay";
42};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dts
new file mode 100644
index 000000000000..9a3e39d1294f
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dts
@@ -0,0 +1,131 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP zc1751-xm015-dc1
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/gpio/gpio.h>
15
16/ {
17 model = "ZynqMP zc1751-xm015-dc1 RevA";
18 compatible = "xlnx,zynqmp-zc1751", "xlnx,zynqmp";
19
20 aliases {
21 ethernet0 = &gem3;
22 i2c0 = &i2c1;
23 mmc0 = &sdhci0;
24 mmc1 = &sdhci1;
25 rtc0 = &rtc;
26 serial0 = &uart0;
27 };
28
29 chosen {
30 bootargs = "earlycon";
31 stdout-path = "serial0:115200n8";
32 };
33
34 memory@0 {
35 device_type = "memory";
36 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
37 };
38};
39
40&fpd_dma_chan1 {
41 status = "okay";
42};
43
44&fpd_dma_chan2 {
45 status = "okay";
46};
47
48&fpd_dma_chan3 {
49 status = "okay";
50};
51
52&fpd_dma_chan4 {
53 status = "okay";
54};
55
56&fpd_dma_chan5 {
57 status = "okay";
58};
59
60&fpd_dma_chan6 {
61 status = "okay";
62};
63
64&fpd_dma_chan7 {
65 status = "okay";
66};
67
68&fpd_dma_chan8 {
69 status = "okay";
70};
71
72&gem3 {
73 status = "okay";
74 phy-handle = <&phy0>;
75 phy-mode = "rgmii-id";
76 phy0: phy@0 {
77 reg = <0>;
78 };
79};
80
81&gpio {
82 status = "okay";
83};
84
85
86&i2c1 {
87 status = "okay";
88 clock-frequency = <400000>;
89
90 eeprom: eeprom@55 {
91 compatible = "atmel,24c64"; /* 24AA64 */
92 reg = <0x55>;
93 };
94};
95
96&rtc {
97 status = "okay";
98};
99
100&sata {
101 status = "okay";
102 /* SATA phy OOB timing settings */
103 ceva,p0-cominit-params = /bits/ 8 <0x1B 0x4D 0x18 0x28>;
104 ceva,p0-comwake-params = /bits/ 8 <0x06 0x19 0x08 0x0E>;
105 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
106 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
107 ceva,p1-cominit-params = /bits/ 8 <0x1B 0x4D 0x18 0x28>;
108 ceva,p1-comwake-params = /bits/ 8 <0x06 0x19 0x08 0x0E>;
109 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
110 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
111};
112
113/* eMMC */
114&sdhci0 {
115 status = "okay";
116 bus-width = <8>;
117};
118
119/* SD1 with level shifter */
120&sdhci1 {
121 status = "okay";
122};
123
124&uart0 {
125 status = "okay";
126};
127
128/* ULPI SMSC USB3320 */
129&usb0 {
130 status = "okay";
131};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts
new file mode 100644
index 000000000000..11cc67184fa9
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts
@@ -0,0 +1,168 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP zc1751-xm016-dc2
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/gpio/gpio.h>
15
16/ {
17 model = "ZynqMP zc1751-xm016-dc2 RevA";
18 compatible = "xlnx,zynqmp-zc1751", "xlnx,zynqmp";
19
20 aliases {
21 can0 = &can0;
22 can1 = &can1;
23 ethernet0 = &gem2;
24 i2c0 = &i2c0;
25 rtc0 = &rtc;
26 serial0 = &uart0;
27 serial1 = &uart1;
28 spi0 = &spi0;
29 spi1 = &spi1;
30 };
31
32 chosen {
33 bootargs = "earlycon";
34 stdout-path = "serial0:115200n8";
35 };
36
37 memory@0 {
38 device_type = "memory";
39 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
40 };
41};
42
43&can0 {
44 status = "okay";
45};
46
47&can1 {
48 status = "okay";
49};
50
51&fpd_dma_chan1 {
52 status = "okay";
53};
54
55&fpd_dma_chan2 {
56 status = "okay";
57};
58
59&fpd_dma_chan3 {
60 status = "okay";
61};
62
63&fpd_dma_chan4 {
64 status = "okay";
65};
66
67&fpd_dma_chan5 {
68 status = "okay";
69};
70
71&fpd_dma_chan6 {
72 status = "okay";
73};
74
75&fpd_dma_chan7 {
76 status = "okay";
77};
78
79&fpd_dma_chan8 {
80 status = "okay";
81};
82
83&gem2 {
84 status = "okay";
85 phy-handle = <&phy0>;
86 phy-mode = "rgmii-id";
87 phy0: phy@5 {
88 reg = <5>;
89 ti,rx-internal-delay = <0x8>;
90 ti,tx-internal-delay = <0xa>;
91 ti,fifo-depth = <0x1>;
92 };
93};
94
95&gpio {
96 status = "okay";
97};
98
99&i2c0 {
100 status = "okay";
101 clock-frequency = <400000>;
102
103 tca6416_u26: gpio@20 {
104 compatible = "ti,tca6416";
105 reg = <0x20>;
106 gpio-controller;
107 #gpio-cells = <2>;
108 /* IRQ not connected */
109 };
110
111 rtc@68 {
112 compatible = "dallas,ds1339";
113 reg = <0x68>;
114 };
115};
116
117&rtc {
118 status = "okay";
119};
120
121&spi0 {
122 status = "okay";
123 num-cs = <1>;
124
125 spi0_flash0: flash0@0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "sst,sst25wf080", "jedec,spi-nor";
129 spi-max-frequency = <50000000>;
130 reg = <0>;
131
132 partition@0 {
133 label = "data";
134 reg = <0x0 0x100000>;
135 };
136 };
137};
138
139&spi1 {
140 status = "okay";
141 num-cs = <1>;
142
143 spi1_flash0: flash0@0 {
144 #address-cells = <1>;
145 #size-cells = <1>;
146 compatible = "atmel,at45db041e", "atmel,at45", "atmel,dataflash";
147 spi-max-frequency = <20000000>;
148 reg = <0>;
149
150 partition@0 {
151 label = "data";
152 reg = <0x0 0x84000>;
153 };
154 };
155};
156
157/* ULPI SMSC USB3320 */
158&usb1 {
159 status = "okay";
160};
161
162&uart0 {
163 status = "okay";
164};
165
166&uart1 {
167 status = "okay";
168};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dts
new file mode 100644
index 000000000000..7a49deeae647
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dts
@@ -0,0 +1,150 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP zc1751-xm017-dc3
4 *
5 * (C) Copyright 2016 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14
15/ {
16 model = "ZynqMP zc1751-xm017-dc3 RevA";
17 compatible = "xlnx,zynqmp-zc1751", "xlnx,zynqmp";
18
19 aliases {
20 ethernet0 = &gem0;
21 i2c0 = &i2c0;
22 i2c1 = &i2c1;
23 mmc0 = &sdhci1;
24 rtc0 = &rtc;
25 serial0 = &uart0;
26 serial1 = &uart1;
27 };
28
29 chosen {
30 bootargs = "earlycon";
31 stdout-path = "serial0:115200n8";
32 };
33
34 memory@0 {
35 device_type = "memory";
36 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
37 };
38};
39
40&fpd_dma_chan1 {
41 status = "okay";
42};
43
44&fpd_dma_chan2 {
45 status = "okay";
46};
47
48&fpd_dma_chan3 {
49 status = "okay";
50};
51
52&fpd_dma_chan4 {
53 status = "okay";
54};
55
56&fpd_dma_chan5 {
57 status = "okay";
58};
59
60&fpd_dma_chan6 {
61 status = "okay";
62};
63
64&fpd_dma_chan7 {
65 status = "okay";
66};
67
68&fpd_dma_chan8 {
69 status = "okay";
70};
71
72&gem0 {
73 status = "okay";
74 phy-handle = <&phy0>;
75 phy-mode = "rgmii-id";
76 phy0: phy@0 { /* VSC8211 */
77 reg = <0>;
78 };
79};
80
81&gpio {
82 status = "okay";
83};
84
85/* just eeprom here */
86&i2c0 {
87 status = "okay";
88 clock-frequency = <400000>;
89
90 tca6416_u26: gpio@20 {
91 compatible = "ti,tca6416";
92 reg = <0x20>;
93 gpio-controller;
94 #gpio-cells = <2>;
95 /* IRQ not connected */
96 };
97
98 rtc@68 {
99 compatible = "dallas,ds1339";
100 reg = <0x68>;
101 };
102};
103
104/* eeprom24c02 and SE98A temp chip pca9306 */
105&i2c1 {
106 status = "okay";
107 clock-frequency = <400000>;
108};
109
110&rtc {
111 status = "okay";
112};
113
114&sata {
115 status = "okay";
116 /* SATA phy OOB timing settings */
117 ceva,p0-cominit-params = /bits/ 8 <0x1B 0x4D 0x18 0x28>;
118 ceva,p0-comwake-params = /bits/ 8 <0x06 0x19 0x08 0x0E>;
119 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
120 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
121 ceva,p1-cominit-params = /bits/ 8 <0x1B 0x4D 0x18 0x28>;
122 ceva,p1-comwake-params = /bits/ 8 <0x06 0x19 0x08 0x0E>;
123 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
124 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
125};
126
127&sdhci1 { /* emmc with some settings */
128 status = "okay";
129};
130
131/* main */
132&uart0 {
133 status = "okay";
134};
135
136/* DB9 */
137&uart1 {
138 status = "okay";
139};
140
141&usb0 {
142 status = "okay";
143 dr_mode = "host";
144};
145
146/* ULPI SMSC USB3320 */
147&usb1 {
148 status = "okay";
149 dr_mode = "host";
150};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dts
new file mode 100644
index 000000000000..54c7b4f1d1e4
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dts
@@ -0,0 +1,178 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP zc1751-xm018-dc4
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14
15/ {
16 model = "ZynqMP zc1751-xm018-dc4";
17 compatible = "xlnx,zynqmp-zc1751", "xlnx,zynqmp";
18
19 aliases {
20 ethernet0 = &gem0;
21 ethernet1 = &gem1;
22 ethernet2 = &gem2;
23 ethernet3 = &gem3;
24 i2c0 = &i2c0;
25 i2c1 = &i2c1;
26 rtc0 = &rtc;
27 serial0 = &uart0;
28 serial1 = &uart1;
29 };
30
31 chosen {
32 bootargs = "earlycon";
33 stdout-path = "serial0:115200n8";
34 };
35
36 memory@0 {
37 device_type = "memory";
38 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
39 };
40};
41
42&can0 {
43 status = "okay";
44};
45
46&can1 {
47 status = "okay";
48};
49
50&fpd_dma_chan1 {
51 status = "okay";
52};
53
54&fpd_dma_chan2 {
55 status = "okay";
56};
57
58&fpd_dma_chan3 {
59 status = "okay";
60};
61
62&fpd_dma_chan4 {
63 status = "okay";
64};
65
66&fpd_dma_chan5 {
67 status = "okay";
68};
69
70&fpd_dma_chan6 {
71 status = "okay";
72};
73
74&fpd_dma_chan7 {
75 status = "okay";
76};
77
78&fpd_dma_chan8 {
79 status = "okay";
80};
81
82&lpd_dma_chan1 {
83 status = "okay";
84};
85
86&lpd_dma_chan2 {
87 status = "okay";
88};
89
90&lpd_dma_chan3 {
91 status = "okay";
92};
93
94&lpd_dma_chan4 {
95 status = "okay";
96};
97
98&lpd_dma_chan5 {
99 status = "okay";
100};
101
102&lpd_dma_chan6 {
103 status = "okay";
104};
105
106&lpd_dma_chan7 {
107 status = "okay";
108};
109
110&lpd_dma_chan8 {
111 status = "okay";
112};
113
114&gem0 {
115 status = "okay";
116 phy-mode = "rgmii-id";
117 phy-handle = <&ethernet_phy0>;
118 ethernet_phy0: ethernet-phy@0 { /* Marvell 88e1512 */
119 reg = <0>;
120 };
121 ethernet_phy7: ethernet-phy@7 { /* Vitesse VSC8211 */
122 reg = <7>;
123 };
124 ethernet_phy3: ethernet-phy@3 { /* Realtek RTL8211DN */
125 reg = <3>;
126 };
127 ethernet_phy8: ethernet-phy@8 { /* Vitesse VSC8211 */
128 reg = <8>;
129 };
130};
131
132&gem1 {
133 status = "okay";
134 phy-mode = "rgmii-id";
135 phy-handle = <&ethernet_phy7>;
136};
137
138&gem2 {
139 status = "okay";
140 phy-mode = "rgmii-id";
141 phy-handle = <&ethernet_phy3>;
142};
143
144&gem3 {
145 status = "okay";
146 phy-mode = "rgmii-id";
147 phy-handle = <&ethernet_phy8>;
148};
149
150&gpio {
151 status = "okay";
152};
153
154&i2c0 {
155 clock-frequency = <400000>;
156 status = "okay";
157};
158
159&i2c1 {
160 clock-frequency = <400000>;
161 status = "okay";
162};
163
164&rtc {
165 status = "okay";
166};
167
168&uart0 {
169 status = "okay";
170};
171
172&uart1 {
173 status = "okay";
174};
175
176&watchdog0 {
177 status = "okay";
178};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dts
new file mode 100644
index 000000000000..b8b5ff13818d
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dts
@@ -0,0 +1,125 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP zc1751-xm019-dc5
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Siva Durga Prasad <siva.durga.paladugu@xilinx.com>
8 * Michal Simek <michal.simek@xilinx.com>
9 */
10
11/dts-v1/;
12
13#include "zynqmp.dtsi"
14#include "zynqmp-clk.dtsi"
15#include <dt-bindings/gpio/gpio.h>
16
17/ {
18 model = "ZynqMP zc1751-xm019-dc5 RevA";
19 compatible = "xlnx,zynqmp-zc1751", "xlnx,zynqmp";
20
21 aliases {
22 ethernet0 = &gem1;
23 i2c0 = &i2c0;
24 i2c1 = &i2c1;
25 mmc0 = &sdhci0;
26 serial0 = &uart0;
27 serial1 = &uart1;
28 };
29
30 chosen {
31 bootargs = "earlycon";
32 stdout-path = "serial0:115200n8";
33 };
34
35 memory@0 {
36 device_type = "memory";
37 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
38 };
39};
40
41&fpd_dma_chan1 {
42 status = "okay";
43};
44
45&fpd_dma_chan2 {
46 status = "okay";
47};
48
49&fpd_dma_chan3 {
50 status = "okay";
51};
52
53&fpd_dma_chan4 {
54 status = "okay";
55};
56
57&fpd_dma_chan5 {
58 status = "okay";
59};
60
61&fpd_dma_chan6 {
62 status = "okay";
63};
64
65&fpd_dma_chan7 {
66 status = "okay";
67};
68
69&fpd_dma_chan8 {
70 status = "okay";
71};
72
73&gem1 {
74 status = "okay";
75 phy-handle = <&phy0>;
76 phy-mode = "rgmii-id";
77 phy0: phy@0 {
78 reg = <0>;
79 };
80};
81
82&gpio {
83 status = "okay";
84};
85
86&i2c0 {
87 status = "okay";
88};
89
90&i2c1 {
91 status = "okay";
92};
93
94&sdhci0 {
95 status = "okay";
96 no-1-8-v;
97};
98
99&ttc0 {
100 status = "okay";
101};
102
103&ttc1 {
104 status = "okay";
105};
106
107&ttc2 {
108 status = "okay";
109};
110
111&ttc3 {
112 status = "okay";
113};
114
115&uart0 {
116 status = "okay";
117};
118
119&uart1 {
120 status = "okay";
121};
122
123&watchdog0 {
124 status = "okay";
125};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts
new file mode 100644
index 000000000000..3e862a9faf26
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts
@@ -0,0 +1,289 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU100 revC
4 *
5 * (C) Copyright 2016 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 * Nathalie Chan King Choy
9 */
10
11/dts-v1/;
12
13#include "zynqmp.dtsi"
14#include "zynqmp-clk.dtsi"
15#include <dt-bindings/input/input.h>
16#include <dt-bindings/interrupt-controller/irq.h>
17#include <dt-bindings/gpio/gpio.h>
18
19/ {
20 model = "ZynqMP ZCU100 RevC";
21 compatible = "xlnx,zynqmp-zcu100-revC", "xlnx,zynqmp-zcu100", "xlnx,zynqmp";
22
23 aliases {
24 i2c0 = &i2c1;
25 rtc0 = &rtc;
26 serial0 = &uart1;
27 serial1 = &uart0;
28 serial2 = &dcc;
29 spi0 = &spi0;
30 spi1 = &spi1;
31 mmc0 = &sdhci0;
32 mmc1 = &sdhci1;
33 };
34
35 chosen {
36 bootargs = "earlycon";
37 stdout-path = "serial0:115200n8";
38 };
39
40 memory@0 {
41 device_type = "memory";
42 reg = <0x0 0x0 0x0 0x80000000>;
43 };
44
45 gpio-keys {
46 compatible = "gpio-keys";
47 #address-cells = <1>;
48 #size-cells = <0>;
49 autorepeat;
50 sw4 {
51 label = "sw4";
52 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_POWER>;
54 gpio-key,wakeup;
55 autorepeat;
56 };
57 };
58
59 leds {
60 compatible = "gpio-leds";
61 ds2 {
62 label = "ds2";
63 gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
64 linux,default-trigger = "heartbeat";
65 };
66
67 ds3 {
68 label = "ds3";
69 gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
70 linux,default-trigger = "phy0tx"; /* WLAN tx */
71 default-state = "off";
72 };
73
74 ds4 {
75 label = "ds4";
76 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
77 linux,default-trigger = "phy0rx"; /* WLAN rx */
78 default-state = "off";
79 };
80
81 ds5 {
82 label = "ds5";
83 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
84 linux,default-trigger = "bluetooth-power";
85 };
86
87 vbus_det { /* U5 USB5744 VBUS detection via MIO25 */
88 label = "vbus_det";
89 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
90 default-state = "on";
91 };
92
93 bt_power {
94 label = "bt_power";
95 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
96 default-state = "on";
97 };
98 };
99
100 wmmcsdio_fixed: fixedregulator-mmcsdio {
101 compatible = "regulator-fixed";
102 regulator-name = "wmmcsdio_fixed";
103 regulator-min-microvolt = <3300000>;
104 regulator-max-microvolt = <3300000>;
105 regulator-always-on;
106 regulator-boot-on;
107 };
108
109 sdio_pwrseq: sdio_pwrseq {
110 compatible = "mmc-pwrseq-simple";
111 reset-gpios = <&gpio 7 GPIO_ACTIVE_LOW>; /* WIFI_EN */
112 };
113};
114
115&dcc {
116 status = "okay";
117};
118
119&gpio {
120 status = "okay";
121 gpio-line-names = "UART1_TX", "UART1_RX", "UART0_RX", "UART0_TX", "I2C1_SCL",
122 "I2C1_SDA", "SPI1_SCLK", "WLAN_EN", "BT_EN", "SPI1_CS",
123 "SPI1_MISO", "SPI1_MOSI", "I2C_MUX_RESET", "SD0_DAT0", "SD0_DAT1",
124 "SD0_DAT2", "SD0_DAT3", "PS_LED3", "PS_LED2", "PS_LED1",
125 "PS_LED0", "SD0_CMD", "SD0_CLK", "GPIO_PB", "SD0_DETECT",
126 "VBUS_DET", "POWER_INT", "DP_AUX", "DP_HPD", "DP_OE",
127 "DP_AUX_IN", "INA226_ALERT", "PS_FP_PWR_EN", "PL_PWR_EN", "POWER_KILL",
128 "", "GPIO-A", "GPIO-B", "SPI0_SCLK", "GPIO-C",
129 "GPIO-D", "SPI0_CS", "SPI0_MISO", "SPI_MOSI", "GPIO-E",
130 "GPIO-F", "SD1_D0", "SD1_D1", "SD1_D2", "SD1_D3",
131 "SD1_CMD", "SD1_CLK", "USB0_CLK", "USB0_DIR", "USB0_DATA2",
132 "USB0_NXT", "USB0_DATA0", "USB0_DATA1", "USB0_STP", "USB0_DATA3",
133 "USB0_DATA4", "USB0_DATA5", "USB0_DATA6", "USB0_DATA7", "USB1_CLK",
134 "USB1_DIR", "USB1_DATA2", "USB1_NXT", "USB1_DATA0", "USB1_DATA1",
135 "USB1_STP", "USB1_DATA3", "USB1_DATA4", "USB1_DATA5", "USB1_DATA6",
136 "USB_DATA7", "WLAN_IRQ", "PMIC_IRQ", /* MIO end and EMIO start */
137 "", "",
138 "", "", "", "", "", "", "", "", "", "",
139 "", "", "", "", "", "", "", "", "", "",
140 "", "", "", "", "", "", "", "", "", "",
141 "", "", "", "", "", "", "", "", "", "",
142 "", "", "", "", "", "", "", "", "", "",
143 "", "", "", "", "", "", "", "", "", "",
144 "", "", "", "", "", "", "", "", "", "",
145 "", "", "", "", "", "", "", "", "", "",
146 "", "", "", "", "", "", "", "", "", "",
147 "", "", "", "";
148};
149
150&i2c1 {
151 status = "okay";
152 clock-frequency = <100000>;
153 i2c-mux@75 { /* u11 */
154 compatible = "nxp,pca9548";
155 #address-cells = <1>;
156 #size-cells = <0>;
157 reg = <0x75>;
158 i2csw_0: i2c@0 {
159 #address-cells = <1>;
160 #size-cells = <0>;
161 reg = <0>;
162 label = "LS-I2C0";
163 };
164 i2csw_1: i2c@1 {
165 #address-cells = <1>;
166 #size-cells = <0>;
167 reg = <1>;
168 label = "LS-I2C1";
169 };
170 i2csw_2: i2c@2 {
171 #address-cells = <1>;
172 #size-cells = <0>;
173 reg = <2>;
174 label = "HS-I2C2";
175 };
176 i2csw_3: i2c@3 {
177 #address-cells = <1>;
178 #size-cells = <0>;
179 reg = <3>;
180 label = "HS-I2C3";
181 };
182 i2csw_4: i2c@4 {
183 #address-cells = <1>;
184 #size-cells = <0>;
185 reg = <0x4>;
186
187 pmic: pmic@5e { /* Custom TI PMIC u33 */
188 compatible = "ti,tps65086";
189 reg = <0x5e>;
190 interrupt-parent = <&gpio>;
191 interrupts = <77 GPIO_ACTIVE_LOW>;
192 #gpio-cells = <2>;
193 gpio-controller;
194 };
195 };
196 i2csw_5: i2c@5 {
197 #address-cells = <1>;
198 #size-cells = <0>;
199 reg = <5>;
200 /* PS_PMBUS */
201 ina226@40 { /* u35 */
202 compatible = "ti,ina226";
203 reg = <0x40>;
204 shunt-resistor = <10000>;
205 /* MIO31 is alert which should be routed to PMUFW */
206 };
207 };
208 i2csw_6: i2c@6 {
209 #address-cells = <1>;
210 #size-cells = <0>;
211 reg = <6>;
212 /*
213 * Not Connected
214 */
215 };
216 i2csw_7: i2c@7 {
217 #address-cells = <1>;
218 #size-cells = <0>;
219 reg = <7>;
220 /*
221 * usb5744 (DNP) - U5
222 * 100kHz - this is default freq for us
223 */
224 };
225 };
226};
227
228&rtc {
229 status = "okay";
230};
231
232/* SD0 only supports 3.3V, no level shifter */
233&sdhci0 {
234 status = "okay";
235 no-1-8-v;
236 broken-cd; /* CD has to be enabled by default */
237 disable-wp;
238};
239
240&sdhci1 {
241 status = "okay";
242 bus-width = <0x4>;
243 non-removable;
244 disable-wp;
245 cap-power-off-card;
246 mmc-pwrseq = <&sdio_pwrseq>;
247 vqmmc-supply = <&wmmcsdio_fixed>;
248 #address-cells = <1>;
249 #size-cells = <0>;
250 wlcore: wifi@2 {
251 compatible = "ti,wl1831";
252 reg = <2>;
253 interrupt-parent = <&gpio>;
254 interrupts = <76 IRQ_TYPE_EDGE_RISING>; /* MIO76 WLAN_IRQ 1V8 */
255 };
256};
257
258&spi0 { /* Low Speed connector */
259 status = "okay";
260 label = "LS-SPI0";
261};
262
263&spi1 { /* High Speed connector */
264 status = "okay";
265 label = "HS-SPI1";
266};
267
268&uart0 {
269 status = "okay";
270};
271
272&uart1 {
273 status = "okay";
274
275};
276
277/* ULPI SMSC USB3320 */
278&usb0 {
279 status = "okay";
280};
281
282/* ULPI SMSC USB3320 */
283&usb1 {
284 status = "okay";
285};
286
287&watchdog0 {
288 status = "okay";
289};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts
new file mode 100644
index 000000000000..6647e97edba3
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts
@@ -0,0 +1,36 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU102 Rev1.0
4 *
5 * (C) Copyright 2016 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10#include "zynqmp-zcu102-revB.dts"
11
12/ {
13 model = "ZynqMP ZCU102 Rev1.0";
14 compatible = "xlnx,zynqmp-zcu102-rev1.0", "xlnx,zynqmp-zcu102", "xlnx,zynqmp";
15};
16
17&eeprom {
18 #address-cells = <1>;
19 #size-cells = <1>;
20
21 board_sn: board-sn@0 {
22 reg = <0x0 0x14>;
23 };
24
25 eth_mac: eth-mac@20 {
26 reg = <0x20 0x6>;
27 };
28
29 board_name: board-name@d0 {
30 reg = <0xd0 0x6>;
31 };
32
33 board_revision: board-revision@e0 {
34 reg = <0xe0 0x3>;
35 };
36};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
new file mode 100644
index 000000000000..5b4ffe646a9b
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
@@ -0,0 +1,548 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU102 RevA
4 *
5 * (C) Copyright 2015 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/gpio/gpio.h>
16
17/ {
18 model = "ZynqMP ZCU102 RevA";
19 compatible = "xlnx,zynqmp-zcu102-revA", "xlnx,zynqmp-zcu102", "xlnx,zynqmp";
20
21 aliases {
22 ethernet0 = &gem3;
23 i2c0 = &i2c0;
24 i2c1 = &i2c1;
25 mmc0 = &sdhci1;
26 rtc0 = &rtc;
27 serial0 = &uart0;
28 serial1 = &uart1;
29 serial2 = &dcc;
30 };
31
32 chosen {
33 bootargs = "earlycon";
34 stdout-path = "serial0:115200n8";
35 };
36
37 memory@0 {
38 device_type = "memory";
39 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
40 };
41
42 gpio-keys {
43 compatible = "gpio-keys";
44 #address-cells = <1>;
45 #size-cells = <0>;
46 autorepeat;
47 sw19 {
48 label = "sw19";
49 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
50 linux,code = <KEY_DOWN>;
51 gpio-key,wakeup;
52 autorepeat;
53 };
54 };
55
56 leds {
57 compatible = "gpio-leds";
58 heartbeat_led {
59 label = "heartbeat";
60 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
61 linux,default-trigger = "heartbeat";
62 };
63 };
64};
65
66&can1 {
67 status = "okay";
68};
69
70&dcc {
71 status = "okay";
72};
73
74&fpd_dma_chan1 {
75 status = "okay";
76};
77
78&fpd_dma_chan2 {
79 status = "okay";
80};
81
82&fpd_dma_chan3 {
83 status = "okay";
84};
85
86&fpd_dma_chan4 {
87 status = "okay";
88};
89
90&fpd_dma_chan5 {
91 status = "okay";
92};
93
94&fpd_dma_chan6 {
95 status = "okay";
96};
97
98&fpd_dma_chan7 {
99 status = "okay";
100};
101
102&fpd_dma_chan8 {
103 status = "okay";
104};
105
106&gem3 {
107 status = "okay";
108 phy-handle = <&phy0>;
109 phy-mode = "rgmii-id";
110 phy0: phy@21 {
111 reg = <21>;
112 ti,rx-internal-delay = <0x8>;
113 ti,tx-internal-delay = <0xa>;
114 ti,fifo-depth = <0x1>;
115 };
116};
117
118&gpio {
119 status = "okay";
120};
121
122&i2c0 {
123 status = "okay";
124 clock-frequency = <400000>;
125
126 tca6416_u97: gpio@20 {
127 compatible = "ti,tca6416";
128 reg = <0x20>;
129 gpio-controller;
130 #gpio-cells = <2>;
131 /*
132 * IRQ not connected
133 * Lines:
134 * 0 - PS_GTR_LAN_SEL0
135 * 1 - PS_GTR_LAN_SEL1
136 * 2 - PS_GTR_LAN_SEL2
137 * 3 - PS_GTR_LAN_SEL3
138 * 4 - PCI_CLK_DIR_SEL
139 * 5 - IIC_MUX_RESET_B
140 * 6 - GEM3_EXP_RESET_B
141 * 7, 10 - 17 - not connected
142 */
143
144 gtr_sel0 {
145 gpio-hog;
146 gpios = <0 0>;
147 output-low; /* PCIE = 0, DP = 1 */
148 line-name = "sel0";
149 };
150 gtr_sel1 {
151 gpio-hog;
152 gpios = <1 0>;
153 output-high; /* PCIE = 0, DP = 1 */
154 line-name = "sel1";
155 };
156 gtr_sel2 {
157 gpio-hog;
158 gpios = <2 0>;
159 output-high; /* PCIE = 0, USB0 = 1 */
160 line-name = "sel2";
161 };
162 gtr_sel3 {
163 gpio-hog;
164 gpios = <3 0>;
165 output-high; /* PCIE = 0, SATA = 1 */
166 line-name = "sel3";
167 };
168 };
169
170 tca6416_u61: gpio@21 {
171 compatible = "ti,tca6416";
172 reg = <0x21>;
173 gpio-controller;
174 #gpio-cells = <2>;
175 /*
176 * IRQ not connected
177 * Lines:
178 * 0 - VCCPSPLL_EN
179 * 1 - MGTRAVCC_EN
180 * 2 - MGTRAVTT_EN
181 * 3 - VCCPSDDRPLL_EN
182 * 4 - MIO26_PMU_INPUT_LS
183 * 5 - PL_PMBUS_ALERT
184 * 6 - PS_PMBUS_ALERT
185 * 7 - MAXIM_PMBUS_ALERT
186 * 10 - PL_DDR4_VTERM_EN
187 * 11 - PL_DDR4_VPP_2V5_EN
188 * 12 - PS_DIMM_VDDQ_TO_PSVCCO_ON
189 * 13 - PS_DIMM_SUSPEND_EN
190 * 14 - PS_DDR4_VTERM_EN
191 * 15 - PS_DDR4_VPP_2V5_EN
192 * 16 - 17 - not connected
193 */
194 };
195
196 i2c-mux@75 { /* u60 */
197 compatible = "nxp,pca9544";
198 #address-cells = <1>;
199 #size-cells = <0>;
200 reg = <0x75>;
201 i2c@0 {
202 #address-cells = <1>;
203 #size-cells = <0>;
204 reg = <0>;
205 /* PS_PMBUS */
206 ina226@40 { /* u76 */
207 compatible = "ti,ina226";
208 reg = <0x40>;
209 shunt-resistor = <5000>;
210 };
211 ina226@41 { /* u77 */
212 compatible = "ti,ina226";
213 reg = <0x41>;
214 shunt-resistor = <5000>;
215 };
216 ina226@42 { /* u78 */
217 compatible = "ti,ina226";
218 reg = <0x42>;
219 shunt-resistor = <5000>;
220 };
221 ina226@43 { /* u87 */
222 compatible = "ti,ina226";
223 reg = <0x43>;
224 shunt-resistor = <5000>;
225 };
226 ina226@44 { /* u85 */
227 compatible = "ti,ina226";
228 reg = <0x44>;
229 shunt-resistor = <5000>;
230 };
231 ina226@45 { /* u86 */
232 compatible = "ti,ina226";
233 reg = <0x45>;
234 shunt-resistor = <5000>;
235 };
236 ina226@46 { /* u93 */
237 compatible = "ti,ina226";
238 reg = <0x46>;
239 shunt-resistor = <5000>;
240 };
241 ina226@47 { /* u88 */
242 compatible = "ti,ina226";
243 reg = <0x47>;
244 shunt-resistor = <5000>;
245 };
246 ina226@4a { /* u15 */
247 compatible = "ti,ina226";
248 reg = <0x4a>;
249 shunt-resistor = <5000>;
250 };
251 ina226@4b { /* u92 */
252 compatible = "ti,ina226";
253 reg = <0x4b>;
254 shunt-resistor = <5000>;
255 };
256 };
257 i2c@1 {
258 #address-cells = <1>;
259 #size-cells = <0>;
260 reg = <1>;
261 /* PL_PMBUS */
262 ina226@40 { /* u79 */
263 compatible = "ti,ina226";
264 reg = <0x40>;
265 shunt-resistor = <2000>;
266 };
267 ina226@41 { /* u81 */
268 compatible = "ti,ina226";
269 reg = <0x41>;
270 shunt-resistor = <5000>;
271 };
272 ina226@42 { /* u80 */
273 compatible = "ti,ina226";
274 reg = <0x42>;
275 shunt-resistor = <5000>;
276 };
277 ina226@43 { /* u84 */
278 compatible = "ti,ina226";
279 reg = <0x43>;
280 shunt-resistor = <5000>;
281 };
282 ina226@44 { /* u16 */
283 compatible = "ti,ina226";
284 reg = <0x44>;
285 shunt-resistor = <5000>;
286 };
287 ina226@45 { /* u65 */
288 compatible = "ti,ina226";
289 reg = <0x45>;
290 shunt-resistor = <5000>;
291 };
292 ina226@46 { /* u74 */
293 compatible = "ti,ina226";
294 reg = <0x46>;
295 shunt-resistor = <5000>;
296 };
297 ina226@47 { /* u75 */
298 compatible = "ti,ina226";
299 reg = <0x47>;
300 shunt-resistor = <5000>;
301 };
302 };
303 i2c@2 {
304 #address-cells = <1>;
305 #size-cells = <0>;
306 reg = <2>;
307 /* MAXIM_PMBUS - 00 */
308 max15301@a { /* u46 */
309 compatible = "maxim,max15301";
310 reg = <0xa>;
311 };
312 max15303@b { /* u4 */
313 compatible = "maxim,max15303";
314 reg = <0xb>;
315 };
316 max15303@10 { /* u13 */
317 compatible = "maxim,max15303";
318 reg = <0x10>;
319 };
320 max15301@13 { /* u47 */
321 compatible = "maxim,max15301";
322 reg = <0x13>;
323 };
324 max15303@14 { /* u7 */
325 compatible = "maxim,max15303";
326 reg = <0x14>;
327 };
328 max15303@15 { /* u6 */
329 compatible = "maxim,max15303";
330 reg = <0x15>;
331 };
332 max15303@16 { /* u10 */
333 compatible = "maxim,max15303";
334 reg = <0x16>;
335 };
336 max15303@17 { /* u9 */
337 compatible = "maxim,max15303";
338 reg = <0x17>;
339 };
340 max15301@18 { /* u63 */
341 compatible = "maxim,max15301";
342 reg = <0x18>;
343 };
344 max15303@1a { /* u49 */
345 compatible = "maxim,max15303";
346 reg = <0x1a>;
347 };
348 max15303@1d { /* u18 */
349 compatible = "maxim,max15303";
350 reg = <0x1d>;
351 };
352 max15303@20 { /* u8 */
353 compatible = "maxim,max15303";
354 status = "disabled"; /* unreachable */
355 reg = <0x20>;
356 };
357
358 max20751@72 { /* u95 */
359 compatible = "maxim,max20751";
360 reg = <0x72>;
361 };
362 max20751@73 { /* u96 */
363 compatible = "maxim,max20751";
364 reg = <0x73>;
365 };
366 };
367 /* Bus 3 is not connected */
368 };
369};
370
371&i2c1 {
372 status = "okay";
373 clock-frequency = <400000>;
374
375 /* PL i2c via PCA9306 - u45 */
376 i2c-mux@74 { /* u34 */
377 compatible = "nxp,pca9548";
378 #address-cells = <1>;
379 #size-cells = <0>;
380 reg = <0x74>;
381 i2c@0 {
382 #address-cells = <1>;
383 #size-cells = <0>;
384 reg = <0>;
385 /*
386 * IIC_EEPROM 1kB memory which uses 256B blocks
387 * where every block has different address.
388 * 0 - 256B address 0x54
389 * 256B - 512B address 0x55
390 * 512B - 768B address 0x56
391 * 768B - 1024B address 0x57
392 */
393 eeprom: eeprom@54 { /* u23 */
394 compatible = "atmel,24c08";
395 reg = <0x54>;
396 };
397 };
398 i2c@1 {
399 #address-cells = <1>;
400 #size-cells = <0>;
401 reg = <1>;
402 si5341: clock-generator@36 { /* SI5341 - u69 */
403 reg = <0x36>;
404 };
405
406 };
407 i2c@2 {
408 #address-cells = <1>;
409 #size-cells = <0>;
410 reg = <2>;
411 si570_1: clock-generator@5d { /* USER SI570 - u42 */
412 #clock-cells = <0>;
413 compatible = "silabs,si570";
414 reg = <0x5d>;
415 temperature-stability = <50>;
416 factory-fout = <300000000>;
417 clock-frequency = <300000000>;
418 };
419 };
420 i2c@3 {
421 #address-cells = <1>;
422 #size-cells = <0>;
423 reg = <3>;
424 si570_2: clock-generator@5d { /* USER MGT SI570 - u56 */
425 #clock-cells = <0>;
426 compatible = "silabs,si570";
427 reg = <0x5d>;
428 temperature-stability = <50>; /* copy from zc702 */
429 factory-fout = <156250000>;
430 clock-frequency = <148500000>;
431 };
432 };
433 i2c@4 {
434 #address-cells = <1>;
435 #size-cells = <0>;
436 reg = <4>;
437 si5328: clock-generator@69 {/* SI5328 - u20 */
438 reg = <0x69>;
439 /*
440 * Chip has interrupt present connected to PL
441 * interrupt-parent = <&>;
442 * interrupts = <>;
443 */
444 };
445 };
446 /* 5 - 7 unconnected */
447 };
448
449 i2c-mux@75 {
450 compatible = "nxp,pca9548"; /* u135 */
451 #address-cells = <1>;
452 #size-cells = <0>;
453 reg = <0x75>;
454
455 i2c@0 {
456 #address-cells = <1>;
457 #size-cells = <0>;
458 reg = <0>;
459 /* HPC0_IIC */
460 };
461 i2c@1 {
462 #address-cells = <1>;
463 #size-cells = <0>;
464 reg = <1>;
465 /* HPC1_IIC */
466 };
467 i2c@2 {
468 #address-cells = <1>;
469 #size-cells = <0>;
470 reg = <2>;
471 /* SYSMON */
472 };
473 i2c@3 {
474 #address-cells = <1>;
475 #size-cells = <0>;
476 reg = <3>;
477 /* DDR4 SODIMM */
478 };
479 i2c@4 {
480 #address-cells = <1>;
481 #size-cells = <0>;
482 reg = <4>;
483 /* SEP 3 */
484 };
485 i2c@5 {
486 #address-cells = <1>;
487 #size-cells = <0>;
488 reg = <5>;
489 /* SEP 2 */
490 };
491 i2c@6 {
492 #address-cells = <1>;
493 #size-cells = <0>;
494 reg = <6>;
495 /* SEP 1 */
496 };
497 i2c@7 {
498 #address-cells = <1>;
499 #size-cells = <0>;
500 reg = <7>;
501 /* SEP 0 */
502 };
503 };
504};
505
506&pcie {
507 status = "okay";
508};
509
510&rtc {
511 status = "okay";
512};
513
514&sata {
515 status = "okay";
516 /* SATA OOB timing settings */
517 ceva,p0-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
518 ceva,p0-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
519 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
520 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
521 ceva,p1-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
522 ceva,p1-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
523 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
524 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
525};
526
527/* SD1 with level shifter */
528&sdhci1 {
529 status = "okay";
530 no-1-8-v;
531};
532
533&uart0 {
534 status = "okay";
535};
536
537&uart1 {
538 status = "okay";
539};
540
541/* ULPI SMSC USB3320 */
542&usb0 {
543 status = "okay";
544};
545
546&watchdog0 {
547 status = "okay";
548};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dts
new file mode 100644
index 000000000000..af4d86882a5c
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dts
@@ -0,0 +1,40 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU102 RevB
4 *
5 * (C) Copyright 2016 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10#include "zynqmp-zcu102-revA.dts"
11
12/ {
13 model = "ZynqMP ZCU102 RevB";
14 compatible = "xlnx,zynqmp-zcu102-revB", "xlnx,zynqmp-zcu102", "xlnx,zynqmp";
15};
16
17&gem3 {
18 phy-handle = <&phyc>;
19 phyc: phy@c {
20 reg = <0xc>;
21 ti,rx-internal-delay = <0x8>;
22 ti,tx-internal-delay = <0xa>;
23 ti,fifo-depth = <0x1>;
24 };
25 /* Cleanup from RevA */
26 /delete-node/ phy@21;
27};
28
29/* Fix collision with u61 */
30&i2c0 {
31 i2c-mux@75 {
32 i2c@2 {
33 max15303@1b { /* u8 */
34 compatible = "maxim,max15303";
35 reg = <0x1b>;
36 };
37 /delete-node/ max15303@20;
38 };
39 };
40};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts
new file mode 100644
index 000000000000..d4ad19a38c93
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts
@@ -0,0 +1,195 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU104
4 *
5 * (C) Copyright 2017 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/gpio/gpio.h>
15
16/ {
17 model = "ZynqMP ZCU104 RevA";
18 compatible = "xlnx,zynqmp-zcu104-revA", "xlnx,zynqmp-zcu104", "xlnx,zynqmp";
19
20 aliases {
21 ethernet0 = &gem3;
22 i2c0 = &i2c1;
23 mmc0 = &sdhci1;
24 rtc0 = &rtc;
25 serial0 = &uart0;
26 serial1 = &uart1;
27 serial2 = &dcc;
28 };
29
30 chosen {
31 bootargs = "earlycon";
32 stdout-path = "serial0:115200n8";
33 };
34
35 memory@0 {
36 device_type = "memory";
37 reg = <0x0 0x0 0x0 0x80000000>;
38 };
39};
40
41&can1 {
42 status = "okay";
43};
44
45&dcc {
46 status = "okay";
47};
48
49&gem3 {
50 status = "okay";
51 phy-handle = <&phy0>;
52 phy-mode = "rgmii-id";
53 phy0: phy@c {
54 reg = <0xc>;
55 ti,rx-internal-delay = <0x8>;
56 ti,tx-internal-delay = <0xa>;
57 ti,fifo-depth = <0x1>;
58 };
59};
60
61&gpio {
62 status = "okay";
63};
64
65&i2c1 {
66 status = "okay";
67 clock-frequency = <400000>;
68
69 /* Another connection to this bus via PL i2c via PCA9306 - u45 */
70 i2c-mux@74 { /* u34 */
71 compatible = "nxp,pca9548";
72 #address-cells = <1>;
73 #size-cells = <0>;
74 reg = <0x74>;
75 i2c@0 {
76 #address-cells = <1>;
77 #size-cells = <0>;
78 reg = <0>;
79 /*
80 * IIC_EEPROM 1kB memory which uses 256B blocks
81 * where every block has different address.
82 * 0 - 256B address 0x54
83 * 256B - 512B address 0x55
84 * 512B - 768B address 0x56
85 * 768B - 1024B address 0x57
86 */
87 eeprom@54 { /* u23 */
88 compatible = "atmel,24c08";
89 reg = <0x54>;
90 #address-cells = <1>;
91 #size-cells = <1>;
92 };
93 };
94
95 i2c@1 {
96 #address-cells = <1>;
97 #size-cells = <0>;
98 reg = <1>;
99 clock_8t49n287: clock-generator@6c { /* 8T49N287 - u182 */
100 reg = <0x6c>;
101 };
102 };
103
104 i2c@2 {
105 #address-cells = <1>;
106 #size-cells = <0>;
107 reg = <2>;
108 irps5401_43: irps54012@43 { /* IRPS5401 - u175 */
109 reg = <0x43>;
110 };
111 irps5401_4d: irps54012@4d { /* IRPS5401 - u180 */
112 reg = <0x4d>;
113 };
114 };
115
116 i2c@4 {
117 #address-cells = <1>;
118 #size-cells = <0>;
119 reg = <4>;
120 tca6416_u97: gpio@21 {
121 compatible = "ti,tca6416";
122 reg = <0x21>;
123 gpio-controller;
124 #gpio-cells = <2>;
125 /*
126 * IRQ not connected
127 * Lines:
128 * 0 - IRPS5401_ALERT_B
129 * 1 - HDMI_8T49N241_INT_ALM
130 * 2 - MAX6643_OT_B
131 * 3 - MAX6643_FANFAIL_B
132 * 5 - IIC_MUX_RESET_B
133 * 6 - GEM3_EXP_RESET_B
134 * 7 - FMC_LPC_PRSNT_M2C_B
135 * 4, 10 - 17 - not connected
136 */
137 };
138 };
139
140 i2c@5 {
141 #address-cells = <1>;
142 #size-cells = <0>;
143 reg = <5>;
144 };
145
146 i2c@7 {
147 #address-cells = <1>;
148 #size-cells = <0>;
149 reg = <7>;
150 };
151
152 /* 3, 6 not connected */
153 };
154};
155
156&rtc {
157 status = "okay";
158};
159
160&sata {
161 status = "okay";
162 /* SATA OOB timing settings */
163 ceva,p0-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
164 ceva,p0-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
165 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
166 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
167 ceva,p1-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
168 ceva,p1-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
169 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
170 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
171};
172
173/* SD1 with level shifter */
174&sdhci1 {
175 status = "okay";
176 no-1-8-v;
177 disable-wp;
178};
179
180&uart0 {
181 status = "okay";
182};
183
184&uart1 {
185 status = "okay";
186};
187
188/* ULPI SMSC USB3320 */
189&usb0 {
190 status = "okay";
191};
192
193&watchdog0 {
194 status = "okay";
195};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts
new file mode 100644
index 000000000000..668f7f26716a
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts
@@ -0,0 +1,522 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU106
4 *
5 * (C) Copyright 2016, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/gpio/gpio.h>
16
17/ {
18 model = "ZynqMP ZCU106 RevA";
19 compatible = "xlnx,zynqmp-zcu106-revA", "xlnx,zynqmp-zcu106", "xlnx,zynqmp";
20
21 aliases {
22 ethernet0 = &gem3;
23 i2c0 = &i2c0;
24 i2c1 = &i2c1;
25 mmc0 = &sdhci1;
26 rtc0 = &rtc;
27 serial0 = &uart0;
28 serial1 = &uart1;
29 serial2 = &dcc;
30 };
31
32 chosen {
33 bootargs = "earlycon";
34 stdout-path = "serial0:115200n8";
35 };
36
37 memory@0 {
38 device_type = "memory";
39 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
40 };
41
42 gpio-keys {
43 compatible = "gpio-keys";
44 #address-cells = <1>;
45 #size-cells = <0>;
46 autorepeat;
47 sw19 {
48 label = "sw19";
49 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
50 linux,code = <KEY_DOWN>;
51 gpio-key,wakeup;
52 autorepeat;
53 };
54 };
55
56 leds {
57 compatible = "gpio-leds";
58 heartbeat_led {
59 label = "heartbeat";
60 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
61 linux,default-trigger = "heartbeat";
62 };
63 };
64};
65
66&can1 {
67 status = "okay";
68};
69
70&dcc {
71 status = "okay";
72};
73
74/* fpd_dma clk 667MHz, lpd_dma 500MHz */
75&fpd_dma_chan1 {
76 status = "okay";
77};
78
79&fpd_dma_chan2 {
80 status = "okay";
81};
82
83&fpd_dma_chan3 {
84 status = "okay";
85};
86
87&fpd_dma_chan4 {
88 status = "okay";
89};
90
91&fpd_dma_chan5 {
92 status = "okay";
93};
94
95&fpd_dma_chan6 {
96 status = "okay";
97};
98
99&fpd_dma_chan7 {
100 status = "okay";
101};
102
103&fpd_dma_chan8 {
104 status = "okay";
105};
106
107&gem3 {
108 status = "okay";
109 phy-handle = <&phy0>;
110 phy-mode = "rgmii-id";
111 phy0: phy@c {
112 reg = <0xc>;
113 ti,rx-internal-delay = <0x8>;
114 ti,tx-internal-delay = <0xa>;
115 ti,fifo-depth = <0x1>;
116 };
117};
118
119&gpio {
120 status = "okay";
121};
122
123&i2c0 {
124 status = "okay";
125 clock-frequency = <400000>;
126
127 tca6416_u97: gpio@20 {
128 compatible = "ti,tca6416";
129 reg = <0x20>;
130 gpio-controller; /* interrupt not connected */
131 #gpio-cells = <2>;
132 /*
133 * IRQ not connected
134 * Lines:
135 * 0 - SFP_SI5328_INT_ALM
136 * 1 - HDMI_SI5328_INT_ALM
137 * 5 - IIC_MUX_RESET_B
138 * 6 - GEM3_EXP_RESET_B
139 * 10 - FMC_HPC0_PRSNT_M2C_B
140 * 11 - FMC_HPC1_PRSNT_M2C_B
141 * 2-4, 7, 12-17 - not connected
142 */
143 };
144
145 tca6416_u61: gpio@21 {
146 compatible = "ti,tca6416";
147 reg = <0x21>;
148 gpio-controller;
149 #gpio-cells = <2>;
150 /*
151 * IRQ not connected
152 * Lines:
153 * 0 - VCCPSPLL_EN
154 * 1 - MGTRAVCC_EN
155 * 2 - MGTRAVTT_EN
156 * 3 - VCCPSDDRPLL_EN
157 * 4 - MIO26_PMU_INPUT_LS
158 * 5 - PL_PMBUS_ALERT
159 * 6 - PS_PMBUS_ALERT
160 * 7 - MAXIM_PMBUS_ALERT
161 * 10 - PL_DDR4_VTERM_EN
162 * 11 - PL_DDR4_VPP_2V5_EN
163 * 12 - PS_DIMM_VDDQ_TO_PSVCCO_ON
164 * 13 - PS_DIMM_SUSPEND_EN
165 * 14 - PS_DDR4_VTERM_EN
166 * 15 - PS_DDR4_VPP_2V5_EN
167 * 16 - 17 - not connected
168 */
169 };
170
171 i2c-mux@75 { /* u60 */
172 compatible = "nxp,pca9544";
173 #address-cells = <1>;
174 #size-cells = <0>;
175 reg = <0x75>;
176 i2c@0 {
177 #address-cells = <1>;
178 #size-cells = <0>;
179 reg = <0>;
180 /* PS_PMBUS */
181 ina226@40 { /* u76 */
182 compatible = "ti,ina226";
183 reg = <0x40>;
184 shunt-resistor = <5000>;
185 };
186 ina226@41 { /* u77 */
187 compatible = "ti,ina226";
188 reg = <0x41>;
189 shunt-resistor = <5000>;
190 };
191 ina226@42 { /* u78 */
192 compatible = "ti,ina226";
193 reg = <0x42>;
194 shunt-resistor = <5000>;
195 };
196 ina226@43 { /* u87 */
197 compatible = "ti,ina226";
198 reg = <0x43>;
199 shunt-resistor = <5000>;
200 };
201 ina226@44 { /* u85 */
202 compatible = "ti,ina226";
203 reg = <0x44>;
204 shunt-resistor = <5000>;
205 };
206 ina226@45 { /* u86 */
207 compatible = "ti,ina226";
208 reg = <0x45>;
209 shunt-resistor = <5000>;
210 };
211 ina226@46 { /* u93 */
212 compatible = "ti,ina226";
213 reg = <0x46>;
214 shunt-resistor = <5000>;
215 };
216 ina226@47 { /* u88 */
217 compatible = "ti,ina226";
218 reg = <0x47>;
219 shunt-resistor = <5000>;
220 };
221 ina226@4a { /* u15 */
222 compatible = "ti,ina226";
223 reg = <0x4a>;
224 shunt-resistor = <5000>;
225 };
226 ina226@4b { /* u92 */
227 compatible = "ti,ina226";
228 reg = <0x4b>;
229 shunt-resistor = <5000>;
230 };
231 };
232 i2c@1 {
233 #address-cells = <1>;
234 #size-cells = <0>;
235 reg = <1>;
236 /* PL_PMBUS */
237 ina226@40 { /* u79 */
238 compatible = "ti,ina226";
239 reg = <0x40>;
240 shunt-resistor = <2000>;
241 };
242 ina226@41 { /* u81 */
243 compatible = "ti,ina226";
244 reg = <0x41>;
245 shunt-resistor = <5000>;
246 };
247 ina226@42 { /* u80 */
248 compatible = "ti,ina226";
249 reg = <0x42>;
250 shunt-resistor = <5000>;
251 };
252 ina226@43 { /* u84 */
253 compatible = "ti,ina226";
254 reg = <0x43>;
255 shunt-resistor = <5000>;
256 };
257 ina226@44 { /* u16 */
258 compatible = "ti,ina226";
259 reg = <0x44>;
260 shunt-resistor = <5000>;
261 };
262 ina226@45 { /* u65 */
263 compatible = "ti,ina226";
264 reg = <0x45>;
265 shunt-resistor = <5000>;
266 };
267 ina226@46 { /* u74 */
268 compatible = "ti,ina226";
269 reg = <0x46>;
270 shunt-resistor = <5000>;
271 };
272 ina226@47 { /* u75 */
273 compatible = "ti,ina226";
274 reg = <0x47>;
275 shunt-resistor = <5000>;
276 };
277 };
278 i2c@2 {
279 #address-cells = <1>;
280 #size-cells = <0>;
281 reg = <2>;
282 /* MAXIM_PMBUS - 00 */
283 max15301@a { /* u46 */
284 compatible = "maxim,max15301";
285 reg = <0xa>;
286 };
287 max15303@b { /* u4 */
288 compatible = "maxim,max15303";
289 reg = <0xb>;
290 };
291 max15303@10 { /* u13 */
292 compatible = "maxim,max15303";
293 reg = <0x10>;
294 };
295 max15301@13 { /* u47 */
296 compatible = "maxim,max15301";
297 reg = <0x13>;
298 };
299 max15303@14 { /* u7 */
300 compatible = "maxim,max15303";
301 reg = <0x14>;
302 };
303 max15303@15 { /* u6 */
304 compatible = "maxim,max15303";
305 reg = <0x15>;
306 };
307 max15303@16 { /* u10 */
308 compatible = "maxim,max15303";
309 reg = <0x16>;
310 };
311 max15303@17 { /* u9 */
312 compatible = "maxim,max15303";
313 reg = <0x17>;
314 };
315 max15301@18 { /* u63 */
316 compatible = "maxim,max15301";
317 reg = <0x18>;
318 };
319 max15303@1a { /* u49 */
320 compatible = "maxim,max15303";
321 reg = <0x1a>;
322 };
323 max15303@1b { /* u8 */
324 compatible = "maxim,max15303";
325 reg = <0x1b>;
326 };
327 max15303@1d { /* u18 */
328 compatible = "maxim,max15303";
329 reg = <0x1d>;
330 };
331
332 max20751@72 { /* u95 */
333 compatible = "maxim,max20751";
334 reg = <0x72>;
335 };
336 max20751@73 { /* u96 */
337 compatible = "maxim,max20751";
338 reg = <0x73>;
339 };
340 };
341 /* Bus 3 is not connected */
342 };
343};
344
345&i2c1 {
346 status = "okay";
347 clock-frequency = <400000>;
348
349 /* PL i2c via PCA9306 - u45 */
350 i2c-mux@74 { /* u34 */
351 compatible = "nxp,pca9548";
352 #address-cells = <1>;
353 #size-cells = <0>;
354 reg = <0x74>;
355 i2c@0 {
356 #address-cells = <1>;
357 #size-cells = <0>;
358 reg = <0>;
359 /*
360 * IIC_EEPROM 1kB memory which uses 256B blocks
361 * where every block has different address.
362 * 0 - 256B address 0x54
363 * 256B - 512B address 0x55
364 * 512B - 768B address 0x56
365 * 768B - 1024B address 0x57
366 */
367 eeprom: eeprom@54 { /* u23 */
368 compatible = "atmel,24c08";
369 reg = <0x54>;
370 };
371 };
372 i2c@1 {
373 #address-cells = <1>;
374 #size-cells = <0>;
375 reg = <1>;
376 si5341: clock-generator@36 { /* SI5341 - u69 */
377 reg = <0x36>;
378 };
379
380 };
381 i2c@2 {
382 #address-cells = <1>;
383 #size-cells = <0>;
384 reg = <2>;
385 si570_1: clock-generator@5d { /* USER SI570 - u42 */
386 #clock-cells = <0>;
387 compatible = "silabs,si570";
388 reg = <0x5d>;
389 temperature-stability = <50>;
390 factory-fout = <300000000>;
391 clock-frequency = <300000000>;
392 };
393 };
394 i2c@3 {
395 #address-cells = <1>;
396 #size-cells = <0>;
397 reg = <3>;
398 si570_2: clock-generator@5d { /* USER MGT SI570 - u56 */
399 #clock-cells = <0>;
400 compatible = "silabs,si570";
401 reg = <0x5d>;
402 temperature-stability = <50>; /* copy from zc702 */
403 factory-fout = <156250000>;
404 clock-frequency = <148500000>;
405 };
406 };
407 i2c@4 {
408 #address-cells = <1>;
409 #size-cells = <0>;
410 reg = <4>;
411 si5328: clock-generator@69 {/* SI5328 - u20 */
412 reg = <0x69>;
413 };
414 };
415 i2c@5 {
416 #address-cells = <1>;
417 #size-cells = <0>;
418 reg = <5>; /* FAN controller */
419 temp@4c {/* lm96163 - u128 */
420 compatible = "national,lm96163";
421 reg = <0x4c>;
422 };
423 };
424 /* 6 - 7 unconnected */
425 };
426
427 i2c-mux@75 {
428 compatible = "nxp,pca9548"; /* u135 */
429 #address-cells = <1>;
430 #size-cells = <0>;
431 reg = <0x75>;
432
433 i2c@0 {
434 #address-cells = <1>;
435 #size-cells = <0>;
436 reg = <0>;
437 /* HPC0_IIC */
438 };
439 i2c@1 {
440 #address-cells = <1>;
441 #size-cells = <0>;
442 reg = <1>;
443 /* HPC1_IIC */
444 };
445 i2c@2 {
446 #address-cells = <1>;
447 #size-cells = <0>;
448 reg = <2>;
449 /* SYSMON */
450 };
451 i2c@3 {
452 #address-cells = <1>;
453 #size-cells = <0>;
454 reg = <3>;
455 /* DDR4 SODIMM */
456 };
457 i2c@4 {
458 #address-cells = <1>;
459 #size-cells = <0>;
460 reg = <4>;
461 /* SEP 3 */
462 };
463 i2c@5 {
464 #address-cells = <1>;
465 #size-cells = <0>;
466 reg = <5>;
467 /* SEP 2 */
468 };
469 i2c@6 {
470 #address-cells = <1>;
471 #size-cells = <0>;
472 reg = <6>;
473 /* SEP 1 */
474 };
475 i2c@7 {
476 #address-cells = <1>;
477 #size-cells = <0>;
478 reg = <7>;
479 /* SEP 0 */
480 };
481 };
482};
483
484&rtc {
485 status = "okay";
486};
487
488&sata {
489 status = "okay";
490 /* SATA OOB timing settings */
491 ceva,p0-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
492 ceva,p0-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
493 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
494 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
495 ceva,p1-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
496 ceva,p1-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
497 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
498 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
499};
500
501/* SD1 with level shifter */
502&sdhci1 {
503 status = "okay";
504 no-1-8-v;
505};
506
507&uart0 {
508 status = "okay";
509};
510
511&uart1 {
512 status = "okay";
513};
514
515/* ULPI SMSC USB3320 */
516&usb0 {
517 status = "okay";
518};
519
520&watchdog0 {
521 status = "okay";
522};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts
new file mode 100644
index 000000000000..9a9dd6a0142b
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts
@@ -0,0 +1,444 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * dts file for Xilinx ZynqMP ZCU111
4 *
5 * (C) Copyright 2017 - 2018, Xilinx, Inc.
6 *
7 * Michal Simek <michal.simek@xilinx.com>
8 */
9
10/dts-v1/;
11
12#include "zynqmp.dtsi"
13#include "zynqmp-clk.dtsi"
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/gpio/gpio.h>
16
17/ {
18 model = "ZynqMP ZCU111 RevA";
19 compatible = "xlnx,zynqmp-zcu111-revA", "xlnx,zynqmp-zcu111", "xlnx,zynqmp";
20
21 aliases {
22 ethernet0 = &gem3;
23 i2c0 = &i2c0;
24 i2c1 = &i2c1;
25 mmc0 = &sdhci1;
26 rtc0 = &rtc;
27 serial0 = &uart0;
28 serial1 = &dcc;
29 };
30
31 chosen {
32 bootargs = "earlycon";
33 stdout-path = "serial0:115200n8";
34 };
35
36 memory@0 {
37 device_type = "memory";
38 reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
39 /* Another 4GB connected to PL */
40 };
41
42 gpio-keys {
43 compatible = "gpio-keys";
44 #address-cells = <1>;
45 #size-cells = <0>;
46 autorepeat;
47 sw19 {
48 label = "sw19";
49 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
50 linux,code = <KEY_DOWN>;
51 gpio-key,wakeup;
52 autorepeat;
53 };
54 };
55
56 leds {
57 compatible = "gpio-leds";
58 heartbeat_led {
59 label = "heartbeat";
60 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
61 linux,default-trigger = "heartbeat";
62 };
63 };
64};
65
66&dcc {
67 status = "okay";
68};
69
70&fpd_dma_chan1 {
71 status = "okay";
72};
73
74&fpd_dma_chan2 {
75 status = "okay";
76};
77
78&fpd_dma_chan3 {
79 status = "okay";
80};
81
82&fpd_dma_chan4 {
83 status = "okay";
84};
85
86&fpd_dma_chan5 {
87 status = "okay";
88};
89
90&fpd_dma_chan6 {
91 status = "okay";
92};
93
94&fpd_dma_chan7 {
95 status = "okay";
96};
97
98&fpd_dma_chan8 {
99 status = "okay";
100};
101
102&gem3 {
103 status = "okay";
104 phy-handle = <&phy0>;
105 phy-mode = "rgmii-id";
106 phy0: phy@c {
107 reg = <0xc>;
108 ti,rx-internal-delay = <0x8>;
109 ti,tx-internal-delay = <0xa>;
110 ti,fifo-depth = <0x1>;
111 };
112};
113
114&gpio {
115 status = "okay";
116};
117
118&i2c0 {
119 status = "okay";
120 clock-frequency = <400000>;
121
122 tca6416_u22: gpio@20 {
123 compatible = "ti,tca6416";
124 reg = <0x20>;
125 gpio-controller; /* interrupt not connected */
126 #gpio-cells = <2>;
127 /*
128 * IRQ not connected
129 * Lines:
130 * 0 - MAX6643_OT_B
131 * 1 - MAX6643_FANFAIL_B
132 * 2 - MIO26_PMU_INPUT_LS
133 * 4 - SFP_SI5382_INT_ALM
134 * 5 - IIC_MUX_RESET_B
135 * 6 - GEM3_EXP_RESET_B
136 * 10 - FMCP_HSPC_PRSNT_M2C_B
137 * 11 - CLK_SPI_MUX_SEL0
138 * 12 - CLK_SPI_MUX_SEL1
139 * 16 - IRPS5401_ALERT_B
140 * 17 - INA226_PMBUS_ALERT
141 * 3, 7, 13-15 - not connected
142 */
143 };
144
145 i2c-mux@75 { /* u23 */
146 compatible = "nxp,pca9544";
147 #address-cells = <1>;
148 #size-cells = <0>;
149 reg = <0x75>;
150 i2c@0 {
151 #address-cells = <1>;
152 #size-cells = <0>;
153 reg = <0>;
154 /* PS_PMBUS */
155 /* PMBUS_ALERT done via pca9544 */
156 ina226@40 { /* u67 */
157 compatible = "ti,ina226";
158 reg = <0x40>;
159 shunt-resistor = <2000>;
160 };
161 ina226@41 { /* u59 */
162 compatible = "ti,ina226";
163 reg = <0x41>;
164 shunt-resistor = <5000>;
165 };
166 ina226@42 { /* u61 */
167 compatible = "ti,ina226";
168 reg = <0x42>;
169 shunt-resistor = <5000>;
170 };
171 ina226@43 { /* u60 */
172 compatible = "ti,ina226";
173 reg = <0x43>;
174 shunt-resistor = <5000>;
175 };
176 ina226@45 { /* u64 */
177 compatible = "ti,ina226";
178 reg = <0x45>;
179 shunt-resistor = <5000>;
180 };
181 ina226@46 { /* u69 */
182 compatible = "ti,ina226";
183 reg = <0x46>;
184 shunt-resistor = <2000>;
185 };
186 ina226@47 { /* u66 */
187 compatible = "ti,ina226";
188 reg = <0x47>;
189 shunt-resistor = <5000>;
190 };
191 ina226@48 { /* u65 */
192 compatible = "ti,ina226";
193 reg = <0x48>;
194 shunt-resistor = <5000>;
195 };
196 ina226@49 { /* u63 */
197 compatible = "ti,ina226";
198 reg = <0x49>;
199 shunt-resistor = <5000>;
200 };
201 ina226@4a { /* u3 */
202 compatible = "ti,ina226";
203 reg = <0x4a>;
204 shunt-resistor = <5000>;
205 };
206 ina226@4b { /* u71 */
207 compatible = "ti,ina226";
208 reg = <0x4b>;
209 shunt-resistor = <5000>;
210 };
211 ina226@4c { /* u77 */
212 compatible = "ti,ina226";
213 reg = <0x4c>;
214 shunt-resistor = <5000>;
215 };
216 ina226@4d { /* u73 */
217 compatible = "ti,ina226";
218 reg = <0x4d>;
219 shunt-resistor = <5000>;
220 };
221 ina226@4e { /* u79 */
222 compatible = "ti,ina226";
223 reg = <0x4e>;
224 shunt-resistor = <5000>;
225 };
226 };
227 i2c@1 {
228 #address-cells = <1>;
229 #size-cells = <0>;
230 reg = <1>;
231 /* NC */
232 };
233 i2c@2 {
234 #address-cells = <1>;
235 #size-cells = <0>;
236 reg = <2>;
237 irps5401_43: irps54012@43 { /* IRPS5401 - u53 check these */
238 reg = <0x43>;
239 };
240 irps5401_44: irps54012@44 { /* IRPS5401 - u55 */
241 reg = <0x44>;
242 };
243 irps5401_45: irps54012@45 { /* IRPS5401 - u57 */
244 reg = <0x45>;
245 };
246 /* u68 IR38064 +0 */
247 /* u70 IR38060 +1 */
248 /* u74 IR38060 +2 */
249 /* u75 IR38060 +6 */
250 /* J19 header too */
251
252 };
253 i2c@3 {
254 #address-cells = <1>;
255 #size-cells = <0>;
256 reg = <3>;
257 /* SYSMON */
258 };
259 };
260};
261
262&i2c1 {
263 status = "okay";
264 clock-frequency = <400000>;
265
266 i2c-mux@74 { /* u26 */
267 compatible = "nxp,pca9548";
268 #address-cells = <1>;
269 #size-cells = <0>;
270 reg = <0x74>;
271 i2c@0 {
272 #address-cells = <1>;
273 #size-cells = <0>;
274 reg = <0>;
275 /*
276 * IIC_EEPROM 1kB memory which uses 256B blocks
277 * where every block has different address.
278 * 0 - 256B address 0x54
279 * 256B - 512B address 0x55
280 * 512B - 768B address 0x56
281 * 768B - 1024B address 0x57
282 */
283 eeprom: eeprom@54 { /* u88 */
284 compatible = "atmel,24c08";
285 reg = <0x54>;
286 };
287 };
288 i2c@1 {
289 #address-cells = <1>;
290 #size-cells = <0>;
291 reg = <1>;
292 si5341: clock-generator@36 { /* SI5341 - u46 */
293 reg = <0x36>;
294 };
295
296 };
297 i2c@2 {
298 #address-cells = <1>;
299 #size-cells = <0>;
300 reg = <2>;
301 si570_1: clock-generator@5d { /* USER SI570 - u47 */
302 #clock-cells = <0>;
303 compatible = "silabs,si570";
304 reg = <0x5d>;
305 temperature-stability = <50>;
306 factory-fout = <300000000>;
307 clock-frequency = <300000000>;
308 };
309 };
310 i2c@3 {
311 #address-cells = <1>;
312 #size-cells = <0>;
313 reg = <3>;
314 si570_2: clock-generator@5d { /* USER MGT SI570 - u49 */
315 #clock-cells = <0>;
316 compatible = "silabs,si570";
317 reg = <0x5d>;
318 temperature-stability = <50>;
319 factory-fout = <156250000>;
320 clock-frequency = <148500000>;
321 };
322 };
323 i2c@4 {
324 #address-cells = <1>;
325 #size-cells = <0>;
326 reg = <4>;
327 si5328: clock-generator@69 { /* SI5328 - u48 */
328 reg = <0x69>;
329 };
330 };
331 i2c@5 {
332 #address-cells = <1>;
333 #size-cells = <0>;
334 reg = <5>;
335 sc18is603@2f { /* sc18is602 - u93 */
336 compatible = "nxp,sc18is603";
337 reg = <0x2f>;
338 /* 4 gpios for CS not handled by driver */
339 /*
340 * USB2ANY cable or
341 * LMK04208 - u90 or
342 * LMX2594 - u102 or
343 * LMX2594 - u103 or
344 * LMX2594 - u104
345 */
346 };
347 };
348 i2c@6 {
349 #address-cells = <1>;
350 #size-cells = <0>;
351 reg = <6>;
352 /* FMC connector */
353 };
354 /* 7 NC */
355 };
356
357 i2c-mux@75 {
358 compatible = "nxp,pca9548"; /* u27 */
359 #address-cells = <1>;
360 #size-cells = <0>;
361 reg = <0x75>;
362
363 i2c@0 {
364 #address-cells = <1>;
365 #size-cells = <0>;
366 reg = <0>;
367 /* FMCP_HSPC_IIC */
368 };
369 i2c@1 {
370 #address-cells = <1>;
371 #size-cells = <0>;
372 reg = <1>;
373 /* NC */
374 };
375 i2c@2 {
376 #address-cells = <1>;
377 #size-cells = <0>;
378 reg = <2>;
379 /* SYSMON */
380 };
381 i2c@3 {
382 #address-cells = <1>;
383 #size-cells = <0>;
384 reg = <3>;
385 /* DDR4 SODIMM */
386 };
387 i2c@4 {
388 #address-cells = <1>;
389 #size-cells = <0>;
390 reg = <4>;
391 /* SFP3 */
392 };
393 i2c@5 {
394 #address-cells = <1>;
395 #size-cells = <0>;
396 reg = <5>;
397 /* SFP2 */
398 };
399 i2c@6 {
400 #address-cells = <1>;
401 #size-cells = <0>;
402 reg = <6>;
403 /* SFP1 */
404 };
405 i2c@7 {
406 #address-cells = <1>;
407 #size-cells = <0>;
408 reg = <7>;
409 /* SFP0 */
410 };
411 };
412};
413
414&rtc {
415 status = "okay";
416};
417
418&sata {
419 status = "okay";
420 /* SATA OOB timing settings */
421 ceva,p0-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
422 ceva,p0-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
423 ceva,p0-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
424 ceva,p0-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
425 ceva,p1-cominit-params = /bits/ 8 <0x18 0x40 0x18 0x28>;
426 ceva,p1-comwake-params = /bits/ 8 <0x06 0x14 0x08 0x0E>;
427 ceva,p1-burst-params = /bits/ 8 <0x13 0x08 0x4A 0x06>;
428 ceva,p1-retry-params = /bits/ 16 <0x96A4 0x3FFC>;
429};
430
431/* SD1 with level shifter */
432&sdhci1 {
433 status = "okay";
434 no-1-8-v;
435};
436
437&uart0 {
438 status = "okay";
439};
440
441/* ULPI SMSC USB3320 */
442&usb0 {
443 status = "okay";
444};
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
index 7665fbddff28..a091e6f03014 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0+
1/* 2/*
2 * dts file for Xilinx ZynqMP 3 * dts file for Xilinx ZynqMP
3 * 4 *
@@ -355,7 +356,7 @@
355 }; 356 };
356 357
357 gem0: ethernet@ff0b0000 { 358 gem0: ethernet@ff0b0000 {
358 compatible = "cdns,gem"; 359 compatible = "cdns,zynqmp-gem", "cdns,gem";
359 status = "disabled"; 360 status = "disabled";
360 interrupt-parent = <&gic>; 361 interrupt-parent = <&gic>;
361 interrupts = <0 57 4>, <0 57 4>; 362 interrupts = <0 57 4>, <0 57 4>;
@@ -366,7 +367,7 @@
366 }; 367 };
367 368
368 gem1: ethernet@ff0c0000 { 369 gem1: ethernet@ff0c0000 {
369 compatible = "cdns,gem"; 370 compatible = "cdns,zynqmp-gem", "cdns,gem";
370 status = "disabled"; 371 status = "disabled";
371 interrupt-parent = <&gic>; 372 interrupt-parent = <&gic>;
372 interrupts = <0 59 4>, <0 59 4>; 373 interrupts = <0 59 4>, <0 59 4>;
@@ -377,7 +378,7 @@
377 }; 378 };
378 379
379 gem2: ethernet@ff0d0000 { 380 gem2: ethernet@ff0d0000 {
380 compatible = "cdns,gem"; 381 compatible = "cdns,zynqmp-gem", "cdns,gem";
381 status = "disabled"; 382 status = "disabled";
382 interrupt-parent = <&gic>; 383 interrupt-parent = <&gic>;
383 interrupts = <0 61 4>, <0 61 4>; 384 interrupts = <0 61 4>, <0 61 4>;
@@ -388,7 +389,7 @@
388 }; 389 };
389 390
390 gem3: ethernet@ff0e0000 { 391 gem3: ethernet@ff0e0000 {
391 compatible = "cdns,gem"; 392 compatible = "cdns,zynqmp-gem", "cdns,gem";
392 status = "disabled"; 393 status = "disabled";
393 interrupt-parent = <&gic>; 394 interrupt-parent = <&gic>;
394 interrupts = <0 63 4>, <0 63 4>; 395 interrupts = <0 63 4>, <0 63 4>;
@@ -439,10 +440,10 @@
439 device_type = "pci"; 440 device_type = "pci";
440 interrupt-parent = <&gic>; 441 interrupt-parent = <&gic>;
441 interrupts = <0 118 4>, 442 interrupts = <0 118 4>,
442 <0 117 4>, 443 <0 117 4>,
443 <0 116 4>, 444 <0 116 4>,
444 <0 115 4>, /* MSI_1 [63...32] */ 445 <0 115 4>, /* MSI_1 [63...32] */
445 <0 114 4>; /* MSI_0 [31...0] */ 446 <0 114 4>; /* MSI_0 [31...0] */
446 interrupt-names = "misc", "dummy", "intx", 447 interrupt-names = "misc", "dummy", "intx",
447 "msi1", "msi0"; 448 "msi1", "msi0";
448 msi-parent = <&pcie>; 449 msi-parent = <&pcie>;
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index be7bd19c87ec..350c76a1d15b 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -20,7 +20,7 @@
20 20
21#define MPIDR_UP_BITMASK (0x1 << 30) 21#define MPIDR_UP_BITMASK (0x1 << 30)
22#define MPIDR_MT_BITMASK (0x1 << 24) 22#define MPIDR_MT_BITMASK (0x1 << 24)
23#define MPIDR_HWID_BITMASK 0xff00ffffff 23#define MPIDR_HWID_BITMASK UL(0xff00ffffff)
24 24
25#define MPIDR_LEVEL_BITS_SHIFT 3 25#define MPIDR_LEVEL_BITS_SHIFT 3
26#define MPIDR_LEVEL_BITS (1 << MPIDR_LEVEL_BITS_SHIFT) 26#define MPIDR_LEVEL_BITS (1 << MPIDR_LEVEL_BITS_SHIFT)
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 1dca41bea16a..e73f68569624 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -22,7 +22,7 @@
22 22
23static inline pte_t huge_ptep_get(pte_t *ptep) 23static inline pte_t huge_ptep_get(pte_t *ptep)
24{ 24{
25 return *ptep; 25 return READ_ONCE(*ptep);
26} 26}
27 27
28 28
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 9679067a1574..7faed6e48b46 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -185,42 +185,42 @@ static inline pmd_t kvm_s2pmd_mkexec(pmd_t pmd)
185 return pmd; 185 return pmd;
186} 186}
187 187
188static inline void kvm_set_s2pte_readonly(pte_t *pte) 188static inline void kvm_set_s2pte_readonly(pte_t *ptep)
189{ 189{
190 pteval_t old_pteval, pteval; 190 pteval_t old_pteval, pteval;
191 191
192 pteval = READ_ONCE(pte_val(*pte)); 192 pteval = READ_ONCE(pte_val(*ptep));
193 do { 193 do {
194 old_pteval = pteval; 194 old_pteval = pteval;
195 pteval &= ~PTE_S2_RDWR; 195 pteval &= ~PTE_S2_RDWR;
196 pteval |= PTE_S2_RDONLY; 196 pteval |= PTE_S2_RDONLY;
197 pteval = cmpxchg_relaxed(&pte_val(*pte), old_pteval, pteval); 197 pteval = cmpxchg_relaxed(&pte_val(*ptep), old_pteval, pteval);
198 } while (pteval != old_pteval); 198 } while (pteval != old_pteval);
199} 199}
200 200
201static inline bool kvm_s2pte_readonly(pte_t *pte) 201static inline bool kvm_s2pte_readonly(pte_t *ptep)
202{ 202{
203 return (pte_val(*pte) & PTE_S2_RDWR) == PTE_S2_RDONLY; 203 return (READ_ONCE(pte_val(*ptep)) & PTE_S2_RDWR) == PTE_S2_RDONLY;
204} 204}
205 205
206static inline bool kvm_s2pte_exec(pte_t *pte) 206static inline bool kvm_s2pte_exec(pte_t *ptep)
207{ 207{
208 return !(pte_val(*pte) & PTE_S2_XN); 208 return !(READ_ONCE(pte_val(*ptep)) & PTE_S2_XN);
209} 209}
210 210
211static inline void kvm_set_s2pmd_readonly(pmd_t *pmd) 211static inline void kvm_set_s2pmd_readonly(pmd_t *pmdp)
212{ 212{
213 kvm_set_s2pte_readonly((pte_t *)pmd); 213 kvm_set_s2pte_readonly((pte_t *)pmdp);
214} 214}
215 215
216static inline bool kvm_s2pmd_readonly(pmd_t *pmd) 216static inline bool kvm_s2pmd_readonly(pmd_t *pmdp)
217{ 217{
218 return kvm_s2pte_readonly((pte_t *)pmd); 218 return kvm_s2pte_readonly((pte_t *)pmdp);
219} 219}
220 220
221static inline bool kvm_s2pmd_exec(pmd_t *pmd) 221static inline bool kvm_s2pmd_exec(pmd_t *pmdp)
222{ 222{
223 return !(pmd_val(*pmd) & PMD_S2_XN); 223 return !(READ_ONCE(pmd_val(*pmdp)) & PMD_S2_XN);
224} 224}
225 225
226static inline bool kvm_page_empty(void *ptr) 226static inline bool kvm_page_empty(void *ptr)
diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
index 8d3331985d2e..39ec0b8a689e 100644
--- a/arch/arm64/include/asm/mmu_context.h
+++ b/arch/arm64/include/asm/mmu_context.h
@@ -141,13 +141,13 @@ static inline void cpu_install_idmap(void)
141 * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD, 141 * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD,
142 * avoiding the possibility of conflicting TLB entries being allocated. 142 * avoiding the possibility of conflicting TLB entries being allocated.
143 */ 143 */
144static inline void cpu_replace_ttbr1(pgd_t *pgd) 144static inline void cpu_replace_ttbr1(pgd_t *pgdp)
145{ 145{
146 typedef void (ttbr_replace_func)(phys_addr_t); 146 typedef void (ttbr_replace_func)(phys_addr_t);
147 extern ttbr_replace_func idmap_cpu_replace_ttbr1; 147 extern ttbr_replace_func idmap_cpu_replace_ttbr1;
148 ttbr_replace_func *replace_phys; 148 ttbr_replace_func *replace_phys;
149 149
150 phys_addr_t pgd_phys = virt_to_phys(pgd); 150 phys_addr_t pgd_phys = virt_to_phys(pgdp);
151 151
152 replace_phys = (void *)__pa_symbol(idmap_cpu_replace_ttbr1); 152 replace_phys = (void *)__pa_symbol(idmap_cpu_replace_ttbr1);
153 153
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h
index e9d9f1b006ef..2e05bcd944c8 100644
--- a/arch/arm64/include/asm/pgalloc.h
+++ b/arch/arm64/include/asm/pgalloc.h
@@ -36,23 +36,23 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
36 return (pmd_t *)__get_free_page(PGALLOC_GFP); 36 return (pmd_t *)__get_free_page(PGALLOC_GFP);
37} 37}
38 38
39static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) 39static inline void pmd_free(struct mm_struct *mm, pmd_t *pmdp)
40{ 40{
41 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 41 BUG_ON((unsigned long)pmdp & (PAGE_SIZE-1));
42 free_page((unsigned long)pmd); 42 free_page((unsigned long)pmdp);
43} 43}
44 44
45static inline void __pud_populate(pud_t *pud, phys_addr_t pmd, pudval_t prot) 45static inline void __pud_populate(pud_t *pudp, phys_addr_t pmdp, pudval_t prot)
46{ 46{
47 set_pud(pud, __pud(__phys_to_pud_val(pmd) | prot)); 47 set_pud(pudp, __pud(__phys_to_pud_val(pmdp) | prot));
48} 48}
49 49
50static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) 50static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmdp)
51{ 51{
52 __pud_populate(pud, __pa(pmd), PMD_TYPE_TABLE); 52 __pud_populate(pudp, __pa(pmdp), PMD_TYPE_TABLE);
53} 53}
54#else 54#else
55static inline void __pud_populate(pud_t *pud, phys_addr_t pmd, pudval_t prot) 55static inline void __pud_populate(pud_t *pudp, phys_addr_t pmdp, pudval_t prot)
56{ 56{
57 BUILD_BUG(); 57 BUILD_BUG();
58} 58}
@@ -65,30 +65,30 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
65 return (pud_t *)__get_free_page(PGALLOC_GFP); 65 return (pud_t *)__get_free_page(PGALLOC_GFP);
66} 66}
67 67
68static inline void pud_free(struct mm_struct *mm, pud_t *pud) 68static inline void pud_free(struct mm_struct *mm, pud_t *pudp)
69{ 69{
70 BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); 70 BUG_ON((unsigned long)pudp & (PAGE_SIZE-1));
71 free_page((unsigned long)pud); 71 free_page((unsigned long)pudp);
72} 72}
73 73
74static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pud, pgdval_t prot) 74static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pudp, pgdval_t prot)
75{ 75{
76 set_pgd(pgdp, __pgd(__phys_to_pgd_val(pud) | prot)); 76 set_pgd(pgdp, __pgd(__phys_to_pgd_val(pudp) | prot));
77} 77}
78 78
79static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) 79static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgdp, pud_t *pudp)
80{ 80{
81 __pgd_populate(pgd, __pa(pud), PUD_TYPE_TABLE); 81 __pgd_populate(pgdp, __pa(pudp), PUD_TYPE_TABLE);
82} 82}
83#else 83#else
84static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pud, pgdval_t prot) 84static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t pudp, pgdval_t prot)
85{ 85{
86 BUILD_BUG(); 86 BUILD_BUG();
87} 87}
88#endif /* CONFIG_PGTABLE_LEVELS > 3 */ 88#endif /* CONFIG_PGTABLE_LEVELS > 3 */
89 89
90extern pgd_t *pgd_alloc(struct mm_struct *mm); 90extern pgd_t *pgd_alloc(struct mm_struct *mm);
91extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 91extern void pgd_free(struct mm_struct *mm, pgd_t *pgdp);
92 92
93static inline pte_t * 93static inline pte_t *
94pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) 94pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
@@ -114,10 +114,10 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
114/* 114/*
115 * Free a PTE table. 115 * Free a PTE table.
116 */ 116 */
117static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 117static inline void pte_free_kernel(struct mm_struct *mm, pte_t *ptep)
118{ 118{
119 if (pte) 119 if (ptep)
120 free_page((unsigned long)pte); 120 free_page((unsigned long)ptep);
121} 121}
122 122
123static inline void pte_free(struct mm_struct *mm, pgtable_t pte) 123static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
@@ -126,10 +126,10 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
126 __free_page(pte); 126 __free_page(pte);
127} 127}
128 128
129static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, 129static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t ptep,
130 pmdval_t prot) 130 pmdval_t prot)
131{ 131{
132 set_pmd(pmdp, __pmd(__phys_to_pmd_val(pte) | prot)); 132 set_pmd(pmdp, __pmd(__phys_to_pmd_val(ptep) | prot));
133} 133}
134 134
135/* 135/*
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 094374c82db0..7e2c27e63cd8 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -218,7 +218,7 @@ static inline pmd_t pmd_mkcont(pmd_t pmd)
218 218
219static inline void set_pte(pte_t *ptep, pte_t pte) 219static inline void set_pte(pte_t *ptep, pte_t pte)
220{ 220{
221 *ptep = pte; 221 WRITE_ONCE(*ptep, pte);
222 222
223 /* 223 /*
224 * Only if the new pte is valid and kernel, otherwise TLB maintenance 224 * Only if the new pte is valid and kernel, otherwise TLB maintenance
@@ -250,6 +250,8 @@ extern void __sync_icache_dcache(pte_t pteval, unsigned long addr);
250static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, 250static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
251 pte_t *ptep, pte_t pte) 251 pte_t *ptep, pte_t pte)
252{ 252{
253 pte_t old_pte;
254
253 if (pte_present(pte) && pte_user_exec(pte) && !pte_special(pte)) 255 if (pte_present(pte) && pte_user_exec(pte) && !pte_special(pte))
254 __sync_icache_dcache(pte, addr); 256 __sync_icache_dcache(pte, addr);
255 257
@@ -258,14 +260,15 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
258 * hardware updates of the pte (ptep_set_access_flags safely changes 260 * hardware updates of the pte (ptep_set_access_flags safely changes
259 * valid ptes without going through an invalid entry). 261 * valid ptes without going through an invalid entry).
260 */ 262 */
261 if (IS_ENABLED(CONFIG_DEBUG_VM) && pte_valid(*ptep) && pte_valid(pte) && 263 old_pte = READ_ONCE(*ptep);
264 if (IS_ENABLED(CONFIG_DEBUG_VM) && pte_valid(old_pte) && pte_valid(pte) &&
262 (mm == current->active_mm || atomic_read(&mm->mm_users) > 1)) { 265 (mm == current->active_mm || atomic_read(&mm->mm_users) > 1)) {
263 VM_WARN_ONCE(!pte_young(pte), 266 VM_WARN_ONCE(!pte_young(pte),
264 "%s: racy access flag clearing: 0x%016llx -> 0x%016llx", 267 "%s: racy access flag clearing: 0x%016llx -> 0x%016llx",
265 __func__, pte_val(*ptep), pte_val(pte)); 268 __func__, pte_val(old_pte), pte_val(pte));
266 VM_WARN_ONCE(pte_write(*ptep) && !pte_dirty(pte), 269 VM_WARN_ONCE(pte_write(old_pte) && !pte_dirty(pte),
267 "%s: racy dirty state clearing: 0x%016llx -> 0x%016llx", 270 "%s: racy dirty state clearing: 0x%016llx -> 0x%016llx",
268 __func__, pte_val(*ptep), pte_val(pte)); 271 __func__, pte_val(old_pte), pte_val(pte));
269 } 272 }
270 273
271 set_pte(ptep, pte); 274 set_pte(ptep, pte);
@@ -431,7 +434,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
431 434
432static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) 435static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
433{ 436{
434 *pmdp = pmd; 437 WRITE_ONCE(*pmdp, pmd);
435 dsb(ishst); 438 dsb(ishst);
436 isb(); 439 isb();
437} 440}
@@ -482,7 +485,7 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd)
482 485
483static inline void set_pud(pud_t *pudp, pud_t pud) 486static inline void set_pud(pud_t *pudp, pud_t pud)
484{ 487{
485 *pudp = pud; 488 WRITE_ONCE(*pudp, pud);
486 dsb(ishst); 489 dsb(ishst);
487 isb(); 490 isb();
488} 491}
@@ -500,7 +503,7 @@ static inline phys_addr_t pud_page_paddr(pud_t pud)
500/* Find an entry in the second-level page table. */ 503/* Find an entry in the second-level page table. */
501#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) 504#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
502 505
503#define pmd_offset_phys(dir, addr) (pud_page_paddr(*(dir)) + pmd_index(addr) * sizeof(pmd_t)) 506#define pmd_offset_phys(dir, addr) (pud_page_paddr(READ_ONCE(*(dir))) + pmd_index(addr) * sizeof(pmd_t))
504#define pmd_offset(dir, addr) ((pmd_t *)__va(pmd_offset_phys((dir), (addr)))) 507#define pmd_offset(dir, addr) ((pmd_t *)__va(pmd_offset_phys((dir), (addr))))
505 508
506#define pmd_set_fixmap(addr) ((pmd_t *)set_fixmap_offset(FIX_PMD, addr)) 509#define pmd_set_fixmap(addr) ((pmd_t *)set_fixmap_offset(FIX_PMD, addr))
@@ -535,7 +538,7 @@ static inline phys_addr_t pud_page_paddr(pud_t pud)
535 538
536static inline void set_pgd(pgd_t *pgdp, pgd_t pgd) 539static inline void set_pgd(pgd_t *pgdp, pgd_t pgd)
537{ 540{
538 *pgdp = pgd; 541 WRITE_ONCE(*pgdp, pgd);
539 dsb(ishst); 542 dsb(ishst);
540} 543}
541 544
@@ -552,7 +555,7 @@ static inline phys_addr_t pgd_page_paddr(pgd_t pgd)
552/* Find an entry in the frst-level page table. */ 555/* Find an entry in the frst-level page table. */
553#define pud_index(addr) (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)) 556#define pud_index(addr) (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
554 557
555#define pud_offset_phys(dir, addr) (pgd_page_paddr(*(dir)) + pud_index(addr) * sizeof(pud_t)) 558#define pud_offset_phys(dir, addr) (pgd_page_paddr(READ_ONCE(*(dir))) + pud_index(addr) * sizeof(pud_t))
556#define pud_offset(dir, addr) ((pud_t *)__va(pud_offset_phys((dir), (addr)))) 559#define pud_offset(dir, addr) ((pud_t *)__va(pud_offset_phys((dir), (addr))))
557 560
558#define pud_set_fixmap(addr) ((pud_t *)set_fixmap_offset(FIX_PUD, addr)) 561#define pud_set_fixmap(addr) ((pud_t *)set_fixmap_offset(FIX_PUD, addr))
diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h
index 472ef944e932..902f9edacbea 100644
--- a/arch/arm64/include/asm/stacktrace.h
+++ b/arch/arm64/include/asm/stacktrace.h
@@ -28,7 +28,7 @@ struct stackframe {
28 unsigned long fp; 28 unsigned long fp;
29 unsigned long pc; 29 unsigned long pc;
30#ifdef CONFIG_FUNCTION_GRAPH_TRACER 30#ifdef CONFIG_FUNCTION_GRAPH_TRACER
31 unsigned int graph; 31 int graph;
32#endif 32#endif
33}; 33};
34 34
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 543e11f0f657..e66b0fca99c2 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -72,15 +72,15 @@ static inline void set_fs(mm_segment_t fs)
72 * This is equivalent to the following test: 72 * This is equivalent to the following test:
73 * (u65)addr + (u65)size <= (u65)current->addr_limit + 1 73 * (u65)addr + (u65)size <= (u65)current->addr_limit + 1
74 */ 74 */
75static inline unsigned long __range_ok(unsigned long addr, unsigned long size) 75static inline unsigned long __range_ok(const void __user *addr, unsigned long size)
76{ 76{
77 unsigned long limit = current_thread_info()->addr_limit; 77 unsigned long ret, limit = current_thread_info()->addr_limit;
78 78
79 __chk_user_ptr(addr); 79 __chk_user_ptr(addr);
80 asm volatile( 80 asm volatile(
81 // A + B <= C + 1 for all A,B,C, in four easy steps: 81 // A + B <= C + 1 for all A,B,C, in four easy steps:
82 // 1: X = A + B; X' = X % 2^64 82 // 1: X = A + B; X' = X % 2^64
83 " adds %0, %0, %2\n" 83 " adds %0, %3, %2\n"
84 // 2: Set C = 0 if X > 2^64, to guarantee X' > C in step 4 84 // 2: Set C = 0 if X > 2^64, to guarantee X' > C in step 4
85 " csel %1, xzr, %1, hi\n" 85 " csel %1, xzr, %1, hi\n"
86 // 3: Set X' = ~0 if X >= 2^64. For X == 2^64, this decrements X' 86 // 3: Set X' = ~0 if X >= 2^64. For X == 2^64, this decrements X'
@@ -92,9 +92,9 @@ static inline unsigned long __range_ok(unsigned long addr, unsigned long size)
92 // testing X' - C == 0, subject to the previous adjustments. 92 // testing X' - C == 0, subject to the previous adjustments.
93 " sbcs xzr, %0, %1\n" 93 " sbcs xzr, %0, %1\n"
94 " cset %0, ls\n" 94 " cset %0, ls\n"
95 : "+r" (addr), "+r" (limit) : "Ir" (size) : "cc"); 95 : "=&r" (ret), "+r" (limit) : "Ir" (size), "0" (addr) : "cc");
96 96
97 return addr; 97 return ret;
98} 98}
99 99
100/* 100/*
@@ -104,7 +104,7 @@ static inline unsigned long __range_ok(unsigned long addr, unsigned long size)
104 */ 104 */
105#define untagged_addr(addr) sign_extend64(addr, 55) 105#define untagged_addr(addr) sign_extend64(addr, 55)
106 106
107#define access_ok(type, addr, size) __range_ok((unsigned long)(addr), size) 107#define access_ok(type, addr, size) __range_ok(addr, size)
108#define user_addr_max get_fs 108#define user_addr_max get_fs
109 109
110#define _ASM_EXTABLE(from, to) \ 110#define _ASM_EXTABLE(from, to) \
diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c
index c33b5e4010ab..68450e954d47 100644
--- a/arch/arm64/kernel/armv8_deprecated.c
+++ b/arch/arm64/kernel/armv8_deprecated.c
@@ -370,6 +370,7 @@ static unsigned int __kprobes aarch32_check_condition(u32 opcode, u32 psr)
370static int swp_handler(struct pt_regs *regs, u32 instr) 370static int swp_handler(struct pt_regs *regs, u32 instr)
371{ 371{
372 u32 destreg, data, type, address = 0; 372 u32 destreg, data, type, address = 0;
373 const void __user *user_ptr;
373 int rn, rt2, res = 0; 374 int rn, rt2, res = 0;
374 375
375 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc); 376 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
@@ -401,7 +402,8 @@ static int swp_handler(struct pt_regs *regs, u32 instr)
401 aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET), data); 402 aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET), data);
402 403
403 /* Check access in reasonable access range for both SWP and SWPB */ 404 /* Check access in reasonable access range for both SWP and SWPB */
404 if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) { 405 user_ptr = (const void __user *)(unsigned long)(address & ~3);
406 if (!access_ok(VERIFY_WRITE, user_ptr, 4)) {
405 pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n", 407 pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n",
406 address); 408 address);
407 goto fault; 409 goto fault;
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 07823595b7f0..52f15cd896e1 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -408,6 +408,15 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
408 }, 408 },
409 { 409 {
410 .capability = ARM64_HARDEN_BRANCH_PREDICTOR, 410 .capability = ARM64_HARDEN_BRANCH_PREDICTOR,
411 MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR),
412 .enable = qcom_enable_link_stack_sanitization,
413 },
414 {
415 .capability = ARM64_HARDEN_BP_POST_GUEST_EXIT,
416 MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR),
417 },
418 {
419 .capability = ARM64_HARDEN_BRANCH_PREDICTOR,
411 MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), 420 MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN),
412 .enable = enable_smccc_arch_workaround_1, 421 .enable = enable_smccc_arch_workaround_1,
413 }, 422 },
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 29b1f873e337..2985a067fc13 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -199,9 +199,11 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = {
199}; 199};
200 200
201static const struct arm64_ftr_bits ftr_ctr[] = { 201static const struct arm64_ftr_bits ftr_ctr[] = {
202 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RAO */ 202 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */
203 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 29, 1, 1), /* DIC */
204 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 28, 1, 1), /* IDC */
203 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */ 205 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */
204 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 20, 4, 0), /* ERG */ 206 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 20, 4, 0), /* ERG */
205 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */ 207 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */
206 /* 208 /*
207 * Linux can handle differing I-cache policies. Userspace JITs will 209 * Linux can handle differing I-cache policies. Userspace JITs will
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index f85ac58d08a3..a8bf1c892b90 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -90,7 +90,7 @@ static int __init set_permissions(pte_t *ptep, pgtable_t token,
90 unsigned long addr, void *data) 90 unsigned long addr, void *data)
91{ 91{
92 efi_memory_desc_t *md = data; 92 efi_memory_desc_t *md = data;
93 pte_t pte = *ptep; 93 pte_t pte = READ_ONCE(*ptep);
94 94
95 if (md->attribute & EFI_MEMORY_RO) 95 if (md->attribute & EFI_MEMORY_RO)
96 pte = set_pte_bit(pte, __pgprot(PTE_RDONLY)); 96 pte = set_pte_bit(pte, __pgprot(PTE_RDONLY));
diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c
index f20cf7e99249..1ec5f28c39fc 100644
--- a/arch/arm64/kernel/hibernate.c
+++ b/arch/arm64/kernel/hibernate.c
@@ -202,10 +202,10 @@ static int create_safe_exec_page(void *src_start, size_t length,
202 gfp_t mask) 202 gfp_t mask)
203{ 203{
204 int rc = 0; 204 int rc = 0;
205 pgd_t *pgd; 205 pgd_t *pgdp;
206 pud_t *pud; 206 pud_t *pudp;
207 pmd_t *pmd; 207 pmd_t *pmdp;
208 pte_t *pte; 208 pte_t *ptep;
209 unsigned long dst = (unsigned long)allocator(mask); 209 unsigned long dst = (unsigned long)allocator(mask);
210 210
211 if (!dst) { 211 if (!dst) {
@@ -216,38 +216,38 @@ static int create_safe_exec_page(void *src_start, size_t length,
216 memcpy((void *)dst, src_start, length); 216 memcpy((void *)dst, src_start, length);
217 flush_icache_range(dst, dst + length); 217 flush_icache_range(dst, dst + length);
218 218
219 pgd = pgd_offset_raw(allocator(mask), dst_addr); 219 pgdp = pgd_offset_raw(allocator(mask), dst_addr);
220 if (pgd_none(*pgd)) { 220 if (pgd_none(READ_ONCE(*pgdp))) {
221 pud = allocator(mask); 221 pudp = allocator(mask);
222 if (!pud) { 222 if (!pudp) {
223 rc = -ENOMEM; 223 rc = -ENOMEM;
224 goto out; 224 goto out;
225 } 225 }
226 pgd_populate(&init_mm, pgd, pud); 226 pgd_populate(&init_mm, pgdp, pudp);
227 } 227 }
228 228
229 pud = pud_offset(pgd, dst_addr); 229 pudp = pud_offset(pgdp, dst_addr);
230 if (pud_none(*pud)) { 230 if (pud_none(READ_ONCE(*pudp))) {
231 pmd = allocator(mask); 231 pmdp = allocator(mask);
232 if (!pmd) { 232 if (!pmdp) {
233 rc = -ENOMEM; 233 rc = -ENOMEM;
234 goto out; 234 goto out;
235 } 235 }
236 pud_populate(&init_mm, pud, pmd); 236 pud_populate(&init_mm, pudp, pmdp);
237 } 237 }
238 238
239 pmd = pmd_offset(pud, dst_addr); 239 pmdp = pmd_offset(pudp, dst_addr);
240 if (pmd_none(*pmd)) { 240 if (pmd_none(READ_ONCE(*pmdp))) {
241 pte = allocator(mask); 241 ptep = allocator(mask);
242 if (!pte) { 242 if (!ptep) {
243 rc = -ENOMEM; 243 rc = -ENOMEM;
244 goto out; 244 goto out;
245 } 245 }
246 pmd_populate_kernel(&init_mm, pmd, pte); 246 pmd_populate_kernel(&init_mm, pmdp, ptep);
247 } 247 }
248 248
249 pte = pte_offset_kernel(pmd, dst_addr); 249 ptep = pte_offset_kernel(pmdp, dst_addr);
250 set_pte(pte, pfn_pte(virt_to_pfn(dst), PAGE_KERNEL_EXEC)); 250 set_pte(ptep, pfn_pte(virt_to_pfn(dst), PAGE_KERNEL_EXEC));
251 251
252 /* 252 /*
253 * Load our new page tables. A strict BBM approach requires that we 253 * Load our new page tables. A strict BBM approach requires that we
@@ -263,7 +263,7 @@ static int create_safe_exec_page(void *src_start, size_t length,
263 */ 263 */
264 cpu_set_reserved_ttbr0(); 264 cpu_set_reserved_ttbr0();
265 local_flush_tlb_all(); 265 local_flush_tlb_all();
266 write_sysreg(phys_to_ttbr(virt_to_phys(pgd)), ttbr0_el1); 266 write_sysreg(phys_to_ttbr(virt_to_phys(pgdp)), ttbr0_el1);
267 isb(); 267 isb();
268 268
269 *phys_dst_addr = virt_to_phys((void *)dst); 269 *phys_dst_addr = virt_to_phys((void *)dst);
@@ -320,9 +320,9 @@ int swsusp_arch_suspend(void)
320 return ret; 320 return ret;
321} 321}
322 322
323static void _copy_pte(pte_t *dst_pte, pte_t *src_pte, unsigned long addr) 323static void _copy_pte(pte_t *dst_ptep, pte_t *src_ptep, unsigned long addr)
324{ 324{
325 pte_t pte = *src_pte; 325 pte_t pte = READ_ONCE(*src_ptep);
326 326
327 if (pte_valid(pte)) { 327 if (pte_valid(pte)) {
328 /* 328 /*
@@ -330,7 +330,7 @@ static void _copy_pte(pte_t *dst_pte, pte_t *src_pte, unsigned long addr)
330 * read only (code, rodata). Clear the RDONLY bit from 330 * read only (code, rodata). Clear the RDONLY bit from
331 * the temporary mappings we use during restore. 331 * the temporary mappings we use during restore.
332 */ 332 */
333 set_pte(dst_pte, pte_mkwrite(pte)); 333 set_pte(dst_ptep, pte_mkwrite(pte));
334 } else if (debug_pagealloc_enabled() && !pte_none(pte)) { 334 } else if (debug_pagealloc_enabled() && !pte_none(pte)) {
335 /* 335 /*
336 * debug_pagealloc will removed the PTE_VALID bit if 336 * debug_pagealloc will removed the PTE_VALID bit if
@@ -343,112 +343,116 @@ static void _copy_pte(pte_t *dst_pte, pte_t *src_pte, unsigned long addr)
343 */ 343 */
344 BUG_ON(!pfn_valid(pte_pfn(pte))); 344 BUG_ON(!pfn_valid(pte_pfn(pte)));
345 345
346 set_pte(dst_pte, pte_mkpresent(pte_mkwrite(pte))); 346 set_pte(dst_ptep, pte_mkpresent(pte_mkwrite(pte)));
347 } 347 }
348} 348}
349 349
350static int copy_pte(pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long start, 350static int copy_pte(pmd_t *dst_pmdp, pmd_t *src_pmdp, unsigned long start,
351 unsigned long end) 351 unsigned long end)
352{ 352{
353 pte_t *src_pte; 353 pte_t *src_ptep;
354 pte_t *dst_pte; 354 pte_t *dst_ptep;
355 unsigned long addr = start; 355 unsigned long addr = start;
356 356
357 dst_pte = (pte_t *)get_safe_page(GFP_ATOMIC); 357 dst_ptep = (pte_t *)get_safe_page(GFP_ATOMIC);
358 if (!dst_pte) 358 if (!dst_ptep)
359 return -ENOMEM; 359 return -ENOMEM;
360 pmd_populate_kernel(&init_mm, dst_pmd, dst_pte); 360 pmd_populate_kernel(&init_mm, dst_pmdp, dst_ptep);
361 dst_pte = pte_offset_kernel(dst_pmd, start); 361 dst_ptep = pte_offset_kernel(dst_pmdp, start);
362 362
363 src_pte = pte_offset_kernel(src_pmd, start); 363 src_ptep = pte_offset_kernel(src_pmdp, start);
364 do { 364 do {
365 _copy_pte(dst_pte, src_pte, addr); 365 _copy_pte(dst_ptep, src_ptep, addr);
366 } while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end); 366 } while (dst_ptep++, src_ptep++, addr += PAGE_SIZE, addr != end);
367 367
368 return 0; 368 return 0;
369} 369}
370 370
371static int copy_pmd(pud_t *dst_pud, pud_t *src_pud, unsigned long start, 371static int copy_pmd(pud_t *dst_pudp, pud_t *src_pudp, unsigned long start,
372 unsigned long end) 372 unsigned long end)
373{ 373{
374 pmd_t *src_pmd; 374 pmd_t *src_pmdp;
375 pmd_t *dst_pmd; 375 pmd_t *dst_pmdp;
376 unsigned long next; 376 unsigned long next;
377 unsigned long addr = start; 377 unsigned long addr = start;
378 378
379 if (pud_none(*dst_pud)) { 379 if (pud_none(READ_ONCE(*dst_pudp))) {
380 dst_pmd = (pmd_t *)get_safe_page(GFP_ATOMIC); 380 dst_pmdp = (pmd_t *)get_safe_page(GFP_ATOMIC);
381 if (!dst_pmd) 381 if (!dst_pmdp)
382 return -ENOMEM; 382 return -ENOMEM;
383 pud_populate(&init_mm, dst_pud, dst_pmd); 383 pud_populate(&init_mm, dst_pudp, dst_pmdp);
384 } 384 }
385 dst_pmd = pmd_offset(dst_pud, start); 385 dst_pmdp = pmd_offset(dst_pudp, start);
386 386
387 src_pmd = pmd_offset(src_pud, start); 387 src_pmdp = pmd_offset(src_pudp, start);
388 do { 388 do {
389 pmd_t pmd = READ_ONCE(*src_pmdp);
390
389 next = pmd_addr_end(addr, end); 391 next = pmd_addr_end(addr, end);
390 if (pmd_none(*src_pmd)) 392 if (pmd_none(pmd))
391 continue; 393 continue;
392 if (pmd_table(*src_pmd)) { 394 if (pmd_table(pmd)) {
393 if (copy_pte(dst_pmd, src_pmd, addr, next)) 395 if (copy_pte(dst_pmdp, src_pmdp, addr, next))
394 return -ENOMEM; 396 return -ENOMEM;
395 } else { 397 } else {
396 set_pmd(dst_pmd, 398 set_pmd(dst_pmdp,
397 __pmd(pmd_val(*src_pmd) & ~PMD_SECT_RDONLY)); 399 __pmd(pmd_val(pmd) & ~PMD_SECT_RDONLY));
398 } 400 }
399 } while (dst_pmd++, src_pmd++, addr = next, addr != end); 401 } while (dst_pmdp++, src_pmdp++, addr = next, addr != end);
400 402
401 return 0; 403 return 0;
402} 404}
403 405
404static int copy_pud(pgd_t *dst_pgd, pgd_t *src_pgd, unsigned long start, 406static int copy_pud(pgd_t *dst_pgdp, pgd_t *src_pgdp, unsigned long start,
405 unsigned long end) 407 unsigned long end)
406{ 408{
407 pud_t *dst_pud; 409 pud_t *dst_pudp;
408 pud_t *src_pud; 410 pud_t *src_pudp;
409 unsigned long next; 411 unsigned long next;
410 unsigned long addr = start; 412 unsigned long addr = start;
411 413
412 if (pgd_none(*dst_pgd)) { 414 if (pgd_none(READ_ONCE(*dst_pgdp))) {
413 dst_pud = (pud_t *)get_safe_page(GFP_ATOMIC); 415 dst_pudp = (pud_t *)get_safe_page(GFP_ATOMIC);
414 if (!dst_pud) 416 if (!dst_pudp)
415 return -ENOMEM; 417 return -ENOMEM;
416 pgd_populate(&init_mm, dst_pgd, dst_pud); 418 pgd_populate(&init_mm, dst_pgdp, dst_pudp);
417 } 419 }
418 dst_pud = pud_offset(dst_pgd, start); 420 dst_pudp = pud_offset(dst_pgdp, start);
419 421
420 src_pud = pud_offset(src_pgd, start); 422 src_pudp = pud_offset(src_pgdp, start);
421 do { 423 do {
424 pud_t pud = READ_ONCE(*src_pudp);
425
422 next = pud_addr_end(addr, end); 426 next = pud_addr_end(addr, end);
423 if (pud_none(*src_pud)) 427 if (pud_none(pud))
424 continue; 428 continue;
425 if (pud_table(*(src_pud))) { 429 if (pud_table(pud)) {
426 if (copy_pmd(dst_pud, src_pud, addr, next)) 430 if (copy_pmd(dst_pudp, src_pudp, addr, next))
427 return -ENOMEM; 431 return -ENOMEM;
428 } else { 432 } else {
429 set_pud(dst_pud, 433 set_pud(dst_pudp,
430 __pud(pud_val(*src_pud) & ~PMD_SECT_RDONLY)); 434 __pud(pud_val(pud) & ~PMD_SECT_RDONLY));
431 } 435 }
432 } while (dst_pud++, src_pud++, addr = next, addr != end); 436 } while (dst_pudp++, src_pudp++, addr = next, addr != end);
433 437
434 return 0; 438 return 0;
435} 439}
436 440
437static int copy_page_tables(pgd_t *dst_pgd, unsigned long start, 441static int copy_page_tables(pgd_t *dst_pgdp, unsigned long start,
438 unsigned long end) 442 unsigned long end)
439{ 443{
440 unsigned long next; 444 unsigned long next;
441 unsigned long addr = start; 445 unsigned long addr = start;
442 pgd_t *src_pgd = pgd_offset_k(start); 446 pgd_t *src_pgdp = pgd_offset_k(start);
443 447
444 dst_pgd = pgd_offset_raw(dst_pgd, start); 448 dst_pgdp = pgd_offset_raw(dst_pgdp, start);
445 do { 449 do {
446 next = pgd_addr_end(addr, end); 450 next = pgd_addr_end(addr, end);
447 if (pgd_none(*src_pgd)) 451 if (pgd_none(READ_ONCE(*src_pgdp)))
448 continue; 452 continue;
449 if (copy_pud(dst_pgd, src_pgd, addr, next)) 453 if (copy_pud(dst_pgdp, src_pgdp, addr, next))
450 return -ENOMEM; 454 return -ENOMEM;
451 } while (dst_pgd++, src_pgd++, addr = next, addr != end); 455 } while (dst_pgdp++, src_pgdp++, addr = next, addr != end);
452 456
453 return 0; 457 return 0;
454} 458}
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 75b220ba73a3..85a251b6dfa8 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -908,9 +908,9 @@ static void __armv8pmu_probe_pmu(void *info)
908 int pmuver; 908 int pmuver;
909 909
910 dfr0 = read_sysreg(id_aa64dfr0_el1); 910 dfr0 = read_sysreg(id_aa64dfr0_el1);
911 pmuver = cpuid_feature_extract_signed_field(dfr0, 911 pmuver = cpuid_feature_extract_unsigned_field(dfr0,
912 ID_AA64DFR0_PMUVER_SHIFT); 912 ID_AA64DFR0_PMUVER_SHIFT);
913 if (pmuver < 1) 913 if (pmuver == 0xf || pmuver == 0)
914 return; 914 return;
915 915
916 probe->present = true; 916 probe->present = true;
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index ad8aeb098b31..c0da6efe5465 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -220,8 +220,15 @@ void __show_regs(struct pt_regs *regs)
220 220
221 show_regs_print_info(KERN_DEFAULT); 221 show_regs_print_info(KERN_DEFAULT);
222 print_pstate(regs); 222 print_pstate(regs);
223 printk("pc : %pS\n", (void *)regs->pc); 223
224 printk("lr : %pS\n", (void *)lr); 224 if (!user_mode(regs)) {
225 printk("pc : %pS\n", (void *)regs->pc);
226 printk("lr : %pS\n", (void *)lr);
227 } else {
228 printk("pc : %016llx\n", regs->pc);
229 printk("lr : %016llx\n", lr);
230 }
231
225 printk("sp : %016llx\n", sp); 232 printk("sp : %016llx\n", sp);
226 233
227 i = top_reg; 234 i = top_reg;
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6618036ae6d4..9ae31f7e2243 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1419,7 +1419,7 @@ static int compat_ptrace_hbp_get(unsigned int note_type,
1419 u64 addr = 0; 1419 u64 addr = 0;
1420 u32 ctrl = 0; 1420 u32 ctrl = 0;
1421 1421
1422 int err, idx = compat_ptrace_hbp_num_to_idx(num);; 1422 int err, idx = compat_ptrace_hbp_num_to_idx(num);
1423 1423
1424 if (num & 1) { 1424 if (num & 1) {
1425 err = ptrace_hbp_get_addr(note_type, tsk, idx, &addr); 1425 err = ptrace_hbp_get_addr(note_type, tsk, idx, &addr);
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 76809ccd309c..d5718a060672 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -59,6 +59,11 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
59#ifdef CONFIG_FUNCTION_GRAPH_TRACER 59#ifdef CONFIG_FUNCTION_GRAPH_TRACER
60 if (tsk->ret_stack && 60 if (tsk->ret_stack &&
61 (frame->pc == (unsigned long)return_to_handler)) { 61 (frame->pc == (unsigned long)return_to_handler)) {
62 if (WARN_ON_ONCE(frame->graph == -1))
63 return -EINVAL;
64 if (frame->graph < -1)
65 frame->graph += FTRACE_NOTRACE_DEPTH;
66
62 /* 67 /*
63 * This is a case where function graph tracer has 68 * This is a case where function graph tracer has
64 * modified a return address (LR) in a stack frame 69 * modified a return address (LR) in a stack frame
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index 8b8bbd3eaa52..a382b2a1b84e 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -57,7 +57,7 @@ do_compat_cache_op(unsigned long start, unsigned long end, int flags)
57 if (end < start || flags) 57 if (end < start || flags)
58 return -EINVAL; 58 return -EINVAL;
59 59
60 if (!access_ok(VERIFY_READ, start, end - start)) 60 if (!access_ok(VERIFY_READ, (const void __user *)start, end - start))
61 return -EFAULT; 61 return -EFAULT;
62 62
63 return __do_compat_cache_op(start, end); 63 return __do_compat_cache_op(start, end);
diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c
index a4391280fba9..f258636273c9 100644
--- a/arch/arm64/kernel/time.c
+++ b/arch/arm64/kernel/time.c
@@ -52,7 +52,7 @@ unsigned long profile_pc(struct pt_regs *regs)
52 frame.fp = regs->regs[29]; 52 frame.fp = regs->regs[29];
53 frame.pc = regs->pc; 53 frame.pc = regs->pc;
54#ifdef CONFIG_FUNCTION_GRAPH_TRACER 54#ifdef CONFIG_FUNCTION_GRAPH_TRACER
55 frame.graph = -1; /* no task info */ 55 frame.graph = current->curr_ret_stack;
56#endif 56#endif
57 do { 57 do {
58 int ret = unwind_frame(NULL, &frame); 58 int ret = unwind_frame(NULL, &frame);
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index bbb0fde2780e..eb2d15147e8d 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -57,7 +57,7 @@ static const char *handler[]= {
57 "Error" 57 "Error"
58}; 58};
59 59
60int show_unhandled_signals = 1; 60int show_unhandled_signals = 0;
61 61
62static void dump_backtrace_entry(unsigned long where) 62static void dump_backtrace_entry(unsigned long where)
63{ 63{
@@ -526,14 +526,6 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
526 } 526 }
527#endif 527#endif
528 528
529 if (show_unhandled_signals_ratelimited()) {
530 pr_info("%s[%d]: syscall %d\n", current->comm,
531 task_pid_nr(current), regs->syscallno);
532 dump_instr("", regs);
533 if (user_mode(regs))
534 __show_regs(regs);
535 }
536
537 return sys_ni_syscall(); 529 return sys_ni_syscall();
538} 530}
539 531
diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
index 116252a8d3a5..870f4b1587f9 100644
--- a/arch/arm64/kvm/hyp/switch.c
+++ b/arch/arm64/kvm/hyp/switch.c
@@ -407,8 +407,10 @@ again:
407 u32 midr = read_cpuid_id(); 407 u32 midr = read_cpuid_id();
408 408
409 /* Apply BTAC predictors mitigation to all Falkor chips */ 409 /* Apply BTAC predictors mitigation to all Falkor chips */
410 if ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1) 410 if (((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR) ||
411 ((midr & MIDR_CPU_MODEL_MASK) == MIDR_QCOM_FALKOR_V1)) {
411 __qcom_hyp_sanitize_btac_predictors(); 412 __qcom_hyp_sanitize_btac_predictors();
413 }
412 } 414 }
413 415
414 fp_enabled = __fpsimd_enabled(); 416 fp_enabled = __fpsimd_enabled();
diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c
index 7b60d62ac593..65dfc8571bf8 100644
--- a/arch/arm64/mm/dump.c
+++ b/arch/arm64/mm/dump.c
@@ -286,48 +286,52 @@ static void note_page(struct pg_state *st, unsigned long addr, unsigned level,
286 286
287} 287}
288 288
289static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start) 289static void walk_pte(struct pg_state *st, pmd_t *pmdp, unsigned long start)
290{ 290{
291 pte_t *pte = pte_offset_kernel(pmd, 0UL); 291 pte_t *ptep = pte_offset_kernel(pmdp, 0UL);
292 unsigned long addr; 292 unsigned long addr;
293 unsigned i; 293 unsigned i;
294 294
295 for (i = 0; i < PTRS_PER_PTE; i++, pte++) { 295 for (i = 0; i < PTRS_PER_PTE; i++, ptep++) {
296 addr = start + i * PAGE_SIZE; 296 addr = start + i * PAGE_SIZE;
297 note_page(st, addr, 4, pte_val(*pte)); 297 note_page(st, addr, 4, READ_ONCE(pte_val(*ptep)));
298 } 298 }
299} 299}
300 300
301static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) 301static void walk_pmd(struct pg_state *st, pud_t *pudp, unsigned long start)
302{ 302{
303 pmd_t *pmd = pmd_offset(pud, 0UL); 303 pmd_t *pmdp = pmd_offset(pudp, 0UL);
304 unsigned long addr; 304 unsigned long addr;
305 unsigned i; 305 unsigned i;
306 306
307 for (i = 0; i < PTRS_PER_PMD; i++, pmd++) { 307 for (i = 0; i < PTRS_PER_PMD; i++, pmdp++) {
308 pmd_t pmd = READ_ONCE(*pmdp);
309
308 addr = start + i * PMD_SIZE; 310 addr = start + i * PMD_SIZE;
309 if (pmd_none(*pmd) || pmd_sect(*pmd)) { 311 if (pmd_none(pmd) || pmd_sect(pmd)) {
310 note_page(st, addr, 3, pmd_val(*pmd)); 312 note_page(st, addr, 3, pmd_val(pmd));
311 } else { 313 } else {
312 BUG_ON(pmd_bad(*pmd)); 314 BUG_ON(pmd_bad(pmd));
313 walk_pte(st, pmd, addr); 315 walk_pte(st, pmdp, addr);
314 } 316 }
315 } 317 }
316} 318}
317 319
318static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start) 320static void walk_pud(struct pg_state *st, pgd_t *pgdp, unsigned long start)
319{ 321{
320 pud_t *pud = pud_offset(pgd, 0UL); 322 pud_t *pudp = pud_offset(pgdp, 0UL);
321 unsigned long addr; 323 unsigned long addr;
322 unsigned i; 324 unsigned i;
323 325
324 for (i = 0; i < PTRS_PER_PUD; i++, pud++) { 326 for (i = 0; i < PTRS_PER_PUD; i++, pudp++) {
327 pud_t pud = READ_ONCE(*pudp);
328
325 addr = start + i * PUD_SIZE; 329 addr = start + i * PUD_SIZE;
326 if (pud_none(*pud) || pud_sect(*pud)) { 330 if (pud_none(pud) || pud_sect(pud)) {
327 note_page(st, addr, 2, pud_val(*pud)); 331 note_page(st, addr, 2, pud_val(pud));
328 } else { 332 } else {
329 BUG_ON(pud_bad(*pud)); 333 BUG_ON(pud_bad(pud));
330 walk_pmd(st, pud, addr); 334 walk_pmd(st, pudp, addr);
331 } 335 }
332 } 336 }
333} 337}
@@ -335,17 +339,19 @@ static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
335static void walk_pgd(struct pg_state *st, struct mm_struct *mm, 339static void walk_pgd(struct pg_state *st, struct mm_struct *mm,
336 unsigned long start) 340 unsigned long start)
337{ 341{
338 pgd_t *pgd = pgd_offset(mm, 0UL); 342 pgd_t *pgdp = pgd_offset(mm, 0UL);
339 unsigned i; 343 unsigned i;
340 unsigned long addr; 344 unsigned long addr;
341 345
342 for (i = 0; i < PTRS_PER_PGD; i++, pgd++) { 346 for (i = 0; i < PTRS_PER_PGD; i++, pgdp++) {
347 pgd_t pgd = READ_ONCE(*pgdp);
348
343 addr = start + i * PGDIR_SIZE; 349 addr = start + i * PGDIR_SIZE;
344 if (pgd_none(*pgd)) { 350 if (pgd_none(pgd)) {
345 note_page(st, addr, 1, pgd_val(*pgd)); 351 note_page(st, addr, 1, pgd_val(pgd));
346 } else { 352 } else {
347 BUG_ON(pgd_bad(*pgd)); 353 BUG_ON(pgd_bad(pgd));
348 walk_pud(st, pgd, addr); 354 walk_pud(st, pgdp, addr);
349 } 355 }
350 } 356 }
351} 357}
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index f76bb2c3c943..bff11553eb05 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -130,7 +130,8 @@ static void mem_abort_decode(unsigned int esr)
130void show_pte(unsigned long addr) 130void show_pte(unsigned long addr)
131{ 131{
132 struct mm_struct *mm; 132 struct mm_struct *mm;
133 pgd_t *pgd; 133 pgd_t *pgdp;
134 pgd_t pgd;
134 135
135 if (addr < TASK_SIZE) { 136 if (addr < TASK_SIZE) {
136 /* TTBR0 */ 137 /* TTBR0 */
@@ -149,33 +150,37 @@ void show_pte(unsigned long addr)
149 return; 150 return;
150 } 151 }
151 152
152 pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgd = %p\n", 153 pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp = %p\n",
153 mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K, 154 mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K,
154 VA_BITS, mm->pgd); 155 VA_BITS, mm->pgd);
155 pgd = pgd_offset(mm, addr); 156 pgdp = pgd_offset(mm, addr);
156 pr_alert("[%016lx] *pgd=%016llx", addr, pgd_val(*pgd)); 157 pgd = READ_ONCE(*pgdp);
158 pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd));
157 159
158 do { 160 do {
159 pud_t *pud; 161 pud_t *pudp, pud;
160 pmd_t *pmd; 162 pmd_t *pmdp, pmd;
161 pte_t *pte; 163 pte_t *ptep, pte;
162 164
163 if (pgd_none(*pgd) || pgd_bad(*pgd)) 165 if (pgd_none(pgd) || pgd_bad(pgd))
164 break; 166 break;
165 167
166 pud = pud_offset(pgd, addr); 168 pudp = pud_offset(pgdp, addr);
167 pr_cont(", *pud=%016llx", pud_val(*pud)); 169 pud = READ_ONCE(*pudp);
168 if (pud_none(*pud) || pud_bad(*pud)) 170 pr_cont(", pud=%016llx", pud_val(pud));
171 if (pud_none(pud) || pud_bad(pud))
169 break; 172 break;
170 173
171 pmd = pmd_offset(pud, addr); 174 pmdp = pmd_offset(pudp, addr);
172 pr_cont(", *pmd=%016llx", pmd_val(*pmd)); 175 pmd = READ_ONCE(*pmdp);
173 if (pmd_none(*pmd) || pmd_bad(*pmd)) 176 pr_cont(", pmd=%016llx", pmd_val(pmd));
177 if (pmd_none(pmd) || pmd_bad(pmd))
174 break; 178 break;
175 179
176 pte = pte_offset_map(pmd, addr); 180 ptep = pte_offset_map(pmdp, addr);
177 pr_cont(", *pte=%016llx", pte_val(*pte)); 181 pte = READ_ONCE(*ptep);
178 pte_unmap(pte); 182 pr_cont(", pte=%016llx", pte_val(pte));
183 pte_unmap(ptep);
179 } while(0); 184 } while(0);
180 185
181 pr_cont("\n"); 186 pr_cont("\n");
@@ -196,8 +201,9 @@ int ptep_set_access_flags(struct vm_area_struct *vma,
196 pte_t entry, int dirty) 201 pte_t entry, int dirty)
197{ 202{
198 pteval_t old_pteval, pteval; 203 pteval_t old_pteval, pteval;
204 pte_t pte = READ_ONCE(*ptep);
199 205
200 if (pte_same(*ptep, entry)) 206 if (pte_same(pte, entry))
201 return 0; 207 return 0;
202 208
203 /* only preserve the access flags and write permission */ 209 /* only preserve the access flags and write permission */
@@ -210,7 +216,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma,
210 * (calculated as: a & b == ~(~a | ~b)). 216 * (calculated as: a & b == ~(~a | ~b)).
211 */ 217 */
212 pte_val(entry) ^= PTE_RDONLY; 218 pte_val(entry) ^= PTE_RDONLY;
213 pteval = READ_ONCE(pte_val(*ptep)); 219 pteval = pte_val(pte);
214 do { 220 do {
215 old_pteval = pteval; 221 old_pteval = pteval;
216 pteval ^= PTE_RDONLY; 222 pteval ^= PTE_RDONLY;
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 6cb0fa92a651..ecc6818191df 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -54,14 +54,14 @@ static inline pgprot_t pte_pgprot(pte_t pte)
54static int find_num_contig(struct mm_struct *mm, unsigned long addr, 54static int find_num_contig(struct mm_struct *mm, unsigned long addr,
55 pte_t *ptep, size_t *pgsize) 55 pte_t *ptep, size_t *pgsize)
56{ 56{
57 pgd_t *pgd = pgd_offset(mm, addr); 57 pgd_t *pgdp = pgd_offset(mm, addr);
58 pud_t *pud; 58 pud_t *pudp;
59 pmd_t *pmd; 59 pmd_t *pmdp;
60 60
61 *pgsize = PAGE_SIZE; 61 *pgsize = PAGE_SIZE;
62 pud = pud_offset(pgd, addr); 62 pudp = pud_offset(pgdp, addr);
63 pmd = pmd_offset(pud, addr); 63 pmdp = pmd_offset(pudp, addr);
64 if ((pte_t *)pmd == ptep) { 64 if ((pte_t *)pmdp == ptep) {
65 *pgsize = PMD_SIZE; 65 *pgsize = PMD_SIZE;
66 return CONT_PMDS; 66 return CONT_PMDS;
67 } 67 }
@@ -181,11 +181,8 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
181 181
182 clear_flush(mm, addr, ptep, pgsize, ncontig); 182 clear_flush(mm, addr, ptep, pgsize, ncontig);
183 183
184 for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn) { 184 for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn)
185 pr_debug("%s: set pte %p to 0x%llx\n", __func__, ptep,
186 pte_val(pfn_pte(pfn, hugeprot)));
187 set_pte_at(mm, addr, ptep, pfn_pte(pfn, hugeprot)); 185 set_pte_at(mm, addr, ptep, pfn_pte(pfn, hugeprot));
188 }
189} 186}
190 187
191void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr, 188void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr,
@@ -203,20 +200,20 @@ void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr,
203pte_t *huge_pte_alloc(struct mm_struct *mm, 200pte_t *huge_pte_alloc(struct mm_struct *mm,
204 unsigned long addr, unsigned long sz) 201 unsigned long addr, unsigned long sz)
205{ 202{
206 pgd_t *pgd; 203 pgd_t *pgdp;
207 pud_t *pud; 204 pud_t *pudp;
208 pte_t *pte = NULL; 205 pmd_t *pmdp;
209 206 pte_t *ptep = NULL;
210 pr_debug("%s: addr:0x%lx sz:0x%lx\n", __func__, addr, sz); 207
211 pgd = pgd_offset(mm, addr); 208 pgdp = pgd_offset(mm, addr);
212 pud = pud_alloc(mm, pgd, addr); 209 pudp = pud_alloc(mm, pgdp, addr);
213 if (!pud) 210 if (!pudp)
214 return NULL; 211 return NULL;
215 212
216 if (sz == PUD_SIZE) { 213 if (sz == PUD_SIZE) {
217 pte = (pte_t *)pud; 214 ptep = (pte_t *)pudp;
218 } else if (sz == (PAGE_SIZE * CONT_PTES)) { 215 } else if (sz == (PAGE_SIZE * CONT_PTES)) {
219 pmd_t *pmd = pmd_alloc(mm, pud, addr); 216 pmdp = pmd_alloc(mm, pudp, addr);
220 217
221 WARN_ON(addr & (sz - 1)); 218 WARN_ON(addr & (sz - 1));
222 /* 219 /*
@@ -226,60 +223,55 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
226 * will be no pte_unmap() to correspond with this 223 * will be no pte_unmap() to correspond with this
227 * pte_alloc_map(). 224 * pte_alloc_map().
228 */ 225 */
229 pte = pte_alloc_map(mm, pmd, addr); 226 ptep = pte_alloc_map(mm, pmdp, addr);
230 } else if (sz == PMD_SIZE) { 227 } else if (sz == PMD_SIZE) {
231 if (IS_ENABLED(CONFIG_ARCH_WANT_HUGE_PMD_SHARE) && 228 if (IS_ENABLED(CONFIG_ARCH_WANT_HUGE_PMD_SHARE) &&
232 pud_none(*pud)) 229 pud_none(READ_ONCE(*pudp)))
233 pte = huge_pmd_share(mm, addr, pud); 230 ptep = huge_pmd_share(mm, addr, pudp);
234 else 231 else
235 pte = (pte_t *)pmd_alloc(mm, pud, addr); 232 ptep = (pte_t *)pmd_alloc(mm, pudp, addr);
236 } else if (sz == (PMD_SIZE * CONT_PMDS)) { 233 } else if (sz == (PMD_SIZE * CONT_PMDS)) {
237 pmd_t *pmd; 234 pmdp = pmd_alloc(mm, pudp, addr);
238
239 pmd = pmd_alloc(mm, pud, addr);
240 WARN_ON(addr & (sz - 1)); 235 WARN_ON(addr & (sz - 1));
241 return (pte_t *)pmd; 236 return (pte_t *)pmdp;
242 } 237 }
243 238
244 pr_debug("%s: addr:0x%lx sz:0x%lx ret pte=%p/0x%llx\n", __func__, addr, 239 return ptep;
245 sz, pte, pte_val(*pte));
246 return pte;
247} 240}
248 241
249pte_t *huge_pte_offset(struct mm_struct *mm, 242pte_t *huge_pte_offset(struct mm_struct *mm,
250 unsigned long addr, unsigned long sz) 243 unsigned long addr, unsigned long sz)
251{ 244{
252 pgd_t *pgd; 245 pgd_t *pgdp;
253 pud_t *pud; 246 pud_t *pudp, pud;
254 pmd_t *pmd; 247 pmd_t *pmdp, pmd;
255 248
256 pgd = pgd_offset(mm, addr); 249 pgdp = pgd_offset(mm, addr);
257 pr_debug("%s: addr:0x%lx pgd:%p\n", __func__, addr, pgd); 250 if (!pgd_present(READ_ONCE(*pgdp)))
258 if (!pgd_present(*pgd))
259 return NULL; 251 return NULL;
260 252
261 pud = pud_offset(pgd, addr); 253 pudp = pud_offset(pgdp, addr);
262 if (sz != PUD_SIZE && pud_none(*pud)) 254 pud = READ_ONCE(*pudp);
255 if (sz != PUD_SIZE && pud_none(pud))
263 return NULL; 256 return NULL;
264 /* hugepage or swap? */ 257 /* hugepage or swap? */
265 if (pud_huge(*pud) || !pud_present(*pud)) 258 if (pud_huge(pud) || !pud_present(pud))
266 return (pte_t *)pud; 259 return (pte_t *)pudp;
267 /* table; check the next level */ 260 /* table; check the next level */
268 261
269 if (sz == CONT_PMD_SIZE) 262 if (sz == CONT_PMD_SIZE)
270 addr &= CONT_PMD_MASK; 263 addr &= CONT_PMD_MASK;
271 264
272 pmd = pmd_offset(pud, addr); 265 pmdp = pmd_offset(pudp, addr);
266 pmd = READ_ONCE(*pmdp);
273 if (!(sz == PMD_SIZE || sz == CONT_PMD_SIZE) && 267 if (!(sz == PMD_SIZE || sz == CONT_PMD_SIZE) &&
274 pmd_none(*pmd)) 268 pmd_none(pmd))
275 return NULL; 269 return NULL;
276 if (pmd_huge(*pmd) || !pmd_present(*pmd)) 270 if (pmd_huge(pmd) || !pmd_present(pmd))
277 return (pte_t *)pmd; 271 return (pte_t *)pmdp;
278 272
279 if (sz == CONT_PTE_SIZE) { 273 if (sz == CONT_PTE_SIZE)
280 pte_t *pte = pte_offset_kernel(pmd, (addr & CONT_PTE_MASK)); 274 return pte_offset_kernel(pmdp, (addr & CONT_PTE_MASK));
281 return pte;
282 }
283 275
284 return NULL; 276 return NULL;
285} 277}
@@ -367,7 +359,7 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm,
367 size_t pgsize; 359 size_t pgsize;
368 pte_t pte; 360 pte_t pte;
369 361
370 if (!pte_cont(*ptep)) { 362 if (!pte_cont(READ_ONCE(*ptep))) {
371 ptep_set_wrprotect(mm, addr, ptep); 363 ptep_set_wrprotect(mm, addr, ptep);
372 return; 364 return;
373 } 365 }
@@ -391,7 +383,7 @@ void huge_ptep_clear_flush(struct vm_area_struct *vma,
391 size_t pgsize; 383 size_t pgsize;
392 int ncontig; 384 int ncontig;
393 385
394 if (!pte_cont(*ptep)) { 386 if (!pte_cont(READ_ONCE(*ptep))) {
395 ptep_clear_flush(vma, addr, ptep); 387 ptep_clear_flush(vma, addr, ptep);
396 return; 388 return;
397 } 389 }
diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c
index 6e02e6fb4c7b..dabfc1ecda3d 100644
--- a/arch/arm64/mm/kasan_init.c
+++ b/arch/arm64/mm/kasan_init.c
@@ -44,92 +44,92 @@ static phys_addr_t __init kasan_alloc_zeroed_page(int node)
44 return __pa(p); 44 return __pa(p);
45} 45}
46 46
47static pte_t *__init kasan_pte_offset(pmd_t *pmd, unsigned long addr, int node, 47static pte_t *__init kasan_pte_offset(pmd_t *pmdp, unsigned long addr, int node,
48 bool early) 48 bool early)
49{ 49{
50 if (pmd_none(*pmd)) { 50 if (pmd_none(READ_ONCE(*pmdp))) {
51 phys_addr_t pte_phys = early ? __pa_symbol(kasan_zero_pte) 51 phys_addr_t pte_phys = early ? __pa_symbol(kasan_zero_pte)
52 : kasan_alloc_zeroed_page(node); 52 : kasan_alloc_zeroed_page(node);
53 __pmd_populate(pmd, pte_phys, PMD_TYPE_TABLE); 53 __pmd_populate(pmdp, pte_phys, PMD_TYPE_TABLE);
54 } 54 }
55 55
56 return early ? pte_offset_kimg(pmd, addr) 56 return early ? pte_offset_kimg(pmdp, addr)
57 : pte_offset_kernel(pmd, addr); 57 : pte_offset_kernel(pmdp, addr);
58} 58}
59 59
60static pmd_t *__init kasan_pmd_offset(pud_t *pud, unsigned long addr, int node, 60static pmd_t *__init kasan_pmd_offset(pud_t *pudp, unsigned long addr, int node,
61 bool early) 61 bool early)
62{ 62{
63 if (pud_none(*pud)) { 63 if (pud_none(READ_ONCE(*pudp))) {
64 phys_addr_t pmd_phys = early ? __pa_symbol(kasan_zero_pmd) 64 phys_addr_t pmd_phys = early ? __pa_symbol(kasan_zero_pmd)
65 : kasan_alloc_zeroed_page(node); 65 : kasan_alloc_zeroed_page(node);
66 __pud_populate(pud, pmd_phys, PMD_TYPE_TABLE); 66 __pud_populate(pudp, pmd_phys, PMD_TYPE_TABLE);
67 } 67 }
68 68
69 return early ? pmd_offset_kimg(pud, addr) : pmd_offset(pud, addr); 69 return early ? pmd_offset_kimg(pudp, addr) : pmd_offset(pudp, addr);
70} 70}
71 71
72static pud_t *__init kasan_pud_offset(pgd_t *pgd, unsigned long addr, int node, 72static pud_t *__init kasan_pud_offset(pgd_t *pgdp, unsigned long addr, int node,
73 bool early) 73 bool early)
74{ 74{
75 if (pgd_none(*pgd)) { 75 if (pgd_none(READ_ONCE(*pgdp))) {
76 phys_addr_t pud_phys = early ? __pa_symbol(kasan_zero_pud) 76 phys_addr_t pud_phys = early ? __pa_symbol(kasan_zero_pud)
77 : kasan_alloc_zeroed_page(node); 77 : kasan_alloc_zeroed_page(node);
78 __pgd_populate(pgd, pud_phys, PMD_TYPE_TABLE); 78 __pgd_populate(pgdp, pud_phys, PMD_TYPE_TABLE);
79 } 79 }
80 80
81 return early ? pud_offset_kimg(pgd, addr) : pud_offset(pgd, addr); 81 return early ? pud_offset_kimg(pgdp, addr) : pud_offset(pgdp, addr);
82} 82}
83 83
84static void __init kasan_pte_populate(pmd_t *pmd, unsigned long addr, 84static void __init kasan_pte_populate(pmd_t *pmdp, unsigned long addr,
85 unsigned long end, int node, bool early) 85 unsigned long end, int node, bool early)
86{ 86{
87 unsigned long next; 87 unsigned long next;
88 pte_t *pte = kasan_pte_offset(pmd, addr, node, early); 88 pte_t *ptep = kasan_pte_offset(pmdp, addr, node, early);
89 89
90 do { 90 do {
91 phys_addr_t page_phys = early ? __pa_symbol(kasan_zero_page) 91 phys_addr_t page_phys = early ? __pa_symbol(kasan_zero_page)
92 : kasan_alloc_zeroed_page(node); 92 : kasan_alloc_zeroed_page(node);
93 next = addr + PAGE_SIZE; 93 next = addr + PAGE_SIZE;
94 set_pte(pte, pfn_pte(__phys_to_pfn(page_phys), PAGE_KERNEL)); 94 set_pte(ptep, pfn_pte(__phys_to_pfn(page_phys), PAGE_KERNEL));
95 } while (pte++, addr = next, addr != end && pte_none(*pte)); 95 } while (ptep++, addr = next, addr != end && pte_none(READ_ONCE(*ptep)));
96} 96}
97 97
98static void __init kasan_pmd_populate(pud_t *pud, unsigned long addr, 98static void __init kasan_pmd_populate(pud_t *pudp, unsigned long addr,
99 unsigned long end, int node, bool early) 99 unsigned long end, int node, bool early)
100{ 100{
101 unsigned long next; 101 unsigned long next;
102 pmd_t *pmd = kasan_pmd_offset(pud, addr, node, early); 102 pmd_t *pmdp = kasan_pmd_offset(pudp, addr, node, early);
103 103
104 do { 104 do {
105 next = pmd_addr_end(addr, end); 105 next = pmd_addr_end(addr, end);
106 kasan_pte_populate(pmd, addr, next, node, early); 106 kasan_pte_populate(pmdp, addr, next, node, early);
107 } while (pmd++, addr = next, addr != end && pmd_none(*pmd)); 107 } while (pmdp++, addr = next, addr != end && pmd_none(READ_ONCE(*pmdp)));
108} 108}
109 109
110static void __init kasan_pud_populate(pgd_t *pgd, unsigned long addr, 110static void __init kasan_pud_populate(pgd_t *pgdp, unsigned long addr,
111 unsigned long end, int node, bool early) 111 unsigned long end, int node, bool early)
112{ 112{
113 unsigned long next; 113 unsigned long next;
114 pud_t *pud = kasan_pud_offset(pgd, addr, node, early); 114 pud_t *pudp = kasan_pud_offset(pgdp, addr, node, early);
115 115
116 do { 116 do {
117 next = pud_addr_end(addr, end); 117 next = pud_addr_end(addr, end);
118 kasan_pmd_populate(pud, addr, next, node, early); 118 kasan_pmd_populate(pudp, addr, next, node, early);
119 } while (pud++, addr = next, addr != end && pud_none(*pud)); 119 } while (pudp++, addr = next, addr != end && pud_none(READ_ONCE(*pudp)));
120} 120}
121 121
122static void __init kasan_pgd_populate(unsigned long addr, unsigned long end, 122static void __init kasan_pgd_populate(unsigned long addr, unsigned long end,
123 int node, bool early) 123 int node, bool early)
124{ 124{
125 unsigned long next; 125 unsigned long next;
126 pgd_t *pgd; 126 pgd_t *pgdp;
127 127
128 pgd = pgd_offset_k(addr); 128 pgdp = pgd_offset_k(addr);
129 do { 129 do {
130 next = pgd_addr_end(addr, end); 130 next = pgd_addr_end(addr, end);
131 kasan_pud_populate(pgd, addr, next, node, early); 131 kasan_pud_populate(pgdp, addr, next, node, early);
132 } while (pgd++, addr = next, addr != end); 132 } while (pgdp++, addr = next, addr != end);
133} 133}
134 134
135/* The early shadow maps everything to a single page of zeroes */ 135/* The early shadow maps everything to a single page of zeroes */
@@ -155,14 +155,14 @@ static void __init kasan_map_populate(unsigned long start, unsigned long end,
155 */ 155 */
156void __init kasan_copy_shadow(pgd_t *pgdir) 156void __init kasan_copy_shadow(pgd_t *pgdir)
157{ 157{
158 pgd_t *pgd, *pgd_new, *pgd_end; 158 pgd_t *pgdp, *pgdp_new, *pgdp_end;
159 159
160 pgd = pgd_offset_k(KASAN_SHADOW_START); 160 pgdp = pgd_offset_k(KASAN_SHADOW_START);
161 pgd_end = pgd_offset_k(KASAN_SHADOW_END); 161 pgdp_end = pgd_offset_k(KASAN_SHADOW_END);
162 pgd_new = pgd_offset_raw(pgdir, KASAN_SHADOW_START); 162 pgdp_new = pgd_offset_raw(pgdir, KASAN_SHADOW_START);
163 do { 163 do {
164 set_pgd(pgd_new, *pgd); 164 set_pgd(pgdp_new, READ_ONCE(*pgdp));
165 } while (pgd++, pgd_new++, pgd != pgd_end); 165 } while (pgdp++, pgdp_new++, pgdp != pgdp_end);
166} 166}
167 167
168static void __init clear_pgds(unsigned long start, 168static void __init clear_pgds(unsigned long start,
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 4694cda823c9..84a019f55022 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -125,45 +125,48 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
125 return ((old ^ new) & ~mask) == 0; 125 return ((old ^ new) & ~mask) == 0;
126} 126}
127 127
128static void init_pte(pmd_t *pmd, unsigned long addr, unsigned long end, 128static void init_pte(pmd_t *pmdp, unsigned long addr, unsigned long end,
129 phys_addr_t phys, pgprot_t prot) 129 phys_addr_t phys, pgprot_t prot)
130{ 130{
131 pte_t *pte; 131 pte_t *ptep;
132 132
133 pte = pte_set_fixmap_offset(pmd, addr); 133 ptep = pte_set_fixmap_offset(pmdp, addr);
134 do { 134 do {
135 pte_t old_pte = *pte; 135 pte_t old_pte = READ_ONCE(*ptep);
136 136
137 set_pte(pte, pfn_pte(__phys_to_pfn(phys), prot)); 137 set_pte(ptep, pfn_pte(__phys_to_pfn(phys), prot));
138 138
139 /* 139 /*
140 * After the PTE entry has been populated once, we 140 * After the PTE entry has been populated once, we
141 * only allow updates to the permission attributes. 141 * only allow updates to the permission attributes.
142 */ 142 */
143 BUG_ON(!pgattr_change_is_safe(pte_val(old_pte), pte_val(*pte))); 143 BUG_ON(!pgattr_change_is_safe(pte_val(old_pte),
144 READ_ONCE(pte_val(*ptep))));
144 145
145 phys += PAGE_SIZE; 146 phys += PAGE_SIZE;
146 } while (pte++, addr += PAGE_SIZE, addr != end); 147 } while (ptep++, addr += PAGE_SIZE, addr != end);
147 148
148 pte_clear_fixmap(); 149 pte_clear_fixmap();
149} 150}
150 151
151static void alloc_init_cont_pte(pmd_t *pmd, unsigned long addr, 152static void alloc_init_cont_pte(pmd_t *pmdp, unsigned long addr,
152 unsigned long end, phys_addr_t phys, 153 unsigned long end, phys_addr_t phys,
153 pgprot_t prot, 154 pgprot_t prot,
154 phys_addr_t (*pgtable_alloc)(void), 155 phys_addr_t (*pgtable_alloc)(void),
155 int flags) 156 int flags)
156{ 157{
157 unsigned long next; 158 unsigned long next;
159 pmd_t pmd = READ_ONCE(*pmdp);
158 160
159 BUG_ON(pmd_sect(*pmd)); 161 BUG_ON(pmd_sect(pmd));
160 if (pmd_none(*pmd)) { 162 if (pmd_none(pmd)) {
161 phys_addr_t pte_phys; 163 phys_addr_t pte_phys;
162 BUG_ON(!pgtable_alloc); 164 BUG_ON(!pgtable_alloc);
163 pte_phys = pgtable_alloc(); 165 pte_phys = pgtable_alloc();
164 __pmd_populate(pmd, pte_phys, PMD_TYPE_TABLE); 166 __pmd_populate(pmdp, pte_phys, PMD_TYPE_TABLE);
167 pmd = READ_ONCE(*pmdp);
165 } 168 }
166 BUG_ON(pmd_bad(*pmd)); 169 BUG_ON(pmd_bad(pmd));
167 170
168 do { 171 do {
169 pgprot_t __prot = prot; 172 pgprot_t __prot = prot;
@@ -175,67 +178,69 @@ static void alloc_init_cont_pte(pmd_t *pmd, unsigned long addr,
175 (flags & NO_CONT_MAPPINGS) == 0) 178 (flags & NO_CONT_MAPPINGS) == 0)
176 __prot = __pgprot(pgprot_val(prot) | PTE_CONT); 179 __prot = __pgprot(pgprot_val(prot) | PTE_CONT);
177 180
178 init_pte(pmd, addr, next, phys, __prot); 181 init_pte(pmdp, addr, next, phys, __prot);
179 182
180 phys += next - addr; 183 phys += next - addr;
181 } while (addr = next, addr != end); 184 } while (addr = next, addr != end);
182} 185}
183 186
184static void init_pmd(pud_t *pud, unsigned long addr, unsigned long end, 187static void init_pmd(pud_t *pudp, unsigned long addr, unsigned long end,
185 phys_addr_t phys, pgprot_t prot, 188 phys_addr_t phys, pgprot_t prot,
186 phys_addr_t (*pgtable_alloc)(void), int flags) 189 phys_addr_t (*pgtable_alloc)(void), int flags)
187{ 190{
188 unsigned long next; 191 unsigned long next;
189 pmd_t *pmd; 192 pmd_t *pmdp;
190 193
191 pmd = pmd_set_fixmap_offset(pud, addr); 194 pmdp = pmd_set_fixmap_offset(pudp, addr);
192 do { 195 do {
193 pmd_t old_pmd = *pmd; 196 pmd_t old_pmd = READ_ONCE(*pmdp);
194 197
195 next = pmd_addr_end(addr, end); 198 next = pmd_addr_end(addr, end);
196 199
197 /* try section mapping first */ 200 /* try section mapping first */
198 if (((addr | next | phys) & ~SECTION_MASK) == 0 && 201 if (((addr | next | phys) & ~SECTION_MASK) == 0 &&
199 (flags & NO_BLOCK_MAPPINGS) == 0) { 202 (flags & NO_BLOCK_MAPPINGS) == 0) {
200 pmd_set_huge(pmd, phys, prot); 203 pmd_set_huge(pmdp, phys, prot);
201 204
202 /* 205 /*
203 * After the PMD entry has been populated once, we 206 * After the PMD entry has been populated once, we
204 * only allow updates to the permission attributes. 207 * only allow updates to the permission attributes.
205 */ 208 */
206 BUG_ON(!pgattr_change_is_safe(pmd_val(old_pmd), 209 BUG_ON(!pgattr_change_is_safe(pmd_val(old_pmd),
207 pmd_val(*pmd))); 210 READ_ONCE(pmd_val(*pmdp))));
208 } else { 211 } else {
209 alloc_init_cont_pte(pmd, addr, next, phys, prot, 212 alloc_init_cont_pte(pmdp, addr, next, phys, prot,
210 pgtable_alloc, flags); 213 pgtable_alloc, flags);
211 214
212 BUG_ON(pmd_val(old_pmd) != 0 && 215 BUG_ON(pmd_val(old_pmd) != 0 &&
213 pmd_val(old_pmd) != pmd_val(*pmd)); 216 pmd_val(old_pmd) != READ_ONCE(pmd_val(*pmdp)));
214 } 217 }
215 phys += next - addr; 218 phys += next - addr;
216 } while (pmd++, addr = next, addr != end); 219 } while (pmdp++, addr = next, addr != end);
217 220
218 pmd_clear_fixmap(); 221 pmd_clear_fixmap();
219} 222}
220 223
221static void alloc_init_cont_pmd(pud_t *pud, unsigned long addr, 224static void alloc_init_cont_pmd(pud_t *pudp, unsigned long addr,
222 unsigned long end, phys_addr_t phys, 225 unsigned long end, phys_addr_t phys,
223 pgprot_t prot, 226 pgprot_t prot,
224 phys_addr_t (*pgtable_alloc)(void), int flags) 227 phys_addr_t (*pgtable_alloc)(void), int flags)
225{ 228{
226 unsigned long next; 229 unsigned long next;
230 pud_t pud = READ_ONCE(*pudp);
227 231
228 /* 232 /*
229 * Check for initial section mappings in the pgd/pud. 233 * Check for initial section mappings in the pgd/pud.
230 */ 234 */
231 BUG_ON(pud_sect(*pud)); 235 BUG_ON(pud_sect(pud));
232 if (pud_none(*pud)) { 236 if (pud_none(pud)) {
233 phys_addr_t pmd_phys; 237 phys_addr_t pmd_phys;
234 BUG_ON(!pgtable_alloc); 238 BUG_ON(!pgtable_alloc);
235 pmd_phys = pgtable_alloc(); 239 pmd_phys = pgtable_alloc();
236 __pud_populate(pud, pmd_phys, PUD_TYPE_TABLE); 240 __pud_populate(pudp, pmd_phys, PUD_TYPE_TABLE);
241 pud = READ_ONCE(*pudp);
237 } 242 }
238 BUG_ON(pud_bad(*pud)); 243 BUG_ON(pud_bad(pud));
239 244
240 do { 245 do {
241 pgprot_t __prot = prot; 246 pgprot_t __prot = prot;
@@ -247,7 +252,7 @@ static void alloc_init_cont_pmd(pud_t *pud, unsigned long addr,
247 (flags & NO_CONT_MAPPINGS) == 0) 252 (flags & NO_CONT_MAPPINGS) == 0)
248 __prot = __pgprot(pgprot_val(prot) | PTE_CONT); 253 __prot = __pgprot(pgprot_val(prot) | PTE_CONT);
249 254
250 init_pmd(pud, addr, next, phys, __prot, pgtable_alloc, flags); 255 init_pmd(pudp, addr, next, phys, __prot, pgtable_alloc, flags);
251 256
252 phys += next - addr; 257 phys += next - addr;
253 } while (addr = next, addr != end); 258 } while (addr = next, addr != end);
@@ -265,25 +270,27 @@ static inline bool use_1G_block(unsigned long addr, unsigned long next,
265 return true; 270 return true;
266} 271}
267 272
268static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, 273static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
269 phys_addr_t phys, pgprot_t prot, 274 phys_addr_t phys, pgprot_t prot,
270 phys_addr_t (*pgtable_alloc)(void), 275 phys_addr_t (*pgtable_alloc)(void),
271 int flags) 276 int flags)
272{ 277{
273 pud_t *pud;
274 unsigned long next; 278 unsigned long next;
279 pud_t *pudp;
280 pgd_t pgd = READ_ONCE(*pgdp);
275 281
276 if (pgd_none(*pgd)) { 282 if (pgd_none(pgd)) {
277 phys_addr_t pud_phys; 283 phys_addr_t pud_phys;
278 BUG_ON(!pgtable_alloc); 284 BUG_ON(!pgtable_alloc);
279 pud_phys = pgtable_alloc(); 285 pud_phys = pgtable_alloc();
280 __pgd_populate(pgd, pud_phys, PUD_TYPE_TABLE); 286 __pgd_populate(pgdp, pud_phys, PUD_TYPE_TABLE);
287 pgd = READ_ONCE(*pgdp);
281 } 288 }
282 BUG_ON(pgd_bad(*pgd)); 289 BUG_ON(pgd_bad(pgd));
283 290
284 pud = pud_set_fixmap_offset(pgd, addr); 291 pudp = pud_set_fixmap_offset(pgdp, addr);
285 do { 292 do {
286 pud_t old_pud = *pud; 293 pud_t old_pud = READ_ONCE(*pudp);
287 294
288 next = pud_addr_end(addr, end); 295 next = pud_addr_end(addr, end);
289 296
@@ -292,23 +299,23 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
292 */ 299 */
293 if (use_1G_block(addr, next, phys) && 300 if (use_1G_block(addr, next, phys) &&
294 (flags & NO_BLOCK_MAPPINGS) == 0) { 301 (flags & NO_BLOCK_MAPPINGS) == 0) {
295 pud_set_huge(pud, phys, prot); 302 pud_set_huge(pudp, phys, prot);
296 303
297 /* 304 /*
298 * After the PUD entry has been populated once, we 305 * After the PUD entry has been populated once, we
299 * only allow updates to the permission attributes. 306 * only allow updates to the permission attributes.
300 */ 307 */
301 BUG_ON(!pgattr_change_is_safe(pud_val(old_pud), 308 BUG_ON(!pgattr_change_is_safe(pud_val(old_pud),
302 pud_val(*pud))); 309 READ_ONCE(pud_val(*pudp))));
303 } else { 310 } else {
304 alloc_init_cont_pmd(pud, addr, next, phys, prot, 311 alloc_init_cont_pmd(pudp, addr, next, phys, prot,
305 pgtable_alloc, flags); 312 pgtable_alloc, flags);
306 313
307 BUG_ON(pud_val(old_pud) != 0 && 314 BUG_ON(pud_val(old_pud) != 0 &&
308 pud_val(old_pud) != pud_val(*pud)); 315 pud_val(old_pud) != READ_ONCE(pud_val(*pudp)));
309 } 316 }
310 phys += next - addr; 317 phys += next - addr;
311 } while (pud++, addr = next, addr != end); 318 } while (pudp++, addr = next, addr != end);
312 319
313 pud_clear_fixmap(); 320 pud_clear_fixmap();
314} 321}
@@ -320,7 +327,7 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
320 int flags) 327 int flags)
321{ 328{
322 unsigned long addr, length, end, next; 329 unsigned long addr, length, end, next;
323 pgd_t *pgd = pgd_offset_raw(pgdir, virt); 330 pgd_t *pgdp = pgd_offset_raw(pgdir, virt);
324 331
325 /* 332 /*
326 * If the virtual and physical address don't have the same offset 333 * If the virtual and physical address don't have the same offset
@@ -336,10 +343,10 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
336 end = addr + length; 343 end = addr + length;
337 do { 344 do {
338 next = pgd_addr_end(addr, end); 345 next = pgd_addr_end(addr, end);
339 alloc_init_pud(pgd, addr, next, phys, prot, pgtable_alloc, 346 alloc_init_pud(pgdp, addr, next, phys, prot, pgtable_alloc,
340 flags); 347 flags);
341 phys += next - addr; 348 phys += next - addr;
342 } while (pgd++, addr = next, addr != end); 349 } while (pgdp++, addr = next, addr != end);
343} 350}
344 351
345static phys_addr_t pgd_pgtable_alloc(void) 352static phys_addr_t pgd_pgtable_alloc(void)
@@ -401,10 +408,10 @@ static void update_mapping_prot(phys_addr_t phys, unsigned long virt,
401 flush_tlb_kernel_range(virt, virt + size); 408 flush_tlb_kernel_range(virt, virt + size);
402} 409}
403 410
404static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, 411static void __init __map_memblock(pgd_t *pgdp, phys_addr_t start,
405 phys_addr_t end, pgprot_t prot, int flags) 412 phys_addr_t end, pgprot_t prot, int flags)
406{ 413{
407 __create_pgd_mapping(pgd, start, __phys_to_virt(start), end - start, 414 __create_pgd_mapping(pgdp, start, __phys_to_virt(start), end - start,
408 prot, early_pgtable_alloc, flags); 415 prot, early_pgtable_alloc, flags);
409} 416}
410 417
@@ -418,7 +425,7 @@ void __init mark_linear_text_alias_ro(void)
418 PAGE_KERNEL_RO); 425 PAGE_KERNEL_RO);
419} 426}
420 427
421static void __init map_mem(pgd_t *pgd) 428static void __init map_mem(pgd_t *pgdp)
422{ 429{
423 phys_addr_t kernel_start = __pa_symbol(_text); 430 phys_addr_t kernel_start = __pa_symbol(_text);
424 phys_addr_t kernel_end = __pa_symbol(__init_begin); 431 phys_addr_t kernel_end = __pa_symbol(__init_begin);
@@ -451,7 +458,7 @@ static void __init map_mem(pgd_t *pgd)
451 if (memblock_is_nomap(reg)) 458 if (memblock_is_nomap(reg))
452 continue; 459 continue;
453 460
454 __map_memblock(pgd, start, end, PAGE_KERNEL, flags); 461 __map_memblock(pgdp, start, end, PAGE_KERNEL, flags);
455 } 462 }
456 463
457 /* 464 /*
@@ -464,7 +471,7 @@ static void __init map_mem(pgd_t *pgd)
464 * Note that contiguous mappings cannot be remapped in this way, 471 * Note that contiguous mappings cannot be remapped in this way,
465 * so we should avoid them here. 472 * so we should avoid them here.
466 */ 473 */
467 __map_memblock(pgd, kernel_start, kernel_end, 474 __map_memblock(pgdp, kernel_start, kernel_end,
468 PAGE_KERNEL, NO_CONT_MAPPINGS); 475 PAGE_KERNEL, NO_CONT_MAPPINGS);
469 memblock_clear_nomap(kernel_start, kernel_end - kernel_start); 476 memblock_clear_nomap(kernel_start, kernel_end - kernel_start);
470 477
@@ -475,7 +482,7 @@ static void __init map_mem(pgd_t *pgd)
475 * through /sys/kernel/kexec_crash_size interface. 482 * through /sys/kernel/kexec_crash_size interface.
476 */ 483 */
477 if (crashk_res.end) { 484 if (crashk_res.end) {
478 __map_memblock(pgd, crashk_res.start, crashk_res.end + 1, 485 __map_memblock(pgdp, crashk_res.start, crashk_res.end + 1,
479 PAGE_KERNEL, 486 PAGE_KERNEL,
480 NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); 487 NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS);
481 memblock_clear_nomap(crashk_res.start, 488 memblock_clear_nomap(crashk_res.start,
@@ -499,7 +506,7 @@ void mark_rodata_ro(void)
499 debug_checkwx(); 506 debug_checkwx();
500} 507}
501 508
502static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end, 509static void __init map_kernel_segment(pgd_t *pgdp, void *va_start, void *va_end,
503 pgprot_t prot, struct vm_struct *vma, 510 pgprot_t prot, struct vm_struct *vma,
504 int flags, unsigned long vm_flags) 511 int flags, unsigned long vm_flags)
505{ 512{
@@ -509,7 +516,7 @@ static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end,
509 BUG_ON(!PAGE_ALIGNED(pa_start)); 516 BUG_ON(!PAGE_ALIGNED(pa_start));
510 BUG_ON(!PAGE_ALIGNED(size)); 517 BUG_ON(!PAGE_ALIGNED(size));
511 518
512 __create_pgd_mapping(pgd, pa_start, (unsigned long)va_start, size, prot, 519 __create_pgd_mapping(pgdp, pa_start, (unsigned long)va_start, size, prot,
513 early_pgtable_alloc, flags); 520 early_pgtable_alloc, flags);
514 521
515 if (!(vm_flags & VM_NO_GUARD)) 522 if (!(vm_flags & VM_NO_GUARD))
@@ -562,7 +569,7 @@ core_initcall(map_entry_trampoline);
562/* 569/*
563 * Create fine-grained mappings for the kernel. 570 * Create fine-grained mappings for the kernel.
564 */ 571 */
565static void __init map_kernel(pgd_t *pgd) 572static void __init map_kernel(pgd_t *pgdp)
566{ 573{
567 static struct vm_struct vmlinux_text, vmlinux_rodata, vmlinux_inittext, 574 static struct vm_struct vmlinux_text, vmlinux_rodata, vmlinux_inittext,
568 vmlinux_initdata, vmlinux_data; 575 vmlinux_initdata, vmlinux_data;
@@ -578,24 +585,24 @@ static void __init map_kernel(pgd_t *pgd)
578 * Only rodata will be remapped with different permissions later on, 585 * Only rodata will be remapped with different permissions later on,
579 * all other segments are allowed to use contiguous mappings. 586 * all other segments are allowed to use contiguous mappings.
580 */ 587 */
581 map_kernel_segment(pgd, _text, _etext, text_prot, &vmlinux_text, 0, 588 map_kernel_segment(pgdp, _text, _etext, text_prot, &vmlinux_text, 0,
582 VM_NO_GUARD); 589 VM_NO_GUARD);
583 map_kernel_segment(pgd, __start_rodata, __inittext_begin, PAGE_KERNEL, 590 map_kernel_segment(pgdp, __start_rodata, __inittext_begin, PAGE_KERNEL,
584 &vmlinux_rodata, NO_CONT_MAPPINGS, VM_NO_GUARD); 591 &vmlinux_rodata, NO_CONT_MAPPINGS, VM_NO_GUARD);
585 map_kernel_segment(pgd, __inittext_begin, __inittext_end, text_prot, 592 map_kernel_segment(pgdp, __inittext_begin, __inittext_end, text_prot,
586 &vmlinux_inittext, 0, VM_NO_GUARD); 593 &vmlinux_inittext, 0, VM_NO_GUARD);
587 map_kernel_segment(pgd, __initdata_begin, __initdata_end, PAGE_KERNEL, 594 map_kernel_segment(pgdp, __initdata_begin, __initdata_end, PAGE_KERNEL,
588 &vmlinux_initdata, 0, VM_NO_GUARD); 595 &vmlinux_initdata, 0, VM_NO_GUARD);
589 map_kernel_segment(pgd, _data, _end, PAGE_KERNEL, &vmlinux_data, 0, 0); 596 map_kernel_segment(pgdp, _data, _end, PAGE_KERNEL, &vmlinux_data, 0, 0);
590 597
591 if (!pgd_val(*pgd_offset_raw(pgd, FIXADDR_START))) { 598 if (!READ_ONCE(pgd_val(*pgd_offset_raw(pgdp, FIXADDR_START)))) {
592 /* 599 /*
593 * The fixmap falls in a separate pgd to the kernel, and doesn't 600 * The fixmap falls in a separate pgd to the kernel, and doesn't
594 * live in the carveout for the swapper_pg_dir. We can simply 601 * live in the carveout for the swapper_pg_dir. We can simply
595 * re-use the existing dir for the fixmap. 602 * re-use the existing dir for the fixmap.
596 */ 603 */
597 set_pgd(pgd_offset_raw(pgd, FIXADDR_START), 604 set_pgd(pgd_offset_raw(pgdp, FIXADDR_START),
598 *pgd_offset_k(FIXADDR_START)); 605 READ_ONCE(*pgd_offset_k(FIXADDR_START)));
599 } else if (CONFIG_PGTABLE_LEVELS > 3) { 606 } else if (CONFIG_PGTABLE_LEVELS > 3) {
600 /* 607 /*
601 * The fixmap shares its top level pgd entry with the kernel 608 * The fixmap shares its top level pgd entry with the kernel
@@ -604,14 +611,15 @@ static void __init map_kernel(pgd_t *pgd)
604 * entry instead. 611 * entry instead.
605 */ 612 */
606 BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES)); 613 BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES));
607 pud_populate(&init_mm, pud_set_fixmap_offset(pgd, FIXADDR_START), 614 pud_populate(&init_mm,
615 pud_set_fixmap_offset(pgdp, FIXADDR_START),
608 lm_alias(bm_pmd)); 616 lm_alias(bm_pmd));
609 pud_clear_fixmap(); 617 pud_clear_fixmap();
610 } else { 618 } else {
611 BUG(); 619 BUG();
612 } 620 }
613 621
614 kasan_copy_shadow(pgd); 622 kasan_copy_shadow(pgdp);
615} 623}
616 624
617/* 625/*
@@ -621,10 +629,10 @@ static void __init map_kernel(pgd_t *pgd)
621void __init paging_init(void) 629void __init paging_init(void)
622{ 630{
623 phys_addr_t pgd_phys = early_pgtable_alloc(); 631 phys_addr_t pgd_phys = early_pgtable_alloc();
624 pgd_t *pgd = pgd_set_fixmap(pgd_phys); 632 pgd_t *pgdp = pgd_set_fixmap(pgd_phys);
625 633
626 map_kernel(pgd); 634 map_kernel(pgdp);
627 map_mem(pgd); 635 map_mem(pgdp);
628 636
629 /* 637 /*
630 * We want to reuse the original swapper_pg_dir so we don't have to 638 * We want to reuse the original swapper_pg_dir so we don't have to
@@ -635,7 +643,7 @@ void __init paging_init(void)
635 * To do this we need to go via a temporary pgd. 643 * To do this we need to go via a temporary pgd.
636 */ 644 */
637 cpu_replace_ttbr1(__va(pgd_phys)); 645 cpu_replace_ttbr1(__va(pgd_phys));
638 memcpy(swapper_pg_dir, pgd, PGD_SIZE); 646 memcpy(swapper_pg_dir, pgdp, PGD_SIZE);
639 cpu_replace_ttbr1(lm_alias(swapper_pg_dir)); 647 cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
640 648
641 pgd_clear_fixmap(); 649 pgd_clear_fixmap();
@@ -655,37 +663,40 @@ void __init paging_init(void)
655 */ 663 */
656int kern_addr_valid(unsigned long addr) 664int kern_addr_valid(unsigned long addr)
657{ 665{
658 pgd_t *pgd; 666 pgd_t *pgdp;
659 pud_t *pud; 667 pud_t *pudp, pud;
660 pmd_t *pmd; 668 pmd_t *pmdp, pmd;
661 pte_t *pte; 669 pte_t *ptep, pte;
662 670
663 if ((((long)addr) >> VA_BITS) != -1UL) 671 if ((((long)addr) >> VA_BITS) != -1UL)
664 return 0; 672 return 0;
665 673
666 pgd = pgd_offset_k(addr); 674 pgdp = pgd_offset_k(addr);
667 if (pgd_none(*pgd)) 675 if (pgd_none(READ_ONCE(*pgdp)))
668 return 0; 676 return 0;
669 677
670 pud = pud_offset(pgd, addr); 678 pudp = pud_offset(pgdp, addr);
671 if (pud_none(*pud)) 679 pud = READ_ONCE(*pudp);
680 if (pud_none(pud))
672 return 0; 681 return 0;
673 682
674 if (pud_sect(*pud)) 683 if (pud_sect(pud))
675 return pfn_valid(pud_pfn(*pud)); 684 return pfn_valid(pud_pfn(pud));
676 685
677 pmd = pmd_offset(pud, addr); 686 pmdp = pmd_offset(pudp, addr);
678 if (pmd_none(*pmd)) 687 pmd = READ_ONCE(*pmdp);
688 if (pmd_none(pmd))
679 return 0; 689 return 0;
680 690
681 if (pmd_sect(*pmd)) 691 if (pmd_sect(pmd))
682 return pfn_valid(pmd_pfn(*pmd)); 692 return pfn_valid(pmd_pfn(pmd));
683 693
684 pte = pte_offset_kernel(pmd, addr); 694 ptep = pte_offset_kernel(pmdp, addr);
685 if (pte_none(*pte)) 695 pte = READ_ONCE(*ptep);
696 if (pte_none(pte))
686 return 0; 697 return 0;
687 698
688 return pfn_valid(pte_pfn(*pte)); 699 return pfn_valid(pte_pfn(pte));
689} 700}
690#ifdef CONFIG_SPARSEMEM_VMEMMAP 701#ifdef CONFIG_SPARSEMEM_VMEMMAP
691#if !ARM64_SWAPPER_USES_SECTION_MAPS 702#if !ARM64_SWAPPER_USES_SECTION_MAPS
@@ -700,32 +711,32 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
700{ 711{
701 unsigned long addr = start; 712 unsigned long addr = start;
702 unsigned long next; 713 unsigned long next;
703 pgd_t *pgd; 714 pgd_t *pgdp;
704 pud_t *pud; 715 pud_t *pudp;
705 pmd_t *pmd; 716 pmd_t *pmdp;
706 717
707 do { 718 do {
708 next = pmd_addr_end(addr, end); 719 next = pmd_addr_end(addr, end);
709 720
710 pgd = vmemmap_pgd_populate(addr, node); 721 pgdp = vmemmap_pgd_populate(addr, node);
711 if (!pgd) 722 if (!pgdp)
712 return -ENOMEM; 723 return -ENOMEM;
713 724
714 pud = vmemmap_pud_populate(pgd, addr, node); 725 pudp = vmemmap_pud_populate(pgdp, addr, node);
715 if (!pud) 726 if (!pudp)
716 return -ENOMEM; 727 return -ENOMEM;
717 728
718 pmd = pmd_offset(pud, addr); 729 pmdp = pmd_offset(pudp, addr);
719 if (pmd_none(*pmd)) { 730 if (pmd_none(READ_ONCE(*pmdp))) {
720 void *p = NULL; 731 void *p = NULL;
721 732
722 p = vmemmap_alloc_block_buf(PMD_SIZE, node); 733 p = vmemmap_alloc_block_buf(PMD_SIZE, node);
723 if (!p) 734 if (!p)
724 return -ENOMEM; 735 return -ENOMEM;
725 736
726 pmd_set_huge(pmd, __pa(p), __pgprot(PROT_SECT_NORMAL)); 737 pmd_set_huge(pmdp, __pa(p), __pgprot(PROT_SECT_NORMAL));
727 } else 738 } else
728 vmemmap_verify((pte_t *)pmd, node, addr, next); 739 vmemmap_verify((pte_t *)pmdp, node, addr, next);
729 } while (addr = next, addr != end); 740 } while (addr = next, addr != end);
730 741
731 return 0; 742 return 0;
@@ -739,20 +750,22 @@ void vmemmap_free(unsigned long start, unsigned long end,
739 750
740static inline pud_t * fixmap_pud(unsigned long addr) 751static inline pud_t * fixmap_pud(unsigned long addr)
741{ 752{
742 pgd_t *pgd = pgd_offset_k(addr); 753 pgd_t *pgdp = pgd_offset_k(addr);
754 pgd_t pgd = READ_ONCE(*pgdp);
743 755
744 BUG_ON(pgd_none(*pgd) || pgd_bad(*pgd)); 756 BUG_ON(pgd_none(pgd) || pgd_bad(pgd));
745 757
746 return pud_offset_kimg(pgd, addr); 758 return pud_offset_kimg(pgdp, addr);
747} 759}
748 760
749static inline pmd_t * fixmap_pmd(unsigned long addr) 761static inline pmd_t * fixmap_pmd(unsigned long addr)
750{ 762{
751 pud_t *pud = fixmap_pud(addr); 763 pud_t *pudp = fixmap_pud(addr);
764 pud_t pud = READ_ONCE(*pudp);
752 765
753 BUG_ON(pud_none(*pud) || pud_bad(*pud)); 766 BUG_ON(pud_none(pud) || pud_bad(pud));
754 767
755 return pmd_offset_kimg(pud, addr); 768 return pmd_offset_kimg(pudp, addr);
756} 769}
757 770
758static inline pte_t * fixmap_pte(unsigned long addr) 771static inline pte_t * fixmap_pte(unsigned long addr)
@@ -768,30 +781,31 @@ static inline pte_t * fixmap_pte(unsigned long addr)
768 */ 781 */
769void __init early_fixmap_init(void) 782void __init early_fixmap_init(void)
770{ 783{
771 pgd_t *pgd; 784 pgd_t *pgdp, pgd;
772 pud_t *pud; 785 pud_t *pudp;
773 pmd_t *pmd; 786 pmd_t *pmdp;
774 unsigned long addr = FIXADDR_START; 787 unsigned long addr = FIXADDR_START;
775 788
776 pgd = pgd_offset_k(addr); 789 pgdp = pgd_offset_k(addr);
790 pgd = READ_ONCE(*pgdp);
777 if (CONFIG_PGTABLE_LEVELS > 3 && 791 if (CONFIG_PGTABLE_LEVELS > 3 &&
778 !(pgd_none(*pgd) || pgd_page_paddr(*pgd) == __pa_symbol(bm_pud))) { 792 !(pgd_none(pgd) || pgd_page_paddr(pgd) == __pa_symbol(bm_pud))) {
779 /* 793 /*
780 * We only end up here if the kernel mapping and the fixmap 794 * We only end up here if the kernel mapping and the fixmap
781 * share the top level pgd entry, which should only happen on 795 * share the top level pgd entry, which should only happen on
782 * 16k/4 levels configurations. 796 * 16k/4 levels configurations.
783 */ 797 */
784 BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES)); 798 BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES));
785 pud = pud_offset_kimg(pgd, addr); 799 pudp = pud_offset_kimg(pgdp, addr);
786 } else { 800 } else {
787 if (pgd_none(*pgd)) 801 if (pgd_none(pgd))
788 __pgd_populate(pgd, __pa_symbol(bm_pud), PUD_TYPE_TABLE); 802 __pgd_populate(pgdp, __pa_symbol(bm_pud), PUD_TYPE_TABLE);
789 pud = fixmap_pud(addr); 803 pudp = fixmap_pud(addr);
790 } 804 }
791 if (pud_none(*pud)) 805 if (pud_none(READ_ONCE(*pudp)))
792 __pud_populate(pud, __pa_symbol(bm_pmd), PMD_TYPE_TABLE); 806 __pud_populate(pudp, __pa_symbol(bm_pmd), PMD_TYPE_TABLE);
793 pmd = fixmap_pmd(addr); 807 pmdp = fixmap_pmd(addr);
794 __pmd_populate(pmd, __pa_symbol(bm_pte), PMD_TYPE_TABLE); 808 __pmd_populate(pmdp, __pa_symbol(bm_pte), PMD_TYPE_TABLE);
795 809
796 /* 810 /*
797 * The boot-ioremap range spans multiple pmds, for which 811 * The boot-ioremap range spans multiple pmds, for which
@@ -800,11 +814,11 @@ void __init early_fixmap_init(void)
800 BUILD_BUG_ON((__fix_to_virt(FIX_BTMAP_BEGIN) >> PMD_SHIFT) 814 BUILD_BUG_ON((__fix_to_virt(FIX_BTMAP_BEGIN) >> PMD_SHIFT)
801 != (__fix_to_virt(FIX_BTMAP_END) >> PMD_SHIFT)); 815 != (__fix_to_virt(FIX_BTMAP_END) >> PMD_SHIFT));
802 816
803 if ((pmd != fixmap_pmd(fix_to_virt(FIX_BTMAP_BEGIN))) 817 if ((pmdp != fixmap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)))
804 || pmd != fixmap_pmd(fix_to_virt(FIX_BTMAP_END))) { 818 || pmdp != fixmap_pmd(fix_to_virt(FIX_BTMAP_END))) {
805 WARN_ON(1); 819 WARN_ON(1);
806 pr_warn("pmd %p != %p, %p\n", 820 pr_warn("pmdp %p != %p, %p\n",
807 pmd, fixmap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)), 821 pmdp, fixmap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)),
808 fixmap_pmd(fix_to_virt(FIX_BTMAP_END))); 822 fixmap_pmd(fix_to_virt(FIX_BTMAP_END)));
809 pr_warn("fix_to_virt(FIX_BTMAP_BEGIN): %08lx\n", 823 pr_warn("fix_to_virt(FIX_BTMAP_BEGIN): %08lx\n",
810 fix_to_virt(FIX_BTMAP_BEGIN)); 824 fix_to_virt(FIX_BTMAP_BEGIN));
@@ -824,16 +838,16 @@ void __set_fixmap(enum fixed_addresses idx,
824 phys_addr_t phys, pgprot_t flags) 838 phys_addr_t phys, pgprot_t flags)
825{ 839{
826 unsigned long addr = __fix_to_virt(idx); 840 unsigned long addr = __fix_to_virt(idx);
827 pte_t *pte; 841 pte_t *ptep;
828 842
829 BUG_ON(idx <= FIX_HOLE || idx >= __end_of_fixed_addresses); 843 BUG_ON(idx <= FIX_HOLE || idx >= __end_of_fixed_addresses);
830 844
831 pte = fixmap_pte(addr); 845 ptep = fixmap_pte(addr);
832 846
833 if (pgprot_val(flags)) { 847 if (pgprot_val(flags)) {
834 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags)); 848 set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, flags));
835 } else { 849 } else {
836 pte_clear(&init_mm, addr, pte); 850 pte_clear(&init_mm, addr, ptep);
837 flush_tlb_kernel_range(addr, addr+PAGE_SIZE); 851 flush_tlb_kernel_range(addr, addr+PAGE_SIZE);
838 } 852 }
839} 853}
@@ -915,36 +929,46 @@ int __init arch_ioremap_pmd_supported(void)
915 return 1; 929 return 1;
916} 930}
917 931
918int pud_set_huge(pud_t *pud, phys_addr_t phys, pgprot_t prot) 932int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot)
919{ 933{
920 pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | 934 pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT |
921 pgprot_val(mk_sect_prot(prot))); 935 pgprot_val(mk_sect_prot(prot)));
936
937 /* ioremap_page_range doesn't honour BBM */
938 if (pud_present(READ_ONCE(*pudp)))
939 return 0;
940
922 BUG_ON(phys & ~PUD_MASK); 941 BUG_ON(phys & ~PUD_MASK);
923 set_pud(pud, pfn_pud(__phys_to_pfn(phys), sect_prot)); 942 set_pud(pudp, pfn_pud(__phys_to_pfn(phys), sect_prot));
924 return 1; 943 return 1;
925} 944}
926 945
927int pmd_set_huge(pmd_t *pmd, phys_addr_t phys, pgprot_t prot) 946int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot)
928{ 947{
929 pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | 948 pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT |
930 pgprot_val(mk_sect_prot(prot))); 949 pgprot_val(mk_sect_prot(prot)));
950
951 /* ioremap_page_range doesn't honour BBM */
952 if (pmd_present(READ_ONCE(*pmdp)))
953 return 0;
954
931 BUG_ON(phys & ~PMD_MASK); 955 BUG_ON(phys & ~PMD_MASK);
932 set_pmd(pmd, pfn_pmd(__phys_to_pfn(phys), sect_prot)); 956 set_pmd(pmdp, pfn_pmd(__phys_to_pfn(phys), sect_prot));
933 return 1; 957 return 1;
934} 958}
935 959
936int pud_clear_huge(pud_t *pud) 960int pud_clear_huge(pud_t *pudp)
937{ 961{
938 if (!pud_sect(*pud)) 962 if (!pud_sect(READ_ONCE(*pudp)))
939 return 0; 963 return 0;
940 pud_clear(pud); 964 pud_clear(pudp);
941 return 1; 965 return 1;
942} 966}
943 967
944int pmd_clear_huge(pmd_t *pmd) 968int pmd_clear_huge(pmd_t *pmdp)
945{ 969{
946 if (!pmd_sect(*pmd)) 970 if (!pmd_sect(READ_ONCE(*pmdp)))
947 return 0; 971 return 0;
948 pmd_clear(pmd); 972 pmd_clear(pmdp);
949 return 1; 973 return 1;
950} 974}
diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index a682a0a2a0fa..a56359373d8b 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -29,7 +29,7 @@ static int change_page_range(pte_t *ptep, pgtable_t token, unsigned long addr,
29 void *data) 29 void *data)
30{ 30{
31 struct page_change_data *cdata = data; 31 struct page_change_data *cdata = data;
32 pte_t pte = *ptep; 32 pte_t pte = READ_ONCE(*ptep);
33 33
34 pte = clear_pte_bit(pte, cdata->clear_mask); 34 pte = clear_pte_bit(pte, cdata->clear_mask);
35 pte = set_pte_bit(pte, cdata->set_mask); 35 pte = set_pte_bit(pte, cdata->set_mask);
@@ -156,30 +156,32 @@ void __kernel_map_pages(struct page *page, int numpages, int enable)
156 */ 156 */
157bool kernel_page_present(struct page *page) 157bool kernel_page_present(struct page *page)
158{ 158{
159 pgd_t *pgd; 159 pgd_t *pgdp;
160 pud_t *pud; 160 pud_t *pudp, pud;
161 pmd_t *pmd; 161 pmd_t *pmdp, pmd;
162 pte_t *pte; 162 pte_t *ptep;
163 unsigned long addr = (unsigned long)page_address(page); 163 unsigned long addr = (unsigned long)page_address(page);
164 164
165 pgd = pgd_offset_k(addr); 165 pgdp = pgd_offset_k(addr);
166 if (pgd_none(*pgd)) 166 if (pgd_none(READ_ONCE(*pgdp)))
167 return false; 167 return false;
168 168
169 pud = pud_offset(pgd, addr); 169 pudp = pud_offset(pgdp, addr);
170 if (pud_none(*pud)) 170 pud = READ_ONCE(*pudp);
171 if (pud_none(pud))
171 return false; 172 return false;
172 if (pud_sect(*pud)) 173 if (pud_sect(pud))
173 return true; 174 return true;
174 175
175 pmd = pmd_offset(pud, addr); 176 pmdp = pmd_offset(pudp, addr);
176 if (pmd_none(*pmd)) 177 pmd = READ_ONCE(*pmdp);
178 if (pmd_none(pmd))
177 return false; 179 return false;
178 if (pmd_sect(*pmd)) 180 if (pmd_sect(pmd))
179 return true; 181 return true;
180 182
181 pte = pte_offset_kernel(pmd, addr); 183 ptep = pte_offset_kernel(pmdp, addr);
182 return pte_valid(*pte); 184 return pte_valid(READ_ONCE(*ptep));
183} 185}
184#endif /* CONFIG_HIBERNATION */ 186#endif /* CONFIG_HIBERNATION */
185#endif /* CONFIG_DEBUG_PAGEALLOC */ 187#endif /* CONFIG_DEBUG_PAGEALLOC */
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 71baed7e592a..c0af47617299 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -205,7 +205,8 @@ ENDPROC(idmap_cpu_replace_ttbr1)
205 dc cvac, cur_\()\type\()p // Ensure any existing dirty 205 dc cvac, cur_\()\type\()p // Ensure any existing dirty
206 dmb sy // lines are written back before 206 dmb sy // lines are written back before
207 ldr \type, [cur_\()\type\()p] // loading the entry 207 ldr \type, [cur_\()\type\()p] // loading the entry
208 tbz \type, #0, next_\()\type // Skip invalid entries 208 tbz \type, #0, skip_\()\type // Skip invalid and
209 tbnz \type, #11, skip_\()\type // non-global entries
209 .endm 210 .endm
210 211
211 .macro __idmap_kpti_put_pgtable_ent_ng, type 212 .macro __idmap_kpti_put_pgtable_ent_ng, type
@@ -265,8 +266,9 @@ ENTRY(idmap_kpti_install_ng_mappings)
265 add end_pgdp, cur_pgdp, #(PTRS_PER_PGD * 8) 266 add end_pgdp, cur_pgdp, #(PTRS_PER_PGD * 8)
266do_pgd: __idmap_kpti_get_pgtable_ent pgd 267do_pgd: __idmap_kpti_get_pgtable_ent pgd
267 tbnz pgd, #1, walk_puds 268 tbnz pgd, #1, walk_puds
268 __idmap_kpti_put_pgtable_ent_ng pgd
269next_pgd: 269next_pgd:
270 __idmap_kpti_put_pgtable_ent_ng pgd
271skip_pgd:
270 add cur_pgdp, cur_pgdp, #8 272 add cur_pgdp, cur_pgdp, #8
271 cmp cur_pgdp, end_pgdp 273 cmp cur_pgdp, end_pgdp
272 b.ne do_pgd 274 b.ne do_pgd
@@ -294,8 +296,9 @@ walk_puds:
294 add end_pudp, cur_pudp, #(PTRS_PER_PUD * 8) 296 add end_pudp, cur_pudp, #(PTRS_PER_PUD * 8)
295do_pud: __idmap_kpti_get_pgtable_ent pud 297do_pud: __idmap_kpti_get_pgtable_ent pud
296 tbnz pud, #1, walk_pmds 298 tbnz pud, #1, walk_pmds
297 __idmap_kpti_put_pgtable_ent_ng pud
298next_pud: 299next_pud:
300 __idmap_kpti_put_pgtable_ent_ng pud
301skip_pud:
299 add cur_pudp, cur_pudp, 8 302 add cur_pudp, cur_pudp, 8
300 cmp cur_pudp, end_pudp 303 cmp cur_pudp, end_pudp
301 b.ne do_pud 304 b.ne do_pud
@@ -314,8 +317,9 @@ walk_pmds:
314 add end_pmdp, cur_pmdp, #(PTRS_PER_PMD * 8) 317 add end_pmdp, cur_pmdp, #(PTRS_PER_PMD * 8)
315do_pmd: __idmap_kpti_get_pgtable_ent pmd 318do_pmd: __idmap_kpti_get_pgtable_ent pmd
316 tbnz pmd, #1, walk_ptes 319 tbnz pmd, #1, walk_ptes
317 __idmap_kpti_put_pgtable_ent_ng pmd
318next_pmd: 320next_pmd:
321 __idmap_kpti_put_pgtable_ent_ng pmd
322skip_pmd:
319 add cur_pmdp, cur_pmdp, #8 323 add cur_pmdp, cur_pmdp, #8
320 cmp cur_pmdp, end_pmdp 324 cmp cur_pmdp, end_pmdp
321 b.ne do_pmd 325 b.ne do_pmd
@@ -333,7 +337,7 @@ walk_ptes:
333 add end_ptep, cur_ptep, #(PTRS_PER_PTE * 8) 337 add end_ptep, cur_ptep, #(PTRS_PER_PTE * 8)
334do_pte: __idmap_kpti_get_pgtable_ent pte 338do_pte: __idmap_kpti_get_pgtable_ent pte
335 __idmap_kpti_put_pgtable_ent_ng pte 339 __idmap_kpti_put_pgtable_ent_ng pte
336next_pte: 340skip_pte:
337 add cur_ptep, cur_ptep, #8 341 add cur_ptep, cur_ptep, #8
338 cmp cur_ptep, end_ptep 342 cmp cur_ptep, end_ptep
339 b.ne do_pte 343 b.ne do_pte
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 1d4f1da7c58f..a93350451e8e 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -250,8 +250,9 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx)
250 off = offsetof(struct bpf_array, map.max_entries); 250 off = offsetof(struct bpf_array, map.max_entries);
251 emit_a64_mov_i64(tmp, off, ctx); 251 emit_a64_mov_i64(tmp, off, ctx);
252 emit(A64_LDR32(tmp, r2, tmp), ctx); 252 emit(A64_LDR32(tmp, r2, tmp), ctx);
253 emit(A64_MOV(0, r3, r3), ctx);
253 emit(A64_CMP(0, r3, tmp), ctx); 254 emit(A64_CMP(0, r3, tmp), ctx);
254 emit(A64_B_(A64_COND_GE, jmp_offset), ctx); 255 emit(A64_B_(A64_COND_CS, jmp_offset), ctx);
255 256
256 /* if (tail_call_cnt > MAX_TAIL_CALL_CNT) 257 /* if (tail_call_cnt > MAX_TAIL_CALL_CNT)
257 * goto out; 258 * goto out;
@@ -259,7 +260,7 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx)
259 */ 260 */
260 emit_a64_mov_i64(tmp, MAX_TAIL_CALL_CNT, ctx); 261 emit_a64_mov_i64(tmp, MAX_TAIL_CALL_CNT, ctx);
261 emit(A64_CMP(1, tcc, tmp), ctx); 262 emit(A64_CMP(1, tcc, tmp), ctx);
262 emit(A64_B_(A64_COND_GT, jmp_offset), ctx); 263 emit(A64_B_(A64_COND_HI, jmp_offset), ctx);
263 emit(A64_ADD_I(1, tcc, tcc, 1), ctx); 264 emit(A64_ADD_I(1, tcc, tcc, 1), ctx);
264 265
265 /* prog = array->ptrs[index]; 266 /* prog = array->ptrs[index];
diff --git a/arch/cris/include/arch-v10/arch/bug.h b/arch/cris/include/arch-v10/arch/bug.h
index 905afeacfedf..06da9d49152a 100644
--- a/arch/cris/include/arch-v10/arch/bug.h
+++ b/arch/cris/include/arch-v10/arch/bug.h
@@ -44,18 +44,25 @@ struct bug_frame {
44 * not be used like this with newer versions of gcc. 44 * not be used like this with newer versions of gcc.
45 */ 45 */
46#define BUG() \ 46#define BUG() \
47do { \
47 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\ 48 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
48 "movu.w " __stringify(__LINE__) ",$r0\n\t"\ 49 "movu.w " __stringify(__LINE__) ",$r0\n\t"\
49 "jump 0f\n\t" \ 50 "jump 0f\n\t" \
50 ".section .rodata\n" \ 51 ".section .rodata\n" \
51 "0:\t.string \"" __FILE__ "\"\n\t" \ 52 "0:\t.string \"" __FILE__ "\"\n\t" \
52 ".previous") 53 ".previous"); \
54 unreachable(); \
55} while (0)
53#endif 56#endif
54 57
55#else 58#else
56 59
57/* This just causes an oops. */ 60/* This just causes an oops. */
58#define BUG() (*(int *)0 = 0) 61#define BUG() \
62do { \
63 barrier_before_unreachable(); \
64 __builtin_trap(); \
65} while (0)
59 66
60#endif 67#endif
61 68
diff --git a/arch/ia64/include/asm/bug.h b/arch/ia64/include/asm/bug.h
index bd3eeb8d1cfa..66b37a532765 100644
--- a/arch/ia64/include/asm/bug.h
+++ b/arch/ia64/include/asm/bug.h
@@ -4,7 +4,11 @@
4 4
5#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
6#define ia64_abort() __builtin_trap() 6#define ia64_abort() __builtin_trap()
7#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) 7#define BUG() do { \
8 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
9 barrier_before_unreachable(); \
10 ia64_abort(); \
11} while (0)
8 12
9/* should this BUG be made generic? */ 13/* should this BUG be made generic? */
10#define HAVE_ARCH_BUG 14#define HAVE_ARCH_BUG
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 0b4c65a1af25..498f3da3f225 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -41,7 +41,6 @@ ifneq ($(CONFIG_IA64_ESI),)
41obj-y += esi_stub.o # must be in kernel proper 41obj-y += esi_stub.o # must be in kernel proper
42endif 42endif
43obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o 43obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o
44obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
45 44
46obj-$(CONFIG_BINFMT_ELF) += elfcore.o 45obj-$(CONFIG_BINFMT_ELF) += elfcore.o
47 46
diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h
index b7e2bf1ba4a6..275dca1435bf 100644
--- a/arch/m68k/include/asm/bug.h
+++ b/arch/m68k/include/asm/bug.h
@@ -8,16 +8,19 @@
8#ifndef CONFIG_SUN3 8#ifndef CONFIG_SUN3
9#define BUG() do { \ 9#define BUG() do { \
10 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 10 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
11 barrier_before_unreachable(); \
11 __builtin_trap(); \ 12 __builtin_trap(); \
12} while (0) 13} while (0)
13#else 14#else
14#define BUG() do { \ 15#define BUG() do { \
15 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 16 pr_crit("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
17 barrier_before_unreachable(); \
16 panic("BUG!"); \ 18 panic("BUG!"); \
17} while (0) 19} while (0)
18#endif 20#endif
19#else 21#else
20#define BUG() do { \ 22#define BUG() do { \
23 barrier_before_unreachable(); \
21 __builtin_trap(); \ 24 __builtin_trap(); \
22} while (0) 25} while (0)
23#endif 26#endif
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index 1bd5c4f00d19..c22da16d67b8 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -126,6 +126,7 @@ $(obj)/vmlinux.its.S: $(addprefix $(srctree)/arch/mips/$(PLATFORM)/,$(ITS_INPUTS
126 126
127quiet_cmd_cpp_its_S = ITS $@ 127quiet_cmd_cpp_its_S = ITS $@
128 cmd_cpp_its_S = $(CPP) $(cpp_flags) -P -C -o $@ $< \ 128 cmd_cpp_its_S = $(CPP) $(cpp_flags) -P -C -o $@ $< \
129 -D__ASSEMBLY__ \
129 -DKERNEL_NAME="\"Linux $(KERNELRELEASE)\"" \ 130 -DKERNEL_NAME="\"Linux $(KERNELRELEASE)\"" \
130 -DVMLINUX_BINARY="\"$(3)\"" \ 131 -DVMLINUX_BINARY="\"$(3)\"" \
131 -DVMLINUX_COMPRESSION="\"$(2)\"" \ 132 -DVMLINUX_COMPRESSION="\"$(2)\"" \
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 946681db8dc3..9a0fa66b81ac 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -86,7 +86,6 @@ struct compat_flock {
86 compat_off_t l_len; 86 compat_off_t l_len;
87 s32 l_sysid; 87 s32 l_sysid;
88 compat_pid_t l_pid; 88 compat_pid_t l_pid;
89 short __unused;
90 s32 pad[4]; 89 s32 pad[4];
91}; 90};
92 91
diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
index 19c88d770054..fcf9af492d60 100644
--- a/arch/mips/kernel/mips-cpc.c
+++ b/arch/mips/kernel/mips-cpc.c
@@ -10,6 +10,8 @@
10 10
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/percpu.h> 12#include <linux/percpu.h>
13#include <linux/of.h>
14#include <linux/of_address.h>
13#include <linux/spinlock.h> 15#include <linux/spinlock.h>
14 16
15#include <asm/mips-cps.h> 17#include <asm/mips-cps.h>
@@ -22,6 +24,17 @@ static DEFINE_PER_CPU_ALIGNED(unsigned long, cpc_core_lock_flags);
22 24
23phys_addr_t __weak mips_cpc_default_phys_base(void) 25phys_addr_t __weak mips_cpc_default_phys_base(void)
24{ 26{
27 struct device_node *cpc_node;
28 struct resource res;
29 int err;
30
31 cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc");
32 if (cpc_node) {
33 err = of_address_to_resource(cpc_node, 0, &res);
34 if (!err)
35 return res.start;
36 }
37
25 return 0; 38 return 0;
26} 39}
27 40
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 85bc601e9a0d..5f8b0a9e30b3 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -375,6 +375,7 @@ static void __init bootmem_init(void)
375 unsigned long reserved_end; 375 unsigned long reserved_end;
376 unsigned long mapstart = ~0UL; 376 unsigned long mapstart = ~0UL;
377 unsigned long bootmap_size; 377 unsigned long bootmap_size;
378 phys_addr_t ramstart = (phys_addr_t)ULLONG_MAX;
378 bool bootmap_valid = false; 379 bool bootmap_valid = false;
379 int i; 380 int i;
380 381
@@ -395,7 +396,8 @@ static void __init bootmem_init(void)
395 max_low_pfn = 0; 396 max_low_pfn = 0;
396 397
397 /* 398 /*
398 * Find the highest page frame number we have available. 399 * Find the highest page frame number we have available
400 * and the lowest used RAM address
399 */ 401 */
400 for (i = 0; i < boot_mem_map.nr_map; i++) { 402 for (i = 0; i < boot_mem_map.nr_map; i++) {
401 unsigned long start, end; 403 unsigned long start, end;
@@ -407,6 +409,8 @@ static void __init bootmem_init(void)
407 end = PFN_DOWN(boot_mem_map.map[i].addr 409 end = PFN_DOWN(boot_mem_map.map[i].addr
408 + boot_mem_map.map[i].size); 410 + boot_mem_map.map[i].size);
409 411
412 ramstart = min(ramstart, boot_mem_map.map[i].addr);
413
410#ifndef CONFIG_HIGHMEM 414#ifndef CONFIG_HIGHMEM
411 /* 415 /*
412 * Skip highmem here so we get an accurate max_low_pfn if low 416 * Skip highmem here so we get an accurate max_low_pfn if low
@@ -436,6 +440,13 @@ static void __init bootmem_init(void)
436 mapstart = max(reserved_end, start); 440 mapstart = max(reserved_end, start);
437 } 441 }
438 442
443 /*
444 * Reserve any memory between the start of RAM and PHYS_OFFSET
445 */
446 if (ramstart > PHYS_OFFSET)
447 add_memory_region(PHYS_OFFSET, ramstart - PHYS_OFFSET,
448 BOOT_MEM_RESERVED);
449
439 if (min_low_pfn >= max_low_pfn) 450 if (min_low_pfn >= max_low_pfn)
440 panic("Incorrect memory mapping !!!"); 451 panic("Incorrect memory mapping !!!");
441 if (min_low_pfn > ARCH_PFN_OFFSET) { 452 if (min_low_pfn > ARCH_PFN_OFFSET) {
@@ -664,9 +675,6 @@ static int __init early_parse_mem(char *p)
664 675
665 add_memory_region(start, size, BOOT_MEM_RAM); 676 add_memory_region(start, size, BOOT_MEM_RAM);
666 677
667 if (start && start > PHYS_OFFSET)
668 add_memory_region(PHYS_OFFSET, start - PHYS_OFFSET,
669 BOOT_MEM_RESERVED);
670 return 0; 678 return 0;
671} 679}
672early_param("mem", early_parse_mem); 680early_param("mem", early_parse_mem);
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index 87dcac2447c8..9d41732a9146 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -572,7 +572,7 @@ asmlinkage void __weak plat_wired_tlb_setup(void)
572 */ 572 */
573} 573}
574 574
575void __init bmips_cpu_setup(void) 575void bmips_cpu_setup(void)
576{ 576{
577 void __iomem __maybe_unused *cbr = BMIPS_GET_CBR(); 577 void __iomem __maybe_unused *cbr = BMIPS_GET_CBR();
578 u32 __maybe_unused cfg; 578 u32 __maybe_unused cfg;
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 3742508cc534..bd5ce31936f5 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -26,6 +26,7 @@ void flush_user_icache_range_asm(unsigned long, unsigned long);
26void flush_kernel_icache_range_asm(unsigned long, unsigned long); 26void flush_kernel_icache_range_asm(unsigned long, unsigned long);
27void flush_user_dcache_range_asm(unsigned long, unsigned long); 27void flush_user_dcache_range_asm(unsigned long, unsigned long);
28void flush_kernel_dcache_range_asm(unsigned long, unsigned long); 28void flush_kernel_dcache_range_asm(unsigned long, unsigned long);
29void purge_kernel_dcache_range_asm(unsigned long, unsigned long);
29void flush_kernel_dcache_page_asm(void *); 30void flush_kernel_dcache_page_asm(void *);
30void flush_kernel_icache_page(void *); 31void flush_kernel_icache_page(void *);
31 32
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 0e6ab6e4a4e9..2dbe5580a1a4 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -316,6 +316,8 @@ extern int _parisc_requires_coherency;
316#define parisc_requires_coherency() (0) 316#define parisc_requires_coherency() (0)
317#endif 317#endif
318 318
319extern int running_on_qemu;
320
319#endif /* __ASSEMBLY__ */ 321#endif /* __ASSEMBLY__ */
320 322
321#endif /* __ASM_PARISC_PROCESSOR_H */ 323#endif /* __ASM_PARISC_PROCESSOR_H */
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 19c0c141bc3f..79089778725b 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -465,10 +465,10 @@ EXPORT_SYMBOL(copy_user_page);
465int __flush_tlb_range(unsigned long sid, unsigned long start, 465int __flush_tlb_range(unsigned long sid, unsigned long start,
466 unsigned long end) 466 unsigned long end)
467{ 467{
468 unsigned long flags, size; 468 unsigned long flags;
469 469
470 size = (end - start); 470 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
471 if (size >= parisc_tlb_flush_threshold) { 471 end - start >= parisc_tlb_flush_threshold) {
472 flush_tlb_all(); 472 flush_tlb_all();
473 return 1; 473 return 1;
474 } 474 }
@@ -539,13 +539,11 @@ void flush_cache_mm(struct mm_struct *mm)
539 struct vm_area_struct *vma; 539 struct vm_area_struct *vma;
540 pgd_t *pgd; 540 pgd_t *pgd;
541 541
542 /* Flush the TLB to avoid speculation if coherency is required. */
543 if (parisc_requires_coherency())
544 flush_tlb_all();
545
546 /* Flushing the whole cache on each cpu takes forever on 542 /* Flushing the whole cache on each cpu takes forever on
547 rp3440, etc. So, avoid it if the mm isn't too big. */ 543 rp3440, etc. So, avoid it if the mm isn't too big. */
548 if (mm_total_size(mm) >= parisc_cache_flush_threshold) { 544 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
545 mm_total_size(mm) >= parisc_cache_flush_threshold) {
546 flush_tlb_all();
549 flush_cache_all(); 547 flush_cache_all();
550 return; 548 return;
551 } 549 }
@@ -553,9 +551,9 @@ void flush_cache_mm(struct mm_struct *mm)
553 if (mm->context == mfsp(3)) { 551 if (mm->context == mfsp(3)) {
554 for (vma = mm->mmap; vma; vma = vma->vm_next) { 552 for (vma = mm->mmap; vma; vma = vma->vm_next) {
555 flush_user_dcache_range_asm(vma->vm_start, vma->vm_end); 553 flush_user_dcache_range_asm(vma->vm_start, vma->vm_end);
556 if ((vma->vm_flags & VM_EXEC) == 0) 554 if (vma->vm_flags & VM_EXEC)
557 continue; 555 flush_user_icache_range_asm(vma->vm_start, vma->vm_end);
558 flush_user_icache_range_asm(vma->vm_start, vma->vm_end); 556 flush_tlb_range(vma, vma->vm_start, vma->vm_end);
559 } 557 }
560 return; 558 return;
561 } 559 }
@@ -581,14 +579,9 @@ void flush_cache_mm(struct mm_struct *mm)
581void flush_cache_range(struct vm_area_struct *vma, 579void flush_cache_range(struct vm_area_struct *vma,
582 unsigned long start, unsigned long end) 580 unsigned long start, unsigned long end)
583{ 581{
584 BUG_ON(!vma->vm_mm->context); 582 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
585 583 end - start >= parisc_cache_flush_threshold) {
586 /* Flush the TLB to avoid speculation if coherency is required. */
587 if (parisc_requires_coherency())
588 flush_tlb_range(vma, start, end); 584 flush_tlb_range(vma, start, end);
589
590 if ((end - start) >= parisc_cache_flush_threshold
591 || vma->vm_mm->context != mfsp(3)) {
592 flush_cache_all(); 585 flush_cache_all();
593 return; 586 return;
594 } 587 }
@@ -596,6 +589,7 @@ void flush_cache_range(struct vm_area_struct *vma,
596 flush_user_dcache_range_asm(start, end); 589 flush_user_dcache_range_asm(start, end);
597 if (vma->vm_flags & VM_EXEC) 590 if (vma->vm_flags & VM_EXEC)
598 flush_user_icache_range_asm(start, end); 591 flush_user_icache_range_asm(start, end);
592 flush_tlb_range(vma, start, end);
599} 593}
600 594
601void 595void
@@ -604,8 +598,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
604 BUG_ON(!vma->vm_mm->context); 598 BUG_ON(!vma->vm_mm->context);
605 599
606 if (pfn_valid(pfn)) { 600 if (pfn_valid(pfn)) {
607 if (parisc_requires_coherency()) 601 flush_tlb_page(vma, vmaddr);
608 flush_tlb_page(vma, vmaddr);
609 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); 602 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
610 } 603 }
611} 604}
@@ -613,21 +606,33 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
613void flush_kernel_vmap_range(void *vaddr, int size) 606void flush_kernel_vmap_range(void *vaddr, int size)
614{ 607{
615 unsigned long start = (unsigned long)vaddr; 608 unsigned long start = (unsigned long)vaddr;
609 unsigned long end = start + size;
616 610
617 if ((unsigned long)size > parisc_cache_flush_threshold) 611 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
612 (unsigned long)size >= parisc_cache_flush_threshold) {
613 flush_tlb_kernel_range(start, end);
618 flush_data_cache(); 614 flush_data_cache();
619 else 615 return;
620 flush_kernel_dcache_range_asm(start, start + size); 616 }
617
618 flush_kernel_dcache_range_asm(start, end);
619 flush_tlb_kernel_range(start, end);
621} 620}
622EXPORT_SYMBOL(flush_kernel_vmap_range); 621EXPORT_SYMBOL(flush_kernel_vmap_range);
623 622
624void invalidate_kernel_vmap_range(void *vaddr, int size) 623void invalidate_kernel_vmap_range(void *vaddr, int size)
625{ 624{
626 unsigned long start = (unsigned long)vaddr; 625 unsigned long start = (unsigned long)vaddr;
626 unsigned long end = start + size;
627 627
628 if ((unsigned long)size > parisc_cache_flush_threshold) 628 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
629 (unsigned long)size >= parisc_cache_flush_threshold) {
630 flush_tlb_kernel_range(start, end);
629 flush_data_cache(); 631 flush_data_cache();
630 else 632 return;
631 flush_kernel_dcache_range_asm(start, start + size); 633 }
634
635 purge_kernel_dcache_range_asm(start, end);
636 flush_tlb_kernel_range(start, end);
632} 637}
633EXPORT_SYMBOL(invalidate_kernel_vmap_range); 638EXPORT_SYMBOL(invalidate_kernel_vmap_range);
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index bbbe360b458f..fbb4e43fda05 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -138,6 +138,16 @@ $pgt_fill_loop:
138 std %dp,0x18(%r10) 138 std %dp,0x18(%r10)
139#endif 139#endif
140 140
141#ifdef CONFIG_64BIT
142 /* Get PDCE_PROC for monarch CPU. */
143#define MEM_PDC_LO 0x388
144#define MEM_PDC_HI 0x35C
145 ldw MEM_PDC_LO(%r0),%r3
146 ldw MEM_PDC_HI(%r0),%r10
147 depd %r10, 31, 32, %r3 /* move to upper word */
148#endif
149
150
141#ifdef CONFIG_SMP 151#ifdef CONFIG_SMP
142 /* Set the smp rendezvous address into page zero. 152 /* Set the smp rendezvous address into page zero.
143 ** It would be safer to do this in init_smp_config() but 153 ** It would be safer to do this in init_smp_config() but
@@ -196,12 +206,6 @@ common_stext:
196 ** Someday, palo might not do this for the Monarch either. 206 ** Someday, palo might not do this for the Monarch either.
197 */ 207 */
1982: 2082:
199#define MEM_PDC_LO 0x388
200#define MEM_PDC_HI 0x35C
201 ldw MEM_PDC_LO(%r0),%r3
202 ldw MEM_PDC_HI(%r0),%r6
203 depd %r6, 31, 32, %r3 /* move to upper word */
204
205 mfctl %cr30,%r6 /* PCX-W2 firmware bug */ 209 mfctl %cr30,%r6 /* PCX-W2 firmware bug */
206 210
207 ldo PDC_PSW(%r0),%arg0 /* 21 */ 211 ldo PDC_PSW(%r0),%arg0 /* 21 */
@@ -268,6 +272,8 @@ $install_iva:
268aligned_rfi: 272aligned_rfi:
269 pcxt_ssm_bug 273 pcxt_ssm_bug
270 274
275 copy %r3, %arg0 /* PDCE_PROC for smp_callin() */
276
271 rsm PSW_SM_QUIET,%r0 /* off troublesome PSW bits */ 277 rsm PSW_SM_QUIET,%r0 /* off troublesome PSW bits */
272 /* Don't need NOPs, have 8 compliant insn before rfi */ 278 /* Don't need NOPs, have 8 compliant insn before rfi */
273 279
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 2d40c4ff3f69..67b0f7532e83 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -1110,6 +1110,28 @@ ENTRY_CFI(flush_kernel_dcache_range_asm)
1110 .procend 1110 .procend
1111ENDPROC_CFI(flush_kernel_dcache_range_asm) 1111ENDPROC_CFI(flush_kernel_dcache_range_asm)
1112 1112
1113ENTRY_CFI(purge_kernel_dcache_range_asm)
1114 .proc
1115 .callinfo NO_CALLS
1116 .entry
1117
1118 ldil L%dcache_stride, %r1
1119 ldw R%dcache_stride(%r1), %r23
1120 ldo -1(%r23), %r21
1121 ANDCM %r26, %r21, %r26
1122
11231: cmpb,COND(<<),n %r26, %r25,1b
1124 pdc,m %r23(%r26)
1125
1126 sync
1127 syncdma
1128 bv %r0(%r2)
1129 nop
1130 .exit
1131
1132 .procend
1133ENDPROC_CFI(purge_kernel_dcache_range_asm)
1134
1113ENTRY_CFI(flush_user_icache_range_asm) 1135ENTRY_CFI(flush_user_icache_range_asm)
1114 .proc 1136 .proc
1115 .callinfo NO_CALLS 1137 .callinfo NO_CALLS
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 30c28ab14540..4065b5e48c9d 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -292,10 +292,15 @@ smp_cpu_init(int cpunum)
292 * Slaves start using C here. Indirectly called from smp_slave_stext. 292 * Slaves start using C here. Indirectly called from smp_slave_stext.
293 * Do what start_kernel() and main() do for boot strap processor (aka monarch) 293 * Do what start_kernel() and main() do for boot strap processor (aka monarch)
294 */ 294 */
295void __init smp_callin(void) 295void __init smp_callin(unsigned long pdce_proc)
296{ 296{
297 int slave_id = cpu_now_booting; 297 int slave_id = cpu_now_booting;
298 298
299#ifdef CONFIG_64BIT
300 WARN_ON(((unsigned long)(PAGE0->mem_pdc_hi) << 32
301 | PAGE0->mem_pdc) != pdce_proc);
302#endif
303
299 smp_cpu_init(slave_id); 304 smp_cpu_init(slave_id);
300 preempt_disable(); 305 preempt_disable();
301 306
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 4b8fd6dc22da..f7e684560186 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -76,10 +76,10 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
76 next_tick = cpuinfo->it_value; 76 next_tick = cpuinfo->it_value;
77 77
78 /* Calculate how many ticks have elapsed. */ 78 /* Calculate how many ticks have elapsed. */
79 now = mfctl(16);
79 do { 80 do {
80 ++ticks_elapsed; 81 ++ticks_elapsed;
81 next_tick += cpt; 82 next_tick += cpt;
82 now = mfctl(16);
83 } while (next_tick - now > cpt); 83 } while (next_tick - now > cpt);
84 84
85 /* Store (in CR16 cycles) up to when we are accounting right now. */ 85 /* Store (in CR16 cycles) up to when we are accounting right now. */
@@ -103,16 +103,17 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
103 * if one or the other wrapped. If "now" is "bigger" we'll end up 103 * if one or the other wrapped. If "now" is "bigger" we'll end up
104 * with a very large unsigned number. 104 * with a very large unsigned number.
105 */ 105 */
106 while (next_tick - mfctl(16) > cpt) 106 now = mfctl(16);
107 while (next_tick - now > cpt)
107 next_tick += cpt; 108 next_tick += cpt;
108 109
109 /* Program the IT when to deliver the next interrupt. 110 /* Program the IT when to deliver the next interrupt.
110 * Only bottom 32-bits of next_tick are writable in CR16! 111 * Only bottom 32-bits of next_tick are writable in CR16!
111 * Timer interrupt will be delivered at least a few hundred cycles 112 * Timer interrupt will be delivered at least a few hundred cycles
112 * after the IT fires, so if we are too close (<= 500 cycles) to the 113 * after the IT fires, so if we are too close (<= 8000 cycles) to the
113 * next cycle, simply skip it. 114 * next cycle, simply skip it.
114 */ 115 */
115 if (next_tick - mfctl(16) <= 500) 116 if (next_tick - now <= 8000)
116 next_tick += cpt; 117 next_tick += cpt;
117 mtctl(next_tick, 16); 118 mtctl(next_tick, 16);
118 119
@@ -248,7 +249,7 @@ static int __init init_cr16_clocksource(void)
248 * different sockets, so mark them unstable and lower rating on 249 * different sockets, so mark them unstable and lower rating on
249 * multi-socket SMP systems. 250 * multi-socket SMP systems.
250 */ 251 */
251 if (num_online_cpus() > 1) { 252 if (num_online_cpus() > 1 && !running_on_qemu) {
252 int cpu; 253 int cpu;
253 unsigned long cpu0_loc; 254 unsigned long cpu0_loc;
254 cpu0_loc = per_cpu(cpu_data, 0).cpu_loc; 255 cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 48f41399fc0b..cab32ee824d2 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -629,7 +629,12 @@ void __init mem_init(void)
629#endif 629#endif
630 630
631 mem_init_print_info(NULL); 631 mem_init_print_info(NULL);
632#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ 632
633#if 0
634 /*
635 * Do not expose the virtual kernel memory layout to userspace.
636 * But keep code for debugging purposes.
637 */
633 printk("virtual kernel memory layout:\n" 638 printk("virtual kernel memory layout:\n"
634 " vmalloc : 0x%px - 0x%px (%4ld MB)\n" 639 " vmalloc : 0x%px - 0x%px (%4ld MB)\n"
635 " memory : 0x%px - 0x%px (%4ld MB)\n" 640 " memory : 0x%px - 0x%px (%4ld MB)\n"
diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h
index 30a155c0a6b0..c615abdce119 100644
--- a/arch/powerpc/include/asm/book3s/32/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
@@ -16,6 +16,7 @@
16#define PGD_INDEX_SIZE (32 - PGDIR_SHIFT) 16#define PGD_INDEX_SIZE (32 - PGDIR_SHIFT)
17 17
18#define PMD_CACHE_INDEX PMD_INDEX_SIZE 18#define PMD_CACHE_INDEX PMD_INDEX_SIZE
19#define PUD_CACHE_INDEX PUD_INDEX_SIZE
19 20
20#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
21#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE) 22#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE)
diff --git a/arch/powerpc/include/asm/book3s/64/hash-4k.h b/arch/powerpc/include/asm/book3s/64/hash-4k.h
index 949d691094a4..67c5475311ee 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-4k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-4k.h
@@ -63,7 +63,8 @@ static inline int hash__hugepd_ok(hugepd_t hpd)
63 * keeping the prototype consistent across the two formats. 63 * keeping the prototype consistent across the two formats.
64 */ 64 */
65static inline unsigned long pte_set_hidx(pte_t *ptep, real_pte_t rpte, 65static inline unsigned long pte_set_hidx(pte_t *ptep, real_pte_t rpte,
66 unsigned int subpg_index, unsigned long hidx) 66 unsigned int subpg_index, unsigned long hidx,
67 int offset)
67{ 68{
68 return (hidx << H_PAGE_F_GIX_SHIFT) & 69 return (hidx << H_PAGE_F_GIX_SHIFT) &
69 (H_PAGE_F_SECOND | H_PAGE_F_GIX); 70 (H_PAGE_F_SECOND | H_PAGE_F_GIX);
diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h b/arch/powerpc/include/asm/book3s/64/hash-64k.h
index 338b7da468ce..3bcf269f8f55 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
@@ -45,7 +45,7 @@
45 * generic accessors and iterators here 45 * generic accessors and iterators here
46 */ 46 */
47#define __real_pte __real_pte 47#define __real_pte __real_pte
48static inline real_pte_t __real_pte(pte_t pte, pte_t *ptep) 48static inline real_pte_t __real_pte(pte_t pte, pte_t *ptep, int offset)
49{ 49{
50 real_pte_t rpte; 50 real_pte_t rpte;
51 unsigned long *hidxp; 51 unsigned long *hidxp;
@@ -59,7 +59,7 @@ static inline real_pte_t __real_pte(pte_t pte, pte_t *ptep)
59 */ 59 */
60 smp_rmb(); 60 smp_rmb();
61 61
62 hidxp = (unsigned long *)(ptep + PTRS_PER_PTE); 62 hidxp = (unsigned long *)(ptep + offset);
63 rpte.hidx = *hidxp; 63 rpte.hidx = *hidxp;
64 return rpte; 64 return rpte;
65} 65}
@@ -86,9 +86,10 @@ static inline unsigned long __rpte_to_hidx(real_pte_t rpte, unsigned long index)
86 * expected to modify the PTE bits accordingly and commit the PTE to memory. 86 * expected to modify the PTE bits accordingly and commit the PTE to memory.
87 */ 87 */
88static inline unsigned long pte_set_hidx(pte_t *ptep, real_pte_t rpte, 88static inline unsigned long pte_set_hidx(pte_t *ptep, real_pte_t rpte,
89 unsigned int subpg_index, unsigned long hidx) 89 unsigned int subpg_index,
90 unsigned long hidx, int offset)
90{ 91{
91 unsigned long *hidxp = (unsigned long *)(ptep + PTRS_PER_PTE); 92 unsigned long *hidxp = (unsigned long *)(ptep + offset);
92 93
93 rpte.hidx &= ~HIDX_BITS(0xfUL, subpg_index); 94 rpte.hidx &= ~HIDX_BITS(0xfUL, subpg_index);
94 *hidxp = rpte.hidx | HIDX_BITS(HIDX_SHIFT_BY_ONE(hidx), subpg_index); 95 *hidxp = rpte.hidx | HIDX_BITS(HIDX_SHIFT_BY_ONE(hidx), subpg_index);
@@ -140,13 +141,18 @@ static inline int hash__remap_4k_pfn(struct vm_area_struct *vma, unsigned long a
140} 141}
141 142
142#define H_PTE_TABLE_SIZE PTE_FRAG_SIZE 143#define H_PTE_TABLE_SIZE PTE_FRAG_SIZE
143#ifdef CONFIG_TRANSPARENT_HUGEPAGE 144#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined (CONFIG_HUGETLB_PAGE)
144#define H_PMD_TABLE_SIZE ((sizeof(pmd_t) << PMD_INDEX_SIZE) + \ 145#define H_PMD_TABLE_SIZE ((sizeof(pmd_t) << PMD_INDEX_SIZE) + \
145 (sizeof(unsigned long) << PMD_INDEX_SIZE)) 146 (sizeof(unsigned long) << PMD_INDEX_SIZE))
146#else 147#else
147#define H_PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE) 148#define H_PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
148#endif 149#endif
150#ifdef CONFIG_HUGETLB_PAGE
151#define H_PUD_TABLE_SIZE ((sizeof(pud_t) << PUD_INDEX_SIZE) + \
152 (sizeof(unsigned long) << PUD_INDEX_SIZE))
153#else
149#define H_PUD_TABLE_SIZE (sizeof(pud_t) << PUD_INDEX_SIZE) 154#define H_PUD_TABLE_SIZE (sizeof(pud_t) << PUD_INDEX_SIZE)
155#endif
150#define H_PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE) 156#define H_PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
151 157
152#ifdef CONFIG_TRANSPARENT_HUGEPAGE 158#ifdef CONFIG_TRANSPARENT_HUGEPAGE
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index 0920eff731b3..935adcd92a81 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -23,7 +23,8 @@
23 H_PUD_INDEX_SIZE + H_PGD_INDEX_SIZE + PAGE_SHIFT) 23 H_PUD_INDEX_SIZE + H_PGD_INDEX_SIZE + PAGE_SHIFT)
24#define H_PGTABLE_RANGE (ASM_CONST(1) << H_PGTABLE_EADDR_SIZE) 24#define H_PGTABLE_RANGE (ASM_CONST(1) << H_PGTABLE_EADDR_SIZE)
25 25
26#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_PPC_64K_PAGES) 26#if (defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE)) && \
27 defined(CONFIG_PPC_64K_PAGES)
27/* 28/*
28 * only with hash 64k we need to use the second half of pmd page table 29 * only with hash 64k we need to use the second half of pmd page table
29 * to store pointer to deposited pgtable_t 30 * to store pointer to deposited pgtable_t
@@ -33,6 +34,16 @@
33#define H_PMD_CACHE_INDEX H_PMD_INDEX_SIZE 34#define H_PMD_CACHE_INDEX H_PMD_INDEX_SIZE
34#endif 35#endif
35/* 36/*
37 * We store the slot details in the second half of page table.
38 * Increase the pud level table so that hugetlb ptes can be stored
39 * at pud level.
40 */
41#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PPC_64K_PAGES)
42#define H_PUD_CACHE_INDEX (H_PUD_INDEX_SIZE + 1)
43#else
44#define H_PUD_CACHE_INDEX (H_PUD_INDEX_SIZE)
45#endif
46/*
36 * Define the address range of the kernel non-linear virtual area 47 * Define the address range of the kernel non-linear virtual area
37 */ 48 */
38#define H_KERN_VIRT_START ASM_CONST(0xD000000000000000) 49#define H_KERN_VIRT_START ASM_CONST(0xD000000000000000)
diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h
index 1fcfa425cefa..4746bc68d446 100644
--- a/arch/powerpc/include/asm/book3s/64/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h
@@ -73,10 +73,16 @@ static inline void radix__pgd_free(struct mm_struct *mm, pgd_t *pgd)
73 73
74static inline pgd_t *pgd_alloc(struct mm_struct *mm) 74static inline pgd_t *pgd_alloc(struct mm_struct *mm)
75{ 75{
76 pgd_t *pgd;
77
76 if (radix_enabled()) 78 if (radix_enabled())
77 return radix__pgd_alloc(mm); 79 return radix__pgd_alloc(mm);
78 return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), 80
79 pgtable_gfp_flags(mm, GFP_KERNEL)); 81 pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
82 pgtable_gfp_flags(mm, GFP_KERNEL));
83 memset(pgd, 0, PGD_TABLE_SIZE);
84
85 return pgd;
80} 86}
81 87
82static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 88static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
@@ -93,13 +99,13 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud)
93 99
94static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) 100static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
95{ 101{
96 return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), 102 return kmem_cache_alloc(PGT_CACHE(PUD_CACHE_INDEX),
97 pgtable_gfp_flags(mm, GFP_KERNEL)); 103 pgtable_gfp_flags(mm, GFP_KERNEL));
98} 104}
99 105
100static inline void pud_free(struct mm_struct *mm, pud_t *pud) 106static inline void pud_free(struct mm_struct *mm, pud_t *pud)
101{ 107{
102 kmem_cache_free(PGT_CACHE(PUD_INDEX_SIZE), pud); 108 kmem_cache_free(PGT_CACHE(PUD_CACHE_INDEX), pud);
103} 109}
104 110
105static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) 111static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
@@ -115,7 +121,7 @@ static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
115 * ahead and flush the page walk cache 121 * ahead and flush the page walk cache
116 */ 122 */
117 flush_tlb_pgtable(tlb, address); 123 flush_tlb_pgtable(tlb, address);
118 pgtable_free_tlb(tlb, pud, PUD_INDEX_SIZE); 124 pgtable_free_tlb(tlb, pud, PUD_CACHE_INDEX);
119} 125}
120 126
121static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) 127static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 51017726d495..a6b9f1d74600 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -232,11 +232,13 @@ extern unsigned long __pmd_index_size;
232extern unsigned long __pud_index_size; 232extern unsigned long __pud_index_size;
233extern unsigned long __pgd_index_size; 233extern unsigned long __pgd_index_size;
234extern unsigned long __pmd_cache_index; 234extern unsigned long __pmd_cache_index;
235extern unsigned long __pud_cache_index;
235#define PTE_INDEX_SIZE __pte_index_size 236#define PTE_INDEX_SIZE __pte_index_size
236#define PMD_INDEX_SIZE __pmd_index_size 237#define PMD_INDEX_SIZE __pmd_index_size
237#define PUD_INDEX_SIZE __pud_index_size 238#define PUD_INDEX_SIZE __pud_index_size
238#define PGD_INDEX_SIZE __pgd_index_size 239#define PGD_INDEX_SIZE __pgd_index_size
239#define PMD_CACHE_INDEX __pmd_cache_index 240#define PMD_CACHE_INDEX __pmd_cache_index
241#define PUD_CACHE_INDEX __pud_cache_index
240/* 242/*
241 * Because of use of pte fragments and THP, size of page table 243 * Because of use of pte fragments and THP, size of page table
242 * are not always derived out of index size above. 244 * are not always derived out of index size above.
@@ -348,7 +350,7 @@ extern unsigned long pci_io_base;
348 */ 350 */
349#ifndef __real_pte 351#ifndef __real_pte
350 352
351#define __real_pte(e,p) ((real_pte_t){(e)}) 353#define __real_pte(e, p, o) ((real_pte_t){(e)})
352#define __rpte_to_pte(r) ((r).pte) 354#define __rpte_to_pte(r) ((r).pte)
353#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT) 355#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT)
354 356
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 176dfb73d42c..471b2274fbeb 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -645,7 +645,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
645 EXC_HV, SOFTEN_TEST_HV, bitmask) 645 EXC_HV, SOFTEN_TEST_HV, bitmask)
646 646
647#define MASKABLE_RELON_EXCEPTION_HV_OOL(vec, label, bitmask) \ 647#define MASKABLE_RELON_EXCEPTION_HV_OOL(vec, label, bitmask) \
648 MASKABLE_EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_NOTEST_HV, vec, bitmask);\ 648 MASKABLE_EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_HV, vec, bitmask);\
649 EXCEPTION_RELON_PROLOG_PSERIES_1(label, EXC_HV) 649 EXCEPTION_RELON_PROLOG_PSERIES_1(label, EXC_HV)
650 650
651/* 651/*
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h
index 511acfd7ab0d..535add3f7791 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -52,7 +52,7 @@
52#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000) 52#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000)
53#define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000) 53#define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000)
54#define FW_FEATURE_DRMEM_V2 ASM_CONST(0x0000000400000000) 54#define FW_FEATURE_DRMEM_V2 ASM_CONST(0x0000000400000000)
55#define FW_FEATURE_DRC_INFO ASM_CONST(0x0000000400000000) 55#define FW_FEATURE_DRC_INFO ASM_CONST(0x0000000800000000)
56 56
57#ifndef __ASSEMBLY__ 57#ifndef __ASSEMBLY__
58 58
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 88e5e8f17e98..855e17d158b1 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -30,6 +30,16 @@
30#define PACA_IRQ_PMI 0x40 30#define PACA_IRQ_PMI 0x40
31 31
32/* 32/*
33 * Some soft-masked interrupts must be hard masked until they are replayed
34 * (e.g., because the soft-masked handler does not clear the exception).
35 */
36#ifdef CONFIG_PPC_BOOK3S
37#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE|PACA_IRQ_PMI)
38#else
39#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE)
40#endif
41
42/*
33 * flags for paca->irq_soft_mask 43 * flags for paca->irq_soft_mask
34 */ 44 */
35#define IRQS_ENABLED 0 45#define IRQS_ENABLED 0
@@ -244,7 +254,7 @@ static inline bool lazy_irq_pending(void)
244static inline void may_hard_irq_enable(void) 254static inline void may_hard_irq_enable(void)
245{ 255{
246 get_paca()->irq_happened &= ~PACA_IRQ_HARD_DIS; 256 get_paca()->irq_happened &= ~PACA_IRQ_HARD_DIS;
247 if (!(get_paca()->irq_happened & PACA_IRQ_EE)) 257 if (!(get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK))
248 __hard_irq_enable(); 258 __hard_irq_enable();
249} 259}
250 260
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 9dcbfa6bbb91..d8b1e8e7e035 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -140,6 +140,12 @@ static inline bool kdump_in_progress(void)
140 return false; 140 return false;
141} 141}
142 142
143static inline void crash_ipi_callback(struct pt_regs *regs) { }
144
145static inline void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
146{
147}
148
143#endif /* CONFIG_KEXEC_CORE */ 149#endif /* CONFIG_KEXEC_CORE */
144#endif /* ! __ASSEMBLY__ */ 150#endif /* ! __ASSEMBLY__ */
145#endif /* __KERNEL__ */ 151#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h
index 504a3c36ce5c..03bbd1149530 100644
--- a/arch/powerpc/include/asm/nohash/32/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/32/pgtable.h
@@ -24,6 +24,7 @@ extern int icache_44x_need_flush;
24#define PGD_INDEX_SIZE (32 - PGDIR_SHIFT) 24#define PGD_INDEX_SIZE (32 - PGDIR_SHIFT)
25 25
26#define PMD_CACHE_INDEX PMD_INDEX_SIZE 26#define PMD_CACHE_INDEX PMD_INDEX_SIZE
27#define PUD_CACHE_INDEX PUD_INDEX_SIZE
27 28
28#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
29#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE) 30#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE)
diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h
index abddf5830ad5..5c5f75d005ad 100644
--- a/arch/powerpc/include/asm/nohash/64/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/64/pgtable.h
@@ -27,6 +27,7 @@
27#else 27#else
28#define PMD_CACHE_INDEX PMD_INDEX_SIZE 28#define PMD_CACHE_INDEX PMD_INDEX_SIZE
29#endif 29#endif
30#define PUD_CACHE_INDEX PUD_INDEX_SIZE
30 31
31/* 32/*
32 * Define the address range of the kernel non-linear virtual area 33 * Define the address range of the kernel non-linear virtual area
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 88187c285c70..9f421641a35c 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -44,6 +44,11 @@ extern int sysfs_add_device_to_node(struct device *dev, int nid);
44extern void sysfs_remove_device_from_node(struct device *dev, int nid); 44extern void sysfs_remove_device_from_node(struct device *dev, int nid);
45extern int numa_update_cpu_topology(bool cpus_locked); 45extern int numa_update_cpu_topology(bool cpus_locked);
46 46
47static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node)
48{
49 numa_cpu_lookup_table[cpu] = node;
50}
51
47static inline int early_cpu_to_node(int cpu) 52static inline int early_cpu_to_node(int cpu)
48{ 53{
49 int nid; 54 int nid;
@@ -76,12 +81,16 @@ static inline int numa_update_cpu_topology(bool cpus_locked)
76{ 81{
77 return 0; 82 return 0;
78} 83}
84
85static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
86
79#endif /* CONFIG_NUMA */ 87#endif /* CONFIG_NUMA */
80 88
81#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) 89#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
82extern int start_topology_update(void); 90extern int start_topology_update(void);
83extern int stop_topology_update(void); 91extern int stop_topology_update(void);
84extern int prrn_is_enabled(void); 92extern int prrn_is_enabled(void);
93extern int find_and_online_cpu_nid(int cpu);
85#else 94#else
86static inline int start_topology_update(void) 95static inline int start_topology_update(void)
87{ 96{
@@ -95,6 +104,10 @@ static inline int prrn_is_enabled(void)
95{ 104{
96 return 0; 105 return 0;
97} 106}
107static inline int find_and_online_cpu_nid(int cpu)
108{
109 return 0;
110}
98#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ 111#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
99 112
100#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES) 113#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES)
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index beea2182d754..0c0b66fc5bfb 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *userdata)
384 eeh_pcid_put(dev); 384 eeh_pcid_put(dev);
385 pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED); 385 pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
386#ifdef CONFIG_PCI_IOV 386#ifdef CONFIG_PCI_IOV
387 eeh_ops->notify_resume(eeh_dev_to_pdn(edev)); 387 if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
388 eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
388#endif 389#endif
389 return NULL; 390 return NULL;
390} 391}
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index ee832d344a5a..9b6e653e501a 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -943,6 +943,8 @@ kernel_dbg_exc:
943/* 943/*
944 * An interrupt came in while soft-disabled; We mark paca->irq_happened 944 * An interrupt came in while soft-disabled; We mark paca->irq_happened
945 * accordingly and if the interrupt is level sensitive, we hard disable 945 * accordingly and if the interrupt is level sensitive, we hard disable
946 * hard disable (full_mask) corresponds to PACA_IRQ_MUST_HARD_MASK, so
947 * keep these in synch.
946 */ 948 */
947 949
948.macro masked_interrupt_book3e paca_irq full_mask 950.macro masked_interrupt_book3e paca_irq full_mask
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 243d072a225a..3ac87e53b3da 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1426,7 +1426,7 @@ EXC_COMMON_BEGIN(soft_nmi_common)
1426 * triggered and won't automatically refire. 1426 * triggered and won't automatically refire.
1427 * - If it was a HMI we return immediately since we handled it in realmode 1427 * - If it was a HMI we return immediately since we handled it in realmode
1428 * and it won't refire. 1428 * and it won't refire.
1429 * - else we hard disable and return. 1429 * - Else it is one of PACA_IRQ_MUST_HARD_MASK, so hard disable and return.
1430 * This is called with r10 containing the value to OR to the paca field. 1430 * This is called with r10 containing the value to OR to the paca field.
1431 */ 1431 */
1432#define MASKED_INTERRUPT(_H) \ 1432#define MASKED_INTERRUPT(_H) \
@@ -1441,8 +1441,8 @@ masked_##_H##interrupt: \
1441 ori r10,r10,0xffff; \ 1441 ori r10,r10,0xffff; \
1442 mtspr SPRN_DEC,r10; \ 1442 mtspr SPRN_DEC,r10; \
1443 b MASKED_DEC_HANDLER_LABEL; \ 1443 b MASKED_DEC_HANDLER_LABEL; \
14441: andi. r10,r10,(PACA_IRQ_DBELL|PACA_IRQ_HMI); \ 14441: andi. r10,r10,PACA_IRQ_MUST_HARD_MASK; \
1445 bne 2f; \ 1445 beq 2f; \
1446 mfspr r10,SPRN_##_H##SRR1; \ 1446 mfspr r10,SPRN_##_H##SRR1; \
1447 xori r10,r10,MSR_EE; /* clear MSR_EE */ \ 1447 xori r10,r10,MSR_EE; /* clear MSR_EE */ \
1448 mtspr SPRN_##_H##SRR1,r10; \ 1448 mtspr SPRN_##_H##SRR1,r10; \
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index adf044daafd7..d22c41c26bb3 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -874,7 +874,7 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = {
874 .mmu = 0, 874 .mmu = 0,
875 .hash_ext = 0, 875 .hash_ext = 0,
876 .radix_ext = 0, 876 .radix_ext = 0,
877 .byte22 = OV5_FEAT(OV5_DRC_INFO), 877 .byte22 = 0,
878 }, 878 },
879 879
880 /* option vector 6: IBM PAPR hints */ 880 /* option vector 6: IBM PAPR hints */
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 5a8bfee6e187..04d0bbd7a1dd 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -788,7 +788,8 @@ static int register_cpu_online(unsigned int cpu)
788 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2)) 788 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
789 device_create_file(s, &dev_attr_pir); 789 device_create_file(s, &dev_attr_pir);
790 790
791 if (cpu_has_feature(CPU_FTR_ARCH_206)) 791 if (cpu_has_feature(CPU_FTR_ARCH_206) &&
792 !firmware_has_feature(FW_FEATURE_LPAR))
792 device_create_file(s, &dev_attr_tscr); 793 device_create_file(s, &dev_attr_tscr);
793#endif /* CONFIG_PPC64 */ 794#endif /* CONFIG_PPC64 */
794 795
@@ -873,7 +874,8 @@ static int unregister_cpu_online(unsigned int cpu)
873 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2)) 874 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
874 device_remove_file(s, &dev_attr_pir); 875 device_remove_file(s, &dev_attr_pir);
875 876
876 if (cpu_has_feature(CPU_FTR_ARCH_206)) 877 if (cpu_has_feature(CPU_FTR_ARCH_206) &&
878 !firmware_has_feature(FW_FEATURE_LPAR))
877 device_remove_file(s, &dev_attr_tscr); 879 device_remove_file(s, &dev_attr_tscr);
878#endif /* CONFIG_PPC64 */ 880#endif /* CONFIG_PPC64 */
879 881
diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
index f0f5cd4d2fe7..f9818d7d3381 100644
--- a/arch/powerpc/kvm/book3s_xive.c
+++ b/arch/powerpc/kvm/book3s_xive.c
@@ -188,7 +188,7 @@ static int xive_provision_queue(struct kvm_vcpu *vcpu, u8 prio)
188 if (!qpage) { 188 if (!qpage) {
189 pr_err("Failed to allocate queue %d for VCPU %d\n", 189 pr_err("Failed to allocate queue %d for VCPU %d\n",
190 prio, xc->server_num); 190 prio, xc->server_num);
191 return -ENOMEM;; 191 return -ENOMEM;
192 } 192 }
193 memset(qpage, 0, 1 << xive->q_order); 193 memset(qpage, 0, 1 << xive->q_order);
194 194
diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c
index 1604110c4238..3f1803672c9b 100644
--- a/arch/powerpc/mm/drmem.c
+++ b/arch/powerpc/mm/drmem.c
@@ -98,7 +98,7 @@ static void init_drconf_v2_cell(struct of_drconf_cell_v2 *dr_cell,
98 dr_cell->base_addr = cpu_to_be64(lmb->base_addr); 98 dr_cell->base_addr = cpu_to_be64(lmb->base_addr);
99 dr_cell->drc_index = cpu_to_be32(lmb->drc_index); 99 dr_cell->drc_index = cpu_to_be32(lmb->drc_index);
100 dr_cell->aa_index = cpu_to_be32(lmb->aa_index); 100 dr_cell->aa_index = cpu_to_be32(lmb->aa_index);
101 dr_cell->flags = cpu_to_be32(lmb->flags); 101 dr_cell->flags = cpu_to_be32(drmem_lmb_flags(lmb));
102} 102}
103 103
104static int drmem_update_dt_v2(struct device_node *memory, 104static int drmem_update_dt_v2(struct device_node *memory,
@@ -121,7 +121,7 @@ static int drmem_update_dt_v2(struct device_node *memory,
121 } 121 }
122 122
123 if (prev_lmb->aa_index != lmb->aa_index || 123 if (prev_lmb->aa_index != lmb->aa_index ||
124 prev_lmb->flags != lmb->flags) 124 drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb))
125 lmb_sets++; 125 lmb_sets++;
126 126
127 prev_lmb = lmb; 127 prev_lmb = lmb;
@@ -150,7 +150,7 @@ static int drmem_update_dt_v2(struct device_node *memory,
150 } 150 }
151 151
152 if (prev_lmb->aa_index != lmb->aa_index || 152 if (prev_lmb->aa_index != lmb->aa_index ||
153 prev_lmb->flags != lmb->flags) { 153 drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb)) {
154 /* end of one set, start of another */ 154 /* end of one set, start of another */
155 dr_cell->seq_lmbs = cpu_to_be32(seq_lmbs); 155 dr_cell->seq_lmbs = cpu_to_be32(seq_lmbs);
156 dr_cell++; 156 dr_cell++;
@@ -216,6 +216,8 @@ static void __init __walk_drmem_v1_lmbs(const __be32 *prop, const __be32 *usm,
216 u32 i, n_lmbs; 216 u32 i, n_lmbs;
217 217
218 n_lmbs = of_read_number(prop++, 1); 218 n_lmbs = of_read_number(prop++, 1);
219 if (n_lmbs == 0)
220 return;
219 221
220 for (i = 0; i < n_lmbs; i++) { 222 for (i = 0; i < n_lmbs; i++) {
221 read_drconf_v1_cell(&lmb, &prop); 223 read_drconf_v1_cell(&lmb, &prop);
@@ -245,6 +247,8 @@ static void __init __walk_drmem_v2_lmbs(const __be32 *prop, const __be32 *usm,
245 u32 i, j, lmb_sets; 247 u32 i, j, lmb_sets;
246 248
247 lmb_sets = of_read_number(prop++, 1); 249 lmb_sets = of_read_number(prop++, 1);
250 if (lmb_sets == 0)
251 return;
248 252
249 for (i = 0; i < lmb_sets; i++) { 253 for (i = 0; i < lmb_sets; i++) {
250 read_drconf_v2_cell(&dr_cell, &prop); 254 read_drconf_v2_cell(&dr_cell, &prop);
@@ -354,6 +358,8 @@ static void __init init_drmem_v1_lmbs(const __be32 *prop)
354 struct drmem_lmb *lmb; 358 struct drmem_lmb *lmb;
355 359
356 drmem_info->n_lmbs = of_read_number(prop++, 1); 360 drmem_info->n_lmbs = of_read_number(prop++, 1);
361 if (drmem_info->n_lmbs == 0)
362 return;
357 363
358 drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb), 364 drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb),
359 GFP_KERNEL); 365 GFP_KERNEL);
@@ -373,6 +379,8 @@ static void __init init_drmem_v2_lmbs(const __be32 *prop)
373 int lmb_index; 379 int lmb_index;
374 380
375 lmb_sets = of_read_number(prop++, 1); 381 lmb_sets = of_read_number(prop++, 1);
382 if (lmb_sets == 0)
383 return;
376 384
377 /* first pass, calculate the number of LMBs */ 385 /* first pass, calculate the number of LMBs */
378 p = prop; 386 p = prop;
diff --git a/arch/powerpc/mm/hash64_4k.c b/arch/powerpc/mm/hash64_4k.c
index 5a69b51d08a3..d573d7d07f25 100644
--- a/arch/powerpc/mm/hash64_4k.c
+++ b/arch/powerpc/mm/hash64_4k.c
@@ -55,7 +55,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
55 * need to add in 0x1 if it's a read-only user page 55 * need to add in 0x1 if it's a read-only user page
56 */ 56 */
57 rflags = htab_convert_pte_flags(new_pte); 57 rflags = htab_convert_pte_flags(new_pte);
58 rpte = __real_pte(__pte(old_pte), ptep); 58 rpte = __real_pte(__pte(old_pte), ptep, PTRS_PER_PTE);
59 59
60 if (cpu_has_feature(CPU_FTR_NOEXECUTE) && 60 if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
61 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) 61 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
@@ -117,7 +117,7 @@ repeat:
117 return -1; 117 return -1;
118 } 118 }
119 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | H_PAGE_HASHPTE; 119 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | H_PAGE_HASHPTE;
120 new_pte |= pte_set_hidx(ptep, rpte, 0, slot); 120 new_pte |= pte_set_hidx(ptep, rpte, 0, slot, PTRS_PER_PTE);
121 } 121 }
122 *ptep = __pte(new_pte & ~H_PAGE_BUSY); 122 *ptep = __pte(new_pte & ~H_PAGE_BUSY);
123 return 0; 123 return 0;
diff --git a/arch/powerpc/mm/hash64_64k.c b/arch/powerpc/mm/hash64_64k.c
index 2253bbc6a599..e601d95c3b20 100644
--- a/arch/powerpc/mm/hash64_64k.c
+++ b/arch/powerpc/mm/hash64_64k.c
@@ -86,7 +86,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
86 86
87 subpg_index = (ea & (PAGE_SIZE - 1)) >> shift; 87 subpg_index = (ea & (PAGE_SIZE - 1)) >> shift;
88 vpn = hpt_vpn(ea, vsid, ssize); 88 vpn = hpt_vpn(ea, vsid, ssize);
89 rpte = __real_pte(__pte(old_pte), ptep); 89 rpte = __real_pte(__pte(old_pte), ptep, PTRS_PER_PTE);
90 /* 90 /*
91 *None of the sub 4k page is hashed 91 *None of the sub 4k page is hashed
92 */ 92 */
@@ -214,7 +214,7 @@ repeat:
214 return -1; 214 return -1;
215 } 215 }
216 216
217 new_pte |= pte_set_hidx(ptep, rpte, subpg_index, slot); 217 new_pte |= pte_set_hidx(ptep, rpte, subpg_index, slot, PTRS_PER_PTE);
218 new_pte |= H_PAGE_HASHPTE; 218 new_pte |= H_PAGE_HASHPTE;
219 219
220 *ptep = __pte(new_pte & ~H_PAGE_BUSY); 220 *ptep = __pte(new_pte & ~H_PAGE_BUSY);
@@ -262,7 +262,7 @@ int __hash_page_64K(unsigned long ea, unsigned long access,
262 } while (!pte_xchg(ptep, __pte(old_pte), __pte(new_pte))); 262 } while (!pte_xchg(ptep, __pte(old_pte), __pte(new_pte)));
263 263
264 rflags = htab_convert_pte_flags(new_pte); 264 rflags = htab_convert_pte_flags(new_pte);
265 rpte = __real_pte(__pte(old_pte), ptep); 265 rpte = __real_pte(__pte(old_pte), ptep, PTRS_PER_PTE);
266 266
267 if (cpu_has_feature(CPU_FTR_NOEXECUTE) && 267 if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
268 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) 268 !cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
@@ -327,7 +327,7 @@ repeat:
327 } 327 }
328 328
329 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | H_PAGE_HASHPTE; 329 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | H_PAGE_HASHPTE;
330 new_pte |= pte_set_hidx(ptep, rpte, 0, slot); 330 new_pte |= pte_set_hidx(ptep, rpte, 0, slot, PTRS_PER_PTE);
331 } 331 }
332 *ptep = __pte(new_pte & ~H_PAGE_BUSY); 332 *ptep = __pte(new_pte & ~H_PAGE_BUSY);
333 return 0; 333 return 0;
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 7d07c7e17db6..cf290d415dcd 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1008,6 +1008,7 @@ void __init hash__early_init_mmu(void)
1008 __pmd_index_size = H_PMD_INDEX_SIZE; 1008 __pmd_index_size = H_PMD_INDEX_SIZE;
1009 __pud_index_size = H_PUD_INDEX_SIZE; 1009 __pud_index_size = H_PUD_INDEX_SIZE;
1010 __pgd_index_size = H_PGD_INDEX_SIZE; 1010 __pgd_index_size = H_PGD_INDEX_SIZE;
1011 __pud_cache_index = H_PUD_CACHE_INDEX;
1011 __pmd_cache_index = H_PMD_CACHE_INDEX; 1012 __pmd_cache_index = H_PMD_CACHE_INDEX;
1012 __pte_table_size = H_PTE_TABLE_SIZE; 1013 __pte_table_size = H_PTE_TABLE_SIZE;
1013 __pmd_table_size = H_PMD_TABLE_SIZE; 1014 __pmd_table_size = H_PMD_TABLE_SIZE;
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c
index 12511f5a015f..b320f5097a06 100644
--- a/arch/powerpc/mm/hugetlbpage-hash64.c
+++ b/arch/powerpc/mm/hugetlbpage-hash64.c
@@ -27,7 +27,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
27 unsigned long vpn; 27 unsigned long vpn;
28 unsigned long old_pte, new_pte; 28 unsigned long old_pte, new_pte;
29 unsigned long rflags, pa, sz; 29 unsigned long rflags, pa, sz;
30 long slot; 30 long slot, offset;
31 31
32 BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); 32 BUG_ON(shift != mmu_psize_defs[mmu_psize].shift);
33 33
@@ -63,7 +63,11 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
63 } while(!pte_xchg(ptep, __pte(old_pte), __pte(new_pte))); 63 } while(!pte_xchg(ptep, __pte(old_pte), __pte(new_pte)));
64 64
65 rflags = htab_convert_pte_flags(new_pte); 65 rflags = htab_convert_pte_flags(new_pte);
66 rpte = __real_pte(__pte(old_pte), ptep); 66 if (unlikely(mmu_psize == MMU_PAGE_16G))
67 offset = PTRS_PER_PUD;
68 else
69 offset = PTRS_PER_PMD;
70 rpte = __real_pte(__pte(old_pte), ptep, offset);
67 71
68 sz = ((1UL) << shift); 72 sz = ((1UL) << shift);
69 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) 73 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
@@ -104,7 +108,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
104 return -1; 108 return -1;
105 } 109 }
106 110
107 new_pte |= pte_set_hidx(ptep, rpte, 0, slot); 111 new_pte |= pte_set_hidx(ptep, rpte, 0, slot, offset);
108 } 112 }
109 113
110 /* 114 /*
diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c
index eb8c6c8c4851..2b656e67f2ea 100644
--- a/arch/powerpc/mm/init-common.c
+++ b/arch/powerpc/mm/init-common.c
@@ -100,6 +100,6 @@ void pgtable_cache_init(void)
100 * same size as either the pgd or pmd index except with THP enabled 100 * same size as either the pgd or pmd index except with THP enabled
101 * on book3s 64 101 * on book3s 64
102 */ 102 */
103 if (PUD_INDEX_SIZE && !PGT_CACHE(PUD_INDEX_SIZE)) 103 if (PUD_CACHE_INDEX && !PGT_CACHE(PUD_CACHE_INDEX))
104 pgtable_cache_add(PUD_INDEX_SIZE, pud_ctor); 104 pgtable_cache_add(PUD_CACHE_INDEX, pud_ctor);
105} 105}
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 314d19ab9385..edd8d0bc9364 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -143,11 +143,6 @@ static void reset_numa_cpu_lookup_table(void)
143 numa_cpu_lookup_table[cpu] = -1; 143 numa_cpu_lookup_table[cpu] = -1;
144} 144}
145 145
146static void update_numa_cpu_lookup_table(unsigned int cpu, int node)
147{
148 numa_cpu_lookup_table[cpu] = node;
149}
150
151static void map_cpu_to_node(int cpu, int node) 146static void map_cpu_to_node(int cpu, int node)
152{ 147{
153 update_numa_cpu_lookup_table(cpu, node); 148 update_numa_cpu_lookup_table(cpu, node);
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 573a9a2ee455..2e10a964e290 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -17,9 +17,11 @@
17#include <linux/of_fdt.h> 17#include <linux/of_fdt.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/string_helpers.h> 19#include <linux/string_helpers.h>
20#include <linux/stop_machine.h>
20 21
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
22#include <asm/pgalloc.h> 23#include <asm/pgalloc.h>
24#include <asm/mmu_context.h>
23#include <asm/dma.h> 25#include <asm/dma.h>
24#include <asm/machdep.h> 26#include <asm/machdep.h>
25#include <asm/mmu.h> 27#include <asm/mmu.h>
@@ -333,6 +335,22 @@ static void __init radix_init_pgtable(void)
333 "r" (TLBIEL_INVAL_SET_LPID), "r" (0)); 335 "r" (TLBIEL_INVAL_SET_LPID), "r" (0));
334 asm volatile("eieio; tlbsync; ptesync" : : : "memory"); 336 asm volatile("eieio; tlbsync; ptesync" : : : "memory");
335 trace_tlbie(0, 0, TLBIEL_INVAL_SET_LPID, 0, 2, 1, 1); 337 trace_tlbie(0, 0, TLBIEL_INVAL_SET_LPID, 0, 2, 1, 1);
338
339 /*
340 * The init_mm context is given the first available (non-zero) PID,
341 * which is the "guard PID" and contains no page table. PIDR should
342 * never be set to zero because that duplicates the kernel address
343 * space at the 0x0... offset (quadrant 0)!
344 *
345 * An arbitrary PID that may later be allocated by the PID allocator
346 * for userspace processes must not be used either, because that
347 * would cause stale user mappings for that PID on CPUs outside of
348 * the TLB invalidation scheme (because it won't be in mm_cpumask).
349 *
350 * So permanently carve out one PID for the purpose of a guard PID.
351 */
352 init_mm.context.id = mmu_base_pid;
353 mmu_base_pid++;
336} 354}
337 355
338static void __init radix_init_partition_table(void) 356static void __init radix_init_partition_table(void)
@@ -535,6 +553,7 @@ void __init radix__early_init_mmu(void)
535 __pmd_index_size = RADIX_PMD_INDEX_SIZE; 553 __pmd_index_size = RADIX_PMD_INDEX_SIZE;
536 __pud_index_size = RADIX_PUD_INDEX_SIZE; 554 __pud_index_size = RADIX_PUD_INDEX_SIZE;
537 __pgd_index_size = RADIX_PGD_INDEX_SIZE; 555 __pgd_index_size = RADIX_PGD_INDEX_SIZE;
556 __pud_cache_index = RADIX_PUD_INDEX_SIZE;
538 __pmd_cache_index = RADIX_PMD_INDEX_SIZE; 557 __pmd_cache_index = RADIX_PMD_INDEX_SIZE;
539 __pte_table_size = RADIX_PTE_TABLE_SIZE; 558 __pte_table_size = RADIX_PTE_TABLE_SIZE;
540 __pmd_table_size = RADIX_PMD_TABLE_SIZE; 559 __pmd_table_size = RADIX_PMD_TABLE_SIZE;
@@ -579,7 +598,8 @@ void __init radix__early_init_mmu(void)
579 598
580 radix_init_iamr(); 599 radix_init_iamr();
581 radix_init_pgtable(); 600 radix_init_pgtable();
582 601 /* Switch to the guard PID before turning on MMU */
602 radix__switch_mmu_context(NULL, &init_mm);
583 if (cpu_has_feature(CPU_FTR_HVMODE)) 603 if (cpu_has_feature(CPU_FTR_HVMODE))
584 tlbiel_all(); 604 tlbiel_all();
585} 605}
@@ -604,6 +624,7 @@ void radix__early_init_mmu_secondary(void)
604 } 624 }
605 radix_init_iamr(); 625 radix_init_iamr();
606 626
627 radix__switch_mmu_context(NULL, &init_mm);
607 if (cpu_has_feature(CPU_FTR_HVMODE)) 628 if (cpu_has_feature(CPU_FTR_HVMODE))
608 tlbiel_all(); 629 tlbiel_all();
609} 630}
@@ -666,6 +687,30 @@ static void free_pmd_table(pmd_t *pmd_start, pud_t *pud)
666 pud_clear(pud); 687 pud_clear(pud);
667} 688}
668 689
690struct change_mapping_params {
691 pte_t *pte;
692 unsigned long start;
693 unsigned long end;
694 unsigned long aligned_start;
695 unsigned long aligned_end;
696};
697
698static int stop_machine_change_mapping(void *data)
699{
700 struct change_mapping_params *params =
701 (struct change_mapping_params *)data;
702
703 if (!data)
704 return -1;
705
706 spin_unlock(&init_mm.page_table_lock);
707 pte_clear(&init_mm, params->aligned_start, params->pte);
708 create_physical_mapping(params->aligned_start, params->start);
709 create_physical_mapping(params->end, params->aligned_end);
710 spin_lock(&init_mm.page_table_lock);
711 return 0;
712}
713
669static void remove_pte_table(pte_t *pte_start, unsigned long addr, 714static void remove_pte_table(pte_t *pte_start, unsigned long addr,
670 unsigned long end) 715 unsigned long end)
671{ 716{
@@ -694,6 +739,52 @@ static void remove_pte_table(pte_t *pte_start, unsigned long addr,
694 } 739 }
695} 740}
696 741
742/*
743 * clear the pte and potentially split the mapping helper
744 */
745static void split_kernel_mapping(unsigned long addr, unsigned long end,
746 unsigned long size, pte_t *pte)
747{
748 unsigned long mask = ~(size - 1);
749 unsigned long aligned_start = addr & mask;
750 unsigned long aligned_end = addr + size;
751 struct change_mapping_params params;
752 bool split_region = false;
753
754 if ((end - addr) < size) {
755 /*
756 * We're going to clear the PTE, but not flushed
757 * the mapping, time to remap and flush. The
758 * effects if visible outside the processor or
759 * if we are running in code close to the
760 * mapping we cleared, we are in trouble.
761 */
762 if (overlaps_kernel_text(aligned_start, addr) ||
763 overlaps_kernel_text(end, aligned_end)) {
764 /*
765 * Hack, just return, don't pte_clear
766 */
767 WARN_ONCE(1, "Linear mapping %lx->%lx overlaps kernel "
768 "text, not splitting\n", addr, end);
769 return;
770 }
771 split_region = true;
772 }
773
774 if (split_region) {
775 params.pte = pte;
776 params.start = addr;
777 params.end = end;
778 params.aligned_start = addr & ~(size - 1);
779 params.aligned_end = min_t(unsigned long, aligned_end,
780 (unsigned long)__va(memblock_end_of_DRAM()));
781 stop_machine(stop_machine_change_mapping, &params, NULL);
782 return;
783 }
784
785 pte_clear(&init_mm, addr, pte);
786}
787
697static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr, 788static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
698 unsigned long end) 789 unsigned long end)
699{ 790{
@@ -709,13 +800,7 @@ static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
709 continue; 800 continue;
710 801
711 if (pmd_huge(*pmd)) { 802 if (pmd_huge(*pmd)) {
712 if (!IS_ALIGNED(addr, PMD_SIZE) || 803 split_kernel_mapping(addr, end, PMD_SIZE, (pte_t *)pmd);
713 !IS_ALIGNED(next, PMD_SIZE)) {
714 WARN_ONCE(1, "%s: unaligned range\n", __func__);
715 continue;
716 }
717
718 pte_clear(&init_mm, addr, (pte_t *)pmd);
719 continue; 804 continue;
720 } 805 }
721 806
@@ -740,13 +825,7 @@ static void remove_pud_table(pud_t *pud_start, unsigned long addr,
740 continue; 825 continue;
741 826
742 if (pud_huge(*pud)) { 827 if (pud_huge(*pud)) {
743 if (!IS_ALIGNED(addr, PUD_SIZE) || 828 split_kernel_mapping(addr, end, PUD_SIZE, (pte_t *)pud);
744 !IS_ALIGNED(next, PUD_SIZE)) {
745 WARN_ONCE(1, "%s: unaligned range\n", __func__);
746 continue;
747 }
748
749 pte_clear(&init_mm, addr, (pte_t *)pud);
750 continue; 829 continue;
751 } 830 }
752 831
@@ -772,13 +851,7 @@ static void remove_pagetable(unsigned long start, unsigned long end)
772 continue; 851 continue;
773 852
774 if (pgd_huge(*pgd)) { 853 if (pgd_huge(*pgd)) {
775 if (!IS_ALIGNED(addr, PGDIR_SIZE) || 854 split_kernel_mapping(addr, end, PGDIR_SIZE, (pte_t *)pgd);
776 !IS_ALIGNED(next, PGDIR_SIZE)) {
777 WARN_ONCE(1, "%s: unaligned range\n", __func__);
778 continue;
779 }
780
781 pte_clear(&init_mm, addr, (pte_t *)pgd);
782 continue; 855 continue;
783 } 856 }
784 857
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index c9a623c2d8a2..28c980eb4422 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -82,6 +82,8 @@ unsigned long __pgd_index_size;
82EXPORT_SYMBOL(__pgd_index_size); 82EXPORT_SYMBOL(__pgd_index_size);
83unsigned long __pmd_cache_index; 83unsigned long __pmd_cache_index;
84EXPORT_SYMBOL(__pmd_cache_index); 84EXPORT_SYMBOL(__pmd_cache_index);
85unsigned long __pud_cache_index;
86EXPORT_SYMBOL(__pud_cache_index);
85unsigned long __pte_table_size; 87unsigned long __pte_table_size;
86EXPORT_SYMBOL(__pte_table_size); 88EXPORT_SYMBOL(__pte_table_size);
87unsigned long __pmd_table_size; 89unsigned long __pmd_table_size;
@@ -471,6 +473,8 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0,
471 if (old & PATB_HR) { 473 if (old & PATB_HR) {
472 asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : 474 asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : :
473 "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); 475 "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));
476 asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : :
477 "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));
474 trace_tlbie(lpid, 0, TLBIEL_INVAL_SET_LPID, lpid, 2, 0, 1); 478 trace_tlbie(lpid, 0, TLBIEL_INVAL_SET_LPID, lpid, 2, 0, 1);
475 } else { 479 } else {
476 asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : : 480 asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : :
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 881ebd53ffc2..9b23f12e863c 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -51,7 +51,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
51 unsigned int psize; 51 unsigned int psize;
52 int ssize; 52 int ssize;
53 real_pte_t rpte; 53 real_pte_t rpte;
54 int i; 54 int i, offset;
55 55
56 i = batch->index; 56 i = batch->index;
57 57
@@ -67,6 +67,10 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
67 psize = get_slice_psize(mm, addr); 67 psize = get_slice_psize(mm, addr);
68 /* Mask the address for the correct page size */ 68 /* Mask the address for the correct page size */
69 addr &= ~((1UL << mmu_psize_defs[psize].shift) - 1); 69 addr &= ~((1UL << mmu_psize_defs[psize].shift) - 1);
70 if (unlikely(psize == MMU_PAGE_16G))
71 offset = PTRS_PER_PUD;
72 else
73 offset = PTRS_PER_PMD;
70#else 74#else
71 BUG(); 75 BUG();
72 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */ 76 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */
@@ -78,6 +82,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
78 * support 64k pages, this might be different from the 82 * support 64k pages, this might be different from the
79 * hardware page size encoded in the slice table. */ 83 * hardware page size encoded in the slice table. */
80 addr &= PAGE_MASK; 84 addr &= PAGE_MASK;
85 offset = PTRS_PER_PTE;
81 } 86 }
82 87
83 88
@@ -91,7 +96,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
91 } 96 }
92 WARN_ON(vsid == 0); 97 WARN_ON(vsid == 0);
93 vpn = hpt_vpn(addr, vsid, ssize); 98 vpn = hpt_vpn(addr, vsid, ssize);
94 rpte = __real_pte(__pte(pte), ptep); 99 rpte = __real_pte(__pte(pte), ptep, offset);
95 100
96 /* 101 /*
97 * Check if we have an active batch on this CPU. If not, just 102 * Check if we have an active batch on this CPU. If not, just
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 872d1f6dd11e..a9636d8cba15 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -327,6 +327,9 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
327 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); 327 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4);
328 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len)); 328 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len));
329 break; 329 break;
330 case BPF_LDX | BPF_W | BPF_ABS: /* A = *((u32 *)(seccomp_data + K)); */
331 PPC_LWZ_OFFS(r_A, r_skb, K);
332 break;
330 case BPF_LDX | BPF_W | BPF_LEN: /* X = skb->len; */ 333 case BPF_LDX | BPF_W | BPF_LEN: /* X = skb->len; */
331 PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff, len)); 334 PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff, len));
332 break; 335 break;
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index dd4c9b8b8a81..f6f55ab4980e 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -199,9 +199,11 @@ static void disable_nest_pmu_counters(void)
199 const struct cpumask *l_cpumask; 199 const struct cpumask *l_cpumask;
200 200
201 get_online_cpus(); 201 get_online_cpus();
202 for_each_online_node(nid) { 202 for_each_node_with_cpus(nid) {
203 l_cpumask = cpumask_of_node(nid); 203 l_cpumask = cpumask_of_node(nid);
204 cpu = cpumask_first(l_cpumask); 204 cpu = cpumask_first_and(l_cpumask, cpu_online_mask);
205 if (cpu >= nr_cpu_ids)
206 continue;
205 opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST, 207 opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST,
206 get_hard_smp_processor_id(cpu)); 208 get_hard_smp_processor_id(cpu));
207 } 209 }
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 496e47696ed0..a6c92c78c9b2 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1854,7 +1854,7 @@ static int pnv_pci_ioda_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
1854 s64 rc; 1854 s64 rc;
1855 1855
1856 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) 1856 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE))
1857 return -ENODEV;; 1857 return -ENODEV;
1858 1858
1859 pe = &phb->ioda.pe_array[pdn->pe_number]; 1859 pe = &phb->ioda.pe_array[pdn->pe_number];
1860 if (pe->tce_bypass_enabled) { 1860 if (pe->tce_bypass_enabled) {
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 4fb21e17504a..092715b9674b 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -80,6 +80,10 @@ static void pnv_setup_rfi_flush(void)
80 if (np && of_property_read_bool(np, "disabled")) 80 if (np && of_property_read_bool(np, "disabled"))
81 enable--; 81 enable--;
82 82
83 np = of_get_child_by_name(fw_features, "speculation-policy-favor-security");
84 if (np && of_property_read_bool(np, "disabled"))
85 enable = 0;
86
83 of_node_put(np); 87 of_node_put(np);
84 of_node_put(fw_features); 88 of_node_put(fw_features);
85 } 89 }
diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
index 2b3eb01ab110..b7c53a51c31b 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -1063,16 +1063,16 @@ struct vas_window *vas_tx_win_open(int vasid, enum vas_cop_type cop,
1063 rc = PTR_ERR(txwin->paste_kaddr); 1063 rc = PTR_ERR(txwin->paste_kaddr);
1064 goto free_window; 1064 goto free_window;
1065 } 1065 }
1066 } else {
1067 /*
1068 * A user mapping must ensure that context switch issues
1069 * CP_ABORT for this thread.
1070 */
1071 rc = set_thread_uses_vas();
1072 if (rc)
1073 goto free_window;
1066 } 1074 }
1067 1075
1068 /*
1069 * Now that we have a send window, ensure context switch issues
1070 * CP_ABORT for this thread.
1071 */
1072 rc = -EINVAL;
1073 if (set_thread_uses_vas() < 0)
1074 goto free_window;
1075
1076 set_vinst_win(vinst, txwin); 1076 set_vinst_win(vinst, txwin);
1077 1077
1078 return txwin; 1078 return txwin;
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index dceb51454d8d..652d3e96b812 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -36,6 +36,7 @@
36#include <asm/xics.h> 36#include <asm/xics.h>
37#include <asm/xive.h> 37#include <asm/xive.h>
38#include <asm/plpar_wrappers.h> 38#include <asm/plpar_wrappers.h>
39#include <asm/topology.h>
39 40
40#include "pseries.h" 41#include "pseries.h"
41#include "offline_states.h" 42#include "offline_states.h"
@@ -331,6 +332,7 @@ static void pseries_remove_processor(struct device_node *np)
331 BUG_ON(cpu_online(cpu)); 332 BUG_ON(cpu_online(cpu));
332 set_cpu_present(cpu, false); 333 set_cpu_present(cpu, false);
333 set_hard_smp_processor_id(cpu, -1); 334 set_hard_smp_processor_id(cpu, -1);
335 update_numa_cpu_lookup_table(cpu, -1);
334 break; 336 break;
335 } 337 }
336 if (cpu >= nr_cpu_ids) 338 if (cpu >= nr_cpu_ids)
@@ -340,8 +342,6 @@ static void pseries_remove_processor(struct device_node *np)
340 cpu_maps_update_done(); 342 cpu_maps_update_done();
341} 343}
342 344
343extern int find_and_online_cpu_nid(int cpu);
344
345static int dlpar_online_cpu(struct device_node *dn) 345static int dlpar_online_cpu(struct device_node *dn)
346{ 346{
347 int rc = 0; 347 int rc = 0;
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 81d8614e7379..5e1ef9150182 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -49,6 +49,28 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id);
49 49
50 50
51/* 51/*
52 * Enable the hotplug interrupt late because processing them may touch other
53 * devices or systems (e.g. hugepages) that have not been initialized at the
54 * subsys stage.
55 */
56int __init init_ras_hotplug_IRQ(void)
57{
58 struct device_node *np;
59
60 /* Hotplug Events */
61 np = of_find_node_by_path("/event-sources/hot-plug-events");
62 if (np != NULL) {
63 if (dlpar_workqueue_init() == 0)
64 request_event_sources_irqs(np, ras_hotplug_interrupt,
65 "RAS_HOTPLUG");
66 of_node_put(np);
67 }
68
69 return 0;
70}
71machine_late_initcall(pseries, init_ras_hotplug_IRQ);
72
73/*
52 * Initialize handlers for the set of interrupts caused by hardware errors 74 * Initialize handlers for the set of interrupts caused by hardware errors
53 * and power system events. 75 * and power system events.
54 */ 76 */
@@ -66,15 +88,6 @@ static int __init init_ras_IRQ(void)
66 of_node_put(np); 88 of_node_put(np);
67 } 89 }
68 90
69 /* Hotplug Events */
70 np = of_find_node_by_path("/event-sources/hot-plug-events");
71 if (np != NULL) {
72 if (dlpar_workqueue_init() == 0)
73 request_event_sources_irqs(np, ras_hotplug_interrupt,
74 "RAS_HOTPLUG");
75 of_node_put(np);
76 }
77
78 /* EPOW Events */ 91 /* EPOW Events */
79 np = of_find_node_by_path("/event-sources/epow-events"); 92 np = of_find_node_by_path("/event-sources/epow-events");
80 if (np != NULL) { 93 if (np != NULL) {
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 372d7ada1a0c..1a527625acf7 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -482,7 +482,8 @@ static void pseries_setup_rfi_flush(void)
482 if (types == L1D_FLUSH_NONE) 482 if (types == L1D_FLUSH_NONE)
483 types = L1D_FLUSH_FALLBACK; 483 types = L1D_FLUSH_FALLBACK;
484 484
485 if (!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) 485 if ((!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) ||
486 (!(result.behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)))
486 enable = false; 487 enable = false;
487 } else { 488 } else {
488 /* Default to fallback if case hcall is not available */ 489 /* Default to fallback if case hcall is not available */
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index d9c4c9366049..091f1d0d0af1 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -356,7 +356,8 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
356 356
357 rc = plpar_int_get_queue_info(0, target, prio, &esn_page, &esn_size); 357 rc = plpar_int_get_queue_info(0, target, prio, &esn_page, &esn_size);
358 if (rc) { 358 if (rc) {
359 pr_err("Error %lld getting queue info prio %d\n", rc, prio); 359 pr_err("Error %lld getting queue info CPU %d prio %d\n", rc,
360 target, prio);
360 rc = -EIO; 361 rc = -EIO;
361 goto fail; 362 goto fail;
362 } 363 }
@@ -370,7 +371,8 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
370 /* Configure and enable the queue in HW */ 371 /* Configure and enable the queue in HW */
371 rc = plpar_int_set_queue_config(flags, target, prio, qpage_phys, order); 372 rc = plpar_int_set_queue_config(flags, target, prio, qpage_phys, order);
372 if (rc) { 373 if (rc) {
373 pr_err("Error %lld setting queue for prio %d\n", rc, prio); 374 pr_err("Error %lld setting queue for CPU %d prio %d\n", rc,
375 target, prio);
374 rc = -EIO; 376 rc = -EIO;
375 } else { 377 } else {
376 q->qpage = qpage; 378 q->qpage = qpage;
@@ -389,8 +391,8 @@ static int xive_spapr_setup_queue(unsigned int cpu, struct xive_cpu *xc,
389 if (IS_ERR(qpage)) 391 if (IS_ERR(qpage))
390 return PTR_ERR(qpage); 392 return PTR_ERR(qpage);
391 393
392 return xive_spapr_configure_queue(cpu, q, prio, qpage, 394 return xive_spapr_configure_queue(get_hard_smp_processor_id(cpu),
393 xive_queue_shift); 395 q, prio, qpage, xive_queue_shift);
394} 396}
395 397
396static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc, 398static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc,
@@ -399,10 +401,12 @@ static void xive_spapr_cleanup_queue(unsigned int cpu, struct xive_cpu *xc,
399 struct xive_q *q = &xc->queue[prio]; 401 struct xive_q *q = &xc->queue[prio];
400 unsigned int alloc_order; 402 unsigned int alloc_order;
401 long rc; 403 long rc;
404 int hw_cpu = get_hard_smp_processor_id(cpu);
402 405
403 rc = plpar_int_set_queue_config(0, cpu, prio, 0, 0); 406 rc = plpar_int_set_queue_config(0, hw_cpu, prio, 0, 0);
404 if (rc) 407 if (rc)
405 pr_err("Error %ld setting queue for prio %d\n", rc, prio); 408 pr_err("Error %ld setting queue for CPU %d prio %d\n", rc,
409 hw_cpu, prio);
406 410
407 alloc_order = xive_alloc_order(xive_queue_shift); 411 alloc_order = xive_alloc_order(xive_queue_shift);
408 free_pages((unsigned long)q->qpage, alloc_order); 412 free_pages((unsigned long)q->qpage, alloc_order);
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index b6722c246d9c..04807c7f64cc 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -8,7 +8,6 @@ config RISCV
8 select OF 8 select OF
9 select OF_EARLY_FLATTREE 9 select OF_EARLY_FLATTREE
10 select OF_IRQ 10 select OF_IRQ
11 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
12 select ARCH_WANT_FRAME_POINTERS 11 select ARCH_WANT_FRAME_POINTERS
13 select CLONE_BACKWARDS 12 select CLONE_BACKWARDS
14 select COMMON_CLK 13 select COMMON_CLK
@@ -20,7 +19,6 @@ config RISCV
20 select GENERIC_STRNLEN_USER 19 select GENERIC_STRNLEN_USER
21 select GENERIC_SMP_IDLE_THREAD 20 select GENERIC_SMP_IDLE_THREAD
22 select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A 21 select GENERIC_ATOMIC64 if !64BIT || !RISCV_ISA_A
23 select ARCH_WANT_OPTIONAL_GPIOLIB
24 select HAVE_MEMBLOCK 22 select HAVE_MEMBLOCK
25 select HAVE_MEMBLOCK_NODE_MAP 23 select HAVE_MEMBLOCK_NODE_MAP
26 select HAVE_DMA_API_DEBUG 24 select HAVE_DMA_API_DEBUG
@@ -34,7 +32,6 @@ config RISCV
34 select HAVE_ARCH_TRACEHOOK 32 select HAVE_ARCH_TRACEHOOK
35 select MODULES_USE_ELF_RELA if MODULES 33 select MODULES_USE_ELF_RELA if MODULES
36 select THREAD_INFO_IN_TASK 34 select THREAD_INFO_IN_TASK
37 select RISCV_IRQ_INTC
38 select RISCV_TIMER 35 select RISCV_TIMER
39 36
40config MMU 37config MMU
diff --git a/arch/riscv/include/asm/barrier.h b/arch/riscv/include/asm/barrier.h
index c0319cbf1eec..5510366d169a 100644
--- a/arch/riscv/include/asm/barrier.h
+++ b/arch/riscv/include/asm/barrier.h
@@ -34,9 +34,9 @@
34#define wmb() RISCV_FENCE(ow,ow) 34#define wmb() RISCV_FENCE(ow,ow)
35 35
36/* These barriers do not need to enforce ordering on devices, just memory. */ 36/* These barriers do not need to enforce ordering on devices, just memory. */
37#define smp_mb() RISCV_FENCE(rw,rw) 37#define __smp_mb() RISCV_FENCE(rw,rw)
38#define smp_rmb() RISCV_FENCE(r,r) 38#define __smp_rmb() RISCV_FENCE(r,r)
39#define smp_wmb() RISCV_FENCE(w,w) 39#define __smp_wmb() RISCV_FENCE(w,w)
40 40
41/* 41/*
42 * This is a very specific barrier: it's currently only used in two places in 42 * This is a very specific barrier: it's currently only used in two places in
diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 87fc045be51f..56fa592cfa34 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -172,6 +172,9 @@ ENTRY(handle_exception)
172 move a1, sp /* pt_regs */ 172 move a1, sp /* pt_regs */
173 tail do_IRQ 173 tail do_IRQ
1741: 1741:
175 /* Exceptions run with interrupts enabled */
176 csrs sstatus, SR_SIE
177
175 /* Handle syscalls */ 178 /* Handle syscalls */
176 li t0, EXC_SYSCALL 179 li t0, EXC_SYSCALL
177 beq s4, t0, handle_syscall 180 beq s4, t0, handle_syscall
@@ -198,8 +201,6 @@ handle_syscall:
198 */ 201 */
199 addi s2, s2, 0x4 202 addi s2, s2, 0x4
200 REG_S s2, PT_SEPC(sp) 203 REG_S s2, PT_SEPC(sp)
201 /* System calls run with interrupts enabled */
202 csrs sstatus, SR_SIE
203 /* Trace syscalls, but only if requested by the user. */ 204 /* Trace syscalls, but only if requested by the user. */
204 REG_L t0, TASK_TI_FLAGS(tp) 205 REG_L t0, TASK_TI_FLAGS(tp)
205 andi t0, t0, _TIF_SYSCALL_TRACE 206 andi t0, t0, _TIF_SYSCALL_TRACE
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 226eeb190f90..6e07ed37bbff 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -64,7 +64,7 @@ ENTRY(_start)
64 /* Start the kernel */ 64 /* Start the kernel */
65 mv a0, s0 65 mv a0, s0
66 mv a1, s1 66 mv a1, s1
67 call sbi_save 67 call parse_dtb
68 tail start_kernel 68 tail start_kernel
69 69
70relocate: 70relocate:
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 09f7064e898c..c11f40c1b2a8 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -144,7 +144,7 @@ asmlinkage void __init setup_vm(void)
144#endif 144#endif
145} 145}
146 146
147void __init sbi_save(unsigned int hartid, void *dtb) 147void __init parse_dtb(unsigned int hartid, void *dtb)
148{ 148{
149 early_init_dt_scan(__va(dtb)); 149 early_init_dt_scan(__va(dtb));
150} 150}
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index 9c7d70715862..07c6e81163bf 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -22,22 +22,6 @@
22#include "trace.h" 22#include "trace.h"
23#include "trace-s390.h" 23#include "trace-s390.h"
24 24
25
26static const intercept_handler_t instruction_handlers[256] = {
27 [0x01] = kvm_s390_handle_01,
28 [0x82] = kvm_s390_handle_lpsw,
29 [0x83] = kvm_s390_handle_diag,
30 [0xaa] = kvm_s390_handle_aa,
31 [0xae] = kvm_s390_handle_sigp,
32 [0xb2] = kvm_s390_handle_b2,
33 [0xb6] = kvm_s390_handle_stctl,
34 [0xb7] = kvm_s390_handle_lctl,
35 [0xb9] = kvm_s390_handle_b9,
36 [0xe3] = kvm_s390_handle_e3,
37 [0xe5] = kvm_s390_handle_e5,
38 [0xeb] = kvm_s390_handle_eb,
39};
40
41u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu) 25u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu)
42{ 26{
43 struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block; 27 struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block;
@@ -129,16 +113,39 @@ static int handle_validity(struct kvm_vcpu *vcpu)
129 113
130static int handle_instruction(struct kvm_vcpu *vcpu) 114static int handle_instruction(struct kvm_vcpu *vcpu)
131{ 115{
132 intercept_handler_t handler;
133
134 vcpu->stat.exit_instruction++; 116 vcpu->stat.exit_instruction++;
135 trace_kvm_s390_intercept_instruction(vcpu, 117 trace_kvm_s390_intercept_instruction(vcpu,
136 vcpu->arch.sie_block->ipa, 118 vcpu->arch.sie_block->ipa,
137 vcpu->arch.sie_block->ipb); 119 vcpu->arch.sie_block->ipb);
138 handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8]; 120
139 if (handler) 121 switch (vcpu->arch.sie_block->ipa >> 8) {
140 return handler(vcpu); 122 case 0x01:
141 return -EOPNOTSUPP; 123 return kvm_s390_handle_01(vcpu);
124 case 0x82:
125 return kvm_s390_handle_lpsw(vcpu);
126 case 0x83:
127 return kvm_s390_handle_diag(vcpu);
128 case 0xaa:
129 return kvm_s390_handle_aa(vcpu);
130 case 0xae:
131 return kvm_s390_handle_sigp(vcpu);
132 case 0xb2:
133 return kvm_s390_handle_b2(vcpu);
134 case 0xb6:
135 return kvm_s390_handle_stctl(vcpu);
136 case 0xb7:
137 return kvm_s390_handle_lctl(vcpu);
138 case 0xb9:
139 return kvm_s390_handle_b9(vcpu);
140 case 0xe3:
141 return kvm_s390_handle_e3(vcpu);
142 case 0xe5:
143 return kvm_s390_handle_e5(vcpu);
144 case 0xeb:
145 return kvm_s390_handle_eb(vcpu);
146 default:
147 return -EOPNOTSUPP;
148 }
142} 149}
143 150
144static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu) 151static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index aabf46f5f883..b04616b57a94 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -169,8 +169,15 @@ static int ckc_interrupts_enabled(struct kvm_vcpu *vcpu)
169 169
170static int ckc_irq_pending(struct kvm_vcpu *vcpu) 170static int ckc_irq_pending(struct kvm_vcpu *vcpu)
171{ 171{
172 if (vcpu->arch.sie_block->ckc >= kvm_s390_get_tod_clock_fast(vcpu->kvm)) 172 const u64 now = kvm_s390_get_tod_clock_fast(vcpu->kvm);
173 const u64 ckc = vcpu->arch.sie_block->ckc;
174
175 if (vcpu->arch.sie_block->gcr[0] & 0x0020000000000000ul) {
176 if ((s64)ckc >= (s64)now)
177 return 0;
178 } else if (ckc >= now) {
173 return 0; 179 return 0;
180 }
174 return ckc_interrupts_enabled(vcpu); 181 return ckc_interrupts_enabled(vcpu);
175} 182}
176 183
@@ -187,12 +194,6 @@ static int cpu_timer_irq_pending(struct kvm_vcpu *vcpu)
187 return kvm_s390_get_cpu_timer(vcpu) >> 63; 194 return kvm_s390_get_cpu_timer(vcpu) >> 63;
188} 195}
189 196
190static inline int is_ioirq(unsigned long irq_type)
191{
192 return ((irq_type >= IRQ_PEND_IO_ISC_7) &&
193 (irq_type <= IRQ_PEND_IO_ISC_0));
194}
195
196static uint64_t isc_to_isc_bits(int isc) 197static uint64_t isc_to_isc_bits(int isc)
197{ 198{
198 return (0x80 >> isc) << 24; 199 return (0x80 >> isc) << 24;
@@ -236,10 +237,15 @@ static inline int kvm_s390_gisa_tac_ipm_gisc(struct kvm_s390_gisa *gisa, u32 gis
236 return test_and_clear_bit_inv(IPM_BIT_OFFSET + gisc, (unsigned long *) gisa); 237 return test_and_clear_bit_inv(IPM_BIT_OFFSET + gisc, (unsigned long *) gisa);
237} 238}
238 239
239static inline unsigned long pending_irqs(struct kvm_vcpu *vcpu) 240static inline unsigned long pending_irqs_no_gisa(struct kvm_vcpu *vcpu)
240{ 241{
241 return vcpu->kvm->arch.float_int.pending_irqs | 242 return vcpu->kvm->arch.float_int.pending_irqs |
242 vcpu->arch.local_int.pending_irqs | 243 vcpu->arch.local_int.pending_irqs;
244}
245
246static inline unsigned long pending_irqs(struct kvm_vcpu *vcpu)
247{
248 return pending_irqs_no_gisa(vcpu) |
243 kvm_s390_gisa_get_ipm(vcpu->kvm->arch.gisa) << IRQ_PEND_IO_ISC_7; 249 kvm_s390_gisa_get_ipm(vcpu->kvm->arch.gisa) << IRQ_PEND_IO_ISC_7;
244} 250}
245 251
@@ -337,7 +343,7 @@ static void __reset_intercept_indicators(struct kvm_vcpu *vcpu)
337 343
338static void set_intercept_indicators_io(struct kvm_vcpu *vcpu) 344static void set_intercept_indicators_io(struct kvm_vcpu *vcpu)
339{ 345{
340 if (!(pending_irqs(vcpu) & IRQ_PEND_IO_MASK)) 346 if (!(pending_irqs_no_gisa(vcpu) & IRQ_PEND_IO_MASK))
341 return; 347 return;
342 else if (psw_ioint_disabled(vcpu)) 348 else if (psw_ioint_disabled(vcpu))
343 kvm_s390_set_cpuflags(vcpu, CPUSTAT_IO_INT); 349 kvm_s390_set_cpuflags(vcpu, CPUSTAT_IO_INT);
@@ -1011,24 +1017,6 @@ out:
1011 return rc; 1017 return rc;
1012} 1018}
1013 1019
1014typedef int (*deliver_irq_t)(struct kvm_vcpu *vcpu);
1015
1016static const deliver_irq_t deliver_irq_funcs[] = {
1017 [IRQ_PEND_MCHK_EX] = __deliver_machine_check,
1018 [IRQ_PEND_MCHK_REP] = __deliver_machine_check,
1019 [IRQ_PEND_PROG] = __deliver_prog,
1020 [IRQ_PEND_EXT_EMERGENCY] = __deliver_emergency_signal,
1021 [IRQ_PEND_EXT_EXTERNAL] = __deliver_external_call,
1022 [IRQ_PEND_EXT_CLOCK_COMP] = __deliver_ckc,
1023 [IRQ_PEND_EXT_CPU_TIMER] = __deliver_cpu_timer,
1024 [IRQ_PEND_RESTART] = __deliver_restart,
1025 [IRQ_PEND_SET_PREFIX] = __deliver_set_prefix,
1026 [IRQ_PEND_PFAULT_INIT] = __deliver_pfault_init,
1027 [IRQ_PEND_EXT_SERVICE] = __deliver_service,
1028 [IRQ_PEND_PFAULT_DONE] = __deliver_pfault_done,
1029 [IRQ_PEND_VIRTIO] = __deliver_virtio,
1030};
1031
1032/* Check whether an external call is pending (deliverable or not) */ 1020/* Check whether an external call is pending (deliverable or not) */
1033int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu) 1021int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu)
1034{ 1022{
@@ -1066,13 +1054,19 @@ int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
1066 1054
1067static u64 __calculate_sltime(struct kvm_vcpu *vcpu) 1055static u64 __calculate_sltime(struct kvm_vcpu *vcpu)
1068{ 1056{
1069 u64 now, cputm, sltime = 0; 1057 const u64 now = kvm_s390_get_tod_clock_fast(vcpu->kvm);
1058 const u64 ckc = vcpu->arch.sie_block->ckc;
1059 u64 cputm, sltime = 0;
1070 1060
1071 if (ckc_interrupts_enabled(vcpu)) { 1061 if (ckc_interrupts_enabled(vcpu)) {
1072 now = kvm_s390_get_tod_clock_fast(vcpu->kvm); 1062 if (vcpu->arch.sie_block->gcr[0] & 0x0020000000000000ul) {
1073 sltime = tod_to_ns(vcpu->arch.sie_block->ckc - now); 1063 if ((s64)now < (s64)ckc)
1074 /* already expired or overflow? */ 1064 sltime = tod_to_ns((s64)ckc - (s64)now);
1075 if (!sltime || vcpu->arch.sie_block->ckc <= now) 1065 } else if (now < ckc) {
1066 sltime = tod_to_ns(ckc - now);
1067 }
1068 /* already expired */
1069 if (!sltime)
1076 return 0; 1070 return 0;
1077 if (cpu_timer_interrupts_enabled(vcpu)) { 1071 if (cpu_timer_interrupts_enabled(vcpu)) {
1078 cputm = kvm_s390_get_cpu_timer(vcpu); 1072 cputm = kvm_s390_get_cpu_timer(vcpu);
@@ -1192,7 +1186,6 @@ void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu)
1192int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) 1186int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
1193{ 1187{
1194 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; 1188 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
1195 deliver_irq_t func;
1196 int rc = 0; 1189 int rc = 0;
1197 unsigned long irq_type; 1190 unsigned long irq_type;
1198 unsigned long irqs; 1191 unsigned long irqs;
@@ -1212,16 +1205,57 @@ int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
1212 while ((irqs = deliverable_irqs(vcpu)) && !rc) { 1205 while ((irqs = deliverable_irqs(vcpu)) && !rc) {
1213 /* bits are in the reverse order of interrupt priority */ 1206 /* bits are in the reverse order of interrupt priority */
1214 irq_type = find_last_bit(&irqs, IRQ_PEND_COUNT); 1207 irq_type = find_last_bit(&irqs, IRQ_PEND_COUNT);
1215 if (is_ioirq(irq_type)) { 1208 switch (irq_type) {
1209 case IRQ_PEND_IO_ISC_0:
1210 case IRQ_PEND_IO_ISC_1:
1211 case IRQ_PEND_IO_ISC_2:
1212 case IRQ_PEND_IO_ISC_3:
1213 case IRQ_PEND_IO_ISC_4:
1214 case IRQ_PEND_IO_ISC_5:
1215 case IRQ_PEND_IO_ISC_6:
1216 case IRQ_PEND_IO_ISC_7:
1216 rc = __deliver_io(vcpu, irq_type); 1217 rc = __deliver_io(vcpu, irq_type);
1217 } else { 1218 break;
1218 func = deliver_irq_funcs[irq_type]; 1219 case IRQ_PEND_MCHK_EX:
1219 if (!func) { 1220 case IRQ_PEND_MCHK_REP:
1220 WARN_ON_ONCE(func == NULL); 1221 rc = __deliver_machine_check(vcpu);
1221 clear_bit(irq_type, &li->pending_irqs); 1222 break;
1222 continue; 1223 case IRQ_PEND_PROG:
1223 } 1224 rc = __deliver_prog(vcpu);
1224 rc = func(vcpu); 1225 break;
1226 case IRQ_PEND_EXT_EMERGENCY:
1227 rc = __deliver_emergency_signal(vcpu);
1228 break;
1229 case IRQ_PEND_EXT_EXTERNAL:
1230 rc = __deliver_external_call(vcpu);
1231 break;
1232 case IRQ_PEND_EXT_CLOCK_COMP:
1233 rc = __deliver_ckc(vcpu);
1234 break;
1235 case IRQ_PEND_EXT_CPU_TIMER:
1236 rc = __deliver_cpu_timer(vcpu);
1237 break;
1238 case IRQ_PEND_RESTART:
1239 rc = __deliver_restart(vcpu);
1240 break;
1241 case IRQ_PEND_SET_PREFIX:
1242 rc = __deliver_set_prefix(vcpu);
1243 break;
1244 case IRQ_PEND_PFAULT_INIT:
1245 rc = __deliver_pfault_init(vcpu);
1246 break;
1247 case IRQ_PEND_EXT_SERVICE:
1248 rc = __deliver_service(vcpu);
1249 break;
1250 case IRQ_PEND_PFAULT_DONE:
1251 rc = __deliver_pfault_done(vcpu);
1252 break;
1253 case IRQ_PEND_VIRTIO:
1254 rc = __deliver_virtio(vcpu);
1255 break;
1256 default:
1257 WARN_ONCE(1, "Unknown pending irq type %ld", irq_type);
1258 clear_bit(irq_type, &li->pending_irqs);
1225 } 1259 }
1226 } 1260 }
1227 1261
@@ -1701,7 +1735,8 @@ static void __floating_irq_kick(struct kvm *kvm, u64 type)
1701 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_STOP_INT); 1735 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_STOP_INT);
1702 break; 1736 break;
1703 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX: 1737 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
1704 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT); 1738 if (!(type & KVM_S390_INT_IO_AI_MASK && kvm->arch.gisa))
1739 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT);
1705 break; 1740 break;
1706 default: 1741 default:
1707 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_EXT_INT); 1742 kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_EXT_INT);
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index ba4c7092335a..77d7818130db 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -179,6 +179,28 @@ int kvm_arch_hardware_enable(void)
179static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start, 179static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start,
180 unsigned long end); 180 unsigned long end);
181 181
182static void kvm_clock_sync_scb(struct kvm_s390_sie_block *scb, u64 delta)
183{
184 u8 delta_idx = 0;
185
186 /*
187 * The TOD jumps by delta, we have to compensate this by adding
188 * -delta to the epoch.
189 */
190 delta = -delta;
191
192 /* sign-extension - we're adding to signed values below */
193 if ((s64)delta < 0)
194 delta_idx = -1;
195
196 scb->epoch += delta;
197 if (scb->ecd & ECD_MEF) {
198 scb->epdx += delta_idx;
199 if (scb->epoch < delta)
200 scb->epdx += 1;
201 }
202}
203
182/* 204/*
183 * This callback is executed during stop_machine(). All CPUs are therefore 205 * This callback is executed during stop_machine(). All CPUs are therefore
184 * temporarily stopped. In order not to change guest behavior, we have to 206 * temporarily stopped. In order not to change guest behavior, we have to
@@ -194,13 +216,17 @@ static int kvm_clock_sync(struct notifier_block *notifier, unsigned long val,
194 unsigned long long *delta = v; 216 unsigned long long *delta = v;
195 217
196 list_for_each_entry(kvm, &vm_list, vm_list) { 218 list_for_each_entry(kvm, &vm_list, vm_list) {
197 kvm->arch.epoch -= *delta;
198 kvm_for_each_vcpu(i, vcpu, kvm) { 219 kvm_for_each_vcpu(i, vcpu, kvm) {
199 vcpu->arch.sie_block->epoch -= *delta; 220 kvm_clock_sync_scb(vcpu->arch.sie_block, *delta);
221 if (i == 0) {
222 kvm->arch.epoch = vcpu->arch.sie_block->epoch;
223 kvm->arch.epdx = vcpu->arch.sie_block->epdx;
224 }
200 if (vcpu->arch.cputm_enabled) 225 if (vcpu->arch.cputm_enabled)
201 vcpu->arch.cputm_start += *delta; 226 vcpu->arch.cputm_start += *delta;
202 if (vcpu->arch.vsie_block) 227 if (vcpu->arch.vsie_block)
203 vcpu->arch.vsie_block->epoch -= *delta; 228 kvm_clock_sync_scb(vcpu->arch.vsie_block,
229 *delta);
204 } 230 }
205 } 231 }
206 return NOTIFY_OK; 232 return NOTIFY_OK;
@@ -902,12 +928,9 @@ static int kvm_s390_set_tod_ext(struct kvm *kvm, struct kvm_device_attr *attr)
902 if (copy_from_user(&gtod, (void __user *)attr->addr, sizeof(gtod))) 928 if (copy_from_user(&gtod, (void __user *)attr->addr, sizeof(gtod)))
903 return -EFAULT; 929 return -EFAULT;
904 930
905 if (test_kvm_facility(kvm, 139)) 931 if (!test_kvm_facility(kvm, 139) && gtod.epoch_idx)
906 kvm_s390_set_tod_clock_ext(kvm, &gtod);
907 else if (gtod.epoch_idx == 0)
908 kvm_s390_set_tod_clock(kvm, gtod.tod);
909 else
910 return -EINVAL; 932 return -EINVAL;
933 kvm_s390_set_tod_clock(kvm, &gtod);
911 934
912 VM_EVENT(kvm, 3, "SET: TOD extension: 0x%x, TOD base: 0x%llx", 935 VM_EVENT(kvm, 3, "SET: TOD extension: 0x%x, TOD base: 0x%llx",
913 gtod.epoch_idx, gtod.tod); 936 gtod.epoch_idx, gtod.tod);
@@ -932,13 +955,14 @@ static int kvm_s390_set_tod_high(struct kvm *kvm, struct kvm_device_attr *attr)
932 955
933static int kvm_s390_set_tod_low(struct kvm *kvm, struct kvm_device_attr *attr) 956static int kvm_s390_set_tod_low(struct kvm *kvm, struct kvm_device_attr *attr)
934{ 957{
935 u64 gtod; 958 struct kvm_s390_vm_tod_clock gtod = { 0 };
936 959
937 if (copy_from_user(&gtod, (void __user *)attr->addr, sizeof(gtod))) 960 if (copy_from_user(&gtod.tod, (void __user *)attr->addr,
961 sizeof(gtod.tod)))
938 return -EFAULT; 962 return -EFAULT;
939 963
940 kvm_s390_set_tod_clock(kvm, gtod); 964 kvm_s390_set_tod_clock(kvm, &gtod);
941 VM_EVENT(kvm, 3, "SET: TOD base: 0x%llx", gtod); 965 VM_EVENT(kvm, 3, "SET: TOD base: 0x%llx", gtod.tod);
942 return 0; 966 return 0;
943} 967}
944 968
@@ -2389,6 +2413,7 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
2389 mutex_lock(&vcpu->kvm->lock); 2413 mutex_lock(&vcpu->kvm->lock);
2390 preempt_disable(); 2414 preempt_disable();
2391 vcpu->arch.sie_block->epoch = vcpu->kvm->arch.epoch; 2415 vcpu->arch.sie_block->epoch = vcpu->kvm->arch.epoch;
2416 vcpu->arch.sie_block->epdx = vcpu->kvm->arch.epdx;
2392 preempt_enable(); 2417 preempt_enable();
2393 mutex_unlock(&vcpu->kvm->lock); 2418 mutex_unlock(&vcpu->kvm->lock);
2394 if (!kvm_is_ucontrol(vcpu->kvm)) { 2419 if (!kvm_is_ucontrol(vcpu->kvm)) {
@@ -3021,8 +3046,8 @@ retry:
3021 return 0; 3046 return 0;
3022} 3047}
3023 3048
3024void kvm_s390_set_tod_clock_ext(struct kvm *kvm, 3049void kvm_s390_set_tod_clock(struct kvm *kvm,
3025 const struct kvm_s390_vm_tod_clock *gtod) 3050 const struct kvm_s390_vm_tod_clock *gtod)
3026{ 3051{
3027 struct kvm_vcpu *vcpu; 3052 struct kvm_vcpu *vcpu;
3028 struct kvm_s390_tod_clock_ext htod; 3053 struct kvm_s390_tod_clock_ext htod;
@@ -3034,10 +3059,12 @@ void kvm_s390_set_tod_clock_ext(struct kvm *kvm,
3034 get_tod_clock_ext((char *)&htod); 3059 get_tod_clock_ext((char *)&htod);
3035 3060
3036 kvm->arch.epoch = gtod->tod - htod.tod; 3061 kvm->arch.epoch = gtod->tod - htod.tod;
3037 kvm->arch.epdx = gtod->epoch_idx - htod.epoch_idx; 3062 kvm->arch.epdx = 0;
3038 3063 if (test_kvm_facility(kvm, 139)) {
3039 if (kvm->arch.epoch > gtod->tod) 3064 kvm->arch.epdx = gtod->epoch_idx - htod.epoch_idx;
3040 kvm->arch.epdx -= 1; 3065 if (kvm->arch.epoch > gtod->tod)
3066 kvm->arch.epdx -= 1;
3067 }
3041 3068
3042 kvm_s390_vcpu_block_all(kvm); 3069 kvm_s390_vcpu_block_all(kvm);
3043 kvm_for_each_vcpu(i, vcpu, kvm) { 3070 kvm_for_each_vcpu(i, vcpu, kvm) {
@@ -3050,22 +3077,6 @@ void kvm_s390_set_tod_clock_ext(struct kvm *kvm,
3050 mutex_unlock(&kvm->lock); 3077 mutex_unlock(&kvm->lock);
3051} 3078}
3052 3079
3053void kvm_s390_set_tod_clock(struct kvm *kvm, u64 tod)
3054{
3055 struct kvm_vcpu *vcpu;
3056 int i;
3057
3058 mutex_lock(&kvm->lock);
3059 preempt_disable();
3060 kvm->arch.epoch = tod - get_tod_clock();
3061 kvm_s390_vcpu_block_all(kvm);
3062 kvm_for_each_vcpu(i, vcpu, kvm)
3063 vcpu->arch.sie_block->epoch = kvm->arch.epoch;
3064 kvm_s390_vcpu_unblock_all(kvm);
3065 preempt_enable();
3066 mutex_unlock(&kvm->lock);
3067}
3068
3069/** 3080/**
3070 * kvm_arch_fault_in_page - fault-in guest page if necessary 3081 * kvm_arch_fault_in_page - fault-in guest page if necessary
3071 * @vcpu: The corresponding virtual cpu 3082 * @vcpu: The corresponding virtual cpu
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index bd31b37b0e6f..f55ac0ef99ea 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -19,8 +19,6 @@
19#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/sclp.h> 20#include <asm/sclp.h>
21 21
22typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu);
23
24/* Transactional Memory Execution related macros */ 22/* Transactional Memory Execution related macros */
25#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & ECB_TE)) 23#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & ECB_TE))
26#define TDB_FORMAT1 1 24#define TDB_FORMAT1 1
@@ -283,9 +281,8 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
283int kvm_s390_handle_sigp_pei(struct kvm_vcpu *vcpu); 281int kvm_s390_handle_sigp_pei(struct kvm_vcpu *vcpu);
284 282
285/* implemented in kvm-s390.c */ 283/* implemented in kvm-s390.c */
286void kvm_s390_set_tod_clock_ext(struct kvm *kvm, 284void kvm_s390_set_tod_clock(struct kvm *kvm,
287 const struct kvm_s390_vm_tod_clock *gtod); 285 const struct kvm_s390_vm_tod_clock *gtod);
288void kvm_s390_set_tod_clock(struct kvm *kvm, u64 tod);
289long kvm_arch_fault_in_page(struct kvm_vcpu *vcpu, gpa_t gpa, int writable); 286long kvm_arch_fault_in_page(struct kvm_vcpu *vcpu, gpa_t gpa, int writable);
290int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr); 287int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr);
291int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr); 288int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr);
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index c4c4e157c036..f0b4185158af 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -85,9 +85,10 @@ int kvm_s390_handle_e3(struct kvm_vcpu *vcpu)
85/* Handle SCK (SET CLOCK) interception */ 85/* Handle SCK (SET CLOCK) interception */
86static int handle_set_clock(struct kvm_vcpu *vcpu) 86static int handle_set_clock(struct kvm_vcpu *vcpu)
87{ 87{
88 struct kvm_s390_vm_tod_clock gtod = { 0 };
88 int rc; 89 int rc;
89 u8 ar; 90 u8 ar;
90 u64 op2, val; 91 u64 op2;
91 92
92 vcpu->stat.instruction_sck++; 93 vcpu->stat.instruction_sck++;
93 94
@@ -97,12 +98,12 @@ static int handle_set_clock(struct kvm_vcpu *vcpu)
97 op2 = kvm_s390_get_base_disp_s(vcpu, &ar); 98 op2 = kvm_s390_get_base_disp_s(vcpu, &ar);
98 if (op2 & 7) /* Operand must be on a doubleword boundary */ 99 if (op2 & 7) /* Operand must be on a doubleword boundary */
99 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 100 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
100 rc = read_guest(vcpu, op2, ar, &val, sizeof(val)); 101 rc = read_guest(vcpu, op2, ar, &gtod.tod, sizeof(gtod.tod));
101 if (rc) 102 if (rc)
102 return kvm_s390_inject_prog_cond(vcpu, rc); 103 return kvm_s390_inject_prog_cond(vcpu, rc);
103 104
104 VCPU_EVENT(vcpu, 3, "SCK: setting guest TOD to 0x%llx", val); 105 VCPU_EVENT(vcpu, 3, "SCK: setting guest TOD to 0x%llx", gtod.tod);
105 kvm_s390_set_tod_clock(vcpu->kvm, val); 106 kvm_s390_set_tod_clock(vcpu->kvm, &gtod);
106 107
107 kvm_s390_set_psw_cc(vcpu, 0); 108 kvm_s390_set_psw_cc(vcpu, 0);
108 return 0; 109 return 0;
@@ -795,55 +796,60 @@ out:
795 return rc; 796 return rc;
796} 797}
797 798
798static const intercept_handler_t b2_handlers[256] = {
799 [0x02] = handle_stidp,
800 [0x04] = handle_set_clock,
801 [0x10] = handle_set_prefix,
802 [0x11] = handle_store_prefix,
803 [0x12] = handle_store_cpu_address,
804 [0x14] = kvm_s390_handle_vsie,
805 [0x21] = handle_ipte_interlock,
806 [0x29] = handle_iske,
807 [0x2a] = handle_rrbe,
808 [0x2b] = handle_sske,
809 [0x2c] = handle_test_block,
810 [0x30] = handle_io_inst,
811 [0x31] = handle_io_inst,
812 [0x32] = handle_io_inst,
813 [0x33] = handle_io_inst,
814 [0x34] = handle_io_inst,
815 [0x35] = handle_io_inst,
816 [0x36] = handle_io_inst,
817 [0x37] = handle_io_inst,
818 [0x38] = handle_io_inst,
819 [0x39] = handle_io_inst,
820 [0x3a] = handle_io_inst,
821 [0x3b] = handle_io_inst,
822 [0x3c] = handle_io_inst,
823 [0x50] = handle_ipte_interlock,
824 [0x56] = handle_sthyi,
825 [0x5f] = handle_io_inst,
826 [0x74] = handle_io_inst,
827 [0x76] = handle_io_inst,
828 [0x7d] = handle_stsi,
829 [0xb1] = handle_stfl,
830 [0xb2] = handle_lpswe,
831};
832
833int kvm_s390_handle_b2(struct kvm_vcpu *vcpu) 799int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
834{ 800{
835 intercept_handler_t handler; 801 switch (vcpu->arch.sie_block->ipa & 0x00ff) {
836 802 case 0x02:
837 /* 803 return handle_stidp(vcpu);
838 * A lot of B2 instructions are priviledged. Here we check for 804 case 0x04:
839 * the privileged ones, that we can handle in the kernel. 805 return handle_set_clock(vcpu);
840 * Anything else goes to userspace. 806 case 0x10:
841 */ 807 return handle_set_prefix(vcpu);
842 handler = b2_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; 808 case 0x11:
843 if (handler) 809 return handle_store_prefix(vcpu);
844 return handler(vcpu); 810 case 0x12:
845 811 return handle_store_cpu_address(vcpu);
846 return -EOPNOTSUPP; 812 case 0x14:
813 return kvm_s390_handle_vsie(vcpu);
814 case 0x21:
815 case 0x50:
816 return handle_ipte_interlock(vcpu);
817 case 0x29:
818 return handle_iske(vcpu);
819 case 0x2a:
820 return handle_rrbe(vcpu);
821 case 0x2b:
822 return handle_sske(vcpu);
823 case 0x2c:
824 return handle_test_block(vcpu);
825 case 0x30:
826 case 0x31:
827 case 0x32:
828 case 0x33:
829 case 0x34:
830 case 0x35:
831 case 0x36:
832 case 0x37:
833 case 0x38:
834 case 0x39:
835 case 0x3a:
836 case 0x3b:
837 case 0x3c:
838 case 0x5f:
839 case 0x74:
840 case 0x76:
841 return handle_io_inst(vcpu);
842 case 0x56:
843 return handle_sthyi(vcpu);
844 case 0x7d:
845 return handle_stsi(vcpu);
846 case 0xb1:
847 return handle_stfl(vcpu);
848 case 0xb2:
849 return handle_lpswe(vcpu);
850 default:
851 return -EOPNOTSUPP;
852 }
847} 853}
848 854
849static int handle_epsw(struct kvm_vcpu *vcpu) 855static int handle_epsw(struct kvm_vcpu *vcpu)
@@ -1105,25 +1111,22 @@ static int handle_essa(struct kvm_vcpu *vcpu)
1105 return 0; 1111 return 0;
1106} 1112}
1107 1113
1108static const intercept_handler_t b9_handlers[256] = {
1109 [0x8a] = handle_ipte_interlock,
1110 [0x8d] = handle_epsw,
1111 [0x8e] = handle_ipte_interlock,
1112 [0x8f] = handle_ipte_interlock,
1113 [0xab] = handle_essa,
1114 [0xaf] = handle_pfmf,
1115};
1116
1117int kvm_s390_handle_b9(struct kvm_vcpu *vcpu) 1114int kvm_s390_handle_b9(struct kvm_vcpu *vcpu)
1118{ 1115{
1119 intercept_handler_t handler; 1116 switch (vcpu->arch.sie_block->ipa & 0x00ff) {
1120 1117 case 0x8a:
1121 /* This is handled just as for the B2 instructions. */ 1118 case 0x8e:
1122 handler = b9_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; 1119 case 0x8f:
1123 if (handler) 1120 return handle_ipte_interlock(vcpu);
1124 return handler(vcpu); 1121 case 0x8d:
1125 1122 return handle_epsw(vcpu);
1126 return -EOPNOTSUPP; 1123 case 0xab:
1124 return handle_essa(vcpu);
1125 case 0xaf:
1126 return handle_pfmf(vcpu);
1127 default:
1128 return -EOPNOTSUPP;
1129 }
1127} 1130}
1128 1131
1129int kvm_s390_handle_lctl(struct kvm_vcpu *vcpu) 1132int kvm_s390_handle_lctl(struct kvm_vcpu *vcpu)
@@ -1271,22 +1274,20 @@ static int handle_stctg(struct kvm_vcpu *vcpu)
1271 return rc ? kvm_s390_inject_prog_cond(vcpu, rc) : 0; 1274 return rc ? kvm_s390_inject_prog_cond(vcpu, rc) : 0;
1272} 1275}
1273 1276
1274static const intercept_handler_t eb_handlers[256] = {
1275 [0x2f] = handle_lctlg,
1276 [0x25] = handle_stctg,
1277 [0x60] = handle_ri,
1278 [0x61] = handle_ri,
1279 [0x62] = handle_ri,
1280};
1281
1282int kvm_s390_handle_eb(struct kvm_vcpu *vcpu) 1277int kvm_s390_handle_eb(struct kvm_vcpu *vcpu)
1283{ 1278{
1284 intercept_handler_t handler; 1279 switch (vcpu->arch.sie_block->ipb & 0x000000ff) {
1285 1280 case 0x25:
1286 handler = eb_handlers[vcpu->arch.sie_block->ipb & 0xff]; 1281 return handle_stctg(vcpu);
1287 if (handler) 1282 case 0x2f:
1288 return handler(vcpu); 1283 return handle_lctlg(vcpu);
1289 return -EOPNOTSUPP; 1284 case 0x60:
1285 case 0x61:
1286 case 0x62:
1287 return handle_ri(vcpu);
1288 default:
1289 return -EOPNOTSUPP;
1290 }
1290} 1291}
1291 1292
1292static int handle_tprot(struct kvm_vcpu *vcpu) 1293static int handle_tprot(struct kvm_vcpu *vcpu)
@@ -1346,10 +1347,12 @@ out_unlock:
1346 1347
1347int kvm_s390_handle_e5(struct kvm_vcpu *vcpu) 1348int kvm_s390_handle_e5(struct kvm_vcpu *vcpu)
1348{ 1349{
1349 /* For e5xx... instructions we only handle TPROT */ 1350 switch (vcpu->arch.sie_block->ipa & 0x00ff) {
1350 if ((vcpu->arch.sie_block->ipa & 0x00ff) == 0x01) 1351 case 0x01:
1351 return handle_tprot(vcpu); 1352 return handle_tprot(vcpu);
1352 return -EOPNOTSUPP; 1353 default:
1354 return -EOPNOTSUPP;
1355 }
1353} 1356}
1354 1357
1355static int handle_sckpf(struct kvm_vcpu *vcpu) 1358static int handle_sckpf(struct kvm_vcpu *vcpu)
@@ -1380,17 +1383,14 @@ static int handle_ptff(struct kvm_vcpu *vcpu)
1380 return 0; 1383 return 0;
1381} 1384}
1382 1385
1383static const intercept_handler_t x01_handlers[256] = {
1384 [0x04] = handle_ptff,
1385 [0x07] = handle_sckpf,
1386};
1387
1388int kvm_s390_handle_01(struct kvm_vcpu *vcpu) 1386int kvm_s390_handle_01(struct kvm_vcpu *vcpu)
1389{ 1387{
1390 intercept_handler_t handler; 1388 switch (vcpu->arch.sie_block->ipa & 0x00ff) {
1391 1389 case 0x04:
1392 handler = x01_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; 1390 return handle_ptff(vcpu);
1393 if (handler) 1391 case 0x07:
1394 return handler(vcpu); 1392 return handle_sckpf(vcpu);
1395 return -EOPNOTSUPP; 1393 default:
1394 return -EOPNOTSUPP;
1395 }
1396} 1396}
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index ec772700ff96..8961e3970901 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -821,6 +821,7 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
821{ 821{
822 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; 822 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
823 struct kvm_s390_sie_block *scb_o = vsie_page->scb_o; 823 struct kvm_s390_sie_block *scb_o = vsie_page->scb_o;
824 int guest_bp_isolation;
824 int rc; 825 int rc;
825 826
826 handle_last_fault(vcpu, vsie_page); 827 handle_last_fault(vcpu, vsie_page);
@@ -831,6 +832,20 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
831 s390_handle_mcck(); 832 s390_handle_mcck();
832 833
833 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); 834 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
835
836 /* save current guest state of bp isolation override */
837 guest_bp_isolation = test_thread_flag(TIF_ISOLATE_BP_GUEST);
838
839 /*
840 * The guest is running with BPBC, so we have to force it on for our
841 * nested guest. This is done by enabling BPBC globally, so the BPBC
842 * control in the SCB (which the nested guest can modify) is simply
843 * ignored.
844 */
845 if (test_kvm_facility(vcpu->kvm, 82) &&
846 vcpu->arch.sie_block->fpf & FPF_BPBC)
847 set_thread_flag(TIF_ISOLATE_BP_GUEST);
848
834 local_irq_disable(); 849 local_irq_disable();
835 guest_enter_irqoff(); 850 guest_enter_irqoff();
836 local_irq_enable(); 851 local_irq_enable();
@@ -840,6 +855,11 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
840 local_irq_disable(); 855 local_irq_disable();
841 guest_exit_irqoff(); 856 guest_exit_irqoff();
842 local_irq_enable(); 857 local_irq_enable();
858
859 /* restore guest state for bp isolation override */
860 if (!guest_bp_isolation)
861 clear_thread_flag(TIF_ISOLATE_BP_GUEST);
862
843 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); 863 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
844 864
845 if (rc == -EINTR) { 865 if (rc == -EINTR) {
diff --git a/arch/sh/boot/dts/Makefile b/arch/sh/boot/dts/Makefile
index 715def00a436..01d0f7fb14cc 100644
--- a/arch/sh/boot/dts/Makefile
+++ b/arch/sh/boot/dts/Makefile
@@ -1 +1,3 @@
1obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o 1ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"")
2obj-y += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
3endif
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 6bf594ace663..8767e45f1b2b 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -430,6 +430,8 @@ config SPARC_LEON
430 depends on SPARC32 430 depends on SPARC32
431 select USB_EHCI_BIG_ENDIAN_MMIO 431 select USB_EHCI_BIG_ENDIAN_MMIO
432 select USB_EHCI_BIG_ENDIAN_DESC 432 select USB_EHCI_BIG_ENDIAN_DESC
433 select USB_UHCI_BIG_ENDIAN_MMIO
434 select USB_UHCI_BIG_ENDIAN_DESC
433 ---help--- 435 ---help---
434 If you say Y here if you are running on a SPARC-LEON processor. 436 If you say Y here if you are running on a SPARC-LEON processor.
435 The LEON processor is a synthesizable VHDL model of the 437 The LEON processor is a synthesizable VHDL model of the
diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h
index 6f17528356b2..ea53e418f6c0 100644
--- a/arch/sparc/include/asm/bug.h
+++ b/arch/sparc/include/asm/bug.h
@@ -9,10 +9,14 @@
9void do_BUG(const char *file, int line); 9void do_BUG(const char *file, int line);
10#define BUG() do { \ 10#define BUG() do { \
11 do_BUG(__FILE__, __LINE__); \ 11 do_BUG(__FILE__, __LINE__); \
12 barrier_before_unreachable(); \
12 __builtin_trap(); \ 13 __builtin_trap(); \
13} while (0) 14} while (0)
14#else 15#else
15#define BUG() __builtin_trap() 16#define BUG() do { \
17 barrier_before_unreachable(); \
18 __builtin_trap(); \
19} while (0)
16#endif 20#endif
17 21
18#define HAVE_ARCH_BUG 22#define HAVE_ARCH_BUG
diff --git a/arch/x86/.gitignore b/arch/x86/.gitignore
index aff152c87cf4..5a82bac5e0bc 100644
--- a/arch/x86/.gitignore
+++ b/arch/x86/.gitignore
@@ -1,6 +1,7 @@
1boot/compressed/vmlinux 1boot/compressed/vmlinux
2tools/test_get_len 2tools/test_get_len
3tools/insn_sanity 3tools/insn_sanity
4tools/insn_decoder_test
4purgatory/kexec-purgatory.c 5purgatory/kexec-purgatory.c
5purgatory/purgatory.ro 6purgatory/purgatory.ro
6 7
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 63bf349b2b24..eb7f43f23521 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -423,12 +423,6 @@ config X86_MPPARSE
423 For old smp systems that do not have proper acpi support. Newer systems 423 For old smp systems that do not have proper acpi support. Newer systems
424 (esp with 64bit cpus) with acpi support, MADT and DSDT will override it 424 (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
425 425
426config X86_BIGSMP
427 bool "Support for big SMP systems with more than 8 CPUs"
428 depends on X86_32 && SMP
429 ---help---
430 This option is needed for the systems that have more than 8 CPUs
431
432config GOLDFISH 426config GOLDFISH
433 def_bool y 427 def_bool y
434 depends on X86_GOLDFISH 428 depends on X86_GOLDFISH
@@ -436,6 +430,7 @@ config GOLDFISH
436config RETPOLINE 430config RETPOLINE
437 bool "Avoid speculative indirect branches in kernel" 431 bool "Avoid speculative indirect branches in kernel"
438 default y 432 default y
433 select STACK_VALIDATION if HAVE_STACK_VALIDATION
439 help 434 help
440 Compile kernel with the retpoline compiler options to guard against 435 Compile kernel with the retpoline compiler options to guard against
441 kernel-to-user data leaks by avoiding speculative indirect 436 kernel-to-user data leaks by avoiding speculative indirect
@@ -460,6 +455,12 @@ config INTEL_RDT
460 Say N if unsure. 455 Say N if unsure.
461 456
462if X86_32 457if X86_32
458config X86_BIGSMP
459 bool "Support for big SMP systems with more than 8 CPUs"
460 depends on SMP
461 ---help---
462 This option is needed for the systems that have more than 8 CPUs
463
463config X86_EXTENDED_PLATFORM 464config X86_EXTENDED_PLATFORM
464 bool "Support for extended (non-PC) x86 platforms" 465 bool "Support for extended (non-PC) x86 platforms"
465 default y 466 default y
@@ -949,25 +950,66 @@ config MAXSMP
949 Enable maximum number of CPUS and NUMA Nodes for this architecture. 950 Enable maximum number of CPUS and NUMA Nodes for this architecture.
950 If unsure, say N. 951 If unsure, say N.
951 952
953#
954# The maximum number of CPUs supported:
955#
956# The main config value is NR_CPUS, which defaults to NR_CPUS_DEFAULT,
957# and which can be configured interactively in the
958# [NR_CPUS_RANGE_BEGIN ... NR_CPUS_RANGE_END] range.
959#
960# The ranges are different on 32-bit and 64-bit kernels, depending on
961# hardware capabilities and scalability features of the kernel.
962#
963# ( If MAXSMP is enabled we just use the highest possible value and disable
964# interactive configuration. )
965#
966
967config NR_CPUS_RANGE_BEGIN
968 int
969 default NR_CPUS_RANGE_END if MAXSMP
970 default 1 if !SMP
971 default 2
972
973config NR_CPUS_RANGE_END
974 int
975 depends on X86_32
976 default 64 if SMP && X86_BIGSMP
977 default 8 if SMP && !X86_BIGSMP
978 default 1 if !SMP
979
980config NR_CPUS_RANGE_END
981 int
982 depends on X86_64
983 default 8192 if SMP && ( MAXSMP || CPUMASK_OFFSTACK)
984 default 512 if SMP && (!MAXSMP && !CPUMASK_OFFSTACK)
985 default 1 if !SMP
986
987config NR_CPUS_DEFAULT
988 int
989 depends on X86_32
990 default 32 if X86_BIGSMP
991 default 8 if SMP
992 default 1 if !SMP
993
994config NR_CPUS_DEFAULT
995 int
996 depends on X86_64
997 default 8192 if MAXSMP
998 default 64 if SMP
999 default 1 if !SMP
1000
952config NR_CPUS 1001config NR_CPUS
953 int "Maximum number of CPUs" if SMP && !MAXSMP 1002 int "Maximum number of CPUs" if SMP && !MAXSMP
954 range 2 8 if SMP && X86_32 && !X86_BIGSMP 1003 range NR_CPUS_RANGE_BEGIN NR_CPUS_RANGE_END
955 range 2 64 if SMP && X86_32 && X86_BIGSMP 1004 default NR_CPUS_DEFAULT
956 range 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK && X86_64
957 range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64
958 default "1" if !SMP
959 default "8192" if MAXSMP
960 default "32" if SMP && X86_BIGSMP
961 default "8" if SMP && X86_32
962 default "64" if SMP
963 ---help--- 1005 ---help---
964 This allows you to specify the maximum number of CPUs which this 1006 This allows you to specify the maximum number of CPUs which this
965 kernel will support. If CPUMASK_OFFSTACK is enabled, the maximum 1007 kernel will support. If CPUMASK_OFFSTACK is enabled, the maximum
966 supported value is 8192, otherwise the maximum value is 512. The 1008 supported value is 8192, otherwise the maximum value is 512. The
967 minimum value which makes sense is 2. 1009 minimum value which makes sense is 2.
968 1010
969 This is purely to save memory - each supported CPU adds 1011 This is purely to save memory: each supported CPU adds about 8KB
970 approximately eight kilobytes to the kernel image. 1012 to the kernel image.
971 1013
972config SCHED_SMT 1014config SCHED_SMT
973 bool "SMT (Hyperthreading) scheduler support" 1015 bool "SMT (Hyperthreading) scheduler support"
@@ -1363,7 +1405,7 @@ config HIGHMEM4G
1363 1405
1364config HIGHMEM64G 1406config HIGHMEM64G
1365 bool "64GB" 1407 bool "64GB"
1366 depends on !M486 1408 depends on !M486 && !M586 && !M586TSC && !M586MMX && !MGEODE_LX && !MGEODEGX1 && !MCYRIXIII && !MELAN && !MWINCHIPC6 && !WINCHIP3D && !MK6
1367 select X86_PAE 1409 select X86_PAE
1368 ---help--- 1410 ---help---
1369 Select this if you have a 32-bit processor and more than 4 1411 Select this if you have a 32-bit processor and more than 4
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 65a9a4716e34..8b8d2297d486 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -374,7 +374,7 @@ config X86_TSC
374 374
375config X86_CMPXCHG64 375config X86_CMPXCHG64
376 def_bool y 376 def_bool y
377 depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM 377 depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8
378 378
379# this should be set for all -march=.. options where the compiler 379# this should be set for all -march=.. options where the compiler
380# generates cmov. 380# generates cmov.
@@ -385,7 +385,7 @@ config X86_CMOV
385config X86_MINIMUM_CPU_FAMILY 385config X86_MINIMUM_CPU_FAMILY
386 int 386 int
387 default "64" if X86_64 387 default "64" if X86_64
388 default "6" if X86_32 && X86_P6_NOP 388 default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
389 default "5" if X86_32 && X86_CMPXCHG64 389 default "5" if X86_32 && X86_CMPXCHG64
390 default "4" 390 default "4"
391 391
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index fad55160dcb9..498c1b812300 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -232,10 +232,9 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
232 232
233# Avoid indirect branches in kernel to deal with Spectre 233# Avoid indirect branches in kernel to deal with Spectre
234ifdef CONFIG_RETPOLINE 234ifdef CONFIG_RETPOLINE
235 RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register) 235ifneq ($(RETPOLINE_CFLAGS),)
236 ifneq ($(RETPOLINE_CFLAGS),) 236 KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
237 KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE 237endif
238 endif
239endif 238endif
240 239
241archscripts: scripts_basic 240archscripts: scripts_basic
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 353e20c3f114..886a9115af62 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -439,7 +439,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
439 struct efi_uga_draw_protocol *uga = NULL, *first_uga; 439 struct efi_uga_draw_protocol *uga = NULL, *first_uga;
440 efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; 440 efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
441 unsigned long nr_ugas; 441 unsigned long nr_ugas;
442 u32 *handles = (u32 *)uga_handle;; 442 u32 *handles = (u32 *)uga_handle;
443 efi_status_t status = EFI_INVALID_PARAMETER; 443 efi_status_t status = EFI_INVALID_PARAMETER;
444 int i; 444 int i;
445 445
@@ -484,7 +484,7 @@ setup_uga64(void **uga_handle, unsigned long size, u32 *width, u32 *height)
484 struct efi_uga_draw_protocol *uga = NULL, *first_uga; 484 struct efi_uga_draw_protocol *uga = NULL, *first_uga;
485 efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; 485 efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
486 unsigned long nr_ugas; 486 unsigned long nr_ugas;
487 u64 *handles = (u64 *)uga_handle;; 487 u64 *handles = (u64 *)uga_handle;
488 efi_status_t status = EFI_INVALID_PARAMETER; 488 efi_status_t status = EFI_INVALID_PARAMETER;
489 int i; 489 int i;
490 490
diff --git a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c
index 36870b26067a..d08805032f01 100644
--- a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c
+++ b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_init_avx2.c
@@ -57,10 +57,12 @@ void sha512_mb_mgr_init_avx2(struct sha512_mb_mgr *state)
57{ 57{
58 unsigned int j; 58 unsigned int j;
59 59
60 state->lens[0] = 0; 60 /* initially all lanes are unused */
61 state->lens[1] = 1; 61 state->lens[0] = 0xFFFFFFFF00000000;
62 state->lens[2] = 2; 62 state->lens[1] = 0xFFFFFFFF00000001;
63 state->lens[3] = 3; 63 state->lens[2] = 0xFFFFFFFF00000002;
64 state->lens[3] = 0xFFFFFFFF00000003;
65
64 state->unused_lanes = 0xFF03020100; 66 state->unused_lanes = 0xFF03020100;
65 for (j = 0; j < 4; j++) 67 for (j = 0; j < 4; j++)
66 state->ldata[j].job_in_lane = NULL; 68 state->ldata[j].job_in_lane = NULL;
diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
index 3f48f695d5e6..be63330c5511 100644
--- a/arch/x86/entry/calling.h
+++ b/arch/x86/entry/calling.h
@@ -97,80 +97,78 @@ For 32-bit we have the following conventions - kernel is built with
97 97
98#define SIZEOF_PTREGS 21*8 98#define SIZEOF_PTREGS 21*8
99 99
100 .macro ALLOC_PT_GPREGS_ON_STACK 100.macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0
101 addq $-(15*8), %rsp 101 /*
102 .endm 102 * Push registers and sanitize registers of values that a
103 103 * speculation attack might otherwise want to exploit. The
104 .macro SAVE_C_REGS_HELPER offset=0 rax=1 rcx=1 r8910=1 r11=1 104 * lower registers are likely clobbered well before they
105 .if \r11 105 * could be put to use in a speculative execution gadget.
106 movq %r11, 6*8+\offset(%rsp) 106 * Interleave XOR with PUSH for better uop scheduling:
107 .endif 107 */
108 .if \r8910 108 .if \save_ret
109 movq %r10, 7*8+\offset(%rsp) 109 pushq %rsi /* pt_regs->si */
110 movq %r9, 8*8+\offset(%rsp) 110 movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */
111 movq %r8, 9*8+\offset(%rsp) 111 movq %rdi, 8(%rsp) /* pt_regs->di (overwriting original return address) */
112 .endif 112 .else
113 .if \rax 113 pushq %rdi /* pt_regs->di */
114 movq %rax, 10*8+\offset(%rsp) 114 pushq %rsi /* pt_regs->si */
115 .endif 115 .endif
116 .if \rcx 116 pushq \rdx /* pt_regs->dx */
117 movq %rcx, 11*8+\offset(%rsp) 117 pushq %rcx /* pt_regs->cx */
118 pushq \rax /* pt_regs->ax */
119 pushq %r8 /* pt_regs->r8 */
120 xorl %r8d, %r8d /* nospec r8 */
121 pushq %r9 /* pt_regs->r9 */
122 xorl %r9d, %r9d /* nospec r9 */
123 pushq %r10 /* pt_regs->r10 */
124 xorl %r10d, %r10d /* nospec r10 */
125 pushq %r11 /* pt_regs->r11 */
126 xorl %r11d, %r11d /* nospec r11*/
127 pushq %rbx /* pt_regs->rbx */
128 xorl %ebx, %ebx /* nospec rbx*/
129 pushq %rbp /* pt_regs->rbp */
130 xorl %ebp, %ebp /* nospec rbp*/
131 pushq %r12 /* pt_regs->r12 */
132 xorl %r12d, %r12d /* nospec r12*/
133 pushq %r13 /* pt_regs->r13 */
134 xorl %r13d, %r13d /* nospec r13*/
135 pushq %r14 /* pt_regs->r14 */
136 xorl %r14d, %r14d /* nospec r14*/
137 pushq %r15 /* pt_regs->r15 */
138 xorl %r15d, %r15d /* nospec r15*/
139 UNWIND_HINT_REGS
140 .if \save_ret
141 pushq %rsi /* return address on top of stack */
118 .endif 142 .endif
119 movq %rdx, 12*8+\offset(%rsp) 143.endm
120 movq %rsi, 13*8+\offset(%rsp) 144
121 movq %rdi, 14*8+\offset(%rsp) 145.macro POP_REGS pop_rdi=1 skip_r11rcx=0
122 UNWIND_HINT_REGS offset=\offset extra=0
123 .endm
124 .macro SAVE_C_REGS offset=0
125 SAVE_C_REGS_HELPER \offset, 1, 1, 1, 1
126 .endm
127 .macro SAVE_C_REGS_EXCEPT_RAX_RCX offset=0
128 SAVE_C_REGS_HELPER \offset, 0, 0, 1, 1
129 .endm
130 .macro SAVE_C_REGS_EXCEPT_R891011
131 SAVE_C_REGS_HELPER 0, 1, 1, 0, 0
132 .endm
133 .macro SAVE_C_REGS_EXCEPT_RCX_R891011
134 SAVE_C_REGS_HELPER 0, 1, 0, 0, 0
135 .endm
136 .macro SAVE_C_REGS_EXCEPT_RAX_RCX_R11
137 SAVE_C_REGS_HELPER 0, 0, 0, 1, 0
138 .endm
139
140 .macro SAVE_EXTRA_REGS offset=0
141 movq %r15, 0*8+\offset(%rsp)
142 movq %r14, 1*8+\offset(%rsp)
143 movq %r13, 2*8+\offset(%rsp)
144 movq %r12, 3*8+\offset(%rsp)
145 movq %rbp, 4*8+\offset(%rsp)
146 movq %rbx, 5*8+\offset(%rsp)
147 UNWIND_HINT_REGS offset=\offset
148 .endm
149
150 .macro POP_EXTRA_REGS
151 popq %r15 146 popq %r15
152 popq %r14 147 popq %r14
153 popq %r13 148 popq %r13
154 popq %r12 149 popq %r12
155 popq %rbp 150 popq %rbp
156 popq %rbx 151 popq %rbx
157 .endm 152 .if \skip_r11rcx
158 153 popq %rsi
159 .macro POP_C_REGS 154 .else
160 popq %r11 155 popq %r11
156 .endif
161 popq %r10 157 popq %r10
162 popq %r9 158 popq %r9
163 popq %r8 159 popq %r8
164 popq %rax 160 popq %rax
161 .if \skip_r11rcx
162 popq %rsi
163 .else
165 popq %rcx 164 popq %rcx
165 .endif
166 popq %rdx 166 popq %rdx
167 popq %rsi 167 popq %rsi
168 .if \pop_rdi
168 popq %rdi 169 popq %rdi
169 .endm 170 .endif
170 171.endm
171 .macro icebp
172 .byte 0xf1
173 .endm
174 172
175/* 173/*
176 * This is a sneaky trick to help the unwinder find pt_regs on the stack. The 174 * This is a sneaky trick to help the unwinder find pt_regs on the stack. The
@@ -178,17 +176,12 @@ For 32-bit we have the following conventions - kernel is built with
178 * is just setting the LSB, which makes it an invalid stack address and is also 176 * is just setting the LSB, which makes it an invalid stack address and is also
179 * a signal to the unwinder that it's a pt_regs pointer in disguise. 177 * a signal to the unwinder that it's a pt_regs pointer in disguise.
180 * 178 *
181 * NOTE: This macro must be used *after* SAVE_EXTRA_REGS because it corrupts 179 * NOTE: This macro must be used *after* PUSH_AND_CLEAR_REGS because it corrupts
182 * the original rbp. 180 * the original rbp.
183 */ 181 */
184.macro ENCODE_FRAME_POINTER ptregs_offset=0 182.macro ENCODE_FRAME_POINTER ptregs_offset=0
185#ifdef CONFIG_FRAME_POINTER 183#ifdef CONFIG_FRAME_POINTER
186 .if \ptregs_offset 184 leaq 1+\ptregs_offset(%rsp), %rbp
187 leaq \ptregs_offset(%rsp), %rbp
188 .else
189 mov %rsp, %rbp
190 .endif
191 orq $0x1, %rbp
192#endif 185#endif
193.endm 186.endm
194 187
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 16c2c022540d..6ad064c8cf35 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -252,8 +252,7 @@ ENTRY(__switch_to_asm)
252 * exist, overwrite the RSB with entries which capture 252 * exist, overwrite the RSB with entries which capture
253 * speculative execution to prevent attack. 253 * speculative execution to prevent attack.
254 */ 254 */
255 /* Clobbers %ebx */ 255 FILL_RETURN_BUFFER %ebx, RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW
256 FILL_RETURN_BUFFER RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW
257#endif 256#endif
258 257
259 /* restore callee-saved registers */ 258 /* restore callee-saved registers */
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 30c8c5344c4a..805f52703ee3 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -55,7 +55,7 @@ END(native_usergs_sysret64)
55 55
56.macro TRACE_IRQS_FLAGS flags:req 56.macro TRACE_IRQS_FLAGS flags:req
57#ifdef CONFIG_TRACE_IRQFLAGS 57#ifdef CONFIG_TRACE_IRQFLAGS
58 bt $9, \flags /* interrupts off? */ 58 btl $9, \flags /* interrupts off? */
59 jnc 1f 59 jnc 1f
60 TRACE_IRQS_ON 60 TRACE_IRQS_ON
611: 611:
@@ -213,7 +213,7 @@ ENTRY(entry_SYSCALL_64)
213 213
214 swapgs 214 swapgs
215 /* 215 /*
216 * This path is not taken when PAGE_TABLE_ISOLATION is disabled so it 216 * This path is only taken when PAGE_TABLE_ISOLATION is disabled so it
217 * is not required to switch CR3. 217 * is not required to switch CR3.
218 */ 218 */
219 movq %rsp, PER_CPU_VAR(rsp_scratch) 219 movq %rsp, PER_CPU_VAR(rsp_scratch)
@@ -227,22 +227,8 @@ ENTRY(entry_SYSCALL_64)
227 pushq %rcx /* pt_regs->ip */ 227 pushq %rcx /* pt_regs->ip */
228GLOBAL(entry_SYSCALL_64_after_hwframe) 228GLOBAL(entry_SYSCALL_64_after_hwframe)
229 pushq %rax /* pt_regs->orig_ax */ 229 pushq %rax /* pt_regs->orig_ax */
230 pushq %rdi /* pt_regs->di */ 230
231 pushq %rsi /* pt_regs->si */ 231 PUSH_AND_CLEAR_REGS rax=$-ENOSYS
232 pushq %rdx /* pt_regs->dx */
233 pushq %rcx /* pt_regs->cx */
234 pushq $-ENOSYS /* pt_regs->ax */
235 pushq %r8 /* pt_regs->r8 */
236 pushq %r9 /* pt_regs->r9 */
237 pushq %r10 /* pt_regs->r10 */
238 pushq %r11 /* pt_regs->r11 */
239 pushq %rbx /* pt_regs->rbx */
240 pushq %rbp /* pt_regs->rbp */
241 pushq %r12 /* pt_regs->r12 */
242 pushq %r13 /* pt_regs->r13 */
243 pushq %r14 /* pt_regs->r14 */
244 pushq %r15 /* pt_regs->r15 */
245 UNWIND_HINT_REGS
246 232
247 TRACE_IRQS_OFF 233 TRACE_IRQS_OFF
248 234
@@ -321,15 +307,7 @@ GLOBAL(entry_SYSCALL_64_after_hwframe)
321syscall_return_via_sysret: 307syscall_return_via_sysret:
322 /* rcx and r11 are already restored (see code above) */ 308 /* rcx and r11 are already restored (see code above) */
323 UNWIND_HINT_EMPTY 309 UNWIND_HINT_EMPTY
324 POP_EXTRA_REGS 310 POP_REGS pop_rdi=0 skip_r11rcx=1
325 popq %rsi /* skip r11 */
326 popq %r10
327 popq %r9
328 popq %r8
329 popq %rax
330 popq %rsi /* skip rcx */
331 popq %rdx
332 popq %rsi
333 311
334 /* 312 /*
335 * Now all regs are restored except RSP and RDI. 313 * Now all regs are restored except RSP and RDI.
@@ -386,8 +364,7 @@ ENTRY(__switch_to_asm)
386 * exist, overwrite the RSB with entries which capture 364 * exist, overwrite the RSB with entries which capture
387 * speculative execution to prevent attack. 365 * speculative execution to prevent attack.
388 */ 366 */
389 /* Clobbers %rbx */ 367 FILL_RETURN_BUFFER %r12, RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW
390 FILL_RETURN_BUFFER RSB_CLEAR_LOOPS, X86_FEATURE_RSB_CTXSW
391#endif 368#endif
392 369
393 /* restore callee-saved registers */ 370 /* restore callee-saved registers */
@@ -471,9 +448,19 @@ END(irq_entries_start)
471 * 448 *
472 * The invariant is that, if irq_count != -1, then the IRQ stack is in use. 449 * The invariant is that, if irq_count != -1, then the IRQ stack is in use.
473 */ 450 */
474.macro ENTER_IRQ_STACK regs=1 old_rsp 451.macro ENTER_IRQ_STACK regs=1 old_rsp save_ret=0
475 DEBUG_ENTRY_ASSERT_IRQS_OFF 452 DEBUG_ENTRY_ASSERT_IRQS_OFF
453
454 .if \save_ret
455 /*
456 * If save_ret is set, the original stack contains one additional
457 * entry -- the return address. Therefore, move the address one
458 * entry below %rsp to \old_rsp.
459 */
460 leaq 8(%rsp), \old_rsp
461 .else
476 movq %rsp, \old_rsp 462 movq %rsp, \old_rsp
463 .endif
477 464
478 .if \regs 465 .if \regs
479 UNWIND_HINT_REGS base=\old_rsp 466 UNWIND_HINT_REGS base=\old_rsp
@@ -519,6 +506,15 @@ END(irq_entries_start)
519 .if \regs 506 .if \regs
520 UNWIND_HINT_REGS indirect=1 507 UNWIND_HINT_REGS indirect=1
521 .endif 508 .endif
509
510 .if \save_ret
511 /*
512 * Push the return address to the stack. This return address can
513 * be found at the "real" original RSP, which was offset by 8 at
514 * the beginning of this macro.
515 */
516 pushq -8(\old_rsp)
517 .endif
522.endm 518.endm
523 519
524/* 520/*
@@ -542,29 +538,65 @@ END(irq_entries_start)
542.endm 538.endm
543 539
544/* 540/*
545 * Interrupt entry/exit. 541 * Interrupt entry helper function.
546 *
547 * Interrupt entry points save only callee clobbered registers in fast path.
548 * 542 *
549 * Entry runs with interrupts off. 543 * Entry runs with interrupts off. Stack layout at entry:
544 * +----------------------------------------------------+
545 * | regs->ss |
546 * | regs->rsp |
547 * | regs->eflags |
548 * | regs->cs |
549 * | regs->ip |
550 * +----------------------------------------------------+
551 * | regs->orig_ax = ~(interrupt number) |
552 * +----------------------------------------------------+
553 * | return address |
554 * +----------------------------------------------------+
550 */ 555 */
551 556ENTRY(interrupt_entry)
552/* 0(%rsp): ~(interrupt number) */ 557 UNWIND_HINT_FUNC
553 .macro interrupt func 558 ASM_CLAC
554 cld 559 cld
555 560
556 testb $3, CS-ORIG_RAX(%rsp) 561 testb $3, CS-ORIG_RAX+8(%rsp)
557 jz 1f 562 jz 1f
558 SWAPGS 563 SWAPGS
559 call switch_to_thread_stack 564
565 /*
566 * Switch to the thread stack. The IRET frame and orig_ax are
567 * on the stack, as well as the return address. RDI..R12 are
568 * not (yet) on the stack and space has not (yet) been
569 * allocated for them.
570 */
571 pushq %rdi
572
573 /* Need to switch before accessing the thread stack. */
574 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
575 movq %rsp, %rdi
576 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
577
578 /*
579 * We have RDI, return address, and orig_ax on the stack on
580 * top of the IRET frame. That means offset=24
581 */
582 UNWIND_HINT_IRET_REGS base=%rdi offset=24
583
584 pushq 7*8(%rdi) /* regs->ss */
585 pushq 6*8(%rdi) /* regs->rsp */
586 pushq 5*8(%rdi) /* regs->eflags */
587 pushq 4*8(%rdi) /* regs->cs */
588 pushq 3*8(%rdi) /* regs->ip */
589 pushq 2*8(%rdi) /* regs->orig_ax */
590 pushq 8(%rdi) /* return address */
591 UNWIND_HINT_FUNC
592
593 movq (%rdi), %rdi
5601: 5941:
561 595
562 ALLOC_PT_GPREGS_ON_STACK 596 PUSH_AND_CLEAR_REGS save_ret=1
563 SAVE_C_REGS 597 ENCODE_FRAME_POINTER 8
564 SAVE_EXTRA_REGS
565 ENCODE_FRAME_POINTER
566 598
567 testb $3, CS(%rsp) 599 testb $3, CS+8(%rsp)
568 jz 1f 600 jz 1f
569 601
570 /* 602 /*
@@ -572,7 +604,7 @@ END(irq_entries_start)
572 * 604 *
573 * We need to tell lockdep that IRQs are off. We can't do this until 605 * We need to tell lockdep that IRQs are off. We can't do this until
574 * we fix gsbase, and we should do it before enter_from_user_mode 606 * we fix gsbase, and we should do it before enter_from_user_mode
575 * (which can take locks). Since TRACE_IRQS_OFF idempotent, 607 * (which can take locks). Since TRACE_IRQS_OFF is idempotent,
576 * the simplest way to handle it is to just call it twice if 608 * the simplest way to handle it is to just call it twice if
577 * we enter from user mode. There's no reason to optimize this since 609 * we enter from user mode. There's no reason to optimize this since
578 * TRACE_IRQS_OFF is a no-op if lockdep is off. 610 * TRACE_IRQS_OFF is a no-op if lockdep is off.
@@ -582,12 +614,15 @@ END(irq_entries_start)
582 CALL_enter_from_user_mode 614 CALL_enter_from_user_mode
583 615
5841: 6161:
585 ENTER_IRQ_STACK old_rsp=%rdi 617 ENTER_IRQ_STACK old_rsp=%rdi save_ret=1
586 /* We entered an interrupt context - irqs are off: */ 618 /* We entered an interrupt context - irqs are off: */
587 TRACE_IRQS_OFF 619 TRACE_IRQS_OFF
588 620
589 call \func /* rdi points to pt_regs */ 621 ret
590 .endm 622END(interrupt_entry)
623
624
625/* Interrupt entry/exit. */
591 626
592 /* 627 /*
593 * The interrupt stubs push (~vector+0x80) onto the stack and 628 * The interrupt stubs push (~vector+0x80) onto the stack and
@@ -595,9 +630,10 @@ END(irq_entries_start)
595 */ 630 */
596 .p2align CONFIG_X86_L1_CACHE_SHIFT 631 .p2align CONFIG_X86_L1_CACHE_SHIFT
597common_interrupt: 632common_interrupt:
598 ASM_CLAC
599 addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */ 633 addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */
600 interrupt do_IRQ 634 call interrupt_entry
635 UNWIND_HINT_REGS indirect=1
636 call do_IRQ /* rdi points to pt_regs */
601 /* 0(%rsp): old RSP */ 637 /* 0(%rsp): old RSP */
602ret_from_intr: 638ret_from_intr:
603 DISABLE_INTERRUPTS(CLBR_ANY) 639 DISABLE_INTERRUPTS(CLBR_ANY)
@@ -622,15 +658,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode)
622 ud2 658 ud2
6231: 6591:
624#endif 660#endif
625 POP_EXTRA_REGS 661 POP_REGS pop_rdi=0
626 popq %r11
627 popq %r10
628 popq %r9
629 popq %r8
630 popq %rax
631 popq %rcx
632 popq %rdx
633 popq %rsi
634 662
635 /* 663 /*
636 * The stack is now user RDI, orig_ax, RIP, CS, EFLAGS, RSP, SS. 664 * The stack is now user RDI, orig_ax, RIP, CS, EFLAGS, RSP, SS.
@@ -688,8 +716,7 @@ GLOBAL(restore_regs_and_return_to_kernel)
688 ud2 716 ud2
6891: 7171:
690#endif 718#endif
691 POP_EXTRA_REGS 719 POP_REGS
692 POP_C_REGS
693 addq $8, %rsp /* skip regs->orig_ax */ 720 addq $8, %rsp /* skip regs->orig_ax */
694 /* 721 /*
695 * ARCH_HAS_MEMBARRIER_SYNC_CORE rely on IRET core serialization 722 * ARCH_HAS_MEMBARRIER_SYNC_CORE rely on IRET core serialization
@@ -799,10 +826,11 @@ END(common_interrupt)
799.macro apicinterrupt3 num sym do_sym 826.macro apicinterrupt3 num sym do_sym
800ENTRY(\sym) 827ENTRY(\sym)
801 UNWIND_HINT_IRET_REGS 828 UNWIND_HINT_IRET_REGS
802 ASM_CLAC
803 pushq $~(\num) 829 pushq $~(\num)
804.Lcommon_\sym: 830.Lcommon_\sym:
805 interrupt \do_sym 831 call interrupt_entry
832 UNWIND_HINT_REGS indirect=1
833 call \do_sym /* rdi points to pt_regs */
806 jmp ret_from_intr 834 jmp ret_from_intr
807END(\sym) 835END(\sym)
808.endm 836.endm
@@ -865,34 +893,6 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
865 */ 893 */
866#define CPU_TSS_IST(x) PER_CPU_VAR(cpu_tss_rw) + (TSS_ist + ((x) - 1) * 8) 894#define CPU_TSS_IST(x) PER_CPU_VAR(cpu_tss_rw) + (TSS_ist + ((x) - 1) * 8)
867 895
868/*
869 * Switch to the thread stack. This is called with the IRET frame and
870 * orig_ax on the stack. (That is, RDI..R12 are not on the stack and
871 * space has not been allocated for them.)
872 */
873ENTRY(switch_to_thread_stack)
874 UNWIND_HINT_FUNC
875
876 pushq %rdi
877 /* Need to switch before accessing the thread stack. */
878 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
879 movq %rsp, %rdi
880 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
881 UNWIND_HINT sp_offset=16 sp_reg=ORC_REG_DI
882
883 pushq 7*8(%rdi) /* regs->ss */
884 pushq 6*8(%rdi) /* regs->rsp */
885 pushq 5*8(%rdi) /* regs->eflags */
886 pushq 4*8(%rdi) /* regs->cs */
887 pushq 3*8(%rdi) /* regs->ip */
888 pushq 2*8(%rdi) /* regs->orig_ax */
889 pushq 8(%rdi) /* return address */
890 UNWIND_HINT_FUNC
891
892 movq (%rdi), %rdi
893 ret
894END(switch_to_thread_stack)
895
896.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1 896.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
897ENTRY(\sym) 897ENTRY(\sym)
898 UNWIND_HINT_IRET_REGS offset=\has_error_code*8 898 UNWIND_HINT_IRET_REGS offset=\has_error_code*8
@@ -908,10 +908,8 @@ ENTRY(\sym)
908 pushq $-1 /* ORIG_RAX: no syscall to restart */ 908 pushq $-1 /* ORIG_RAX: no syscall to restart */
909 .endif 909 .endif
910 910
911 ALLOC_PT_GPREGS_ON_STACK
912
913 .if \paranoid < 2 911 .if \paranoid < 2
914 testb $3, CS(%rsp) /* If coming from userspace, switch stacks */ 912 testb $3, CS-ORIG_RAX(%rsp) /* If coming from userspace, switch stacks */
915 jnz .Lfrom_usermode_switch_stack_\@ 913 jnz .Lfrom_usermode_switch_stack_\@
916 .endif 914 .endif
917 915
@@ -1121,9 +1119,7 @@ ENTRY(xen_failsafe_callback)
1121 addq $0x30, %rsp 1119 addq $0x30, %rsp
1122 UNWIND_HINT_IRET_REGS 1120 UNWIND_HINT_IRET_REGS
1123 pushq $-1 /* orig_ax = -1 => not a system call */ 1121 pushq $-1 /* orig_ax = -1 => not a system call */
1124 ALLOC_PT_GPREGS_ON_STACK 1122 PUSH_AND_CLEAR_REGS
1125 SAVE_C_REGS
1126 SAVE_EXTRA_REGS
1127 ENCODE_FRAME_POINTER 1123 ENCODE_FRAME_POINTER
1128 jmp error_exit 1124 jmp error_exit
1129END(xen_failsafe_callback) 1125END(xen_failsafe_callback)
@@ -1170,8 +1166,7 @@ idtentry machine_check do_mce has_error_code=0 paranoid=1
1170ENTRY(paranoid_entry) 1166ENTRY(paranoid_entry)
1171 UNWIND_HINT_FUNC 1167 UNWIND_HINT_FUNC
1172 cld 1168 cld
1173 SAVE_C_REGS 8 1169 PUSH_AND_CLEAR_REGS save_ret=1
1174 SAVE_EXTRA_REGS 8
1175 ENCODE_FRAME_POINTER 8 1170 ENCODE_FRAME_POINTER 8
1176 movl $1, %ebx 1171 movl $1, %ebx
1177 movl $MSR_GS_BASE, %ecx 1172 movl $MSR_GS_BASE, %ecx
@@ -1211,21 +1206,20 @@ ENTRY(paranoid_exit)
1211 jmp .Lparanoid_exit_restore 1206 jmp .Lparanoid_exit_restore
1212.Lparanoid_exit_no_swapgs: 1207.Lparanoid_exit_no_swapgs:
1213 TRACE_IRQS_IRETQ_DEBUG 1208 TRACE_IRQS_IRETQ_DEBUG
1209 RESTORE_CR3 scratch_reg=%rbx save_reg=%r14
1214.Lparanoid_exit_restore: 1210.Lparanoid_exit_restore:
1215 jmp restore_regs_and_return_to_kernel 1211 jmp restore_regs_and_return_to_kernel
1216END(paranoid_exit) 1212END(paranoid_exit)
1217 1213
1218/* 1214/*
1219 * Save all registers in pt_regs, and switch gs if needed. 1215 * Save all registers in pt_regs, and switch GS if needed.
1220 * Return: EBX=0: came from user mode; EBX=1: otherwise 1216 * Return: EBX=0: came from user mode; EBX=1: otherwise
1221 */ 1217 */
1222ENTRY(error_entry) 1218ENTRY(error_entry)
1223 UNWIND_HINT_FUNC 1219 UNWIND_HINT_FUNC
1224 cld 1220 cld
1225 SAVE_C_REGS 8 1221 PUSH_AND_CLEAR_REGS save_ret=1
1226 SAVE_EXTRA_REGS 8
1227 ENCODE_FRAME_POINTER 8 1222 ENCODE_FRAME_POINTER 8
1228 xorl %ebx, %ebx
1229 testb $3, CS+8(%rsp) 1223 testb $3, CS+8(%rsp)
1230 jz .Lerror_kernelspace 1224 jz .Lerror_kernelspace
1231 1225
@@ -1406,22 +1400,7 @@ ENTRY(nmi)
1406 pushq 1*8(%rdx) /* pt_regs->rip */ 1400 pushq 1*8(%rdx) /* pt_regs->rip */
1407 UNWIND_HINT_IRET_REGS 1401 UNWIND_HINT_IRET_REGS
1408 pushq $-1 /* pt_regs->orig_ax */ 1402 pushq $-1 /* pt_regs->orig_ax */
1409 pushq %rdi /* pt_regs->di */ 1403 PUSH_AND_CLEAR_REGS rdx=(%rdx)
1410 pushq %rsi /* pt_regs->si */
1411 pushq (%rdx) /* pt_regs->dx */
1412 pushq %rcx /* pt_regs->cx */
1413 pushq %rax /* pt_regs->ax */
1414 pushq %r8 /* pt_regs->r8 */
1415 pushq %r9 /* pt_regs->r9 */
1416 pushq %r10 /* pt_regs->r10 */
1417 pushq %r11 /* pt_regs->r11 */
1418 pushq %rbx /* pt_regs->rbx */
1419 pushq %rbp /* pt_regs->rbp */
1420 pushq %r12 /* pt_regs->r12 */
1421 pushq %r13 /* pt_regs->r13 */
1422 pushq %r14 /* pt_regs->r14 */
1423 pushq %r15 /* pt_regs->r15 */
1424 UNWIND_HINT_REGS
1425 ENCODE_FRAME_POINTER 1404 ENCODE_FRAME_POINTER
1426 1405
1427 /* 1406 /*
@@ -1631,7 +1610,6 @@ end_repeat_nmi:
1631 * frame to point back to repeat_nmi. 1610 * frame to point back to repeat_nmi.
1632 */ 1611 */
1633 pushq $-1 /* ORIG_RAX: no syscall to restart */ 1612 pushq $-1 /* ORIG_RAX: no syscall to restart */
1634 ALLOC_PT_GPREGS_ON_STACK
1635 1613
1636 /* 1614 /*
1637 * Use paranoid_entry to handle SWAPGS, but no need to use paranoid_exit 1615 * Use paranoid_entry to handle SWAPGS, but no need to use paranoid_exit
@@ -1655,8 +1633,7 @@ end_repeat_nmi:
1655nmi_swapgs: 1633nmi_swapgs:
1656 SWAPGS_UNSAFE_STACK 1634 SWAPGS_UNSAFE_STACK
1657nmi_restore: 1635nmi_restore:
1658 POP_EXTRA_REGS 1636 POP_REGS
1659 POP_C_REGS
1660 1637
1661 /* 1638 /*
1662 * Skip orig_ax and the "outermost" frame to point RSP at the "iret" 1639 * Skip orig_ax and the "outermost" frame to point RSP at the "iret"
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 98d5358e4041..e811dd9c5e99 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -85,15 +85,25 @@ ENTRY(entry_SYSENTER_compat)
85 pushq %rcx /* pt_regs->cx */ 85 pushq %rcx /* pt_regs->cx */
86 pushq $-ENOSYS /* pt_regs->ax */ 86 pushq $-ENOSYS /* pt_regs->ax */
87 pushq $0 /* pt_regs->r8 = 0 */ 87 pushq $0 /* pt_regs->r8 = 0 */
88 xorl %r8d, %r8d /* nospec r8 */
88 pushq $0 /* pt_regs->r9 = 0 */ 89 pushq $0 /* pt_regs->r9 = 0 */
90 xorl %r9d, %r9d /* nospec r9 */
89 pushq $0 /* pt_regs->r10 = 0 */ 91 pushq $0 /* pt_regs->r10 = 0 */
92 xorl %r10d, %r10d /* nospec r10 */
90 pushq $0 /* pt_regs->r11 = 0 */ 93 pushq $0 /* pt_regs->r11 = 0 */
94 xorl %r11d, %r11d /* nospec r11 */
91 pushq %rbx /* pt_regs->rbx */ 95 pushq %rbx /* pt_regs->rbx */
96 xorl %ebx, %ebx /* nospec rbx */
92 pushq %rbp /* pt_regs->rbp (will be overwritten) */ 97 pushq %rbp /* pt_regs->rbp (will be overwritten) */
98 xorl %ebp, %ebp /* nospec rbp */
93 pushq $0 /* pt_regs->r12 = 0 */ 99 pushq $0 /* pt_regs->r12 = 0 */
100 xorl %r12d, %r12d /* nospec r12 */
94 pushq $0 /* pt_regs->r13 = 0 */ 101 pushq $0 /* pt_regs->r13 = 0 */
102 xorl %r13d, %r13d /* nospec r13 */
95 pushq $0 /* pt_regs->r14 = 0 */ 103 pushq $0 /* pt_regs->r14 = 0 */
104 xorl %r14d, %r14d /* nospec r14 */
96 pushq $0 /* pt_regs->r15 = 0 */ 105 pushq $0 /* pt_regs->r15 = 0 */
106 xorl %r15d, %r15d /* nospec r15 */
97 cld 107 cld
98 108
99 /* 109 /*
@@ -214,15 +224,25 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe)
214 pushq %rbp /* pt_regs->cx (stashed in bp) */ 224 pushq %rbp /* pt_regs->cx (stashed in bp) */
215 pushq $-ENOSYS /* pt_regs->ax */ 225 pushq $-ENOSYS /* pt_regs->ax */
216 pushq $0 /* pt_regs->r8 = 0 */ 226 pushq $0 /* pt_regs->r8 = 0 */
227 xorl %r8d, %r8d /* nospec r8 */
217 pushq $0 /* pt_regs->r9 = 0 */ 228 pushq $0 /* pt_regs->r9 = 0 */
229 xorl %r9d, %r9d /* nospec r9 */
218 pushq $0 /* pt_regs->r10 = 0 */ 230 pushq $0 /* pt_regs->r10 = 0 */
231 xorl %r10d, %r10d /* nospec r10 */
219 pushq $0 /* pt_regs->r11 = 0 */ 232 pushq $0 /* pt_regs->r11 = 0 */
233 xorl %r11d, %r11d /* nospec r11 */
220 pushq %rbx /* pt_regs->rbx */ 234 pushq %rbx /* pt_regs->rbx */
235 xorl %ebx, %ebx /* nospec rbx */
221 pushq %rbp /* pt_regs->rbp (will be overwritten) */ 236 pushq %rbp /* pt_regs->rbp (will be overwritten) */
237 xorl %ebp, %ebp /* nospec rbp */
222 pushq $0 /* pt_regs->r12 = 0 */ 238 pushq $0 /* pt_regs->r12 = 0 */
239 xorl %r12d, %r12d /* nospec r12 */
223 pushq $0 /* pt_regs->r13 = 0 */ 240 pushq $0 /* pt_regs->r13 = 0 */
241 xorl %r13d, %r13d /* nospec r13 */
224 pushq $0 /* pt_regs->r14 = 0 */ 242 pushq $0 /* pt_regs->r14 = 0 */
243 xorl %r14d, %r14d /* nospec r14 */
225 pushq $0 /* pt_regs->r15 = 0 */ 244 pushq $0 /* pt_regs->r15 = 0 */
245 xorl %r15d, %r15d /* nospec r15 */
226 246
227 /* 247 /*
228 * User mode is traced as though IRQs are on, and SYSENTER 248 * User mode is traced as though IRQs are on, and SYSENTER
@@ -278,9 +298,9 @@ sysret32_from_system_call:
278 */ 298 */
279 SWITCH_TO_USER_CR3_NOSTACK scratch_reg=%r8 scratch_reg2=%r9 299 SWITCH_TO_USER_CR3_NOSTACK scratch_reg=%r8 scratch_reg2=%r9
280 300
281 xorq %r8, %r8 301 xorl %r8d, %r8d
282 xorq %r9, %r9 302 xorl %r9d, %r9d
283 xorq %r10, %r10 303 xorl %r10d, %r10d
284 swapgs 304 swapgs
285 sysretl 305 sysretl
286END(entry_SYSCALL_compat) 306END(entry_SYSCALL_compat)
@@ -327,10 +347,23 @@ ENTRY(entry_INT80_compat)
327 */ 347 */
328 movl %eax, %eax 348 movl %eax, %eax
329 349
350 /* switch to thread stack expects orig_ax and rdi to be pushed */
330 pushq %rax /* pt_regs->orig_ax */ 351 pushq %rax /* pt_regs->orig_ax */
352 pushq %rdi /* pt_regs->di */
353
354 /* Need to switch before accessing the thread stack. */
355 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
356 movq %rsp, %rdi
357 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
358
359 pushq 6*8(%rdi) /* regs->ss */
360 pushq 5*8(%rdi) /* regs->rsp */
361 pushq 4*8(%rdi) /* regs->eflags */
362 pushq 3*8(%rdi) /* regs->cs */
363 pushq 2*8(%rdi) /* regs->ip */
364 pushq 1*8(%rdi) /* regs->orig_ax */
331 365
332 /* switch to thread stack expects orig_ax to be pushed */ 366 movq (%rdi), %rdi /* restore %rdi */
333 call switch_to_thread_stack
334 367
335 pushq %rdi /* pt_regs->di */ 368 pushq %rdi /* pt_regs->di */
336 pushq %rsi /* pt_regs->si */ 369 pushq %rsi /* pt_regs->si */
@@ -338,15 +371,25 @@ ENTRY(entry_INT80_compat)
338 pushq %rcx /* pt_regs->cx */ 371 pushq %rcx /* pt_regs->cx */
339 pushq $-ENOSYS /* pt_regs->ax */ 372 pushq $-ENOSYS /* pt_regs->ax */
340 pushq $0 /* pt_regs->r8 = 0 */ 373 pushq $0 /* pt_regs->r8 = 0 */
374 xorl %r8d, %r8d /* nospec r8 */
341 pushq $0 /* pt_regs->r9 = 0 */ 375 pushq $0 /* pt_regs->r9 = 0 */
376 xorl %r9d, %r9d /* nospec r9 */
342 pushq $0 /* pt_regs->r10 = 0 */ 377 pushq $0 /* pt_regs->r10 = 0 */
378 xorl %r10d, %r10d /* nospec r10 */
343 pushq $0 /* pt_regs->r11 = 0 */ 379 pushq $0 /* pt_regs->r11 = 0 */
380 xorl %r11d, %r11d /* nospec r11 */
344 pushq %rbx /* pt_regs->rbx */ 381 pushq %rbx /* pt_regs->rbx */
382 xorl %ebx, %ebx /* nospec rbx */
345 pushq %rbp /* pt_regs->rbp */ 383 pushq %rbp /* pt_regs->rbp */
384 xorl %ebp, %ebp /* nospec rbp */
346 pushq %r12 /* pt_regs->r12 */ 385 pushq %r12 /* pt_regs->r12 */
386 xorl %r12d, %r12d /* nospec r12 */
347 pushq %r13 /* pt_regs->r13 */ 387 pushq %r13 /* pt_regs->r13 */
388 xorl %r13d, %r13d /* nospec r13 */
348 pushq %r14 /* pt_regs->r14 */ 389 pushq %r14 /* pt_regs->r14 */
390 xorl %r14d, %r14d /* nospec r14 */
349 pushq %r15 /* pt_regs->r15 */ 391 pushq %r15 /* pt_regs->r15 */
392 xorl %r15d, %r15d /* nospec r15 */
350 cld 393 cld
351 394
352 /* 395 /*
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 731153a4681e..56457cb73448 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3559,7 +3559,7 @@ static int intel_snb_pebs_broken(int cpu)
3559 break; 3559 break;
3560 3560
3561 case INTEL_FAM6_SANDYBRIDGE_X: 3561 case INTEL_FAM6_SANDYBRIDGE_X:
3562 switch (cpu_data(cpu).x86_mask) { 3562 switch (cpu_data(cpu).x86_stepping) {
3563 case 6: rev = 0x618; break; 3563 case 6: rev = 0x618; break;
3564 case 7: rev = 0x70c; break; 3564 case 7: rev = 0x70c; break;
3565 } 3565 }
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index ae64d0b69729..cf372b90557e 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -1186,7 +1186,7 @@ void __init intel_pmu_lbr_init_atom(void)
1186 * on PMU interrupt 1186 * on PMU interrupt
1187 */ 1187 */
1188 if (boot_cpu_data.x86_model == 28 1188 if (boot_cpu_data.x86_model == 28
1189 && boot_cpu_data.x86_mask < 10) { 1189 && boot_cpu_data.x86_stepping < 10) {
1190 pr_cont("LBR disabled due to erratum"); 1190 pr_cont("LBR disabled due to erratum");
1191 return; 1191 return;
1192 } 1192 }
diff --git a/arch/x86/events/intel/p6.c b/arch/x86/events/intel/p6.c
index a5604c352930..408879b0c0d4 100644
--- a/arch/x86/events/intel/p6.c
+++ b/arch/x86/events/intel/p6.c
@@ -234,7 +234,7 @@ static __initconst const struct x86_pmu p6_pmu = {
234 234
235static __init void p6_pmu_rdpmc_quirk(void) 235static __init void p6_pmu_rdpmc_quirk(void)
236{ 236{
237 if (boot_cpu_data.x86_mask < 9) { 237 if (boot_cpu_data.x86_stepping < 9) {
238 /* 238 /*
239 * PPro erratum 26; fixed in stepping 9 and above. 239 * PPro erratum 26; fixed in stepping 9 and above.
240 */ 240 */
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 44f5d79d5105..11881726ed37 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -94,7 +94,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
94 if (boot_cpu_data.x86 == 0x0F && 94 if (boot_cpu_data.x86 == 0x0F &&
95 boot_cpu_data.x86_vendor == X86_VENDOR_AMD && 95 boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
96 boot_cpu_data.x86_model <= 0x05 && 96 boot_cpu_data.x86_model <= 0x05 &&
97 boot_cpu_data.x86_mask < 0x0A) 97 boot_cpu_data.x86_stepping < 0x0A)
98 return 1; 98 return 1;
99 else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E)) 99 else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E))
100 return 1; 100 return 1;
diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h
index 4d4015ddcf26..c356098b6fb9 100644
--- a/arch/x86/include/asm/apm.h
+++ b/arch/x86/include/asm/apm.h
@@ -7,6 +7,8 @@
7#ifndef _ASM_X86_MACH_DEFAULT_APM_H 7#ifndef _ASM_X86_MACH_DEFAULT_APM_H
8#define _ASM_X86_MACH_DEFAULT_APM_H 8#define _ASM_X86_MACH_DEFAULT_APM_H
9 9
10#include <asm/nospec-branch.h>
11
10#ifdef APM_ZERO_SEGS 12#ifdef APM_ZERO_SEGS
11# define APM_DO_ZERO_SEGS \ 13# define APM_DO_ZERO_SEGS \
12 "pushl %%ds\n\t" \ 14 "pushl %%ds\n\t" \
@@ -32,6 +34,7 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
32 * N.B. We do NOT need a cld after the BIOS call 34 * N.B. We do NOT need a cld after the BIOS call
33 * because we always save and restore the flags. 35 * because we always save and restore the flags.
34 */ 36 */
37 firmware_restrict_branch_speculation_start();
35 __asm__ __volatile__(APM_DO_ZERO_SEGS 38 __asm__ __volatile__(APM_DO_ZERO_SEGS
36 "pushl %%edi\n\t" 39 "pushl %%edi\n\t"
37 "pushl %%ebp\n\t" 40 "pushl %%ebp\n\t"
@@ -44,6 +47,7 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
44 "=S" (*esi) 47 "=S" (*esi)
45 : "a" (func), "b" (ebx_in), "c" (ecx_in) 48 : "a" (func), "b" (ebx_in), "c" (ecx_in)
46 : "memory", "cc"); 49 : "memory", "cc");
50 firmware_restrict_branch_speculation_end();
47} 51}
48 52
49static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, 53static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
@@ -56,6 +60,7 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
56 * N.B. We do NOT need a cld after the BIOS call 60 * N.B. We do NOT need a cld after the BIOS call
57 * because we always save and restore the flags. 61 * because we always save and restore the flags.
58 */ 62 */
63 firmware_restrict_branch_speculation_start();
59 __asm__ __volatile__(APM_DO_ZERO_SEGS 64 __asm__ __volatile__(APM_DO_ZERO_SEGS
60 "pushl %%edi\n\t" 65 "pushl %%edi\n\t"
61 "pushl %%ebp\n\t" 66 "pushl %%ebp\n\t"
@@ -68,6 +73,7 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
68 "=S" (si) 73 "=S" (si)
69 : "a" (func), "b" (ebx_in), "c" (ecx_in) 74 : "a" (func), "b" (ebx_in), "c" (ecx_in)
70 : "memory", "cc"); 75 : "memory", "cc");
76 firmware_restrict_branch_speculation_end();
71 return error; 77 return error;
72} 78}
73 79
diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
index 4d111616524b..1908214b9125 100644
--- a/arch/x86/include/asm/asm-prototypes.h
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -38,7 +38,4 @@ INDIRECT_THUNK(dx)
38INDIRECT_THUNK(si) 38INDIRECT_THUNK(si)
39INDIRECT_THUNK(di) 39INDIRECT_THUNK(di)
40INDIRECT_THUNK(bp) 40INDIRECT_THUNK(bp)
41asmlinkage void __fill_rsb(void);
42asmlinkage void __clear_rsb(void);
43
44#endif /* CONFIG_RETPOLINE */ 41#endif /* CONFIG_RETPOLINE */
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
index 30d406146016..e1259f043ae9 100644
--- a/arch/x86/include/asm/barrier.h
+++ b/arch/x86/include/asm/barrier.h
@@ -40,7 +40,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
40 40
41 asm ("cmp %1,%2; sbb %0,%0;" 41 asm ("cmp %1,%2; sbb %0,%0;"
42 :"=r" (mask) 42 :"=r" (mask)
43 :"r"(size),"r" (index) 43 :"g"(size),"r" (index)
44 :"cc"); 44 :"cc");
45 return mask; 45 return mask;
46} 46}
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 3fa039855b8f..9f645ba57dbb 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -78,7 +78,7 @@ set_bit(long nr, volatile unsigned long *addr)
78 : "iq" ((u8)CONST_MASK(nr)) 78 : "iq" ((u8)CONST_MASK(nr))
79 : "memory"); 79 : "memory");
80 } else { 80 } else {
81 asm volatile(LOCK_PREFIX "bts %1,%0" 81 asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0"
82 : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); 82 : BITOP_ADDR(addr) : "Ir" (nr) : "memory");
83 } 83 }
84} 84}
@@ -94,7 +94,7 @@ set_bit(long nr, volatile unsigned long *addr)
94 */ 94 */
95static __always_inline void __set_bit(long nr, volatile unsigned long *addr) 95static __always_inline void __set_bit(long nr, volatile unsigned long *addr)
96{ 96{
97 asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); 97 asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory");
98} 98}
99 99
100/** 100/**
@@ -115,7 +115,7 @@ clear_bit(long nr, volatile unsigned long *addr)
115 : CONST_MASK_ADDR(nr, addr) 115 : CONST_MASK_ADDR(nr, addr)
116 : "iq" ((u8)~CONST_MASK(nr))); 116 : "iq" ((u8)~CONST_MASK(nr)));
117 } else { 117 } else {
118 asm volatile(LOCK_PREFIX "btr %1,%0" 118 asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0"
119 : BITOP_ADDR(addr) 119 : BITOP_ADDR(addr)
120 : "Ir" (nr)); 120 : "Ir" (nr));
121 } 121 }
@@ -137,7 +137,7 @@ static __always_inline void clear_bit_unlock(long nr, volatile unsigned long *ad
137 137
138static __always_inline void __clear_bit(long nr, volatile unsigned long *addr) 138static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)
139{ 139{
140 asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); 140 asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr));
141} 141}
142 142
143static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr) 143static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
@@ -182,7 +182,7 @@ static __always_inline void __clear_bit_unlock(long nr, volatile unsigned long *
182 */ 182 */
183static __always_inline void __change_bit(long nr, volatile unsigned long *addr) 183static __always_inline void __change_bit(long nr, volatile unsigned long *addr)
184{ 184{
185 asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); 185 asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr));
186} 186}
187 187
188/** 188/**
@@ -201,7 +201,7 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr)
201 : CONST_MASK_ADDR(nr, addr) 201 : CONST_MASK_ADDR(nr, addr)
202 : "iq" ((u8)CONST_MASK(nr))); 202 : "iq" ((u8)CONST_MASK(nr)));
203 } else { 203 } else {
204 asm volatile(LOCK_PREFIX "btc %1,%0" 204 asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0"
205 : BITOP_ADDR(addr) 205 : BITOP_ADDR(addr)
206 : "Ir" (nr)); 206 : "Ir" (nr));
207 } 207 }
@@ -217,7 +217,8 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr)
217 */ 217 */
218static __always_inline bool test_and_set_bit(long nr, volatile unsigned long *addr) 218static __always_inline bool test_and_set_bit(long nr, volatile unsigned long *addr)
219{ 219{
220 GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", c); 220 GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts),
221 *addr, "Ir", nr, "%0", c);
221} 222}
222 223
223/** 224/**
@@ -246,7 +247,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
246{ 247{
247 bool oldbit; 248 bool oldbit;
248 249
249 asm("bts %2,%1" 250 asm(__ASM_SIZE(bts) " %2,%1"
250 CC_SET(c) 251 CC_SET(c)
251 : CC_OUT(c) (oldbit), ADDR 252 : CC_OUT(c) (oldbit), ADDR
252 : "Ir" (nr)); 253 : "Ir" (nr));
@@ -263,7 +264,8 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
263 */ 264 */
264static __always_inline bool test_and_clear_bit(long nr, volatile unsigned long *addr) 265static __always_inline bool test_and_clear_bit(long nr, volatile unsigned long *addr)
265{ 266{
266 GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", c); 267 GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btr),
268 *addr, "Ir", nr, "%0", c);
267} 269}
268 270
269/** 271/**
@@ -286,7 +288,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long
286{ 288{
287 bool oldbit; 289 bool oldbit;
288 290
289 asm volatile("btr %2,%1" 291 asm volatile(__ASM_SIZE(btr) " %2,%1"
290 CC_SET(c) 292 CC_SET(c)
291 : CC_OUT(c) (oldbit), ADDR 293 : CC_OUT(c) (oldbit), ADDR
292 : "Ir" (nr)); 294 : "Ir" (nr));
@@ -298,7 +300,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
298{ 300{
299 bool oldbit; 301 bool oldbit;
300 302
301 asm volatile("btc %2,%1" 303 asm volatile(__ASM_SIZE(btc) " %2,%1"
302 CC_SET(c) 304 CC_SET(c)
303 : CC_OUT(c) (oldbit), ADDR 305 : CC_OUT(c) (oldbit), ADDR
304 : "Ir" (nr) : "memory"); 306 : "Ir" (nr) : "memory");
@@ -316,7 +318,8 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
316 */ 318 */
317static __always_inline bool test_and_change_bit(long nr, volatile unsigned long *addr) 319static __always_inline bool test_and_change_bit(long nr, volatile unsigned long *addr)
318{ 320{
319 GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", c); 321 GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc),
322 *addr, "Ir", nr, "%0", c);
320} 323}
321 324
322static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr) 325static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
@@ -329,7 +332,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l
329{ 332{
330 bool oldbit; 333 bool oldbit;
331 334
332 asm volatile("bt %2,%1" 335 asm volatile(__ASM_SIZE(bt) " %2,%1"
333 CC_SET(c) 336 CC_SET(c)
334 : CC_OUT(c) (oldbit) 337 : CC_OUT(c) (oldbit)
335 : "m" (*(unsigned long *)addr), "Ir" (nr)); 338 : "m" (*(unsigned long *)addr), "Ir" (nr));
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 34d99af43994..6804d6642767 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -5,23 +5,20 @@
5#include <linux/stringify.h> 5#include <linux/stringify.h>
6 6
7/* 7/*
8 * Since some emulators terminate on UD2, we cannot use it for WARN. 8 * Despite that some emulators terminate on UD2, we use it for WARN().
9 * Since various instruction decoders disagree on the length of UD1,
10 * we cannot use it either. So use UD0 for WARN.
11 * 9 *
12 * (binutils knows about "ud1" but {en,de}codes it as 2 bytes, whereas 10 * Since various instruction decoders/specs disagree on the encoding of
13 * our kernel decoder thinks it takes a ModRM byte, which seems consistent 11 * UD0/UD1.
14 * with various things like the Intel SDM instruction encoding rules)
15 */ 12 */
16 13
17#define ASM_UD0 ".byte 0x0f, 0xff" 14#define ASM_UD0 ".byte 0x0f, 0xff" /* + ModRM (for Intel) */
18#define ASM_UD1 ".byte 0x0f, 0xb9" /* + ModRM */ 15#define ASM_UD1 ".byte 0x0f, 0xb9" /* + ModRM */
19#define ASM_UD2 ".byte 0x0f, 0x0b" 16#define ASM_UD2 ".byte 0x0f, 0x0b"
20 17
21#define INSN_UD0 0xff0f 18#define INSN_UD0 0xff0f
22#define INSN_UD2 0x0b0f 19#define INSN_UD2 0x0b0f
23 20
24#define LEN_UD0 2 21#define LEN_UD2 2
25 22
26#ifdef CONFIG_GENERIC_BUG 23#ifdef CONFIG_GENERIC_BUG
27 24
@@ -77,7 +74,11 @@ do { \
77 unreachable(); \ 74 unreachable(); \
78} while (0) 75} while (0)
79 76
80#define __WARN_FLAGS(flags) _BUG_FLAGS(ASM_UD0, BUGFLAG_WARNING|(flags)) 77#define __WARN_FLAGS(flags) \
78do { \
79 _BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \
80 annotate_reachable(); \
81} while (0)
81 82
82#include <asm-generic/bug.h> 83#include <asm-generic/bug.h>
83 84
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 70eddb3922ff..736771c9822e 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -148,45 +148,46 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
148 */ 148 */
149static __always_inline __pure bool _static_cpu_has(u16 bit) 149static __always_inline __pure bool _static_cpu_has(u16 bit)
150{ 150{
151 asm_volatile_goto("1: jmp 6f\n" 151 asm_volatile_goto("1: jmp 6f\n"
152 "2:\n" 152 "2:\n"
153 ".skip -(((5f-4f) - (2b-1b)) > 0) * " 153 ".skip -(((5f-4f) - (2b-1b)) > 0) * "
154 "((5f-4f) - (2b-1b)),0x90\n" 154 "((5f-4f) - (2b-1b)),0x90\n"
155 "3:\n" 155 "3:\n"
156 ".section .altinstructions,\"a\"\n" 156 ".section .altinstructions,\"a\"\n"
157 " .long 1b - .\n" /* src offset */ 157 " .long 1b - .\n" /* src offset */
158 " .long 4f - .\n" /* repl offset */ 158 " .long 4f - .\n" /* repl offset */
159 " .word %P1\n" /* always replace */ 159 " .word %P[always]\n" /* always replace */
160 " .byte 3b - 1b\n" /* src len */ 160 " .byte 3b - 1b\n" /* src len */
161 " .byte 5f - 4f\n" /* repl len */ 161 " .byte 5f - 4f\n" /* repl len */
162 " .byte 3b - 2b\n" /* pad len */ 162 " .byte 3b - 2b\n" /* pad len */
163 ".previous\n" 163 ".previous\n"
164 ".section .altinstr_replacement,\"ax\"\n" 164 ".section .altinstr_replacement,\"ax\"\n"
165 "4: jmp %l[t_no]\n" 165 "4: jmp %l[t_no]\n"
166 "5:\n" 166 "5:\n"
167 ".previous\n" 167 ".previous\n"
168 ".section .altinstructions,\"a\"\n" 168 ".section .altinstructions,\"a\"\n"
169 " .long 1b - .\n" /* src offset */ 169 " .long 1b - .\n" /* src offset */
170 " .long 0\n" /* no replacement */ 170 " .long 0\n" /* no replacement */
171 " .word %P0\n" /* feature bit */ 171 " .word %P[feature]\n" /* feature bit */
172 " .byte 3b - 1b\n" /* src len */ 172 " .byte 3b - 1b\n" /* src len */
173 " .byte 0\n" /* repl len */ 173 " .byte 0\n" /* repl len */
174 " .byte 0\n" /* pad len */ 174 " .byte 0\n" /* pad len */
175 ".previous\n" 175 ".previous\n"
176 ".section .altinstr_aux,\"ax\"\n" 176 ".section .altinstr_aux,\"ax\"\n"
177 "6:\n" 177 "6:\n"
178 " testb %[bitnum],%[cap_byte]\n" 178 " testb %[bitnum],%[cap_byte]\n"
179 " jnz %l[t_yes]\n" 179 " jnz %l[t_yes]\n"
180 " jmp %l[t_no]\n" 180 " jmp %l[t_no]\n"
181 ".previous\n" 181 ".previous\n"
182 : : "i" (bit), "i" (X86_FEATURE_ALWAYS), 182 : : [feature] "i" (bit),
183 [bitnum] "i" (1 << (bit & 7)), 183 [always] "i" (X86_FEATURE_ALWAYS),
184 [cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3]) 184 [bitnum] "i" (1 << (bit & 7)),
185 : : t_yes, t_no); 185 [cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3])
186 t_yes: 186 : : t_yes, t_no);
187 return true; 187t_yes:
188 t_no: 188 return true;
189 return false; 189t_no:
190 return false;
190} 191}
191 192
192#define static_cpu_has(bit) \ 193#define static_cpu_has(bit) \
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 0dfe4d3f74e2..f41079da38c5 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -213,6 +213,7 @@
213#define X86_FEATURE_SEV ( 7*32+20) /* AMD Secure Encrypted Virtualization */ 213#define X86_FEATURE_SEV ( 7*32+20) /* AMD Secure Encrypted Virtualization */
214 214
215#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */ 215#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
216#define X86_FEATURE_USE_IBRS_FW ( 7*32+22) /* "" Use IBRS during runtime firmware calls */
216 217
217/* Virtualization flags: Linux defined, word 8 */ 218/* Virtualization flags: Linux defined, word 8 */
218#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */ 219#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 85f6ccb80b91..a399c1ebf6f0 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -6,6 +6,7 @@
6#include <asm/pgtable.h> 6#include <asm/pgtable.h>
7#include <asm/processor-flags.h> 7#include <asm/processor-flags.h>
8#include <asm/tlb.h> 8#include <asm/tlb.h>
9#include <asm/nospec-branch.h>
9 10
10/* 11/*
11 * We map the EFI regions needed for runtime services non-contiguously, 12 * We map the EFI regions needed for runtime services non-contiguously,
@@ -36,8 +37,18 @@
36 37
37extern asmlinkage unsigned long efi_call_phys(void *, ...); 38extern asmlinkage unsigned long efi_call_phys(void *, ...);
38 39
39#define arch_efi_call_virt_setup() kernel_fpu_begin() 40#define arch_efi_call_virt_setup() \
40#define arch_efi_call_virt_teardown() kernel_fpu_end() 41({ \
42 kernel_fpu_begin(); \
43 firmware_restrict_branch_speculation_start(); \
44})
45
46#define arch_efi_call_virt_teardown() \
47({ \
48 firmware_restrict_branch_speculation_end(); \
49 kernel_fpu_end(); \
50})
51
41 52
42/* 53/*
43 * Wrap all the virtual calls in a way that forces the parameters on the stack. 54 * Wrap all the virtual calls in a way that forces the parameters on the stack.
@@ -73,6 +84,7 @@ struct efi_scratch {
73 efi_sync_low_kernel_mappings(); \ 84 efi_sync_low_kernel_mappings(); \
74 preempt_disable(); \ 85 preempt_disable(); \
75 __kernel_fpu_begin(); \ 86 __kernel_fpu_begin(); \
87 firmware_restrict_branch_speculation_start(); \
76 \ 88 \
77 if (efi_scratch.use_pgd) { \ 89 if (efi_scratch.use_pgd) { \
78 efi_scratch.prev_cr3 = __read_cr3(); \ 90 efi_scratch.prev_cr3 = __read_cr3(); \
@@ -91,6 +103,7 @@ struct efi_scratch {
91 __flush_tlb_all(); \ 103 __flush_tlb_all(); \
92 } \ 104 } \
93 \ 105 \
106 firmware_restrict_branch_speculation_end(); \
94 __kernel_fpu_end(); \ 107 __kernel_fpu_end(); \
95 preempt_enable(); \ 108 preempt_enable(); \
96}) 109})
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index dd6f57a54a26..b605a5b6a30c 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -507,6 +507,7 @@ struct kvm_vcpu_arch {
507 u64 smi_count; 507 u64 smi_count;
508 bool tpr_access_reporting; 508 bool tpr_access_reporting;
509 u64 ia32_xss; 509 u64 ia32_xss;
510 u64 microcode_version;
510 511
511 /* 512 /*
512 * Paging state of the vcpu 513 * Paging state of the vcpu
@@ -1095,6 +1096,8 @@ struct kvm_x86_ops {
1095 int (*mem_enc_op)(struct kvm *kvm, void __user *argp); 1096 int (*mem_enc_op)(struct kvm *kvm, void __user *argp);
1096 int (*mem_enc_reg_region)(struct kvm *kvm, struct kvm_enc_region *argp); 1097 int (*mem_enc_reg_region)(struct kvm *kvm, struct kvm_enc_region *argp);
1097 int (*mem_enc_unreg_region)(struct kvm *kvm, struct kvm_enc_region *argp); 1098 int (*mem_enc_unreg_region)(struct kvm *kvm, struct kvm_enc_region *argp);
1099
1100 int (*get_msr_feature)(struct kvm_msr_entry *entry);
1098}; 1101};
1099 1102
1100struct kvm_arch_async_pf { 1103struct kvm_arch_async_pf {
@@ -1464,7 +1467,4 @@ static inline int kvm_cpu_get_apicid(int mps_cpu)
1464#define put_smstate(type, buf, offset, val) \ 1467#define put_smstate(type, buf, offset, val) \
1465 *(type *)((buf) + (offset) - 0x7e00) = val 1468 *(type *)((buf) + (offset) - 0x7e00) = val
1466 1469
1467void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
1468 unsigned long start, unsigned long end);
1469
1470#endif /* _ASM_X86_KVM_HOST_H */ 1470#endif /* _ASM_X86_KVM_HOST_H */
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 55520cec8b27..7fb1047d61c7 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -37,7 +37,12 @@ struct cpu_signature {
37 37
38struct device; 38struct device;
39 39
40enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND }; 40enum ucode_state {
41 UCODE_OK = 0,
42 UCODE_UPDATED,
43 UCODE_NFOUND,
44 UCODE_ERROR,
45};
41 46
42struct microcode_ops { 47struct microcode_ops {
43 enum ucode_state (*request_microcode_user) (int cpu, 48 enum ucode_state (*request_microcode_user) (int cpu,
@@ -54,7 +59,7 @@ struct microcode_ops {
54 * are being called. 59 * are being called.
55 * See also the "Synchronization" section in microcode_core.c. 60 * See also the "Synchronization" section in microcode_core.c.
56 */ 61 */
57 int (*apply_microcode) (int cpu); 62 enum ucode_state (*apply_microcode) (int cpu);
58 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig); 63 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig);
59}; 64};
60 65
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index c931b88982a0..1de72ce514cd 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -74,6 +74,7 @@ static inline void *ldt_slot_va(int slot)
74 return (void *)(LDT_BASE_ADDR + LDT_SLOT_STRIDE * slot); 74 return (void *)(LDT_BASE_ADDR + LDT_SLOT_STRIDE * slot);
75#else 75#else
76 BUG(); 76 BUG();
77 return (void *)fix_to_virt(FIX_HOLE);
77#endif 78#endif
78} 79}
79 80
diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 4d57894635f2..d0dabeae0505 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -6,6 +6,51 @@
6#include <asm/alternative.h> 6#include <asm/alternative.h>
7#include <asm/alternative-asm.h> 7#include <asm/alternative-asm.h>
8#include <asm/cpufeatures.h> 8#include <asm/cpufeatures.h>
9#include <asm/msr-index.h>
10
11/*
12 * Fill the CPU return stack buffer.
13 *
14 * Each entry in the RSB, if used for a speculative 'ret', contains an
15 * infinite 'pause; lfence; jmp' loop to capture speculative execution.
16 *
17 * This is required in various cases for retpoline and IBRS-based
18 * mitigations for the Spectre variant 2 vulnerability. Sometimes to
19 * eliminate potentially bogus entries from the RSB, and sometimes
20 * purely to ensure that it doesn't get empty, which on some CPUs would
21 * allow predictions from other (unwanted!) sources to be used.
22 *
23 * We define a CPP macro such that it can be used from both .S files and
24 * inline assembly. It's possible to do a .macro and then include that
25 * from C via asm(".include <asm/nospec-branch.h>") but let's not go there.
26 */
27
28#define RSB_CLEAR_LOOPS 32 /* To forcibly overwrite all entries */
29#define RSB_FILL_LOOPS 16 /* To avoid underflow */
30
31/*
32 * Google experimented with loop-unrolling and this turned out to be
33 * the optimal version — two calls, each with their own speculation
34 * trap should their return address end up getting used, in a loop.
35 */
36#define __FILL_RETURN_BUFFER(reg, nr, sp) \
37 mov $(nr/2), reg; \
38771: \
39 call 772f; \
40773: /* speculation trap */ \
41 pause; \
42 lfence; \
43 jmp 773b; \
44772: \
45 call 774f; \
46775: /* speculation trap */ \
47 pause; \
48 lfence; \
49 jmp 775b; \
50774: \
51 dec reg; \
52 jnz 771b; \
53 add $(BITS_PER_LONG/8) * nr, sp;
9 54
10#ifdef __ASSEMBLY__ 55#ifdef __ASSEMBLY__
11 56
@@ -23,6 +68,18 @@
23.endm 68.endm
24 69
25/* 70/*
71 * This should be used immediately before an indirect jump/call. It tells
72 * objtool the subsequent indirect jump/call is vouched safe for retpoline
73 * builds.
74 */
75.macro ANNOTATE_RETPOLINE_SAFE
76 .Lannotate_\@:
77 .pushsection .discard.retpoline_safe
78 _ASM_PTR .Lannotate_\@
79 .popsection
80.endm
81
82/*
26 * These are the bare retpoline primitives for indirect jmp and call. 83 * These are the bare retpoline primitives for indirect jmp and call.
27 * Do not use these directly; they only exist to make the ALTERNATIVE 84 * Do not use these directly; they only exist to make the ALTERNATIVE
28 * invocation below less ugly. 85 * invocation below less ugly.
@@ -58,9 +115,9 @@
58.macro JMP_NOSPEC reg:req 115.macro JMP_NOSPEC reg:req
59#ifdef CONFIG_RETPOLINE 116#ifdef CONFIG_RETPOLINE
60 ANNOTATE_NOSPEC_ALTERNATIVE 117 ANNOTATE_NOSPEC_ALTERNATIVE
61 ALTERNATIVE_2 __stringify(jmp *\reg), \ 118 ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *\reg), \
62 __stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE, \ 119 __stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE, \
63 __stringify(lfence; jmp *\reg), X86_FEATURE_RETPOLINE_AMD 120 __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
64#else 121#else
65 jmp *\reg 122 jmp *\reg
66#endif 123#endif
@@ -69,18 +126,25 @@
69.macro CALL_NOSPEC reg:req 126.macro CALL_NOSPEC reg:req
70#ifdef CONFIG_RETPOLINE 127#ifdef CONFIG_RETPOLINE
71 ANNOTATE_NOSPEC_ALTERNATIVE 128 ANNOTATE_NOSPEC_ALTERNATIVE
72 ALTERNATIVE_2 __stringify(call *\reg), \ 129 ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; call *\reg), \
73 __stringify(RETPOLINE_CALL \reg), X86_FEATURE_RETPOLINE,\ 130 __stringify(RETPOLINE_CALL \reg), X86_FEATURE_RETPOLINE,\
74 __stringify(lfence; call *\reg), X86_FEATURE_RETPOLINE_AMD 131 __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; call *\reg), X86_FEATURE_RETPOLINE_AMD
75#else 132#else
76 call *\reg 133 call *\reg
77#endif 134#endif
78.endm 135.endm
79 136
80/* This clobbers the BX register */ 137 /*
81.macro FILL_RETURN_BUFFER nr:req ftr:req 138 * A simpler FILL_RETURN_BUFFER macro. Don't make people use the CPP
139 * monstrosity above, manually.
140 */
141.macro FILL_RETURN_BUFFER reg:req nr:req ftr:req
82#ifdef CONFIG_RETPOLINE 142#ifdef CONFIG_RETPOLINE
83 ALTERNATIVE "", "call __clear_rsb", \ftr 143 ANNOTATE_NOSPEC_ALTERNATIVE
144 ALTERNATIVE "jmp .Lskip_rsb_\@", \
145 __stringify(__FILL_RETURN_BUFFER(\reg,\nr,%_ASM_SP)) \
146 \ftr
147.Lskip_rsb_\@:
84#endif 148#endif
85.endm 149.endm
86 150
@@ -92,6 +156,12 @@
92 ".long 999b - .\n\t" \ 156 ".long 999b - .\n\t" \
93 ".popsection\n\t" 157 ".popsection\n\t"
94 158
159#define ANNOTATE_RETPOLINE_SAFE \
160 "999:\n\t" \
161 ".pushsection .discard.retpoline_safe\n\t" \
162 _ASM_PTR " 999b\n\t" \
163 ".popsection\n\t"
164
95#if defined(CONFIG_X86_64) && defined(RETPOLINE) 165#if defined(CONFIG_X86_64) && defined(RETPOLINE)
96 166
97/* 167/*
@@ -101,6 +171,7 @@
101# define CALL_NOSPEC \ 171# define CALL_NOSPEC \
102 ANNOTATE_NOSPEC_ALTERNATIVE \ 172 ANNOTATE_NOSPEC_ALTERNATIVE \
103 ALTERNATIVE( \ 173 ALTERNATIVE( \
174 ANNOTATE_RETPOLINE_SAFE \
104 "call *%[thunk_target]\n", \ 175 "call *%[thunk_target]\n", \
105 "call __x86_indirect_thunk_%V[thunk_target]\n", \ 176 "call __x86_indirect_thunk_%V[thunk_target]\n", \
106 X86_FEATURE_RETPOLINE) 177 X86_FEATURE_RETPOLINE)
@@ -155,20 +226,90 @@ extern char __indirect_thunk_end[];
155static inline void vmexit_fill_RSB(void) 226static inline void vmexit_fill_RSB(void)
156{ 227{
157#ifdef CONFIG_RETPOLINE 228#ifdef CONFIG_RETPOLINE
158 alternative_input("", 229 unsigned long loops;
159 "call __fill_rsb", 230
160 X86_FEATURE_RETPOLINE, 231 asm volatile (ANNOTATE_NOSPEC_ALTERNATIVE
161 ASM_NO_INPUT_CLOBBER(_ASM_BX, "memory")); 232 ALTERNATIVE("jmp 910f",
233 __stringify(__FILL_RETURN_BUFFER(%0, RSB_CLEAR_LOOPS, %1)),
234 X86_FEATURE_RETPOLINE)
235 "910:"
236 : "=r" (loops), ASM_CALL_CONSTRAINT
237 : : "memory" );
162#endif 238#endif
163} 239}
164 240
241#define alternative_msr_write(_msr, _val, _feature) \
242 asm volatile(ALTERNATIVE("", \
243 "movl %[msr], %%ecx\n\t" \
244 "movl %[val], %%eax\n\t" \
245 "movl $0, %%edx\n\t" \
246 "wrmsr", \
247 _feature) \
248 : : [msr] "i" (_msr), [val] "i" (_val) \
249 : "eax", "ecx", "edx", "memory")
250
165static inline void indirect_branch_prediction_barrier(void) 251static inline void indirect_branch_prediction_barrier(void)
166{ 252{
167 alternative_input("", 253 alternative_msr_write(MSR_IA32_PRED_CMD, PRED_CMD_IBPB,
168 "call __ibp_barrier", 254 X86_FEATURE_USE_IBPB);
169 X86_FEATURE_USE_IBPB,
170 ASM_NO_INPUT_CLOBBER("eax", "ecx", "edx", "memory"));
171} 255}
172 256
257/*
258 * With retpoline, we must use IBRS to restrict branch prediction
259 * before calling into firmware.
260 *
261 * (Implemented as CPP macros due to header hell.)
262 */
263#define firmware_restrict_branch_speculation_start() \
264do { \
265 preempt_disable(); \
266 alternative_msr_write(MSR_IA32_SPEC_CTRL, SPEC_CTRL_IBRS, \
267 X86_FEATURE_USE_IBRS_FW); \
268} while (0)
269
270#define firmware_restrict_branch_speculation_end() \
271do { \
272 alternative_msr_write(MSR_IA32_SPEC_CTRL, 0, \
273 X86_FEATURE_USE_IBRS_FW); \
274 preempt_enable(); \
275} while (0)
276
173#endif /* __ASSEMBLY__ */ 277#endif /* __ASSEMBLY__ */
278
279/*
280 * Below is used in the eBPF JIT compiler and emits the byte sequence
281 * for the following assembly:
282 *
283 * With retpolines configured:
284 *
285 * callq do_rop
286 * spec_trap:
287 * pause
288 * lfence
289 * jmp spec_trap
290 * do_rop:
291 * mov %rax,(%rsp)
292 * retq
293 *
294 * Without retpolines configured:
295 *
296 * jmp *%rax
297 */
298#ifdef CONFIG_RETPOLINE
299# define RETPOLINE_RAX_BPF_JIT_SIZE 17
300# define RETPOLINE_RAX_BPF_JIT() \
301 EMIT1_off32(0xE8, 7); /* callq do_rop */ \
302 /* spec_trap: */ \
303 EMIT2(0xF3, 0x90); /* pause */ \
304 EMIT3(0x0F, 0xAE, 0xE8); /* lfence */ \
305 EMIT2(0xEB, 0xF9); /* jmp spec_trap */ \
306 /* do_rop: */ \
307 EMIT4(0x48, 0x89, 0x04, 0x24); /* mov %rax,(%rsp) */ \
308 EMIT1(0xC3); /* retq */
309#else
310# define RETPOLINE_RAX_BPF_JIT_SIZE 2
311# define RETPOLINE_RAX_BPF_JIT() \
312 EMIT2(0xFF, 0xE0); /* jmp *%rax */
313#endif
314
174#endif /* _ASM_X86_NOSPEC_BRANCH_H_ */ 315#endif /* _ASM_X86_NOSPEC_BRANCH_H_ */
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 4baa6bceb232..d652a3808065 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -52,10 +52,6 @@ static inline void clear_page(void *page)
52 52
53void copy_page(void *to, void *from); 53void copy_page(void *to, void *from);
54 54
55#ifdef CONFIG_X86_MCE
56#define arch_unmap_kpfn arch_unmap_kpfn
57#endif
58
59#endif /* !__ASSEMBLY__ */ 55#endif /* !__ASSEMBLY__ */
60 56
61#ifdef CONFIG_X86_VSYSCALL_EMULATION 57#ifdef CONFIG_X86_VSYSCALL_EMULATION
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 892df375b615..c83a2f418cea 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -7,6 +7,7 @@
7#ifdef CONFIG_PARAVIRT 7#ifdef CONFIG_PARAVIRT
8#include <asm/pgtable_types.h> 8#include <asm/pgtable_types.h>
9#include <asm/asm.h> 9#include <asm/asm.h>
10#include <asm/nospec-branch.h>
10 11
11#include <asm/paravirt_types.h> 12#include <asm/paravirt_types.h>
12 13
@@ -297,9 +298,9 @@ static inline void __flush_tlb_global(void)
297{ 298{
298 PVOP_VCALL0(pv_mmu_ops.flush_tlb_kernel); 299 PVOP_VCALL0(pv_mmu_ops.flush_tlb_kernel);
299} 300}
300static inline void __flush_tlb_single(unsigned long addr) 301static inline void __flush_tlb_one_user(unsigned long addr)
301{ 302{
302 PVOP_VCALL1(pv_mmu_ops.flush_tlb_single, addr); 303 PVOP_VCALL1(pv_mmu_ops.flush_tlb_one_user, addr);
303} 304}
304 305
305static inline void flush_tlb_others(const struct cpumask *cpumask, 306static inline void flush_tlb_others(const struct cpumask *cpumask,
@@ -879,23 +880,27 @@ extern void default_banner(void);
879 880
880#define INTERRUPT_RETURN \ 881#define INTERRUPT_RETURN \
881 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE, \ 882 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE, \
882 jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_iret)) 883 ANNOTATE_RETPOLINE_SAFE; \
884 jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_iret);)
883 885
884#define DISABLE_INTERRUPTS(clobbers) \ 886#define DISABLE_INTERRUPTS(clobbers) \
885 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \ 887 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \
886 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \ 888 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
889 ANNOTATE_RETPOLINE_SAFE; \
887 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_disable); \ 890 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_disable); \
888 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);) 891 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
889 892
890#define ENABLE_INTERRUPTS(clobbers) \ 893#define ENABLE_INTERRUPTS(clobbers) \
891 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \ 894 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \
892 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \ 895 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
896 ANNOTATE_RETPOLINE_SAFE; \
893 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \ 897 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \
894 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);) 898 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
895 899
896#ifdef CONFIG_X86_32 900#ifdef CONFIG_X86_32
897#define GET_CR0_INTO_EAX \ 901#define GET_CR0_INTO_EAX \
898 push %ecx; push %edx; \ 902 push %ecx; push %edx; \
903 ANNOTATE_RETPOLINE_SAFE; \
899 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \ 904 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
900 pop %edx; pop %ecx 905 pop %edx; pop %ecx
901#else /* !CONFIG_X86_32 */ 906#else /* !CONFIG_X86_32 */
@@ -917,21 +922,25 @@ extern void default_banner(void);
917 */ 922 */
918#define SWAPGS \ 923#define SWAPGS \
919 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \ 924 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
920 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs) \ 925 ANNOTATE_RETPOLINE_SAFE; \
926 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs); \
921 ) 927 )
922 928
923#define GET_CR2_INTO_RAX \ 929#define GET_CR2_INTO_RAX \
924 call PARA_INDIRECT(pv_mmu_ops+PV_MMU_read_cr2) 930 ANNOTATE_RETPOLINE_SAFE; \
931 call PARA_INDIRECT(pv_mmu_ops+PV_MMU_read_cr2);
925 932
926#define USERGS_SYSRET64 \ 933#define USERGS_SYSRET64 \
927 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret64), \ 934 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret64), \
928 CLBR_NONE, \ 935 CLBR_NONE, \
929 jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_usergs_sysret64)) 936 ANNOTATE_RETPOLINE_SAFE; \
937 jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_usergs_sysret64);)
930 938
931#ifdef CONFIG_DEBUG_ENTRY 939#ifdef CONFIG_DEBUG_ENTRY
932#define SAVE_FLAGS(clobbers) \ 940#define SAVE_FLAGS(clobbers) \
933 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_save_fl), clobbers, \ 941 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_save_fl), clobbers, \
934 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \ 942 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
943 ANNOTATE_RETPOLINE_SAFE; \
935 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_save_fl); \ 944 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_save_fl); \
936 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);) 945 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
937#endif 946#endif
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 6ec54d01972d..180bc0bff0fb 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -43,6 +43,7 @@
43#include <asm/desc_defs.h> 43#include <asm/desc_defs.h>
44#include <asm/kmap_types.h> 44#include <asm/kmap_types.h>
45#include <asm/pgtable_types.h> 45#include <asm/pgtable_types.h>
46#include <asm/nospec-branch.h>
46 47
47struct page; 48struct page;
48struct thread_struct; 49struct thread_struct;
@@ -217,7 +218,7 @@ struct pv_mmu_ops {
217 /* TLB operations */ 218 /* TLB operations */
218 void (*flush_tlb_user)(void); 219 void (*flush_tlb_user)(void);
219 void (*flush_tlb_kernel)(void); 220 void (*flush_tlb_kernel)(void);
220 void (*flush_tlb_single)(unsigned long addr); 221 void (*flush_tlb_one_user)(unsigned long addr);
221 void (*flush_tlb_others)(const struct cpumask *cpus, 222 void (*flush_tlb_others)(const struct cpumask *cpus,
222 const struct flush_tlb_info *info); 223 const struct flush_tlb_info *info);
223 224
@@ -392,7 +393,9 @@ int paravirt_disable_iospace(void);
392 * offset into the paravirt_patch_template structure, and can therefore be 393 * offset into the paravirt_patch_template structure, and can therefore be
393 * freely converted back into a structure offset. 394 * freely converted back into a structure offset.
394 */ 395 */
395#define PARAVIRT_CALL "call *%c[paravirt_opptr];" 396#define PARAVIRT_CALL \
397 ANNOTATE_RETPOLINE_SAFE \
398 "call *%c[paravirt_opptr];"
396 399
397/* 400/*
398 * These macros are intended to wrap calls through one of the paravirt 401 * These macros are intended to wrap calls through one of the paravirt
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index ba3c523aaf16..a06b07399d17 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -526,7 +526,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
526{ 526{
527 bool oldbit; 527 bool oldbit;
528 528
529 asm volatile("bt "__percpu_arg(2)",%1" 529 asm volatile("btl "__percpu_arg(2)",%1"
530 CC_SET(c) 530 CC_SET(c)
531 : CC_OUT(c) (oldbit) 531 : CC_OUT(c) (oldbit)
532 : "m" (*(unsigned long __percpu *)addr), "Ir" (nr)); 532 : "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 63c2552b6b65..b444d83cfc95 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -350,14 +350,14 @@ static inline pmd_t pmd_set_flags(pmd_t pmd, pmdval_t set)
350{ 350{
351 pmdval_t v = native_pmd_val(pmd); 351 pmdval_t v = native_pmd_val(pmd);
352 352
353 return __pmd(v | set); 353 return native_make_pmd(v | set);
354} 354}
355 355
356static inline pmd_t pmd_clear_flags(pmd_t pmd, pmdval_t clear) 356static inline pmd_t pmd_clear_flags(pmd_t pmd, pmdval_t clear)
357{ 357{
358 pmdval_t v = native_pmd_val(pmd); 358 pmdval_t v = native_pmd_val(pmd);
359 359
360 return __pmd(v & ~clear); 360 return native_make_pmd(v & ~clear);
361} 361}
362 362
363static inline pmd_t pmd_mkold(pmd_t pmd) 363static inline pmd_t pmd_mkold(pmd_t pmd)
@@ -409,14 +409,14 @@ static inline pud_t pud_set_flags(pud_t pud, pudval_t set)
409{ 409{
410 pudval_t v = native_pud_val(pud); 410 pudval_t v = native_pud_val(pud);
411 411
412 return __pud(v | set); 412 return native_make_pud(v | set);
413} 413}
414 414
415static inline pud_t pud_clear_flags(pud_t pud, pudval_t clear) 415static inline pud_t pud_clear_flags(pud_t pud, pudval_t clear)
416{ 416{
417 pudval_t v = native_pud_val(pud); 417 pudval_t v = native_pud_val(pud);
418 418
419 return __pud(v & ~clear); 419 return native_make_pud(v & ~clear);
420} 420}
421 421
422static inline pud_t pud_mkold(pud_t pud) 422static inline pud_t pud_mkold(pud_t pud)
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index e67c0620aec2..b3ec519e3982 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -32,6 +32,7 @@ extern pmd_t initial_pg_pmd[];
32static inline void pgtable_cache_init(void) { } 32static inline void pgtable_cache_init(void) { }
33static inline void check_pgt_cache(void) { } 33static inline void check_pgt_cache(void) { }
34void paging_init(void); 34void paging_init(void);
35void sync_initial_page_table(void);
35 36
36/* 37/*
37 * Define this if things work differently on an i386 and an i486: 38 * Define this if things work differently on an i386 and an i486:
@@ -61,7 +62,7 @@ void paging_init(void);
61#define kpte_clear_flush(ptep, vaddr) \ 62#define kpte_clear_flush(ptep, vaddr) \
62do { \ 63do { \
63 pte_clear(&init_mm, (vaddr), (ptep)); \ 64 pte_clear(&init_mm, (vaddr), (ptep)); \
64 __flush_tlb_one((vaddr)); \ 65 __flush_tlb_one_kernel((vaddr)); \
65} while (0) 66} while (0)
66 67
67#endif /* !__ASSEMBLY__ */ 68#endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 81462e9a34f6..1149d2112b2e 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -28,6 +28,7 @@ extern pgd_t init_top_pgt[];
28#define swapper_pg_dir init_top_pgt 28#define swapper_pg_dir init_top_pgt
29 29
30extern void paging_init(void); 30extern void paging_init(void);
31static inline void sync_initial_page_table(void) { }
31 32
32#define pte_ERROR(e) \ 33#define pte_ERROR(e) \
33 pr_err("%s:%d: bad pte %p(%016lx)\n", \ 34 pr_err("%s:%d: bad pte %p(%016lx)\n", \
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 3696398a9475..246f15b4e64c 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -323,6 +323,11 @@ static inline pudval_t native_pud_val(pud_t pud)
323#else 323#else
324#include <asm-generic/pgtable-nopud.h> 324#include <asm-generic/pgtable-nopud.h>
325 325
326static inline pud_t native_make_pud(pudval_t val)
327{
328 return (pud_t) { .p4d.pgd = native_make_pgd(val) };
329}
330
326static inline pudval_t native_pud_val(pud_t pud) 331static inline pudval_t native_pud_val(pud_t pud)
327{ 332{
328 return native_pgd_val(pud.p4d.pgd); 333 return native_pgd_val(pud.p4d.pgd);
@@ -344,6 +349,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
344#else 349#else
345#include <asm-generic/pgtable-nopmd.h> 350#include <asm-generic/pgtable-nopmd.h>
346 351
352static inline pmd_t native_make_pmd(pmdval_t val)
353{
354 return (pmd_t) { .pud.p4d.pgd = native_make_pgd(val) };
355}
356
347static inline pmdval_t native_pmd_val(pmd_t pmd) 357static inline pmdval_t native_pmd_val(pmd_t pmd)
348{ 358{
349 return native_pgd_val(pmd.pud.p4d.pgd); 359 return native_pgd_val(pmd.pud.p4d.pgd);
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 793bae7e7ce3..b0ccd4847a58 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -91,7 +91,7 @@ struct cpuinfo_x86 {
91 __u8 x86; /* CPU family */ 91 __u8 x86; /* CPU family */
92 __u8 x86_vendor; /* CPU vendor */ 92 __u8 x86_vendor; /* CPU vendor */
93 __u8 x86_model; 93 __u8 x86_model;
94 __u8 x86_mask; 94 __u8 x86_stepping;
95#ifdef CONFIG_X86_64 95#ifdef CONFIG_X86_64
96 /* Number of 4K pages in DTLB/ITLB combined(in pages): */ 96 /* Number of 4K pages in DTLB/ITLB combined(in pages): */
97 int x86_tlbsize; 97 int x86_tlbsize;
@@ -109,7 +109,7 @@ struct cpuinfo_x86 {
109 char x86_vendor_id[16]; 109 char x86_vendor_id[16];
110 char x86_model_id[64]; 110 char x86_model_id[64];
111 /* in KB - valid for CPUS which support this call: */ 111 /* in KB - valid for CPUS which support this call: */
112 int x86_cache_size; 112 unsigned int x86_cache_size;
113 int x86_cache_alignment; /* In bytes */ 113 int x86_cache_alignment; /* In bytes */
114 /* Cache QoS architectural values: */ 114 /* Cache QoS architectural values: */
115 int x86_cache_max_rmid; /* max index */ 115 int x86_cache_max_rmid; /* max index */
@@ -977,7 +977,5 @@ bool xen_set_default_idle(void);
977 977
978void stop_this_cpu(void *dummy); 978void stop_this_cpu(void *dummy);
979void df_debug(struct pt_regs *regs, long error_code); 979void df_debug(struct pt_regs *regs, long error_code);
980 980void microcode_check(void);
981void __ibp_barrier(void);
982
983#endif /* _ASM_X86_PROCESSOR_H */ 981#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/include/asm/refcount.h b/arch/x86/include/asm/refcount.h
index 4e44250e7d0d..4cf11d88d3b3 100644
--- a/arch/x86/include/asm/refcount.h
+++ b/arch/x86/include/asm/refcount.h
@@ -17,7 +17,7 @@
17#define _REFCOUNT_EXCEPTION \ 17#define _REFCOUNT_EXCEPTION \
18 ".pushsection .text..refcount\n" \ 18 ".pushsection .text..refcount\n" \
19 "111:\tlea %[counter], %%" _ASM_CX "\n" \ 19 "111:\tlea %[counter], %%" _ASM_CX "\n" \
20 "112:\t" ASM_UD0 "\n" \ 20 "112:\t" ASM_UD2 "\n" \
21 ASM_UNREACHABLE \ 21 ASM_UNREACHABLE \
22 ".popsection\n" \ 22 ".popsection\n" \
23 "113:\n" \ 23 "113:\n" \
@@ -67,13 +67,13 @@ static __always_inline __must_check
67bool refcount_sub_and_test(unsigned int i, refcount_t *r) 67bool refcount_sub_and_test(unsigned int i, refcount_t *r)
68{ 68{
69 GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl", REFCOUNT_CHECK_LT_ZERO, 69 GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl", REFCOUNT_CHECK_LT_ZERO,
70 r->refs.counter, "er", i, "%0", e); 70 r->refs.counter, "er", i, "%0", e, "cx");
71} 71}
72 72
73static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r) 73static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r)
74{ 74{
75 GEN_UNARY_SUFFIXED_RMWcc(LOCK_PREFIX "decl", REFCOUNT_CHECK_LT_ZERO, 75 GEN_UNARY_SUFFIXED_RMWcc(LOCK_PREFIX "decl", REFCOUNT_CHECK_LT_ZERO,
76 r->refs.counter, "%0", e); 76 r->refs.counter, "%0", e, "cx");
77} 77}
78 78
79static __always_inline __must_check 79static __always_inline __must_check
diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h
index f91c365e57c3..4914a3e7c803 100644
--- a/arch/x86/include/asm/rmwcc.h
+++ b/arch/x86/include/asm/rmwcc.h
@@ -2,8 +2,7 @@
2#ifndef _ASM_X86_RMWcc 2#ifndef _ASM_X86_RMWcc
3#define _ASM_X86_RMWcc 3#define _ASM_X86_RMWcc
4 4
5#define __CLOBBERS_MEM "memory" 5#define __CLOBBERS_MEM(clb...) "memory", ## clb
6#define __CLOBBERS_MEM_CC_CX "memory", "cc", "cx"
7 6
8#if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CC_HAVE_ASM_GOTO) 7#if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CC_HAVE_ASM_GOTO)
9 8
@@ -40,18 +39,19 @@ do { \
40#endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CC_HAVE_ASM_GOTO) */ 39#endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CC_HAVE_ASM_GOTO) */
41 40
42#define GEN_UNARY_RMWcc(op, var, arg0, cc) \ 41#define GEN_UNARY_RMWcc(op, var, arg0, cc) \
43 __GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM) 42 __GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM())
44 43
45#define GEN_UNARY_SUFFIXED_RMWcc(op, suffix, var, arg0, cc) \ 44#define GEN_UNARY_SUFFIXED_RMWcc(op, suffix, var, arg0, cc, clobbers...)\
46 __GEN_RMWcc(op " " arg0 "\n\t" suffix, var, cc, \ 45 __GEN_RMWcc(op " " arg0 "\n\t" suffix, var, cc, \
47 __CLOBBERS_MEM_CC_CX) 46 __CLOBBERS_MEM(clobbers))
48 47
49#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ 48#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \
50 __GEN_RMWcc(op __BINARY_RMWcc_ARG arg0, var, cc, \ 49 __GEN_RMWcc(op __BINARY_RMWcc_ARG arg0, var, cc, \
51 __CLOBBERS_MEM, vcon (val)) 50 __CLOBBERS_MEM(), vcon (val))
52 51
53#define GEN_BINARY_SUFFIXED_RMWcc(op, suffix, var, vcon, val, arg0, cc) \ 52#define GEN_BINARY_SUFFIXED_RMWcc(op, suffix, var, vcon, val, arg0, cc, \
53 clobbers...) \
54 __GEN_RMWcc(op __BINARY_RMWcc_ARG arg0 "\n\t" suffix, var, cc, \ 54 __GEN_RMWcc(op __BINARY_RMWcc_ARG arg0 "\n\t" suffix, var, cc, \
55 __CLOBBERS_MEM_CC_CX, vcon (val)) 55 __CLOBBERS_MEM(clobbers), vcon (val))
56 56
57#endif /* _ASM_X86_RMWcc */ 57#endif /* _ASM_X86_RMWcc */
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 461f53d27708..a4189762b266 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -129,6 +129,7 @@ static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
129void cpu_disable_common(void); 129void cpu_disable_common(void);
130void native_smp_prepare_boot_cpu(void); 130void native_smp_prepare_boot_cpu(void);
131void native_smp_prepare_cpus(unsigned int max_cpus); 131void native_smp_prepare_cpus(unsigned int max_cpus);
132void calculate_max_logical_packages(void);
132void native_smp_cpus_done(unsigned int max_cpus); 133void native_smp_cpus_done(unsigned int max_cpus);
133void common_cpu_up(unsigned int cpunum, struct task_struct *tidle); 134void common_cpu_up(unsigned int cpunum, struct task_struct *tidle);
134int native_cpu_up(unsigned int cpunum, struct task_struct *tidle); 135int native_cpu_up(unsigned int cpunum, struct task_struct *tidle);
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 2b8f18ca5874..84137c22fdfa 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -140,7 +140,7 @@ static inline unsigned long build_cr3_noflush(pgd_t *pgd, u16 asid)
140#else 140#else
141#define __flush_tlb() __native_flush_tlb() 141#define __flush_tlb() __native_flush_tlb()
142#define __flush_tlb_global() __native_flush_tlb_global() 142#define __flush_tlb_global() __native_flush_tlb_global()
143#define __flush_tlb_single(addr) __native_flush_tlb_single(addr) 143#define __flush_tlb_one_user(addr) __native_flush_tlb_one_user(addr)
144#endif 144#endif
145 145
146static inline bool tlb_defer_switch_to_init_mm(void) 146static inline bool tlb_defer_switch_to_init_mm(void)
@@ -400,7 +400,7 @@ static inline void __native_flush_tlb_global(void)
400/* 400/*
401 * flush one page in the user mapping 401 * flush one page in the user mapping
402 */ 402 */
403static inline void __native_flush_tlb_single(unsigned long addr) 403static inline void __native_flush_tlb_one_user(unsigned long addr)
404{ 404{
405 u32 loaded_mm_asid = this_cpu_read(cpu_tlbstate.loaded_mm_asid); 405 u32 loaded_mm_asid = this_cpu_read(cpu_tlbstate.loaded_mm_asid);
406 406
@@ -437,18 +437,31 @@ static inline void __flush_tlb_all(void)
437/* 437/*
438 * flush one page in the kernel mapping 438 * flush one page in the kernel mapping
439 */ 439 */
440static inline void __flush_tlb_one(unsigned long addr) 440static inline void __flush_tlb_one_kernel(unsigned long addr)
441{ 441{
442 count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE); 442 count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE);
443 __flush_tlb_single(addr); 443
444 /*
445 * If PTI is off, then __flush_tlb_one_user() is just INVLPG or its
446 * paravirt equivalent. Even with PCID, this is sufficient: we only
447 * use PCID if we also use global PTEs for the kernel mapping, and
448 * INVLPG flushes global translations across all address spaces.
449 *
450 * If PTI is on, then the kernel is mapped with non-global PTEs, and
451 * __flush_tlb_one_user() will flush the given address for the current
452 * kernel address space and for its usermode counterpart, but it does
453 * not flush it for other address spaces.
454 */
455 __flush_tlb_one_user(addr);
444 456
445 if (!static_cpu_has(X86_FEATURE_PTI)) 457 if (!static_cpu_has(X86_FEATURE_PTI))
446 return; 458 return;
447 459
448 /* 460 /*
449 * __flush_tlb_single() will have cleared the TLB entry for this ASID, 461 * See above. We need to propagate the flush to all other address
450 * but since kernel space is replicated across all, we must also 462 * spaces. In principle, we only need to propagate it to kernelmode
451 * invalidate all others. 463 * address spaces, but the extra bookkeeping we would need is not
464 * worth it.
452 */ 465 */
453 invalidate_other_asid(); 466 invalidate_other_asid();
454} 467}
diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h
index 197c2e6c7376..099414345865 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -241,24 +241,24 @@
241#define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106 241#define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106
242 242
243struct hv_reenlightenment_control { 243struct hv_reenlightenment_control {
244 u64 vector:8; 244 __u64 vector:8;
245 u64 reserved1:8; 245 __u64 reserved1:8;
246 u64 enabled:1; 246 __u64 enabled:1;
247 u64 reserved2:15; 247 __u64 reserved2:15;
248 u64 target_vp:32; 248 __u64 target_vp:32;
249}; 249};
250 250
251#define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107 251#define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107
252#define HV_X64_MSR_TSC_EMULATION_STATUS 0x40000108 252#define HV_X64_MSR_TSC_EMULATION_STATUS 0x40000108
253 253
254struct hv_tsc_emulation_control { 254struct hv_tsc_emulation_control {
255 u64 enabled:1; 255 __u64 enabled:1;
256 u64 reserved:63; 256 __u64 reserved:63;
257}; 257};
258 258
259struct hv_tsc_emulation_status { 259struct hv_tsc_emulation_status {
260 u64 inprogress:1; 260 __u64 inprogress:1;
261 u64 reserved:63; 261 __u64 reserved:63;
262}; 262};
263 263
264#define HV_X64_MSR_HYPERCALL_ENABLE 0x00000001 264#define HV_X64_MSR_HYPERCALL_ENABLE 0x00000001
diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index 7a2ade4aa235..6cfa9c8cb7d6 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -26,6 +26,7 @@
26#define KVM_FEATURE_PV_EOI 6 26#define KVM_FEATURE_PV_EOI 6
27#define KVM_FEATURE_PV_UNHALT 7 27#define KVM_FEATURE_PV_UNHALT 7
28#define KVM_FEATURE_PV_TLB_FLUSH 9 28#define KVM_FEATURE_PV_TLB_FLUSH 9
29#define KVM_FEATURE_ASYNC_PF_VMEXIT 10
29 30
30/* The last 8 bits are used to indicate how to interpret the flags field 31/* The last 8 bits are used to indicate how to interpret the flags field
31 * in pvclock structure. If no bits are set, all flags are ignored. 32 * in pvclock structure. If no bits are set, all flags are ignored.
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 6db28f17ff28..c88e0b127810 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -235,7 +235,7 @@ int amd_cache_northbridges(void)
235 if (boot_cpu_data.x86 == 0x10 && 235 if (boot_cpu_data.x86 == 0x10 &&
236 boot_cpu_data.x86_model >= 0x8 && 236 boot_cpu_data.x86_model >= 0x8 &&
237 (boot_cpu_data.x86_model > 0x9 || 237 (boot_cpu_data.x86_model > 0x9 ||
238 boot_cpu_data.x86_mask >= 0x1)) 238 boot_cpu_data.x86_stepping >= 0x1))
239 amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE; 239 amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE;
240 240
241 if (boot_cpu_data.x86 == 0x15) 241 if (boot_cpu_data.x86 == 0x15)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 25ddf02598d2..b203af0855b5 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -546,7 +546,7 @@ static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
546 546
547static u32 hsx_deadline_rev(void) 547static u32 hsx_deadline_rev(void)
548{ 548{
549 switch (boot_cpu_data.x86_mask) { 549 switch (boot_cpu_data.x86_stepping) {
550 case 0x02: return 0x3a; /* EP */ 550 case 0x02: return 0x3a; /* EP */
551 case 0x04: return 0x0f; /* EX */ 551 case 0x04: return 0x0f; /* EX */
552 } 552 }
@@ -556,7 +556,7 @@ static u32 hsx_deadline_rev(void)
556 556
557static u32 bdx_deadline_rev(void) 557static u32 bdx_deadline_rev(void)
558{ 558{
559 switch (boot_cpu_data.x86_mask) { 559 switch (boot_cpu_data.x86_stepping) {
560 case 0x02: return 0x00000011; 560 case 0x02: return 0x00000011;
561 case 0x03: return 0x0700000e; 561 case 0x03: return 0x0700000e;
562 case 0x04: return 0x0f00000c; 562 case 0x04: return 0x0f00000c;
@@ -568,7 +568,7 @@ static u32 bdx_deadline_rev(void)
568 568
569static u32 skx_deadline_rev(void) 569static u32 skx_deadline_rev(void)
570{ 570{
571 switch (boot_cpu_data.x86_mask) { 571 switch (boot_cpu_data.x86_stepping) {
572 case 0x03: return 0x01000136; 572 case 0x03: return 0x01000136;
573 case 0x04: return 0x02000014; 573 case 0x04: return 0x02000014;
574 } 574 }
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8ad2e410974f..7c5538769f7e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1603,7 +1603,7 @@ static void __init delay_with_tsc(void)
1603 do { 1603 do {
1604 rep_nop(); 1604 rep_nop();
1605 now = rdtsc(); 1605 now = rdtsc();
1606 } while ((now - start) < 40000000000UL / HZ && 1606 } while ((now - start) < 40000000000ULL / HZ &&
1607 time_before_eq(jiffies, end)); 1607 time_before_eq(jiffies, end));
1608} 1608}
1609 1609
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 3cc471beb50b..bb6f7a2148d7 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -134,21 +134,40 @@ static void apic_update_vector(struct irq_data *irqd, unsigned int newvec,
134{ 134{
135 struct apic_chip_data *apicd = apic_chip_data(irqd); 135 struct apic_chip_data *apicd = apic_chip_data(irqd);
136 struct irq_desc *desc = irq_data_to_desc(irqd); 136 struct irq_desc *desc = irq_data_to_desc(irqd);
137 bool managed = irqd_affinity_is_managed(irqd);
137 138
138 lockdep_assert_held(&vector_lock); 139 lockdep_assert_held(&vector_lock);
139 140
140 trace_vector_update(irqd->irq, newvec, newcpu, apicd->vector, 141 trace_vector_update(irqd->irq, newvec, newcpu, apicd->vector,
141 apicd->cpu); 142 apicd->cpu);
142 143
143 /* Setup the vector move, if required */ 144 /*
144 if (apicd->vector && cpu_online(apicd->cpu)) { 145 * If there is no vector associated or if the associated vector is
146 * the shutdown vector, which is associated to make PCI/MSI
147 * shutdown mode work, then there is nothing to release. Clear out
148 * prev_vector for this and the offlined target case.
149 */
150 apicd->prev_vector = 0;
151 if (!apicd->vector || apicd->vector == MANAGED_IRQ_SHUTDOWN_VECTOR)
152 goto setnew;
153 /*
154 * If the target CPU of the previous vector is online, then mark
155 * the vector as move in progress and store it for cleanup when the
156 * first interrupt on the new vector arrives. If the target CPU is
157 * offline then the regular release mechanism via the cleanup
158 * vector is not possible and the vector can be immediately freed
159 * in the underlying matrix allocator.
160 */
161 if (cpu_online(apicd->cpu)) {
145 apicd->move_in_progress = true; 162 apicd->move_in_progress = true;
146 apicd->prev_vector = apicd->vector; 163 apicd->prev_vector = apicd->vector;
147 apicd->prev_cpu = apicd->cpu; 164 apicd->prev_cpu = apicd->cpu;
148 } else { 165 } else {
149 apicd->prev_vector = 0; 166 irq_matrix_free(vector_matrix, apicd->cpu, apicd->vector,
167 managed);
150 } 168 }
151 169
170setnew:
152 apicd->vector = newvec; 171 apicd->vector = newvec;
153 apicd->cpu = newcpu; 172 apicd->cpu = newcpu;
154 BUG_ON(!IS_ERR_OR_NULL(per_cpu(vector_irq, newcpu)[newvec])); 173 BUG_ON(!IS_ERR_OR_NULL(per_cpu(vector_irq, newcpu)[newvec]));
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 46b675aaf20b..f11910b44638 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1176,16 +1176,25 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
1176 1176
1177 uv_gre_table = gre; 1177 uv_gre_table = gre;
1178 for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) { 1178 for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
1179 unsigned long size = ((unsigned long)(gre->limit - lgre)
1180 << UV_GAM_RANGE_SHFT);
1181 int order = 0;
1182 char suffix[] = " KMGTPE";
1183
1184 while (size > 9999 && order < sizeof(suffix)) {
1185 size /= 1024;
1186 order++;
1187 }
1188
1179 if (!index) { 1189 if (!index) {
1180 pr_info("UV: GAM Range Table...\n"); 1190 pr_info("UV: GAM Range Table...\n");
1181 pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN"); 1191 pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
1182 } 1192 }
1183 pr_info("UV: %2d: 0x%014lx-0x%014lx %5luG %3d %04x %02x %02x\n", 1193 pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d %04x %02x %02x\n",
1184 index++, 1194 index++,
1185 (unsigned long)lgre << UV_GAM_RANGE_SHFT, 1195 (unsigned long)lgre << UV_GAM_RANGE_SHFT,
1186 (unsigned long)gre->limit << UV_GAM_RANGE_SHFT, 1196 (unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
1187 ((unsigned long)(gre->limit - lgre)) >> 1197 size, suffix[order],
1188 (30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
1189 gre->type, gre->nasid, gre->sockid, gre->pnode); 1198 gre->type, gre->nasid, gre->sockid, gre->pnode);
1190 1199
1191 lgre = gre->limit; 1200 lgre = gre->limit;
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index fa1261eefa16..f91ba53e06c8 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -18,7 +18,7 @@ void foo(void)
18 OFFSET(CPUINFO_x86, cpuinfo_x86, x86); 18 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
19 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); 19 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
20 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); 20 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
21 OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); 21 OFFSET(CPUINFO_x86_stepping, cpuinfo_x86, x86_stepping);
22 OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); 22 OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
23 OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); 23 OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
24 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); 24 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 5bddbdcbc4a3..f0e6456ca7d3 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -119,7 +119,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
119 return; 119 return;
120 } 120 }
121 121
122 if (c->x86_model == 6 && c->x86_mask == 1) { 122 if (c->x86_model == 6 && c->x86_stepping == 1) {
123 const int K6_BUG_LOOP = 1000000; 123 const int K6_BUG_LOOP = 1000000;
124 int n; 124 int n;
125 void (*f_vide)(void); 125 void (*f_vide)(void);
@@ -149,7 +149,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
149 149
150 /* K6 with old style WHCR */ 150 /* K6 with old style WHCR */
151 if (c->x86_model < 8 || 151 if (c->x86_model < 8 ||
152 (c->x86_model == 8 && c->x86_mask < 8)) { 152 (c->x86_model == 8 && c->x86_stepping < 8)) {
153 /* We can only write allocate on the low 508Mb */ 153 /* We can only write allocate on the low 508Mb */
154 if (mbytes > 508) 154 if (mbytes > 508)
155 mbytes = 508; 155 mbytes = 508;
@@ -168,7 +168,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
168 return; 168 return;
169 } 169 }
170 170
171 if ((c->x86_model == 8 && c->x86_mask > 7) || 171 if ((c->x86_model == 8 && c->x86_stepping > 7) ||
172 c->x86_model == 9 || c->x86_model == 13) { 172 c->x86_model == 9 || c->x86_model == 13) {
173 /* The more serious chips .. */ 173 /* The more serious chips .. */
174 174
@@ -221,7 +221,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
221 * are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx 221 * are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
222 * As per AMD technical note 27212 0.2 222 * As per AMD technical note 27212 0.2
223 */ 223 */
224 if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) { 224 if ((c->x86_model == 8 && c->x86_stepping >= 1) || (c->x86_model > 8)) {
225 rdmsr(MSR_K7_CLK_CTL, l, h); 225 rdmsr(MSR_K7_CLK_CTL, l, h);
226 if ((l & 0xfff00000) != 0x20000000) { 226 if ((l & 0xfff00000) != 0x20000000) {
227 pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", 227 pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
@@ -241,12 +241,12 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
241 * but they are not certified as MP capable. 241 * but they are not certified as MP capable.
242 */ 242 */
243 /* Athlon 660/661 is valid. */ 243 /* Athlon 660/661 is valid. */
244 if ((c->x86_model == 6) && ((c->x86_mask == 0) || 244 if ((c->x86_model == 6) && ((c->x86_stepping == 0) ||
245 (c->x86_mask == 1))) 245 (c->x86_stepping == 1)))
246 return; 246 return;
247 247
248 /* Duron 670 is valid */ 248 /* Duron 670 is valid */
249 if ((c->x86_model == 7) && (c->x86_mask == 0)) 249 if ((c->x86_model == 7) && (c->x86_stepping == 0))
250 return; 250 return;
251 251
252 /* 252 /*
@@ -256,8 +256,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
256 * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for 256 * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
257 * more. 257 * more.
258 */ 258 */
259 if (((c->x86_model == 6) && (c->x86_mask >= 2)) || 259 if (((c->x86_model == 6) && (c->x86_stepping >= 2)) ||
260 ((c->x86_model == 7) && (c->x86_mask >= 1)) || 260 ((c->x86_model == 7) && (c->x86_stepping >= 1)) ||
261 (c->x86_model > 7)) 261 (c->x86_model > 7))
262 if (cpu_has(c, X86_FEATURE_MP)) 262 if (cpu_has(c, X86_FEATURE_MP))
263 return; 263 return;
@@ -628,7 +628,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)
628 /* Set MTRR capability flag if appropriate */ 628 /* Set MTRR capability flag if appropriate */
629 if (c->x86 == 5) 629 if (c->x86 == 5)
630 if (c->x86_model == 13 || c->x86_model == 9 || 630 if (c->x86_model == 13 || c->x86_model == 9 ||
631 (c->x86_model == 8 && c->x86_mask >= 8)) 631 (c->x86_model == 8 && c->x86_stepping >= 8))
632 set_cpu_cap(c, X86_FEATURE_K6_MTRR); 632 set_cpu_cap(c, X86_FEATURE_K6_MTRR);
633#endif 633#endif
634#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) 634#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
@@ -795,7 +795,7 @@ static void init_amd_zn(struct cpuinfo_x86 *c)
795 * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects 795 * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects
796 * all up to and including B1. 796 * all up to and including B1.
797 */ 797 */
798 if (c->x86_model <= 1 && c->x86_mask <= 1) 798 if (c->x86_model <= 1 && c->x86_stepping <= 1)
799 set_cpu_cap(c, X86_FEATURE_CPB); 799 set_cpu_cap(c, X86_FEATURE_CPB);
800} 800}
801 801
@@ -906,11 +906,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
906 /* AMD errata T13 (order #21922) */ 906 /* AMD errata T13 (order #21922) */
907 if ((c->x86 == 6)) { 907 if ((c->x86 == 6)) {
908 /* Duron Rev A0 */ 908 /* Duron Rev A0 */
909 if (c->x86_model == 3 && c->x86_mask == 0) 909 if (c->x86_model == 3 && c->x86_stepping == 0)
910 size = 64; 910 size = 64;
911 /* Tbird rev A1/A2 */ 911 /* Tbird rev A1/A2 */
912 if (c->x86_model == 4 && 912 if (c->x86_model == 4 &&
913 (c->x86_mask == 0 || c->x86_mask == 1)) 913 (c->x86_stepping == 0 || c->x86_stepping == 1))
914 size = 256; 914 size = 256;
915 } 915 }
916 return size; 916 return size;
@@ -1047,7 +1047,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
1047 } 1047 }
1048 1048
1049 /* OSVW unavailable or ID unknown, match family-model-stepping range */ 1049 /* OSVW unavailable or ID unknown, match family-model-stepping range */
1050 ms = (cpu->x86_model << 4) | cpu->x86_mask; 1050 ms = (cpu->x86_model << 4) | cpu->x86_stepping;
1051 while ((range = *erratum++)) 1051 while ((range = *erratum++))
1052 if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && 1052 if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
1053 (ms >= AMD_MODEL_RANGE_START(range)) && 1053 (ms >= AMD_MODEL_RANGE_START(range)) &&
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 71949bf2de5a..bfca937bdcc3 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -162,8 +162,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
162 if (cmdline_find_option_bool(boot_command_line, "nospectre_v2")) 162 if (cmdline_find_option_bool(boot_command_line, "nospectre_v2"))
163 return SPECTRE_V2_CMD_NONE; 163 return SPECTRE_V2_CMD_NONE;
164 else { 164 else {
165 ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, 165 ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, sizeof(arg));
166 sizeof(arg));
167 if (ret < 0) 166 if (ret < 0)
168 return SPECTRE_V2_CMD_AUTO; 167 return SPECTRE_V2_CMD_AUTO;
169 168
@@ -175,8 +174,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
175 } 174 }
176 175
177 if (i >= ARRAY_SIZE(mitigation_options)) { 176 if (i >= ARRAY_SIZE(mitigation_options)) {
178 pr_err("unknown option (%s). Switching to AUTO select\n", 177 pr_err("unknown option (%s). Switching to AUTO select\n", arg);
179 mitigation_options[i].option);
180 return SPECTRE_V2_CMD_AUTO; 178 return SPECTRE_V2_CMD_AUTO;
181 } 179 }
182 } 180 }
@@ -185,8 +183,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
185 cmd == SPECTRE_V2_CMD_RETPOLINE_AMD || 183 cmd == SPECTRE_V2_CMD_RETPOLINE_AMD ||
186 cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC) && 184 cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC) &&
187 !IS_ENABLED(CONFIG_RETPOLINE)) { 185 !IS_ENABLED(CONFIG_RETPOLINE)) {
188 pr_err("%s selected but not compiled in. Switching to AUTO select\n", 186 pr_err("%s selected but not compiled in. Switching to AUTO select\n", mitigation_options[i].option);
189 mitigation_options[i].option);
190 return SPECTRE_V2_CMD_AUTO; 187 return SPECTRE_V2_CMD_AUTO;
191 } 188 }
192 189
@@ -256,14 +253,14 @@ static void __init spectre_v2_select_mitigation(void)
256 goto retpoline_auto; 253 goto retpoline_auto;
257 break; 254 break;
258 } 255 }
259 pr_err("kernel not compiled with retpoline; no mitigation available!"); 256 pr_err("Spectre mitigation: kernel not compiled with retpoline; no mitigation available!");
260 return; 257 return;
261 258
262retpoline_auto: 259retpoline_auto:
263 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { 260 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
264 retpoline_amd: 261 retpoline_amd:
265 if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) { 262 if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) {
266 pr_err("LFENCE not serializing. Switching to generic retpoline\n"); 263 pr_err("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n");
267 goto retpoline_generic; 264 goto retpoline_generic;
268 } 265 }
269 mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD : 266 mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD :
@@ -281,7 +278,7 @@ retpoline_auto:
281 pr_info("%s\n", spectre_v2_strings[mode]); 278 pr_info("%s\n", spectre_v2_strings[mode]);
282 279
283 /* 280 /*
284 * If neither SMEP or KPTI are available, there is a risk of 281 * If neither SMEP nor PTI are available, there is a risk of
285 * hitting userspace addresses in the RSB after a context switch 282 * hitting userspace addresses in the RSB after a context switch
286 * from a shallow call stack to a deeper one. To prevent this fill 283 * from a shallow call stack to a deeper one. To prevent this fill
287 * the entire RSB, even when using IBRS. 284 * the entire RSB, even when using IBRS.
@@ -295,21 +292,29 @@ retpoline_auto:
295 if ((!boot_cpu_has(X86_FEATURE_PTI) && 292 if ((!boot_cpu_has(X86_FEATURE_PTI) &&
296 !boot_cpu_has(X86_FEATURE_SMEP)) || is_skylake_era()) { 293 !boot_cpu_has(X86_FEATURE_SMEP)) || is_skylake_era()) {
297 setup_force_cpu_cap(X86_FEATURE_RSB_CTXSW); 294 setup_force_cpu_cap(X86_FEATURE_RSB_CTXSW);
298 pr_info("Filling RSB on context switch\n"); 295 pr_info("Spectre v2 mitigation: Filling RSB on context switch\n");
299 } 296 }
300 297
301 /* Initialize Indirect Branch Prediction Barrier if supported */ 298 /* Initialize Indirect Branch Prediction Barrier if supported */
302 if (boot_cpu_has(X86_FEATURE_IBPB)) { 299 if (boot_cpu_has(X86_FEATURE_IBPB)) {
303 setup_force_cpu_cap(X86_FEATURE_USE_IBPB); 300 setup_force_cpu_cap(X86_FEATURE_USE_IBPB);
304 pr_info("Enabling Indirect Branch Prediction Barrier\n"); 301 pr_info("Spectre v2 mitigation: Enabling Indirect Branch Prediction Barrier\n");
302 }
303
304 /*
305 * Retpoline means the kernel is safe because it has no indirect
306 * branches. But firmware isn't, so use IBRS to protect that.
307 */
308 if (boot_cpu_has(X86_FEATURE_IBRS)) {
309 setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW);
310 pr_info("Enabling Restricted Speculation for firmware calls\n");
305 } 311 }
306} 312}
307 313
308#undef pr_fmt 314#undef pr_fmt
309 315
310#ifdef CONFIG_SYSFS 316#ifdef CONFIG_SYSFS
311ssize_t cpu_show_meltdown(struct device *dev, 317ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
312 struct device_attribute *attr, char *buf)
313{ 318{
314 if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) 319 if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
315 return sprintf(buf, "Not affected\n"); 320 return sprintf(buf, "Not affected\n");
@@ -318,28 +323,21 @@ ssize_t cpu_show_meltdown(struct device *dev,
318 return sprintf(buf, "Vulnerable\n"); 323 return sprintf(buf, "Vulnerable\n");
319} 324}
320 325
321ssize_t cpu_show_spectre_v1(struct device *dev, 326ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf)
322 struct device_attribute *attr, char *buf)
323{ 327{
324 if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1)) 328 if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1))
325 return sprintf(buf, "Not affected\n"); 329 return sprintf(buf, "Not affected\n");
326 return sprintf(buf, "Mitigation: __user pointer sanitization\n"); 330 return sprintf(buf, "Mitigation: __user pointer sanitization\n");
327} 331}
328 332
329ssize_t cpu_show_spectre_v2(struct device *dev, 333ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, char *buf)
330 struct device_attribute *attr, char *buf)
331{ 334{
332 if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2)) 335 if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
333 return sprintf(buf, "Not affected\n"); 336 return sprintf(buf, "Not affected\n");
334 337
335 return sprintf(buf, "%s%s%s\n", spectre_v2_strings[spectre_v2_enabled], 338 return sprintf(buf, "%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
336 boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "", 339 boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "",
340 boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
337 spectre_v2_module_string()); 341 spectre_v2_module_string());
338} 342}
339#endif 343#endif
340
341void __ibp_barrier(void)
342{
343 __wrmsr(MSR_IA32_PRED_CMD, PRED_CMD_IBPB, 0);
344}
345EXPORT_SYMBOL_GPL(__ibp_barrier);
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index c578cd29c2d2..e5ec0f11c0de 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -140,7 +140,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
140 clear_cpu_cap(c, X86_FEATURE_TSC); 140 clear_cpu_cap(c, X86_FEATURE_TSC);
141 break; 141 break;
142 case 8: 142 case 8:
143 switch (c->x86_mask) { 143 switch (c->x86_stepping) {
144 default: 144 default:
145 name = "2"; 145 name = "2";
146 break; 146 break;
@@ -215,7 +215,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
215 * - Note, it seems this may only be in engineering samples. 215 * - Note, it seems this may only be in engineering samples.
216 */ 216 */
217 if ((c->x86 == 6) && (c->x86_model == 9) && 217 if ((c->x86 == 6) && (c->x86_model == 9) &&
218 (c->x86_mask == 1) && (size == 65)) 218 (c->x86_stepping == 1) && (size == 65))
219 size -= 1; 219 size -= 1;
220 return size; 220 return size;
221} 221}
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d63f4b5706e4..348cf4821240 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -731,7 +731,7 @@ void cpu_detect(struct cpuinfo_x86 *c)
731 cpuid(0x00000001, &tfms, &misc, &junk, &cap0); 731 cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
732 c->x86 = x86_family(tfms); 732 c->x86 = x86_family(tfms);
733 c->x86_model = x86_model(tfms); 733 c->x86_model = x86_model(tfms);
734 c->x86_mask = x86_stepping(tfms); 734 c->x86_stepping = x86_stepping(tfms);
735 735
736 if (cap0 & (1<<19)) { 736 if (cap0 & (1<<19)) {
737 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; 737 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
@@ -1184,9 +1184,9 @@ static void identify_cpu(struct cpuinfo_x86 *c)
1184 int i; 1184 int i;
1185 1185
1186 c->loops_per_jiffy = loops_per_jiffy; 1186 c->loops_per_jiffy = loops_per_jiffy;
1187 c->x86_cache_size = -1; 1187 c->x86_cache_size = 0;
1188 c->x86_vendor = X86_VENDOR_UNKNOWN; 1188 c->x86_vendor = X86_VENDOR_UNKNOWN;
1189 c->x86_model = c->x86_mask = 0; /* So far unknown... */ 1189 c->x86_model = c->x86_stepping = 0; /* So far unknown... */
1190 c->x86_vendor_id[0] = '\0'; /* Unset */ 1190 c->x86_vendor_id[0] = '\0'; /* Unset */
1191 c->x86_model_id[0] = '\0'; /* Unset */ 1191 c->x86_model_id[0] = '\0'; /* Unset */
1192 c->x86_max_cores = 1; 1192 c->x86_max_cores = 1;
@@ -1378,8 +1378,8 @@ void print_cpu_info(struct cpuinfo_x86 *c)
1378 1378
1379 pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model); 1379 pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
1380 1380
1381 if (c->x86_mask || c->cpuid_level >= 0) 1381 if (c->x86_stepping || c->cpuid_level >= 0)
1382 pr_cont(", stepping: 0x%x)\n", c->x86_mask); 1382 pr_cont(", stepping: 0x%x)\n", c->x86_stepping);
1383 else 1383 else
1384 pr_cont(")\n"); 1384 pr_cont(")\n");
1385} 1385}
@@ -1749,3 +1749,33 @@ static int __init init_cpu_syscore(void)
1749 return 0; 1749 return 0;
1750} 1750}
1751core_initcall(init_cpu_syscore); 1751core_initcall(init_cpu_syscore);
1752
1753/*
1754 * The microcode loader calls this upon late microcode load to recheck features,
1755 * only when microcode has been updated. Caller holds microcode_mutex and CPU
1756 * hotplug lock.
1757 */
1758void microcode_check(void)
1759{
1760 struct cpuinfo_x86 info;
1761
1762 perf_check_microcode();
1763
1764 /* Reload CPUID max function as it might've changed. */
1765 info.cpuid_level = cpuid_eax(0);
1766
1767 /*
1768 * Copy all capability leafs to pick up the synthetic ones so that
1769 * memcmp() below doesn't fail on that. The ones coming from CPUID will
1770 * get overwritten in get_cpu_cap().
1771 */
1772 memcpy(&info.x86_capability, &boot_cpu_data.x86_capability, sizeof(info.x86_capability));
1773
1774 get_cpu_cap(&info);
1775
1776 if (!memcmp(&info.x86_capability, &boot_cpu_data.x86_capability, sizeof(info.x86_capability)))
1777 return;
1778
1779 pr_warn("x86/CPU: CPU features have changed after loading microcode, but might not take effect.\n");
1780 pr_warn("x86/CPU: Please consider either early loading through initrd/built-in or a potential BIOS update.\n");
1781}
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 6b4bb335641f..8949b7ae6d92 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -215,7 +215,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
215 215
216 /* common case step number/rev -- exceptions handled below */ 216 /* common case step number/rev -- exceptions handled below */
217 c->x86_model = (dir1 >> 4) + 1; 217 c->x86_model = (dir1 >> 4) + 1;
218 c->x86_mask = dir1 & 0xf; 218 c->x86_stepping = dir1 & 0xf;
219 219
220 /* Now cook; the original recipe is by Channing Corn, from Cyrix. 220 /* Now cook; the original recipe is by Channing Corn, from Cyrix.
221 * We do the same thing for each generation: we work out 221 * We do the same thing for each generation: we work out
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 319bf989fad1..d19e903214b4 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -116,14 +116,13 @@ struct sku_microcode {
116 u32 microcode; 116 u32 microcode;
117}; 117};
118static const struct sku_microcode spectre_bad_microcodes[] = { 118static const struct sku_microcode spectre_bad_microcodes[] = {
119 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0B, 0x84 }, 119 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0B, 0x80 },
120 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0A, 0x84 }, 120 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x0A, 0x80 },
121 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x09, 0x84 }, 121 { INTEL_FAM6_KABYLAKE_DESKTOP, 0x09, 0x80 },
122 { INTEL_FAM6_KABYLAKE_MOBILE, 0x0A, 0x84 }, 122 { INTEL_FAM6_KABYLAKE_MOBILE, 0x0A, 0x80 },
123 { INTEL_FAM6_KABYLAKE_MOBILE, 0x09, 0x84 }, 123 { INTEL_FAM6_KABYLAKE_MOBILE, 0x09, 0x80 },
124 { INTEL_FAM6_SKYLAKE_X, 0x03, 0x0100013e }, 124 { INTEL_FAM6_SKYLAKE_X, 0x03, 0x0100013e },
125 { INTEL_FAM6_SKYLAKE_X, 0x04, 0x0200003c }, 125 { INTEL_FAM6_SKYLAKE_X, 0x04, 0x0200003c },
126 { INTEL_FAM6_SKYLAKE_MOBILE, 0x03, 0xc2 },
127 { INTEL_FAM6_SKYLAKE_DESKTOP, 0x03, 0xc2 }, 126 { INTEL_FAM6_SKYLAKE_DESKTOP, 0x03, 0xc2 },
128 { INTEL_FAM6_BROADWELL_CORE, 0x04, 0x28 }, 127 { INTEL_FAM6_BROADWELL_CORE, 0x04, 0x28 },
129 { INTEL_FAM6_BROADWELL_GT3E, 0x01, 0x1b }, 128 { INTEL_FAM6_BROADWELL_GT3E, 0x01, 0x1b },
@@ -136,8 +135,6 @@ static const struct sku_microcode spectre_bad_microcodes[] = {
136 { INTEL_FAM6_HASWELL_X, 0x02, 0x3b }, 135 { INTEL_FAM6_HASWELL_X, 0x02, 0x3b },
137 { INTEL_FAM6_HASWELL_X, 0x04, 0x10 }, 136 { INTEL_FAM6_HASWELL_X, 0x04, 0x10 },
138 { INTEL_FAM6_IVYBRIDGE_X, 0x04, 0x42a }, 137 { INTEL_FAM6_IVYBRIDGE_X, 0x04, 0x42a },
139 /* Updated in the 20180108 release; blacklist until we know otherwise */
140 { INTEL_FAM6_ATOM_GEMINI_LAKE, 0x01, 0x22 },
141 /* Observed in the wild */ 138 /* Observed in the wild */
142 { INTEL_FAM6_SANDYBRIDGE_X, 0x06, 0x61b }, 139 { INTEL_FAM6_SANDYBRIDGE_X, 0x06, 0x61b },
143 { INTEL_FAM6_SANDYBRIDGE_X, 0x07, 0x712 }, 140 { INTEL_FAM6_SANDYBRIDGE_X, 0x07, 0x712 },
@@ -149,7 +146,7 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
149 146
150 for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { 147 for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
151 if (c->x86_model == spectre_bad_microcodes[i].model && 148 if (c->x86_model == spectre_bad_microcodes[i].model &&
152 c->x86_mask == spectre_bad_microcodes[i].stepping) 149 c->x86_stepping == spectre_bad_microcodes[i].stepping)
153 return (c->microcode <= spectre_bad_microcodes[i].microcode); 150 return (c->microcode <= spectre_bad_microcodes[i].microcode);
154 } 151 }
155 return false; 152 return false;
@@ -196,7 +193,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
196 * need the microcode to have already been loaded... so if it is 193 * need the microcode to have already been loaded... so if it is
197 * not, recommend a BIOS update and disable large pages. 194 * not, recommend a BIOS update and disable large pages.
198 */ 195 */
199 if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 && 196 if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_stepping <= 2 &&
200 c->microcode < 0x20e) { 197 c->microcode < 0x20e) {
201 pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n"); 198 pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n");
202 clear_cpu_cap(c, X86_FEATURE_PSE); 199 clear_cpu_cap(c, X86_FEATURE_PSE);
@@ -212,7 +209,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
212 209
213 /* CPUID workaround for 0F33/0F34 CPU */ 210 /* CPUID workaround for 0F33/0F34 CPU */
214 if (c->x86 == 0xF && c->x86_model == 0x3 211 if (c->x86 == 0xF && c->x86_model == 0x3
215 && (c->x86_mask == 0x3 || c->x86_mask == 0x4)) 212 && (c->x86_stepping == 0x3 || c->x86_stepping == 0x4))
216 c->x86_phys_bits = 36; 213 c->x86_phys_bits = 36;
217 214
218 /* 215 /*
@@ -310,7 +307,7 @@ int ppro_with_ram_bug(void)
310 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && 307 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
311 boot_cpu_data.x86 == 6 && 308 boot_cpu_data.x86 == 6 &&
312 boot_cpu_data.x86_model == 1 && 309 boot_cpu_data.x86_model == 1 &&
313 boot_cpu_data.x86_mask < 8) { 310 boot_cpu_data.x86_stepping < 8) {
314 pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n"); 311 pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
315 return 1; 312 return 1;
316 } 313 }
@@ -327,7 +324,7 @@ static void intel_smp_check(struct cpuinfo_x86 *c)
327 * Mask B, Pentium, but not Pentium MMX 324 * Mask B, Pentium, but not Pentium MMX
328 */ 325 */
329 if (c->x86 == 5 && 326 if (c->x86 == 5 &&
330 c->x86_mask >= 1 && c->x86_mask <= 4 && 327 c->x86_stepping >= 1 && c->x86_stepping <= 4 &&
331 c->x86_model <= 3) { 328 c->x86_model <= 3) {
332 /* 329 /*
333 * Remember we have B step Pentia with bugs 330 * Remember we have B step Pentia with bugs
@@ -370,7 +367,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
370 * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until 367 * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until
371 * model 3 mask 3 368 * model 3 mask 3
372 */ 369 */
373 if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) 370 if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) < 0x633)
374 clear_cpu_cap(c, X86_FEATURE_SEP); 371 clear_cpu_cap(c, X86_FEATURE_SEP);
375 372
376 /* 373 /*
@@ -388,7 +385,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
388 * P4 Xeon erratum 037 workaround. 385 * P4 Xeon erratum 037 workaround.
389 * Hardware prefetcher may cause stale data to be loaded into the cache. 386 * Hardware prefetcher may cause stale data to be loaded into the cache.
390 */ 387 */
391 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { 388 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_stepping == 1)) {
392 if (msr_set_bit(MSR_IA32_MISC_ENABLE, 389 if (msr_set_bit(MSR_IA32_MISC_ENABLE,
393 MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) { 390 MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) {
394 pr_info("CPU: C0 stepping P4 Xeon detected.\n"); 391 pr_info("CPU: C0 stepping P4 Xeon detected.\n");
@@ -403,7 +400,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
403 * Specification Update"). 400 * Specification Update").
404 */ 401 */
405 if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 && 402 if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 &&
406 (c->x86_mask < 0x6 || c->x86_mask == 0xb)) 403 (c->x86_stepping < 0x6 || c->x86_stepping == 0xb))
407 set_cpu_bug(c, X86_BUG_11AP); 404 set_cpu_bug(c, X86_BUG_11AP);
408 405
409 406
@@ -650,7 +647,7 @@ static void init_intel(struct cpuinfo_x86 *c)
650 case 6: 647 case 6:
651 if (l2 == 128) 648 if (l2 == 128)
652 p = "Celeron (Mendocino)"; 649 p = "Celeron (Mendocino)";
653 else if (c->x86_mask == 0 || c->x86_mask == 5) 650 else if (c->x86_stepping == 0 || c->x86_stepping == 5)
654 p = "Celeron-A"; 651 p = "Celeron-A";
655 break; 652 break;
656 653
diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index 410629f10ad3..589b948e6e01 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -819,7 +819,7 @@ static __init void rdt_quirks(void)
819 cache_alloc_hsw_probe(); 819 cache_alloc_hsw_probe();
820 break; 820 break;
821 case INTEL_FAM6_SKYLAKE_X: 821 case INTEL_FAM6_SKYLAKE_X:
822 if (boot_cpu_data.x86_mask <= 4) 822 if (boot_cpu_data.x86_stepping <= 4)
823 set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat"); 823 set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat");
824 } 824 }
825} 825}
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index bdab7d2f51af..fca759d272a1 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1804,6 +1804,7 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
1804 goto out_common_fail; 1804 goto out_common_fail;
1805 } 1805 }
1806 closid = ret; 1806 closid = ret;
1807 ret = 0;
1807 1808
1808 rdtgrp->closid = closid; 1809 rdtgrp->closid = closid;
1809 list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups); 1810 list_add(&rdtgrp->rdtgroup_list, &rdt_all_groups);
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index aa0d5df9dc60..e956eb267061 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -115,4 +115,19 @@ static inline void mce_unregister_injector_chain(struct notifier_block *nb) { }
115 115
116extern struct mca_config mca_cfg; 116extern struct mca_config mca_cfg;
117 117
118#ifndef CONFIG_X86_64
119/*
120 * On 32-bit systems it would be difficult to safely unmap a poison page
121 * from the kernel 1:1 map because there are no non-canonical addresses that
122 * we can use to refer to the address without risking a speculative access.
123 * However, this isn't much of an issue because:
124 * 1) Few unmappable pages are in the 1:1 map. Most are in HIGHMEM which
125 * are only mapped into the kernel as needed
126 * 2) Few people would run a 32-bit kernel on a machine that supports
127 * recoverable errors because they have too much memory to boot 32-bit.
128 */
129static inline void mce_unmap_kpfn(unsigned long pfn) {}
130#define mce_unmap_kpfn mce_unmap_kpfn
131#endif
132
118#endif /* __X86_MCE_INTERNAL_H__ */ 133#endif /* __X86_MCE_INTERNAL_H__ */
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 3a8e88a611eb..8ff94d1e2dce 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -105,6 +105,10 @@ static struct irq_work mce_irq_work;
105 105
106static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs); 106static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);
107 107
108#ifndef mce_unmap_kpfn
109static void mce_unmap_kpfn(unsigned long pfn);
110#endif
111
108/* 112/*
109 * CPU/chipset specific EDAC code can register a notifier call here to print 113 * CPU/chipset specific EDAC code can register a notifier call here to print
110 * MCE errors in a human-readable form. 114 * MCE errors in a human-readable form.
@@ -234,7 +238,7 @@ static void __print_mce(struct mce *m)
234 m->cs, m->ip); 238 m->cs, m->ip);
235 239
236 if (m->cs == __KERNEL_CS) 240 if (m->cs == __KERNEL_CS)
237 pr_cont("{%pS}", (void *)m->ip); 241 pr_cont("{%pS}", (void *)(unsigned long)m->ip);
238 pr_cont("\n"); 242 pr_cont("\n");
239 } 243 }
240 244
@@ -590,7 +594,8 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,
590 594
591 if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) { 595 if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
592 pfn = mce->addr >> PAGE_SHIFT; 596 pfn = mce->addr >> PAGE_SHIFT;
593 memory_failure(pfn, 0); 597 if (!memory_failure(pfn, 0))
598 mce_unmap_kpfn(pfn);
594 } 599 }
595 600
596 return NOTIFY_OK; 601 return NOTIFY_OK;
@@ -1057,12 +1062,13 @@ static int do_memory_failure(struct mce *m)
1057 ret = memory_failure(m->addr >> PAGE_SHIFT, flags); 1062 ret = memory_failure(m->addr >> PAGE_SHIFT, flags);
1058 if (ret) 1063 if (ret)
1059 pr_err("Memory error not recovered"); 1064 pr_err("Memory error not recovered");
1065 else
1066 mce_unmap_kpfn(m->addr >> PAGE_SHIFT);
1060 return ret; 1067 return ret;
1061} 1068}
1062 1069
1063#if defined(arch_unmap_kpfn) && defined(CONFIG_MEMORY_FAILURE) 1070#ifndef mce_unmap_kpfn
1064 1071static void mce_unmap_kpfn(unsigned long pfn)
1065void arch_unmap_kpfn(unsigned long pfn)
1066{ 1072{
1067 unsigned long decoy_addr; 1073 unsigned long decoy_addr;
1068 1074
@@ -1073,7 +1079,7 @@ void arch_unmap_kpfn(unsigned long pfn)
1073 * We would like to just call: 1079 * We would like to just call:
1074 * set_memory_np((unsigned long)pfn_to_kaddr(pfn), 1); 1080 * set_memory_np((unsigned long)pfn_to_kaddr(pfn), 1);
1075 * but doing that would radically increase the odds of a 1081 * but doing that would radically increase the odds of a
1076 * speculative access to the posion page because we'd have 1082 * speculative access to the poison page because we'd have
1077 * the virtual address of the kernel 1:1 mapping sitting 1083 * the virtual address of the kernel 1:1 mapping sitting
1078 * around in registers. 1084 * around in registers.
1079 * Instead we get tricky. We create a non-canonical address 1085 * Instead we get tricky. We create a non-canonical address
@@ -1098,7 +1104,6 @@ void arch_unmap_kpfn(unsigned long pfn)
1098 1104
1099 if (set_memory_np(decoy_addr, 1)) 1105 if (set_memory_np(decoy_addr, 1))
1100 pr_warn("Could not invalidate pfn=0x%lx from 1:1 map\n", pfn); 1106 pr_warn("Could not invalidate pfn=0x%lx from 1:1 map\n", pfn);
1101
1102} 1107}
1103#endif 1108#endif
1104 1109
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 330b8462d426..a998e1a7d46f 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -498,7 +498,7 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size,
498 return patch_size; 498 return patch_size;
499} 499}
500 500
501static int apply_microcode_amd(int cpu) 501static enum ucode_state apply_microcode_amd(int cpu)
502{ 502{
503 struct cpuinfo_x86 *c = &cpu_data(cpu); 503 struct cpuinfo_x86 *c = &cpu_data(cpu);
504 struct microcode_amd *mc_amd; 504 struct microcode_amd *mc_amd;
@@ -512,7 +512,7 @@ static int apply_microcode_amd(int cpu)
512 512
513 p = find_patch(cpu); 513 p = find_patch(cpu);
514 if (!p) 514 if (!p)
515 return 0; 515 return UCODE_NFOUND;
516 516
517 mc_amd = p->data; 517 mc_amd = p->data;
518 uci->mc = p->data; 518 uci->mc = p->data;
@@ -523,13 +523,13 @@ static int apply_microcode_amd(int cpu)
523 if (rev >= mc_amd->hdr.patch_id) { 523 if (rev >= mc_amd->hdr.patch_id) {
524 c->microcode = rev; 524 c->microcode = rev;
525 uci->cpu_sig.rev = rev; 525 uci->cpu_sig.rev = rev;
526 return 0; 526 return UCODE_OK;
527 } 527 }
528 528
529 if (__apply_microcode_amd(mc_amd)) { 529 if (__apply_microcode_amd(mc_amd)) {
530 pr_err("CPU%d: update failed for patch_level=0x%08x\n", 530 pr_err("CPU%d: update failed for patch_level=0x%08x\n",
531 cpu, mc_amd->hdr.patch_id); 531 cpu, mc_amd->hdr.patch_id);
532 return -1; 532 return UCODE_ERROR;
533 } 533 }
534 pr_info("CPU%d: new patch_level=0x%08x\n", cpu, 534 pr_info("CPU%d: new patch_level=0x%08x\n", cpu,
535 mc_amd->hdr.patch_id); 535 mc_amd->hdr.patch_id);
@@ -537,7 +537,7 @@ static int apply_microcode_amd(int cpu)
537 uci->cpu_sig.rev = mc_amd->hdr.patch_id; 537 uci->cpu_sig.rev = mc_amd->hdr.patch_id;
538 c->microcode = mc_amd->hdr.patch_id; 538 c->microcode = mc_amd->hdr.patch_id;
539 539
540 return 0; 540 return UCODE_UPDATED;
541} 541}
542 542
543static int install_equiv_cpu_table(const u8 *buf) 543static int install_equiv_cpu_table(const u8 *buf)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 319dd65f98a2..aa1b9a422f2b 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -374,7 +374,7 @@ static int collect_cpu_info(int cpu)
374} 374}
375 375
376struct apply_microcode_ctx { 376struct apply_microcode_ctx {
377 int err; 377 enum ucode_state err;
378}; 378};
379 379
380static void apply_microcode_local(void *arg) 380static void apply_microcode_local(void *arg)
@@ -489,31 +489,30 @@ static void __exit microcode_dev_exit(void)
489/* fake device for request_firmware */ 489/* fake device for request_firmware */
490static struct platform_device *microcode_pdev; 490static struct platform_device *microcode_pdev;
491 491
492static int reload_for_cpu(int cpu) 492static enum ucode_state reload_for_cpu(int cpu)
493{ 493{
494 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 494 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
495 enum ucode_state ustate; 495 enum ucode_state ustate;
496 int err = 0;
497 496
498 if (!uci->valid) 497 if (!uci->valid)
499 return err; 498 return UCODE_OK;
500 499
501 ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev, true); 500 ustate = microcode_ops->request_microcode_fw(cpu, &microcode_pdev->dev, true);
502 if (ustate == UCODE_OK) 501 if (ustate != UCODE_OK)
503 apply_microcode_on_target(cpu); 502 return ustate;
504 else 503
505 if (ustate == UCODE_ERROR) 504 return apply_microcode_on_target(cpu);
506 err = -EINVAL;
507 return err;
508} 505}
509 506
510static ssize_t reload_store(struct device *dev, 507static ssize_t reload_store(struct device *dev,
511 struct device_attribute *attr, 508 struct device_attribute *attr,
512 const char *buf, size_t size) 509 const char *buf, size_t size)
513{ 510{
511 enum ucode_state tmp_ret = UCODE_OK;
512 bool do_callback = false;
514 unsigned long val; 513 unsigned long val;
514 ssize_t ret = 0;
515 int cpu; 515 int cpu;
516 ssize_t ret = 0, tmp_ret;
517 516
518 ret = kstrtoul(buf, 0, &val); 517 ret = kstrtoul(buf, 0, &val);
519 if (ret) 518 if (ret)
@@ -526,15 +525,21 @@ static ssize_t reload_store(struct device *dev,
526 mutex_lock(&microcode_mutex); 525 mutex_lock(&microcode_mutex);
527 for_each_online_cpu(cpu) { 526 for_each_online_cpu(cpu) {
528 tmp_ret = reload_for_cpu(cpu); 527 tmp_ret = reload_for_cpu(cpu);
529 if (tmp_ret != 0) 528 if (tmp_ret > UCODE_NFOUND) {
530 pr_warn("Error reloading microcode on CPU %d\n", cpu); 529 pr_warn("Error reloading microcode on CPU %d\n", cpu);
531 530
532 /* save retval of the first encountered reload error */ 531 /* set retval for the first encountered reload error */
533 if (!ret) 532 if (!ret)
534 ret = tmp_ret; 533 ret = -EINVAL;
534 }
535
536 if (tmp_ret == UCODE_UPDATED)
537 do_callback = true;
535 } 538 }
536 if (!ret) 539
537 perf_check_microcode(); 540 if (!ret && do_callback)
541 microcode_check();
542
538 mutex_unlock(&microcode_mutex); 543 mutex_unlock(&microcode_mutex);
539 put_online_cpus(); 544 put_online_cpus();
540 545
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index f7c55b0e753a..923054a6b760 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -772,7 +772,7 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
772 return 0; 772 return 0;
773} 773}
774 774
775static int apply_microcode_intel(int cpu) 775static enum ucode_state apply_microcode_intel(int cpu)
776{ 776{
777 struct microcode_intel *mc; 777 struct microcode_intel *mc;
778 struct ucode_cpu_info *uci; 778 struct ucode_cpu_info *uci;
@@ -782,7 +782,7 @@ static int apply_microcode_intel(int cpu)
782 782
783 /* We should bind the task to the CPU */ 783 /* We should bind the task to the CPU */
784 if (WARN_ON(raw_smp_processor_id() != cpu)) 784 if (WARN_ON(raw_smp_processor_id() != cpu))
785 return -1; 785 return UCODE_ERROR;
786 786
787 uci = ucode_cpu_info + cpu; 787 uci = ucode_cpu_info + cpu;
788 mc = uci->mc; 788 mc = uci->mc;
@@ -790,7 +790,7 @@ static int apply_microcode_intel(int cpu)
790 /* Look for a newer patch in our cache: */ 790 /* Look for a newer patch in our cache: */
791 mc = find_patch(uci); 791 mc = find_patch(uci);
792 if (!mc) 792 if (!mc)
793 return 0; 793 return UCODE_NFOUND;
794 } 794 }
795 795
796 /* write microcode via MSR 0x79 */ 796 /* write microcode via MSR 0x79 */
@@ -801,7 +801,7 @@ static int apply_microcode_intel(int cpu)
801 if (rev != mc->hdr.rev) { 801 if (rev != mc->hdr.rev) {
802 pr_err("CPU%d update to revision 0x%x failed\n", 802 pr_err("CPU%d update to revision 0x%x failed\n",
803 cpu, mc->hdr.rev); 803 cpu, mc->hdr.rev);
804 return -1; 804 return UCODE_ERROR;
805 } 805 }
806 806
807 if (rev != prev_rev) { 807 if (rev != prev_rev) {
@@ -818,7 +818,7 @@ static int apply_microcode_intel(int cpu)
818 uci->cpu_sig.rev = rev; 818 uci->cpu_sig.rev = rev;
819 c->microcode = rev; 819 c->microcode = rev;
820 820
821 return 0; 821 return UCODE_UPDATED;
822} 822}
823 823
824static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size, 824static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
@@ -921,7 +921,7 @@ static bool is_blacklisted(unsigned int cpu)
921 */ 921 */
922 if (c->x86 == 6 && 922 if (c->x86 == 6 &&
923 c->x86_model == INTEL_FAM6_BROADWELL_X && 923 c->x86_model == INTEL_FAM6_BROADWELL_X &&
924 c->x86_mask == 0x01 && 924 c->x86_stepping == 0x01 &&
925 llc_size_per_core > 2621440 && 925 llc_size_per_core > 2621440 &&
926 c->microcode < 0x0b000021) { 926 c->microcode < 0x0b000021) {
927 pr_err_once("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n", c->microcode); 927 pr_err_once("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n", c->microcode);
@@ -944,7 +944,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
944 return UCODE_NFOUND; 944 return UCODE_NFOUND;
945 945
946 sprintf(name, "intel-ucode/%02x-%02x-%02x", 946 sprintf(name, "intel-ucode/%02x-%02x-%02x",
947 c->x86, c->x86_model, c->x86_mask); 947 c->x86, c->x86_model, c->x86_stepping);
948 948
949 if (request_firmware_direct(&firmware, name, device)) { 949 if (request_firmware_direct(&firmware, name, device)) {
950 pr_debug("data file %s load failed\n", name); 950 pr_debug("data file %s load failed\n", name);
@@ -982,7 +982,7 @@ static struct microcode_ops microcode_intel_ops = {
982 982
983static int __init calc_llc_size_per_core(struct cpuinfo_x86 *c) 983static int __init calc_llc_size_per_core(struct cpuinfo_x86 *c)
984{ 984{
985 u64 llc_size = c->x86_cache_size * 1024; 985 u64 llc_size = c->x86_cache_size * 1024ULL;
986 986
987 do_div(llc_size, c->x86_max_cores); 987 do_div(llc_size, c->x86_max_cores);
988 988
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index fdc55215d44d..e12ee86906c6 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -859,7 +859,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size,
859 */ 859 */
860 if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 && 860 if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 &&
861 boot_cpu_data.x86_model == 1 && 861 boot_cpu_data.x86_model == 1 &&
862 boot_cpu_data.x86_mask <= 7) { 862 boot_cpu_data.x86_stepping <= 7) {
863 if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) { 863 if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
864 pr_warn("mtrr: base(0x%lx000) is not 4 MiB aligned\n", base); 864 pr_warn("mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
865 return -EINVAL; 865 return -EINVAL;
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 40d5a8a75212..7468de429087 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -711,8 +711,8 @@ void __init mtrr_bp_init(void)
711 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && 711 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
712 boot_cpu_data.x86 == 0xF && 712 boot_cpu_data.x86 == 0xF &&
713 boot_cpu_data.x86_model == 0x3 && 713 boot_cpu_data.x86_model == 0x3 &&
714 (boot_cpu_data.x86_mask == 0x3 || 714 (boot_cpu_data.x86_stepping == 0x3 ||
715 boot_cpu_data.x86_mask == 0x4)) 715 boot_cpu_data.x86_stepping == 0x4))
716 phys_addr = 36; 716 phys_addr = 36;
717 717
718 size_or_mask = SIZE_OR_MASK_BITS(phys_addr); 718 size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index e7ecedafa1c8..2c8522a39ed5 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -72,8 +72,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
72 c->x86_model, 72 c->x86_model,
73 c->x86_model_id[0] ? c->x86_model_id : "unknown"); 73 c->x86_model_id[0] ? c->x86_model_id : "unknown");
74 74
75 if (c->x86_mask || c->cpuid_level >= 0) 75 if (c->x86_stepping || c->cpuid_level >= 0)
76 seq_printf(m, "stepping\t: %d\n", c->x86_mask); 76 seq_printf(m, "stepping\t: %d\n", c->x86_stepping);
77 else 77 else
78 seq_puts(m, "stepping\t: unknown\n"); 78 seq_puts(m, "stepping\t: unknown\n");
79 if (c->microcode) 79 if (c->microcode)
@@ -91,8 +91,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
91 } 91 }
92 92
93 /* Cache size */ 93 /* Cache size */
94 if (c->x86_cache_size >= 0) 94 if (c->x86_cache_size)
95 seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); 95 seq_printf(m, "cache size\t: %u KB\n", c->x86_cache_size);
96 96
97 show_cpuinfo_core(m, c, cpu); 97 show_cpuinfo_core(m, c, cpu);
98 show_cpuinfo_misc(m, c); 98 show_cpuinfo_misc(m, c);
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index c29020907886..b59e4fb40fd9 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -37,7 +37,7 @@
37#define X86 new_cpu_data+CPUINFO_x86 37#define X86 new_cpu_data+CPUINFO_x86
38#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor 38#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor
39#define X86_MODEL new_cpu_data+CPUINFO_x86_model 39#define X86_MODEL new_cpu_data+CPUINFO_x86_model
40#define X86_MASK new_cpu_data+CPUINFO_x86_mask 40#define X86_STEPPING new_cpu_data+CPUINFO_x86_stepping
41#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math 41#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math
42#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level 42#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level
43#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability 43#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
@@ -332,7 +332,7 @@ ENTRY(startup_32_smp)
332 shrb $4,%al 332 shrb $4,%al
333 movb %al,X86_MODEL 333 movb %al,X86_MODEL
334 andb $0x0f,%cl # mask mask revision 334 andb $0x0f,%cl # mask mask revision
335 movb %cl,X86_MASK 335 movb %cl,X86_STEPPING
336 movl %edx,X86_CAPABILITY 336 movl %edx,X86_CAPABILITY
337 337
338.Lis486: 338.Lis486:
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 04a625f0fcda..0f545b3cf926 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -23,6 +23,7 @@
23#include <asm/nops.h> 23#include <asm/nops.h>
24#include "../entry/calling.h" 24#include "../entry/calling.h"
25#include <asm/export.h> 25#include <asm/export.h>
26#include <asm/nospec-branch.h>
26 27
27#ifdef CONFIG_PARAVIRT 28#ifdef CONFIG_PARAVIRT
28#include <asm/asm-offsets.h> 29#include <asm/asm-offsets.h>
@@ -134,6 +135,7 @@ ENTRY(secondary_startup_64)
134 135
135 /* Ensure I am executing from virtual addresses */ 136 /* Ensure I am executing from virtual addresses */
136 movq $1f, %rax 137 movq $1f, %rax
138 ANNOTATE_RETPOLINE_SAFE
137 jmp *%rax 139 jmp *%rax
1381: 1401:
139 UNWIND_HINT_EMPTY 141 UNWIND_HINT_EMPTY
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 4e37d1a851a6..bc1a27280c4b 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -49,7 +49,7 @@
49 49
50static int kvmapf = 1; 50static int kvmapf = 1;
51 51
52static int parse_no_kvmapf(char *arg) 52static int __init parse_no_kvmapf(char *arg)
53{ 53{
54 kvmapf = 0; 54 kvmapf = 0;
55 return 0; 55 return 0;
@@ -58,7 +58,7 @@ static int parse_no_kvmapf(char *arg)
58early_param("no-kvmapf", parse_no_kvmapf); 58early_param("no-kvmapf", parse_no_kvmapf);
59 59
60static int steal_acc = 1; 60static int steal_acc = 1;
61static int parse_no_stealacc(char *arg) 61static int __init parse_no_stealacc(char *arg)
62{ 62{
63 steal_acc = 0; 63 steal_acc = 0;
64 return 0; 64 return 0;
@@ -67,7 +67,7 @@ static int parse_no_stealacc(char *arg)
67early_param("no-steal-acc", parse_no_stealacc); 67early_param("no-steal-acc", parse_no_stealacc);
68 68
69static int kvmclock_vsyscall = 1; 69static int kvmclock_vsyscall = 1;
70static int parse_no_kvmclock_vsyscall(char *arg) 70static int __init parse_no_kvmclock_vsyscall(char *arg)
71{ 71{
72 kvmclock_vsyscall = 0; 72 kvmclock_vsyscall = 0;
73 return 0; 73 return 0;
@@ -341,10 +341,10 @@ static void kvm_guest_cpu_init(void)
341#endif 341#endif
342 pa |= KVM_ASYNC_PF_ENABLED; 342 pa |= KVM_ASYNC_PF_ENABLED;
343 343
344 /* Async page fault support for L1 hypervisor is optional */ 344 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_VMEXIT))
345 if (wrmsr_safe(MSR_KVM_ASYNC_PF_EN, 345 pa |= KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT;
346 (pa | KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT) & 0xffffffff, pa >> 32) < 0) 346
347 wrmsrl(MSR_KVM_ASYNC_PF_EN, pa); 347 wrmsrl(MSR_KVM_ASYNC_PF_EN, pa);
348 __this_cpu_write(apf_reason.enabled, 1); 348 __this_cpu_write(apf_reason.enabled, 1);
349 printk(KERN_INFO"KVM setup async PF for cpu %d\n", 349 printk(KERN_INFO"KVM setup async PF for cpu %d\n",
350 smp_processor_id()); 350 smp_processor_id());
@@ -545,7 +545,8 @@ static void __init kvm_guest_init(void)
545 pv_time_ops.steal_clock = kvm_steal_clock; 545 pv_time_ops.steal_clock = kvm_steal_clock;
546 } 546 }
547 547
548 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH)) 548 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
549 !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME))
549 pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others; 550 pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others;
550 551
551 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) 552 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -633,7 +634,8 @@ static __init int kvm_setup_pv_tlb_flush(void)
633{ 634{
634 int cpu; 635 int cpu;
635 636
636 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH)) { 637 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
638 !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
637 for_each_possible_cpu(cpu) { 639 for_each_possible_cpu(cpu) {
638 zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu), 640 zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu),
639 GFP_KERNEL, cpu_to_node(cpu)); 641 GFP_KERNEL, cpu_to_node(cpu));
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 1f790cf9d38f..3b7427aa7d85 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -542,6 +542,7 @@ int arch_kexec_apply_relocations_add(const Elf64_Ehdr *ehdr,
542 goto overflow; 542 goto overflow;
543 break; 543 break;
544 case R_X86_64_PC32: 544 case R_X86_64_PC32:
545 case R_X86_64_PLT32:
545 value -= (u64)address; 546 value -= (u64)address;
546 *(u32 *)location = value; 547 *(u32 *)location = value;
547 break; 548 break;
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index da0c160e5589..f58336af095c 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -191,6 +191,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
191 goto overflow; 191 goto overflow;
192 break; 192 break;
193 case R_X86_64_PC32: 193 case R_X86_64_PC32:
194 case R_X86_64_PLT32:
194 if (*(u32 *)loc != 0) 195 if (*(u32 *)loc != 0)
195 goto invalid_relocation; 196 goto invalid_relocation;
196 val -= (u64)loc; 197 val -= (u64)loc;
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 27d0a1712663..f1c5eb99d445 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -410,7 +410,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
410 processor.apicver = mpc_default_type > 4 ? 0x10 : 0x01; 410 processor.apicver = mpc_default_type > 4 ? 0x10 : 0x01;
411 processor.cpuflag = CPU_ENABLED; 411 processor.cpuflag = CPU_ENABLED;
412 processor.cpufeature = (boot_cpu_data.x86 << 8) | 412 processor.cpufeature = (boot_cpu_data.x86 << 8) |
413 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; 413 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_stepping;
414 processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX]; 414 processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX];
415 processor.reserved[0] = 0; 415 processor.reserved[0] = 0;
416 processor.reserved[1] = 0; 416 processor.reserved[1] = 0;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 041096bdef86..99dc79e76bdc 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -200,9 +200,9 @@ static void native_flush_tlb_global(void)
200 __native_flush_tlb_global(); 200 __native_flush_tlb_global();
201} 201}
202 202
203static void native_flush_tlb_single(unsigned long addr) 203static void native_flush_tlb_one_user(unsigned long addr)
204{ 204{
205 __native_flush_tlb_single(addr); 205 __native_flush_tlb_one_user(addr);
206} 206}
207 207
208struct static_key paravirt_steal_enabled; 208struct static_key paravirt_steal_enabled;
@@ -401,7 +401,7 @@ struct pv_mmu_ops pv_mmu_ops __ro_after_init = {
401 401
402 .flush_tlb_user = native_flush_tlb, 402 .flush_tlb_user = native_flush_tlb,
403 .flush_tlb_kernel = native_flush_tlb_global, 403 .flush_tlb_kernel = native_flush_tlb_global,
404 .flush_tlb_single = native_flush_tlb_single, 404 .flush_tlb_one_user = native_flush_tlb_one_user,
405 .flush_tlb_others = native_flush_tlb_others, 405 .flush_tlb_others = native_flush_tlb_others,
406 406
407 .pgd_alloc = __paravirt_pgd_alloc, 407 .pgd_alloc = __paravirt_pgd_alloc,
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 1ae67e982af7..4c616be28506 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1204,20 +1204,13 @@ void __init setup_arch(char **cmdline_p)
1204 1204
1205 kasan_init(); 1205 kasan_init();
1206 1206
1207#ifdef CONFIG_X86_32
1208 /* sync back kernel address range */
1209 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
1210 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
1211 KERNEL_PGD_PTRS);
1212
1213 /* 1207 /*
1214 * sync back low identity map too. It is used for example 1208 * Sync back kernel address range.
1215 * in the 32-bit EFI stub. 1209 *
1210 * FIXME: Can the later sync in setup_cpu_entry_areas() replace
1211 * this call?
1216 */ 1212 */
1217 clone_pgd_range(initial_page_table, 1213 sync_initial_page_table();
1218 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
1219 min(KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY));
1220#endif
1221 1214
1222 tboot_probe(); 1215 tboot_probe();
1223 1216
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 497aa766fab3..ea554f812ee1 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -287,24 +287,15 @@ void __init setup_per_cpu_areas(void)
287 /* Setup cpu initialized, callin, callout masks */ 287 /* Setup cpu initialized, callin, callout masks */
288 setup_cpu_local_masks(); 288 setup_cpu_local_masks();
289 289
290#ifdef CONFIG_X86_32
291 /* 290 /*
292 * Sync back kernel address range again. We already did this in 291 * Sync back kernel address range again. We already did this in
293 * setup_arch(), but percpu data also needs to be available in 292 * setup_arch(), but percpu data also needs to be available in
294 * the smpboot asm. We can't reliably pick up percpu mappings 293 * the smpboot asm. We can't reliably pick up percpu mappings
295 * using vmalloc_fault(), because exception dispatch needs 294 * using vmalloc_fault(), because exception dispatch needs
296 * percpu data. 295 * percpu data.
296 *
297 * FIXME: Can the later sync in setup_cpu_entry_areas() replace
298 * this call?
297 */ 299 */
298 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, 300 sync_initial_page_table();
299 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
300 KERNEL_PGD_PTRS);
301
302 /*
303 * sync back low identity map too. It is used for example
304 * in the 32-bit EFI stub.
305 */
306 clone_pgd_range(initial_page_table,
307 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
308 min(KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY));
309#endif
310} 301}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6f27facbaa9b..ff99e2b6fc54 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1281,11 +1281,10 @@ void __init native_smp_prepare_boot_cpu(void)
1281 cpu_set_state_online(me); 1281 cpu_set_state_online(me);
1282} 1282}
1283 1283
1284void __init native_smp_cpus_done(unsigned int max_cpus) 1284void __init calculate_max_logical_packages(void)
1285{ 1285{
1286 int ncpus; 1286 int ncpus;
1287 1287
1288 pr_debug("Boot done\n");
1289 /* 1288 /*
1290 * Today neither Intel nor AMD support heterogenous systems so 1289 * Today neither Intel nor AMD support heterogenous systems so
1291 * extrapolate the boot cpu's data to all packages. 1290 * extrapolate the boot cpu's data to all packages.
@@ -1293,6 +1292,13 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1293 ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); 1292 ncpus = cpu_data(0).booted_cores * topology_max_smt_threads();
1294 __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); 1293 __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus);
1295 pr_info("Max logical packages: %u\n", __max_logical_packages); 1294 pr_info("Max logical packages: %u\n", __max_logical_packages);
1295}
1296
1297void __init native_smp_cpus_done(unsigned int max_cpus)
1298{
1299 pr_debug("Boot done\n");
1300
1301 calculate_max_logical_packages();
1296 1302
1297 if (x86_has_numa_in_package) 1303 if (x86_has_numa_in_package)
1298 set_sched_topology(x86_numa_in_package_topology); 1304 set_sched_topology(x86_numa_in_package_topology);
@@ -1430,8 +1436,8 @@ static void remove_siblinginfo(int cpu)
1430 cpumask_clear(cpu_llc_shared_mask(cpu)); 1436 cpumask_clear(cpu_llc_shared_mask(cpu));
1431 cpumask_clear(topology_sibling_cpumask(cpu)); 1437 cpumask_clear(topology_sibling_cpumask(cpu));
1432 cpumask_clear(topology_core_cpumask(cpu)); 1438 cpumask_clear(topology_core_cpumask(cpu));
1433 c->phys_proc_id = 0;
1434 c->cpu_core_id = 0; 1439 c->cpu_core_id = 0;
1440 c->booted_cores = 0;
1435 cpumask_clear_cpu(cpu, cpu_sibling_setup_mask); 1441 cpumask_clear_cpu(cpu, cpu_sibling_setup_mask);
1436 recompute_smt_state(); 1442 recompute_smt_state();
1437} 1443}
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 446c9ef8cfc3..3d9b2308e7fa 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -181,7 +181,7 @@ int fixup_bug(struct pt_regs *regs, int trapnr)
181 break; 181 break;
182 182
183 case BUG_TRAP_TYPE_WARN: 183 case BUG_TRAP_TYPE_WARN:
184 regs->ip += LEN_UD0; 184 regs->ip += LEN_UD2;
185 return 1; 185 return 1;
186 } 186 }
187 187
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index 1f9188f5357c..feb28fee6cea 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -5,7 +5,6 @@
5#include <asm/unwind.h> 5#include <asm/unwind.h>
6#include <asm/orc_types.h> 6#include <asm/orc_types.h>
7#include <asm/orc_lookup.h> 7#include <asm/orc_lookup.h>
8#include <asm/sections.h>
9 8
10#define orc_warn(fmt, ...) \ 9#define orc_warn(fmt, ...) \
11 printk_deferred_once(KERN_WARNING pr_fmt("WARNING: " fmt), ##__VA_ARGS__) 10 printk_deferred_once(KERN_WARNING pr_fmt("WARNING: " fmt), ##__VA_ARGS__)
@@ -148,7 +147,7 @@ static struct orc_entry *orc_find(unsigned long ip)
148 } 147 }
149 148
150 /* vmlinux .init slow lookup: */ 149 /* vmlinux .init slow lookup: */
151 if (ip >= (unsigned long)_sinittext && ip < (unsigned long)_einittext) 150 if (init_kernel_text(ip))
152 return __orc_find(__start_orc_unwind_ip, __start_orc_unwind, 151 return __orc_find(__start_orc_unwind_ip, __start_orc_unwind,
153 __stop_orc_unwind_ip - __start_orc_unwind_ip, ip); 152 __stop_orc_unwind_ip - __start_orc_unwind_ip, ip);
154 153
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index a0c5a69bc7c4..b671fc2d0422 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -607,7 +607,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
607 (1 << KVM_FEATURE_PV_EOI) | 607 (1 << KVM_FEATURE_PV_EOI) |
608 (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) | 608 (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) |
609 (1 << KVM_FEATURE_PV_UNHALT) | 609 (1 << KVM_FEATURE_PV_UNHALT) |
610 (1 << KVM_FEATURE_PV_TLB_FLUSH); 610 (1 << KVM_FEATURE_PV_TLB_FLUSH) |
611 (1 << KVM_FEATURE_ASYNC_PF_VMEXIT);
611 612
612 if (sched_info_on()) 613 if (sched_info_on())
613 entry->eax |= (1 << KVM_FEATURE_STEAL_TIME); 614 entry->eax |= (1 << KVM_FEATURE_STEAL_TIME);
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 924ac8ce9d50..391dda8d43b7 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2002,14 +2002,13 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
2002 2002
2003void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) 2003void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)
2004{ 2004{
2005 struct kvm_lapic *apic; 2005 struct kvm_lapic *apic = vcpu->arch.apic;
2006 int i; 2006 int i;
2007 2007
2008 apic_debug("%s\n", __func__); 2008 if (!apic)
2009 return;
2009 2010
2010 ASSERT(vcpu); 2011 apic_debug("%s\n", __func__);
2011 apic = vcpu->arch.apic;
2012 ASSERT(apic != NULL);
2013 2012
2014 /* Stop the timer in case it's a reset to an active apic */ 2013 /* Stop the timer in case it's a reset to an active apic */
2015 hrtimer_cancel(&apic->lapic_timer.timer); 2014 hrtimer_cancel(&apic->lapic_timer.timer);
@@ -2165,7 +2164,6 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
2165 */ 2164 */
2166 vcpu->arch.apic_base = MSR_IA32_APICBASE_ENABLE; 2165 vcpu->arch.apic_base = MSR_IA32_APICBASE_ENABLE;
2167 static_key_slow_inc(&apic_sw_disabled.key); /* sw disabled at reset */ 2166 static_key_slow_inc(&apic_sw_disabled.key); /* sw disabled at reset */
2168 kvm_lapic_reset(vcpu, false);
2169 kvm_iodevice_init(&apic->dev, &apic_mmio_ops); 2167 kvm_iodevice_init(&apic->dev, &apic_mmio_ops);
2170 2168
2171 return 0; 2169 return 0;
@@ -2569,7 +2567,6 @@ void kvm_apic_accept_events(struct kvm_vcpu *vcpu)
2569 2567
2570 pe = xchg(&apic->pending_events, 0); 2568 pe = xchg(&apic->pending_events, 0);
2571 if (test_bit(KVM_APIC_INIT, &pe)) { 2569 if (test_bit(KVM_APIC_INIT, &pe)) {
2572 kvm_lapic_reset(vcpu, true);
2573 kvm_vcpu_reset(vcpu, true); 2570 kvm_vcpu_reset(vcpu, true);
2574 if (kvm_vcpu_is_bsp(apic->vcpu)) 2571 if (kvm_vcpu_is_bsp(apic->vcpu))
2575 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; 2572 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 8eca1d04aeb8..f551962ac294 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3029,7 +3029,7 @@ static int kvm_handle_bad_page(struct kvm_vcpu *vcpu, gfn_t gfn, kvm_pfn_t pfn)
3029 return RET_PF_RETRY; 3029 return RET_PF_RETRY;
3030 } 3030 }
3031 3031
3032 return -EFAULT; 3032 return RET_PF_EMULATE;
3033} 3033}
3034 3034
3035static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu, 3035static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu,
@@ -5080,7 +5080,7 @@ void kvm_mmu_uninit_vm(struct kvm *kvm)
5080typedef bool (*slot_level_handler) (struct kvm *kvm, struct kvm_rmap_head *rmap_head); 5080typedef bool (*slot_level_handler) (struct kvm *kvm, struct kvm_rmap_head *rmap_head);
5081 5081
5082/* The caller should hold mmu-lock before calling this function. */ 5082/* The caller should hold mmu-lock before calling this function. */
5083static bool 5083static __always_inline bool
5084slot_handle_level_range(struct kvm *kvm, struct kvm_memory_slot *memslot, 5084slot_handle_level_range(struct kvm *kvm, struct kvm_memory_slot *memslot,
5085 slot_level_handler fn, int start_level, int end_level, 5085 slot_level_handler fn, int start_level, int end_level,
5086 gfn_t start_gfn, gfn_t end_gfn, bool lock_flush_tlb) 5086 gfn_t start_gfn, gfn_t end_gfn, bool lock_flush_tlb)
@@ -5110,7 +5110,7 @@ slot_handle_level_range(struct kvm *kvm, struct kvm_memory_slot *memslot,
5110 return flush; 5110 return flush;
5111} 5111}
5112 5112
5113static bool 5113static __always_inline bool
5114slot_handle_level(struct kvm *kvm, struct kvm_memory_slot *memslot, 5114slot_handle_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5115 slot_level_handler fn, int start_level, int end_level, 5115 slot_level_handler fn, int start_level, int end_level,
5116 bool lock_flush_tlb) 5116 bool lock_flush_tlb)
@@ -5121,7 +5121,7 @@ slot_handle_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5121 lock_flush_tlb); 5121 lock_flush_tlb);
5122} 5122}
5123 5123
5124static bool 5124static __always_inline bool
5125slot_handle_all_level(struct kvm *kvm, struct kvm_memory_slot *memslot, 5125slot_handle_all_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5126 slot_level_handler fn, bool lock_flush_tlb) 5126 slot_level_handler fn, bool lock_flush_tlb)
5127{ 5127{
@@ -5129,7 +5129,7 @@ slot_handle_all_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5129 PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb); 5129 PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb);
5130} 5130}
5131 5131
5132static bool 5132static __always_inline bool
5133slot_handle_large_level(struct kvm *kvm, struct kvm_memory_slot *memslot, 5133slot_handle_large_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5134 slot_level_handler fn, bool lock_flush_tlb) 5134 slot_level_handler fn, bool lock_flush_tlb)
5135{ 5135{
@@ -5137,7 +5137,7 @@ slot_handle_large_level(struct kvm *kvm, struct kvm_memory_slot *memslot,
5137 PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb); 5137 PT_MAX_HUGEPAGE_LEVEL, lock_flush_tlb);
5138} 5138}
5139 5139
5140static bool 5140static __always_inline bool
5141slot_handle_leaf(struct kvm *kvm, struct kvm_memory_slot *memslot, 5141slot_handle_leaf(struct kvm *kvm, struct kvm_memory_slot *memslot,
5142 slot_level_handler fn, bool lock_flush_tlb) 5142 slot_level_handler fn, bool lock_flush_tlb)
5143{ 5143{
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index b3e488a74828..be9c839e2c89 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -49,6 +49,7 @@
49#include <asm/debugreg.h> 49#include <asm/debugreg.h>
50#include <asm/kvm_para.h> 50#include <asm/kvm_para.h>
51#include <asm/irq_remapping.h> 51#include <asm/irq_remapping.h>
52#include <asm/microcode.h>
52#include <asm/nospec-branch.h> 53#include <asm/nospec-branch.h>
53 54
54#include <asm/virtext.h> 55#include <asm/virtext.h>
@@ -178,6 +179,8 @@ struct vcpu_svm {
178 uint64_t sysenter_eip; 179 uint64_t sysenter_eip;
179 uint64_t tsc_aux; 180 uint64_t tsc_aux;
180 181
182 u64 msr_decfg;
183
181 u64 next_rip; 184 u64 next_rip;
182 185
183 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS]; 186 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
@@ -300,6 +303,8 @@ module_param(vgif, int, 0444);
300static int sev = IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT); 303static int sev = IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT);
301module_param(sev, int, 0444); 304module_param(sev, int, 0444);
302 305
306static u8 rsm_ins_bytes[] = "\x0f\xaa";
307
303static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); 308static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
304static void svm_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa); 309static void svm_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa);
305static void svm_complete_interrupts(struct vcpu_svm *svm); 310static void svm_complete_interrupts(struct vcpu_svm *svm);
@@ -1383,6 +1388,7 @@ static void init_vmcb(struct vcpu_svm *svm)
1383 set_intercept(svm, INTERCEPT_SKINIT); 1388 set_intercept(svm, INTERCEPT_SKINIT);
1384 set_intercept(svm, INTERCEPT_WBINVD); 1389 set_intercept(svm, INTERCEPT_WBINVD);
1385 set_intercept(svm, INTERCEPT_XSETBV); 1390 set_intercept(svm, INTERCEPT_XSETBV);
1391 set_intercept(svm, INTERCEPT_RSM);
1386 1392
1387 if (!kvm_mwait_in_guest()) { 1393 if (!kvm_mwait_in_guest()) {
1388 set_intercept(svm, INTERCEPT_MONITOR); 1394 set_intercept(svm, INTERCEPT_MONITOR);
@@ -1902,6 +1908,7 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
1902 u32 dummy; 1908 u32 dummy;
1903 u32 eax = 1; 1909 u32 eax = 1;
1904 1910
1911 vcpu->arch.microcode_version = 0x01000065;
1905 svm->spec_ctrl = 0; 1912 svm->spec_ctrl = 0;
1906 1913
1907 if (!init_event) { 1914 if (!init_event) {
@@ -3699,6 +3706,12 @@ static int emulate_on_interception(struct vcpu_svm *svm)
3699 return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; 3706 return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE;
3700} 3707}
3701 3708
3709static int rsm_interception(struct vcpu_svm *svm)
3710{
3711 return x86_emulate_instruction(&svm->vcpu, 0, 0,
3712 rsm_ins_bytes, 2) == EMULATE_DONE;
3713}
3714
3702static int rdpmc_interception(struct vcpu_svm *svm) 3715static int rdpmc_interception(struct vcpu_svm *svm)
3703{ 3716{
3704 int err; 3717 int err;
@@ -3860,6 +3873,22 @@ static int cr8_write_interception(struct vcpu_svm *svm)
3860 return 0; 3873 return 0;
3861} 3874}
3862 3875
3876static int svm_get_msr_feature(struct kvm_msr_entry *msr)
3877{
3878 msr->data = 0;
3879
3880 switch (msr->index) {
3881 case MSR_F10H_DECFG:
3882 if (boot_cpu_has(X86_FEATURE_LFENCE_RDTSC))
3883 msr->data |= MSR_F10H_DECFG_LFENCE_SERIALIZE;
3884 break;
3885 default:
3886 return 1;
3887 }
3888
3889 return 0;
3890}
3891
3863static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) 3892static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
3864{ 3893{
3865 struct vcpu_svm *svm = to_svm(vcpu); 3894 struct vcpu_svm *svm = to_svm(vcpu);
@@ -3935,9 +3964,6 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
3935 3964
3936 msr_info->data = svm->spec_ctrl; 3965 msr_info->data = svm->spec_ctrl;
3937 break; 3966 break;
3938 case MSR_IA32_UCODE_REV:
3939 msr_info->data = 0x01000065;
3940 break;
3941 case MSR_F15H_IC_CFG: { 3967 case MSR_F15H_IC_CFG: {
3942 3968
3943 int family, model; 3969 int family, model;
@@ -3955,6 +3981,9 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
3955 msr_info->data = 0x1E; 3981 msr_info->data = 0x1E;
3956 } 3982 }
3957 break; 3983 break;
3984 case MSR_F10H_DECFG:
3985 msr_info->data = svm->msr_decfg;
3986 break;
3958 default: 3987 default:
3959 return kvm_get_msr_common(vcpu, msr_info); 3988 return kvm_get_msr_common(vcpu, msr_info);
3960 } 3989 }
@@ -4133,6 +4162,24 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
4133 case MSR_VM_IGNNE: 4162 case MSR_VM_IGNNE:
4134 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data); 4163 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
4135 break; 4164 break;
4165 case MSR_F10H_DECFG: {
4166 struct kvm_msr_entry msr_entry;
4167
4168 msr_entry.index = msr->index;
4169 if (svm_get_msr_feature(&msr_entry))
4170 return 1;
4171
4172 /* Check the supported bits */
4173 if (data & ~msr_entry.data)
4174 return 1;
4175
4176 /* Don't allow the guest to change a bit, #GP */
4177 if (!msr->host_initiated && (data ^ msr_entry.data))
4178 return 1;
4179
4180 svm->msr_decfg = data;
4181 break;
4182 }
4136 case MSR_IA32_APICBASE: 4183 case MSR_IA32_APICBASE:
4137 if (kvm_vcpu_apicv_active(vcpu)) 4184 if (kvm_vcpu_apicv_active(vcpu))
4138 avic_update_vapic_bar(to_svm(vcpu), data); 4185 avic_update_vapic_bar(to_svm(vcpu), data);
@@ -4541,7 +4588,7 @@ static int (*const svm_exit_handlers[])(struct vcpu_svm *svm) = {
4541 [SVM_EXIT_MWAIT] = mwait_interception, 4588 [SVM_EXIT_MWAIT] = mwait_interception,
4542 [SVM_EXIT_XSETBV] = xsetbv_interception, 4589 [SVM_EXIT_XSETBV] = xsetbv_interception,
4543 [SVM_EXIT_NPF] = npf_interception, 4590 [SVM_EXIT_NPF] = npf_interception,
4544 [SVM_EXIT_RSM] = emulate_on_interception, 4591 [SVM_EXIT_RSM] = rsm_interception,
4545 [SVM_EXIT_AVIC_INCOMPLETE_IPI] = avic_incomplete_ipi_interception, 4592 [SVM_EXIT_AVIC_INCOMPLETE_IPI] = avic_incomplete_ipi_interception,
4546 [SVM_EXIT_AVIC_UNACCELERATED_ACCESS] = avic_unaccelerated_access_interception, 4593 [SVM_EXIT_AVIC_UNACCELERATED_ACCESS] = avic_unaccelerated_access_interception,
4547}; 4594};
@@ -5355,7 +5402,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
5355 * being speculatively taken. 5402 * being speculatively taken.
5356 */ 5403 */
5357 if (svm->spec_ctrl) 5404 if (svm->spec_ctrl)
5358 wrmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl); 5405 native_wrmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl);
5359 5406
5360 asm volatile ( 5407 asm volatile (
5361 "push %%" _ASM_BP "; \n\t" 5408 "push %%" _ASM_BP "; \n\t"
@@ -5464,11 +5511,11 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
5464 * If the L02 MSR bitmap does not intercept the MSR, then we need to 5511 * If the L02 MSR bitmap does not intercept the MSR, then we need to
5465 * save it. 5512 * save it.
5466 */ 5513 */
5467 if (!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)) 5514 if (unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)))
5468 rdmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl); 5515 svm->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL);
5469 5516
5470 if (svm->spec_ctrl) 5517 if (svm->spec_ctrl)
5471 wrmsrl(MSR_IA32_SPEC_CTRL, 0); 5518 native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
5472 5519
5473 /* Eliminate branch target predictions from guest mode */ 5520 /* Eliminate branch target predictions from guest mode */
5474 vmexit_fill_RSB(); 5521 vmexit_fill_RSB();
@@ -6236,16 +6283,18 @@ e_free:
6236 6283
6237static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp) 6284static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp)
6238{ 6285{
6286 void __user *measure = (void __user *)(uintptr_t)argp->data;
6239 struct kvm_sev_info *sev = &kvm->arch.sev_info; 6287 struct kvm_sev_info *sev = &kvm->arch.sev_info;
6240 struct sev_data_launch_measure *data; 6288 struct sev_data_launch_measure *data;
6241 struct kvm_sev_launch_measure params; 6289 struct kvm_sev_launch_measure params;
6290 void __user *p = NULL;
6242 void *blob = NULL; 6291 void *blob = NULL;
6243 int ret; 6292 int ret;
6244 6293
6245 if (!sev_guest(kvm)) 6294 if (!sev_guest(kvm))
6246 return -ENOTTY; 6295 return -ENOTTY;
6247 6296
6248 if (copy_from_user(&params, (void __user *)(uintptr_t)argp->data, sizeof(params))) 6297 if (copy_from_user(&params, measure, sizeof(params)))
6249 return -EFAULT; 6298 return -EFAULT;
6250 6299
6251 data = kzalloc(sizeof(*data), GFP_KERNEL); 6300 data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -6256,17 +6305,13 @@ static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp)
6256 if (!params.len) 6305 if (!params.len)
6257 goto cmd; 6306 goto cmd;
6258 6307
6259 if (params.uaddr) { 6308 p = (void __user *)(uintptr_t)params.uaddr;
6309 if (p) {
6260 if (params.len > SEV_FW_BLOB_MAX_SIZE) { 6310 if (params.len > SEV_FW_BLOB_MAX_SIZE) {
6261 ret = -EINVAL; 6311 ret = -EINVAL;
6262 goto e_free; 6312 goto e_free;
6263 } 6313 }
6264 6314
6265 if (!access_ok(VERIFY_WRITE, params.uaddr, params.len)) {
6266 ret = -EFAULT;
6267 goto e_free;
6268 }
6269
6270 ret = -ENOMEM; 6315 ret = -ENOMEM;
6271 blob = kmalloc(params.len, GFP_KERNEL); 6316 blob = kmalloc(params.len, GFP_KERNEL);
6272 if (!blob) 6317 if (!blob)
@@ -6290,13 +6335,13 @@ cmd:
6290 goto e_free_blob; 6335 goto e_free_blob;
6291 6336
6292 if (blob) { 6337 if (blob) {
6293 if (copy_to_user((void __user *)(uintptr_t)params.uaddr, blob, params.len)) 6338 if (copy_to_user(p, blob, params.len))
6294 ret = -EFAULT; 6339 ret = -EFAULT;
6295 } 6340 }
6296 6341
6297done: 6342done:
6298 params.len = data->len; 6343 params.len = data->len;
6299 if (copy_to_user((void __user *)(uintptr_t)argp->data, &params, sizeof(params))) 6344 if (copy_to_user(measure, &params, sizeof(params)))
6300 ret = -EFAULT; 6345 ret = -EFAULT;
6301e_free_blob: 6346e_free_blob:
6302 kfree(blob); 6347 kfree(blob);
@@ -6597,7 +6642,7 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
6597 struct page **pages; 6642 struct page **pages;
6598 void *blob, *hdr; 6643 void *blob, *hdr;
6599 unsigned long n; 6644 unsigned long n;
6600 int ret; 6645 int ret, offset;
6601 6646
6602 if (!sev_guest(kvm)) 6647 if (!sev_guest(kvm))
6603 return -ENOTTY; 6648 return -ENOTTY;
@@ -6623,6 +6668,10 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
6623 if (!data) 6668 if (!data)
6624 goto e_unpin_memory; 6669 goto e_unpin_memory;
6625 6670
6671 offset = params.guest_uaddr & (PAGE_SIZE - 1);
6672 data->guest_address = __sme_page_pa(pages[0]) + offset;
6673 data->guest_len = params.guest_len;
6674
6626 blob = psp_copy_user_blob(params.trans_uaddr, params.trans_len); 6675 blob = psp_copy_user_blob(params.trans_uaddr, params.trans_len);
6627 if (IS_ERR(blob)) { 6676 if (IS_ERR(blob)) {
6628 ret = PTR_ERR(blob); 6677 ret = PTR_ERR(blob);
@@ -6637,8 +6686,8 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
6637 ret = PTR_ERR(hdr); 6686 ret = PTR_ERR(hdr);
6638 goto e_free_blob; 6687 goto e_free_blob;
6639 } 6688 }
6640 data->trans_address = __psp_pa(blob); 6689 data->hdr_address = __psp_pa(hdr);
6641 data->trans_len = params.trans_len; 6690 data->hdr_len = params.hdr_len;
6642 6691
6643 data->handle = sev->handle; 6692 data->handle = sev->handle;
6644 ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_UPDATE_SECRET, data, &argp->error); 6693 ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_UPDATE_SECRET, data, &argp->error);
@@ -6821,6 +6870,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = {
6821 .vcpu_unblocking = svm_vcpu_unblocking, 6870 .vcpu_unblocking = svm_vcpu_unblocking,
6822 6871
6823 .update_bp_intercept = update_bp_intercept, 6872 .update_bp_intercept = update_bp_intercept,
6873 .get_msr_feature = svm_get_msr_feature,
6824 .get_msr = svm_get_msr, 6874 .get_msr = svm_get_msr,
6825 .set_msr = svm_set_msr, 6875 .set_msr = svm_set_msr,
6826 .get_segment_base = svm_get_segment_base, 6876 .get_segment_base = svm_get_segment_base,
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f427723dc7db..051dab74e4e9 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -51,6 +51,7 @@
51#include <asm/apic.h> 51#include <asm/apic.h>
52#include <asm/irq_remapping.h> 52#include <asm/irq_remapping.h>
53#include <asm/mmu_context.h> 53#include <asm/mmu_context.h>
54#include <asm/microcode.h>
54#include <asm/nospec-branch.h> 55#include <asm/nospec-branch.h>
55 56
56#include "trace.h" 57#include "trace.h"
@@ -3226,6 +3227,11 @@ static inline bool vmx_feature_control_msr_valid(struct kvm_vcpu *vcpu,
3226 return !(val & ~valid_bits); 3227 return !(val & ~valid_bits);
3227} 3228}
3228 3229
3230static int vmx_get_msr_feature(struct kvm_msr_entry *msr)
3231{
3232 return 1;
3233}
3234
3229/* 3235/*
3230 * Reads an msr value (of 'msr_index') into 'pdata'. 3236 * Reads an msr value (of 'msr_index') into 'pdata'.
3231 * Returns 0 on success, non-0 otherwise. 3237 * Returns 0 on success, non-0 otherwise.
@@ -4485,7 +4491,8 @@ static int vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
4485 vmcs_set_bits(SECONDARY_VM_EXEC_CONTROL, 4491 vmcs_set_bits(SECONDARY_VM_EXEC_CONTROL,
4486 SECONDARY_EXEC_DESC); 4492 SECONDARY_EXEC_DESC);
4487 hw_cr4 &= ~X86_CR4_UMIP; 4493 hw_cr4 &= ~X86_CR4_UMIP;
4488 } else 4494 } else if (!is_guest_mode(vcpu) ||
4495 !nested_cpu_has2(get_vmcs12(vcpu), SECONDARY_EXEC_DESC))
4489 vmcs_clear_bits(SECONDARY_VM_EXEC_CONTROL, 4496 vmcs_clear_bits(SECONDARY_VM_EXEC_CONTROL,
4490 SECONDARY_EXEC_DESC); 4497 SECONDARY_EXEC_DESC);
4491 4498
@@ -5765,6 +5772,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
5765 vmx->rmode.vm86_active = 0; 5772 vmx->rmode.vm86_active = 0;
5766 vmx->spec_ctrl = 0; 5773 vmx->spec_ctrl = 0;
5767 5774
5775 vcpu->arch.microcode_version = 0x100000000ULL;
5768 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); 5776 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
5769 kvm_set_cr8(vcpu, 0); 5777 kvm_set_cr8(vcpu, 0);
5770 5778
@@ -9452,7 +9460,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
9452 * being speculatively taken. 9460 * being speculatively taken.
9453 */ 9461 */
9454 if (vmx->spec_ctrl) 9462 if (vmx->spec_ctrl)
9455 wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl); 9463 native_wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl);
9456 9464
9457 vmx->__launched = vmx->loaded_vmcs->launched; 9465 vmx->__launched = vmx->loaded_vmcs->launched;
9458 asm( 9466 asm(
@@ -9587,11 +9595,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
9587 * If the L02 MSR bitmap does not intercept the MSR, then we need to 9595 * If the L02 MSR bitmap does not intercept the MSR, then we need to
9588 * save it. 9596 * save it.
9589 */ 9597 */
9590 if (!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)) 9598 if (unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)))
9591 rdmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl); 9599 vmx->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL);
9592 9600
9593 if (vmx->spec_ctrl) 9601 if (vmx->spec_ctrl)
9594 wrmsrl(MSR_IA32_SPEC_CTRL, 0); 9602 native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
9595 9603
9596 /* Eliminate branch target predictions from guest mode */ 9604 /* Eliminate branch target predictions from guest mode */
9597 vmexit_fill_RSB(); 9605 vmexit_fill_RSB();
@@ -10136,7 +10144,10 @@ static void nested_get_vmcs12_pages(struct kvm_vcpu *vcpu,
10136 (unsigned long)(vmcs12->posted_intr_desc_addr & 10144 (unsigned long)(vmcs12->posted_intr_desc_addr &
10137 (PAGE_SIZE - 1))); 10145 (PAGE_SIZE - 1)));
10138 } 10146 }
10139 if (!nested_vmx_prepare_msr_bitmap(vcpu, vmcs12)) 10147 if (nested_vmx_prepare_msr_bitmap(vcpu, vmcs12))
10148 vmcs_set_bits(CPU_BASED_VM_EXEC_CONTROL,
10149 CPU_BASED_USE_MSR_BITMAPS);
10150 else
10140 vmcs_clear_bits(CPU_BASED_VM_EXEC_CONTROL, 10151 vmcs_clear_bits(CPU_BASED_VM_EXEC_CONTROL,
10141 CPU_BASED_USE_MSR_BITMAPS); 10152 CPU_BASED_USE_MSR_BITMAPS);
10142} 10153}
@@ -10224,8 +10235,8 @@ static inline bool nested_vmx_prepare_msr_bitmap(struct kvm_vcpu *vcpu,
10224 * updated to reflect this when L1 (or its L2s) actually write to 10235 * updated to reflect this when L1 (or its L2s) actually write to
10225 * the MSR. 10236 * the MSR.
10226 */ 10237 */
10227 bool pred_cmd = msr_write_intercepted_l01(vcpu, MSR_IA32_PRED_CMD); 10238 bool pred_cmd = !msr_write_intercepted_l01(vcpu, MSR_IA32_PRED_CMD);
10228 bool spec_ctrl = msr_write_intercepted_l01(vcpu, MSR_IA32_SPEC_CTRL); 10239 bool spec_ctrl = !msr_write_intercepted_l01(vcpu, MSR_IA32_SPEC_CTRL);
10229 10240
10230 /* Nothing to do if the MSR bitmap is not in use. */ 10241 /* Nothing to do if the MSR bitmap is not in use. */
10231 if (!cpu_has_vmx_msr_bitmap() || 10242 if (!cpu_has_vmx_msr_bitmap() ||
@@ -11196,7 +11207,12 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
11196 if (ret) 11207 if (ret)
11197 return ret; 11208 return ret;
11198 11209
11199 if (vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT) 11210 /*
11211 * If we're entering a halted L2 vcpu and the L2 vcpu won't be woken
11212 * by event injection, halt vcpu.
11213 */
11214 if ((vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT) &&
11215 !(vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK))
11200 return kvm_vcpu_halt(vcpu); 11216 return kvm_vcpu_halt(vcpu);
11201 11217
11202 vmx->nested.nested_run_pending = 1; 11218 vmx->nested.nested_run_pending = 1;
@@ -12287,6 +12303,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = {
12287 .vcpu_put = vmx_vcpu_put, 12303 .vcpu_put = vmx_vcpu_put,
12288 12304
12289 .update_bp_intercept = update_exception_bitmap, 12305 .update_bp_intercept = update_exception_bitmap,
12306 .get_msr_feature = vmx_get_msr_feature,
12290 .get_msr = vmx_get_msr, 12307 .get_msr = vmx_get_msr,
12291 .set_msr = vmx_set_msr, 12308 .set_msr = vmx_set_msr,
12292 .get_segment_base = vmx_get_segment_base, 12309 .get_segment_base = vmx_get_segment_base,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c8a0b545ac20..18b5ca7a3197 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1049,6 +1049,45 @@ static u32 emulated_msrs[] = {
1049 1049
1050static unsigned num_emulated_msrs; 1050static unsigned num_emulated_msrs;
1051 1051
1052/*
1053 * List of msr numbers which are used to expose MSR-based features that
1054 * can be used by a hypervisor to validate requested CPU features.
1055 */
1056static u32 msr_based_features[] = {
1057 MSR_F10H_DECFG,
1058 MSR_IA32_UCODE_REV,
1059};
1060
1061static unsigned int num_msr_based_features;
1062
1063static int kvm_get_msr_feature(struct kvm_msr_entry *msr)
1064{
1065 switch (msr->index) {
1066 case MSR_IA32_UCODE_REV:
1067 rdmsrl(msr->index, msr->data);
1068 break;
1069 default:
1070 if (kvm_x86_ops->get_msr_feature(msr))
1071 return 1;
1072 }
1073 return 0;
1074}
1075
1076static int do_get_msr_feature(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
1077{
1078 struct kvm_msr_entry msr;
1079 int r;
1080
1081 msr.index = index;
1082 r = kvm_get_msr_feature(&msr);
1083 if (r)
1084 return r;
1085
1086 *data = msr.data;
1087
1088 return 0;
1089}
1090
1052bool kvm_valid_efer(struct kvm_vcpu *vcpu, u64 efer) 1091bool kvm_valid_efer(struct kvm_vcpu *vcpu, u64 efer)
1053{ 1092{
1054 if (efer & efer_reserved_bits) 1093 if (efer & efer_reserved_bits)
@@ -2222,7 +2261,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
2222 2261
2223 switch (msr) { 2262 switch (msr) {
2224 case MSR_AMD64_NB_CFG: 2263 case MSR_AMD64_NB_CFG:
2225 case MSR_IA32_UCODE_REV:
2226 case MSR_IA32_UCODE_WRITE: 2264 case MSR_IA32_UCODE_WRITE:
2227 case MSR_VM_HSAVE_PA: 2265 case MSR_VM_HSAVE_PA:
2228 case MSR_AMD64_PATCH_LOADER: 2266 case MSR_AMD64_PATCH_LOADER:
@@ -2230,6 +2268,10 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
2230 case MSR_AMD64_DC_CFG: 2268 case MSR_AMD64_DC_CFG:
2231 break; 2269 break;
2232 2270
2271 case MSR_IA32_UCODE_REV:
2272 if (msr_info->host_initiated)
2273 vcpu->arch.microcode_version = data;
2274 break;
2233 case MSR_EFER: 2275 case MSR_EFER:
2234 return set_efer(vcpu, data); 2276 return set_efer(vcpu, data);
2235 case MSR_K7_HWCR: 2277 case MSR_K7_HWCR:
@@ -2525,7 +2567,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
2525 msr_info->data = 0; 2567 msr_info->data = 0;
2526 break; 2568 break;
2527 case MSR_IA32_UCODE_REV: 2569 case MSR_IA32_UCODE_REV:
2528 msr_info->data = 0x100000000ULL; 2570 msr_info->data = vcpu->arch.microcode_version;
2529 break; 2571 break;
2530 case MSR_MTRRcap: 2572 case MSR_MTRRcap:
2531 case 0x200 ... 0x2ff: 2573 case 0x200 ... 0x2ff:
@@ -2680,13 +2722,11 @@ static int __msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs *msrs,
2680 int (*do_msr)(struct kvm_vcpu *vcpu, 2722 int (*do_msr)(struct kvm_vcpu *vcpu,
2681 unsigned index, u64 *data)) 2723 unsigned index, u64 *data))
2682{ 2724{
2683 int i, idx; 2725 int i;
2684 2726
2685 idx = srcu_read_lock(&vcpu->kvm->srcu);
2686 for (i = 0; i < msrs->nmsrs; ++i) 2727 for (i = 0; i < msrs->nmsrs; ++i)
2687 if (do_msr(vcpu, entries[i].index, &entries[i].data)) 2728 if (do_msr(vcpu, entries[i].index, &entries[i].data))
2688 break; 2729 break;
2689 srcu_read_unlock(&vcpu->kvm->srcu, idx);
2690 2730
2691 return i; 2731 return i;
2692} 2732}
@@ -2785,6 +2825,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
2785 case KVM_CAP_SET_BOOT_CPU_ID: 2825 case KVM_CAP_SET_BOOT_CPU_ID:
2786 case KVM_CAP_SPLIT_IRQCHIP: 2826 case KVM_CAP_SPLIT_IRQCHIP:
2787 case KVM_CAP_IMMEDIATE_EXIT: 2827 case KVM_CAP_IMMEDIATE_EXIT:
2828 case KVM_CAP_GET_MSR_FEATURES:
2788 r = 1; 2829 r = 1;
2789 break; 2830 break;
2790 case KVM_CAP_ADJUST_CLOCK: 2831 case KVM_CAP_ADJUST_CLOCK:
@@ -2899,6 +2940,31 @@ long kvm_arch_dev_ioctl(struct file *filp,
2899 goto out; 2940 goto out;
2900 r = 0; 2941 r = 0;
2901 break; 2942 break;
2943 case KVM_GET_MSR_FEATURE_INDEX_LIST: {
2944 struct kvm_msr_list __user *user_msr_list = argp;
2945 struct kvm_msr_list msr_list;
2946 unsigned int n;
2947
2948 r = -EFAULT;
2949 if (copy_from_user(&msr_list, user_msr_list, sizeof(msr_list)))
2950 goto out;
2951 n = msr_list.nmsrs;
2952 msr_list.nmsrs = num_msr_based_features;
2953 if (copy_to_user(user_msr_list, &msr_list, sizeof(msr_list)))
2954 goto out;
2955 r = -E2BIG;
2956 if (n < msr_list.nmsrs)
2957 goto out;
2958 r = -EFAULT;
2959 if (copy_to_user(user_msr_list->indices, &msr_based_features,
2960 num_msr_based_features * sizeof(u32)))
2961 goto out;
2962 r = 0;
2963 break;
2964 }
2965 case KVM_GET_MSRS:
2966 r = msr_io(NULL, argp, do_get_msr_feature, 1);
2967 break;
2902 } 2968 }
2903 default: 2969 default:
2904 r = -EINVAL; 2970 r = -EINVAL;
@@ -3636,12 +3702,18 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
3636 r = 0; 3702 r = 0;
3637 break; 3703 break;
3638 } 3704 }
3639 case KVM_GET_MSRS: 3705 case KVM_GET_MSRS: {
3706 int idx = srcu_read_lock(&vcpu->kvm->srcu);
3640 r = msr_io(vcpu, argp, do_get_msr, 1); 3707 r = msr_io(vcpu, argp, do_get_msr, 1);
3708 srcu_read_unlock(&vcpu->kvm->srcu, idx);
3641 break; 3709 break;
3642 case KVM_SET_MSRS: 3710 }
3711 case KVM_SET_MSRS: {
3712 int idx = srcu_read_lock(&vcpu->kvm->srcu);
3643 r = msr_io(vcpu, argp, do_set_msr, 0); 3713 r = msr_io(vcpu, argp, do_set_msr, 0);
3714 srcu_read_unlock(&vcpu->kvm->srcu, idx);
3644 break; 3715 break;
3716 }
3645 case KVM_TPR_ACCESS_REPORTING: { 3717 case KVM_TPR_ACCESS_REPORTING: {
3646 struct kvm_tpr_access_ctl tac; 3718 struct kvm_tpr_access_ctl tac;
3647 3719
@@ -4464,6 +4536,19 @@ static void kvm_init_msr_list(void)
4464 j++; 4536 j++;
4465 } 4537 }
4466 num_emulated_msrs = j; 4538 num_emulated_msrs = j;
4539
4540 for (i = j = 0; i < ARRAY_SIZE(msr_based_features); i++) {
4541 struct kvm_msr_entry msr;
4542
4543 msr.index = msr_based_features[i];
4544 if (kvm_get_msr_feature(&msr))
4545 continue;
4546
4547 if (j < i)
4548 msr_based_features[j] = msr_based_features[i];
4549 j++;
4550 }
4551 num_msr_based_features = j;
4467} 4552}
4468 4553
4469static int vcpu_mmio_write(struct kvm_vcpu *vcpu, gpa_t addr, int len, 4554static int vcpu_mmio_write(struct kvm_vcpu *vcpu, gpa_t addr, int len,
@@ -8017,6 +8102,8 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
8017 8102
8018void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) 8103void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
8019{ 8104{
8105 kvm_lapic_reset(vcpu, init_event);
8106
8020 vcpu->arch.hflags = 0; 8107 vcpu->arch.hflags = 0;
8021 8108
8022 vcpu->arch.smi_pending = 0; 8109 vcpu->arch.smi_pending = 0;
@@ -8460,10 +8547,8 @@ int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size)
8460 return r; 8547 return r;
8461 } 8548 }
8462 8549
8463 if (!size) { 8550 if (!size)
8464 r = vm_munmap(old.userspace_addr, old.npages * PAGE_SIZE); 8551 vm_munmap(old.userspace_addr, old.npages * PAGE_SIZE);
8465 WARN_ON(r < 0);
8466 }
8467 8552
8468 return 0; 8553 return 0;
8469} 8554}
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 91e9700cc6dc..25a972c61b0a 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -28,7 +28,6 @@ lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
28lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o 28lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
29lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o 29lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
30lib-$(CONFIG_RETPOLINE) += retpoline.o 30lib-$(CONFIG_RETPOLINE) += retpoline.o
31OBJECT_FILES_NON_STANDARD_retpoline.o :=y
32 31
33obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o 32obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
34 33
diff --git a/arch/x86/lib/cpu.c b/arch/x86/lib/cpu.c
index d6f848d1211d..2dd1fe13a37b 100644
--- a/arch/x86/lib/cpu.c
+++ b/arch/x86/lib/cpu.c
@@ -18,7 +18,7 @@ unsigned int x86_model(unsigned int sig)
18{ 18{
19 unsigned int fam, model; 19 unsigned int fam, model;
20 20
21 fam = x86_family(sig); 21 fam = x86_family(sig);
22 22
23 model = (sig >> 4) & 0xf; 23 model = (sig >> 4) & 0xf;
24 24
diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c
index 7b881d03d0dd..3cdf06128d13 100644
--- a/arch/x86/lib/error-inject.c
+++ b/arch/x86/lib/error-inject.c
@@ -7,6 +7,7 @@ asmlinkage void just_return_func(void);
7 7
8asm( 8asm(
9 ".type just_return_func, @function\n" 9 ".type just_return_func, @function\n"
10 ".globl just_return_func\n"
10 "just_return_func:\n" 11 "just_return_func:\n"
11 " ret\n" 12 " ret\n"
12 ".size just_return_func, .-just_return_func\n" 13 ".size just_return_func, .-just_return_func\n"
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index 480edc3a5e03..c909961e678a 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -7,7 +7,6 @@
7#include <asm/alternative-asm.h> 7#include <asm/alternative-asm.h>
8#include <asm/export.h> 8#include <asm/export.h>
9#include <asm/nospec-branch.h> 9#include <asm/nospec-branch.h>
10#include <asm/bitsperlong.h>
11 10
12.macro THUNK reg 11.macro THUNK reg
13 .section .text.__x86.indirect_thunk 12 .section .text.__x86.indirect_thunk
@@ -47,58 +46,3 @@ GENERATE_THUNK(r13)
47GENERATE_THUNK(r14) 46GENERATE_THUNK(r14)
48GENERATE_THUNK(r15) 47GENERATE_THUNK(r15)
49#endif 48#endif
50
51/*
52 * Fill the CPU return stack buffer.
53 *
54 * Each entry in the RSB, if used for a speculative 'ret', contains an
55 * infinite 'pause; lfence; jmp' loop to capture speculative execution.
56 *
57 * This is required in various cases for retpoline and IBRS-based
58 * mitigations for the Spectre variant 2 vulnerability. Sometimes to
59 * eliminate potentially bogus entries from the RSB, and sometimes
60 * purely to ensure that it doesn't get empty, which on some CPUs would
61 * allow predictions from other (unwanted!) sources to be used.
62 *
63 * Google experimented with loop-unrolling and this turned out to be
64 * the optimal version - two calls, each with their own speculation
65 * trap should their return address end up getting used, in a loop.
66 */
67.macro STUFF_RSB nr:req sp:req
68 mov $(\nr / 2), %_ASM_BX
69 .align 16
70771:
71 call 772f
72773: /* speculation trap */
73 pause
74 lfence
75 jmp 773b
76 .align 16
77772:
78 call 774f
79775: /* speculation trap */
80 pause
81 lfence
82 jmp 775b
83 .align 16
84774:
85 dec %_ASM_BX
86 jnz 771b
87 add $((BITS_PER_LONG/8) * \nr), \sp
88.endm
89
90#define RSB_FILL_LOOPS 16 /* To avoid underflow */
91
92ENTRY(__fill_rsb)
93 STUFF_RSB RSB_FILL_LOOPS, %_ASM_SP
94 ret
95END(__fill_rsb)
96EXPORT_SYMBOL_GPL(__fill_rsb)
97
98#define RSB_CLEAR_LOOPS 32 /* To forcibly overwrite all entries */
99
100ENTRY(__clear_rsb)
101 STUFF_RSB RSB_CLEAR_LOOPS, %_ASM_SP
102 ret
103END(__clear_rsb)
104EXPORT_SYMBOL_GPL(__clear_rsb)
diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
index b9283cc27622..476d810639a8 100644
--- a/arch/x86/mm/cpu_entry_area.c
+++ b/arch/x86/mm/cpu_entry_area.c
@@ -163,4 +163,10 @@ void __init setup_cpu_entry_areas(void)
163 163
164 for_each_possible_cpu(cpu) 164 for_each_possible_cpu(cpu)
165 setup_cpu_entry_area(cpu); 165 setup_cpu_entry_area(cpu);
166
167 /*
168 * This is the last essential update to swapper_pgdir which needs
169 * to be synchronized to initial_page_table on 32bit.
170 */
171 sync_initial_page_table();
166} 172}
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 800de815519c..c88573d90f3e 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1248,10 +1248,6 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
1248 tsk = current; 1248 tsk = current;
1249 mm = tsk->mm; 1249 mm = tsk->mm;
1250 1250
1251 /*
1252 * Detect and handle instructions that would cause a page fault for
1253 * both a tracked kernel page and a userspace page.
1254 */
1255 prefetchw(&mm->mmap_sem); 1251 prefetchw(&mm->mmap_sem);
1256 1252
1257 if (unlikely(kmmio_fault(regs, address))) 1253 if (unlikely(kmmio_fault(regs, address)))
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 79cb066f40c0..396e1f0151ac 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -453,6 +453,21 @@ static inline void permanent_kmaps_init(pgd_t *pgd_base)
453} 453}
454#endif /* CONFIG_HIGHMEM */ 454#endif /* CONFIG_HIGHMEM */
455 455
456void __init sync_initial_page_table(void)
457{
458 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
459 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
460 KERNEL_PGD_PTRS);
461
462 /*
463 * sync back low identity map too. It is used for example
464 * in the 32-bit EFI stub.
465 */
466 clone_pgd_range(initial_page_table,
467 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
468 min(KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY));
469}
470
456void __init native_pagetable_init(void) 471void __init native_pagetable_init(void)
457{ 472{
458 unsigned long pfn, va; 473 unsigned long pfn, va;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1ab42c852069..8b72923f1d35 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -256,7 +256,7 @@ static void __set_pte_vaddr(pud_t *pud, unsigned long vaddr, pte_t new_pte)
256 * It's enough to flush this one mapping. 256 * It's enough to flush this one mapping.
257 * (PGE mappings get flushed as well) 257 * (PGE mappings get flushed as well)
258 */ 258 */
259 __flush_tlb_one(vaddr); 259 __flush_tlb_one_kernel(vaddr);
260} 260}
261 261
262void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr, pte_t new_pte) 262void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr, pte_t new_pte)
@@ -1193,8 +1193,8 @@ void __init mem_init(void)
1193 register_page_bootmem_info(); 1193 register_page_bootmem_info();
1194 1194
1195 /* Register memory areas for /proc/kcore */ 1195 /* Register memory areas for /proc/kcore */
1196 kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, 1196 if (get_gate_vma(&init_mm))
1197 PAGE_SIZE, KCORE_OTHER); 1197 kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
1198 1198
1199 mem_init_print_info(NULL); 1199 mem_init_print_info(NULL);
1200} 1200}
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index c45b6ec5357b..e2db83bebc3b 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -820,5 +820,5 @@ void __init __early_set_fixmap(enum fixed_addresses idx,
820 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags)); 820 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
821 else 821 else
822 pte_clear(&init_mm, addr, pte); 822 pte_clear(&init_mm, addr, pte);
823 __flush_tlb_one(addr); 823 __flush_tlb_one_kernel(addr);
824} 824}
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index 58477ec3d66d..7c8686709636 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -168,7 +168,7 @@ static int clear_page_presence(struct kmmio_fault_page *f, bool clear)
168 return -1; 168 return -1;
169 } 169 }
170 170
171 __flush_tlb_one(f->addr); 171 __flush_tlb_one_kernel(f->addr);
172 return 0; 172 return 0;
173} 173}
174 174
diff --git a/arch/x86/mm/mem_encrypt_boot.S b/arch/x86/mm/mem_encrypt_boot.S
index 01f682cf77a8..40a6085063d6 100644
--- a/arch/x86/mm/mem_encrypt_boot.S
+++ b/arch/x86/mm/mem_encrypt_boot.S
@@ -15,6 +15,7 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/processor-flags.h> 16#include <asm/processor-flags.h>
17#include <asm/msr-index.h> 17#include <asm/msr-index.h>
18#include <asm/nospec-branch.h>
18 19
19 .text 20 .text
20 .code64 21 .code64
@@ -59,6 +60,7 @@ ENTRY(sme_encrypt_execute)
59 movq %rax, %r8 /* Workarea encryption routine */ 60 movq %rax, %r8 /* Workarea encryption routine */
60 addq $PAGE_SIZE, %r8 /* Workarea intermediate copy buffer */ 61 addq $PAGE_SIZE, %r8 /* Workarea intermediate copy buffer */
61 62
63 ANNOTATE_RETPOLINE_SAFE
62 call *%rax /* Call the encryption routine */ 64 call *%rax /* Call the encryption routine */
63 65
64 pop %r12 66 pop %r12
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index c3c5274410a9..9bb7f0ab9fe6 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -63,7 +63,7 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
63 * It's enough to flush this one mapping. 63 * It's enough to flush this one mapping.
64 * (PGE mappings get flushed as well) 64 * (PGE mappings get flushed as well)
65 */ 65 */
66 __flush_tlb_one(vaddr); 66 __flush_tlb_one_kernel(vaddr);
67} 67}
68 68
69unsigned long __FIXADDR_TOP = 0xfffff000; 69unsigned long __FIXADDR_TOP = 0xfffff000;
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 8dcc0607f805..7f1a51399674 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -498,7 +498,7 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f,
498 * flush that changes context.tlb_gen from 2 to 3. If they get 498 * flush that changes context.tlb_gen from 2 to 3. If they get
499 * processed on this CPU in reverse order, we'll see 499 * processed on this CPU in reverse order, we'll see
500 * local_tlb_gen == 1, mm_tlb_gen == 3, and end != TLB_FLUSH_ALL. 500 * local_tlb_gen == 1, mm_tlb_gen == 3, and end != TLB_FLUSH_ALL.
501 * If we were to use __flush_tlb_single() and set local_tlb_gen to 501 * If we were to use __flush_tlb_one_user() and set local_tlb_gen to
502 * 3, we'd be break the invariant: we'd update local_tlb_gen above 502 * 3, we'd be break the invariant: we'd update local_tlb_gen above
503 * 1 without the full flush that's needed for tlb_gen 2. 503 * 1 without the full flush that's needed for tlb_gen 2.
504 * 504 *
@@ -519,7 +519,7 @@ static void flush_tlb_func_common(const struct flush_tlb_info *f,
519 519
520 addr = f->start; 520 addr = f->start;
521 while (addr < f->end) { 521 while (addr < f->end) {
522 __flush_tlb_single(addr); 522 __flush_tlb_one_user(addr);
523 addr += PAGE_SIZE; 523 addr += PAGE_SIZE;
524 } 524 }
525 if (local) 525 if (local)
@@ -666,7 +666,7 @@ static void do_kernel_range_flush(void *info)
666 666
667 /* flush range by one by one 'invlpg' */ 667 /* flush range by one by one 'invlpg' */
668 for (addr = f->start; addr < f->end; addr += PAGE_SIZE) 668 for (addr = f->start; addr < f->end; addr += PAGE_SIZE)
669 __flush_tlb_one(addr); 669 __flush_tlb_one_kernel(addr);
670} 670}
671 671
672void flush_tlb_kernel_range(unsigned long start, unsigned long end) 672void flush_tlb_kernel_range(unsigned long start, unsigned long end)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 4923d92f918d..45e4eb5bcbb2 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -13,6 +13,7 @@
13#include <linux/if_vlan.h> 13#include <linux/if_vlan.h>
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/set_memory.h> 15#include <asm/set_memory.h>
16#include <asm/nospec-branch.h>
16#include <linux/bpf.h> 17#include <linux/bpf.h>
17 18
18/* 19/*
@@ -290,7 +291,7 @@ static void emit_bpf_tail_call(u8 **pprog)
290 EMIT2(0x89, 0xD2); /* mov edx, edx */ 291 EMIT2(0x89, 0xD2); /* mov edx, edx */
291 EMIT3(0x39, 0x56, /* cmp dword ptr [rsi + 16], edx */ 292 EMIT3(0x39, 0x56, /* cmp dword ptr [rsi + 16], edx */
292 offsetof(struct bpf_array, map.max_entries)); 293 offsetof(struct bpf_array, map.max_entries));
293#define OFFSET1 43 /* number of bytes to jump */ 294#define OFFSET1 (41 + RETPOLINE_RAX_BPF_JIT_SIZE) /* number of bytes to jump */
294 EMIT2(X86_JBE, OFFSET1); /* jbe out */ 295 EMIT2(X86_JBE, OFFSET1); /* jbe out */
295 label1 = cnt; 296 label1 = cnt;
296 297
@@ -299,7 +300,7 @@ static void emit_bpf_tail_call(u8 **pprog)
299 */ 300 */
300 EMIT2_off32(0x8B, 0x85, 36); /* mov eax, dword ptr [rbp + 36] */ 301 EMIT2_off32(0x8B, 0x85, 36); /* mov eax, dword ptr [rbp + 36] */
301 EMIT3(0x83, 0xF8, MAX_TAIL_CALL_CNT); /* cmp eax, MAX_TAIL_CALL_CNT */ 302 EMIT3(0x83, 0xF8, MAX_TAIL_CALL_CNT); /* cmp eax, MAX_TAIL_CALL_CNT */
302#define OFFSET2 32 303#define OFFSET2 (30 + RETPOLINE_RAX_BPF_JIT_SIZE)
303 EMIT2(X86_JA, OFFSET2); /* ja out */ 304 EMIT2(X86_JA, OFFSET2); /* ja out */
304 label2 = cnt; 305 label2 = cnt;
305 EMIT3(0x83, 0xC0, 0x01); /* add eax, 1 */ 306 EMIT3(0x83, 0xC0, 0x01); /* add eax, 1 */
@@ -313,7 +314,7 @@ static void emit_bpf_tail_call(u8 **pprog)
313 * goto out; 314 * goto out;
314 */ 315 */
315 EMIT3(0x48, 0x85, 0xC0); /* test rax,rax */ 316 EMIT3(0x48, 0x85, 0xC0); /* test rax,rax */
316#define OFFSET3 10 317#define OFFSET3 (8 + RETPOLINE_RAX_BPF_JIT_SIZE)
317 EMIT2(X86_JE, OFFSET3); /* je out */ 318 EMIT2(X86_JE, OFFSET3); /* je out */
318 label3 = cnt; 319 label3 = cnt;
319 320
@@ -326,7 +327,7 @@ static void emit_bpf_tail_call(u8 **pprog)
326 * rdi == ctx (1st arg) 327 * rdi == ctx (1st arg)
327 * rax == prog->bpf_func + prologue_size 328 * rax == prog->bpf_func + prologue_size
328 */ 329 */
329 EMIT2(0xFF, 0xE0); /* jmp rax */ 330 RETPOLINE_RAX_BPF_JIT();
330 331
331 /* out: */ 332 /* out: */
332 BUILD_BUG_ON(cnt - label1 != OFFSET1); 333 BUILD_BUG_ON(cnt - label1 != OFFSET1);
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 174c59774cc9..a7a7677265b6 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -460,7 +460,7 @@ static int nmi_setup(void)
460 goto fail; 460 goto fail;
461 461
462 for_each_possible_cpu(cpu) { 462 for_each_possible_cpu(cpu) {
463 if (!cpu) 463 if (!IS_ENABLED(CONFIG_SMP) || !cpu)
464 continue; 464 continue;
465 465
466 memcpy(per_cpu(cpu_msrs, cpu).counters, 466 memcpy(per_cpu(cpu_msrs, cpu).counters,
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 2c67bae6bb53..fb1df9488e98 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -79,7 +79,7 @@ static void intel_mid_power_off(void)
79 79
80static void intel_mid_reboot(void) 80static void intel_mid_reboot(void)
81{ 81{
82 intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); 82 intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
83} 83}
84 84
85static unsigned long __init intel_mid_calibrate_tsc(void) 85static unsigned long __init intel_mid_calibrate_tsc(void)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index c2e9285d1bf1..db77e087adaf 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -299,7 +299,7 @@ static void bau_process_message(struct msg_desc *mdp, struct bau_control *bcp,
299 local_flush_tlb(); 299 local_flush_tlb();
300 stat->d_alltlb++; 300 stat->d_alltlb++;
301 } else { 301 } else {
302 __flush_tlb_single(msg->address); 302 __flush_tlb_one_user(msg->address);
303 stat->d_onetlb++; 303 stat->d_onetlb++;
304 } 304 }
305 stat->d_requestee++; 305 stat->d_requestee++;
diff --git a/arch/x86/realmode/rm/trampoline_64.S b/arch/x86/realmode/rm/trampoline_64.S
index de53bd15df5a..24bb7598774e 100644
--- a/arch/x86/realmode/rm/trampoline_64.S
+++ b/arch/x86/realmode/rm/trampoline_64.S
@@ -102,7 +102,7 @@ ENTRY(startup_32)
102 * don't we'll eventually crash trying to execute encrypted 102 * don't we'll eventually crash trying to execute encrypted
103 * instructions. 103 * instructions.
104 */ 104 */
105 bt $TH_FLAGS_SME_ACTIVE_BIT, pa_tr_flags 105 btl $TH_FLAGS_SME_ACTIVE_BIT, pa_tr_flags
106 jnc .Ldone 106 jnc .Ldone
107 movl $MSR_K8_SYSCFG, %ecx 107 movl $MSR_K8_SYSCFG, %ecx
108 rdmsr 108 rdmsr
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 5d73c443e778..220e97841e49 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -770,9 +770,12 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
770 break; 770 break;
771 771
772 case R_X86_64_PC32: 772 case R_X86_64_PC32:
773 case R_X86_64_PLT32:
773 /* 774 /*
774 * PC relative relocations don't need to be adjusted unless 775 * PC relative relocations don't need to be adjusted unless
775 * referencing a percpu symbol. 776 * referencing a percpu symbol.
777 *
778 * NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32.
776 */ 779 */
777 if (is_percpu_sym(sym, symname)) 780 if (is_percpu_sym(sym, symname))
778 add_reloc(&relocs32neg, offset); 781 add_reloc(&relocs32neg, offset);
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index c047f42552e1..3c2c2530737e 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1376,8 +1376,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
1376 1376
1377 if (!xen_initial_domain()) { 1377 if (!xen_initial_domain()) {
1378 add_preferred_console("xenboot", 0, NULL); 1378 add_preferred_console("xenboot", 0, NULL);
1379 add_preferred_console("tty", 0, NULL);
1380 add_preferred_console("hvc", 0, NULL);
1381 if (pci_xen) 1379 if (pci_xen)
1382 x86_init.pci.arch_init = pci_xen_init; 1380 x86_init.pci.arch_init = pci_xen_init;
1383 } else { 1381 } else {
@@ -1410,6 +1408,10 @@ asmlinkage __visible void __init xen_start_kernel(void)
1410 1408
1411 xen_boot_params_init_edd(); 1409 xen_boot_params_init_edd();
1412 } 1410 }
1411
1412 add_preferred_console("tty", 0, NULL);
1413 add_preferred_console("hvc", 0, NULL);
1414
1413#ifdef CONFIG_PCI 1415#ifdef CONFIG_PCI
1414 /* PCI BIOS service won't work from a PV guest. */ 1416 /* PCI BIOS service won't work from a PV guest. */
1415 pci_probe &= ~PCI_PROBE_BIOS; 1417 pci_probe &= ~PCI_PROBE_BIOS;
diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index d85076223a69..aae88fec9941 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -1300,12 +1300,12 @@ static void xen_flush_tlb(void)
1300 preempt_enable(); 1300 preempt_enable();
1301} 1301}
1302 1302
1303static void xen_flush_tlb_single(unsigned long addr) 1303static void xen_flush_tlb_one_user(unsigned long addr)
1304{ 1304{
1305 struct mmuext_op *op; 1305 struct mmuext_op *op;
1306 struct multicall_space mcs; 1306 struct multicall_space mcs;
1307 1307
1308 trace_xen_mmu_flush_tlb_single(addr); 1308 trace_xen_mmu_flush_tlb_one_user(addr);
1309 1309
1310 preempt_disable(); 1310 preempt_disable();
1311 1311
@@ -2370,7 +2370,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = {
2370 2370
2371 .flush_tlb_user = xen_flush_tlb, 2371 .flush_tlb_user = xen_flush_tlb,
2372 .flush_tlb_kernel = xen_flush_tlb, 2372 .flush_tlb_kernel = xen_flush_tlb,
2373 .flush_tlb_single = xen_flush_tlb_single, 2373 .flush_tlb_one_user = xen_flush_tlb_one_user,
2374 .flush_tlb_others = xen_flush_tlb_others, 2374 .flush_tlb_others = xen_flush_tlb_others,
2375 2375
2376 .pgd_alloc = xen_pgd_alloc, 2376 .pgd_alloc = xen_pgd_alloc,
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 77c959cf81e7..7a43b2ae19f1 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -122,6 +122,8 @@ void __init xen_smp_cpus_done(unsigned int max_cpus)
122 122
123 if (xen_hvm_domain()) 123 if (xen_hvm_domain())
124 native_smp_cpus_done(max_cpus); 124 native_smp_cpus_done(max_cpus);
125 else
126 calculate_max_logical_packages();
125 127
126 if (xen_have_vcpu_info_placement) 128 if (xen_have_vcpu_info_placement)
127 return; 129 return;
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index d9f96cc5d743..1d83152c761b 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -1,12 +1,15 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <linux/types.h> 2#include <linux/types.h>
3#include <linux/tick.h> 3#include <linux/tick.h>
4#include <linux/percpu-defs.h>
4 5
5#include <xen/xen.h> 6#include <xen/xen.h>
6#include <xen/interface/xen.h> 7#include <xen/interface/xen.h>
7#include <xen/grant_table.h> 8#include <xen/grant_table.h>
8#include <xen/events.h> 9#include <xen/events.h>
9 10
11#include <asm/cpufeatures.h>
12#include <asm/msr-index.h>
10#include <asm/xen/hypercall.h> 13#include <asm/xen/hypercall.h>
11#include <asm/xen/page.h> 14#include <asm/xen/page.h>
12#include <asm/fixmap.h> 15#include <asm/fixmap.h>
@@ -15,6 +18,8 @@
15#include "mmu.h" 18#include "mmu.h"
16#include "pmu.h" 19#include "pmu.h"
17 20
21static DEFINE_PER_CPU(u64, spec_ctrl);
22
18void xen_arch_pre_suspend(void) 23void xen_arch_pre_suspend(void)
19{ 24{
20 xen_save_time_memory_area(); 25 xen_save_time_memory_area();
@@ -35,6 +40,9 @@ void xen_arch_post_suspend(int cancelled)
35 40
36static void xen_vcpu_notify_restore(void *data) 41static void xen_vcpu_notify_restore(void *data)
37{ 42{
43 if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL))
44 wrmsrl(MSR_IA32_SPEC_CTRL, this_cpu_read(spec_ctrl));
45
38 /* Boot processor notified via generic timekeeping_resume() */ 46 /* Boot processor notified via generic timekeeping_resume() */
39 if (smp_processor_id() == 0) 47 if (smp_processor_id() == 0)
40 return; 48 return;
@@ -44,7 +52,15 @@ static void xen_vcpu_notify_restore(void *data)
44 52
45static void xen_vcpu_notify_suspend(void *data) 53static void xen_vcpu_notify_suspend(void *data)
46{ 54{
55 u64 tmp;
56
47 tick_suspend_local(); 57 tick_suspend_local();
58
59 if (xen_pv_domain() && boot_cpu_has(X86_FEATURE_SPEC_CTRL)) {
60 rdmsrl(MSR_IA32_SPEC_CTRL, tmp);
61 this_cpu_write(spec_ctrl, tmp);
62 wrmsrl(MSR_IA32_SPEC_CTRL, 0);
63 }
48} 64}
49 65
50void xen_arch_resume(void) 66void xen_arch_resume(void)
diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index 623720a11143..732631ce250f 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include <linux/dma-contiguous.h> 18#include <linux/dma-contiguous.h>
19#include <linux/dma-direct.h>
19#include <linux/gfp.h> 20#include <linux/gfp.h>
20#include <linux/highmem.h> 21#include <linux/highmem.h>
21#include <linux/mm.h> 22#include <linux/mm.h>
@@ -123,7 +124,7 @@ static void *xtensa_dma_alloc(struct device *dev, size_t size,
123 unsigned long attrs) 124 unsigned long attrs)
124{ 125{
125 unsigned long ret; 126 unsigned long ret;
126 unsigned long uncached = 0; 127 unsigned long uncached;
127 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; 128 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
128 struct page *page = NULL; 129 struct page *page = NULL;
129 130
@@ -144,15 +145,27 @@ static void *xtensa_dma_alloc(struct device *dev, size_t size,
144 if (!page) 145 if (!page)
145 return NULL; 146 return NULL;
146 147
147 ret = (unsigned long)page_address(page); 148 *handle = phys_to_dma(dev, page_to_phys(page));
148 149
149 /* We currently don't support coherent memory outside KSEG */ 150#ifdef CONFIG_MMU
151 if (PageHighMem(page)) {
152 void *p;
150 153
154 p = dma_common_contiguous_remap(page, size, VM_MAP,
155 pgprot_noncached(PAGE_KERNEL),
156 __builtin_return_address(0));
157 if (!p) {
158 if (!dma_release_from_contiguous(dev, page, count))
159 __free_pages(page, get_order(size));
160 }
161 return p;
162 }
163#endif
164 ret = (unsigned long)page_address(page);
151 BUG_ON(ret < XCHAL_KSEG_CACHED_VADDR || 165 BUG_ON(ret < XCHAL_KSEG_CACHED_VADDR ||
152 ret > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1); 166 ret > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1);
153 167
154 uncached = ret + XCHAL_KSEG_BYPASS_VADDR - XCHAL_KSEG_CACHED_VADDR; 168 uncached = ret + XCHAL_KSEG_BYPASS_VADDR - XCHAL_KSEG_CACHED_VADDR;
155 *handle = virt_to_bus((void *)ret);
156 __invalidate_dcache_range(ret, size); 169 __invalidate_dcache_range(ret, size);
157 170
158 return (void *)uncached; 171 return (void *)uncached;
@@ -161,13 +174,20 @@ static void *xtensa_dma_alloc(struct device *dev, size_t size,
161static void xtensa_dma_free(struct device *dev, size_t size, void *vaddr, 174static void xtensa_dma_free(struct device *dev, size_t size, void *vaddr,
162 dma_addr_t dma_handle, unsigned long attrs) 175 dma_addr_t dma_handle, unsigned long attrs)
163{ 176{
164 unsigned long addr = (unsigned long)vaddr +
165 XCHAL_KSEG_CACHED_VADDR - XCHAL_KSEG_BYPASS_VADDR;
166 struct page *page = virt_to_page(addr);
167 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; 177 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
168 178 unsigned long addr = (unsigned long)vaddr;
169 BUG_ON(addr < XCHAL_KSEG_CACHED_VADDR || 179 struct page *page;
170 addr > XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE - 1); 180
181 if (addr >= XCHAL_KSEG_BYPASS_VADDR &&
182 addr - XCHAL_KSEG_BYPASS_VADDR < XCHAL_KSEG_SIZE) {
183 addr += XCHAL_KSEG_CACHED_VADDR - XCHAL_KSEG_BYPASS_VADDR;
184 page = virt_to_page(addr);
185 } else {
186#ifdef CONFIG_MMU
187 dma_common_free_remap(vaddr, size, VM_MAP);
188#endif
189 page = pfn_to_page(PHYS_PFN(dma_to_phys(dev, dma_handle)));
190 }
171 191
172 if (!dma_release_from_contiguous(dev, page, count)) 192 if (!dma_release_from_contiguous(dev, page, count))
173 __free_pages(page, get_order(size)); 193 __free_pages(page, get_order(size));
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index d776ec0d7b22..34aead7dcb48 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -79,19 +79,75 @@ void __init zones_init(void)
79 free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL); 79 free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL);
80} 80}
81 81
82#ifdef CONFIG_HIGHMEM
83static void __init free_area_high(unsigned long pfn, unsigned long end)
84{
85 for (; pfn < end; pfn++)
86 free_highmem_page(pfn_to_page(pfn));
87}
88
89static void __init free_highpages(void)
90{
91 unsigned long max_low = max_low_pfn;
92 struct memblock_region *mem, *res;
93
94 reset_all_zones_managed_pages();
95 /* set highmem page free */
96 for_each_memblock(memory, mem) {
97 unsigned long start = memblock_region_memory_base_pfn(mem);
98 unsigned long end = memblock_region_memory_end_pfn(mem);
99
100 /* Ignore complete lowmem entries */
101 if (end <= max_low)
102 continue;
103
104 if (memblock_is_nomap(mem))
105 continue;
106
107 /* Truncate partial highmem entries */
108 if (start < max_low)
109 start = max_low;
110
111 /* Find and exclude any reserved regions */
112 for_each_memblock(reserved, res) {
113 unsigned long res_start, res_end;
114
115 res_start = memblock_region_reserved_base_pfn(res);
116 res_end = memblock_region_reserved_end_pfn(res);
117
118 if (res_end < start)
119 continue;
120 if (res_start < start)
121 res_start = start;
122 if (res_start > end)
123 res_start = end;
124 if (res_end > end)
125 res_end = end;
126 if (res_start != start)
127 free_area_high(start, res_start);
128 start = res_end;
129 if (start == end)
130 break;
131 }
132
133 /* And now free anything which remains */
134 if (start < end)
135 free_area_high(start, end);
136 }
137}
138#else
139static void __init free_highpages(void)
140{
141}
142#endif
143
82/* 144/*
83 * Initialize memory pages. 145 * Initialize memory pages.
84 */ 146 */
85 147
86void __init mem_init(void) 148void __init mem_init(void)
87{ 149{
88#ifdef CONFIG_HIGHMEM 150 free_highpages();
89 unsigned long tmp;
90
91 reset_all_zones_managed_pages();
92 for (tmp = max_low_pfn; tmp < max_pfn; tmp++)
93 free_highmem_page(pfn_to_page(tmp));
94#endif
95 151
96 max_mapnr = max_pfn - ARCH_PFN_OFFSET; 152 max_mapnr = max_pfn - ARCH_PFN_OFFSET;
97 high_memory = (void *)__va(max_low_pfn << PAGE_SHIFT); 153 high_memory = (void *)__va(max_low_pfn << PAGE_SHIFT);
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 4117524ca45b..c2033a232a44 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -812,7 +812,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
812 struct gendisk *disk; 812 struct gendisk *disk;
813 struct request_queue *q; 813 struct request_queue *q;
814 struct blkcg_gq *blkg; 814 struct blkcg_gq *blkg;
815 struct module *owner;
816 unsigned int major, minor; 815 unsigned int major, minor;
817 int key_len, part, ret; 816 int key_len, part, ret;
818 char *body; 817 char *body;
@@ -904,9 +903,7 @@ fail_unlock:
904 spin_unlock_irq(q->queue_lock); 903 spin_unlock_irq(q->queue_lock);
905 rcu_read_unlock(); 904 rcu_read_unlock();
906fail: 905fail:
907 owner = disk->fops->owner; 906 put_disk_and_module(disk);
908 put_disk(disk);
909 module_put(owner);
910 /* 907 /*
911 * If queue was bypassing, we should retry. Do so after a 908 * If queue was bypassing, we should retry. Do so after a
912 * short msleep(). It isn't strictly necessary but queue 909 * short msleep(). It isn't strictly necessary but queue
@@ -931,13 +928,9 @@ EXPORT_SYMBOL_GPL(blkg_conf_prep);
931void blkg_conf_finish(struct blkg_conf_ctx *ctx) 928void blkg_conf_finish(struct blkg_conf_ctx *ctx)
932 __releases(ctx->disk->queue->queue_lock) __releases(rcu) 929 __releases(ctx->disk->queue->queue_lock) __releases(rcu)
933{ 930{
934 struct module *owner;
935
936 spin_unlock_irq(ctx->disk->queue->queue_lock); 931 spin_unlock_irq(ctx->disk->queue->queue_lock);
937 rcu_read_unlock(); 932 rcu_read_unlock();
938 owner = ctx->disk->fops->owner; 933 put_disk_and_module(ctx->disk);
939 put_disk(ctx->disk);
940 module_put(owner);
941} 934}
942EXPORT_SYMBOL_GPL(blkg_conf_finish); 935EXPORT_SYMBOL_GPL(blkg_conf_finish);
943 936
diff --git a/block/blk-core.c b/block/blk-core.c
index 2d1a7bbe0634..6d82c4f7fadd 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2434,7 +2434,7 @@ blk_qc_t submit_bio(struct bio *bio)
2434 unsigned int count; 2434 unsigned int count;
2435 2435
2436 if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME)) 2436 if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME))
2437 count = queue_logical_block_size(bio->bi_disk->queue); 2437 count = queue_logical_block_size(bio->bi_disk->queue) >> 9;
2438 else 2438 else
2439 count = bio_sectors(bio); 2439 count = bio_sectors(bio);
2440 2440
diff --git a/block/blk-mq.c b/block/blk-mq.c
index df93102e2149..16e83e6df404 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -712,7 +712,6 @@ static void __blk_mq_requeue_request(struct request *rq)
712 712
713 trace_block_rq_requeue(q, rq); 713 trace_block_rq_requeue(q, rq);
714 wbt_requeue(q->rq_wb, &rq->issue_stat); 714 wbt_requeue(q->rq_wb, &rq->issue_stat);
715 blk_mq_sched_requeue_request(rq);
716 715
717 if (blk_mq_rq_state(rq) != MQ_RQ_IDLE) { 716 if (blk_mq_rq_state(rq) != MQ_RQ_IDLE) {
718 blk_mq_rq_update_state(rq, MQ_RQ_IDLE); 717 blk_mq_rq_update_state(rq, MQ_RQ_IDLE);
@@ -725,6 +724,9 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list)
725{ 724{
726 __blk_mq_requeue_request(rq); 725 __blk_mq_requeue_request(rq);
727 726
727 /* this request will be re-inserted to io scheduler queue */
728 blk_mq_sched_requeue_request(rq);
729
728 BUG_ON(blk_queued_rq(rq)); 730 BUG_ON(blk_queued_rq(rq));
729 blk_mq_add_to_requeue_list(rq, true, kick_requeue_list); 731 blk_mq_add_to_requeue_list(rq, true, kick_requeue_list);
730} 732}
@@ -3164,6 +3166,7 @@ static bool __blk_mq_poll(struct blk_mq_hw_ctx *hctx, struct request *rq)
3164 cpu_relax(); 3166 cpu_relax();
3165 } 3167 }
3166 3168
3169 __set_current_state(TASK_RUNNING);
3167 return false; 3170 return false;
3168} 3171}
3169 3172
diff --git a/block/genhd.c b/block/genhd.c
index 88a53c188cb7..9656f9e9f99e 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -547,7 +547,7 @@ static int exact_lock(dev_t devt, void *data)
547{ 547{
548 struct gendisk *p = data; 548 struct gendisk *p = data;
549 549
550 if (!get_disk(p)) 550 if (!get_disk_and_module(p))
551 return -1; 551 return -1;
552 return 0; 552 return 0;
553} 553}
@@ -717,6 +717,11 @@ void del_gendisk(struct gendisk *disk)
717 blk_integrity_del(disk); 717 blk_integrity_del(disk);
718 disk_del_events(disk); 718 disk_del_events(disk);
719 719
720 /*
721 * Block lookups of the disk until all bdevs are unhashed and the
722 * disk is marked as dead (GENHD_FL_UP cleared).
723 */
724 down_write(&disk->lookup_sem);
720 /* invalidate stuff */ 725 /* invalidate stuff */
721 disk_part_iter_init(&piter, disk, 726 disk_part_iter_init(&piter, disk,
722 DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE); 727 DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE);
@@ -731,6 +736,7 @@ void del_gendisk(struct gendisk *disk)
731 bdev_unhash_inode(disk_devt(disk)); 736 bdev_unhash_inode(disk_devt(disk));
732 set_capacity(disk, 0); 737 set_capacity(disk, 0);
733 disk->flags &= ~GENHD_FL_UP; 738 disk->flags &= ~GENHD_FL_UP;
739 up_write(&disk->lookup_sem);
734 740
735 if (!(disk->flags & GENHD_FL_HIDDEN)) 741 if (!(disk->flags & GENHD_FL_HIDDEN))
736 sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi"); 742 sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi");
@@ -809,16 +815,28 @@ struct gendisk *get_gendisk(dev_t devt, int *partno)
809 815
810 spin_lock_bh(&ext_devt_lock); 816 spin_lock_bh(&ext_devt_lock);
811 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt))); 817 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
812 if (part && get_disk(part_to_disk(part))) { 818 if (part && get_disk_and_module(part_to_disk(part))) {
813 *partno = part->partno; 819 *partno = part->partno;
814 disk = part_to_disk(part); 820 disk = part_to_disk(part);
815 } 821 }
816 spin_unlock_bh(&ext_devt_lock); 822 spin_unlock_bh(&ext_devt_lock);
817 } 823 }
818 824
819 if (disk && unlikely(disk->flags & GENHD_FL_HIDDEN)) { 825 if (!disk)
820 put_disk(disk); 826 return NULL;
827
828 /*
829 * Synchronize with del_gendisk() to not return disk that is being
830 * destroyed.
831 */
832 down_read(&disk->lookup_sem);
833 if (unlikely((disk->flags & GENHD_FL_HIDDEN) ||
834 !(disk->flags & GENHD_FL_UP))) {
835 up_read(&disk->lookup_sem);
836 put_disk_and_module(disk);
821 disk = NULL; 837 disk = NULL;
838 } else {
839 up_read(&disk->lookup_sem);
822 } 840 }
823 return disk; 841 return disk;
824} 842}
@@ -1418,6 +1436,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id)
1418 kfree(disk); 1436 kfree(disk);
1419 return NULL; 1437 return NULL;
1420 } 1438 }
1439 init_rwsem(&disk->lookup_sem);
1421 disk->node_id = node_id; 1440 disk->node_id = node_id;
1422 if (disk_expand_part_tbl(disk, 0)) { 1441 if (disk_expand_part_tbl(disk, 0)) {
1423 free_part_stats(&disk->part0); 1442 free_part_stats(&disk->part0);
@@ -1453,7 +1472,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id)
1453} 1472}
1454EXPORT_SYMBOL(__alloc_disk_node); 1473EXPORT_SYMBOL(__alloc_disk_node);
1455 1474
1456struct kobject *get_disk(struct gendisk *disk) 1475struct kobject *get_disk_and_module(struct gendisk *disk)
1457{ 1476{
1458 struct module *owner; 1477 struct module *owner;
1459 struct kobject *kobj; 1478 struct kobject *kobj;
@@ -1471,17 +1490,30 @@ struct kobject *get_disk(struct gendisk *disk)
1471 return kobj; 1490 return kobj;
1472 1491
1473} 1492}
1474 1493EXPORT_SYMBOL(get_disk_and_module);
1475EXPORT_SYMBOL(get_disk);
1476 1494
1477void put_disk(struct gendisk *disk) 1495void put_disk(struct gendisk *disk)
1478{ 1496{
1479 if (disk) 1497 if (disk)
1480 kobject_put(&disk_to_dev(disk)->kobj); 1498 kobject_put(&disk_to_dev(disk)->kobj);
1481} 1499}
1482
1483EXPORT_SYMBOL(put_disk); 1500EXPORT_SYMBOL(put_disk);
1484 1501
1502/*
1503 * This is a counterpart of get_disk_and_module() and thus also of
1504 * get_gendisk().
1505 */
1506void put_disk_and_module(struct gendisk *disk)
1507{
1508 if (disk) {
1509 struct module *owner = disk->fops->owner;
1510
1511 put_disk(disk);
1512 module_put(owner);
1513 }
1514}
1515EXPORT_SYMBOL(put_disk_and_module);
1516
1485static void set_disk_ro_uevent(struct gendisk *gd, int ro) 1517static void set_disk_ro_uevent(struct gendisk *gd, int ro)
1486{ 1518{
1487 char event[] = "DISK_RO=1"; 1519 char event[] = "DISK_RO=1";
diff --git a/block/ioctl.c b/block/ioctl.c
index 1668506d8ed8..3884d810efd2 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -225,7 +225,7 @@ static int blk_ioctl_discard(struct block_device *bdev, fmode_t mode,
225 225
226 if (start + len > i_size_read(bdev->bd_inode)) 226 if (start + len > i_size_read(bdev->bd_inode))
227 return -EINVAL; 227 return -EINVAL;
228 truncate_inode_pages_range(mapping, start, start + len); 228 truncate_inode_pages_range(mapping, start, start + len - 1);
229 return blkdev_issue_discard(bdev, start >> 9, len >> 9, 229 return blkdev_issue_discard(bdev, start >> 9, len >> 9,
230 GFP_KERNEL, flags); 230 GFP_KERNEL, flags);
231} 231}
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index f95c60774ce8..0d6d25e32e1f 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -833,6 +833,7 @@ static struct elevator_type kyber_sched = {
833 .limit_depth = kyber_limit_depth, 833 .limit_depth = kyber_limit_depth,
834 .prepare_request = kyber_prepare_request, 834 .prepare_request = kyber_prepare_request,
835 .finish_request = kyber_finish_request, 835 .finish_request = kyber_finish_request,
836 .requeue_request = kyber_finish_request,
836 .completed_request = kyber_completed_request, 837 .completed_request = kyber_completed_request,
837 .dispatch_request = kyber_dispatch_request, 838 .dispatch_request = kyber_dispatch_request,
838 .has_work = kyber_has_work, 839 .has_work = kyber_has_work,
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index c56f211c8440..8ec0ba9f5386 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -536,12 +536,21 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
536} 536}
537 537
538/* 538/*
539 * Nothing to do here. This is defined only to ensure that .finish_request
540 * method is called upon request completion.
541 */
542static void dd_prepare_request(struct request *rq, struct bio *bio)
543{
544}
545
546/*
539 * For zoned block devices, write unlock the target zone of 547 * For zoned block devices, write unlock the target zone of
540 * completed write requests. Do this while holding the zone lock 548 * completed write requests. Do this while holding the zone lock
541 * spinlock so that the zone is never unlocked while deadline_fifo_request() 549 * spinlock so that the zone is never unlocked while deadline_fifo_request()
542 * while deadline_next_request() are executing. 550 * or deadline_next_request() are executing. This function is called for
551 * all requests, whether or not these requests complete successfully.
543 */ 552 */
544static void dd_completed_request(struct request *rq) 553static void dd_finish_request(struct request *rq)
545{ 554{
546 struct request_queue *q = rq->q; 555 struct request_queue *q = rq->q;
547 556
@@ -756,7 +765,8 @@ static struct elevator_type mq_deadline = {
756 .ops.mq = { 765 .ops.mq = {
757 .insert_requests = dd_insert_requests, 766 .insert_requests = dd_insert_requests,
758 .dispatch_request = dd_dispatch_request, 767 .dispatch_request = dd_dispatch_request,
759 .completed_request = dd_completed_request, 768 .prepare_request = dd_prepare_request,
769 .finish_request = dd_finish_request,
760 .next_request = elv_rb_latter_request, 770 .next_request = elv_rb_latter_request,
761 .former_request = elv_rb_former_request, 771 .former_request = elv_rb_former_request,
762 .bio_merge = dd_bio_merge, 772 .bio_merge = dd_bio_merge,
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 91622db9aedf..08dabcd8b6ae 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -51,6 +51,12 @@ const char *bdevname(struct block_device *bdev, char *buf)
51 51
52EXPORT_SYMBOL(bdevname); 52EXPORT_SYMBOL(bdevname);
53 53
54const char *bio_devname(struct bio *bio, char *buf)
55{
56 return disk_name(bio->bi_disk, bio->bi_partno, buf);
57}
58EXPORT_SYMBOL(bio_devname);
59
54/* 60/*
55 * There's very little reason to use this, you should really 61 * There's very little reason to use this, you should really
56 * have a struct block_device just about everywhere and use 62 * have a struct block_device just about everywhere and use
diff --git a/block/sed-opal.c b/block/sed-opal.c
index 9ed51d0c6b1d..e4929eec547f 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -490,7 +490,7 @@ static int opal_discovery0_end(struct opal_dev *dev)
490 490
491 if (!found_com_id) { 491 if (!found_com_id) {
492 pr_debug("Could not find OPAL comid for device. Returning early\n"); 492 pr_debug("Could not find OPAL comid for device. Returning early\n");
493 return -EOPNOTSUPP;; 493 return -EOPNOTSUPP;
494 } 494 }
495 495
496 dev->comid = comid; 496 dev->comid = comid;
diff --git a/certs/blacklist_nohashes.c b/certs/blacklist_nohashes.c
index 73fd99098ad7..753b703ef0ef 100644
--- a/certs/blacklist_nohashes.c
+++ b/certs/blacklist_nohashes.c
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include "blacklist.h" 2#include "blacklist.h"
3 3
4const char __initdata *const blacklist_hashes[] = { 4const char __initconst *const blacklist_hashes[] = {
5 NULL 5 NULL
6}; 6};
diff --git a/crypto/asymmetric_keys/pkcs7_trust.c b/crypto/asymmetric_keys/pkcs7_trust.c
index 1f4e25f10049..598906b1e28d 100644
--- a/crypto/asymmetric_keys/pkcs7_trust.c
+++ b/crypto/asymmetric_keys/pkcs7_trust.c
@@ -106,6 +106,7 @@ static int pkcs7_validate_trust_one(struct pkcs7_message *pkcs7,
106 pr_devel("sinfo %u: Direct signer is key %x\n", 106 pr_devel("sinfo %u: Direct signer is key %x\n",
107 sinfo->index, key_serial(key)); 107 sinfo->index, key_serial(key));
108 x509 = NULL; 108 x509 = NULL;
109 sig = sinfo->sig;
109 goto matched; 110 goto matched;
110 } 111 }
111 if (PTR_ERR(key) != -ENOKEY) 112 if (PTR_ERR(key) != -ENOKEY)
diff --git a/crypto/asymmetric_keys/pkcs7_verify.c b/crypto/asymmetric_keys/pkcs7_verify.c
index 39e6de0c2761..97c77f66b20d 100644
--- a/crypto/asymmetric_keys/pkcs7_verify.c
+++ b/crypto/asymmetric_keys/pkcs7_verify.c
@@ -270,7 +270,7 @@ static int pkcs7_verify_sig_chain(struct pkcs7_message *pkcs7,
270 sinfo->index); 270 sinfo->index);
271 return 0; 271 return 0;
272 } 272 }
273 ret = public_key_verify_signature(p->pub, p->sig); 273 ret = public_key_verify_signature(p->pub, x509->sig);
274 if (ret < 0) 274 if (ret < 0)
275 return ret; 275 return ret;
276 x509->signer = p; 276 x509->signer = p;
@@ -366,8 +366,7 @@ static int pkcs7_verify_one(struct pkcs7_message *pkcs7,
366 * 366 *
367 * (*) -EBADMSG if some part of the message was invalid, or: 367 * (*) -EBADMSG if some part of the message was invalid, or:
368 * 368 *
369 * (*) 0 if no signature chains were found to be blacklisted or to contain 369 * (*) 0 if a signature chain passed verification, or:
370 * unsupported crypto, or:
371 * 370 *
372 * (*) -EKEYREJECTED if a blacklisted key was encountered, or: 371 * (*) -EKEYREJECTED if a blacklisted key was encountered, or:
373 * 372 *
@@ -423,8 +422,11 @@ int pkcs7_verify(struct pkcs7_message *pkcs7,
423 422
424 for (sinfo = pkcs7->signed_infos; sinfo; sinfo = sinfo->next) { 423 for (sinfo = pkcs7->signed_infos; sinfo; sinfo = sinfo->next) {
425 ret = pkcs7_verify_one(pkcs7, sinfo); 424 ret = pkcs7_verify_one(pkcs7, sinfo);
426 if (sinfo->blacklisted && actual_ret == -ENOPKG) 425 if (sinfo->blacklisted) {
427 actual_ret = -EKEYREJECTED; 426 if (actual_ret == -ENOPKG)
427 actual_ret = -EKEYREJECTED;
428 continue;
429 }
428 if (ret < 0) { 430 if (ret < 0) {
429 if (ret == -ENOPKG) { 431 if (ret == -ENOPKG) {
430 sinfo->unsupported_crypto = true; 432 sinfo->unsupported_crypto = true;
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
index de996586762a..e929fe1e4106 100644
--- a/crypto/asymmetric_keys/public_key.c
+++ b/crypto/asymmetric_keys/public_key.c
@@ -79,9 +79,11 @@ int public_key_verify_signature(const struct public_key *pkey,
79 79
80 BUG_ON(!pkey); 80 BUG_ON(!pkey);
81 BUG_ON(!sig); 81 BUG_ON(!sig);
82 BUG_ON(!sig->digest);
83 BUG_ON(!sig->s); 82 BUG_ON(!sig->s);
84 83
84 if (!sig->digest)
85 return -ENOPKG;
86
85 alg_name = sig->pkey_algo; 87 alg_name = sig->pkey_algo;
86 if (strcmp(sig->pkey_algo, "rsa") == 0) { 88 if (strcmp(sig->pkey_algo, "rsa") == 0) {
87 /* The data wangled by the RSA algorithm is typically padded 89 /* The data wangled by the RSA algorithm is typically padded
diff --git a/crypto/asymmetric_keys/restrict.c b/crypto/asymmetric_keys/restrict.c
index 86fb68508952..7c93c7728454 100644
--- a/crypto/asymmetric_keys/restrict.c
+++ b/crypto/asymmetric_keys/restrict.c
@@ -67,8 +67,9 @@ __setup("ca_keys=", ca_keys_setup);
67 * 67 *
68 * Returns 0 if the new certificate was accepted, -ENOKEY if we couldn't find a 68 * Returns 0 if the new certificate was accepted, -ENOKEY if we couldn't find a
69 * matching parent certificate in the trusted list, -EKEYREJECTED if the 69 * matching parent certificate in the trusted list, -EKEYREJECTED if the
70 * signature check fails or the key is blacklisted and some other error if 70 * signature check fails or the key is blacklisted, -ENOPKG if the signature
71 * there is a matching certificate but the signature check cannot be performed. 71 * uses unsupported crypto, or some other error if there is a matching
72 * certificate but the signature check cannot be performed.
72 */ 73 */
73int restrict_link_by_signature(struct key *dest_keyring, 74int restrict_link_by_signature(struct key *dest_keyring,
74 const struct key_type *type, 75 const struct key_type *type,
@@ -88,6 +89,8 @@ int restrict_link_by_signature(struct key *dest_keyring,
88 return -EOPNOTSUPP; 89 return -EOPNOTSUPP;
89 90
90 sig = payload->data[asym_auth]; 91 sig = payload->data[asym_auth];
92 if (!sig)
93 return -ENOPKG;
91 if (!sig->auth_ids[0] && !sig->auth_ids[1]) 94 if (!sig->auth_ids[0] && !sig->auth_ids[1])
92 return -ENOKEY; 95 return -ENOKEY;
93 96
@@ -139,6 +142,8 @@ static int key_or_keyring_common(struct key *dest_keyring,
139 return -EOPNOTSUPP; 142 return -EOPNOTSUPP;
140 143
141 sig = payload->data[asym_auth]; 144 sig = payload->data[asym_auth];
145 if (!sig)
146 return -ENOPKG;
142 if (!sig->auth_ids[0] && !sig->auth_ids[1]) 147 if (!sig->auth_ids[0] && !sig->auth_ids[1])
143 return -ENOKEY; 148 return -ENOKEY;
144 149
@@ -222,9 +227,9 @@ static int key_or_keyring_common(struct key *dest_keyring,
222 * 227 *
223 * Returns 0 if the new certificate was accepted, -ENOKEY if we 228 * Returns 0 if the new certificate was accepted, -ENOKEY if we
224 * couldn't find a matching parent certificate in the trusted list, 229 * couldn't find a matching parent certificate in the trusted list,
225 * -EKEYREJECTED if the signature check fails, and some other error if 230 * -EKEYREJECTED if the signature check fails, -ENOPKG if the signature uses
226 * there is a matching certificate but the signature check cannot be 231 * unsupported crypto, or some other error if there is a matching certificate
227 * performed. 232 * but the signature check cannot be performed.
228 */ 233 */
229int restrict_link_by_key_or_keyring(struct key *dest_keyring, 234int restrict_link_by_key_or_keyring(struct key *dest_keyring,
230 const struct key_type *type, 235 const struct key_type *type,
@@ -249,9 +254,9 @@ int restrict_link_by_key_or_keyring(struct key *dest_keyring,
249 * 254 *
250 * Returns 0 if the new certificate was accepted, -ENOKEY if we 255 * Returns 0 if the new certificate was accepted, -ENOKEY if we
251 * couldn't find a matching parent certificate in the trusted list, 256 * couldn't find a matching parent certificate in the trusted list,
252 * -EKEYREJECTED if the signature check fails, and some other error if 257 * -EKEYREJECTED if the signature check fails, -ENOPKG if the signature uses
253 * there is a matching certificate but the signature check cannot be 258 * unsupported crypto, or some other error if there is a matching certificate
254 * performed. 259 * but the signature check cannot be performed.
255 */ 260 */
256int restrict_link_by_key_or_keyring_chain(struct key *dest_keyring, 261int restrict_link_by_key_or_keyring_chain(struct key *dest_keyring,
257 const struct key_type *type, 262 const struct key_type *type,
diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c
index a965b9d80559..ded148783303 100644
--- a/crypto/sha3_generic.c
+++ b/crypto/sha3_generic.c
@@ -20,6 +20,20 @@
20#include <crypto/sha3.h> 20#include <crypto/sha3.h>
21#include <asm/unaligned.h> 21#include <asm/unaligned.h>
22 22
23/*
24 * On some 32-bit architectures (mn10300 and h8300), GCC ends up using
25 * over 1 KB of stack if we inline the round calculation into the loop
26 * in keccakf(). On the other hand, on 64-bit architectures with plenty
27 * of [64-bit wide] general purpose registers, not inlining it severely
28 * hurts performance. So let's use 64-bitness as a heuristic to decide
29 * whether to inline or not.
30 */
31#ifdef CONFIG_64BIT
32#define SHA3_INLINE inline
33#else
34#define SHA3_INLINE noinline
35#endif
36
23#define KECCAK_ROUNDS 24 37#define KECCAK_ROUNDS 24
24 38
25static const u64 keccakf_rndc[24] = { 39static const u64 keccakf_rndc[24] = {
@@ -35,111 +49,115 @@ static const u64 keccakf_rndc[24] = {
35 49
36/* update the state with given number of rounds */ 50/* update the state with given number of rounds */
37 51
38static void __attribute__((__optimize__("O3"))) keccakf(u64 st[25]) 52static SHA3_INLINE void keccakf_round(u64 st[25])
39{ 53{
40 u64 t[5], tt, bc[5]; 54 u64 t[5], tt, bc[5];
41 int round;
42 55
43 for (round = 0; round < KECCAK_ROUNDS; round++) { 56 /* Theta */
57 bc[0] = st[0] ^ st[5] ^ st[10] ^ st[15] ^ st[20];
58 bc[1] = st[1] ^ st[6] ^ st[11] ^ st[16] ^ st[21];
59 bc[2] = st[2] ^ st[7] ^ st[12] ^ st[17] ^ st[22];
60 bc[3] = st[3] ^ st[8] ^ st[13] ^ st[18] ^ st[23];
61 bc[4] = st[4] ^ st[9] ^ st[14] ^ st[19] ^ st[24];
62
63 t[0] = bc[4] ^ rol64(bc[1], 1);
64 t[1] = bc[0] ^ rol64(bc[2], 1);
65 t[2] = bc[1] ^ rol64(bc[3], 1);
66 t[3] = bc[2] ^ rol64(bc[4], 1);
67 t[4] = bc[3] ^ rol64(bc[0], 1);
68
69 st[0] ^= t[0];
70
71 /* Rho Pi */
72 tt = st[1];
73 st[ 1] = rol64(st[ 6] ^ t[1], 44);
74 st[ 6] = rol64(st[ 9] ^ t[4], 20);
75 st[ 9] = rol64(st[22] ^ t[2], 61);
76 st[22] = rol64(st[14] ^ t[4], 39);
77 st[14] = rol64(st[20] ^ t[0], 18);
78 st[20] = rol64(st[ 2] ^ t[2], 62);
79 st[ 2] = rol64(st[12] ^ t[2], 43);
80 st[12] = rol64(st[13] ^ t[3], 25);
81 st[13] = rol64(st[19] ^ t[4], 8);
82 st[19] = rol64(st[23] ^ t[3], 56);
83 st[23] = rol64(st[15] ^ t[0], 41);
84 st[15] = rol64(st[ 4] ^ t[4], 27);
85 st[ 4] = rol64(st[24] ^ t[4], 14);
86 st[24] = rol64(st[21] ^ t[1], 2);
87 st[21] = rol64(st[ 8] ^ t[3], 55);
88 st[ 8] = rol64(st[16] ^ t[1], 45);
89 st[16] = rol64(st[ 5] ^ t[0], 36);
90 st[ 5] = rol64(st[ 3] ^ t[3], 28);
91 st[ 3] = rol64(st[18] ^ t[3], 21);
92 st[18] = rol64(st[17] ^ t[2], 15);
93 st[17] = rol64(st[11] ^ t[1], 10);
94 st[11] = rol64(st[ 7] ^ t[2], 6);
95 st[ 7] = rol64(st[10] ^ t[0], 3);
96 st[10] = rol64( tt ^ t[1], 1);
97
98 /* Chi */
99 bc[ 0] = ~st[ 1] & st[ 2];
100 bc[ 1] = ~st[ 2] & st[ 3];
101 bc[ 2] = ~st[ 3] & st[ 4];
102 bc[ 3] = ~st[ 4] & st[ 0];
103 bc[ 4] = ~st[ 0] & st[ 1];
104 st[ 0] ^= bc[ 0];
105 st[ 1] ^= bc[ 1];
106 st[ 2] ^= bc[ 2];
107 st[ 3] ^= bc[ 3];
108 st[ 4] ^= bc[ 4];
109
110 bc[ 0] = ~st[ 6] & st[ 7];
111 bc[ 1] = ~st[ 7] & st[ 8];
112 bc[ 2] = ~st[ 8] & st[ 9];
113 bc[ 3] = ~st[ 9] & st[ 5];
114 bc[ 4] = ~st[ 5] & st[ 6];
115 st[ 5] ^= bc[ 0];
116 st[ 6] ^= bc[ 1];
117 st[ 7] ^= bc[ 2];
118 st[ 8] ^= bc[ 3];
119 st[ 9] ^= bc[ 4];
120
121 bc[ 0] = ~st[11] & st[12];
122 bc[ 1] = ~st[12] & st[13];
123 bc[ 2] = ~st[13] & st[14];
124 bc[ 3] = ~st[14] & st[10];
125 bc[ 4] = ~st[10] & st[11];
126 st[10] ^= bc[ 0];
127 st[11] ^= bc[ 1];
128 st[12] ^= bc[ 2];
129 st[13] ^= bc[ 3];
130 st[14] ^= bc[ 4];
131
132 bc[ 0] = ~st[16] & st[17];
133 bc[ 1] = ~st[17] & st[18];
134 bc[ 2] = ~st[18] & st[19];
135 bc[ 3] = ~st[19] & st[15];
136 bc[ 4] = ~st[15] & st[16];
137 st[15] ^= bc[ 0];
138 st[16] ^= bc[ 1];
139 st[17] ^= bc[ 2];
140 st[18] ^= bc[ 3];
141 st[19] ^= bc[ 4];
142
143 bc[ 0] = ~st[21] & st[22];
144 bc[ 1] = ~st[22] & st[23];
145 bc[ 2] = ~st[23] & st[24];
146 bc[ 3] = ~st[24] & st[20];
147 bc[ 4] = ~st[20] & st[21];
148 st[20] ^= bc[ 0];
149 st[21] ^= bc[ 1];
150 st[22] ^= bc[ 2];
151 st[23] ^= bc[ 3];
152 st[24] ^= bc[ 4];
153}
44 154
45 /* Theta */ 155static void __optimize("O3") keccakf(u64 st[25])
46 bc[0] = st[0] ^ st[5] ^ st[10] ^ st[15] ^ st[20]; 156{
47 bc[1] = st[1] ^ st[6] ^ st[11] ^ st[16] ^ st[21]; 157 int round;
48 bc[2] = st[2] ^ st[7] ^ st[12] ^ st[17] ^ st[22];
49 bc[3] = st[3] ^ st[8] ^ st[13] ^ st[18] ^ st[23];
50 bc[4] = st[4] ^ st[9] ^ st[14] ^ st[19] ^ st[24];
51
52 t[0] = bc[4] ^ rol64(bc[1], 1);
53 t[1] = bc[0] ^ rol64(bc[2], 1);
54 t[2] = bc[1] ^ rol64(bc[3], 1);
55 t[3] = bc[2] ^ rol64(bc[4], 1);
56 t[4] = bc[3] ^ rol64(bc[0], 1);
57
58 st[0] ^= t[0];
59
60 /* Rho Pi */
61 tt = st[1];
62 st[ 1] = rol64(st[ 6] ^ t[1], 44);
63 st[ 6] = rol64(st[ 9] ^ t[4], 20);
64 st[ 9] = rol64(st[22] ^ t[2], 61);
65 st[22] = rol64(st[14] ^ t[4], 39);
66 st[14] = rol64(st[20] ^ t[0], 18);
67 st[20] = rol64(st[ 2] ^ t[2], 62);
68 st[ 2] = rol64(st[12] ^ t[2], 43);
69 st[12] = rol64(st[13] ^ t[3], 25);
70 st[13] = rol64(st[19] ^ t[4], 8);
71 st[19] = rol64(st[23] ^ t[3], 56);
72 st[23] = rol64(st[15] ^ t[0], 41);
73 st[15] = rol64(st[ 4] ^ t[4], 27);
74 st[ 4] = rol64(st[24] ^ t[4], 14);
75 st[24] = rol64(st[21] ^ t[1], 2);
76 st[21] = rol64(st[ 8] ^ t[3], 55);
77 st[ 8] = rol64(st[16] ^ t[1], 45);
78 st[16] = rol64(st[ 5] ^ t[0], 36);
79 st[ 5] = rol64(st[ 3] ^ t[3], 28);
80 st[ 3] = rol64(st[18] ^ t[3], 21);
81 st[18] = rol64(st[17] ^ t[2], 15);
82 st[17] = rol64(st[11] ^ t[1], 10);
83 st[11] = rol64(st[ 7] ^ t[2], 6);
84 st[ 7] = rol64(st[10] ^ t[0], 3);
85 st[10] = rol64( tt ^ t[1], 1);
86
87 /* Chi */
88 bc[ 0] = ~st[ 1] & st[ 2];
89 bc[ 1] = ~st[ 2] & st[ 3];
90 bc[ 2] = ~st[ 3] & st[ 4];
91 bc[ 3] = ~st[ 4] & st[ 0];
92 bc[ 4] = ~st[ 0] & st[ 1];
93 st[ 0] ^= bc[ 0];
94 st[ 1] ^= bc[ 1];
95 st[ 2] ^= bc[ 2];
96 st[ 3] ^= bc[ 3];
97 st[ 4] ^= bc[ 4];
98
99 bc[ 0] = ~st[ 6] & st[ 7];
100 bc[ 1] = ~st[ 7] & st[ 8];
101 bc[ 2] = ~st[ 8] & st[ 9];
102 bc[ 3] = ~st[ 9] & st[ 5];
103 bc[ 4] = ~st[ 5] & st[ 6];
104 st[ 5] ^= bc[ 0];
105 st[ 6] ^= bc[ 1];
106 st[ 7] ^= bc[ 2];
107 st[ 8] ^= bc[ 3];
108 st[ 9] ^= bc[ 4];
109
110 bc[ 0] = ~st[11] & st[12];
111 bc[ 1] = ~st[12] & st[13];
112 bc[ 2] = ~st[13] & st[14];
113 bc[ 3] = ~st[14] & st[10];
114 bc[ 4] = ~st[10] & st[11];
115 st[10] ^= bc[ 0];
116 st[11] ^= bc[ 1];
117 st[12] ^= bc[ 2];
118 st[13] ^= bc[ 3];
119 st[14] ^= bc[ 4];
120
121 bc[ 0] = ~st[16] & st[17];
122 bc[ 1] = ~st[17] & st[18];
123 bc[ 2] = ~st[18] & st[19];
124 bc[ 3] = ~st[19] & st[15];
125 bc[ 4] = ~st[15] & st[16];
126 st[15] ^= bc[ 0];
127 st[16] ^= bc[ 1];
128 st[17] ^= bc[ 2];
129 st[18] ^= bc[ 3];
130 st[19] ^= bc[ 4];
131
132 bc[ 0] = ~st[21] & st[22];
133 bc[ 1] = ~st[22] & st[23];
134 bc[ 2] = ~st[23] & st[24];
135 bc[ 3] = ~st[24] & st[20];
136 bc[ 4] = ~st[20] & st[21];
137 st[20] ^= bc[ 0];
138 st[21] ^= bc[ 1];
139 st[22] ^= bc[ 2];
140 st[23] ^= bc[ 3];
141 st[24] ^= bc[ 4];
142 158
159 for (round = 0; round < KECCAK_ROUNDS; round++) {
160 keccakf_round(st);
143 /* Iota */ 161 /* Iota */
144 st[0] ^= keccakf_rndc[round]; 162 st[0] ^= keccakf_rndc[round];
145 } 163 }
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 676c9788e1c8..0dad0bd9327b 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -660,13 +660,15 @@ struct acpi_device *acpi_companion_match(const struct device *dev)
660 * acpi_of_match_device - Match device object using the "compatible" property. 660 * acpi_of_match_device - Match device object using the "compatible" property.
661 * @adev: ACPI device object to match. 661 * @adev: ACPI device object to match.
662 * @of_match_table: List of device IDs to match against. 662 * @of_match_table: List of device IDs to match against.
663 * @of_id: OF ID if matched
663 * 664 *
664 * If @dev has an ACPI companion which has ACPI_DT_NAMESPACE_HID in its list of 665 * If @dev has an ACPI companion which has ACPI_DT_NAMESPACE_HID in its list of
665 * identifiers and a _DSD object with the "compatible" property, use that 666 * identifiers and a _DSD object with the "compatible" property, use that
666 * property to match against the given list of identifiers. 667 * property to match against the given list of identifiers.
667 */ 668 */
668static bool acpi_of_match_device(struct acpi_device *adev, 669static bool acpi_of_match_device(struct acpi_device *adev,
669 const struct of_device_id *of_match_table) 670 const struct of_device_id *of_match_table,
671 const struct of_device_id **of_id)
670{ 672{
671 const union acpi_object *of_compatible, *obj; 673 const union acpi_object *of_compatible, *obj;
672 int i, nval; 674 int i, nval;
@@ -690,8 +692,11 @@ static bool acpi_of_match_device(struct acpi_device *adev,
690 const struct of_device_id *id; 692 const struct of_device_id *id;
691 693
692 for (id = of_match_table; id->compatible[0]; id++) 694 for (id = of_match_table; id->compatible[0]; id++)
693 if (!strcasecmp(obj->string.pointer, id->compatible)) 695 if (!strcasecmp(obj->string.pointer, id->compatible)) {
696 if (of_id)
697 *of_id = id;
694 return true; 698 return true;
699 }
695 } 700 }
696 701
697 return false; 702 return false;
@@ -762,10 +767,11 @@ static bool __acpi_match_device_cls(const struct acpi_device_id *id,
762 return true; 767 return true;
763} 768}
764 769
765static const struct acpi_device_id *__acpi_match_device( 770static bool __acpi_match_device(struct acpi_device *device,
766 struct acpi_device *device, 771 const struct acpi_device_id *acpi_ids,
767 const struct acpi_device_id *ids, 772 const struct of_device_id *of_ids,
768 const struct of_device_id *of_ids) 773 const struct acpi_device_id **acpi_id,
774 const struct of_device_id **of_id)
769{ 775{
770 const struct acpi_device_id *id; 776 const struct acpi_device_id *id;
771 struct acpi_hardware_id *hwid; 777 struct acpi_hardware_id *hwid;
@@ -775,30 +781,32 @@ static const struct acpi_device_id *__acpi_match_device(
775 * driver for it. 781 * driver for it.
776 */ 782 */
777 if (!device || !device->status.present) 783 if (!device || !device->status.present)
778 return NULL; 784 return false;
779 785
780 list_for_each_entry(hwid, &device->pnp.ids, list) { 786 list_for_each_entry(hwid, &device->pnp.ids, list) {
781 /* First, check the ACPI/PNP IDs provided by the caller. */ 787 /* First, check the ACPI/PNP IDs provided by the caller. */
782 for (id = ids; id->id[0] || id->cls; id++) { 788 if (acpi_ids) {
783 if (id->id[0] && !strcmp((char *) id->id, hwid->id)) 789 for (id = acpi_ids; id->id[0] || id->cls; id++) {
784 return id; 790 if (id->id[0] && !strcmp((char *)id->id, hwid->id))
785 else if (id->cls && __acpi_match_device_cls(id, hwid)) 791 goto out_acpi_match;
786 return id; 792 if (id->cls && __acpi_match_device_cls(id, hwid))
793 goto out_acpi_match;
794 }
787 } 795 }
788 796
789 /* 797 /*
790 * Next, check ACPI_DT_NAMESPACE_HID and try to match the 798 * Next, check ACPI_DT_NAMESPACE_HID and try to match the
791 * "compatible" property if found. 799 * "compatible" property if found.
792 *
793 * The id returned by the below is not valid, but the only
794 * caller passing non-NULL of_ids here is only interested in
795 * whether or not the return value is NULL.
796 */ 800 */
797 if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id) 801 if (!strcmp(ACPI_DT_NAMESPACE_HID, hwid->id))
798 && acpi_of_match_device(device, of_ids)) 802 return acpi_of_match_device(device, of_ids, of_id);
799 return id;
800 } 803 }
801 return NULL; 804 return false;
805
806out_acpi_match:
807 if (acpi_id)
808 *acpi_id = id;
809 return true;
802} 810}
803 811
804/** 812/**
@@ -815,32 +823,29 @@ static const struct acpi_device_id *__acpi_match_device(
815const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, 823const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
816 const struct device *dev) 824 const struct device *dev)
817{ 825{
818 return __acpi_match_device(acpi_companion_match(dev), ids, NULL); 826 const struct acpi_device_id *id = NULL;
827
828 __acpi_match_device(acpi_companion_match(dev), ids, NULL, &id, NULL);
829 return id;
819} 830}
820EXPORT_SYMBOL_GPL(acpi_match_device); 831EXPORT_SYMBOL_GPL(acpi_match_device);
821 832
822void *acpi_get_match_data(const struct device *dev) 833const void *acpi_device_get_match_data(const struct device *dev)
823{ 834{
824 const struct acpi_device_id *match; 835 const struct acpi_device_id *match;
825 836
826 if (!dev->driver)
827 return NULL;
828
829 if (!dev->driver->acpi_match_table)
830 return NULL;
831
832 match = acpi_match_device(dev->driver->acpi_match_table, dev); 837 match = acpi_match_device(dev->driver->acpi_match_table, dev);
833 if (!match) 838 if (!match)
834 return NULL; 839 return NULL;
835 840
836 return (void *)match->driver_data; 841 return (const void *)match->driver_data;
837} 842}
838EXPORT_SYMBOL_GPL(acpi_get_match_data); 843EXPORT_SYMBOL_GPL(acpi_device_get_match_data);
839 844
840int acpi_match_device_ids(struct acpi_device *device, 845int acpi_match_device_ids(struct acpi_device *device,
841 const struct acpi_device_id *ids) 846 const struct acpi_device_id *ids)
842{ 847{
843 return __acpi_match_device(device, ids, NULL) ? 0 : -ENOENT; 848 return __acpi_match_device(device, ids, NULL, NULL, NULL) ? 0 : -ENOENT;
844} 849}
845EXPORT_SYMBOL(acpi_match_device_ids); 850EXPORT_SYMBOL(acpi_match_device_ids);
846 851
@@ -849,10 +854,12 @@ bool acpi_driver_match_device(struct device *dev,
849{ 854{
850 if (!drv->acpi_match_table) 855 if (!drv->acpi_match_table)
851 return acpi_of_match_device(ACPI_COMPANION(dev), 856 return acpi_of_match_device(ACPI_COMPANION(dev),
852 drv->of_match_table); 857 drv->of_match_table,
858 NULL);
853 859
854 return !!__acpi_match_device(acpi_companion_match(dev), 860 return __acpi_match_device(acpi_companion_match(dev),
855 drv->acpi_match_table, drv->of_match_table); 861 drv->acpi_match_table, drv->of_match_table,
862 NULL, NULL);
856} 863}
857EXPORT_SYMBOL_GPL(acpi_driver_match_device); 864EXPORT_SYMBOL_GPL(acpi_driver_match_device);
858 865
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d9f38c645e4a..30a572956557 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1927,6 +1927,9 @@ static int acpi_ec_suspend_noirq(struct device *dev)
1927 ec->reference_count >= 1) 1927 ec->reference_count >= 1)
1928 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE); 1928 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE);
1929 1929
1930 if (acpi_sleep_no_ec_events())
1931 acpi_ec_enter_noirq(ec);
1932
1930 return 0; 1933 return 0;
1931} 1934}
1932 1935
@@ -1934,6 +1937,9 @@ static int acpi_ec_resume_noirq(struct device *dev)
1934{ 1937{
1935 struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev)); 1938 struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
1936 1939
1940 if (acpi_sleep_no_ec_events())
1941 acpi_ec_leave_noirq(ec);
1942
1937 if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) && 1943 if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) &&
1938 ec->reference_count >= 1) 1944 ec->reference_count >= 1)
1939 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE); 1945 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 466d1503aba0..5815356ea6ad 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1271,11 +1271,11 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
1271 return 0; 1271 return 0;
1272} 1272}
1273 1273
1274static void * 1274static const void *
1275acpi_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, 1275acpi_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
1276 const struct device *dev) 1276 const struct device *dev)
1277{ 1277{
1278 return acpi_get_match_data(dev); 1278 return acpi_device_get_match_data(dev);
1279} 1279}
1280 1280
1281#define DECLARE_ACPI_FWNODE_OPS(ops) \ 1281#define DECLARE_ACPI_FWNODE_OPS(ops) \
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 89e97d21a89c..9d52743080a4 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -115,6 +115,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
115 table->serial_port.access_width))) { 115 table->serial_port.access_width))) {
116 default: 116 default:
117 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n"); 117 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
118 /* fall through */
118 case 8: 119 case 8:
119 iotype = "mmio"; 120 iotype = "mmio";
120 break; 121 break;
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 15e3d3c2260d..764b63a5aade 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -1991,8 +1991,14 @@ static void binder_send_failed_reply(struct binder_transaction *t,
1991 &target_thread->reply_error.work); 1991 &target_thread->reply_error.work);
1992 wake_up_interruptible(&target_thread->wait); 1992 wake_up_interruptible(&target_thread->wait);
1993 } else { 1993 } else {
1994 WARN(1, "Unexpected reply error: %u\n", 1994 /*
1995 target_thread->reply_error.cmd); 1995 * Cannot get here for normal operation, but
1996 * we can if multiple synchronous transactions
1997 * are sent without blocking for responses.
1998 * Just ignore the 2nd error in this case.
1999 */
2000 pr_warn("Unexpected reply error: %u\n",
2001 target_thread->reply_error.cmd);
1996 } 2002 }
1997 binder_inner_proc_unlock(target_thread->proc); 2003 binder_inner_proc_unlock(target_thread->proc);
1998 binder_thread_dec_tmpref(target_thread); 2004 binder_thread_dec_tmpref(target_thread);
@@ -2193,7 +2199,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
2193 int debug_id = buffer->debug_id; 2199 int debug_id = buffer->debug_id;
2194 2200
2195 binder_debug(BINDER_DEBUG_TRANSACTION, 2201 binder_debug(BINDER_DEBUG_TRANSACTION,
2196 "%d buffer release %d, size %zd-%zd, failed at %p\n", 2202 "%d buffer release %d, size %zd-%zd, failed at %pK\n",
2197 proc->pid, buffer->debug_id, 2203 proc->pid, buffer->debug_id,
2198 buffer->data_size, buffer->offsets_size, failed_at); 2204 buffer->data_size, buffer->offsets_size, failed_at);
2199 2205
@@ -3705,7 +3711,7 @@ static int binder_thread_write(struct binder_proc *proc,
3705 } 3711 }
3706 } 3712 }
3707 binder_debug(BINDER_DEBUG_DEAD_BINDER, 3713 binder_debug(BINDER_DEBUG_DEAD_BINDER,
3708 "%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n", 3714 "%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n",
3709 proc->pid, thread->pid, (u64)cookie, 3715 proc->pid, thread->pid, (u64)cookie,
3710 death); 3716 death);
3711 if (death == NULL) { 3717 if (death == NULL) {
@@ -4376,6 +4382,15 @@ static int binder_thread_release(struct binder_proc *proc,
4376 4382
4377 binder_inner_proc_unlock(thread->proc); 4383 binder_inner_proc_unlock(thread->proc);
4378 4384
4385 /*
4386 * This is needed to avoid races between wake_up_poll() above and
4387 * and ep_remove_waitqueue() called for other reasons (eg the epoll file
4388 * descriptor being closed); ep_remove_waitqueue() holds an RCU read
4389 * lock, so we can be sure it's done after calling synchronize_rcu().
4390 */
4391 if (thread->looper & BINDER_LOOPER_STATE_POLL)
4392 synchronize_rcu();
4393
4379 if (send_reply) 4394 if (send_reply)
4380 binder_send_failed_reply(send_reply, BR_DEAD_REPLY); 4395 binder_send_failed_reply(send_reply, BR_DEAD_REPLY);
4381 binder_release_work(proc, &thread->todo); 4396 binder_release_work(proc, &thread->todo);
@@ -4391,6 +4406,8 @@ static __poll_t binder_poll(struct file *filp,
4391 bool wait_for_proc_work; 4406 bool wait_for_proc_work;
4392 4407
4393 thread = binder_get_thread(proc); 4408 thread = binder_get_thread(proc);
4409 if (!thread)
4410 return POLLERR;
4394 4411
4395 binder_inner_proc_lock(thread->proc); 4412 binder_inner_proc_lock(thread->proc);
4396 thread->looper |= BINDER_LOOPER_STATE_POLL; 4413 thread->looper |= BINDER_LOOPER_STATE_POLL;
@@ -5034,7 +5051,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
5034 spin_lock(&t->lock); 5051 spin_lock(&t->lock);
5035 to_proc = t->to_proc; 5052 to_proc = t->to_proc;
5036 seq_printf(m, 5053 seq_printf(m,
5037 "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d", 5054 "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d",
5038 prefix, t->debug_id, t, 5055 prefix, t->debug_id, t,
5039 t->from ? t->from->proc->pid : 0, 5056 t->from ? t->from->proc->pid : 0,
5040 t->from ? t->from->pid : 0, 5057 t->from ? t->from->pid : 0,
@@ -5058,7 +5075,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
5058 } 5075 }
5059 if (buffer->target_node) 5076 if (buffer->target_node)
5060 seq_printf(m, " node %d", buffer->target_node->debug_id); 5077 seq_printf(m, " node %d", buffer->target_node->debug_id);
5061 seq_printf(m, " size %zd:%zd data %p\n", 5078 seq_printf(m, " size %zd:%zd data %pK\n",
5062 buffer->data_size, buffer->offsets_size, 5079 buffer->data_size, buffer->offsets_size,
5063 buffer->data); 5080 buffer->data);
5064} 5081}
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b2261f92f2f1..5847364f25d9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -310,6 +310,9 @@ static void __device_link_del(struct device_link *link)
310 dev_info(link->consumer, "Dropping the link to %s\n", 310 dev_info(link->consumer, "Dropping the link to %s\n",
311 dev_name(link->supplier)); 311 dev_name(link->supplier));
312 312
313 if (link->flags & DL_FLAG_PM_RUNTIME)
314 pm_runtime_drop_link(link->consumer);
315
313 list_del(&link->s_node); 316 list_del(&link->s_node);
314 list_del(&link->c_node); 317 list_del(&link->c_node);
315 device_link_free(link); 318 device_link_free(link);
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index a8ac86e4d79e..6637fc319269 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -321,7 +321,8 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
321 return; 321 return;
322 322
323 if (device_may_wakeup(wirq->dev)) { 323 if (device_may_wakeup(wirq->dev)) {
324 if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED) 324 if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
325 !pm_runtime_status_suspended(wirq->dev))
325 enable_irq(wirq->irq); 326 enable_irq(wirq->irq);
326 327
327 enable_irq_wake(wirq->irq); 328 enable_irq_wake(wirq->irq);
@@ -343,7 +344,8 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
343 if (device_may_wakeup(wirq->dev)) { 344 if (device_may_wakeup(wirq->dev)) {
344 disable_irq_wake(wirq->irq); 345 disable_irq_wake(wirq->irq);
345 346
346 if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED) 347 if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
348 !pm_runtime_status_suspended(wirq->dev))
347 disable_irq_nosync(wirq->irq); 349 disable_irq_nosync(wirq->irq);
348 } 350 }
349} 351}
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 302236281d83..8f205f6461ed 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1410,9 +1410,8 @@ int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
1410} 1410}
1411EXPORT_SYMBOL(fwnode_graph_parse_endpoint); 1411EXPORT_SYMBOL(fwnode_graph_parse_endpoint);
1412 1412
1413void *device_get_match_data(struct device *dev) 1413const void *device_get_match_data(struct device *dev)
1414{ 1414{
1415 return fwnode_call_ptr_op(dev_fwnode(dev), device_get_match_data, 1415 return fwnode_call_ptr_op(dev_fwnode(dev), device_get_match_data, dev);
1416 dev);
1417} 1416}
1418EXPORT_SYMBOL_GPL(device_get_match_data); 1417EXPORT_SYMBOL_GPL(device_get_match_data);
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index e5aa62fcf5a8..3aaf6af3ec23 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1758,7 +1758,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
1758 if (unit[drive].type->code == FD_NODRIVE) 1758 if (unit[drive].type->code == FD_NODRIVE)
1759 return NULL; 1759 return NULL;
1760 *part = 0; 1760 *part = 0;
1761 return get_disk(unit[drive].gendisk); 1761 return get_disk_and_module(unit[drive].gendisk);
1762} 1762}
1763 1763
1764static int __init amiga_floppy_probe(struct platform_device *pdev) 1764static int __init amiga_floppy_probe(struct platform_device *pdev)
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 8bc3b9fd8dd2..dfb2c2622e5a 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1917,7 +1917,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
1917 if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS) 1917 if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
1918 return NULL; 1918 return NULL;
1919 *part = 0; 1919 *part = 0;
1920 return get_disk(unit[drive].disk); 1920 return get_disk_and_module(unit[drive].disk);
1921} 1921}
1922 1922
1923static int __init atari_floppy_init (void) 1923static int __init atari_floppy_init (void)
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 8028a3a7e7fd..deea78e485da 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -456,7 +456,7 @@ static struct kobject *brd_probe(dev_t dev, int *part, void *data)
456 456
457 mutex_lock(&brd_devices_mutex); 457 mutex_lock(&brd_devices_mutex);
458 brd = brd_init_one(MINOR(dev) / max_part, &new); 458 brd = brd_init_one(MINOR(dev) / max_part, &new);
459 kobj = brd ? get_disk(brd->brd_disk) : NULL; 459 kobj = brd ? get_disk_and_module(brd->brd_disk) : NULL;
460 mutex_unlock(&brd_devices_mutex); 460 mutex_unlock(&brd_devices_mutex);
461 461
462 if (new) 462 if (new)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index eae484acfbbc..8ec7235fc93b 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4505,7 +4505,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
4505 if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type)) 4505 if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type))
4506 return NULL; 4506 return NULL;
4507 *part = 0; 4507 *part = 0;
4508 return get_disk(disks[drive]); 4508 return get_disk_and_module(disks[drive]);
4509} 4509}
4510 4510
4511static int __init do_floppy_init(void) 4511static int __init do_floppy_init(void)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d5fe720cf149..87855b5123a6 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1922,7 +1922,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
1922 if (err < 0) 1922 if (err < 0)
1923 kobj = NULL; 1923 kobj = NULL;
1924 else 1924 else
1925 kobj = get_disk(lo->lo_disk); 1925 kobj = get_disk_and_module(lo->lo_disk);
1926 mutex_unlock(&loop_index_mutex); 1926 mutex_unlock(&loop_index_mutex);
1927 1927
1928 *part = 0; 1928 *part = 0;
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 5f2a4240a204..86258b00a1d4 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1591,7 +1591,7 @@ again:
1591 if (new_index < 0) { 1591 if (new_index < 0) {
1592 mutex_unlock(&nbd_index_mutex); 1592 mutex_unlock(&nbd_index_mutex);
1593 printk(KERN_ERR "nbd: failed to add new device\n"); 1593 printk(KERN_ERR "nbd: failed to add new device\n");
1594 return ret; 1594 return new_index;
1595 } 1595 }
1596 nbd = idr_find(&nbd_index_idr, new_index); 1596 nbd = idr_find(&nbd_index_idr, new_index);
1597 } 1597 }
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 531a0915066b..c61d20c9f3f8 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1122,7 +1122,7 @@ static int pkt_start_recovery(struct packet_data *pkt)
1122 pkt->sector = new_sector; 1122 pkt->sector = new_sector;
1123 1123
1124 bio_reset(pkt->bio); 1124 bio_reset(pkt->bio);
1125 bio_set_set(pkt->bio, pd->bdev); 1125 bio_set_dev(pkt->bio, pd->bdev);
1126 bio_set_op_attrs(pkt->bio, REQ_OP_WRITE, 0); 1126 bio_set_op_attrs(pkt->bio, REQ_OP_WRITE, 0);
1127 pkt->bio->bi_iter.bi_sector = new_sector; 1127 pkt->bio->bi_iter.bi_sector = new_sector;
1128 pkt->bio->bi_iter.bi_size = pkt->frames * CD_FRAMESIZE; 1128 pkt->bio->bi_iter.bi_size = pkt->frames * CD_FRAMESIZE;
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 84434d3ea19b..64e066eba72e 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -799,7 +799,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
799 return NULL; 799 return NULL;
800 800
801 *part = 0; 801 *part = 0;
802 return get_disk(swd->unit[drive].disk); 802 return get_disk_and_module(swd->unit[drive].disk);
803} 803}
804 804
805static int swim_add_floppy(struct swim_priv *swd, enum drive_location location) 805static int swim_add_floppy(struct swim_priv *swd, enum drive_location location)
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 41c95c9b2ab4..8f9130ab5887 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -332,7 +332,7 @@ static const struct block_device_operations z2_fops =
332static struct kobject *z2_find(dev_t dev, int *part, void *data) 332static struct kobject *z2_find(dev_t dev, int *part, void *data)
333{ 333{
334 *part = 0; 334 *part = 0;
335 return get_disk(z2ram_gendisk); 335 return get_disk_and_module(z2ram_gendisk);
336} 336}
337 337
338static struct request_queue *z2_queue; 338static struct request_queue *z2_queue;
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 4d46003c46cf..cdaeeea7999c 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -630,7 +630,7 @@ static int sysc_init_dts_quirks(struct sysc *ddata)
630 for (i = 0; i < ARRAY_SIZE(sysc_dts_quirks); i++) { 630 for (i = 0; i < ARRAY_SIZE(sysc_dts_quirks); i++) {
631 prop = of_get_property(np, sysc_dts_quirks[i].name, &len); 631 prop = of_get_property(np, sysc_dts_quirks[i].name, &len);
632 if (!prop) 632 if (!prop)
633 break; 633 continue;
634 634
635 ddata->cfg.quirks |= sysc_dts_quirks[i].mask; 635 ddata->cfg.quirks |= sysc_dts_quirks[i].mask;
636 } 636 }
diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c
index d1f5bb534e0e..6e9df558325b 100644
--- a/drivers/char/hw_random/via-rng.c
+++ b/drivers/char/hw_random/via-rng.c
@@ -162,7 +162,7 @@ static int via_rng_init(struct hwrng *rng)
162 /* Enable secondary noise source on CPUs where it is present. */ 162 /* Enable secondary noise source on CPUs where it is present. */
163 163
164 /* Nehemiah stepping 8 and higher */ 164 /* Nehemiah stepping 8 and higher */
165 if ((c->x86_model == 9) && (c->x86_mask > 7)) 165 if ((c->x86_model == 9) && (c->x86_stepping > 7))
166 lo |= VIA_NOISESRC2; 166 lo |= VIA_NOISESRC2;
167 167
168 /* Esther */ 168 /* Esther */
diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
index 4d1dc8b46877..f95b9c75175b 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.c
+++ b/drivers/char/tpm/st33zp24/st33zp24.c
@@ -457,7 +457,7 @@ static int st33zp24_recv(struct tpm_chip *chip, unsigned char *buf,
457 size_t count) 457 size_t count)
458{ 458{
459 int size = 0; 459 int size = 0;
460 int expected; 460 u32 expected;
461 461
462 if (!chip) 462 if (!chip)
463 return -EBUSY; 463 return -EBUSY;
@@ -474,7 +474,7 @@ static int st33zp24_recv(struct tpm_chip *chip, unsigned char *buf,
474 } 474 }
475 475
476 expected = be32_to_cpu(*(__be32 *)(buf + 2)); 476 expected = be32_to_cpu(*(__be32 *)(buf + 2));
477 if (expected > count) { 477 if (expected > count || expected < TPM_HEADER_SIZE) {
478 size = -EIO; 478 size = -EIO;
479 goto out; 479 goto out;
480 } 480 }
diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 76df4fbcf089..9e80a953d693 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -1190,6 +1190,10 @@ int tpm_get_random(struct tpm_chip *chip, u8 *out, size_t max)
1190 break; 1190 break;
1191 1191
1192 recd = be32_to_cpu(tpm_cmd.params.getrandom_out.rng_data_len); 1192 recd = be32_to_cpu(tpm_cmd.params.getrandom_out.rng_data_len);
1193 if (recd > num_bytes) {
1194 total = -EFAULT;
1195 break;
1196 }
1193 1197
1194 rlength = be32_to_cpu(tpm_cmd.header.out.length); 1198 rlength = be32_to_cpu(tpm_cmd.header.out.length);
1195 if (rlength < offsetof(struct tpm_getrandom_out, rng_data) + 1199 if (rlength < offsetof(struct tpm_getrandom_out, rng_data) +
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index c17e75348a99..a700f8f9ead7 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -683,6 +683,10 @@ static int tpm2_unseal_cmd(struct tpm_chip *chip,
683 if (!rc) { 683 if (!rc) {
684 data_len = be16_to_cpup( 684 data_len = be16_to_cpup(
685 (__be16 *) &buf.data[TPM_HEADER_SIZE + 4]); 685 (__be16 *) &buf.data[TPM_HEADER_SIZE + 4]);
686 if (data_len < MIN_KEY_SIZE || data_len > MAX_KEY_SIZE + 1) {
687 rc = -EFAULT;
688 goto out;
689 }
686 690
687 rlength = be32_to_cpu(((struct tpm2_cmd *)&buf) 691 rlength = be32_to_cpu(((struct tpm2_cmd *)&buf)
688 ->header.out.length); 692 ->header.out.length);
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index c1dd39eaaeeb..6116cd05e228 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -473,7 +473,8 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
473static int tpm_tis_i2c_recv(struct tpm_chip *chip, u8 *buf, size_t count) 473static int tpm_tis_i2c_recv(struct tpm_chip *chip, u8 *buf, size_t count)
474{ 474{
475 int size = 0; 475 int size = 0;
476 int expected, status; 476 int status;
477 u32 expected;
477 478
478 if (count < TPM_HEADER_SIZE) { 479 if (count < TPM_HEADER_SIZE) {
479 size = -EIO; 480 size = -EIO;
@@ -488,7 +489,7 @@ static int tpm_tis_i2c_recv(struct tpm_chip *chip, u8 *buf, size_t count)
488 } 489 }
489 490
490 expected = be32_to_cpu(*(__be32 *)(buf + 2)); 491 expected = be32_to_cpu(*(__be32 *)(buf + 2));
491 if ((size_t) expected > count) { 492 if (((size_t) expected > count) || (expected < TPM_HEADER_SIZE)) {
492 size = -EIO; 493 size = -EIO;
493 goto out; 494 goto out;
494 } 495 }
diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
index c6428771841f..caa86b19c76d 100644
--- a/drivers/char/tpm/tpm_i2c_nuvoton.c
+++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
@@ -281,7 +281,11 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count)
281 struct device *dev = chip->dev.parent; 281 struct device *dev = chip->dev.parent;
282 struct i2c_client *client = to_i2c_client(dev); 282 struct i2c_client *client = to_i2c_client(dev);
283 s32 rc; 283 s32 rc;
284 int expected, status, burst_count, retries, size = 0; 284 int status;
285 int burst_count;
286 int retries;
287 int size = 0;
288 u32 expected;
285 289
286 if (count < TPM_HEADER_SIZE) { 290 if (count < TPM_HEADER_SIZE) {
287 i2c_nuvoton_ready(chip); /* return to idle */ 291 i2c_nuvoton_ready(chip); /* return to idle */
@@ -323,7 +327,7 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count)
323 * to machine native 327 * to machine native
324 */ 328 */
325 expected = be32_to_cpu(*(__be32 *) (buf + 2)); 329 expected = be32_to_cpu(*(__be32 *) (buf + 2));
326 if (expected > count) { 330 if (expected > count || expected < size) {
327 dev_err(dev, "%s() expected > count\n", __func__); 331 dev_err(dev, "%s() expected > count\n", __func__);
328 size = -EIO; 332 size = -EIO;
329 continue; 333 continue;
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 183a5f54d875..da074e3db19b 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -270,7 +270,8 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
270{ 270{
271 struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); 271 struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
272 int size = 0; 272 int size = 0;
273 int expected, status; 273 int status;
274 u32 expected;
274 275
275 if (count < TPM_HEADER_SIZE) { 276 if (count < TPM_HEADER_SIZE) {
276 size = -EIO; 277 size = -EIO;
@@ -285,7 +286,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
285 } 286 }
286 287
287 expected = be32_to_cpu(*(__be32 *) (buf + 2)); 288 expected = be32_to_cpu(*(__be32 *) (buf + 2));
288 if (expected > count) { 289 if (expected > count || expected < TPM_HEADER_SIZE) {
289 size = -EIO; 290 size = -EIO;
290 goto out; 291 goto out;
291 } 292 }
diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
index 80dc211eb74b..617beb234259 100644
--- a/drivers/clk/imx/clk-imx7d.c
+++ b/drivers/clk/imx/clk-imx7d.c
@@ -795,6 +795,8 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
795 clks[IMX7D_DRAM_PHYM_ALT_ROOT_CLK] = imx_clk_gate4("dram_phym_alt_root_clk", "dram_phym_alt_post_div", base + 0x4130, 0); 795 clks[IMX7D_DRAM_PHYM_ALT_ROOT_CLK] = imx_clk_gate4("dram_phym_alt_root_clk", "dram_phym_alt_post_div", base + 0x4130, 0);
796 clks[IMX7D_DRAM_ALT_ROOT_CLK] = imx_clk_gate4("dram_alt_root_clk", "dram_alt_post_div", base + 0x4130, 0); 796 clks[IMX7D_DRAM_ALT_ROOT_CLK] = imx_clk_gate4("dram_alt_root_clk", "dram_alt_post_div", base + 0x4130, 0);
797 clks[IMX7D_OCOTP_CLK] = imx_clk_gate4("ocotp_clk", "ipg_root_clk", base + 0x4230, 0); 797 clks[IMX7D_OCOTP_CLK] = imx_clk_gate4("ocotp_clk", "ipg_root_clk", base + 0x4230, 0);
798 clks[IMX7D_SNVS_CLK] = imx_clk_gate4("snvs_clk", "ipg_root_clk", base + 0x4250, 0);
799 clks[IMX7D_CAAM_CLK] = imx_clk_gate4("caam_clk", "ipg_root_clk", base + 0x4240, 0);
798 clks[IMX7D_USB_HSIC_ROOT_CLK] = imx_clk_gate4("usb_hsic_root_clk", "usb_hsic_post_div", base + 0x4420, 0); 800 clks[IMX7D_USB_HSIC_ROOT_CLK] = imx_clk_gate4("usb_hsic_root_clk", "usb_hsic_post_div", base + 0x4420, 0);
799 clks[IMX7D_SDMA_CORE_CLK] = imx_clk_gate4("sdma_root_clk", "ahb_root_clk", base + 0x4480, 0); 801 clks[IMX7D_SDMA_CORE_CLK] = imx_clk_gate4("sdma_root_clk", "ahb_root_clk", base + 0x4480, 0);
800 clks[IMX7D_PCIE_CTRL_ROOT_CLK] = imx_clk_gate4("pcie_ctrl_root_clk", "pcie_ctrl_post_div", base + 0x4600, 0); 802 clks[IMX7D_PCIE_CTRL_ROOT_CLK] = imx_clk_gate4("pcie_ctrl_root_clk", "pcie_ctrl_post_div", base + 0x4600, 0);
@@ -857,6 +859,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
857 clks[IMX7D_WDOG2_ROOT_CLK] = imx_clk_gate4("wdog2_root_clk", "wdog_post_div", base + 0x49d0, 0); 859 clks[IMX7D_WDOG2_ROOT_CLK] = imx_clk_gate4("wdog2_root_clk", "wdog_post_div", base + 0x49d0, 0);
858 clks[IMX7D_WDOG3_ROOT_CLK] = imx_clk_gate4("wdog3_root_clk", "wdog_post_div", base + 0x49e0, 0); 860 clks[IMX7D_WDOG3_ROOT_CLK] = imx_clk_gate4("wdog3_root_clk", "wdog_post_div", base + 0x49e0, 0);
859 clks[IMX7D_WDOG4_ROOT_CLK] = imx_clk_gate4("wdog4_root_clk", "wdog_post_div", base + 0x49f0, 0); 861 clks[IMX7D_WDOG4_ROOT_CLK] = imx_clk_gate4("wdog4_root_clk", "wdog_post_div", base + 0x49f0, 0);
862 clks[IMX7D_KPP_ROOT_CLK] = imx_clk_gate4("kpp_root_clk", "ipg_root_clk", base + 0x4aa0, 0);
860 clks[IMX7D_CSI_MCLK_ROOT_CLK] = imx_clk_gate4("csi_mclk_root_clk", "csi_mclk_post_div", base + 0x4490, 0); 863 clks[IMX7D_CSI_MCLK_ROOT_CLK] = imx_clk_gate4("csi_mclk_root_clk", "csi_mclk_post_div", base + 0x4490, 0);
861 clks[IMX7D_AUDIO_MCLK_ROOT_CLK] = imx_clk_gate4("audio_mclk_root_clk", "audio_mclk_post_div", base + 0x4790, 0); 864 clks[IMX7D_AUDIO_MCLK_ROOT_CLK] = imx_clk_gate4("audio_mclk_root_clk", "audio_mclk_post_div", base + 0x4790, 0);
862 clks[IMX7D_WRCLK_ROOT_CLK] = imx_clk_gate4("wrclk_root_clk", "wrclk_post_div", base + 0x47a0, 0); 865 clks[IMX7D_WRCLK_ROOT_CLK] = imx_clk_gate4("wrclk_root_clk", "wrclk_post_div", base + 0x47a0, 0);
diff --git a/drivers/clocksource/arc_timer.c b/drivers/clocksource/arc_timer.c
index 4927355f9cbe..471b428d8034 100644
--- a/drivers/clocksource/arc_timer.c
+++ b/drivers/clocksource/arc_timer.c
@@ -251,9 +251,14 @@ static irqreturn_t timer_irq_handler(int irq, void *dev_id)
251 int irq_reenable = clockevent_state_periodic(evt); 251 int irq_reenable = clockevent_state_periodic(evt);
252 252
253 /* 253 /*
254 * Any write to CTRL reg ACks the interrupt, we rewrite the 254 * 1. ACK the interrupt
255 * Count when [N]ot [H]alted bit. 255 * - For ARC700, any write to CTRL reg ACKs it, so just rewrite
256 * And re-arm it if perioid by [I]nterrupt [E]nable bit 256 * Count when [N]ot [H]alted bit.
257 * - For HS3x, it is a bit subtle. On taken count-down interrupt,
258 * IP bit [3] is set, which needs to be cleared for ACK'ing.
259 * The write below can only update the other two bits, hence
260 * explicitly clears IP bit
261 * 2. Re-arm interrupt if periodic by writing to IE bit [0]
257 */ 262 */
258 write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH); 263 write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
259 264
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 3ee7e6fea621..846d18daf893 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -281,7 +281,7 @@ static int __init __ftm_clk_init(struct device_node *np, char *cnt_name,
281 281
282static unsigned long __init ftm_clk_init(struct device_node *np) 282static unsigned long __init ftm_clk_init(struct device_node *np)
283{ 283{
284 unsigned long freq; 284 long freq;
285 285
286 freq = __ftm_clk_init(np, "ftm-evt-counter-en", "ftm-evt"); 286 freq = __ftm_clk_init(np, "ftm-evt-counter-en", "ftm-evt");
287 if (freq <= 0) 287 if (freq <= 0)
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index a04808a21d4e..986b6796b631 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -166,7 +166,7 @@ static int __init __gic_clocksource_init(void)
166 166
167 /* Set clocksource mask. */ 167 /* Set clocksource mask. */
168 count_width = read_gic_config() & GIC_CONFIG_COUNTBITS; 168 count_width = read_gic_config() & GIC_CONFIG_COUNTBITS;
169 count_width >>= __fls(GIC_CONFIG_COUNTBITS); 169 count_width >>= __ffs(GIC_CONFIG_COUNTBITS);
170 count_width *= 4; 170 count_width *= 4;
171 count_width += 32; 171 count_width += 32;
172 gic_clocksource.mask = CLOCKSOURCE_MASK(count_width); 172 gic_clocksource.mask = CLOCKSOURCE_MASK(count_width);
@@ -205,12 +205,12 @@ static int __init gic_clocksource_of_init(struct device_node *node)
205 } else if (of_property_read_u32(node, "clock-frequency", 205 } else if (of_property_read_u32(node, "clock-frequency",
206 &gic_frequency)) { 206 &gic_frequency)) {
207 pr_err("GIC frequency not specified.\n"); 207 pr_err("GIC frequency not specified.\n");
208 return -EINVAL;; 208 return -EINVAL;
209 } 209 }
210 gic_timer_irq = irq_of_parse_and_map(node, 0); 210 gic_timer_irq = irq_of_parse_and_map(node, 0);
211 if (!gic_timer_irq) { 211 if (!gic_timer_irq) {
212 pr_err("GIC timer IRQ not specified.\n"); 212 pr_err("GIC timer IRQ not specified.\n");
213 return -EINVAL;; 213 return -EINVAL;
214 } 214 }
215 215
216 ret = __gic_clocksource_init(); 216 ret = __gic_clocksource_init();
diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index 2a3fe83ec337..3b56ea3f52af 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -334,7 +334,7 @@ static int __init sun5i_timer_init(struct device_node *node)
334 timer_base = of_io_request_and_map(node, 0, of_node_full_name(node)); 334 timer_base = of_io_request_and_map(node, 0, of_node_full_name(node));
335 if (IS_ERR(timer_base)) { 335 if (IS_ERR(timer_base)) {
336 pr_err("Can't map registers\n"); 336 pr_err("Can't map registers\n");
337 return PTR_ERR(timer_base);; 337 return PTR_ERR(timer_base);
338 } 338 }
339 339
340 irq = irq_of_parse_and_map(node, 0); 340 irq = irq_of_parse_and_map(node, 0);
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 3a88e33b0cfe..fb586e09682d 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -44,10 +44,10 @@ config ARM_DT_BL_CPUFREQ
44 44
45config ARM_SCPI_CPUFREQ 45config ARM_SCPI_CPUFREQ
46 tristate "SCPI based CPUfreq driver" 46 tristate "SCPI based CPUfreq driver"
47 depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI 47 depends on ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
48 help 48 help
49 This adds the CPUfreq driver support for ARM big.LITTLE platforms 49 This adds the CPUfreq driver support for ARM platforms using SCPI
50 using SCPI protocol for CPU power management. 50 protocol for CPU power management.
51 51
52 This driver uses SCPI Message Protocol driver to interact with the 52 This driver uses SCPI Message Protocol driver to interact with the
53 firmware providing the CPU DVFS functionality. 53 firmware providing the CPU DVFS functionality.
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 3a2ca0f79daf..d0c34df0529c 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -629,7 +629,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
629 if (c->x86_vendor == X86_VENDOR_INTEL) { 629 if (c->x86_vendor == X86_VENDOR_INTEL) {
630 if ((c->x86 == 15) && 630 if ((c->x86 == 15) &&
631 (c->x86_model == 6) && 631 (c->x86_model == 6) &&
632 (c->x86_mask == 8)) { 632 (c->x86_stepping == 8)) {
633 pr_info("Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n"); 633 pr_info("Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n");
634 return -ENODEV; 634 return -ENODEV;
635 } 635 }
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 942632a27b50..f730b6528c18 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -775,7 +775,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
775 break; 775 break;
776 776
777 case 7: 777 case 7:
778 switch (c->x86_mask) { 778 switch (c->x86_stepping) {
779 case 0: 779 case 0:
780 longhaul_version = TYPE_LONGHAUL_V1; 780 longhaul_version = TYPE_LONGHAUL_V1;
781 cpu_model = CPU_SAMUEL2; 781 cpu_model = CPU_SAMUEL2;
@@ -787,7 +787,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
787 break; 787 break;
788 case 1 ... 15: 788 case 1 ... 15:
789 longhaul_version = TYPE_LONGHAUL_V2; 789 longhaul_version = TYPE_LONGHAUL_V2;
790 if (c->x86_mask < 8) { 790 if (c->x86_stepping < 8) {
791 cpu_model = CPU_SAMUEL2; 791 cpu_model = CPU_SAMUEL2;
792 cpuname = "C3 'Samuel 2' [C5B]"; 792 cpuname = "C3 'Samuel 2' [C5B]";
793 } else { 793 } else {
@@ -814,7 +814,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
814 numscales = 32; 814 numscales = 32;
815 memcpy(mults, nehemiah_mults, sizeof(nehemiah_mults)); 815 memcpy(mults, nehemiah_mults, sizeof(nehemiah_mults));
816 memcpy(eblcr, nehemiah_eblcr, sizeof(nehemiah_eblcr)); 816 memcpy(eblcr, nehemiah_eblcr, sizeof(nehemiah_eblcr));
817 switch (c->x86_mask) { 817 switch (c->x86_stepping) {
818 case 0 ... 1: 818 case 0 ... 1:
819 cpu_model = CPU_NEHEMIAH; 819 cpu_model = CPU_NEHEMIAH;
820 cpuname = "C3 'Nehemiah A' [C5XLOE]"; 820 cpuname = "C3 'Nehemiah A' [C5XLOE]";
diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c
index fd77812313f3..a25741b1281b 100644
--- a/drivers/cpufreq/p4-clockmod.c
+++ b/drivers/cpufreq/p4-clockmod.c
@@ -168,7 +168,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
168#endif 168#endif
169 169
170 /* Errata workaround */ 170 /* Errata workaround */
171 cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_mask; 171 cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_stepping;
172 switch (cpuid) { 172 switch (cpuid) {
173 case 0x0f07: 173 case 0x0f07:
174 case 0x0f0a: 174 case 0x0f0a:
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index 80ac313e6c59..302e9ce793a0 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -131,7 +131,7 @@ static int check_powernow(void)
131 return 0; 131 return 0;
132 } 132 }
133 133
134 if ((c->x86_model == 6) && (c->x86_mask == 0)) { 134 if ((c->x86_model == 6) && (c->x86_stepping == 0)) {
135 pr_info("K7 660[A0] core detected, enabling errata workarounds\n"); 135 pr_info("K7 660[A0] core detected, enabling errata workarounds\n");
136 have_a0 = 1; 136 have_a0 = 1;
137 } 137 }
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index 7b596fa38ad2..6bebc1f9f55a 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -351,7 +351,13 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
351static int s3c_cpufreq_init(struct cpufreq_policy *policy) 351static int s3c_cpufreq_init(struct cpufreq_policy *policy)
352{ 352{
353 policy->clk = clk_arm; 353 policy->clk = clk_arm;
354 return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency); 354
355 policy->cpuinfo.transition_latency = cpu_cur.info->latency;
356
357 if (ftab)
358 return cpufreq_table_validate_and_show(policy, ftab);
359
360 return 0;
355} 361}
356 362
357static int __init s3c_cpufreq_initclks(void) 363static int __init s3c_cpufreq_initclks(void)
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index c32a833e1b00..d300a163945f 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -51,15 +51,23 @@ static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
51static int 51static int
52scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) 52scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
53{ 53{
54 unsigned long freq = policy->freq_table[index].frequency;
54 struct scpi_data *priv = policy->driver_data; 55 struct scpi_data *priv = policy->driver_data;
55 u64 rate = policy->freq_table[index].frequency * 1000; 56 u64 rate = freq * 1000;
56 int ret; 57 int ret;
57 58
58 ret = clk_set_rate(priv->clk, rate); 59 ret = clk_set_rate(priv->clk, rate);
59 if (!ret && (clk_get_rate(priv->clk) != rate))
60 ret = -EIO;
61 60
62 return ret; 61 if (ret)
62 return ret;
63
64 if (clk_get_rate(priv->clk) != rate)
65 return -EIO;
66
67 arch_set_freq_scale(policy->related_cpus, freq,
68 policy->cpuinfo.max_freq);
69
70 return 0;
63} 71}
64 72
65static int 73static int
diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
index 41bc5397f4bb..4fa5adf16c70 100644
--- a/drivers/cpufreq/speedstep-centrino.c
+++ b/drivers/cpufreq/speedstep-centrino.c
@@ -37,7 +37,7 @@ struct cpu_id
37{ 37{
38 __u8 x86; /* CPU family */ 38 __u8 x86; /* CPU family */
39 __u8 x86_model; /* model */ 39 __u8 x86_model; /* model */
40 __u8 x86_mask; /* stepping */ 40 __u8 x86_stepping; /* stepping */
41}; 41};
42 42
43enum { 43enum {
@@ -277,7 +277,7 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c,
277{ 277{
278 if ((c->x86 == x->x86) && 278 if ((c->x86 == x->x86) &&
279 (c->x86_model == x->x86_model) && 279 (c->x86_model == x->x86_model) &&
280 (c->x86_mask == x->x86_mask)) 280 (c->x86_stepping == x->x86_stepping))
281 return 1; 281 return 1;
282 return 0; 282 return 0;
283} 283}
diff --git a/drivers/cpufreq/speedstep-lib.c b/drivers/cpufreq/speedstep-lib.c
index 8085ec9000d1..e3a9962ee410 100644
--- a/drivers/cpufreq/speedstep-lib.c
+++ b/drivers/cpufreq/speedstep-lib.c
@@ -272,9 +272,9 @@ unsigned int speedstep_detect_processor(void)
272 ebx = cpuid_ebx(0x00000001); 272 ebx = cpuid_ebx(0x00000001);
273 ebx &= 0x000000FF; 273 ebx &= 0x000000FF;
274 274
275 pr_debug("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); 275 pr_debug("ebx value is %x, x86_stepping is %x\n", ebx, c->x86_stepping);
276 276
277 switch (c->x86_mask) { 277 switch (c->x86_stepping) {
278 case 4: 278 case 4:
279 /* 279 /*
280 * B-stepping [M-P4-M] 280 * B-stepping [M-P4-M]
@@ -361,7 +361,7 @@ unsigned int speedstep_detect_processor(void)
361 msr_lo, msr_hi); 361 msr_lo, msr_hi);
362 if ((msr_hi & (1<<18)) && 362 if ((msr_hi & (1<<18)) &&
363 (relaxed_check ? 1 : (msr_hi & (3<<24)))) { 363 (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
364 if (c->x86_mask == 0x01) { 364 if (c->x86_stepping == 0x01) {
365 pr_debug("early PIII version\n"); 365 pr_debug("early PIII version\n");
366 return SPEEDSTEP_CPU_PIII_C_EARLY; 366 return SPEEDSTEP_CPU_PIII_C_EARLY;
367 } else 367 } else
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 75d280cb2dc0..e843cf410373 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -228,12 +228,16 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
228 * without any error (HW optimizations for later 228 * without any error (HW optimizations for later
229 * CAAM eras), then try again. 229 * CAAM eras), then try again.
230 */ 230 */
231 if (ret)
232 break;
233
231 rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK; 234 rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK;
232 if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) || 235 if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) ||
233 !(rdsta_val & (1 << sh_idx))) 236 !(rdsta_val & (1 << sh_idx))) {
234 ret = -EAGAIN; 237 ret = -EAGAIN;
235 if (ret)
236 break; 238 break;
239 }
240
237 dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx); 241 dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx);
238 /* Clear the contents before recreating the descriptor */ 242 /* Clear the contents before recreating the descriptor */
239 memset(desc, 0x00, CAAM_CMD_SZ * 7); 243 memset(desc, 0x00, CAAM_CMD_SZ * 7);
diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
index fcfa5b1eae61..b3afb6cc9d72 100644
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -211,7 +211,7 @@ static int __sev_platform_shutdown_locked(int *error)
211{ 211{
212 int ret; 212 int ret;
213 213
214 ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, 0, error); 214 ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, NULL, error);
215 if (ret) 215 if (ret)
216 return ret; 216 return ret;
217 217
@@ -271,7 +271,7 @@ static int sev_ioctl_do_reset(struct sev_issue_cmd *argp)
271 return rc; 271 return rc;
272 } 272 }
273 273
274 return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, 0, &argp->error); 274 return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, NULL, &argp->error);
275} 275}
276 276
277static int sev_ioctl_do_platform_status(struct sev_issue_cmd *argp) 277static int sev_ioctl_do_platform_status(struct sev_issue_cmd *argp)
@@ -299,7 +299,7 @@ static int sev_ioctl_do_pek_pdh_gen(int cmd, struct sev_issue_cmd *argp)
299 return rc; 299 return rc;
300 } 300 }
301 301
302 return __sev_do_cmd_locked(cmd, 0, &argp->error); 302 return __sev_do_cmd_locked(cmd, NULL, &argp->error);
303} 303}
304 304
305static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp) 305static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp)
@@ -624,7 +624,7 @@ EXPORT_SYMBOL_GPL(sev_guest_decommission);
624 624
625int sev_guest_df_flush(int *error) 625int sev_guest_df_flush(int *error)
626{ 626{
627 return sev_do_cmd(SEV_CMD_DF_FLUSH, 0, error); 627 return sev_do_cmd(SEV_CMD_DF_FLUSH, NULL, error);
628} 628}
629EXPORT_SYMBOL_GPL(sev_guest_df_flush); 629EXPORT_SYMBOL_GPL(sev_guest_df_flush);
630 630
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index 4b6642a25df5..1c6cbda56afe 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -512,7 +512,7 @@ static int __init padlock_init(void)
512 512
513 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n"); 513 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
514 514
515 if (c->x86 == 6 && c->x86_model == 15 && c->x86_mask == 2) { 515 if (c->x86 == 6 && c->x86_model == 15 && c->x86_stepping == 2) {
516 ecb_fetch_blocks = MAX_ECB_FETCH_BLOCKS; 516 ecb_fetch_blocks = MAX_ECB_FETCH_BLOCKS;
517 cbc_fetch_blocks = MAX_CBC_FETCH_BLOCKS; 517 cbc_fetch_blocks = MAX_CBC_FETCH_BLOCKS;
518 printk(KERN_NOTICE PFX "VIA Nano stepping 2 detected: enabling workaround.\n"); 518 printk(KERN_NOTICE PFX "VIA Nano stepping 2 detected: enabling workaround.\n");
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 188f44b7eb27..5d64c08b7f47 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -1922,15 +1922,21 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
1922 uint32_t aes_control; 1922 uint32_t aes_control;
1923 unsigned long flags; 1923 unsigned long flags;
1924 int err; 1924 int err;
1925 u8 *iv;
1925 1926
1926 aes_control = SSS_AES_KEY_CHANGE_MODE; 1927 aes_control = SSS_AES_KEY_CHANGE_MODE;
1927 if (mode & FLAGS_AES_DECRYPT) 1928 if (mode & FLAGS_AES_DECRYPT)
1928 aes_control |= SSS_AES_MODE_DECRYPT; 1929 aes_control |= SSS_AES_MODE_DECRYPT;
1929 1930
1930 if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) 1931 if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) {
1931 aes_control |= SSS_AES_CHAIN_MODE_CBC; 1932 aes_control |= SSS_AES_CHAIN_MODE_CBC;
1932 else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) 1933 iv = req->info;
1934 } else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) {
1933 aes_control |= SSS_AES_CHAIN_MODE_CTR; 1935 aes_control |= SSS_AES_CHAIN_MODE_CTR;
1936 iv = req->info;
1937 } else {
1938 iv = NULL; /* AES_ECB */
1939 }
1934 1940
1935 if (dev->ctx->keylen == AES_KEYSIZE_192) 1941 if (dev->ctx->keylen == AES_KEYSIZE_192)
1936 aes_control |= SSS_AES_KEY_SIZE_192; 1942 aes_control |= SSS_AES_KEY_SIZE_192;
@@ -1961,7 +1967,7 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
1961 goto outdata_error; 1967 goto outdata_error;
1962 1968
1963 SSS_AES_WRITE(dev, AES_CONTROL, aes_control); 1969 SSS_AES_WRITE(dev, AES_CONTROL, aes_control);
1964 s5p_set_aes(dev, dev->ctx->aes_key, req->info, dev->ctx->keylen); 1970 s5p_set_aes(dev, dev->ctx->aes_key, iv, dev->ctx->keylen);
1965 1971
1966 s5p_set_dma_indata(dev, dev->sg_src); 1972 s5p_set_dma_indata(dev, dev->sg_src);
1967 s5p_set_dma_outdata(dev, dev->sg_dst); 1973 s5p_set_dma_outdata(dev, dev->sg_dst);
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c
index 0d01d1624252..63d636424161 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c
@@ -28,7 +28,7 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
28 algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); 28 algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);
29 ss = algt->ss; 29 ss = algt->ss;
30 30
31 spin_lock(&ss->slock); 31 spin_lock_bh(&ss->slock);
32 32
33 writel(mode, ss->base + SS_CTL); 33 writel(mode, ss->base + SS_CTL);
34 34
@@ -51,6 +51,6 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
51 } 51 }
52 52
53 writel(0, ss->base + SS_CTL); 53 writel(0, ss->base + SS_CTL);
54 spin_unlock(&ss->slock); 54 spin_unlock_bh(&ss->slock);
55 return dlen; 55 return 0;
56} 56}
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 9c80e0cb1664..6882fa2f8bad 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1138,6 +1138,10 @@ static int talitos_sg_map(struct device *dev, struct scatterlist *src,
1138 struct talitos_private *priv = dev_get_drvdata(dev); 1138 struct talitos_private *priv = dev_get_drvdata(dev);
1139 bool is_sec1 = has_ftr_sec1(priv); 1139 bool is_sec1 = has_ftr_sec1(priv);
1140 1140
1141 if (!src) {
1142 to_talitos_ptr(ptr, 0, 0, is_sec1);
1143 return 1;
1144 }
1141 if (sg_count == 1) { 1145 if (sg_count == 1) {
1142 to_talitos_ptr(ptr, sg_dma_address(src) + offset, len, is_sec1); 1146 to_talitos_ptr(ptr, sg_dma_address(src) + offset, len, is_sec1);
1143 return sg_count; 1147 return sg_count;
diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 473af694ad1c..ecdc292aa4e4 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -246,12 +246,6 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
246{ 246{
247 long avail; 247 long avail;
248 248
249 /*
250 * The device driver is allowed to sleep, in order to make the
251 * memory directly accessible.
252 */
253 might_sleep();
254
255 if (!dax_dev) 249 if (!dax_dev)
256 return -EOPNOTSUPP; 250 return -EOPNOTSUPP;
257 251
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 8b16ec595fa7..329cb96f886f 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3147,7 +3147,7 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
3147 struct amd64_family_type *fam_type = NULL; 3147 struct amd64_family_type *fam_type = NULL;
3148 3148
3149 pvt->ext_model = boot_cpu_data.x86_model >> 4; 3149 pvt->ext_model = boot_cpu_data.x86_model >> 4;
3150 pvt->stepping = boot_cpu_data.x86_mask; 3150 pvt->stepping = boot_cpu_data.x86_stepping;
3151 pvt->model = boot_cpu_data.x86_model; 3151 pvt->model = boot_cpu_data.x86_model;
3152 pvt->fam = boot_cpu_data.x86; 3152 pvt->fam = boot_cpu_data.x86;
3153 3153
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index f34430f99fd8..872100215ca0 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -279,7 +279,7 @@ static const u32 correrrthrsld[] = {
279 * sbridge structs 279 * sbridge structs
280 */ 280 */
281 281
282#define NUM_CHANNELS 4 /* Max channels per MC */ 282#define NUM_CHANNELS 6 /* Max channels per MC */
283#define MAX_DIMMS 3 /* Max DIMMS per channel */ 283#define MAX_DIMMS 3 /* Max DIMMS per channel */
284#define KNL_MAX_CHAS 38 /* KNL max num. of Cache Home Agents */ 284#define KNL_MAX_CHAS 38 /* KNL max num. of Cache Home Agents */
285#define KNL_MAX_CHANNELS 6 /* KNL max num. of PCI channels */ 285#define KNL_MAX_CHANNELS 6 /* KNL max num. of PCI channels */
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 0a44d43802fe..3ec4c715e240 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -1,7 +1,6 @@
1/* 1/*
2 * extcon-axp288.c - X-Power AXP288 PMIC extcon cable detection driver 2 * extcon-axp288.c - X-Power AXP288 PMIC extcon cable detection driver
3 * 3 *
4 * Copyright (C) 2016-2017 Hans de Goede <hdegoede@redhat.com>
5 * Copyright (C) 2015 Intel Corporation 4 * Copyright (C) 2015 Intel Corporation
6 * Author: Ramakrishna Pallala <ramakrishna.pallala@intel.com> 5 * Author: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
7 * 6 *
@@ -98,15 +97,13 @@ struct axp288_extcon_info {
98 struct device *dev; 97 struct device *dev;
99 struct regmap *regmap; 98 struct regmap *regmap;
100 struct regmap_irq_chip_data *regmap_irqc; 99 struct regmap_irq_chip_data *regmap_irqc;
101 struct delayed_work det_work;
102 int irq[EXTCON_IRQ_END]; 100 int irq[EXTCON_IRQ_END];
103 struct extcon_dev *edev; 101 struct extcon_dev *edev;
104 unsigned int previous_cable; 102 unsigned int previous_cable;
105 bool first_detect_done;
106}; 103};
107 104
108/* Power up/down reason string array */ 105/* Power up/down reason string array */
109static char *axp288_pwr_up_down_info[] = { 106static const char * const axp288_pwr_up_down_info[] = {
110 "Last wake caused by user pressing the power button", 107 "Last wake caused by user pressing the power button",
111 "Last wake caused by a charger insertion", 108 "Last wake caused by a charger insertion",
112 "Last wake caused by a battery insertion", 109 "Last wake caused by a battery insertion",
@@ -124,7 +121,7 @@ static char *axp288_pwr_up_down_info[] = {
124 */ 121 */
125static void axp288_extcon_log_rsi(struct axp288_extcon_info *info) 122static void axp288_extcon_log_rsi(struct axp288_extcon_info *info)
126{ 123{
127 char **rsi; 124 const char * const *rsi;
128 unsigned int val, i, clear_mask = 0; 125 unsigned int val, i, clear_mask = 0;
129 int ret; 126 int ret;
130 127
@@ -140,25 +137,6 @@ static void axp288_extcon_log_rsi(struct axp288_extcon_info *info)
140 regmap_write(info->regmap, AXP288_PS_BOOT_REASON_REG, clear_mask); 137 regmap_write(info->regmap, AXP288_PS_BOOT_REASON_REG, clear_mask);
141} 138}
142 139
143static void axp288_chrg_detect_complete(struct axp288_extcon_info *info)
144{
145 /*
146 * We depend on other drivers to do things like mux the data lines,
147 * enable/disable vbus based on the id-pin, etc. Sometimes the BIOS has
148 * not set these things up correctly resulting in the initial charger
149 * cable type detection giving a wrong result and we end up not charging
150 * or charging at only 0.5A.
151 *
152 * So we schedule a second cable type detection after 2 seconds to
153 * give the other drivers time to load and do their thing.
154 */
155 if (!info->first_detect_done) {
156 queue_delayed_work(system_wq, &info->det_work,
157 msecs_to_jiffies(2000));
158 info->first_detect_done = true;
159 }
160}
161
162static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) 140static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
163{ 141{
164 int ret, stat, cfg, pwr_stat; 142 int ret, stat, cfg, pwr_stat;
@@ -223,8 +201,6 @@ no_vbus:
223 info->previous_cable = cable; 201 info->previous_cable = cable;
224 } 202 }
225 203
226 axp288_chrg_detect_complete(info);
227
228 return 0; 204 return 0;
229 205
230dev_det_ret: 206dev_det_ret:
@@ -246,11 +222,8 @@ static irqreturn_t axp288_extcon_isr(int irq, void *data)
246 return IRQ_HANDLED; 222 return IRQ_HANDLED;
247} 223}
248 224
249static void axp288_extcon_det_work(struct work_struct *work) 225static void axp288_extcon_enable(struct axp288_extcon_info *info)
250{ 226{
251 struct axp288_extcon_info *info =
252 container_of(work, struct axp288_extcon_info, det_work.work);
253
254 regmap_update_bits(info->regmap, AXP288_BC_GLOBAL_REG, 227 regmap_update_bits(info->regmap, AXP288_BC_GLOBAL_REG,
255 BC_GLOBAL_RUN, 0); 228 BC_GLOBAL_RUN, 0);
256 /* Enable the charger detection logic */ 229 /* Enable the charger detection logic */
@@ -272,7 +245,6 @@ static int axp288_extcon_probe(struct platform_device *pdev)
272 info->regmap = axp20x->regmap; 245 info->regmap = axp20x->regmap;
273 info->regmap_irqc = axp20x->regmap_irqc; 246 info->regmap_irqc = axp20x->regmap_irqc;
274 info->previous_cable = EXTCON_NONE; 247 info->previous_cable = EXTCON_NONE;
275 INIT_DELAYED_WORK(&info->det_work, axp288_extcon_det_work);
276 248
277 platform_set_drvdata(pdev, info); 249 platform_set_drvdata(pdev, info);
278 250
@@ -318,7 +290,7 @@ static int axp288_extcon_probe(struct platform_device *pdev)
318 } 290 }
319 291
320 /* Start charger cable type detection */ 292 /* Start charger cable type detection */
321 queue_delayed_work(system_wq, &info->det_work, 0); 293 axp288_extcon_enable(info);
322 294
323 return 0; 295 return 0;
324} 296}
diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index c8691b5a9cb0..191e99f06a9a 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -153,8 +153,9 @@ static int int3496_probe(struct platform_device *pdev)
153 return ret; 153 return ret;
154 } 154 }
155 155
156 /* queue initial processing of id-pin */ 156 /* process id-pin so that we start with the right status */
157 queue_delayed_work(system_wq, &data->work, 0); 157 queue_delayed_work(system_wq, &data->work, 0);
158 flush_delayed_work(&data->work);
158 159
159 platform_set_drvdata(pdev, data); 160 platform_set_drvdata(pdev, data);
160 161
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 564bb7a31da4..84e5a9df2344 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -241,6 +241,19 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
241 241
242 desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx, 242 desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx,
243 &of_flags); 243 &of_flags);
244 /*
245 * -EPROBE_DEFER in our case means that we found a
246 * valid GPIO property, but no controller has been
247 * registered so far.
248 *
249 * This means we don't need to look any further for
250 * alternate name conventions, and we should really
251 * preserve the return code for our user to be able to
252 * retry probing later.
253 */
254 if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER)
255 return desc;
256
244 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) 257 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
245 break; 258 break;
246 } 259 }
@@ -250,7 +263,7 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
250 desc = of_find_spi_gpio(dev, con_id, &of_flags); 263 desc = of_find_spi_gpio(dev, con_id, &of_flags);
251 264
252 /* Special handling for regulator GPIOs if used */ 265 /* Special handling for regulator GPIOs if used */
253 if (IS_ERR(desc)) 266 if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER)
254 desc = of_find_regulator_gpio(dev, con_id, &of_flags); 267 desc = of_find_regulator_gpio(dev, con_id, &of_flags);
255 268
256 if (IS_ERR(desc)) 269 if (IS_ERR(desc))
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index d5a2eefd6c3e..74edba18b159 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1156,7 +1156,7 @@ static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p,
1156/* 1156/*
1157 * Writeback 1157 * Writeback
1158 */ 1158 */
1159#define AMDGPU_MAX_WB 512 /* Reserve at most 512 WB slots for amdgpu-owned rings. */ 1159#define AMDGPU_MAX_WB 128 /* Reserve at most 128 WB slots for amdgpu-owned rings. */
1160 1160
1161struct amdgpu_wb { 1161struct amdgpu_wb {
1162 struct amdgpu_bo *wb_obj; 1162 struct amdgpu_bo *wb_obj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index e2c3c5ec42d1..c53095b3b0fb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -568,6 +568,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = {
568 /* HG _PR3 doesn't seem to work on this A+A weston board */ 568 /* HG _PR3 doesn't seem to work on this A+A weston board */
569 { 0x1002, 0x6900, 0x1002, 0x0124, AMDGPU_PX_QUIRK_FORCE_ATPX }, 569 { 0x1002, 0x6900, 0x1002, 0x0124, AMDGPU_PX_QUIRK_FORCE_ATPX },
570 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX }, 570 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX },
571 { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX },
571 { 0, 0, 0, 0, 0 }, 572 { 0, 0, 0, 0, 0 },
572}; 573};
573 574
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 8ca3783f2deb..74d2efaec52f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -736,9 +736,11 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
736 enum drm_connector_status ret = connector_status_disconnected; 736 enum drm_connector_status ret = connector_status_disconnected;
737 int r; 737 int r;
738 738
739 r = pm_runtime_get_sync(connector->dev->dev); 739 if (!drm_kms_helper_is_poll_worker()) {
740 if (r < 0) 740 r = pm_runtime_get_sync(connector->dev->dev);
741 return connector_status_disconnected; 741 if (r < 0)
742 return connector_status_disconnected;
743 }
742 744
743 if (encoder) { 745 if (encoder) {
744 struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); 746 struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
@@ -757,8 +759,12 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
757 /* check acpi lid status ??? */ 759 /* check acpi lid status ??? */
758 760
759 amdgpu_connector_update_scratch_regs(connector, ret); 761 amdgpu_connector_update_scratch_regs(connector, ret);
760 pm_runtime_mark_last_busy(connector->dev->dev); 762
761 pm_runtime_put_autosuspend(connector->dev->dev); 763 if (!drm_kms_helper_is_poll_worker()) {
764 pm_runtime_mark_last_busy(connector->dev->dev);
765 pm_runtime_put_autosuspend(connector->dev->dev);
766 }
767
762 return ret; 768 return ret;
763} 769}
764 770
@@ -868,9 +874,11 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
868 enum drm_connector_status ret = connector_status_disconnected; 874 enum drm_connector_status ret = connector_status_disconnected;
869 int r; 875 int r;
870 876
871 r = pm_runtime_get_sync(connector->dev->dev); 877 if (!drm_kms_helper_is_poll_worker()) {
872 if (r < 0) 878 r = pm_runtime_get_sync(connector->dev->dev);
873 return connector_status_disconnected; 879 if (r < 0)
880 return connector_status_disconnected;
881 }
874 882
875 encoder = amdgpu_connector_best_single_encoder(connector); 883 encoder = amdgpu_connector_best_single_encoder(connector);
876 if (!encoder) 884 if (!encoder)
@@ -924,8 +932,10 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
924 amdgpu_connector_update_scratch_regs(connector, ret); 932 amdgpu_connector_update_scratch_regs(connector, ret);
925 933
926out: 934out:
927 pm_runtime_mark_last_busy(connector->dev->dev); 935 if (!drm_kms_helper_is_poll_worker()) {
928 pm_runtime_put_autosuspend(connector->dev->dev); 936 pm_runtime_mark_last_busy(connector->dev->dev);
937 pm_runtime_put_autosuspend(connector->dev->dev);
938 }
929 939
930 return ret; 940 return ret;
931} 941}
@@ -988,9 +998,11 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
988 enum drm_connector_status ret = connector_status_disconnected; 998 enum drm_connector_status ret = connector_status_disconnected;
989 bool dret = false, broken_edid = false; 999 bool dret = false, broken_edid = false;
990 1000
991 r = pm_runtime_get_sync(connector->dev->dev); 1001 if (!drm_kms_helper_is_poll_worker()) {
992 if (r < 0) 1002 r = pm_runtime_get_sync(connector->dev->dev);
993 return connector_status_disconnected; 1003 if (r < 0)
1004 return connector_status_disconnected;
1005 }
994 1006
995 if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) { 1007 if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) {
996 ret = connector->status; 1008 ret = connector->status;
@@ -1115,8 +1127,10 @@ out:
1115 amdgpu_connector_update_scratch_regs(connector, ret); 1127 amdgpu_connector_update_scratch_regs(connector, ret);
1116 1128
1117exit: 1129exit:
1118 pm_runtime_mark_last_busy(connector->dev->dev); 1130 if (!drm_kms_helper_is_poll_worker()) {
1119 pm_runtime_put_autosuspend(connector->dev->dev); 1131 pm_runtime_mark_last_busy(connector->dev->dev);
1132 pm_runtime_put_autosuspend(connector->dev->dev);
1133 }
1120 1134
1121 return ret; 1135 return ret;
1122} 1136}
@@ -1359,9 +1373,11 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
1359 struct drm_encoder *encoder = amdgpu_connector_best_single_encoder(connector); 1373 struct drm_encoder *encoder = amdgpu_connector_best_single_encoder(connector);
1360 int r; 1374 int r;
1361 1375
1362 r = pm_runtime_get_sync(connector->dev->dev); 1376 if (!drm_kms_helper_is_poll_worker()) {
1363 if (r < 0) 1377 r = pm_runtime_get_sync(connector->dev->dev);
1364 return connector_status_disconnected; 1378 if (r < 0)
1379 return connector_status_disconnected;
1380 }
1365 1381
1366 if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) { 1382 if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) {
1367 ret = connector->status; 1383 ret = connector->status;
@@ -1429,8 +1445,10 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
1429 1445
1430 amdgpu_connector_update_scratch_regs(connector, ret); 1446 amdgpu_connector_update_scratch_regs(connector, ret);
1431out: 1447out:
1432 pm_runtime_mark_last_busy(connector->dev->dev); 1448 if (!drm_kms_helper_is_poll_worker()) {
1433 pm_runtime_put_autosuspend(connector->dev->dev); 1449 pm_runtime_mark_last_busy(connector->dev->dev);
1450 pm_runtime_put_autosuspend(connector->dev->dev);
1451 }
1434 1452
1435 return ret; 1453 return ret;
1436} 1454}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 00a50cc5ec9a..af1b879a9ee9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -492,7 +492,7 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev)
492 memset(&adev->wb.used, 0, sizeof(adev->wb.used)); 492 memset(&adev->wb.used, 0, sizeof(adev->wb.used));
493 493
494 /* clear wb memory */ 494 /* clear wb memory */
495 memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t)); 495 memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t) * 8);
496 } 496 }
497 497
498 return 0; 498 return 0;
@@ -530,8 +530,9 @@ int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb)
530 */ 530 */
531void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb) 531void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb)
532{ 532{
533 wb >>= 3;
533 if (wb < adev->wb.num_wb) 534 if (wb < adev->wb.num_wb)
534 __clear_bit(wb >> 3, adev->wb.used); 535 __clear_bit(wb, adev->wb.used);
535} 536}
536 537
537/** 538/**
@@ -1455,11 +1456,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1455 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 1456 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
1456 if (!adev->ip_blocks[i].status.hw) 1457 if (!adev->ip_blocks[i].status.hw)
1457 continue; 1458 continue;
1458 if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
1459 amdgpu_free_static_csa(adev);
1460 amdgpu_device_wb_fini(adev);
1461 amdgpu_device_vram_scratch_fini(adev);
1462 }
1463 1459
1464 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && 1460 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
1465 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { 1461 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
@@ -1486,6 +1482,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1486 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 1482 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
1487 if (!adev->ip_blocks[i].status.sw) 1483 if (!adev->ip_blocks[i].status.sw)
1488 continue; 1484 continue;
1485
1486 if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
1487 amdgpu_free_static_csa(adev);
1488 amdgpu_device_wb_fini(adev);
1489 amdgpu_device_vram_scratch_fini(adev);
1490 }
1491
1489 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); 1492 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev);
1490 /* XXX handle errors */ 1493 /* XXX handle errors */
1491 if (r) { 1494 if (r) {
@@ -2284,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
2284 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 2287 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
2285 } 2288 }
2286 drm_modeset_unlock_all(dev); 2289 drm_modeset_unlock_all(dev);
2287 } else {
2288 /*
2289 * There is no equivalent atomic helper to turn on
2290 * display, so we defined our own function for this,
2291 * once suspend resume is supported by the atomic
2292 * framework this will be reworked
2293 */
2294 amdgpu_dm_display_resume(adev);
2295 } 2290 }
2296 } 2291 }
2297 2292
@@ -2726,7 +2721,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
2726 if (amdgpu_device_has_dc_support(adev)) { 2721 if (amdgpu_device_has_dc_support(adev)) {
2727 if (drm_atomic_helper_resume(adev->ddev, state)) 2722 if (drm_atomic_helper_resume(adev->ddev, state))
2728 dev_info(adev->dev, "drm resume failed:%d\n", r); 2723 dev_info(adev->dev, "drm resume failed:%d\n", r);
2729 amdgpu_dm_display_resume(adev);
2730 } else { 2724 } else {
2731 drm_helper_resume_force_mode(adev->ddev); 2725 drm_helper_resume_force_mode(adev->ddev);
2732 } 2726 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
index e14ab34d8262..7c2be32c5aea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
@@ -75,7 +75,7 @@ static int amdgpu_gtt_mgr_init(struct ttm_mem_type_manager *man,
75static int amdgpu_gtt_mgr_fini(struct ttm_mem_type_manager *man) 75static int amdgpu_gtt_mgr_fini(struct ttm_mem_type_manager *man)
76{ 76{
77 struct amdgpu_gtt_mgr *mgr = man->priv; 77 struct amdgpu_gtt_mgr *mgr = man->priv;
78 78 spin_lock(&mgr->lock);
79 drm_mm_takedown(&mgr->mm); 79 drm_mm_takedown(&mgr->mm);
80 spin_unlock(&mgr->lock); 80 spin_unlock(&mgr->lock);
81 kfree(mgr); 81 kfree(mgr);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 56bcd59c3399..36483e0d3c97 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -257,7 +257,8 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
257 r = drm_irq_install(adev->ddev, adev->ddev->pdev->irq); 257 r = drm_irq_install(adev->ddev, adev->ddev->pdev->irq);
258 if (r) { 258 if (r) {
259 adev->irq.installed = false; 259 adev->irq.installed = false;
260 flush_work(&adev->hotplug_work); 260 if (!amdgpu_device_has_dc_support(adev))
261 flush_work(&adev->hotplug_work);
261 cancel_work_sync(&adev->reset_work); 262 cancel_work_sync(&adev->reset_work);
262 return r; 263 return r;
263 } 264 }
@@ -282,7 +283,8 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
282 adev->irq.installed = false; 283 adev->irq.installed = false;
283 if (adev->irq.msi_enabled) 284 if (adev->irq.msi_enabled)
284 pci_disable_msi(adev->pdev); 285 pci_disable_msi(adev->pdev);
285 flush_work(&adev->hotplug_work); 286 if (!amdgpu_device_has_dc_support(adev))
287 flush_work(&adev->hotplug_work);
286 cancel_work_sync(&adev->reset_work); 288 cancel_work_sync(&adev->reset_work);
287 } 289 }
288 290
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 2719937e09d6..3b7e7af09ead 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -634,7 +634,7 @@ static int gmc_v9_0_late_init(void *handle)
634 for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i) 634 for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i)
635 BUG_ON(vm_inv_eng[i] > 16); 635 BUG_ON(vm_inv_eng[i] > 16);
636 636
637 if (adev->asic_type == CHIP_VEGA10) { 637 if (adev->asic_type == CHIP_VEGA10 && !amdgpu_sriov_vf(adev)) {
638 r = gmc_v9_0_ecc_available(adev); 638 r = gmc_v9_0_ecc_available(adev);
639 if (r == 1) { 639 if (r == 1) {
640 DRM_INFO("ECC is active.\n"); 640 DRM_INFO("ECC is active.\n");
@@ -682,7 +682,10 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
682 adev->mc.vram_width = amdgpu_atomfirmware_get_vram_width(adev); 682 adev->mc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
683 if (!adev->mc.vram_width) { 683 if (!adev->mc.vram_width) {
684 /* hbm memory channel size */ 684 /* hbm memory channel size */
685 chansize = 128; 685 if (adev->flags & AMD_IS_APU)
686 chansize = 64;
687 else
688 chansize = 128;
686 689
687 tmp = RREG32_SOC15(DF, 0, mmDF_CS_AON0_DramBaseAddress0); 690 tmp = RREG32_SOC15(DF, 0, mmDF_CS_AON0_DramBaseAddress0);
688 tmp &= DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK; 691 tmp &= DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index e92fb372bc99..91cf95a8c39c 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -238,31 +238,27 @@ static uint64_t sdma_v4_0_ring_get_rptr(struct amdgpu_ring *ring)
238static uint64_t sdma_v4_0_ring_get_wptr(struct amdgpu_ring *ring) 238static uint64_t sdma_v4_0_ring_get_wptr(struct amdgpu_ring *ring)
239{ 239{
240 struct amdgpu_device *adev = ring->adev; 240 struct amdgpu_device *adev = ring->adev;
241 u64 *wptr = NULL; 241 u64 wptr;
242 uint64_t local_wptr = 0;
243 242
244 if (ring->use_doorbell) { 243 if (ring->use_doorbell) {
245 /* XXX check if swapping is necessary on BE */ 244 /* XXX check if swapping is necessary on BE */
246 wptr = ((u64 *)&adev->wb.wb[ring->wptr_offs]); 245 wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs]));
247 DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", *wptr); 246 DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr);
248 *wptr = (*wptr) >> 2;
249 DRM_DEBUG("wptr/doorbell after shift == 0x%016llx\n", *wptr);
250 } else { 247 } else {
251 u32 lowbit, highbit; 248 u32 lowbit, highbit;
252 int me = (ring == &adev->sdma.instance[0].ring) ? 0 : 1; 249 int me = (ring == &adev->sdma.instance[0].ring) ? 0 : 1;
253 250
254 wptr = &local_wptr;
255 lowbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR)) >> 2; 251 lowbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR)) >> 2;
256 highbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2; 252 highbit = RREG32(sdma_v4_0_get_reg_offset(adev, me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2;
257 253
258 DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n", 254 DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n",
259 me, highbit, lowbit); 255 me, highbit, lowbit);
260 *wptr = highbit; 256 wptr = highbit;
261 *wptr = (*wptr) << 32; 257 wptr = wptr << 32;
262 *wptr |= lowbit; 258 wptr |= lowbit;
263 } 259 }
264 260
265 return *wptr; 261 return wptr >> 2;
266} 262}
267 263
268/** 264/**
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index b2bfedaf57f1..9bab4842cd44 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -1618,7 +1618,7 @@ static const struct amdgpu_ring_funcs uvd_v6_0_enc_ring_vm_funcs = {
1618 .set_wptr = uvd_v6_0_enc_ring_set_wptr, 1618 .set_wptr = uvd_v6_0_enc_ring_set_wptr,
1619 .emit_frame_size = 1619 .emit_frame_size =
1620 4 + /* uvd_v6_0_enc_ring_emit_pipeline_sync */ 1620 4 + /* uvd_v6_0_enc_ring_emit_pipeline_sync */
1621 6 + /* uvd_v6_0_enc_ring_emit_vm_flush */ 1621 5 + /* uvd_v6_0_enc_ring_emit_vm_flush */
1622 5 + 5 + /* uvd_v6_0_enc_ring_emit_fence x2 vm fence */ 1622 5 + 5 + /* uvd_v6_0_enc_ring_emit_fence x2 vm fence */
1623 1, /* uvd_v6_0_enc_ring_insert_end */ 1623 1, /* uvd_v6_0_enc_ring_insert_end */
1624 .emit_ib_size = 5, /* uvd_v6_0_enc_ring_emit_ib */ 1624 .emit_ib_size = 5, /* uvd_v6_0_enc_ring_emit_ib */
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 1ce4c98385e3..862835dc054e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -629,11 +629,13 @@ static int dm_resume(void *handle)
629{ 629{
630 struct amdgpu_device *adev = handle; 630 struct amdgpu_device *adev = handle;
631 struct amdgpu_display_manager *dm = &adev->dm; 631 struct amdgpu_display_manager *dm = &adev->dm;
632 int ret = 0;
632 633
633 /* power on hardware */ 634 /* power on hardware */
634 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); 635 dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
635 636
636 return 0; 637 ret = amdgpu_dm_display_resume(adev);
638 return ret;
637} 639}
638 640
639int amdgpu_dm_display_resume(struct amdgpu_device *adev) 641int amdgpu_dm_display_resume(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 61e8c3e02d16..639421a00ab6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -718,7 +718,7 @@ static enum link_training_result perform_channel_equalization_sequence(
718 uint32_t retries_ch_eq; 718 uint32_t retries_ch_eq;
719 enum dc_lane_count lane_count = lt_settings->link_settings.lane_count; 719 enum dc_lane_count lane_count = lt_settings->link_settings.lane_count;
720 union lane_align_status_updated dpcd_lane_status_updated = {{0}}; 720 union lane_align_status_updated dpcd_lane_status_updated = {{0}};
721 union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX] = {{{0}}};; 721 union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX] = {{{0}}};
722 722
723 hw_tr_pattern = get_supported_tp(link); 723 hw_tr_pattern = get_supported_tp(link);
724 724
@@ -1465,7 +1465,7 @@ void decide_link_settings(struct dc_stream_state *stream,
1465 /* MST doesn't perform link training for now 1465 /* MST doesn't perform link training for now
1466 * TODO: add MST specific link training routine 1466 * TODO: add MST specific link training routine
1467 */ 1467 */
1468 if (is_mst_supported(link)) { 1468 if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
1469 *link_setting = link->verified_link_cap; 1469 *link_setting = link->verified_link_cap;
1470 return; 1470 return;
1471 } 1471 }
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 261811e0c094..539c3e0a6292 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -197,7 +197,8 @@ bool dc_stream_set_cursor_attributes(
197 for (i = 0; i < MAX_PIPES; i++) { 197 for (i = 0; i < MAX_PIPES; i++) {
198 struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; 198 struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
199 199
200 if (pipe_ctx->stream != stream || (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp)) 200 if (pipe_ctx->stream != stream || (!pipe_ctx->plane_res.xfm &&
201 !pipe_ctx->plane_res.dpp) || !pipe_ctx->plane_res.ipp)
201 continue; 202 continue;
202 if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state) 203 if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)
203 continue; 204 continue;
@@ -273,7 +274,8 @@ bool dc_stream_set_cursor_position(
273 if (pipe_ctx->stream != stream || 274 if (pipe_ctx->stream != stream ||
274 (!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) || 275 (!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) ||
275 !pipe_ctx->plane_state || 276 !pipe_ctx->plane_state ||
276 (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp)) 277 (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp) ||
278 !pipe_ctx->plane_res.ipp)
277 continue; 279 continue;
278 280
279 if (pipe_ctx->plane_state->address.type 281 if (pipe_ctx->plane_state->address.type
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 4c3223a4d62b..adb6e7b9280c 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -162,7 +162,7 @@ static int pp_hw_init(void *handle)
162 if(hwmgr->smumgr_funcs->start_smu(pp_handle->hwmgr)) { 162 if(hwmgr->smumgr_funcs->start_smu(pp_handle->hwmgr)) {
163 pr_err("smc start failed\n"); 163 pr_err("smc start failed\n");
164 hwmgr->smumgr_funcs->smu_fini(pp_handle->hwmgr); 164 hwmgr->smumgr_funcs->smu_fini(pp_handle->hwmgr);
165 return -EINVAL;; 165 return -EINVAL;
166 } 166 }
167 if (ret == PP_DPM_DISABLED) 167 if (ret == PP_DPM_DISABLED)
168 goto exit; 168 goto exit;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 41e42beff213..08e8a793714f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -2756,10 +2756,13 @@ static int smu7_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
2756 PHM_PlatformCaps_DisableMclkSwitchingForFrameLock); 2756 PHM_PlatformCaps_DisableMclkSwitchingForFrameLock);
2757 2757
2758 2758
2759 disable_mclk_switching = ((1 < info.display_count) || 2759 if (info.display_count == 0)
2760 disable_mclk_switching_for_frame_lock || 2760 disable_mclk_switching = false;
2761 smu7_vblank_too_short(hwmgr, mode_info.vblank_time_us) || 2761 else
2762 (mode_info.refresh_rate > 120)); 2762 disable_mclk_switching = ((1 < info.display_count) ||
2763 disable_mclk_switching_for_frame_lock ||
2764 smu7_vblank_too_short(hwmgr, mode_info.vblank_time_us) ||
2765 (mode_info.refresh_rate > 120));
2763 2766
2764 sclk = smu7_ps->performance_levels[0].engine_clock; 2767 sclk = smu7_ps->performance_levels[0].engine_clock;
2765 mclk = smu7_ps->performance_levels[0].memory_clock; 2768 mclk = smu7_ps->performance_levels[0].memory_clock;
@@ -4534,13 +4537,6 @@ static int smu7_set_power_profile_state(struct pp_hwmgr *hwmgr,
4534 int tmp_result, result = 0; 4537 int tmp_result, result = 0;
4535 uint32_t sclk_mask = 0, mclk_mask = 0; 4538 uint32_t sclk_mask = 0, mclk_mask = 0;
4536 4539
4537 if (hwmgr->chip_id == CHIP_FIJI) {
4538 if (request->type == AMD_PP_GFX_PROFILE)
4539 smu7_enable_power_containment(hwmgr);
4540 else if (request->type == AMD_PP_COMPUTE_PROFILE)
4541 smu7_disable_power_containment(hwmgr);
4542 }
4543
4544 if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_AUTO) 4540 if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_AUTO)
4545 return -EINVAL; 4541 return -EINVAL;
4546 4542
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 2d55dabc77d4..5f9c3efb532f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -3168,10 +3168,13 @@ static int vega10_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
3168 disable_mclk_switching_for_vr = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchForVR); 3168 disable_mclk_switching_for_vr = PP_CAP(PHM_PlatformCaps_DisableMclkSwitchForVR);
3169 force_mclk_high = PP_CAP(PHM_PlatformCaps_ForceMclkHigh); 3169 force_mclk_high = PP_CAP(PHM_PlatformCaps_ForceMclkHigh);
3170 3170
3171 disable_mclk_switching = (info.display_count > 1) || 3171 if (info.display_count == 0)
3172 disable_mclk_switching_for_frame_lock || 3172 disable_mclk_switching = false;
3173 disable_mclk_switching_for_vr || 3173 else
3174 force_mclk_high; 3174 disable_mclk_switching = (info.display_count > 1) ||
3175 disable_mclk_switching_for_frame_lock ||
3176 disable_mclk_switching_for_vr ||
3177 force_mclk_high;
3175 3178
3176 sclk = vega10_ps->performance_levels[0].gfx_clock; 3179 sclk = vega10_ps->performance_levels[0].gfx_clock;
3177 mclk = vega10_ps->performance_levels[0].mem_clock; 3180 mclk = vega10_ps->performance_levels[0].mem_clock;
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index cd23b1b28259..c91b9b054e3f 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -294,22 +294,7 @@ static void cirrus_crtc_prepare(struct drm_crtc *crtc)
294{ 294{
295} 295}
296 296
297/* 297static void cirrus_crtc_load_lut(struct drm_crtc *crtc)
298 * This is called after a mode is programmed. It should reverse anything done
299 * by the prepare function
300 */
301static void cirrus_crtc_commit(struct drm_crtc *crtc)
302{
303}
304
305/*
306 * The core can pass us a set of gamma values to program. We actually only
307 * use this for 8-bit mode so can't perform smooth fades on deeper modes,
308 * but it's a requirement that we provide the function
309 */
310static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
311 u16 *blue, uint32_t size,
312 struct drm_modeset_acquire_ctx *ctx)
313{ 298{
314 struct drm_device *dev = crtc->dev; 299 struct drm_device *dev = crtc->dev;
315 struct cirrus_device *cdev = dev->dev_private; 300 struct cirrus_device *cdev = dev->dev_private;
@@ -317,7 +302,7 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
317 int i; 302 int i;
318 303
319 if (!crtc->enabled) 304 if (!crtc->enabled)
320 return 0; 305 return;
321 306
322 r = crtc->gamma_store; 307 r = crtc->gamma_store;
323 g = r + crtc->gamma_size; 308 g = r + crtc->gamma_size;
@@ -330,6 +315,27 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
330 WREG8(PALETTE_DATA, *g++ >> 8); 315 WREG8(PALETTE_DATA, *g++ >> 8);
331 WREG8(PALETTE_DATA, *b++ >> 8); 316 WREG8(PALETTE_DATA, *b++ >> 8);
332 } 317 }
318}
319
320/*
321 * This is called after a mode is programmed. It should reverse anything done
322 * by the prepare function
323 */
324static void cirrus_crtc_commit(struct drm_crtc *crtc)
325{
326 cirrus_crtc_load_lut(crtc);
327}
328
329/*
330 * The core can pass us a set of gamma values to program. We actually only
331 * use this for 8-bit mode so can't perform smooth fades on deeper modes,
332 * but it's a requirement that we provide the function
333 */
334static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
335 u16 *blue, uint32_t size,
336 struct drm_modeset_acquire_ctx *ctx)
337{
338 cirrus_crtc_load_lut(crtc);
333 339
334 return 0; 340 return 0;
335} 341}
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ab4032167094..ae3cbfe9e01c 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1878,6 +1878,8 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
1878 new_crtc_state->event->base.completion = &commit->flip_done; 1878 new_crtc_state->event->base.completion = &commit->flip_done;
1879 new_crtc_state->event->base.completion_release = release_crtc_commit; 1879 new_crtc_state->event->base.completion_release = release_crtc_commit;
1880 drm_crtc_commit_get(commit); 1880 drm_crtc_commit_get(commit);
1881
1882 commit->abort_completion = true;
1881 } 1883 }
1882 1884
1883 for_each_oldnew_connector_in_state(state, conn, old_conn_state, new_conn_state, i) { 1885 for_each_oldnew_connector_in_state(state, conn, old_conn_state, new_conn_state, i) {
@@ -3421,8 +3423,21 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
3421void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state) 3423void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state)
3422{ 3424{
3423 if (state->commit) { 3425 if (state->commit) {
3426 /*
3427 * In the event that a non-blocking commit returns
3428 * -ERESTARTSYS before the commit_tail work is queued, we will
3429 * have an extra reference to the commit object. Release it, if
3430 * the event has not been consumed by the worker.
3431 *
3432 * state->event may be freed, so we can't directly look at
3433 * state->event->base.completion.
3434 */
3435 if (state->event && state->commit->abort_completion)
3436 drm_crtc_commit_put(state->commit);
3437
3424 kfree(state->commit->event); 3438 kfree(state->commit->event);
3425 state->commit->event = NULL; 3439 state->commit->event = NULL;
3440
3426 drm_crtc_commit_put(state->commit); 3441 drm_crtc_commit_put(state->commit);
3427 } 3442 }
3428 3443
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index ddd537914575..4f751a9d71a3 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -113,6 +113,9 @@ static const struct edid_quirk {
113 /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */ 113 /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
114 { "AEO", 0, EDID_QUIRK_FORCE_6BPC }, 114 { "AEO", 0, EDID_QUIRK_FORCE_6BPC },
115 115
116 /* CPT panel of Asus UX303LA reports 8 bpc, but is a 6 bpc panel */
117 { "CPT", 0x17df, EDID_QUIRK_FORCE_6BPC },
118
116 /* Belinea 10 15 55 */ 119 /* Belinea 10 15 55 */
117 { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 }, 120 { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 },
118 { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 }, 121 { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
@@ -162,6 +165,24 @@ static const struct edid_quirk {
162 165
163 /* HTC Vive VR Headset */ 166 /* HTC Vive VR Headset */
164 { "HVR", 0xaa01, EDID_QUIRK_NON_DESKTOP }, 167 { "HVR", 0xaa01, EDID_QUIRK_NON_DESKTOP },
168
169 /* Oculus Rift DK1, DK2, and CV1 VR Headsets */
170 { "OVR", 0x0001, EDID_QUIRK_NON_DESKTOP },
171 { "OVR", 0x0003, EDID_QUIRK_NON_DESKTOP },
172 { "OVR", 0x0004, EDID_QUIRK_NON_DESKTOP },
173
174 /* Windows Mixed Reality Headsets */
175 { "ACR", 0x7fce, EDID_QUIRK_NON_DESKTOP },
176 { "HPN", 0x3515, EDID_QUIRK_NON_DESKTOP },
177 { "LEN", 0x0408, EDID_QUIRK_NON_DESKTOP },
178 { "LEN", 0xb800, EDID_QUIRK_NON_DESKTOP },
179 { "FUJ", 0x1970, EDID_QUIRK_NON_DESKTOP },
180 { "DEL", 0x7fce, EDID_QUIRK_NON_DESKTOP },
181 { "SEC", 0x144a, EDID_QUIRK_NON_DESKTOP },
182 { "AUS", 0xc102, EDID_QUIRK_NON_DESKTOP },
183
184 /* Sony PlayStation VR Headset */
185 { "SNY", 0x0704, EDID_QUIRK_NON_DESKTOP },
165}; 186};
166 187
167/* 188/*
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 5a13ff29f4f0..c0530a1af5e3 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -121,6 +121,10 @@ int drm_mode_addfb(struct drm_device *dev,
121 r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth); 121 r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
122 r.handles[0] = or->handle; 122 r.handles[0] = or->handle;
123 123
124 if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
125 dev->driver->driver_features & DRIVER_PREFER_XBGR_30BPP)
126 r.pixel_format = DRM_FORMAT_XBGR2101010;
127
124 ret = drm_mode_addfb2(dev, &r, file_priv); 128 ret = drm_mode_addfb2(dev, &r, file_priv);
125 if (ret) 129 if (ret)
126 return ret; 130 return ret;
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 186c4e90cc1c..89eef1bb4ddc 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -836,9 +836,24 @@ struct drm_mm_node *drm_mm_scan_color_evict(struct drm_mm_scan *scan)
836 if (!mm->color_adjust) 836 if (!mm->color_adjust)
837 return NULL; 837 return NULL;
838 838
839 hole = list_first_entry(&mm->hole_stack, typeof(*hole), hole_stack); 839 /*
840 hole_start = __drm_mm_hole_node_start(hole); 840 * The hole found during scanning should ideally be the first element
841 hole_end = hole_start + hole->hole_size; 841 * in the hole_stack list, but due to side-effects in the driver it
842 * may not be.
843 */
844 list_for_each_entry(hole, &mm->hole_stack, hole_stack) {
845 hole_start = __drm_mm_hole_node_start(hole);
846 hole_end = hole_start + hole->hole_size;
847
848 if (hole_start <= scan->hit_start &&
849 hole_end >= scan->hit_end)
850 break;
851 }
852
853 /* We should only be called after we found the hole previously */
854 DRM_MM_BUG_ON(&hole->hole_stack == &mm->hole_stack);
855 if (unlikely(&hole->hole_stack == &mm->hole_stack))
856 return NULL;
842 857
843 DRM_MM_BUG_ON(hole_start > scan->hit_start); 858 DRM_MM_BUG_ON(hole_start > scan->hit_start);
844 DRM_MM_BUG_ON(hole_end < scan->hit_end); 859 DRM_MM_BUG_ON(hole_end < scan->hit_end);
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 555fbe54d6e2..00b8445ba819 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -654,6 +654,26 @@ out:
654} 654}
655 655
656/** 656/**
657 * drm_kms_helper_is_poll_worker - is %current task an output poll worker?
658 *
659 * Determine if %current task is an output poll worker. This can be used
660 * to select distinct code paths for output polling versus other contexts.
661 *
662 * One use case is to avoid a deadlock between the output poll worker and
663 * the autosuspend worker wherein the latter waits for polling to finish
664 * upon calling drm_kms_helper_poll_disable(), while the former waits for
665 * runtime suspend to finish upon calling pm_runtime_get_sync() in a
666 * connector ->detect hook.
667 */
668bool drm_kms_helper_is_poll_worker(void)
669{
670 struct work_struct *work = current_work();
671
672 return work && work->func == output_poll_execute;
673}
674EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
675
676/**
657 * drm_kms_helper_poll_disable - disable output polling 677 * drm_kms_helper_poll_disable - disable output polling
658 * @dev: drm_device 678 * @dev: drm_device
659 * 679 *
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 2b8bf2dd6387..f68ef1b3a28c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -286,7 +286,6 @@ static int g2d_init_cmdlist(struct g2d_data *g2d)
286 286
287 node = kcalloc(G2D_CMDLIST_NUM, sizeof(*node), GFP_KERNEL); 287 node = kcalloc(G2D_CMDLIST_NUM, sizeof(*node), GFP_KERNEL);
288 if (!node) { 288 if (!node) {
289 dev_err(dev, "failed to allocate memory\n");
290 ret = -ENOMEM; 289 ret = -ENOMEM;
291 goto err; 290 goto err;
292 } 291 }
@@ -926,7 +925,7 @@ static void g2d_finish_event(struct g2d_data *g2d, u32 cmdlist_no)
926 struct drm_device *drm_dev = g2d->subdrv.drm_dev; 925 struct drm_device *drm_dev = g2d->subdrv.drm_dev;
927 struct g2d_runqueue_node *runqueue_node = g2d->runqueue_node; 926 struct g2d_runqueue_node *runqueue_node = g2d->runqueue_node;
928 struct drm_exynos_pending_g2d_event *e; 927 struct drm_exynos_pending_g2d_event *e;
929 struct timeval now; 928 struct timespec64 now;
930 929
931 if (list_empty(&runqueue_node->event_list)) 930 if (list_empty(&runqueue_node->event_list))
932 return; 931 return;
@@ -934,9 +933,9 @@ static void g2d_finish_event(struct g2d_data *g2d, u32 cmdlist_no)
934 e = list_first_entry(&runqueue_node->event_list, 933 e = list_first_entry(&runqueue_node->event_list,
935 struct drm_exynos_pending_g2d_event, base.link); 934 struct drm_exynos_pending_g2d_event, base.link);
936 935
937 do_gettimeofday(&now); 936 ktime_get_ts64(&now);
938 e->event.tv_sec = now.tv_sec; 937 e->event.tv_sec = now.tv_sec;
939 e->event.tv_usec = now.tv_usec; 938 e->event.tv_usec = now.tv_nsec / NSEC_PER_USEC;
940 e->event.cmdlist_no = cmdlist_no; 939 e->event.cmdlist_no = cmdlist_no;
941 940
942 drm_send_event(drm_dev, &e->base); 941 drm_send_event(drm_dev, &e->base);
@@ -1358,10 +1357,9 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
1358 return -EFAULT; 1357 return -EFAULT;
1359 1358
1360 runqueue_node = kmem_cache_alloc(g2d->runqueue_slab, GFP_KERNEL); 1359 runqueue_node = kmem_cache_alloc(g2d->runqueue_slab, GFP_KERNEL);
1361 if (!runqueue_node) { 1360 if (!runqueue_node)
1362 dev_err(dev, "failed to allocate memory\n");
1363 return -ENOMEM; 1361 return -ENOMEM;
1364 } 1362
1365 run_cmdlist = &runqueue_node->run_cmdlist; 1363 run_cmdlist = &runqueue_node->run_cmdlist;
1366 event_list = &runqueue_node->event_list; 1364 event_list = &runqueue_node->event_list;
1367 INIT_LIST_HEAD(run_cmdlist); 1365 INIT_LIST_HEAD(run_cmdlist);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.h b/drivers/gpu/drm/exynos/exynos_drm_rotator.h
deleted file mode 100644
index 71a0b4c0c1e8..000000000000
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 *
4 * Authors:
5 * YoungJun Cho <yj44.cho@samsung.com>
6 * Eunchul Kim <chulspro.kim@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifndef _EXYNOS_DRM_ROTATOR_H_
15#define _EXYNOS_DRM_ROTATOR_H_
16
17/* TODO */
18
19#endif
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index a4b75a46f946..abd84cbcf1c2 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1068,10 +1068,13 @@ static void hdmi_audio_config(struct hdmi_context *hdata)
1068 /* Configuration I2S input ports. Configure I2S_PIN_SEL_0~4 */ 1068 /* Configuration I2S input ports. Configure I2S_PIN_SEL_0~4 */
1069 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_0, HDMI_I2S_SEL_SCLK(5) 1069 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_0, HDMI_I2S_SEL_SCLK(5)
1070 | HDMI_I2S_SEL_LRCK(6)); 1070 | HDMI_I2S_SEL_LRCK(6));
1071 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_1, HDMI_I2S_SEL_SDATA1(1) 1071
1072 | HDMI_I2S_SEL_SDATA2(4)); 1072 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_1, HDMI_I2S_SEL_SDATA1(3)
1073 | HDMI_I2S_SEL_SDATA0(4));
1074
1073 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_2, HDMI_I2S_SEL_SDATA3(1) 1075 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_2, HDMI_I2S_SEL_SDATA3(1)
1074 | HDMI_I2S_SEL_SDATA2(2)); 1076 | HDMI_I2S_SEL_SDATA2(2));
1077
1075 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_3, HDMI_I2S_SEL_DSD(0)); 1078 hdmi_reg_writeb(hdata, HDMI_I2S_PIN_SEL_3, HDMI_I2S_SEL_DSD(0));
1076 1079
1077 /* I2S_CON_1 & 2 */ 1080 /* I2S_CON_1 & 2 */
diff --git a/drivers/gpu/drm/exynos/regs-fimc.h b/drivers/gpu/drm/exynos/regs-fimc.h
index 30496134a3d0..d7cbe53c4c01 100644
--- a/drivers/gpu/drm/exynos/regs-fimc.h
+++ b/drivers/gpu/drm/exynos/regs-fimc.h
@@ -569,7 +569,7 @@
569#define EXYNOS_CIIMGEFF_FIN_EMBOSSING (4 << 26) 569#define EXYNOS_CIIMGEFF_FIN_EMBOSSING (4 << 26)
570#define EXYNOS_CIIMGEFF_FIN_SILHOUETTE (5 << 26) 570#define EXYNOS_CIIMGEFF_FIN_SILHOUETTE (5 << 26)
571#define EXYNOS_CIIMGEFF_FIN_MASK (7 << 26) 571#define EXYNOS_CIIMGEFF_FIN_MASK (7 << 26)
572#define EXYNOS_CIIMGEFF_PAT_CBCR_MASK ((0xff < 13) | (0xff < 0)) 572#define EXYNOS_CIIMGEFF_PAT_CBCR_MASK ((0xff << 13) | (0xff << 0))
573 573
574/* Real input DMA size register */ 574/* Real input DMA size register */
575#define EXYNOS_CIREAL_ISIZE_AUTOLOAD_ENABLE (1 << 31) 575#define EXYNOS_CIREAL_ISIZE_AUTOLOAD_ENABLE (1 << 31)
diff --git a/drivers/gpu/drm/exynos/regs-hdmi.h b/drivers/gpu/drm/exynos/regs-hdmi.h
index 04be0f7e8193..4420c203ac85 100644
--- a/drivers/gpu/drm/exynos/regs-hdmi.h
+++ b/drivers/gpu/drm/exynos/regs-hdmi.h
@@ -464,7 +464,7 @@
464 464
465/* I2S_PIN_SEL_1 */ 465/* I2S_PIN_SEL_1 */
466#define HDMI_I2S_SEL_SDATA1(x) (((x) & 0x7) << 4) 466#define HDMI_I2S_SEL_SDATA1(x) (((x) & 0x7) << 4)
467#define HDMI_I2S_SEL_SDATA2(x) ((x) & 0x7) 467#define HDMI_I2S_SEL_SDATA0(x) ((x) & 0x7)
468 468
469/* I2S_PIN_SEL_2 */ 469/* I2S_PIN_SEL_2 */
470#define HDMI_I2S_SEL_SDATA3(x) (((x) & 0x7) << 4) 470#define HDMI_I2S_SEL_SDATA3(x) (((x) & 0x7) << 4)
diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index 909499b73d03..021f722e2481 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -733,6 +733,25 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
733 return ret == 0 ? count : ret; 733 return ret == 0 ? count : ret;
734} 734}
735 735
736static bool gtt_entry(struct mdev_device *mdev, loff_t *ppos)
737{
738 struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
739 unsigned int index = VFIO_PCI_OFFSET_TO_INDEX(*ppos);
740 struct intel_gvt *gvt = vgpu->gvt;
741 int offset;
742
743 /* Only allow MMIO GGTT entry access */
744 if (index != PCI_BASE_ADDRESS_0)
745 return false;
746
747 offset = (u64)(*ppos & VFIO_PCI_OFFSET_MASK) -
748 intel_vgpu_get_bar_gpa(vgpu, PCI_BASE_ADDRESS_0);
749
750 return (offset >= gvt->device_info.gtt_start_offset &&
751 offset < gvt->device_info.gtt_start_offset + gvt_ggtt_sz(gvt)) ?
752 true : false;
753}
754
736static ssize_t intel_vgpu_read(struct mdev_device *mdev, char __user *buf, 755static ssize_t intel_vgpu_read(struct mdev_device *mdev, char __user *buf,
737 size_t count, loff_t *ppos) 756 size_t count, loff_t *ppos)
738{ 757{
@@ -742,7 +761,21 @@ static ssize_t intel_vgpu_read(struct mdev_device *mdev, char __user *buf,
742 while (count) { 761 while (count) {
743 size_t filled; 762 size_t filled;
744 763
745 if (count >= 4 && !(*ppos % 4)) { 764 /* Only support GGTT entry 8 bytes read */
765 if (count >= 8 && !(*ppos % 8) &&
766 gtt_entry(mdev, ppos)) {
767 u64 val;
768
769 ret = intel_vgpu_rw(mdev, (char *)&val, sizeof(val),
770 ppos, false);
771 if (ret <= 0)
772 goto read_err;
773
774 if (copy_to_user(buf, &val, sizeof(val)))
775 goto read_err;
776
777 filled = 8;
778 } else if (count >= 4 && !(*ppos % 4)) {
746 u32 val; 779 u32 val;
747 780
748 ret = intel_vgpu_rw(mdev, (char *)&val, sizeof(val), 781 ret = intel_vgpu_rw(mdev, (char *)&val, sizeof(val),
@@ -802,7 +835,21 @@ static ssize_t intel_vgpu_write(struct mdev_device *mdev,
802 while (count) { 835 while (count) {
803 size_t filled; 836 size_t filled;
804 837
805 if (count >= 4 && !(*ppos % 4)) { 838 /* Only support GGTT entry 8 bytes write */
839 if (count >= 8 && !(*ppos % 8) &&
840 gtt_entry(mdev, ppos)) {
841 u64 val;
842
843 if (copy_from_user(&val, buf, sizeof(val)))
844 goto write_err;
845
846 ret = intel_vgpu_rw(mdev, (char *)&val, sizeof(val),
847 ppos, true);
848 if (ret <= 0)
849 goto write_err;
850
851 filled = 8;
852 } else if (count >= 4 && !(*ppos % 4)) {
806 u32 val; 853 u32 val;
807 854
808 if (copy_from_user(&val, buf, sizeof(val))) 855 if (copy_from_user(&val, buf, sizeof(val)))
diff --git a/drivers/gpu/drm/i915/gvt/mmio_context.c b/drivers/gpu/drm/i915/gvt/mmio_context.c
index 73ad6e90e49d..256f1bb522b7 100644
--- a/drivers/gpu/drm/i915/gvt/mmio_context.c
+++ b/drivers/gpu/drm/i915/gvt/mmio_context.c
@@ -118,6 +118,7 @@ static struct engine_mmio gen9_engine_mmio_list[] __cacheline_aligned = {
118 {RCS, HALF_SLICE_CHICKEN3, 0xffff, true}, /* 0xe184 */ 118 {RCS, HALF_SLICE_CHICKEN3, 0xffff, true}, /* 0xe184 */
119 {RCS, GEN9_HALF_SLICE_CHICKEN5, 0xffff, true}, /* 0xe188 */ 119 {RCS, GEN9_HALF_SLICE_CHICKEN5, 0xffff, true}, /* 0xe188 */
120 {RCS, GEN9_HALF_SLICE_CHICKEN7, 0xffff, true}, /* 0xe194 */ 120 {RCS, GEN9_HALF_SLICE_CHICKEN7, 0xffff, true}, /* 0xe194 */
121 {RCS, GEN8_ROW_CHICKEN, 0xffff, true}, /* 0xe4f0 */
121 {RCS, TRVATTL3PTRDW(0), 0, false}, /* 0x4de0 */ 122 {RCS, TRVATTL3PTRDW(0), 0, false}, /* 0x4de0 */
122 {RCS, TRVATTL3PTRDW(1), 0, false}, /* 0x4de4 */ 123 {RCS, TRVATTL3PTRDW(1), 0, false}, /* 0x4de4 */
123 {RCS, TRNULLDETCT, 0, false}, /* 0x4de8 */ 124 {RCS, TRNULLDETCT, 0, false}, /* 0x4de8 */
diff --git a/drivers/gpu/drm/i915/gvt/trace.h b/drivers/gpu/drm/i915/gvt/trace.h
index 7a2511538f34..736bd2bc5127 100644
--- a/drivers/gpu/drm/i915/gvt/trace.h
+++ b/drivers/gpu/drm/i915/gvt/trace.h
@@ -333,7 +333,7 @@ TRACE_EVENT(render_mmio,
333 TP_PROTO(int old_id, int new_id, char *action, unsigned int reg, 333 TP_PROTO(int old_id, int new_id, char *action, unsigned int reg,
334 unsigned int old_val, unsigned int new_val), 334 unsigned int old_val, unsigned int new_val),
335 335
336 TP_ARGS(old_id, new_id, action, reg, new_val, old_val), 336 TP_ARGS(old_id, new_id, action, reg, old_val, new_val),
337 337
338 TP_STRUCT__entry( 338 TP_STRUCT__entry(
339 __field(int, old_id) 339 __field(int, old_id)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 173d0095e3b2..2f5209de0391 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1433,19 +1433,7 @@ void i915_driver_unload(struct drm_device *dev)
1433 1433
1434 intel_modeset_cleanup(dev); 1434 intel_modeset_cleanup(dev);
1435 1435
1436 /* 1436 intel_bios_cleanup(dev_priv);
1437 * free the memory space allocated for the child device
1438 * config parsed from VBT
1439 */
1440 if (dev_priv->vbt.child_dev && dev_priv->vbt.child_dev_num) {
1441 kfree(dev_priv->vbt.child_dev);
1442 dev_priv->vbt.child_dev = NULL;
1443 dev_priv->vbt.child_dev_num = 0;
1444 }
1445 kfree(dev_priv->vbt.sdvo_lvds_vbt_mode);
1446 dev_priv->vbt.sdvo_lvds_vbt_mode = NULL;
1447 kfree(dev_priv->vbt.lfp_lvds_vbt_mode);
1448 dev_priv->vbt.lfp_lvds_vbt_mode = NULL;
1449 1437
1450 vga_switcheroo_unregister_client(pdev); 1438 vga_switcheroo_unregister_client(pdev);
1451 vga_client_register(pdev, NULL, NULL, NULL); 1439 vga_client_register(pdev, NULL, NULL, NULL);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a42deebedb0f..d307429a5ae0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1349,6 +1349,7 @@ struct intel_vbt_data {
1349 u32 size; 1349 u32 size;
1350 u8 *data; 1350 u8 *data;
1351 const u8 *sequence[MIPI_SEQ_MAX]; 1351 const u8 *sequence[MIPI_SEQ_MAX];
1352 u8 *deassert_seq; /* Used by fixup_mipi_sequences() */
1352 } dsi; 1353 } dsi;
1353 1354
1354 int crt_ddc_pin; 1355 int crt_ddc_pin;
@@ -3657,6 +3658,7 @@ extern void intel_i2c_reset(struct drm_i915_private *dev_priv);
3657 3658
3658/* intel_bios.c */ 3659/* intel_bios.c */
3659void intel_bios_init(struct drm_i915_private *dev_priv); 3660void intel_bios_init(struct drm_i915_private *dev_priv);
3661void intel_bios_cleanup(struct drm_i915_private *dev_priv);
3660bool intel_bios_is_valid_vbt(const void *buf, size_t size); 3662bool intel_bios_is_valid_vbt(const void *buf, size_t size);
3661bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv); 3663bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv);
3662bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin); 3664bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin);
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 648e7536ff51..0c963fcf31ff 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -803,7 +803,7 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,
803 803
804 case I915_CONTEXT_PARAM_PRIORITY: 804 case I915_CONTEXT_PARAM_PRIORITY:
805 { 805 {
806 int priority = args->value; 806 s64 priority = args->value;
807 807
808 if (args->size) 808 if (args->size)
809 ret = -EINVAL; 809 ret = -EINVAL;
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 4401068ff468..3ab1ace2a6bd 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -505,6 +505,8 @@ eb_add_vma(struct i915_execbuffer *eb, unsigned int i, struct i915_vma *vma)
505 list_add_tail(&vma->exec_link, &eb->unbound); 505 list_add_tail(&vma->exec_link, &eb->unbound);
506 if (drm_mm_node_allocated(&vma->node)) 506 if (drm_mm_node_allocated(&vma->node))
507 err = i915_vma_unbind(vma); 507 err = i915_vma_unbind(vma);
508 if (unlikely(err))
509 vma->exec_flags = NULL;
508 } 510 }
509 return err; 511 return err;
510} 512}
@@ -2410,7 +2412,7 @@ err_request:
2410 if (out_fence) { 2412 if (out_fence) {
2411 if (err == 0) { 2413 if (err == 0) {
2412 fd_install(out_fence_fd, out_fence->file); 2414 fd_install(out_fence_fd, out_fence->file);
2413 args->rsvd2 &= GENMASK_ULL(0, 31); /* keep in-fence */ 2415 args->rsvd2 &= GENMASK_ULL(31, 0); /* keep in-fence */
2414 args->rsvd2 |= (u64)out_fence_fd << 32; 2416 args->rsvd2 |= (u64)out_fence_fd << 32;
2415 out_fence_fd = -1; 2417 out_fence_fd = -1;
2416 } else { 2418 } else {
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index e09d18df8b7f..a3e93d46316a 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -476,8 +476,6 @@ void __i915_gem_request_submit(struct drm_i915_gem_request *request)
476 GEM_BUG_ON(!irqs_disabled()); 476 GEM_BUG_ON(!irqs_disabled());
477 lockdep_assert_held(&engine->timeline->lock); 477 lockdep_assert_held(&engine->timeline->lock);
478 478
479 trace_i915_gem_request_execute(request);
480
481 /* Transfer from per-context onto the global per-engine timeline */ 479 /* Transfer from per-context onto the global per-engine timeline */
482 timeline = engine->timeline; 480 timeline = engine->timeline;
483 GEM_BUG_ON(timeline == request->timeline); 481 GEM_BUG_ON(timeline == request->timeline);
@@ -501,6 +499,8 @@ void __i915_gem_request_submit(struct drm_i915_gem_request *request)
501 list_move_tail(&request->link, &timeline->requests); 499 list_move_tail(&request->link, &timeline->requests);
502 spin_unlock(&request->timeline->lock); 500 spin_unlock(&request->timeline->lock);
503 501
502 trace_i915_gem_request_execute(request);
503
504 wake_up_all(&request->execute); 504 wake_up_all(&request->execute);
505} 505}
506 506
diff --git a/drivers/gpu/drm/i915/i915_oa_cflgt3.c b/drivers/gpu/drm/i915/i915_oa_cflgt3.c
index 42ff06fe54a3..792facdb6702 100644
--- a/drivers/gpu/drm/i915/i915_oa_cflgt3.c
+++ b/drivers/gpu/drm/i915/i915_oa_cflgt3.c
@@ -84,9 +84,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
84void 84void
85i915_perf_load_test_config_cflgt3(struct drm_i915_private *dev_priv) 85i915_perf_load_test_config_cflgt3(struct drm_i915_private *dev_priv)
86{ 86{
87 strncpy(dev_priv->perf.oa.test_config.uuid, 87 strlcpy(dev_priv->perf.oa.test_config.uuid,
88 "577e8e2c-3fa0-4875-8743-3538d585e3b0", 88 "577e8e2c-3fa0-4875-8743-3538d585e3b0",
89 UUID_STRING_LEN); 89 sizeof(dev_priv->perf.oa.test_config.uuid));
90 dev_priv->perf.oa.test_config.id = 1; 90 dev_priv->perf.oa.test_config.id = 1;
91 91
92 dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa; 92 dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_oa_cnl.c b/drivers/gpu/drm/i915/i915_oa_cnl.c
index ff0ac3627cc4..ba9140c87cc0 100644
--- a/drivers/gpu/drm/i915/i915_oa_cnl.c
+++ b/drivers/gpu/drm/i915/i915_oa_cnl.c
@@ -96,9 +96,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
96void 96void
97i915_perf_load_test_config_cnl(struct drm_i915_private *dev_priv) 97i915_perf_load_test_config_cnl(struct drm_i915_private *dev_priv)
98{ 98{
99 strncpy(dev_priv->perf.oa.test_config.uuid, 99 strlcpy(dev_priv->perf.oa.test_config.uuid,
100 "db41edd4-d8e7-4730-ad11-b9a2d6833503", 100 "db41edd4-d8e7-4730-ad11-b9a2d6833503",
101 UUID_STRING_LEN); 101 sizeof(dev_priv->perf.oa.test_config.uuid));
102 dev_priv->perf.oa.test_config.id = 1; 102 dev_priv->perf.oa.test_config.id = 1;
103 103
104 dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa; 104 dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa;
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 55a8a1e29424..0e9b98c32b62 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -285,26 +285,41 @@ static u64 count_interrupts(struct drm_i915_private *i915)
285 return sum; 285 return sum;
286} 286}
287 287
288static void i915_pmu_event_destroy(struct perf_event *event) 288static void engine_event_destroy(struct perf_event *event)
289{ 289{
290 WARN_ON(event->parent); 290 struct drm_i915_private *i915 =
291 container_of(event->pmu, typeof(*i915), pmu.base);
292 struct intel_engine_cs *engine;
293
294 engine = intel_engine_lookup_user(i915,
295 engine_event_class(event),
296 engine_event_instance(event));
297 if (WARN_ON_ONCE(!engine))
298 return;
299
300 if (engine_event_sample(event) == I915_SAMPLE_BUSY &&
301 intel_engine_supports_stats(engine))
302 intel_disable_engine_stats(engine);
291} 303}
292 304
293static int engine_event_init(struct perf_event *event) 305static void i915_pmu_event_destroy(struct perf_event *event)
294{ 306{
295 struct drm_i915_private *i915 = 307 WARN_ON(event->parent);
296 container_of(event->pmu, typeof(*i915), pmu.base);
297 308
298 if (!intel_engine_lookup_user(i915, engine_event_class(event), 309 if (is_engine_event(event))
299 engine_event_instance(event))) 310 engine_event_destroy(event);
300 return -ENODEV; 311}
301 312
302 switch (engine_event_sample(event)) { 313static int
314engine_event_status(struct intel_engine_cs *engine,
315 enum drm_i915_pmu_engine_sample sample)
316{
317 switch (sample) {
303 case I915_SAMPLE_BUSY: 318 case I915_SAMPLE_BUSY:
304 case I915_SAMPLE_WAIT: 319 case I915_SAMPLE_WAIT:
305 break; 320 break;
306 case I915_SAMPLE_SEMA: 321 case I915_SAMPLE_SEMA:
307 if (INTEL_GEN(i915) < 6) 322 if (INTEL_GEN(engine->i915) < 6)
308 return -ENODEV; 323 return -ENODEV;
309 break; 324 break;
310 default: 325 default:
@@ -314,6 +329,30 @@ static int engine_event_init(struct perf_event *event)
314 return 0; 329 return 0;
315} 330}
316 331
332static int engine_event_init(struct perf_event *event)
333{
334 struct drm_i915_private *i915 =
335 container_of(event->pmu, typeof(*i915), pmu.base);
336 struct intel_engine_cs *engine;
337 u8 sample;
338 int ret;
339
340 engine = intel_engine_lookup_user(i915, engine_event_class(event),
341 engine_event_instance(event));
342 if (!engine)
343 return -ENODEV;
344
345 sample = engine_event_sample(event);
346 ret = engine_event_status(engine, sample);
347 if (ret)
348 return ret;
349
350 if (sample == I915_SAMPLE_BUSY && intel_engine_supports_stats(engine))
351 ret = intel_enable_engine_stats(engine);
352
353 return ret;
354}
355
317static int i915_pmu_event_init(struct perf_event *event) 356static int i915_pmu_event_init(struct perf_event *event)
318{ 357{
319 struct drm_i915_private *i915 = 358 struct drm_i915_private *i915 =
@@ -370,7 +409,94 @@ static int i915_pmu_event_init(struct perf_event *event)
370 return 0; 409 return 0;
371} 410}
372 411
373static u64 __i915_pmu_event_read(struct perf_event *event) 412static u64 __get_rc6(struct drm_i915_private *i915)
413{
414 u64 val;
415
416 val = intel_rc6_residency_ns(i915,
417 IS_VALLEYVIEW(i915) ?
418 VLV_GT_RENDER_RC6 :
419 GEN6_GT_GFX_RC6);
420
421 if (HAS_RC6p(i915))
422 val += intel_rc6_residency_ns(i915, GEN6_GT_GFX_RC6p);
423
424 if (HAS_RC6pp(i915))
425 val += intel_rc6_residency_ns(i915, GEN6_GT_GFX_RC6pp);
426
427 return val;
428}
429
430static u64 get_rc6(struct drm_i915_private *i915, bool locked)
431{
432#if IS_ENABLED(CONFIG_PM)
433 unsigned long flags;
434 u64 val;
435
436 if (intel_runtime_pm_get_if_in_use(i915)) {
437 val = __get_rc6(i915);
438 intel_runtime_pm_put(i915);
439
440 /*
441 * If we are coming back from being runtime suspended we must
442 * be careful not to report a larger value than returned
443 * previously.
444 */
445
446 if (!locked)
447 spin_lock_irqsave(&i915->pmu.lock, flags);
448
449 if (val >= i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur) {
450 i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur = 0;
451 i915->pmu.sample[__I915_SAMPLE_RC6].cur = val;
452 } else {
453 val = i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur;
454 }
455
456 if (!locked)
457 spin_unlock_irqrestore(&i915->pmu.lock, flags);
458 } else {
459 struct pci_dev *pdev = i915->drm.pdev;
460 struct device *kdev = &pdev->dev;
461 unsigned long flags2;
462
463 /*
464 * We are runtime suspended.
465 *
466 * Report the delta from when the device was suspended to now,
467 * on top of the last known real value, as the approximated RC6
468 * counter value.
469 */
470 if (!locked)
471 spin_lock_irqsave(&i915->pmu.lock, flags);
472
473 spin_lock_irqsave(&kdev->power.lock, flags2);
474
475 if (!i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur)
476 i915->pmu.suspended_jiffies_last =
477 kdev->power.suspended_jiffies;
478
479 val = kdev->power.suspended_jiffies -
480 i915->pmu.suspended_jiffies_last;
481 val += jiffies - kdev->power.accounting_timestamp;
482
483 spin_unlock_irqrestore(&kdev->power.lock, flags2);
484
485 val = jiffies_to_nsecs(val);
486 val += i915->pmu.sample[__I915_SAMPLE_RC6].cur;
487 i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur = val;
488
489 if (!locked)
490 spin_unlock_irqrestore(&i915->pmu.lock, flags);
491 }
492
493 return val;
494#else
495 return __get_rc6(i915);
496#endif
497}
498
499static u64 __i915_pmu_event_read(struct perf_event *event, bool locked)
374{ 500{
375 struct drm_i915_private *i915 = 501 struct drm_i915_private *i915 =
376 container_of(event->pmu, typeof(*i915), pmu.base); 502 container_of(event->pmu, typeof(*i915), pmu.base);
@@ -387,7 +513,7 @@ static u64 __i915_pmu_event_read(struct perf_event *event)
387 if (WARN_ON_ONCE(!engine)) { 513 if (WARN_ON_ONCE(!engine)) {
388 /* Do nothing */ 514 /* Do nothing */
389 } else if (sample == I915_SAMPLE_BUSY && 515 } else if (sample == I915_SAMPLE_BUSY &&
390 engine->pmu.busy_stats) { 516 intel_engine_supports_stats(engine)) {
391 val = ktime_to_ns(intel_engine_get_busy_time(engine)); 517 val = ktime_to_ns(intel_engine_get_busy_time(engine));
392 } else { 518 } else {
393 val = engine->pmu.sample[sample].cur; 519 val = engine->pmu.sample[sample].cur;
@@ -408,18 +534,7 @@ static u64 __i915_pmu_event_read(struct perf_event *event)
408 val = count_interrupts(i915); 534 val = count_interrupts(i915);
409 break; 535 break;
410 case I915_PMU_RC6_RESIDENCY: 536 case I915_PMU_RC6_RESIDENCY:
411 intel_runtime_pm_get(i915); 537 val = get_rc6(i915, locked);
412 val = intel_rc6_residency_ns(i915,
413 IS_VALLEYVIEW(i915) ?
414 VLV_GT_RENDER_RC6 :
415 GEN6_GT_GFX_RC6);
416 if (HAS_RC6p(i915))
417 val += intel_rc6_residency_ns(i915,
418 GEN6_GT_GFX_RC6p);
419 if (HAS_RC6pp(i915))
420 val += intel_rc6_residency_ns(i915,
421 GEN6_GT_GFX_RC6pp);
422 intel_runtime_pm_put(i915);
423 break; 538 break;
424 } 539 }
425 } 540 }
@@ -434,7 +549,7 @@ static void i915_pmu_event_read(struct perf_event *event)
434 549
435again: 550again:
436 prev = local64_read(&hwc->prev_count); 551 prev = local64_read(&hwc->prev_count);
437 new = __i915_pmu_event_read(event); 552 new = __i915_pmu_event_read(event, false);
438 553
439 if (local64_cmpxchg(&hwc->prev_count, prev, new) != prev) 554 if (local64_cmpxchg(&hwc->prev_count, prev, new) != prev)
440 goto again; 555 goto again;
@@ -442,12 +557,6 @@ again:
442 local64_add(new - prev, &event->count); 557 local64_add(new - prev, &event->count);
443} 558}
444 559
445static bool engine_needs_busy_stats(struct intel_engine_cs *engine)
446{
447 return intel_engine_supports_stats(engine) &&
448 (engine->pmu.enable & BIT(I915_SAMPLE_BUSY));
449}
450
451static void i915_pmu_enable(struct perf_event *event) 560static void i915_pmu_enable(struct perf_event *event)
452{ 561{
453 struct drm_i915_private *i915 = 562 struct drm_i915_private *i915 =
@@ -487,21 +596,7 @@ static void i915_pmu_enable(struct perf_event *event)
487 596
488 GEM_BUG_ON(sample >= I915_PMU_SAMPLE_BITS); 597 GEM_BUG_ON(sample >= I915_PMU_SAMPLE_BITS);
489 GEM_BUG_ON(engine->pmu.enable_count[sample] == ~0); 598 GEM_BUG_ON(engine->pmu.enable_count[sample] == ~0);
490 if (engine->pmu.enable_count[sample]++ == 0) { 599 engine->pmu.enable_count[sample]++;
491 /*
492 * Enable engine busy stats tracking if needed or
493 * alternatively cancel the scheduled disable.
494 *
495 * If the delayed disable was pending, cancel it and
496 * in this case do not enable since it already is.
497 */
498 if (engine_needs_busy_stats(engine) &&
499 !engine->pmu.busy_stats) {
500 engine->pmu.busy_stats = true;
501 if (!cancel_delayed_work(&engine->pmu.disable_busy_stats))
502 intel_enable_engine_stats(engine);
503 }
504 }
505 } 600 }
506 601
507 /* 602 /*
@@ -509,19 +604,11 @@ static void i915_pmu_enable(struct perf_event *event)
509 * for all listeners. Even when the event was already enabled and has 604 * for all listeners. Even when the event was already enabled and has
510 * an existing non-zero value. 605 * an existing non-zero value.
511 */ 606 */
512 local64_set(&event->hw.prev_count, __i915_pmu_event_read(event)); 607 local64_set(&event->hw.prev_count, __i915_pmu_event_read(event, true));
513 608
514 spin_unlock_irqrestore(&i915->pmu.lock, flags); 609 spin_unlock_irqrestore(&i915->pmu.lock, flags);
515} 610}
516 611
517static void __disable_busy_stats(struct work_struct *work)
518{
519 struct intel_engine_cs *engine =
520 container_of(work, typeof(*engine), pmu.disable_busy_stats.work);
521
522 intel_disable_engine_stats(engine);
523}
524
525static void i915_pmu_disable(struct perf_event *event) 612static void i915_pmu_disable(struct perf_event *event)
526{ 613{
527 struct drm_i915_private *i915 = 614 struct drm_i915_private *i915 =
@@ -545,26 +632,8 @@ static void i915_pmu_disable(struct perf_event *event)
545 * Decrement the reference count and clear the enabled 632 * Decrement the reference count and clear the enabled
546 * bitmask when the last listener on an event goes away. 633 * bitmask when the last listener on an event goes away.
547 */ 634 */
548 if (--engine->pmu.enable_count[sample] == 0) { 635 if (--engine->pmu.enable_count[sample] == 0)
549 engine->pmu.enable &= ~BIT(sample); 636 engine->pmu.enable &= ~BIT(sample);
550 if (!engine_needs_busy_stats(engine) &&
551 engine->pmu.busy_stats) {
552 engine->pmu.busy_stats = false;
553 /*
554 * We request a delayed disable to handle the
555 * rapid on/off cycles on events, which can
556 * happen when tools like perf stat start, in a
557 * nicer way.
558 *
559 * In addition, this also helps with busy stats
560 * accuracy with background CPU offline/online
561 * migration events.
562 */
563 queue_delayed_work(system_wq,
564 &engine->pmu.disable_busy_stats,
565 round_jiffies_up_relative(HZ));
566 }
567 }
568 } 637 }
569 638
570 GEM_BUG_ON(bit >= I915_PMU_MASK_BITS); 639 GEM_BUG_ON(bit >= I915_PMU_MASK_BITS);
@@ -797,8 +866,6 @@ static void i915_pmu_unregister_cpuhp_state(struct drm_i915_private *i915)
797 866
798void i915_pmu_register(struct drm_i915_private *i915) 867void i915_pmu_register(struct drm_i915_private *i915)
799{ 868{
800 struct intel_engine_cs *engine;
801 enum intel_engine_id id;
802 int ret; 869 int ret;
803 870
804 if (INTEL_GEN(i915) <= 2) { 871 if (INTEL_GEN(i915) <= 2) {
@@ -820,10 +887,6 @@ void i915_pmu_register(struct drm_i915_private *i915)
820 hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 887 hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
821 i915->pmu.timer.function = i915_sample; 888 i915->pmu.timer.function = i915_sample;
822 889
823 for_each_engine(engine, i915, id)
824 INIT_DELAYED_WORK(&engine->pmu.disable_busy_stats,
825 __disable_busy_stats);
826
827 ret = perf_pmu_register(&i915->pmu.base, "i915", -1); 890 ret = perf_pmu_register(&i915->pmu.base, "i915", -1);
828 if (ret) 891 if (ret)
829 goto err; 892 goto err;
@@ -843,9 +906,6 @@ err:
843 906
844void i915_pmu_unregister(struct drm_i915_private *i915) 907void i915_pmu_unregister(struct drm_i915_private *i915)
845{ 908{
846 struct intel_engine_cs *engine;
847 enum intel_engine_id id;
848
849 if (!i915->pmu.base.event_init) 909 if (!i915->pmu.base.event_init)
850 return; 910 return;
851 911
@@ -853,11 +913,6 @@ void i915_pmu_unregister(struct drm_i915_private *i915)
853 913
854 hrtimer_cancel(&i915->pmu.timer); 914 hrtimer_cancel(&i915->pmu.timer);
855 915
856 for_each_engine(engine, i915, id) {
857 GEM_BUG_ON(engine->pmu.busy_stats);
858 flush_delayed_work(&engine->pmu.disable_busy_stats);
859 }
860
861 i915_pmu_unregister_cpuhp_state(i915); 916 i915_pmu_unregister_cpuhp_state(i915);
862 917
863 perf_pmu_unregister(&i915->pmu.base); 918 perf_pmu_unregister(&i915->pmu.base);
diff --git a/drivers/gpu/drm/i915/i915_pmu.h b/drivers/gpu/drm/i915/i915_pmu.h
index 40c154d13565..bb62df15afa4 100644
--- a/drivers/gpu/drm/i915/i915_pmu.h
+++ b/drivers/gpu/drm/i915/i915_pmu.h
@@ -27,6 +27,8 @@
27enum { 27enum {
28 __I915_SAMPLE_FREQ_ACT = 0, 28 __I915_SAMPLE_FREQ_ACT = 0,
29 __I915_SAMPLE_FREQ_REQ, 29 __I915_SAMPLE_FREQ_REQ,
30 __I915_SAMPLE_RC6,
31 __I915_SAMPLE_RC6_ESTIMATED,
30 __I915_NUM_PMU_SAMPLERS 32 __I915_NUM_PMU_SAMPLERS
31}; 33};
32 34
@@ -94,6 +96,10 @@ struct i915_pmu {
94 * struct intel_engine_cs. 96 * struct intel_engine_cs.
95 */ 97 */
96 struct i915_pmu_sample sample[__I915_NUM_PMU_SAMPLERS]; 98 struct i915_pmu_sample sample[__I915_NUM_PMU_SAMPLERS];
99 /**
100 * @suspended_jiffies_last: Cached suspend time from PM core.
101 */
102 unsigned long suspended_jiffies_last;
97}; 103};
98 104
99#ifdef CONFIG_PERF_EVENTS 105#ifdef CONFIG_PERF_EVENTS
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index a2108e35c599..33eb0c5b1d32 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2027,7 +2027,7 @@ enum i915_power_well_id {
2027#define _CNL_PORT_TX_DW5_LN0_AE 0x162454 2027#define _CNL_PORT_TX_DW5_LN0_AE 0x162454
2028#define _CNL_PORT_TX_DW5_LN0_B 0x162654 2028#define _CNL_PORT_TX_DW5_LN0_B 0x162654
2029#define _CNL_PORT_TX_DW5_LN0_C 0x162C54 2029#define _CNL_PORT_TX_DW5_LN0_C 0x162C54
2030#define _CNL_PORT_TX_DW5_LN0_D 0x162ED4 2030#define _CNL_PORT_TX_DW5_LN0_D 0x162E54
2031#define _CNL_PORT_TX_DW5_LN0_F 0x162854 2031#define _CNL_PORT_TX_DW5_LN0_F 0x162854
2032#define CNL_PORT_TX_DW5_GRP(port) _MMIO_PORT6(port, \ 2032#define CNL_PORT_TX_DW5_GRP(port) _MMIO_PORT6(port, \
2033 _CNL_PORT_TX_DW5_GRP_AE, \ 2033 _CNL_PORT_TX_DW5_GRP_AE, \
@@ -2058,7 +2058,7 @@ enum i915_power_well_id {
2058#define _CNL_PORT_TX_DW7_LN0_AE 0x16245C 2058#define _CNL_PORT_TX_DW7_LN0_AE 0x16245C
2059#define _CNL_PORT_TX_DW7_LN0_B 0x16265C 2059#define _CNL_PORT_TX_DW7_LN0_B 0x16265C
2060#define _CNL_PORT_TX_DW7_LN0_C 0x162C5C 2060#define _CNL_PORT_TX_DW7_LN0_C 0x162C5C
2061#define _CNL_PORT_TX_DW7_LN0_D 0x162EDC 2061#define _CNL_PORT_TX_DW7_LN0_D 0x162E5C
2062#define _CNL_PORT_TX_DW7_LN0_F 0x16285C 2062#define _CNL_PORT_TX_DW7_LN0_F 0x16285C
2063#define CNL_PORT_TX_DW7_GRP(port) _MMIO_PORT6(port, \ 2063#define CNL_PORT_TX_DW7_GRP(port) _MMIO_PORT6(port, \
2064 _CNL_PORT_TX_DW7_GRP_AE, \ 2064 _CNL_PORT_TX_DW7_GRP_AE, \
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 522d54fecb53..4a01f62a392d 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -779,11 +779,11 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
779{ 779{
780 struct intel_encoder *encoder; 780 struct intel_encoder *encoder;
781 781
782 if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map)))
783 return NULL;
784
785 /* MST */ 782 /* MST */
786 if (pipe >= 0) { 783 if (pipe >= 0) {
784 if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map)))
785 return NULL;
786
787 encoder = dev_priv->av_enc_map[pipe]; 787 encoder = dev_priv->av_enc_map[pipe];
788 /* 788 /*
789 * when bootup, audio driver may not know it is 789 * when bootup, audio driver may not know it is
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index f7f771749e48..b49a2df44430 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -947,6 +947,86 @@ static int goto_next_sequence_v3(const u8 *data, int index, int total)
947 return 0; 947 return 0;
948} 948}
949 949
950/*
951 * Get len of pre-fixed deassert fragment from a v1 init OTP sequence,
952 * skip all delay + gpio operands and stop at the first DSI packet op.
953 */
954static int get_init_otp_deassert_fragment_len(struct drm_i915_private *dev_priv)
955{
956 const u8 *data = dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP];
957 int index, len;
958
959 if (WARN_ON(!data || dev_priv->vbt.dsi.seq_version != 1))
960 return 0;
961
962 /* index = 1 to skip sequence byte */
963 for (index = 1; data[index] != MIPI_SEQ_ELEM_END; index += len) {
964 switch (data[index]) {
965 case MIPI_SEQ_ELEM_SEND_PKT:
966 return index == 1 ? 0 : index;
967 case MIPI_SEQ_ELEM_DELAY:
968 len = 5; /* 1 byte for operand + uint32 */
969 break;
970 case MIPI_SEQ_ELEM_GPIO:
971 len = 3; /* 1 byte for op, 1 for gpio_nr, 1 for value */
972 break;
973 default:
974 return 0;
975 }
976 }
977
978 return 0;
979}
980
981/*
982 * Some v1 VBT MIPI sequences do the deassert in the init OTP sequence.
983 * The deassert must be done before calling intel_dsi_device_ready, so for
984 * these devices we split the init OTP sequence into a deassert sequence and
985 * the actual init OTP part.
986 */
987static void fixup_mipi_sequences(struct drm_i915_private *dev_priv)
988{
989 u8 *init_otp;
990 int len;
991
992 /* Limit this to VLV for now. */
993 if (!IS_VALLEYVIEW(dev_priv))
994 return;
995
996 /* Limit this to v1 vid-mode sequences */
997 if (dev_priv->vbt.dsi.config->is_cmd_mode ||
998 dev_priv->vbt.dsi.seq_version != 1)
999 return;
1000
1001 /* Only do this if there are otp and assert seqs and no deassert seq */
1002 if (!dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] ||
1003 !dev_priv->vbt.dsi.sequence[MIPI_SEQ_ASSERT_RESET] ||
1004 dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET])
1005 return;
1006
1007 /* The deassert-sequence ends at the first DSI packet */
1008 len = get_init_otp_deassert_fragment_len(dev_priv);
1009 if (!len)
1010 return;
1011
1012 DRM_DEBUG_KMS("Using init OTP fragment to deassert reset\n");
1013
1014 /* Copy the fragment, update seq byte and terminate it */
1015 init_otp = (u8 *)dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP];
1016 dev_priv->vbt.dsi.deassert_seq = kmemdup(init_otp, len + 1, GFP_KERNEL);
1017 if (!dev_priv->vbt.dsi.deassert_seq)
1018 return;
1019 dev_priv->vbt.dsi.deassert_seq[0] = MIPI_SEQ_DEASSERT_RESET;
1020 dev_priv->vbt.dsi.deassert_seq[len] = MIPI_SEQ_ELEM_END;
1021 /* Use the copy for deassert */
1022 dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET] =
1023 dev_priv->vbt.dsi.deassert_seq;
1024 /* Replace the last byte of the fragment with init OTP seq byte */
1025 init_otp[len - 1] = MIPI_SEQ_INIT_OTP;
1026 /* And make MIPI_MIPI_SEQ_INIT_OTP point to it */
1027 dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] = init_otp + len - 1;
1028}
1029
950static void 1030static void
951parse_mipi_sequence(struct drm_i915_private *dev_priv, 1031parse_mipi_sequence(struct drm_i915_private *dev_priv,
952 const struct bdb_header *bdb) 1032 const struct bdb_header *bdb)
@@ -1016,6 +1096,8 @@ parse_mipi_sequence(struct drm_i915_private *dev_priv,
1016 dev_priv->vbt.dsi.size = seq_size; 1096 dev_priv->vbt.dsi.size = seq_size;
1017 dev_priv->vbt.dsi.seq_version = sequence->version; 1097 dev_priv->vbt.dsi.seq_version = sequence->version;
1018 1098
1099 fixup_mipi_sequences(dev_priv);
1100
1019 DRM_DEBUG_DRIVER("MIPI related VBT parsing complete\n"); 1101 DRM_DEBUG_DRIVER("MIPI related VBT parsing complete\n");
1020 return; 1102 return;
1021 1103
@@ -1589,6 +1671,29 @@ out:
1589} 1671}
1590 1672
1591/** 1673/**
1674 * intel_bios_cleanup - Free any resources allocated by intel_bios_init()
1675 * @dev_priv: i915 device instance
1676 */
1677void intel_bios_cleanup(struct drm_i915_private *dev_priv)
1678{
1679 kfree(dev_priv->vbt.child_dev);
1680 dev_priv->vbt.child_dev = NULL;
1681 dev_priv->vbt.child_dev_num = 0;
1682 kfree(dev_priv->vbt.sdvo_lvds_vbt_mode);
1683 dev_priv->vbt.sdvo_lvds_vbt_mode = NULL;
1684 kfree(dev_priv->vbt.lfp_lvds_vbt_mode);
1685 dev_priv->vbt.lfp_lvds_vbt_mode = NULL;
1686 kfree(dev_priv->vbt.dsi.data);
1687 dev_priv->vbt.dsi.data = NULL;
1688 kfree(dev_priv->vbt.dsi.pps);
1689 dev_priv->vbt.dsi.pps = NULL;
1690 kfree(dev_priv->vbt.dsi.config);
1691 dev_priv->vbt.dsi.config = NULL;
1692 kfree(dev_priv->vbt.dsi.deassert_seq);
1693 dev_priv->vbt.dsi.deassert_seq = NULL;
1694}
1695
1696/**
1592 * intel_bios_is_tv_present - is integrated TV present in VBT 1697 * intel_bios_is_tv_present - is integrated TV present in VBT
1593 * @dev_priv: i915 device instance 1698 * @dev_priv: i915 device instance
1594 * 1699 *
diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index bd40fea16b4f..f54ddda9fdad 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -594,29 +594,16 @@ void intel_engine_remove_wait(struct intel_engine_cs *engine,
594 spin_unlock_irq(&b->rb_lock); 594 spin_unlock_irq(&b->rb_lock);
595} 595}
596 596
597static bool signal_valid(const struct drm_i915_gem_request *request)
598{
599 return intel_wait_check_request(&request->signaling.wait, request);
600}
601
602static bool signal_complete(const struct drm_i915_gem_request *request) 597static bool signal_complete(const struct drm_i915_gem_request *request)
603{ 598{
604 if (!request) 599 if (!request)
605 return false; 600 return false;
606 601
607 /* If another process served as the bottom-half it may have already 602 /*
608 * signalled that this wait is already completed. 603 * Carefully check if the request is complete, giving time for the
609 */
610 if (intel_wait_complete(&request->signaling.wait))
611 return signal_valid(request);
612
613 /* Carefully check if the request is complete, giving time for the
614 * seqno to be visible or if the GPU hung. 604 * seqno to be visible or if the GPU hung.
615 */ 605 */
616 if (__i915_request_irq_complete(request)) 606 return __i915_request_irq_complete(request);
617 return true;
618
619 return false;
620} 607}
621 608
622static struct drm_i915_gem_request *to_signaler(struct rb_node *rb) 609static struct drm_i915_gem_request *to_signaler(struct rb_node *rb)
@@ -659,9 +646,13 @@ static int intel_breadcrumbs_signaler(void *arg)
659 request = i915_gem_request_get_rcu(request); 646 request = i915_gem_request_get_rcu(request);
660 rcu_read_unlock(); 647 rcu_read_unlock();
661 if (signal_complete(request)) { 648 if (signal_complete(request)) {
662 local_bh_disable(); 649 if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
663 dma_fence_signal(&request->fence); 650 &request->fence.flags)) {
664 local_bh_enable(); /* kick start the tasklets */ 651 local_bh_disable();
652 dma_fence_signal(&request->fence);
653 GEM_BUG_ON(!i915_gem_request_completed(request));
654 local_bh_enable(); /* kick start the tasklets */
655 }
665 656
666 spin_lock_irq(&b->rb_lock); 657 spin_lock_irq(&b->rb_lock);
667 658
diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index 5dc118f26b51..1704c8897afd 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -1952,6 +1952,14 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
1952 if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9) 1952 if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)
1953 min_cdclk = max(2 * 96000, min_cdclk); 1953 min_cdclk = max(2 * 96000, min_cdclk);
1954 1954
1955 /*
1956 * On Valleyview some DSI panels lose (v|h)sync when the clock is lower
1957 * than 320000KHz.
1958 */
1959 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) &&
1960 IS_VALLEYVIEW(dev_priv))
1961 min_cdclk = max(320000, min_cdclk);
1962
1955 if (min_cdclk > dev_priv->max_cdclk_freq) { 1963 if (min_cdclk > dev_priv->max_cdclk_freq) {
1956 DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n", 1964 DRM_DEBUG_KMS("required cdclk (%d kHz) exceeds max (%d kHz)\n",
1957 min_cdclk, dev_priv->max_cdclk_freq); 1965 min_cdclk, dev_priv->max_cdclk_freq);
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index d790bdc227ff..fa960cfd2764 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1458,7 +1458,9 @@ static bool ring_is_idle(struct intel_engine_cs *engine)
1458 struct drm_i915_private *dev_priv = engine->i915; 1458 struct drm_i915_private *dev_priv = engine->i915;
1459 bool idle = true; 1459 bool idle = true;
1460 1460
1461 intel_runtime_pm_get(dev_priv); 1461 /* If the whole device is asleep, the engine must be idle */
1462 if (!intel_runtime_pm_get_if_in_use(dev_priv))
1463 return true;
1462 1464
1463 /* First check that no commands are left in the ring */ 1465 /* First check that no commands are left in the ring */
1464 if ((I915_READ_HEAD(engine) & HEAD_ADDR) != 1466 if ((I915_READ_HEAD(engine) & HEAD_ADDR) !=
@@ -1943,16 +1945,22 @@ intel_engine_lookup_user(struct drm_i915_private *i915, u8 class, u8 instance)
1943 */ 1945 */
1944int intel_enable_engine_stats(struct intel_engine_cs *engine) 1946int intel_enable_engine_stats(struct intel_engine_cs *engine)
1945{ 1947{
1948 struct intel_engine_execlists *execlists = &engine->execlists;
1946 unsigned long flags; 1949 unsigned long flags;
1950 int err = 0;
1947 1951
1948 if (!intel_engine_supports_stats(engine)) 1952 if (!intel_engine_supports_stats(engine))
1949 return -ENODEV; 1953 return -ENODEV;
1950 1954
1955 tasklet_disable(&execlists->tasklet);
1951 spin_lock_irqsave(&engine->stats.lock, flags); 1956 spin_lock_irqsave(&engine->stats.lock, flags);
1952 if (engine->stats.enabled == ~0) 1957
1953 goto busy; 1958 if (unlikely(engine->stats.enabled == ~0)) {
1959 err = -EBUSY;
1960 goto unlock;
1961 }
1962
1954 if (engine->stats.enabled++ == 0) { 1963 if (engine->stats.enabled++ == 0) {
1955 struct intel_engine_execlists *execlists = &engine->execlists;
1956 const struct execlist_port *port = execlists->port; 1964 const struct execlist_port *port = execlists->port;
1957 unsigned int num_ports = execlists_num_ports(execlists); 1965 unsigned int num_ports = execlists_num_ports(execlists);
1958 1966
@@ -1967,14 +1975,12 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)
1967 if (engine->stats.active) 1975 if (engine->stats.active)
1968 engine->stats.start = engine->stats.enabled_at; 1976 engine->stats.start = engine->stats.enabled_at;
1969 } 1977 }
1970 spin_unlock_irqrestore(&engine->stats.lock, flags);
1971
1972 return 0;
1973 1978
1974busy: 1979unlock:
1975 spin_unlock_irqrestore(&engine->stats.lock, flags); 1980 spin_unlock_irqrestore(&engine->stats.lock, flags);
1981 tasklet_enable(&execlists->tasklet);
1976 1982
1977 return -EBUSY; 1983 return err;
1978} 1984}
1979 1985
1980static ktime_t __intel_engine_get_busy_time(struct intel_engine_cs *engine) 1986static ktime_t __intel_engine_get_busy_time(struct intel_engine_cs *engine)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index c5ff203e42d6..a0e7a6c2a57c 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -366,20 +366,6 @@ struct intel_engine_cs {
366 */ 366 */
367#define I915_ENGINE_SAMPLE_MAX (I915_SAMPLE_SEMA + 1) 367#define I915_ENGINE_SAMPLE_MAX (I915_SAMPLE_SEMA + 1)
368 struct i915_pmu_sample sample[I915_ENGINE_SAMPLE_MAX]; 368 struct i915_pmu_sample sample[I915_ENGINE_SAMPLE_MAX];
369 /**
370 * @busy_stats: Has enablement of engine stats tracking been
371 * requested.
372 */
373 bool busy_stats;
374 /**
375 * @disable_busy_stats: Work item for busy stats disabling.
376 *
377 * Same as with @enable_busy_stats action, with the difference
378 * that we delay it in case there are rapid enable-disable
379 * actions, which can happen during tool startup (like perf
380 * stat).
381 */
382 struct delayed_work disable_busy_stats;
383 } pmu; 369 } pmu;
384 370
385 /* 371 /*
diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c
index 5155f0179b61..05520202c967 100644
--- a/drivers/gpu/drm/meson/meson_crtc.c
+++ b/drivers/gpu/drm/meson/meson_crtc.c
@@ -36,6 +36,7 @@
36#include "meson_venc.h" 36#include "meson_venc.h"
37#include "meson_vpp.h" 37#include "meson_vpp.h"
38#include "meson_viu.h" 38#include "meson_viu.h"
39#include "meson_canvas.h"
39#include "meson_registers.h" 40#include "meson_registers.h"
40 41
41/* CRTC definition */ 42/* CRTC definition */
@@ -192,6 +193,11 @@ void meson_crtc_irq(struct meson_drm *priv)
192 } else 193 } else
193 meson_vpp_disable_interlace_vscaler_osd1(priv); 194 meson_vpp_disable_interlace_vscaler_osd1(priv);
194 195
196 meson_canvas_setup(priv, MESON_CANVAS_ID_OSD1,
197 priv->viu.osd1_addr, priv->viu.osd1_stride,
198 priv->viu.osd1_height, MESON_CANVAS_WRAP_NONE,
199 MESON_CANVAS_BLKMODE_LINEAR);
200
195 /* Enable OSD1 */ 201 /* Enable OSD1 */
196 writel_bits_relaxed(VPP_OSD1_POSTBLEND, VPP_OSD1_POSTBLEND, 202 writel_bits_relaxed(VPP_OSD1_POSTBLEND, VPP_OSD1_POSTBLEND,
197 priv->io_base + _REG(VPP_MISC)); 203 priv->io_base + _REG(VPP_MISC));
diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h
index 5e8b392b9d1f..8450d6ac8c9b 100644
--- a/drivers/gpu/drm/meson/meson_drv.h
+++ b/drivers/gpu/drm/meson/meson_drv.h
@@ -43,6 +43,9 @@ struct meson_drm {
43 bool osd1_commit; 43 bool osd1_commit;
44 uint32_t osd1_ctrl_stat; 44 uint32_t osd1_ctrl_stat;
45 uint32_t osd1_blk0_cfg[5]; 45 uint32_t osd1_blk0_cfg[5];
46 uint32_t osd1_addr;
47 uint32_t osd1_stride;
48 uint32_t osd1_height;
46 } viu; 49 } viu;
47 50
48 struct { 51 struct {
diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
index d0a6ac8390f3..27bd3503e1e4 100644
--- a/drivers/gpu/drm/meson/meson_plane.c
+++ b/drivers/gpu/drm/meson/meson_plane.c
@@ -164,10 +164,9 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
164 /* Update Canvas with buffer address */ 164 /* Update Canvas with buffer address */
165 gem = drm_fb_cma_get_gem_obj(fb, 0); 165 gem = drm_fb_cma_get_gem_obj(fb, 0);
166 166
167 meson_canvas_setup(priv, MESON_CANVAS_ID_OSD1, 167 priv->viu.osd1_addr = gem->paddr;
168 gem->paddr, fb->pitches[0], 168 priv->viu.osd1_stride = fb->pitches[0];
169 fb->height, MESON_CANVAS_WRAP_NONE, 169 priv->viu.osd1_height = fb->height;
170 MESON_CANVAS_BLKMODE_LINEAR);
171 170
172 spin_unlock_irqrestore(&priv->drm->event_lock, flags); 171 spin_unlock_irqrestore(&priv->drm->event_lock, flags);
173} 172}
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
index 3e9bba4d6624..6d8e3a9a6fc0 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
@@ -680,7 +680,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
680 } else { 680 } else {
681 dev_info(&pdev->dev, 681 dev_info(&pdev->dev,
682 "no iommu, fallback to phys contig buffers for scanout\n"); 682 "no iommu, fallback to phys contig buffers for scanout\n");
683 aspace = NULL;; 683 aspace = NULL;
684 } 684 }
685 685
686 pm_runtime_put_sync(&pdev->dev); 686 pm_runtime_put_sync(&pdev->dev);
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 69d6e61a01ec..6ed9cb053dfa 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -570,9 +570,15 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
570 nv_connector->edid = NULL; 570 nv_connector->edid = NULL;
571 } 571 }
572 572
573 ret = pm_runtime_get_sync(connector->dev->dev); 573 /* Outputs are only polled while runtime active, so acquiring a
574 if (ret < 0 && ret != -EACCES) 574 * runtime PM ref here is unnecessary (and would deadlock upon
575 return conn_status; 575 * runtime suspend because it waits for polling to finish).
576 */
577 if (!drm_kms_helper_is_poll_worker()) {
578 ret = pm_runtime_get_sync(connector->dev->dev);
579 if (ret < 0 && ret != -EACCES)
580 return conn_status;
581 }
576 582
577 nv_encoder = nouveau_connector_ddc_detect(connector); 583 nv_encoder = nouveau_connector_ddc_detect(connector);
578 if (nv_encoder && (i2c = nv_encoder->i2c) != NULL) { 584 if (nv_encoder && (i2c = nv_encoder->i2c) != NULL) {
@@ -647,8 +653,10 @@ detect_analog:
647 653
648 out: 654 out:
649 655
650 pm_runtime_mark_last_busy(connector->dev->dev); 656 if (!drm_kms_helper_is_poll_worker()) {
651 pm_runtime_put_autosuspend(connector->dev->dev); 657 pm_runtime_mark_last_busy(connector->dev->dev);
658 pm_runtime_put_autosuspend(connector->dev->dev);
659 }
652 660
653 return conn_status; 661 return conn_status;
654} 662}
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index dd8d4352ed99..caddce88d2d8 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -4477,6 +4477,7 @@ nv50_display_create(struct drm_device *dev)
4477 nouveau_display(dev)->fini = nv50_display_fini; 4477 nouveau_display(dev)->fini = nv50_display_fini;
4478 disp->disp = &nouveau_display(dev)->disp; 4478 disp->disp = &nouveau_display(dev)->disp;
4479 dev->mode_config.funcs = &nv50_disp_func; 4479 dev->mode_config.funcs = &nv50_disp_func;
4480 dev->driver->driver_features |= DRIVER_PREFER_XBGR_30BPP;
4480 if (nouveau_atomic) 4481 if (nouveau_atomic)
4481 dev->driver->driver_features |= DRIVER_ATOMIC; 4482 dev->driver->driver_features |= DRIVER_ATOMIC;
4482 4483
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
index bf62303571b3..3695cde669f8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
@@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,
301void 301void
302nvkm_therm_clkgate_enable(struct nvkm_therm *therm) 302nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
303{ 303{
304 if (!therm->func->clkgate_enable || !therm->clkgating_enabled) 304 if (!therm || !therm->func->clkgate_enable || !therm->clkgating_enabled)
305 return; 305 return;
306 306
307 nvkm_debug(&therm->subdev, 307 nvkm_debug(&therm->subdev,
@@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
312void 312void
313nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend) 313nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend)
314{ 314{
315 if (!therm->func->clkgate_fini || !therm->clkgating_enabled) 315 if (!therm || !therm->func->clkgate_fini || !therm->clkgating_enabled)
316 return; 316 return;
317 317
318 nvkm_debug(&therm->subdev, 318 nvkm_debug(&therm->subdev,
@@ -395,7 +395,7 @@ void
395nvkm_therm_clkgate_init(struct nvkm_therm *therm, 395nvkm_therm_clkgate_init(struct nvkm_therm *therm,
396 const struct nvkm_therm_clkgate_pack *p) 396 const struct nvkm_therm_clkgate_pack *p)
397{ 397{
398 if (!therm->func->clkgate_init || !therm->clkgating_enabled) 398 if (!therm || !therm->func->clkgate_init || !therm->clkgating_enabled)
399 return; 399 return;
400 400
401 therm->func->clkgate_init(therm, p); 401 therm->func->clkgate_init(therm, p);
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 5012f5e47a1e..2e2ca3c6b47d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -899,9 +899,11 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
899 enum drm_connector_status ret = connector_status_disconnected; 899 enum drm_connector_status ret = connector_status_disconnected;
900 int r; 900 int r;
901 901
902 r = pm_runtime_get_sync(connector->dev->dev); 902 if (!drm_kms_helper_is_poll_worker()) {
903 if (r < 0) 903 r = pm_runtime_get_sync(connector->dev->dev);
904 return connector_status_disconnected; 904 if (r < 0)
905 return connector_status_disconnected;
906 }
905 907
906 if (encoder) { 908 if (encoder) {
907 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 909 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
@@ -924,8 +926,12 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
924 /* check acpi lid status ??? */ 926 /* check acpi lid status ??? */
925 927
926 radeon_connector_update_scratch_regs(connector, ret); 928 radeon_connector_update_scratch_regs(connector, ret);
927 pm_runtime_mark_last_busy(connector->dev->dev); 929
928 pm_runtime_put_autosuspend(connector->dev->dev); 930 if (!drm_kms_helper_is_poll_worker()) {
931 pm_runtime_mark_last_busy(connector->dev->dev);
932 pm_runtime_put_autosuspend(connector->dev->dev);
933 }
934
929 return ret; 935 return ret;
930} 936}
931 937
@@ -1039,9 +1045,11 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
1039 enum drm_connector_status ret = connector_status_disconnected; 1045 enum drm_connector_status ret = connector_status_disconnected;
1040 int r; 1046 int r;
1041 1047
1042 r = pm_runtime_get_sync(connector->dev->dev); 1048 if (!drm_kms_helper_is_poll_worker()) {
1043 if (r < 0) 1049 r = pm_runtime_get_sync(connector->dev->dev);
1044 return connector_status_disconnected; 1050 if (r < 0)
1051 return connector_status_disconnected;
1052 }
1045 1053
1046 encoder = radeon_best_single_encoder(connector); 1054 encoder = radeon_best_single_encoder(connector);
1047 if (!encoder) 1055 if (!encoder)
@@ -1108,8 +1116,10 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
1108 radeon_connector_update_scratch_regs(connector, ret); 1116 radeon_connector_update_scratch_regs(connector, ret);
1109 1117
1110out: 1118out:
1111 pm_runtime_mark_last_busy(connector->dev->dev); 1119 if (!drm_kms_helper_is_poll_worker()) {
1112 pm_runtime_put_autosuspend(connector->dev->dev); 1120 pm_runtime_mark_last_busy(connector->dev->dev);
1121 pm_runtime_put_autosuspend(connector->dev->dev);
1122 }
1113 1123
1114 return ret; 1124 return ret;
1115} 1125}
@@ -1173,9 +1183,11 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
1173 if (!radeon_connector->dac_load_detect) 1183 if (!radeon_connector->dac_load_detect)
1174 return ret; 1184 return ret;
1175 1185
1176 r = pm_runtime_get_sync(connector->dev->dev); 1186 if (!drm_kms_helper_is_poll_worker()) {
1177 if (r < 0) 1187 r = pm_runtime_get_sync(connector->dev->dev);
1178 return connector_status_disconnected; 1188 if (r < 0)
1189 return connector_status_disconnected;
1190 }
1179 1191
1180 encoder = radeon_best_single_encoder(connector); 1192 encoder = radeon_best_single_encoder(connector);
1181 if (!encoder) 1193 if (!encoder)
@@ -1187,8 +1199,12 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
1187 if (ret == connector_status_connected) 1199 if (ret == connector_status_connected)
1188 ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false); 1200 ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
1189 radeon_connector_update_scratch_regs(connector, ret); 1201 radeon_connector_update_scratch_regs(connector, ret);
1190 pm_runtime_mark_last_busy(connector->dev->dev); 1202
1191 pm_runtime_put_autosuspend(connector->dev->dev); 1203 if (!drm_kms_helper_is_poll_worker()) {
1204 pm_runtime_mark_last_busy(connector->dev->dev);
1205 pm_runtime_put_autosuspend(connector->dev->dev);
1206 }
1207
1192 return ret; 1208 return ret;
1193} 1209}
1194 1210
@@ -1251,9 +1267,11 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
1251 enum drm_connector_status ret = connector_status_disconnected; 1267 enum drm_connector_status ret = connector_status_disconnected;
1252 bool dret = false, broken_edid = false; 1268 bool dret = false, broken_edid = false;
1253 1269
1254 r = pm_runtime_get_sync(connector->dev->dev); 1270 if (!drm_kms_helper_is_poll_worker()) {
1255 if (r < 0) 1271 r = pm_runtime_get_sync(connector->dev->dev);
1256 return connector_status_disconnected; 1272 if (r < 0)
1273 return connector_status_disconnected;
1274 }
1257 1275
1258 if (radeon_connector->detected_hpd_without_ddc) { 1276 if (radeon_connector->detected_hpd_without_ddc) {
1259 force = true; 1277 force = true;
@@ -1436,8 +1454,10 @@ out:
1436 } 1454 }
1437 1455
1438exit: 1456exit:
1439 pm_runtime_mark_last_busy(connector->dev->dev); 1457 if (!drm_kms_helper_is_poll_worker()) {
1440 pm_runtime_put_autosuspend(connector->dev->dev); 1458 pm_runtime_mark_last_busy(connector->dev->dev);
1459 pm_runtime_put_autosuspend(connector->dev->dev);
1460 }
1441 1461
1442 return ret; 1462 return ret;
1443} 1463}
@@ -1688,9 +1708,11 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1688 if (radeon_dig_connector->is_mst) 1708 if (radeon_dig_connector->is_mst)
1689 return connector_status_disconnected; 1709 return connector_status_disconnected;
1690 1710
1691 r = pm_runtime_get_sync(connector->dev->dev); 1711 if (!drm_kms_helper_is_poll_worker()) {
1692 if (r < 0) 1712 r = pm_runtime_get_sync(connector->dev->dev);
1693 return connector_status_disconnected; 1713 if (r < 0)
1714 return connector_status_disconnected;
1715 }
1694 1716
1695 if (!force && radeon_check_hpd_status_unchanged(connector)) { 1717 if (!force && radeon_check_hpd_status_unchanged(connector)) {
1696 ret = connector->status; 1718 ret = connector->status;
@@ -1777,8 +1799,10 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
1777 } 1799 }
1778 1800
1779out: 1801out:
1780 pm_runtime_mark_last_busy(connector->dev->dev); 1802 if (!drm_kms_helper_is_poll_worker()) {
1781 pm_runtime_put_autosuspend(connector->dev->dev); 1803 pm_runtime_mark_last_busy(connector->dev->dev);
1804 pm_runtime_put_autosuspend(connector->dev->dev);
1805 }
1782 1806
1783 return ret; 1807 return ret;
1784} 1808}
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 8d3e3d2e0090..7828a5e10629 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1365,6 +1365,10 @@ int radeon_device_init(struct radeon_device *rdev,
1365 if ((rdev->flags & RADEON_IS_PCI) && 1365 if ((rdev->flags & RADEON_IS_PCI) &&
1366 (rdev->family <= CHIP_RS740)) 1366 (rdev->family <= CHIP_RS740))
1367 rdev->need_dma32 = true; 1367 rdev->need_dma32 = true;
1368#ifdef CONFIG_PPC64
1369 if (rdev->family == CHIP_CEDAR)
1370 rdev->need_dma32 = true;
1371#endif
1368 1372
1369 dma_bits = rdev->need_dma32 ? 32 : 40; 1373 dma_bits = rdev->need_dma32 ? 32 : 40;
1370 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits)); 1374 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 326ad068c15a..4b6542538ff9 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -47,7 +47,6 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev);
47static bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finish); 47static bool radeon_pm_debug_check_in_vbl(struct radeon_device *rdev, bool finish);
48static void radeon_pm_update_profile(struct radeon_device *rdev); 48static void radeon_pm_update_profile(struct radeon_device *rdev);
49static void radeon_pm_set_clocks(struct radeon_device *rdev); 49static void radeon_pm_set_clocks(struct radeon_device *rdev);
50static void radeon_pm_compute_clocks_dpm(struct radeon_device *rdev);
51 50
52int radeon_pm_get_type_index(struct radeon_device *rdev, 51int radeon_pm_get_type_index(struct radeon_device *rdev,
53 enum radeon_pm_state_type ps_type, 52 enum radeon_pm_state_type ps_type,
@@ -80,8 +79,6 @@ void radeon_pm_acpi_event_handler(struct radeon_device *rdev)
80 radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power); 79 radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power);
81 } 80 }
82 mutex_unlock(&rdev->pm.mutex); 81 mutex_unlock(&rdev->pm.mutex);
83 /* allow new DPM state to be picked */
84 radeon_pm_compute_clocks_dpm(rdev);
85 } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) { 82 } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
86 if (rdev->pm.profile == PM_PROFILE_AUTO) { 83 if (rdev->pm.profile == PM_PROFILE_AUTO) {
87 mutex_lock(&rdev->pm.mutex); 84 mutex_lock(&rdev->pm.mutex);
@@ -885,8 +882,7 @@ static struct radeon_ps *radeon_dpm_pick_power_state(struct radeon_device *rdev,
885 dpm_state = POWER_STATE_TYPE_INTERNAL_3DPERF; 882 dpm_state = POWER_STATE_TYPE_INTERNAL_3DPERF;
886 /* balanced states don't exist at the moment */ 883 /* balanced states don't exist at the moment */
887 if (dpm_state == POWER_STATE_TYPE_BALANCED) 884 if (dpm_state == POWER_STATE_TYPE_BALANCED)
888 dpm_state = rdev->pm.dpm.ac_power ? 885 dpm_state = POWER_STATE_TYPE_PERFORMANCE;
889 POWER_STATE_TYPE_PERFORMANCE : POWER_STATE_TYPE_BATTERY;
890 886
891restart_search: 887restart_search:
892 /* Pick the best power state based on current conditions */ 888 /* Pick the best power state based on current conditions */
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
index 2c18996d59c5..0d95888ccc3e 100644
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
@@ -461,7 +461,7 @@ void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, struct drm_sched_jo
461{ 461{
462 struct drm_sched_job *s_job; 462 struct drm_sched_job *s_job;
463 struct drm_sched_entity *entity, *tmp; 463 struct drm_sched_entity *entity, *tmp;
464 int i;; 464 int i;
465 465
466 spin_lock(&sched->job_list_lock); 466 spin_lock(&sched->job_list_lock);
467 list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) { 467 list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) {
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 3c15cf24b503..b3960118deb9 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -260,7 +260,7 @@ static void sun4i_tcon0_mode_set_common(struct sun4i_tcon *tcon,
260 const struct drm_display_mode *mode) 260 const struct drm_display_mode *mode)
261{ 261{
262 /* Configure the dot clock */ 262 /* Configure the dot clock */
263 clk_set_rate(tcon->dclk, mode->crtc_clock * 1000); 263 clk_set_rate_exclusive(tcon->dclk, mode->crtc_clock * 1000);
264 264
265 /* Set the resolution */ 265 /* Set the resolution */
266 regmap_write(tcon->regs, SUN4I_TCON0_BASIC0_REG, 266 regmap_write(tcon->regs, SUN4I_TCON0_BASIC0_REG,
@@ -335,6 +335,9 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
335 regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG, 335 regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG,
336 SUN4I_TCON_GCTL_IOMAP_MASK, 336 SUN4I_TCON_GCTL_IOMAP_MASK,
337 SUN4I_TCON_GCTL_IOMAP_TCON0); 337 SUN4I_TCON_GCTL_IOMAP_TCON0);
338
339 /* Enable the output on the pins */
340 regmap_write(tcon->regs, SUN4I_TCON0_IO_TRI_REG, 0xe0000000);
338} 341}
339 342
340static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, 343static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
@@ -418,7 +421,7 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon,
418 WARN_ON(!tcon->quirks->has_channel_1); 421 WARN_ON(!tcon->quirks->has_channel_1);
419 422
420 /* Configure the dot clock */ 423 /* Configure the dot clock */
421 clk_set_rate(tcon->sclk1, mode->crtc_clock * 1000); 424 clk_set_rate_exclusive(tcon->sclk1, mode->crtc_clock * 1000);
422 425
423 /* Adjust clock delay */ 426 /* Adjust clock delay */
424 clk_delay = sun4i_tcon_get_clk_delay(mode, 1); 427 clk_delay = sun4i_tcon_get_clk_delay(mode, 1);
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 5720a0d4ac0a..677ac16c8a6d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -197,6 +197,9 @@ static int virtio_gpu_getparam_ioctl(struct drm_device *dev, void *data,
197 case VIRTGPU_PARAM_3D_FEATURES: 197 case VIRTGPU_PARAM_3D_FEATURES:
198 value = vgdev->has_virgl_3d == true ? 1 : 0; 198 value = vgdev->has_virgl_3d == true ? 1 : 0;
199 break; 199 break;
200 case VIRTGPU_PARAM_CAPSET_QUERY_FIX:
201 value = 1;
202 break;
200 default: 203 default:
201 return -EINVAL; 204 return -EINVAL;
202 } 205 }
@@ -472,7 +475,7 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
472{ 475{
473 struct virtio_gpu_device *vgdev = dev->dev_private; 476 struct virtio_gpu_device *vgdev = dev->dev_private;
474 struct drm_virtgpu_get_caps *args = data; 477 struct drm_virtgpu_get_caps *args = data;
475 int size; 478 unsigned size, host_caps_size;
476 int i; 479 int i;
477 int found_valid = -1; 480 int found_valid = -1;
478 int ret; 481 int ret;
@@ -481,6 +484,10 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
481 if (vgdev->num_capsets == 0) 484 if (vgdev->num_capsets == 0)
482 return -ENOSYS; 485 return -ENOSYS;
483 486
487 /* don't allow userspace to pass 0 */
488 if (args->size == 0)
489 return -EINVAL;
490
484 spin_lock(&vgdev->display_info_lock); 491 spin_lock(&vgdev->display_info_lock);
485 for (i = 0; i < vgdev->num_capsets; i++) { 492 for (i = 0; i < vgdev->num_capsets; i++) {
486 if (vgdev->capsets[i].id == args->cap_set_id) { 493 if (vgdev->capsets[i].id == args->cap_set_id) {
@@ -496,11 +503,9 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
496 return -EINVAL; 503 return -EINVAL;
497 } 504 }
498 505
499 size = vgdev->capsets[found_valid].max_size; 506 host_caps_size = vgdev->capsets[found_valid].max_size;
500 if (args->size > size) { 507 /* only copy to user the minimum of the host caps size or the guest caps size */
501 spin_unlock(&vgdev->display_info_lock); 508 size = min(args->size, host_caps_size);
502 return -EINVAL;
503 }
504 509
505 list_for_each_entry(cache_ent, &vgdev->cap_cache, head) { 510 list_for_each_entry(cache_ent, &vgdev->cap_cache, head) {
506 if (cache_ent->id == args->cap_set_id && 511 if (cache_ent->id == args->cap_set_id &&
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 658fa2d3e40c..48685cddbad1 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -1089,7 +1089,7 @@ static void ipu_irq_handler(struct irq_desc *desc)
1089{ 1089{
1090 struct ipu_soc *ipu = irq_desc_get_handler_data(desc); 1090 struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
1091 struct irq_chip *chip = irq_desc_get_chip(desc); 1091 struct irq_chip *chip = irq_desc_get_chip(desc);
1092 const int int_reg[] = { 0, 1, 2, 3, 10, 11, 12, 13, 14}; 1092 static const int int_reg[] = { 0, 1, 2, 3, 10, 11, 12, 13, 14};
1093 1093
1094 chained_irq_enter(chip, desc); 1094 chained_irq_enter(chip, desc);
1095 1095
@@ -1102,7 +1102,7 @@ static void ipu_err_irq_handler(struct irq_desc *desc)
1102{ 1102{
1103 struct ipu_soc *ipu = irq_desc_get_handler_data(desc); 1103 struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
1104 struct irq_chip *chip = irq_desc_get_chip(desc); 1104 struct irq_chip *chip = irq_desc_get_chip(desc);
1105 const int int_reg[] = { 4, 5, 8, 9}; 1105 static const int int_reg[] = { 4, 5, 8, 9};
1106 1106
1107 chained_irq_enter(chip, desc); 1107 chained_irq_enter(chip, desc);
1108 1108
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c
index bb9c087e6c0d..9f2d9ec42add 100644
--- a/drivers/gpu/ipu-v3/ipu-cpmem.c
+++ b/drivers/gpu/ipu-v3/ipu-cpmem.c
@@ -788,12 +788,14 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
788 case V4L2_PIX_FMT_SGBRG8: 788 case V4L2_PIX_FMT_SGBRG8:
789 case V4L2_PIX_FMT_SGRBG8: 789 case V4L2_PIX_FMT_SGRBG8:
790 case V4L2_PIX_FMT_SRGGB8: 790 case V4L2_PIX_FMT_SRGGB8:
791 case V4L2_PIX_FMT_GREY:
791 offset = image->rect.left + image->rect.top * pix->bytesperline; 792 offset = image->rect.left + image->rect.top * pix->bytesperline;
792 break; 793 break;
793 case V4L2_PIX_FMT_SBGGR16: 794 case V4L2_PIX_FMT_SBGGR16:
794 case V4L2_PIX_FMT_SGBRG16: 795 case V4L2_PIX_FMT_SGBRG16:
795 case V4L2_PIX_FMT_SGRBG16: 796 case V4L2_PIX_FMT_SGRBG16:
796 case V4L2_PIX_FMT_SRGGB16: 797 case V4L2_PIX_FMT_SRGGB16:
798 case V4L2_PIX_FMT_Y16:
797 offset = image->rect.left * 2 + 799 offset = image->rect.left * 2 +
798 image->rect.top * pix->bytesperline; 800 image->rect.top * pix->bytesperline;
799 break; 801 break;
diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index 24e12b87a0cb..caa05b0702e1 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -288,6 +288,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code)
288 case MEDIA_BUS_FMT_SGBRG10_1X10: 288 case MEDIA_BUS_FMT_SGBRG10_1X10:
289 case MEDIA_BUS_FMT_SGRBG10_1X10: 289 case MEDIA_BUS_FMT_SGRBG10_1X10:
290 case MEDIA_BUS_FMT_SRGGB10_1X10: 290 case MEDIA_BUS_FMT_SRGGB10_1X10:
291 case MEDIA_BUS_FMT_Y10_1X10:
291 cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; 292 cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
292 cfg->mipi_dt = MIPI_DT_RAW10; 293 cfg->mipi_dt = MIPI_DT_RAW10;
293 cfg->data_width = IPU_CSI_DATA_WIDTH_10; 294 cfg->data_width = IPU_CSI_DATA_WIDTH_10;
@@ -296,6 +297,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code)
296 case MEDIA_BUS_FMT_SGBRG12_1X12: 297 case MEDIA_BUS_FMT_SGBRG12_1X12:
297 case MEDIA_BUS_FMT_SGRBG12_1X12: 298 case MEDIA_BUS_FMT_SGRBG12_1X12:
298 case MEDIA_BUS_FMT_SRGGB12_1X12: 299 case MEDIA_BUS_FMT_SRGGB12_1X12:
300 case MEDIA_BUS_FMT_Y12_1X12:
299 cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; 301 cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER;
300 cfg->mipi_dt = MIPI_DT_RAW12; 302 cfg->mipi_dt = MIPI_DT_RAW12;
301 cfg->data_width = IPU_CSI_DATA_WIDTH_12; 303 cfg->data_width = IPU_CSI_DATA_WIDTH_12;
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
index f1cec3d70498..0f70e8847540 100644
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -129,11 +129,14 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
129 if (pre_node == pre->dev->of_node) { 129 if (pre_node == pre->dev->of_node) {
130 mutex_unlock(&ipu_pre_list_mutex); 130 mutex_unlock(&ipu_pre_list_mutex);
131 device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE); 131 device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
132 of_node_put(pre_node);
132 return pre; 133 return pre;
133 } 134 }
134 } 135 }
135 mutex_unlock(&ipu_pre_list_mutex); 136 mutex_unlock(&ipu_pre_list_mutex);
136 137
138 of_node_put(pre_node);
139
137 return NULL; 140 return NULL;
138} 141}
139 142
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
index 067365c733c6..97b99500153d 100644
--- a/drivers/gpu/ipu-v3/ipu-prg.c
+++ b/drivers/gpu/ipu-v3/ipu-prg.c
@@ -102,11 +102,14 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
102 mutex_unlock(&ipu_prg_list_mutex); 102 mutex_unlock(&ipu_prg_list_mutex);
103 device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE); 103 device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
104 prg->id = ipu_id; 104 prg->id = ipu_id;
105 of_node_put(prg_node);
105 return prg; 106 return prg;
106 } 107 }
107 } 108 }
108 mutex_unlock(&ipu_prg_list_mutex); 109 mutex_unlock(&ipu_prg_list_mutex);
109 110
111 of_node_put(prg_node);
112
110 return NULL; 113 return NULL;
111} 114}
112 115
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 43ddcdfbd0da..9454ac134ce2 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -645,6 +645,9 @@
645#define USB_DEVICE_ID_LD_MICROCASSYTIME 0x1033 645#define USB_DEVICE_ID_LD_MICROCASSYTIME 0x1033
646#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE 0x1035 646#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE 0x1035
647#define USB_DEVICE_ID_LD_MICROCASSYPH 0x1038 647#define USB_DEVICE_ID_LD_MICROCASSYPH 0x1038
648#define USB_DEVICE_ID_LD_POWERANALYSERCASSY 0x1040
649#define USB_DEVICE_ID_LD_CONVERTERCONTROLLERCASSY 0x1042
650#define USB_DEVICE_ID_LD_MACHINETESTCASSY 0x1043
648#define USB_DEVICE_ID_LD_JWM 0x1080 651#define USB_DEVICE_ID_LD_JWM 0x1080
649#define USB_DEVICE_ID_LD_DMMP 0x1081 652#define USB_DEVICE_ID_LD_DMMP 0x1081
650#define USB_DEVICE_ID_LD_UMIP 0x1090 653#define USB_DEVICE_ID_LD_UMIP 0x1090
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 5f6035a5ce36..e92b77fa574a 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -809,6 +809,9 @@ static const struct hid_device_id hid_ignore_list[] = {
809 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTIME) }, 809 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTIME) },
810 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE) }, 810 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE) },
811 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYPH) }, 811 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYPH) },
812 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERANALYSERCASSY) },
813 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CONVERTERCONTROLLERCASSY) },
814 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETESTCASSY) },
812 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) }, 815 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) },
813 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) }, 816 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) },
814 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) }, 817 { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) },
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 4bdbf77f7197..72c338eb5fae 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -269,13 +269,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
269 for (i = 0; i < ARRAY_SIZE(tjmax_model_table); i++) { 269 for (i = 0; i < ARRAY_SIZE(tjmax_model_table); i++) {
270 const struct tjmax_model *tm = &tjmax_model_table[i]; 270 const struct tjmax_model *tm = &tjmax_model_table[i];
271 if (c->x86_model == tm->model && 271 if (c->x86_model == tm->model &&
272 (tm->mask == ANY || c->x86_mask == tm->mask)) 272 (tm->mask == ANY || c->x86_stepping == tm->mask))
273 return tm->tjmax; 273 return tm->tjmax;
274 } 274 }
275 275
276 /* Early chips have no MSR for TjMax */ 276 /* Early chips have no MSR for TjMax */
277 277
278 if (c->x86_model == 0xf && c->x86_mask < 4) 278 if (c->x86_model == 0xf && c->x86_stepping < 4)
279 usemsr_ee = 0; 279 usemsr_ee = 0;
280 280
281 if (c->x86_model > 0xe && usemsr_ee) { 281 if (c->x86_model > 0xe && usemsr_ee) {
@@ -426,7 +426,7 @@ static int chk_ucode_version(unsigned int cpu)
426 * Readings might stop update when processor visited too deep sleep, 426 * Readings might stop update when processor visited too deep sleep,
427 * fixed for stepping D0 (6EC). 427 * fixed for stepping D0 (6EC).
428 */ 428 */
429 if (c->x86_model == 0xe && c->x86_mask < 0xc && c->microcode < 0x39) { 429 if (c->x86_model == 0xe && c->x86_stepping < 0xc && c->microcode < 0x39) {
430 pr_err("Errata AE18 not fixed, update BIOS or microcode of the CPU!\n"); 430 pr_err("Errata AE18 not fixed, update BIOS or microcode of the CPU!\n");
431 return -ENODEV; 431 return -ENODEV;
432 } 432 }
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index ef91b8a67549..84e91286fc4f 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -293,7 +293,7 @@ u8 vid_which_vrm(void)
293 if (c->x86 < 6) /* Any CPU with family lower than 6 */ 293 if (c->x86 < 6) /* Any CPU with family lower than 6 */
294 return 0; /* doesn't have VID */ 294 return 0; /* doesn't have VID */
295 295
296 vrm_ret = find_vrm(c->x86, c->x86_model, c->x86_mask, c->x86_vendor); 296 vrm_ret = find_vrm(c->x86, c->x86_model, c->x86_stepping, c->x86_vendor);
297 if (vrm_ret == 134) 297 if (vrm_ret == 134)
298 vrm_ret = get_via_model_d_vrm(); 298 vrm_ret = get_via_model_d_vrm();
299 if (vrm_ret == 0) 299 if (vrm_ret == 0)
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 06b4e1c78bd8..051a72eecb24 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -129,7 +129,10 @@ static ssize_t temp1_input_show(struct device *dev,
129 129
130 data->read_tempreg(data->pdev, &regval); 130 data->read_tempreg(data->pdev, &regval);
131 temp = (regval >> 21) * 125; 131 temp = (regval >> 21) * 125;
132 temp -= data->temp_offset; 132 if (temp > data->temp_offset)
133 temp -= data->temp_offset;
134 else
135 temp = 0;
133 136
134 return sprintf(buf, "%u\n", temp); 137 return sprintf(buf, "%u\n", temp);
135} 138}
@@ -227,7 +230,7 @@ static bool has_erratum_319(struct pci_dev *pdev)
227 * and AM3 formats, but that's the best we can do. 230 * and AM3 formats, but that's the best we can do.
228 */ 231 */
229 return boot_cpu_data.x86_model < 4 || 232 return boot_cpu_data.x86_model < 4 ||
230 (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2); 233 (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_stepping <= 2);
231} 234}
232 235
233static int k10temp_probe(struct pci_dev *pdev, 236static int k10temp_probe(struct pci_dev *pdev,
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index 5a632bcf869b..e59f9113fb93 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -187,7 +187,7 @@ static int k8temp_probe(struct pci_dev *pdev,
187 return -ENOMEM; 187 return -ENOMEM;
188 188
189 model = boot_cpu_data.x86_model; 189 model = boot_cpu_data.x86_model;
190 stepping = boot_cpu_data.x86_mask; 190 stepping = boot_cpu_data.x86_stepping;
191 191
192 /* feature available since SH-C0, exclude older revisions */ 192 /* feature available since SH-C0, exclude older revisions */
193 if ((model == 4 && stepping == 0) || 193 if ((model == 4 && stepping == 0) ||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index a9805c7cb305..e2954fb86d65 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -123,8 +123,10 @@ config I2C_I801
123 Wildcat Point (PCH) 123 Wildcat Point (PCH)
124 Wildcat Point-LP (PCH) 124 Wildcat Point-LP (PCH)
125 BayTrail (SOC) 125 BayTrail (SOC)
126 Braswell (SOC)
126 Sunrise Point-H (PCH) 127 Sunrise Point-H (PCH)
127 Sunrise Point-LP (PCH) 128 Sunrise Point-LP (PCH)
129 Kaby Lake-H (PCH)
128 DNV (SOC) 130 DNV (SOC)
129 Broxton (SOC) 131 Broxton (SOC)
130 Lewisburg (PCH) 132 Lewisburg (PCH)
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index cd07a69e2e93..44deae78913e 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -50,6 +50,9 @@
50#define BCM2835_I2C_S_CLKT BIT(9) 50#define BCM2835_I2C_S_CLKT BIT(9)
51#define BCM2835_I2C_S_LEN BIT(10) /* Fake bit for SW error reporting */ 51#define BCM2835_I2C_S_LEN BIT(10) /* Fake bit for SW error reporting */
52 52
53#define BCM2835_I2C_FEDL_SHIFT 16
54#define BCM2835_I2C_REDL_SHIFT 0
55
53#define BCM2835_I2C_CDIV_MIN 0x0002 56#define BCM2835_I2C_CDIV_MIN 0x0002
54#define BCM2835_I2C_CDIV_MAX 0xFFFE 57#define BCM2835_I2C_CDIV_MAX 0xFFFE
55 58
@@ -81,7 +84,7 @@ static inline u32 bcm2835_i2c_readl(struct bcm2835_i2c_dev *i2c_dev, u32 reg)
81 84
82static int bcm2835_i2c_set_divider(struct bcm2835_i2c_dev *i2c_dev) 85static int bcm2835_i2c_set_divider(struct bcm2835_i2c_dev *i2c_dev)
83{ 86{
84 u32 divider; 87 u32 divider, redl, fedl;
85 88
86 divider = DIV_ROUND_UP(clk_get_rate(i2c_dev->clk), 89 divider = DIV_ROUND_UP(clk_get_rate(i2c_dev->clk),
87 i2c_dev->bus_clk_rate); 90 i2c_dev->bus_clk_rate);
@@ -100,6 +103,22 @@ static int bcm2835_i2c_set_divider(struct bcm2835_i2c_dev *i2c_dev)
100 103
101 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_DIV, divider); 104 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_DIV, divider);
102 105
106 /*
107 * Number of core clocks to wait after falling edge before
108 * outputting the next data bit. Note that both FEDL and REDL
109 * can't be greater than CDIV/2.
110 */
111 fedl = max(divider / 16, 1u);
112
113 /*
114 * Number of core clocks to wait after rising edge before
115 * sampling the next incoming data bit.
116 */
117 redl = max(divider / 4, 1u);
118
119 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_DEL,
120 (fedl << BCM2835_I2C_FEDL_SHIFT) |
121 (redl << BCM2835_I2C_REDL_SHIFT));
103 return 0; 122 return 0;
104} 123}
105 124
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index ae691884d071..05732531829f 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -209,7 +209,7 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
209 i2c_dw_disable_int(dev); 209 i2c_dw_disable_int(dev);
210 210
211 /* Enable the adapter */ 211 /* Enable the adapter */
212 __i2c_dw_enable(dev, true); 212 __i2c_dw_enable_and_wait(dev, true);
213 213
214 /* Clear and enable interrupts */ 214 /* Clear and enable interrupts */
215 dw_readl(dev, DW_IC_CLR_INTR); 215 dw_readl(dev, DW_IC_CLR_INTR);
@@ -644,7 +644,7 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
644 gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH); 644 gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH);
645 if (IS_ERR(gpio)) { 645 if (IS_ERR(gpio)) {
646 r = PTR_ERR(gpio); 646 r = PTR_ERR(gpio);
647 if (r == -ENOENT) 647 if (r == -ENOENT || r == -ENOSYS)
648 return 0; 648 return 0;
649 return r; 649 return r;
650 } 650 }
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 8eac00efadc1..692b34125866 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -58,6 +58,7 @@
58 * Wildcat Point (PCH) 0x8ca2 32 hard yes yes yes 58 * Wildcat Point (PCH) 0x8ca2 32 hard yes yes yes
59 * Wildcat Point-LP (PCH) 0x9ca2 32 hard yes yes yes 59 * Wildcat Point-LP (PCH) 0x9ca2 32 hard yes yes yes
60 * BayTrail (SOC) 0x0f12 32 hard yes yes yes 60 * BayTrail (SOC) 0x0f12 32 hard yes yes yes
61 * Braswell (SOC) 0x2292 32 hard yes yes yes
61 * Sunrise Point-H (PCH) 0xa123 32 hard yes yes yes 62 * Sunrise Point-H (PCH) 0xa123 32 hard yes yes yes
62 * Sunrise Point-LP (PCH) 0x9d23 32 hard yes yes yes 63 * Sunrise Point-LP (PCH) 0x9d23 32 hard yes yes yes
63 * DNV (SOC) 0x19df 32 hard yes yes yes 64 * DNV (SOC) 0x19df 32 hard yes yes yes
diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
index 1d8775799056..d9607905dc2f 100644
--- a/drivers/i2c/busses/i2c-octeon-core.c
+++ b/drivers/i2c/busses/i2c-octeon-core.c
@@ -233,6 +233,7 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read)
233 return -EOPNOTSUPP; 233 return -EOPNOTSUPP;
234 234
235 case STAT_TXDATA_NAK: 235 case STAT_TXDATA_NAK:
236 case STAT_BUS_ERROR:
236 return -EIO; 237 return -EIO;
237 case STAT_TXADDR_NAK: 238 case STAT_TXADDR_NAK:
238 case STAT_RXADDR_NAK: 239 case STAT_RXADDR_NAK:
diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
index a7ef19855bb8..9bb9f64fdda0 100644
--- a/drivers/i2c/busses/i2c-octeon-core.h
+++ b/drivers/i2c/busses/i2c-octeon-core.h
@@ -43,7 +43,7 @@
43#define TWSI_CTL_AAK 0x04 /* Assert ACK */ 43#define TWSI_CTL_AAK 0x04 /* Assert ACK */
44 44
45/* Status values */ 45/* Status values */
46#define STAT_ERROR 0x00 46#define STAT_BUS_ERROR 0x00
47#define STAT_START 0x08 47#define STAT_START 0x08
48#define STAT_REP_START 0x10 48#define STAT_REP_START 0x10
49#define STAT_TXADDR_ACK 0x18 49#define STAT_TXADDR_ACK 0x18
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 2fd8b6d00391..87197ece0f90 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -341,7 +341,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
341 platform_set_drvdata(pdev, adap); 341 platform_set_drvdata(pdev, adap);
342 init_completion(&siic->done); 342 init_completion(&siic->done);
343 343
344 /* Controller Initalisation */ 344 /* Controller initialisation */
345 345
346 writel(SIRFSOC_I2C_RESET, siic->base + SIRFSOC_I2C_CTRL); 346 writel(SIRFSOC_I2C_RESET, siic->base + SIRFSOC_I2C_CTRL);
347 while (readl(siic->base + SIRFSOC_I2C_CTRL) & SIRFSOC_I2C_RESET) 347 while (readl(siic->base + SIRFSOC_I2C_CTRL) & SIRFSOC_I2C_RESET)
@@ -369,7 +369,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
369 * but they start to affect the speed when clock is set to faster 369 * but they start to affect the speed when clock is set to faster
370 * frequencies. 370 * frequencies.
371 * Through the actual tests, use the different user_div value(which 371 * Through the actual tests, use the different user_div value(which
372 * in the divider formular 'Fio / (Fi2c * user_div)') to adapt 372 * in the divider formula 'Fio / (Fi2c * user_div)') to adapt
373 * the different ranges of i2c bus clock frequency, to make the SCL 373 * the different ranges of i2c bus clock frequency, to make the SCL
374 * more accurate. 374 * more accurate.
375 */ 375 */
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 17fd55af4d92..caa20eb5f26b 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -928,7 +928,7 @@ static int exact_lock(dev_t dev, void *data)
928{ 928{
929 struct gendisk *p = data; 929 struct gendisk *p = data;
930 930
931 if (!get_disk(p)) 931 if (!get_disk_and_module(p))
932 return -1; 932 return -1;
933 return 0; 933 return 0;
934} 934}
diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 327a49ba1991..9515ca165dfd 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -243,7 +243,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
243 ASPEED_ADC_INIT_POLLING_TIME, 243 ASPEED_ADC_INIT_POLLING_TIME,
244 ASPEED_ADC_INIT_TIMEOUT); 244 ASPEED_ADC_INIT_TIMEOUT);
245 if (ret) 245 if (ret)
246 goto scaler_error; 246 goto poll_timeout_error;
247 } 247 }
248 248
249 /* Start all channels in normal mode. */ 249 /* Start all channels in normal mode. */
@@ -274,9 +274,10 @@ iio_register_error:
274 writel(ASPEED_OPERATION_MODE_POWER_DOWN, 274 writel(ASPEED_OPERATION_MODE_POWER_DOWN,
275 data->base + ASPEED_REG_ENGINE_CONTROL); 275 data->base + ASPEED_REG_ENGINE_CONTROL);
276 clk_disable_unprepare(data->clk_scaler->clk); 276 clk_disable_unprepare(data->clk_scaler->clk);
277reset_error:
278 reset_control_assert(data->rst);
279clk_enable_error: 277clk_enable_error:
278poll_timeout_error:
279 reset_control_assert(data->rst);
280reset_error:
280 clk_hw_unregister_divider(data->clk_scaler); 281 clk_hw_unregister_divider(data->clk_scaler);
281scaler_error: 282scaler_error:
282 clk_hw_unregister_divider(data->clk_prescaler); 283 clk_hw_unregister_divider(data->clk_prescaler);
diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index 7f5def465340..9a2583caedaa 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -722,8 +722,6 @@ static int stm32h7_adc_enable(struct stm32_adc *adc)
722 int ret; 722 int ret;
723 u32 val; 723 u32 val;
724 724
725 /* Clear ADRDY by writing one, then enable ADC */
726 stm32_adc_set_bits(adc, STM32H7_ADC_ISR, STM32H7_ADRDY);
727 stm32_adc_set_bits(adc, STM32H7_ADC_CR, STM32H7_ADEN); 725 stm32_adc_set_bits(adc, STM32H7_ADC_CR, STM32H7_ADEN);
728 726
729 /* Poll for ADRDY to be set (after adc startup time) */ 727 /* Poll for ADRDY to be set (after adc startup time) */
@@ -731,8 +729,11 @@ static int stm32h7_adc_enable(struct stm32_adc *adc)
731 val & STM32H7_ADRDY, 729 val & STM32H7_ADRDY,
732 100, STM32_ADC_TIMEOUT_US); 730 100, STM32_ADC_TIMEOUT_US);
733 if (ret) { 731 if (ret) {
734 stm32_adc_clr_bits(adc, STM32H7_ADC_CR, STM32H7_ADEN); 732 stm32_adc_set_bits(adc, STM32H7_ADC_CR, STM32H7_ADDIS);
735 dev_err(&indio_dev->dev, "Failed to enable ADC\n"); 733 dev_err(&indio_dev->dev, "Failed to enable ADC\n");
734 } else {
735 /* Clear ADRDY by writing one */
736 stm32_adc_set_bits(adc, STM32H7_ADC_ISR, STM32H7_ADRDY);
736 } 737 }
737 738
738 return ret; 739 return ret;
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c
index 0dd5a381be64..457372f36791 100644
--- a/drivers/iio/imu/adis_trigger.c
+++ b/drivers/iio/imu/adis_trigger.c
@@ -46,6 +46,10 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
46 if (adis->trig == NULL) 46 if (adis->trig == NULL)
47 return -ENOMEM; 47 return -ENOMEM;
48 48
49 adis->trig->dev.parent = &adis->spi->dev;
50 adis->trig->ops = &adis_trigger_ops;
51 iio_trigger_set_drvdata(adis->trig, adis);
52
49 ret = request_irq(adis->spi->irq, 53 ret = request_irq(adis->spi->irq,
50 &iio_trigger_generic_data_rdy_poll, 54 &iio_trigger_generic_data_rdy_poll,
51 IRQF_TRIGGER_RISING, 55 IRQF_TRIGGER_RISING,
@@ -54,9 +58,6 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
54 if (ret) 58 if (ret)
55 goto error_free_trig; 59 goto error_free_trig;
56 60
57 adis->trig->dev.parent = &adis->spi->dev;
58 adis->trig->ops = &adis_trigger_ops;
59 iio_trigger_set_drvdata(adis->trig, adis);
60 ret = iio_trigger_register(adis->trig); 61 ret = iio_trigger_register(adis->trig);
61 62
62 indio_dev->trig = iio_trigger_get(adis->trig); 63 indio_dev->trig = iio_trigger_get(adis->trig);
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 79abf70a126d..cd5bfe39591b 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -175,7 +175,7 @@ __poll_t iio_buffer_poll(struct file *filp,
175 struct iio_dev *indio_dev = filp->private_data; 175 struct iio_dev *indio_dev = filp->private_data;
176 struct iio_buffer *rb = indio_dev->buffer; 176 struct iio_buffer *rb = indio_dev->buffer;
177 177
178 if (!indio_dev->info) 178 if (!indio_dev->info || rb == NULL)
179 return 0; 179 return 0;
180 180
181 poll_wait(filp, &rb->pollq, wait); 181 poll_wait(filp, &rb->pollq, wait);
diff --git a/drivers/iio/proximity/Kconfig b/drivers/iio/proximity/Kconfig
index fcb1c4ba5e41..f726f9427602 100644
--- a/drivers/iio/proximity/Kconfig
+++ b/drivers/iio/proximity/Kconfig
@@ -68,6 +68,8 @@ config SX9500
68 68
69config SRF08 69config SRF08
70 tristate "Devantech SRF02/SRF08/SRF10 ultrasonic ranger sensor" 70 tristate "Devantech SRF02/SRF08/SRF10 ultrasonic ranger sensor"
71 select IIO_BUFFER
72 select IIO_TRIGGERED_BUFFER
71 depends on I2C 73 depends on I2C
72 help 74 help
73 Say Y here to build a driver for Devantech SRF02/SRF08/SRF10 75 Say Y here to build a driver for Devantech SRF02/SRF08/SRF10
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index c4560d84dfae..25bb178f6074 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -305,16 +305,21 @@ void nldev_exit(void);
305static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, 305static inline struct ib_qp *_ib_create_qp(struct ib_device *dev,
306 struct ib_pd *pd, 306 struct ib_pd *pd,
307 struct ib_qp_init_attr *attr, 307 struct ib_qp_init_attr *attr,
308 struct ib_udata *udata) 308 struct ib_udata *udata,
309 struct ib_uobject *uobj)
309{ 310{
310 struct ib_qp *qp; 311 struct ib_qp *qp;
311 312
313 if (!dev->create_qp)
314 return ERR_PTR(-EOPNOTSUPP);
315
312 qp = dev->create_qp(pd, attr, udata); 316 qp = dev->create_qp(pd, attr, udata);
313 if (IS_ERR(qp)) 317 if (IS_ERR(qp))
314 return qp; 318 return qp;
315 319
316 qp->device = dev; 320 qp->device = dev;
317 qp->pd = pd; 321 qp->pd = pd;
322 qp->uobject = uobj;
318 /* 323 /*
319 * We don't track XRC QPs for now, because they don't have PD 324 * We don't track XRC QPs for now, because they don't have PD
320 * and more importantly they are created internaly by driver, 325 * and more importantly they are created internaly by driver,
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 85b5ee4defa4..d8eead5d106d 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -141,7 +141,12 @@ static struct ib_uobject *alloc_uobj(struct ib_ucontext *context,
141 */ 141 */
142 uobj->context = context; 142 uobj->context = context;
143 uobj->type = type; 143 uobj->type = type;
144 atomic_set(&uobj->usecnt, 0); 144 /*
145 * Allocated objects start out as write locked to deny any other
146 * syscalls from accessing them until they are committed. See
147 * rdma_alloc_commit_uobject
148 */
149 atomic_set(&uobj->usecnt, -1);
145 kref_init(&uobj->ref); 150 kref_init(&uobj->ref);
146 151
147 return uobj; 152 return uobj;
@@ -196,7 +201,15 @@ static struct ib_uobject *lookup_get_idr_uobject(const struct uverbs_obj_type *t
196 goto free; 201 goto free;
197 } 202 }
198 203
199 uverbs_uobject_get(uobj); 204 /*
205 * The idr_find is guaranteed to return a pointer to something that
206 * isn't freed yet, or NULL, as the free after idr_remove goes through
207 * kfree_rcu(). However the object may still have been released and
208 * kfree() could be called at any time.
209 */
210 if (!kref_get_unless_zero(&uobj->ref))
211 uobj = ERR_PTR(-ENOENT);
212
200free: 213free:
201 rcu_read_unlock(); 214 rcu_read_unlock();
202 return uobj; 215 return uobj;
@@ -399,13 +412,13 @@ static int __must_check remove_commit_fd_uobject(struct ib_uobject *uobj,
399 return ret; 412 return ret;
400} 413}
401 414
402static void lockdep_check(struct ib_uobject *uobj, bool exclusive) 415static void assert_uverbs_usecnt(struct ib_uobject *uobj, bool exclusive)
403{ 416{
404#ifdef CONFIG_LOCKDEP 417#ifdef CONFIG_LOCKDEP
405 if (exclusive) 418 if (exclusive)
406 WARN_ON(atomic_read(&uobj->usecnt) > 0); 419 WARN_ON(atomic_read(&uobj->usecnt) != -1);
407 else 420 else
408 WARN_ON(atomic_read(&uobj->usecnt) == -1); 421 WARN_ON(atomic_read(&uobj->usecnt) <= 0);
409#endif 422#endif
410} 423}
411 424
@@ -444,7 +457,7 @@ int __must_check rdma_remove_commit_uobject(struct ib_uobject *uobj)
444 WARN(true, "ib_uverbs: Cleanup is running while removing an uobject\n"); 457 WARN(true, "ib_uverbs: Cleanup is running while removing an uobject\n");
445 return 0; 458 return 0;
446 } 459 }
447 lockdep_check(uobj, true); 460 assert_uverbs_usecnt(uobj, true);
448 ret = _rdma_remove_commit_uobject(uobj, RDMA_REMOVE_DESTROY); 461 ret = _rdma_remove_commit_uobject(uobj, RDMA_REMOVE_DESTROY);
449 462
450 up_read(&ucontext->cleanup_rwsem); 463 up_read(&ucontext->cleanup_rwsem);
@@ -474,16 +487,17 @@ int rdma_explicit_destroy(struct ib_uobject *uobject)
474 WARN(true, "ib_uverbs: Cleanup is running while removing an uobject\n"); 487 WARN(true, "ib_uverbs: Cleanup is running while removing an uobject\n");
475 return 0; 488 return 0;
476 } 489 }
477 lockdep_check(uobject, true); 490 assert_uverbs_usecnt(uobject, true);
478 ret = uobject->type->type_class->remove_commit(uobject, 491 ret = uobject->type->type_class->remove_commit(uobject,
479 RDMA_REMOVE_DESTROY); 492 RDMA_REMOVE_DESTROY);
480 if (ret) 493 if (ret)
481 return ret; 494 goto out;
482 495
483 uobject->type = &null_obj_type; 496 uobject->type = &null_obj_type;
484 497
498out:
485 up_read(&ucontext->cleanup_rwsem); 499 up_read(&ucontext->cleanup_rwsem);
486 return 0; 500 return ret;
487} 501}
488 502
489static void alloc_commit_idr_uobject(struct ib_uobject *uobj) 503static void alloc_commit_idr_uobject(struct ib_uobject *uobj)
@@ -527,6 +541,10 @@ int rdma_alloc_commit_uobject(struct ib_uobject *uobj)
527 return ret; 541 return ret;
528 } 542 }
529 543
544 /* matches atomic_set(-1) in alloc_uobj */
545 assert_uverbs_usecnt(uobj, true);
546 atomic_set(&uobj->usecnt, 0);
547
530 uobj->type->type_class->alloc_commit(uobj); 548 uobj->type->type_class->alloc_commit(uobj);
531 up_read(&uobj->context->cleanup_rwsem); 549 up_read(&uobj->context->cleanup_rwsem);
532 550
@@ -561,7 +579,7 @@ static void lookup_put_fd_uobject(struct ib_uobject *uobj, bool exclusive)
561 579
562void rdma_lookup_put_uobject(struct ib_uobject *uobj, bool exclusive) 580void rdma_lookup_put_uobject(struct ib_uobject *uobj, bool exclusive)
563{ 581{
564 lockdep_check(uobj, exclusive); 582 assert_uverbs_usecnt(uobj, exclusive);
565 uobj->type->type_class->lookup_put(uobj, exclusive); 583 uobj->type->type_class->lookup_put(uobj, exclusive);
566 /* 584 /*
567 * In order to unlock an object, either decrease its usecnt for 585 * In order to unlock an object, either decrease its usecnt for
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index 857637bf46da..3dbc4e4cca41 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -7,7 +7,6 @@
7#include <rdma/restrack.h> 7#include <rdma/restrack.h>
8#include <linux/mutex.h> 8#include <linux/mutex.h>
9#include <linux/sched/task.h> 9#include <linux/sched/task.h>
10#include <linux/uaccess.h>
11#include <linux/pid_namespace.h> 10#include <linux/pid_namespace.h>
12 11
13void rdma_restrack_init(struct rdma_restrack_root *res) 12void rdma_restrack_init(struct rdma_restrack_root *res)
@@ -63,7 +62,6 @@ static struct ib_device *res_to_dev(struct rdma_restrack_entry *res)
63{ 62{
64 enum rdma_restrack_type type = res->type; 63 enum rdma_restrack_type type = res->type;
65 struct ib_device *dev; 64 struct ib_device *dev;
66 struct ib_xrcd *xrcd;
67 struct ib_pd *pd; 65 struct ib_pd *pd;
68 struct ib_cq *cq; 66 struct ib_cq *cq;
69 struct ib_qp *qp; 67 struct ib_qp *qp;
@@ -81,10 +79,6 @@ static struct ib_device *res_to_dev(struct rdma_restrack_entry *res)
81 qp = container_of(res, struct ib_qp, res); 79 qp = container_of(res, struct ib_qp, res);
82 dev = qp->device; 80 dev = qp->device;
83 break; 81 break;
84 case RDMA_RESTRACK_XRCD:
85 xrcd = container_of(res, struct ib_xrcd, res);
86 dev = xrcd->device;
87 break;
88 default: 82 default:
89 WARN_ONCE(true, "Wrong resource tracking type %u\n", type); 83 WARN_ONCE(true, "Wrong resource tracking type %u\n", type);
90 return NULL; 84 return NULL;
@@ -93,6 +87,21 @@ static struct ib_device *res_to_dev(struct rdma_restrack_entry *res)
93 return dev; 87 return dev;
94} 88}
95 89
90static bool res_is_user(struct rdma_restrack_entry *res)
91{
92 switch (res->type) {
93 case RDMA_RESTRACK_PD:
94 return container_of(res, struct ib_pd, res)->uobject;
95 case RDMA_RESTRACK_CQ:
96 return container_of(res, struct ib_cq, res)->uobject;
97 case RDMA_RESTRACK_QP:
98 return container_of(res, struct ib_qp, res)->uobject;
99 default:
100 WARN_ONCE(true, "Wrong resource tracking type %u\n", res->type);
101 return false;
102 }
103}
104
96void rdma_restrack_add(struct rdma_restrack_entry *res) 105void rdma_restrack_add(struct rdma_restrack_entry *res)
97{ 106{
98 struct ib_device *dev = res_to_dev(res); 107 struct ib_device *dev = res_to_dev(res);
@@ -100,7 +109,7 @@ void rdma_restrack_add(struct rdma_restrack_entry *res)
100 if (!dev) 109 if (!dev)
101 return; 110 return;
102 111
103 if (!uaccess_kernel()) { 112 if (res_is_user(res)) {
104 get_task_struct(current); 113 get_task_struct(current);
105 res->task = current; 114 res->task = current;
106 res->kern_name = NULL; 115 res->kern_name = NULL;
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 256934d1f64f..a148de35df8d 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -562,9 +562,10 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
562 if (f.file) 562 if (f.file)
563 fdput(f); 563 fdput(f);
564 564
565 mutex_unlock(&file->device->xrcd_tree_mutex);
566
565 uobj_alloc_commit(&obj->uobject); 567 uobj_alloc_commit(&obj->uobject);
566 568
567 mutex_unlock(&file->device->xrcd_tree_mutex);
568 return in_len; 569 return in_len;
569 570
570err_copy: 571err_copy:
@@ -603,10 +604,8 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *file,
603 604
604 uobj = uobj_get_write(uobj_get_type(xrcd), cmd.xrcd_handle, 605 uobj = uobj_get_write(uobj_get_type(xrcd), cmd.xrcd_handle,
605 file->ucontext); 606 file->ucontext);
606 if (IS_ERR(uobj)) { 607 if (IS_ERR(uobj))
607 mutex_unlock(&file->device->xrcd_tree_mutex);
608 return PTR_ERR(uobj); 608 return PTR_ERR(uobj);
609 }
610 609
611 ret = uobj_remove_commit(uobj); 610 ret = uobj_remove_commit(uobj);
612 return ret ?: in_len; 611 return ret ?: in_len;
@@ -979,6 +978,9 @@ static struct ib_ucq_object *create_cq(struct ib_uverbs_file *file,
979 struct ib_uverbs_ex_create_cq_resp resp; 978 struct ib_uverbs_ex_create_cq_resp resp;
980 struct ib_cq_init_attr attr = {}; 979 struct ib_cq_init_attr attr = {};
981 980
981 if (!ib_dev->create_cq)
982 return ERR_PTR(-EOPNOTSUPP);
983
982 if (cmd->comp_vector >= file->device->num_comp_vectors) 984 if (cmd->comp_vector >= file->device->num_comp_vectors)
983 return ERR_PTR(-EINVAL); 985 return ERR_PTR(-EINVAL);
984 986
@@ -1030,14 +1032,14 @@ static struct ib_ucq_object *create_cq(struct ib_uverbs_file *file,
1030 resp.response_length = offsetof(typeof(resp), response_length) + 1032 resp.response_length = offsetof(typeof(resp), response_length) +
1031 sizeof(resp.response_length); 1033 sizeof(resp.response_length);
1032 1034
1035 cq->res.type = RDMA_RESTRACK_CQ;
1036 rdma_restrack_add(&cq->res);
1037
1033 ret = cb(file, obj, &resp, ucore, context); 1038 ret = cb(file, obj, &resp, ucore, context);
1034 if (ret) 1039 if (ret)
1035 goto err_cb; 1040 goto err_cb;
1036 1041
1037 uobj_alloc_commit(&obj->uobject); 1042 uobj_alloc_commit(&obj->uobject);
1038 cq->res.type = RDMA_RESTRACK_CQ;
1039 rdma_restrack_add(&cq->res);
1040
1041 return obj; 1043 return obj;
1042 1044
1043err_cb: 1045err_cb:
@@ -1518,7 +1520,8 @@ static int create_qp(struct ib_uverbs_file *file,
1518 if (cmd->qp_type == IB_QPT_XRC_TGT) 1520 if (cmd->qp_type == IB_QPT_XRC_TGT)
1519 qp = ib_create_qp(pd, &attr); 1521 qp = ib_create_qp(pd, &attr);
1520 else 1522 else
1521 qp = _ib_create_qp(device, pd, &attr, uhw); 1523 qp = _ib_create_qp(device, pd, &attr, uhw,
1524 &obj->uevent.uobject);
1522 1525
1523 if (IS_ERR(qp)) { 1526 if (IS_ERR(qp)) {
1524 ret = PTR_ERR(qp); 1527 ret = PTR_ERR(qp);
@@ -1550,8 +1553,10 @@ static int create_qp(struct ib_uverbs_file *file,
1550 atomic_inc(&attr.srq->usecnt); 1553 atomic_inc(&attr.srq->usecnt);
1551 if (ind_tbl) 1554 if (ind_tbl)
1552 atomic_inc(&ind_tbl->usecnt); 1555 atomic_inc(&ind_tbl->usecnt);
1556 } else {
1557 /* It is done in _ib_create_qp for other QP types */
1558 qp->uobject = &obj->uevent.uobject;
1553 } 1559 }
1554 qp->uobject = &obj->uevent.uobject;
1555 1560
1556 obj->uevent.uobject.object = qp; 1561 obj->uevent.uobject.object = qp;
1557 1562
@@ -1971,8 +1976,15 @@ static int modify_qp(struct ib_uverbs_file *file,
1971 goto release_qp; 1976 goto release_qp;
1972 } 1977 }
1973 1978
1979 if ((cmd->base.attr_mask & IB_QP_AV) &&
1980 !rdma_is_port_valid(qp->device, cmd->base.dest.port_num)) {
1981 ret = -EINVAL;
1982 goto release_qp;
1983 }
1984
1974 if ((cmd->base.attr_mask & IB_QP_ALT_PATH) && 1985 if ((cmd->base.attr_mask & IB_QP_ALT_PATH) &&
1975 !rdma_is_port_valid(qp->device, cmd->base.alt_port_num)) { 1986 (!rdma_is_port_valid(qp->device, cmd->base.alt_port_num) ||
1987 !rdma_is_port_valid(qp->device, cmd->base.alt_dest.port_num))) {
1976 ret = -EINVAL; 1988 ret = -EINVAL;
1977 goto release_qp; 1989 goto release_qp;
1978 } 1990 }
@@ -2941,6 +2953,11 @@ int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file,
2941 wq_init_attr.create_flags = cmd.create_flags; 2953 wq_init_attr.create_flags = cmd.create_flags;
2942 obj->uevent.events_reported = 0; 2954 obj->uevent.events_reported = 0;
2943 INIT_LIST_HEAD(&obj->uevent.event_list); 2955 INIT_LIST_HEAD(&obj->uevent.event_list);
2956
2957 if (!pd->device->create_wq) {
2958 err = -EOPNOTSUPP;
2959 goto err_put_cq;
2960 }
2944 wq = pd->device->create_wq(pd, &wq_init_attr, uhw); 2961 wq = pd->device->create_wq(pd, &wq_init_attr, uhw);
2945 if (IS_ERR(wq)) { 2962 if (IS_ERR(wq)) {
2946 err = PTR_ERR(wq); 2963 err = PTR_ERR(wq);
@@ -3084,7 +3101,12 @@ int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,
3084 wq_attr.flags = cmd.flags; 3101 wq_attr.flags = cmd.flags;
3085 wq_attr.flags_mask = cmd.flags_mask; 3102 wq_attr.flags_mask = cmd.flags_mask;
3086 } 3103 }
3104 if (!wq->device->modify_wq) {
3105 ret = -EOPNOTSUPP;
3106 goto out;
3107 }
3087 ret = wq->device->modify_wq(wq, &wq_attr, cmd.attr_mask, uhw); 3108 ret = wq->device->modify_wq(wq, &wq_attr, cmd.attr_mask, uhw);
3109out:
3088 uobj_put_obj_read(wq); 3110 uobj_put_obj_read(wq);
3089 return ret; 3111 return ret;
3090} 3112}
@@ -3181,6 +3203,11 @@ int ib_uverbs_ex_create_rwq_ind_table(struct ib_uverbs_file *file,
3181 3203
3182 init_attr.log_ind_tbl_size = cmd.log_ind_tbl_size; 3204 init_attr.log_ind_tbl_size = cmd.log_ind_tbl_size;
3183 init_attr.ind_tbl = wqs; 3205 init_attr.ind_tbl = wqs;
3206
3207 if (!ib_dev->create_rwq_ind_table) {
3208 err = -EOPNOTSUPP;
3209 goto err_uobj;
3210 }
3184 rwq_ind_tbl = ib_dev->create_rwq_ind_table(ib_dev, &init_attr, uhw); 3211 rwq_ind_tbl = ib_dev->create_rwq_ind_table(ib_dev, &init_attr, uhw);
3185 3212
3186 if (IS_ERR(rwq_ind_tbl)) { 3213 if (IS_ERR(rwq_ind_tbl)) {
@@ -3770,6 +3797,9 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
3770 struct ib_device_attr attr = {0}; 3797 struct ib_device_attr attr = {0};
3771 int err; 3798 int err;
3772 3799
3800 if (!ib_dev->query_device)
3801 return -EOPNOTSUPP;
3802
3773 if (ucore->inlen < sizeof(cmd)) 3803 if (ucore->inlen < sizeof(cmd))
3774 return -EINVAL; 3804 return -EINVAL;
3775 3805
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index d96dc1d17be1..339b85145044 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -59,6 +59,9 @@ static int uverbs_process_attr(struct ib_device *ibdev,
59 return 0; 59 return 0;
60 } 60 }
61 61
62 if (test_bit(attr_id, attr_bundle_h->valid_bitmap))
63 return -EINVAL;
64
62 spec = &attr_spec_bucket->attrs[attr_id]; 65 spec = &attr_spec_bucket->attrs[attr_id];
63 e = &elements[attr_id]; 66 e = &elements[attr_id];
64 e->uattr = uattr_ptr; 67 e->uattr = uattr_ptr;
diff --git a/drivers/infiniband/core/uverbs_ioctl_merge.c b/drivers/infiniband/core/uverbs_ioctl_merge.c
index 062485f9300d..62e1eb1d2a28 100644
--- a/drivers/infiniband/core/uverbs_ioctl_merge.c
+++ b/drivers/infiniband/core/uverbs_ioctl_merge.c
@@ -114,6 +114,7 @@ static size_t get_elements_above_id(const void **iters,
114 short min = SHRT_MAX; 114 short min = SHRT_MAX;
115 const void *elem; 115 const void *elem;
116 int i, j, last_stored = -1; 116 int i, j, last_stored = -1;
117 unsigned int equal_min = 0;
117 118
118 for_each_element(elem, i, j, elements, num_elements, num_offset, 119 for_each_element(elem, i, j, elements, num_elements, num_offset,
119 data_offset) { 120 data_offset) {
@@ -136,6 +137,10 @@ static size_t get_elements_above_id(const void **iters,
136 */ 137 */
137 iters[last_stored == i ? num_iters - 1 : num_iters++] = elem; 138 iters[last_stored == i ? num_iters - 1 : num_iters++] = elem;
138 last_stored = i; 139 last_stored = i;
140 if (min == GET_ID(id))
141 equal_min++;
142 else
143 equal_min = 1;
139 min = GET_ID(id); 144 min = GET_ID(id);
140 } 145 }
141 146
@@ -146,15 +151,10 @@ static size_t get_elements_above_id(const void **iters,
146 * Therefore, we need to clean the beginning of the array to make sure 151 * Therefore, we need to clean the beginning of the array to make sure
147 * all ids of final elements are equal to min. 152 * all ids of final elements are equal to min.
148 */ 153 */
149 for (i = num_iters - 1; i >= 0 && 154 memmove(iters, iters + num_iters - equal_min, sizeof(*iters) * equal_min);
150 GET_ID(*(u16 *)(iters[i] + id_offset)) == min; i--)
151 ;
152
153 num_iters -= i + 1;
154 memmove(iters, iters + i + 1, sizeof(*iters) * num_iters);
155 155
156 *min_id = min; 156 *min_id = min;
157 return num_iters; 157 return equal_min;
158} 158}
159 159
160#define find_max_element_entry_id(num_elements, elements, num_objects_fld, \ 160#define find_max_element_entry_id(num_elements, elements, num_objects_fld, \
@@ -322,7 +322,7 @@ static struct uverbs_method_spec *build_method_with_attrs(const struct uverbs_me
322 hash = kzalloc(sizeof(*hash) + 322 hash = kzalloc(sizeof(*hash) +
323 ALIGN(sizeof(*hash->attrs) * (attr_max_bucket + 1), 323 ALIGN(sizeof(*hash->attrs) * (attr_max_bucket + 1),
324 sizeof(long)) + 324 sizeof(long)) +
325 BITS_TO_LONGS(attr_max_bucket) * sizeof(long), 325 BITS_TO_LONGS(attr_max_bucket + 1) * sizeof(long),
326 GFP_KERNEL); 326 GFP_KERNEL);
327 if (!hash) { 327 if (!hash) {
328 res = -ENOMEM; 328 res = -ENOMEM;
@@ -509,7 +509,7 @@ static struct uverbs_object_spec *build_object_with_methods(const struct uverbs_
509 * first handler which != NULL. This also defines the 509 * first handler which != NULL. This also defines the
510 * set of flags used for this handler. 510 * set of flags used for this handler.
511 */ 511 */
512 for (i = num_object_defs - 1; 512 for (i = num_method_defs - 1;
513 i >= 0 && !method_defs[i]->handler; i--) 513 i >= 0 && !method_defs[i]->handler; i--)
514 ; 514 ;
515 hash->methods[min_id++] = method; 515 hash->methods[min_id++] = method;
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 395a3b091229..b1ca223aa380 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -650,12 +650,21 @@ static int verify_command_mask(struct ib_device *ib_dev, __u32 command)
650 return -1; 650 return -1;
651} 651}
652 652
653static bool verify_command_idx(u32 command, bool extended)
654{
655 if (extended)
656 return command < ARRAY_SIZE(uverbs_ex_cmd_table);
657
658 return command < ARRAY_SIZE(uverbs_cmd_table);
659}
660
653static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, 661static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
654 size_t count, loff_t *pos) 662 size_t count, loff_t *pos)
655{ 663{
656 struct ib_uverbs_file *file = filp->private_data; 664 struct ib_uverbs_file *file = filp->private_data;
657 struct ib_device *ib_dev; 665 struct ib_device *ib_dev;
658 struct ib_uverbs_cmd_hdr hdr; 666 struct ib_uverbs_cmd_hdr hdr;
667 bool extended_command;
659 __u32 command; 668 __u32 command;
660 __u32 flags; 669 __u32 flags;
661 int srcu_key; 670 int srcu_key;
@@ -688,6 +697,15 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
688 } 697 }
689 698
690 command = hdr.command & IB_USER_VERBS_CMD_COMMAND_MASK; 699 command = hdr.command & IB_USER_VERBS_CMD_COMMAND_MASK;
700 flags = (hdr.command &
701 IB_USER_VERBS_CMD_FLAGS_MASK) >> IB_USER_VERBS_CMD_FLAGS_SHIFT;
702
703 extended_command = flags & IB_USER_VERBS_CMD_FLAG_EXTENDED;
704 if (!verify_command_idx(command, extended_command)) {
705 ret = -EINVAL;
706 goto out;
707 }
708
691 if (verify_command_mask(ib_dev, command)) { 709 if (verify_command_mask(ib_dev, command)) {
692 ret = -EOPNOTSUPP; 710 ret = -EOPNOTSUPP;
693 goto out; 711 goto out;
@@ -699,12 +717,8 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
699 goto out; 717 goto out;
700 } 718 }
701 719
702 flags = (hdr.command &
703 IB_USER_VERBS_CMD_FLAGS_MASK) >> IB_USER_VERBS_CMD_FLAGS_SHIFT;
704
705 if (!flags) { 720 if (!flags) {
706 if (command >= ARRAY_SIZE(uverbs_cmd_table) || 721 if (!uverbs_cmd_table[command]) {
707 !uverbs_cmd_table[command]) {
708 ret = -EINVAL; 722 ret = -EINVAL;
709 goto out; 723 goto out;
710 } 724 }
@@ -725,8 +739,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
725 struct ib_udata uhw; 739 struct ib_udata uhw;
726 size_t written_count = count; 740 size_t written_count = count;
727 741
728 if (command >= ARRAY_SIZE(uverbs_ex_cmd_table) || 742 if (!uverbs_ex_cmd_table[command]) {
729 !uverbs_ex_cmd_table[command]) {
730 ret = -ENOSYS; 743 ret = -ENOSYS;
731 goto out; 744 goto out;
732 } 745 }
@@ -942,6 +955,7 @@ static const struct file_operations uverbs_fops = {
942 .llseek = no_llseek, 955 .llseek = no_llseek,
943#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS) 956#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
944 .unlocked_ioctl = ib_uverbs_ioctl, 957 .unlocked_ioctl = ib_uverbs_ioctl,
958 .compat_ioctl = ib_uverbs_ioctl,
945#endif 959#endif
946}; 960};
947 961
@@ -954,6 +968,7 @@ static const struct file_operations uverbs_mmap_fops = {
954 .llseek = no_llseek, 968 .llseek = no_llseek,
955#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS) 969#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
956 .unlocked_ioctl = ib_uverbs_ioctl, 970 .unlocked_ioctl = ib_uverbs_ioctl,
971 .compat_ioctl = ib_uverbs_ioctl,
957#endif 972#endif
958}; 973};
959 974
diff --git a/drivers/infiniband/core/uverbs_std_types.c b/drivers/infiniband/core/uverbs_std_types.c
index cab0ac3556eb..df1360e6774f 100644
--- a/drivers/infiniband/core/uverbs_std_types.c
+++ b/drivers/infiniband/core/uverbs_std_types.c
@@ -234,15 +234,18 @@ static void create_udata(struct uverbs_attr_bundle *ctx,
234 uverbs_attr_get(ctx, UVERBS_UHW_OUT); 234 uverbs_attr_get(ctx, UVERBS_UHW_OUT);
235 235
236 if (!IS_ERR(uhw_in)) { 236 if (!IS_ERR(uhw_in)) {
237 udata->inbuf = uhw_in->ptr_attr.ptr;
238 udata->inlen = uhw_in->ptr_attr.len; 237 udata->inlen = uhw_in->ptr_attr.len;
238 if (uverbs_attr_ptr_is_inline(uhw_in))
239 udata->inbuf = &uhw_in->uattr->data;
240 else
241 udata->inbuf = u64_to_user_ptr(uhw_in->ptr_attr.data);
239 } else { 242 } else {
240 udata->inbuf = NULL; 243 udata->inbuf = NULL;
241 udata->inlen = 0; 244 udata->inlen = 0;
242 } 245 }
243 246
244 if (!IS_ERR(uhw_out)) { 247 if (!IS_ERR(uhw_out)) {
245 udata->outbuf = uhw_out->ptr_attr.ptr; 248 udata->outbuf = u64_to_user_ptr(uhw_out->ptr_attr.data);
246 udata->outlen = uhw_out->ptr_attr.len; 249 udata->outlen = uhw_out->ptr_attr.len;
247 } else { 250 } else {
248 udata->outbuf = NULL; 251 udata->outbuf = NULL;
@@ -323,7 +326,8 @@ static int uverbs_create_cq_handler(struct ib_device *ib_dev,
323 cq->res.type = RDMA_RESTRACK_CQ; 326 cq->res.type = RDMA_RESTRACK_CQ;
324 rdma_restrack_add(&cq->res); 327 rdma_restrack_add(&cq->res);
325 328
326 ret = uverbs_copy_to(attrs, CREATE_CQ_RESP_CQE, &cq->cqe); 329 ret = uverbs_copy_to(attrs, CREATE_CQ_RESP_CQE, &cq->cqe,
330 sizeof(cq->cqe));
327 if (ret) 331 if (ret)
328 goto err_cq; 332 goto err_cq;
329 333
@@ -375,7 +379,7 @@ static int uverbs_destroy_cq_handler(struct ib_device *ib_dev,
375 resp.comp_events_reported = obj->comp_events_reported; 379 resp.comp_events_reported = obj->comp_events_reported;
376 resp.async_events_reported = obj->async_events_reported; 380 resp.async_events_reported = obj->async_events_reported;
377 381
378 return uverbs_copy_to(attrs, DESTROY_CQ_RESP, &resp); 382 return uverbs_copy_to(attrs, DESTROY_CQ_RESP, &resp, sizeof(resp));
379} 383}
380 384
381static DECLARE_UVERBS_METHOD( 385static DECLARE_UVERBS_METHOD(
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 16ebc6372c31..93025d2009b8 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -887,7 +887,7 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
887 if (qp_init_attr->cap.max_rdma_ctxs) 887 if (qp_init_attr->cap.max_rdma_ctxs)
888 rdma_rw_init_qp(device, qp_init_attr); 888 rdma_rw_init_qp(device, qp_init_attr);
889 889
890 qp = _ib_create_qp(device, pd, qp_init_attr, NULL); 890 qp = _ib_create_qp(device, pd, qp_init_attr, NULL, NULL);
891 if (IS_ERR(qp)) 891 if (IS_ERR(qp))
892 return qp; 892 return qp;
893 893
@@ -898,7 +898,6 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
898 } 898 }
899 899
900 qp->real_qp = qp; 900 qp->real_qp = qp;
901 qp->uobject = NULL;
902 qp->qp_type = qp_init_attr->qp_type; 901 qp->qp_type = qp_init_attr->qp_type;
903 qp->rwq_ind_tbl = qp_init_attr->rwq_ind_tbl; 902 qp->rwq_ind_tbl = qp_init_attr->rwq_ind_tbl;
904 903
diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
index ca32057e886f..3eb7a8387116 100644
--- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h
+++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
@@ -120,7 +120,6 @@ struct bnxt_re_dev {
120#define BNXT_RE_FLAG_HAVE_L2_REF 3 120#define BNXT_RE_FLAG_HAVE_L2_REF 3
121#define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4 121#define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4
122#define BNXT_RE_FLAG_QOS_WORK_REG 5 122#define BNXT_RE_FLAG_QOS_WORK_REG 5
123#define BNXT_RE_FLAG_TASK_IN_PROG 6
124#define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29 123#define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29
125 struct net_device *netdev; 124 struct net_device *netdev;
126 unsigned int version, major, minor; 125 unsigned int version, major, minor;
@@ -158,6 +157,7 @@ struct bnxt_re_dev {
158 atomic_t srq_count; 157 atomic_t srq_count;
159 atomic_t mr_count; 158 atomic_t mr_count;
160 atomic_t mw_count; 159 atomic_t mw_count;
160 atomic_t sched_count;
161 /* Max of 2 lossless traffic class supported per port */ 161 /* Max of 2 lossless traffic class supported per port */
162 u16 cosq[2]; 162 u16 cosq[2];
163 163
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index ae9e9ff54826..643174d949a8 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -174,10 +174,8 @@ int bnxt_re_query_device(struct ib_device *ibdev,
174 ib_attr->max_pd = dev_attr->max_pd; 174 ib_attr->max_pd = dev_attr->max_pd;
175 ib_attr->max_qp_rd_atom = dev_attr->max_qp_rd_atom; 175 ib_attr->max_qp_rd_atom = dev_attr->max_qp_rd_atom;
176 ib_attr->max_qp_init_rd_atom = dev_attr->max_qp_init_rd_atom; 176 ib_attr->max_qp_init_rd_atom = dev_attr->max_qp_init_rd_atom;
177 if (dev_attr->is_atomic) { 177 ib_attr->atomic_cap = IB_ATOMIC_NONE;
178 ib_attr->atomic_cap = IB_ATOMIC_HCA; 178 ib_attr->masked_atomic_cap = IB_ATOMIC_NONE;
179 ib_attr->masked_atomic_cap = IB_ATOMIC_HCA;
180 }
181 179
182 ib_attr->max_ee_rd_atom = 0; 180 ib_attr->max_ee_rd_atom = 0;
183 ib_attr->max_res_rd_atom = 0; 181 ib_attr->max_res_rd_atom = 0;
@@ -787,20 +785,51 @@ int bnxt_re_query_ah(struct ib_ah *ib_ah, struct rdma_ah_attr *ah_attr)
787 return 0; 785 return 0;
788} 786}
789 787
788static unsigned long bnxt_re_lock_cqs(struct bnxt_re_qp *qp)
789 __acquires(&qp->scq->cq_lock) __acquires(&qp->rcq->cq_lock)
790{
791 unsigned long flags;
792
793 spin_lock_irqsave(&qp->scq->cq_lock, flags);
794 if (qp->rcq != qp->scq)
795 spin_lock(&qp->rcq->cq_lock);
796 else
797 __acquire(&qp->rcq->cq_lock);
798
799 return flags;
800}
801
802static void bnxt_re_unlock_cqs(struct bnxt_re_qp *qp,
803 unsigned long flags)
804 __releases(&qp->scq->cq_lock) __releases(&qp->rcq->cq_lock)
805{
806 if (qp->rcq != qp->scq)
807 spin_unlock(&qp->rcq->cq_lock);
808 else
809 __release(&qp->rcq->cq_lock);
810 spin_unlock_irqrestore(&qp->scq->cq_lock, flags);
811}
812
790/* Queue Pairs */ 813/* Queue Pairs */
791int bnxt_re_destroy_qp(struct ib_qp *ib_qp) 814int bnxt_re_destroy_qp(struct ib_qp *ib_qp)
792{ 815{
793 struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp); 816 struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp);
794 struct bnxt_re_dev *rdev = qp->rdev; 817 struct bnxt_re_dev *rdev = qp->rdev;
795 int rc; 818 int rc;
819 unsigned int flags;
796 820
797 bnxt_qplib_flush_cqn_wq(&qp->qplib_qp); 821 bnxt_qplib_flush_cqn_wq(&qp->qplib_qp);
798 bnxt_qplib_del_flush_qp(&qp->qplib_qp);
799 rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp); 822 rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp);
800 if (rc) { 823 if (rc) {
801 dev_err(rdev_to_dev(rdev), "Failed to destroy HW QP"); 824 dev_err(rdev_to_dev(rdev), "Failed to destroy HW QP");
802 return rc; 825 return rc;
803 } 826 }
827
828 flags = bnxt_re_lock_cqs(qp);
829 bnxt_qplib_clean_qp(&qp->qplib_qp);
830 bnxt_re_unlock_cqs(qp, flags);
831 bnxt_qplib_free_qp_res(&rdev->qplib_res, &qp->qplib_qp);
832
804 if (ib_qp->qp_type == IB_QPT_GSI && rdev->qp1_sqp) { 833 if (ib_qp->qp_type == IB_QPT_GSI && rdev->qp1_sqp) {
805 rc = bnxt_qplib_destroy_ah(&rdev->qplib_res, 834 rc = bnxt_qplib_destroy_ah(&rdev->qplib_res,
806 &rdev->sqp_ah->qplib_ah); 835 &rdev->sqp_ah->qplib_ah);
@@ -810,7 +839,7 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp)
810 return rc; 839 return rc;
811 } 840 }
812 841
813 bnxt_qplib_del_flush_qp(&qp->qplib_qp); 842 bnxt_qplib_clean_qp(&qp->qplib_qp);
814 rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, 843 rc = bnxt_qplib_destroy_qp(&rdev->qplib_res,
815 &rdev->qp1_sqp->qplib_qp); 844 &rdev->qp1_sqp->qplib_qp);
816 if (rc) { 845 if (rc) {
@@ -1069,6 +1098,7 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd,
1069 goto fail; 1098 goto fail;
1070 } 1099 }
1071 qp->qplib_qp.scq = &cq->qplib_cq; 1100 qp->qplib_qp.scq = &cq->qplib_cq;
1101 qp->scq = cq;
1072 } 1102 }
1073 1103
1074 if (qp_init_attr->recv_cq) { 1104 if (qp_init_attr->recv_cq) {
@@ -1080,6 +1110,7 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd,
1080 goto fail; 1110 goto fail;
1081 } 1111 }
1082 qp->qplib_qp.rcq = &cq->qplib_cq; 1112 qp->qplib_qp.rcq = &cq->qplib_cq;
1113 qp->rcq = cq;
1083 } 1114 }
1084 1115
1085 if (qp_init_attr->srq) { 1116 if (qp_init_attr->srq) {
@@ -1185,7 +1216,7 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd,
1185 rc = bnxt_qplib_create_qp(&rdev->qplib_res, &qp->qplib_qp); 1216 rc = bnxt_qplib_create_qp(&rdev->qplib_res, &qp->qplib_qp);
1186 if (rc) { 1217 if (rc) {
1187 dev_err(rdev_to_dev(rdev), "Failed to create HW QP"); 1218 dev_err(rdev_to_dev(rdev), "Failed to create HW QP");
1188 goto fail; 1219 goto free_umem;
1189 } 1220 }
1190 } 1221 }
1191 1222
@@ -1213,6 +1244,13 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd,
1213 return &qp->ib_qp; 1244 return &qp->ib_qp;
1214qp_destroy: 1245qp_destroy:
1215 bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp); 1246 bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp);
1247free_umem:
1248 if (udata) {
1249 if (qp->rumem)
1250 ib_umem_release(qp->rumem);
1251 if (qp->sumem)
1252 ib_umem_release(qp->sumem);
1253 }
1216fail: 1254fail:
1217 kfree(qp); 1255 kfree(qp);
1218 return ERR_PTR(rc); 1256 return ERR_PTR(rc);
@@ -1603,7 +1641,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
1603 dev_dbg(rdev_to_dev(rdev), 1641 dev_dbg(rdev_to_dev(rdev),
1604 "Move QP = %p out of flush list\n", 1642 "Move QP = %p out of flush list\n",
1605 qp); 1643 qp);
1606 bnxt_qplib_del_flush_qp(&qp->qplib_qp); 1644 bnxt_qplib_clean_qp(&qp->qplib_qp);
1607 } 1645 }
1608 } 1646 }
1609 if (qp_attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY) { 1647 if (qp_attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY) {
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.h b/drivers/infiniband/hw/bnxt_re/ib_verbs.h
index 423ebe012f95..b88a48d43a9d 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.h
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.h
@@ -89,6 +89,8 @@ struct bnxt_re_qp {
89 /* QP1 */ 89 /* QP1 */
90 u32 send_psn; 90 u32 send_psn;
91 struct ib_ud_header qp1_hdr; 91 struct ib_ud_header qp1_hdr;
92 struct bnxt_re_cq *scq;
93 struct bnxt_re_cq *rcq;
92}; 94};
93 95
94struct bnxt_re_cq { 96struct bnxt_re_cq {
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index 508d00a5a106..33a448036c2e 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -656,7 +656,6 @@ static void bnxt_re_dev_remove(struct bnxt_re_dev *rdev)
656 mutex_unlock(&bnxt_re_dev_lock); 656 mutex_unlock(&bnxt_re_dev_lock);
657 657
658 synchronize_rcu(); 658 synchronize_rcu();
659 flush_workqueue(bnxt_re_wq);
660 659
661 ib_dealloc_device(&rdev->ibdev); 660 ib_dealloc_device(&rdev->ibdev);
662 /* rdev is gone */ 661 /* rdev is gone */
@@ -1441,7 +1440,7 @@ static void bnxt_re_task(struct work_struct *work)
1441 break; 1440 break;
1442 } 1441 }
1443 smp_mb__before_atomic(); 1442 smp_mb__before_atomic();
1444 clear_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags); 1443 atomic_dec(&rdev->sched_count);
1445 kfree(re_work); 1444 kfree(re_work);
1446} 1445}
1447 1446
@@ -1503,7 +1502,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
1503 /* netdev notifier will call NETDEV_UNREGISTER again later since 1502 /* netdev notifier will call NETDEV_UNREGISTER again later since
1504 * we are still holding the reference to the netdev 1503 * we are still holding the reference to the netdev
1505 */ 1504 */
1506 if (test_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags)) 1505 if (atomic_read(&rdev->sched_count) > 0)
1507 goto exit; 1506 goto exit;
1508 bnxt_re_ib_unreg(rdev, false); 1507 bnxt_re_ib_unreg(rdev, false);
1509 bnxt_re_remove_one(rdev); 1508 bnxt_re_remove_one(rdev);
@@ -1523,7 +1522,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
1523 re_work->vlan_dev = (real_dev == netdev ? 1522 re_work->vlan_dev = (real_dev == netdev ?
1524 NULL : netdev); 1523 NULL : netdev);
1525 INIT_WORK(&re_work->work, bnxt_re_task); 1524 INIT_WORK(&re_work->work, bnxt_re_task);
1526 set_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags); 1525 atomic_inc(&rdev->sched_count);
1527 queue_work(bnxt_re_wq, &re_work->work); 1526 queue_work(bnxt_re_wq, &re_work->work);
1528 } 1527 }
1529 } 1528 }
@@ -1578,6 +1577,11 @@ static void __exit bnxt_re_mod_exit(void)
1578 */ 1577 */
1579 list_for_each_entry_safe_reverse(rdev, next, &to_be_deleted, list) { 1578 list_for_each_entry_safe_reverse(rdev, next, &to_be_deleted, list) {
1580 dev_info(rdev_to_dev(rdev), "Unregistering Device"); 1579 dev_info(rdev_to_dev(rdev), "Unregistering Device");
1580 /*
1581 * Flush out any scheduled tasks before destroying the
1582 * resources
1583 */
1584 flush_workqueue(bnxt_re_wq);
1581 bnxt_re_dev_stop(rdev); 1585 bnxt_re_dev_stop(rdev);
1582 bnxt_re_ib_unreg(rdev, true); 1586 bnxt_re_ib_unreg(rdev, true);
1583 bnxt_re_remove_one(rdev); 1587 bnxt_re_remove_one(rdev);
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 1b0e94697fe3..3ea5b9624f6b 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -173,7 +173,7 @@ static void __bnxt_qplib_del_flush_qp(struct bnxt_qplib_qp *qp)
173 } 173 }
174} 174}
175 175
176void bnxt_qplib_del_flush_qp(struct bnxt_qplib_qp *qp) 176void bnxt_qplib_clean_qp(struct bnxt_qplib_qp *qp)
177{ 177{
178 unsigned long flags; 178 unsigned long flags;
179 179
@@ -1419,7 +1419,6 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
1419 struct bnxt_qplib_rcfw *rcfw = res->rcfw; 1419 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
1420 struct cmdq_destroy_qp req; 1420 struct cmdq_destroy_qp req;
1421 struct creq_destroy_qp_resp resp; 1421 struct creq_destroy_qp_resp resp;
1422 unsigned long flags;
1423 u16 cmd_flags = 0; 1422 u16 cmd_flags = 0;
1424 int rc; 1423 int rc;
1425 1424
@@ -1437,19 +1436,12 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
1437 return rc; 1436 return rc;
1438 } 1437 }
1439 1438
1440 /* Must walk the associated CQs to nullified the QP ptr */ 1439 return 0;
1441 spin_lock_irqsave(&qp->scq->hwq.lock, flags); 1440}
1442
1443 __clean_cq(qp->scq, (u64)(unsigned long)qp);
1444
1445 if (qp->rcq && qp->rcq != qp->scq) {
1446 spin_lock(&qp->rcq->hwq.lock);
1447 __clean_cq(qp->rcq, (u64)(unsigned long)qp);
1448 spin_unlock(&qp->rcq->hwq.lock);
1449 }
1450
1451 spin_unlock_irqrestore(&qp->scq->hwq.lock, flags);
1452 1441
1442void bnxt_qplib_free_qp_res(struct bnxt_qplib_res *res,
1443 struct bnxt_qplib_qp *qp)
1444{
1453 bnxt_qplib_free_qp_hdr_buf(res, qp); 1445 bnxt_qplib_free_qp_hdr_buf(res, qp);
1454 bnxt_qplib_free_hwq(res->pdev, &qp->sq.hwq); 1446 bnxt_qplib_free_hwq(res->pdev, &qp->sq.hwq);
1455 kfree(qp->sq.swq); 1447 kfree(qp->sq.swq);
@@ -1462,7 +1454,6 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
1462 if (qp->orrq.max_elements) 1454 if (qp->orrq.max_elements)
1463 bnxt_qplib_free_hwq(res->pdev, &qp->orrq); 1455 bnxt_qplib_free_hwq(res->pdev, &qp->orrq);
1464 1456
1465 return 0;
1466} 1457}
1467 1458
1468void *bnxt_qplib_get_qp1_sq_buf(struct bnxt_qplib_qp *qp, 1459void *bnxt_qplib_get_qp1_sq_buf(struct bnxt_qplib_qp *qp,
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h
index 211b27a8f9e2..ca0a2ffa3509 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h
@@ -478,6 +478,9 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp);
478int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp); 478int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp);
479int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp); 479int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp);
480int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp); 480int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp);
481void bnxt_qplib_clean_qp(struct bnxt_qplib_qp *qp);
482void bnxt_qplib_free_qp_res(struct bnxt_qplib_res *res,
483 struct bnxt_qplib_qp *qp);
481void *bnxt_qplib_get_qp1_sq_buf(struct bnxt_qplib_qp *qp, 484void *bnxt_qplib_get_qp1_sq_buf(struct bnxt_qplib_qp *qp,
482 struct bnxt_qplib_sge *sge); 485 struct bnxt_qplib_sge *sge);
483void *bnxt_qplib_get_qp1_rq_buf(struct bnxt_qplib_qp *qp, 486void *bnxt_qplib_get_qp1_rq_buf(struct bnxt_qplib_qp *qp,
@@ -500,7 +503,6 @@ void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type);
500void bnxt_qplib_free_nq(struct bnxt_qplib_nq *nq); 503void bnxt_qplib_free_nq(struct bnxt_qplib_nq *nq);
501int bnxt_qplib_alloc_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq); 504int bnxt_qplib_alloc_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq);
502void bnxt_qplib_add_flush_qp(struct bnxt_qplib_qp *qp); 505void bnxt_qplib_add_flush_qp(struct bnxt_qplib_qp *qp);
503void bnxt_qplib_del_flush_qp(struct bnxt_qplib_qp *qp);
504void bnxt_qplib_acquire_cq_locks(struct bnxt_qplib_qp *qp, 506void bnxt_qplib_acquire_cq_locks(struct bnxt_qplib_qp *qp,
505 unsigned long *flags); 507 unsigned long *flags);
506void bnxt_qplib_release_cq_locks(struct bnxt_qplib_qp *qp, 508void bnxt_qplib_release_cq_locks(struct bnxt_qplib_qp *qp,
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
index c015c1861351..03057983341f 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
@@ -52,18 +52,6 @@ const struct bnxt_qplib_gid bnxt_qplib_gid_zero = {{ 0, 0, 0, 0, 0, 0, 0, 0,
52 52
53/* Device */ 53/* Device */
54 54
55static bool bnxt_qplib_is_atomic_cap(struct bnxt_qplib_rcfw *rcfw)
56{
57 int rc;
58 u16 pcie_ctl2;
59
60 rc = pcie_capability_read_word(rcfw->pdev, PCI_EXP_DEVCTL2,
61 &pcie_ctl2);
62 if (rc)
63 return false;
64 return !!(pcie_ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ);
65}
66
67static void bnxt_qplib_query_version(struct bnxt_qplib_rcfw *rcfw, 55static void bnxt_qplib_query_version(struct bnxt_qplib_rcfw *rcfw,
68 char *fw_ver) 56 char *fw_ver)
69{ 57{
@@ -165,7 +153,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
165 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc); 153 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc);
166 } 154 }
167 155
168 attr->is_atomic = bnxt_qplib_is_atomic_cap(rcfw); 156 attr->is_atomic = 0;
169bail: 157bail:
170 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf); 158 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf);
171 return rc; 159 return rc;
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
index faa9478c14a6..f95b97646c25 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
@@ -114,6 +114,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev,
114 union pvrdma_cmd_resp rsp; 114 union pvrdma_cmd_resp rsp;
115 struct pvrdma_cmd_create_cq *cmd = &req.create_cq; 115 struct pvrdma_cmd_create_cq *cmd = &req.create_cq;
116 struct pvrdma_cmd_create_cq_resp *resp = &rsp.create_cq_resp; 116 struct pvrdma_cmd_create_cq_resp *resp = &rsp.create_cq_resp;
117 struct pvrdma_create_cq_resp cq_resp = {0};
117 struct pvrdma_create_cq ucmd; 118 struct pvrdma_create_cq ucmd;
118 119
119 BUILD_BUG_ON(sizeof(struct pvrdma_cqe) != 64); 120 BUILD_BUG_ON(sizeof(struct pvrdma_cqe) != 64);
@@ -197,6 +198,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev,
197 198
198 cq->ibcq.cqe = resp->cqe; 199 cq->ibcq.cqe = resp->cqe;
199 cq->cq_handle = resp->cq_handle; 200 cq->cq_handle = resp->cq_handle;
201 cq_resp.cqn = resp->cq_handle;
200 spin_lock_irqsave(&dev->cq_tbl_lock, flags); 202 spin_lock_irqsave(&dev->cq_tbl_lock, flags);
201 dev->cq_tbl[cq->cq_handle % dev->dsr->caps.max_cq] = cq; 203 dev->cq_tbl[cq->cq_handle % dev->dsr->caps.max_cq] = cq;
202 spin_unlock_irqrestore(&dev->cq_tbl_lock, flags); 204 spin_unlock_irqrestore(&dev->cq_tbl_lock, flags);
@@ -205,7 +207,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev,
205 cq->uar = &(to_vucontext(context)->uar); 207 cq->uar = &(to_vucontext(context)->uar);
206 208
207 /* Copy udata back. */ 209 /* Copy udata back. */
208 if (ib_copy_to_udata(udata, &cq->cq_handle, sizeof(__u32))) { 210 if (ib_copy_to_udata(udata, &cq_resp, sizeof(cq_resp))) {
209 dev_warn(&dev->pdev->dev, 211 dev_warn(&dev->pdev->dev,
210 "failed to copy back udata\n"); 212 "failed to copy back udata\n");
211 pvrdma_destroy_cq(&cq->ibcq); 213 pvrdma_destroy_cq(&cq->ibcq);
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
index 5acebb1ef631..af235967a9c2 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
@@ -113,6 +113,7 @@ struct ib_srq *pvrdma_create_srq(struct ib_pd *pd,
113 union pvrdma_cmd_resp rsp; 113 union pvrdma_cmd_resp rsp;
114 struct pvrdma_cmd_create_srq *cmd = &req.create_srq; 114 struct pvrdma_cmd_create_srq *cmd = &req.create_srq;
115 struct pvrdma_cmd_create_srq_resp *resp = &rsp.create_srq_resp; 115 struct pvrdma_cmd_create_srq_resp *resp = &rsp.create_srq_resp;
116 struct pvrdma_create_srq_resp srq_resp = {0};
116 struct pvrdma_create_srq ucmd; 117 struct pvrdma_create_srq ucmd;
117 unsigned long flags; 118 unsigned long flags;
118 int ret; 119 int ret;
@@ -204,12 +205,13 @@ struct ib_srq *pvrdma_create_srq(struct ib_pd *pd,
204 } 205 }
205 206
206 srq->srq_handle = resp->srqn; 207 srq->srq_handle = resp->srqn;
208 srq_resp.srqn = resp->srqn;
207 spin_lock_irqsave(&dev->srq_tbl_lock, flags); 209 spin_lock_irqsave(&dev->srq_tbl_lock, flags);
208 dev->srq_tbl[srq->srq_handle % dev->dsr->caps.max_srq] = srq; 210 dev->srq_tbl[srq->srq_handle % dev->dsr->caps.max_srq] = srq;
209 spin_unlock_irqrestore(&dev->srq_tbl_lock, flags); 211 spin_unlock_irqrestore(&dev->srq_tbl_lock, flags);
210 212
211 /* Copy udata back. */ 213 /* Copy udata back. */
212 if (ib_copy_to_udata(udata, &srq->srq_handle, sizeof(__u32))) { 214 if (ib_copy_to_udata(udata, &srq_resp, sizeof(srq_resp))) {
213 dev_warn(&dev->pdev->dev, "failed to copy back udata\n"); 215 dev_warn(&dev->pdev->dev, "failed to copy back udata\n");
214 pvrdma_destroy_srq(&srq->ibsrq); 216 pvrdma_destroy_srq(&srq->ibsrq);
215 return ERR_PTR(-EINVAL); 217 return ERR_PTR(-EINVAL);
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
index 16b96616ef7e..a51463cd2f37 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
@@ -447,6 +447,7 @@ struct ib_pd *pvrdma_alloc_pd(struct ib_device *ibdev,
447 union pvrdma_cmd_resp rsp; 447 union pvrdma_cmd_resp rsp;
448 struct pvrdma_cmd_create_pd *cmd = &req.create_pd; 448 struct pvrdma_cmd_create_pd *cmd = &req.create_pd;
449 struct pvrdma_cmd_create_pd_resp *resp = &rsp.create_pd_resp; 449 struct pvrdma_cmd_create_pd_resp *resp = &rsp.create_pd_resp;
450 struct pvrdma_alloc_pd_resp pd_resp = {0};
450 int ret; 451 int ret;
451 void *ptr; 452 void *ptr;
452 453
@@ -475,9 +476,10 @@ struct ib_pd *pvrdma_alloc_pd(struct ib_device *ibdev,
475 pd->privileged = !context; 476 pd->privileged = !context;
476 pd->pd_handle = resp->pd_handle; 477 pd->pd_handle = resp->pd_handle;
477 pd->pdn = resp->pd_handle; 478 pd->pdn = resp->pd_handle;
479 pd_resp.pdn = resp->pd_handle;
478 480
479 if (context) { 481 if (context) {
480 if (ib_copy_to_udata(udata, &pd->pdn, sizeof(__u32))) { 482 if (ib_copy_to_udata(udata, &pd_resp, sizeof(pd_resp))) {
481 dev_warn(&dev->pdev->dev, 483 dev_warn(&dev->pdev->dev,
482 "failed to copy back protection domain\n"); 484 "failed to copy back protection domain\n");
483 pvrdma_dealloc_pd(&pd->ibpd); 485 pvrdma_dealloc_pd(&pd->ibpd);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
index 11f74cbe6660..ea302b054601 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_fs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
@@ -281,8 +281,6 @@ void ipoib_delete_debug_files(struct net_device *dev)
281{ 281{
282 struct ipoib_dev_priv *priv = ipoib_priv(dev); 282 struct ipoib_dev_priv *priv = ipoib_priv(dev);
283 283
284 WARN_ONCE(!priv->mcg_dentry, "null mcg debug file\n");
285 WARN_ONCE(!priv->path_dentry, "null path debug file\n");
286 debugfs_remove(priv->mcg_dentry); 284 debugfs_remove(priv->mcg_dentry);
287 debugfs_remove(priv->path_dentry); 285 debugfs_remove(priv->path_dentry);
288 priv->mcg_dentry = priv->path_dentry = NULL; 286 priv->mcg_dentry = priv->path_dentry = NULL;
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
index 35a408d0ae4f..99bc9bd64b9e 100644
--- a/drivers/iommu/intel-svm.c
+++ b/drivers/iommu/intel-svm.c
@@ -205,7 +205,7 @@ static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_d
205 * for example, an "address" value of 0x12345f000 will 205 * for example, an "address" value of 0x12345f000 will
206 * flush from 0x123440000 to 0x12347ffff (256KiB). */ 206 * flush from 0x123440000 to 0x12347ffff (256KiB). */
207 unsigned long last = address + ((unsigned long)(pages - 1) << VTD_PAGE_SHIFT); 207 unsigned long last = address + ((unsigned long)(pages - 1) << VTD_PAGE_SHIFT);
208 unsigned long mask = __rounddown_pow_of_two(address ^ last);; 208 unsigned long mask = __rounddown_pow_of_two(address ^ last);
209 209
210 desc.high = QI_DEV_EIOTLB_ADDR((address & ~mask) | (mask - 1)) | QI_DEV_EIOTLB_SIZE; 210 desc.high = QI_DEV_EIOTLB_ADDR((address & ~mask) | (mask - 1)) | QI_DEV_EIOTLB_SIZE;
211 } else { 211 } else {
diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c
index 55cfb986225b..faf734ff4cf3 100644
--- a/drivers/irqchip/irq-bcm7038-l1.c
+++ b/drivers/irqchip/irq-bcm7038-l1.c
@@ -339,9 +339,6 @@ int __init bcm7038_l1_of_init(struct device_node *dn,
339 goto out_unmap; 339 goto out_unmap;
340 } 340 }
341 341
342 pr_info("registered BCM7038 L1 intc (mem: 0x%p, IRQs: %d)\n",
343 intc->cpus[0]->map_base, IRQS_PER_WORD * intc->n_words);
344
345 return 0; 342 return 0;
346 343
347out_unmap: 344out_unmap:
diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
index 983640eba418..8968e5e93fcb 100644
--- a/drivers/irqchip/irq-bcm7120-l2.c
+++ b/drivers/irqchip/irq-bcm7120-l2.c
@@ -318,9 +318,6 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
318 } 318 }
319 } 319 }
320 320
321 pr_info("registered %s intc (mem: 0x%p, parent IRQ(s): %d)\n",
322 intc_name, data->map_base[0], data->num_parent_irqs);
323
324 return 0; 321 return 0;
325 322
326out_free_domain: 323out_free_domain:
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
index 691d20eb0bec..0e65f609352e 100644
--- a/drivers/irqchip/irq-brcmstb-l2.c
+++ b/drivers/irqchip/irq-brcmstb-l2.c
@@ -262,9 +262,6 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
262 ct->chip.irq_set_wake = irq_gc_set_wake; 262 ct->chip.irq_set_wake = irq_gc_set_wake;
263 } 263 }
264 264
265 pr_info("registered L2 intc (mem: 0x%p, parent irq: %d)\n",
266 base, parent_irq);
267
268 return 0; 265 return 0;
269 266
270out_free_domain: 267out_free_domain:
diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 993a8426a453..1ff38aff9f29 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -94,7 +94,7 @@ static struct irq_chip gicv2m_msi_irq_chip = {
94 94
95static struct msi_domain_info gicv2m_msi_domain_info = { 95static struct msi_domain_info gicv2m_msi_domain_info = {
96 .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | 96 .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
97 MSI_FLAG_PCI_MSIX), 97 MSI_FLAG_PCI_MSIX | MSI_FLAG_MULTI_PCI_MSI),
98 .chip = &gicv2m_msi_irq_chip, 98 .chip = &gicv2m_msi_irq_chip,
99}; 99};
100 100
@@ -155,18 +155,12 @@ static int gicv2m_irq_gic_domain_alloc(struct irq_domain *domain,
155 return 0; 155 return 0;
156} 156}
157 157
158static void gicv2m_unalloc_msi(struct v2m_data *v2m, unsigned int hwirq) 158static void gicv2m_unalloc_msi(struct v2m_data *v2m, unsigned int hwirq,
159 int nr_irqs)
159{ 160{
160 int pos;
161
162 pos = hwirq - v2m->spi_start;
163 if (pos < 0 || pos >= v2m->nr_spis) {
164 pr_err("Failed to teardown msi. Invalid hwirq %d\n", hwirq);
165 return;
166 }
167
168 spin_lock(&v2m_lock); 161 spin_lock(&v2m_lock);
169 __clear_bit(pos, v2m->bm); 162 bitmap_release_region(v2m->bm, hwirq - v2m->spi_start,
163 get_count_order(nr_irqs));
170 spin_unlock(&v2m_lock); 164 spin_unlock(&v2m_lock);
171} 165}
172 166
@@ -174,13 +168,13 @@ static int gicv2m_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
174 unsigned int nr_irqs, void *args) 168 unsigned int nr_irqs, void *args)
175{ 169{
176 struct v2m_data *v2m = NULL, *tmp; 170 struct v2m_data *v2m = NULL, *tmp;
177 int hwirq, offset, err = 0; 171 int hwirq, offset, i, err = 0;
178 172
179 spin_lock(&v2m_lock); 173 spin_lock(&v2m_lock);
180 list_for_each_entry(tmp, &v2m_nodes, entry) { 174 list_for_each_entry(tmp, &v2m_nodes, entry) {
181 offset = find_first_zero_bit(tmp->bm, tmp->nr_spis); 175 offset = bitmap_find_free_region(tmp->bm, tmp->nr_spis,
182 if (offset < tmp->nr_spis) { 176 get_count_order(nr_irqs));
183 __set_bit(offset, tmp->bm); 177 if (offset >= 0) {
184 v2m = tmp; 178 v2m = tmp;
185 break; 179 break;
186 } 180 }
@@ -192,16 +186,21 @@ static int gicv2m_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
192 186
193 hwirq = v2m->spi_start + offset; 187 hwirq = v2m->spi_start + offset;
194 188
195 err = gicv2m_irq_gic_domain_alloc(domain, virq, hwirq); 189 for (i = 0; i < nr_irqs; i++) {
196 if (err) { 190 err = gicv2m_irq_gic_domain_alloc(domain, virq + i, hwirq + i);
197 gicv2m_unalloc_msi(v2m, hwirq); 191 if (err)
198 return err; 192 goto fail;
199 }
200 193
201 irq_domain_set_hwirq_and_chip(domain, virq, hwirq, 194 irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
202 &gicv2m_irq_chip, v2m); 195 &gicv2m_irq_chip, v2m);
196 }
203 197
204 return 0; 198 return 0;
199
200fail:
201 irq_domain_free_irqs_parent(domain, virq, nr_irqs);
202 gicv2m_unalloc_msi(v2m, hwirq, get_count_order(nr_irqs));
203 return err;
205} 204}
206 205
207static void gicv2m_irq_domain_free(struct irq_domain *domain, 206static void gicv2m_irq_domain_free(struct irq_domain *domain,
@@ -210,8 +209,7 @@ static void gicv2m_irq_domain_free(struct irq_domain *domain,
210 struct irq_data *d = irq_domain_get_irq_data(domain, virq); 209 struct irq_data *d = irq_domain_get_irq_data(domain, virq);
211 struct v2m_data *v2m = irq_data_get_irq_chip_data(d); 210 struct v2m_data *v2m = irq_data_get_irq_chip_data(d);
212 211
213 BUG_ON(nr_irqs != 1); 212 gicv2m_unalloc_msi(v2m, d->hwirq, nr_irqs);
214 gicv2m_unalloc_msi(v2m, d->hwirq);
215 irq_domain_free_irqs_parent(domain, virq, nr_irqs); 213 irq_domain_free_irqs_parent(domain, virq, nr_irqs);
216} 214}
217 215
diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
index 14a8c0a7e095..25a98de5cfb2 100644
--- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c
@@ -132,6 +132,8 @@ static int __init its_pci_of_msi_init(void)
132 132
133 for (np = of_find_matching_node(NULL, its_device_id); np; 133 for (np = of_find_matching_node(NULL, its_device_id); np;
134 np = of_find_matching_node(np, its_device_id)) { 134 np = of_find_matching_node(np, its_device_id)) {
135 if (!of_device_is_available(np))
136 continue;
135 if (!of_property_read_bool(np, "msi-controller")) 137 if (!of_property_read_bool(np, "msi-controller"))
136 continue; 138 continue;
137 139
diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
index 833a90fe33ae..8881a053c173 100644
--- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
@@ -154,6 +154,8 @@ static void __init its_pmsi_of_init(void)
154 154
155 for (np = of_find_matching_node(NULL, its_device_id); np; 155 for (np = of_find_matching_node(NULL, its_device_id); np;
156 np = of_find_matching_node(np, its_device_id)) { 156 np = of_find_matching_node(np, its_device_id)) {
157 if (!of_device_is_available(np))
158 continue;
157 if (!of_property_read_bool(np, "msi-controller")) 159 if (!of_property_read_bool(np, "msi-controller"))
158 continue; 160 continue;
159 161
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 06f025fd5726..1d3056f53747 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3314,6 +3314,8 @@ static int __init its_of_probe(struct device_node *node)
3314 3314
3315 for (np = of_find_matching_node(node, its_device_id); np; 3315 for (np = of_find_matching_node(node, its_device_id); np;
3316 np = of_find_matching_node(np, its_device_id)) { 3316 np = of_find_matching_node(np, its_device_id)) {
3317 if (!of_device_is_available(np))
3318 continue;
3317 if (!of_property_read_bool(np, "msi-controller")) { 3319 if (!of_property_read_bool(np, "msi-controller")) {
3318 pr_warn("%pOF: no msi-controller property, ITS ignored\n", 3320 pr_warn("%pOF: no msi-controller property, ITS ignored\n",
3319 np); 3321 np);
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index a57c0fbbd34a..d99cc07903ec 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -673,7 +673,7 @@ static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq)
673 MPIDR_TO_SGI_RS(cluster_id) | 673 MPIDR_TO_SGI_RS(cluster_id) |
674 tlist << ICC_SGI1R_TARGET_LIST_SHIFT); 674 tlist << ICC_SGI1R_TARGET_LIST_SHIFT);
675 675
676 pr_debug("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val); 676 pr_devel("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val);
677 gic_write_sgi1r(val); 677 gic_write_sgi1r(val);
678} 678}
679 679
@@ -688,7 +688,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
688 * Ensure that stores to Normal memory are visible to the 688 * Ensure that stores to Normal memory are visible to the
689 * other CPUs before issuing the IPI. 689 * other CPUs before issuing the IPI.
690 */ 690 */
691 smp_wmb(); 691 wmb();
692 692
693 for_each_cpu(cpu, mask) { 693 for_each_cpu(cpu, mask) {
694 u64 cluster_id = MPIDR_TO_SGI_CLUSTER_ID(cpu_logical_map(cpu)); 694 u64 cluster_id = MPIDR_TO_SGI_CLUSTER_ID(cpu_logical_map(cpu));
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index ef92a4d2038e..d32268cc1174 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -424,8 +424,6 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq,
424 spin_lock_irqsave(&gic_lock, flags); 424 spin_lock_irqsave(&gic_lock, flags);
425 write_gic_map_pin(intr, GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin); 425 write_gic_map_pin(intr, GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
426 write_gic_map_vp(intr, BIT(mips_cm_vp_id(cpu))); 426 write_gic_map_vp(intr, BIT(mips_cm_vp_id(cpu)));
427 gic_clear_pcpu_masks(intr);
428 set_bit(intr, per_cpu_ptr(pcpu_masks, cpu));
429 irq_data_update_effective_affinity(data, cpumask_of(cpu)); 427 irq_data_update_effective_affinity(data, cpumask_of(cpu));
430 spin_unlock_irqrestore(&gic_lock, flags); 428 spin_unlock_irqrestore(&gic_lock, flags);
431 429
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 62f541f968f6..07074820a167 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -375,6 +375,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
375 dev->ofdev.dev.of_node = np; 375 dev->ofdev.dev.of_node = np;
376 dev->ofdev.archdata.dma_mask = 0xffffffffUL; 376 dev->ofdev.archdata.dma_mask = 0xffffffffUL;
377 dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask; 377 dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
378 dev->ofdev.dev.coherent_dma_mask = dev->ofdev.archdata.dma_mask;
378 dev->ofdev.dev.parent = parent; 379 dev->ofdev.dev.parent = parent;
379 dev->ofdev.dev.bus = &macio_bus_type; 380 dev->ofdev.dev.bus = &macio_bus_type;
380 dev->ofdev.dev.release = macio_release_dev; 381 dev->ofdev.dev.release = macio_release_dev;
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 1a46b41dac70..6422846b546e 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -659,11 +659,11 @@ static void do_bio_hook(struct search *s, struct bio *orig_bio)
659static void search_free(struct closure *cl) 659static void search_free(struct closure *cl)
660{ 660{
661 struct search *s = container_of(cl, struct search, cl); 661 struct search *s = container_of(cl, struct search, cl);
662 bio_complete(s);
663 662
664 if (s->iop.bio) 663 if (s->iop.bio)
665 bio_put(s->iop.bio); 664 bio_put(s->iop.bio);
666 665
666 bio_complete(s);
667 closure_debug_destroy(cl); 667 closure_debug_destroy(cl);
668 mempool_free(s, s->d->c->search); 668 mempool_free(s, s->d->c->search);
669} 669}
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 312895788036..4d1d8dfb2d2a 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1274,7 +1274,7 @@ static int flash_devs_run(struct cache_set *c)
1274 struct uuid_entry *u; 1274 struct uuid_entry *u;
1275 1275
1276 for (u = c->uuids; 1276 for (u = c->uuids;
1277 u < c->uuids + c->devices_max_used && !ret; 1277 u < c->uuids + c->nr_uuids && !ret;
1278 u++) 1278 u++)
1279 if (UUID_FLASH_ONLY(u)) 1279 if (UUID_FLASH_ONLY(u))
1280 ret = flash_dev_run(c, u); 1280 ret = flash_dev_run(c, u);
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index d6de00f367ef..68136806d365 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -903,7 +903,8 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
903 queue_io(md, bio); 903 queue_io(md, bio);
904 } else { 904 } else {
905 /* done with normal IO or empty flush */ 905 /* done with normal IO or empty flush */
906 bio->bi_status = io_error; 906 if (io_error)
907 bio->bi_status = io_error;
907 bio_endio(bio); 908 bio_endio(bio);
908 } 909 }
909 } 910 }
diff --git a/drivers/md/md-multipath.c b/drivers/md/md-multipath.c
index e40065bdbfc8..0a7e99d62c69 100644
--- a/drivers/md/md-multipath.c
+++ b/drivers/md/md-multipath.c
@@ -157,7 +157,7 @@ static void multipath_status(struct seq_file *seq, struct mddev *mddev)
157 seq_printf (seq, "%s", rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_"); 157 seq_printf (seq, "%s", rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_");
158 } 158 }
159 rcu_read_unlock(); 159 rcu_read_unlock();
160 seq_printf (seq, "]"); 160 seq_putc(seq, ']');
161} 161}
162 162
163static int multipath_congested(struct mddev *mddev, int bits) 163static int multipath_congested(struct mddev *mddev, int bits)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bc67ab6844f0..254e44e44668 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -801,6 +801,9 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
801 struct bio *bio; 801 struct bio *bio;
802 int ff = 0; 802 int ff = 0;
803 803
804 if (!page)
805 return;
806
804 if (test_bit(Faulty, &rdev->flags)) 807 if (test_bit(Faulty, &rdev->flags))
805 return; 808 return;
806 809
@@ -5452,6 +5455,7 @@ int md_run(struct mddev *mddev)
5452 * the only valid external interface is through the md 5455 * the only valid external interface is through the md
5453 * device. 5456 * device.
5454 */ 5457 */
5458 mddev->has_superblocks = false;
5455 rdev_for_each(rdev, mddev) { 5459 rdev_for_each(rdev, mddev) {
5456 if (test_bit(Faulty, &rdev->flags)) 5460 if (test_bit(Faulty, &rdev->flags))
5457 continue; 5461 continue;
@@ -5465,6 +5469,9 @@ int md_run(struct mddev *mddev)
5465 set_disk_ro(mddev->gendisk, 1); 5469 set_disk_ro(mddev->gendisk, 1);
5466 } 5470 }
5467 5471
5472 if (rdev->sb_page)
5473 mddev->has_superblocks = true;
5474
5468 /* perform some consistency tests on the device. 5475 /* perform some consistency tests on the device.
5469 * We don't want the data to overlap the metadata, 5476 * We don't want the data to overlap the metadata,
5470 * Internal Bitmap issues have been handled elsewhere. 5477 * Internal Bitmap issues have been handled elsewhere.
@@ -5497,8 +5504,10 @@ int md_run(struct mddev *mddev)
5497 } 5504 }
5498 if (mddev->sync_set == NULL) { 5505 if (mddev->sync_set == NULL) {
5499 mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); 5506 mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
5500 if (!mddev->sync_set) 5507 if (!mddev->sync_set) {
5501 return -ENOMEM; 5508 err = -ENOMEM;
5509 goto abort;
5510 }
5502 } 5511 }
5503 5512
5504 spin_lock(&pers_lock); 5513 spin_lock(&pers_lock);
@@ -5511,7 +5520,8 @@ int md_run(struct mddev *mddev)
5511 else 5520 else
5512 pr_warn("md: personality for level %s is not loaded!\n", 5521 pr_warn("md: personality for level %s is not loaded!\n",
5513 mddev->clevel); 5522 mddev->clevel);
5514 return -EINVAL; 5523 err = -EINVAL;
5524 goto abort;
5515 } 5525 }
5516 spin_unlock(&pers_lock); 5526 spin_unlock(&pers_lock);
5517 if (mddev->level != pers->level) { 5527 if (mddev->level != pers->level) {
@@ -5524,7 +5534,8 @@ int md_run(struct mddev *mddev)
5524 pers->start_reshape == NULL) { 5534 pers->start_reshape == NULL) {
5525 /* This personality cannot handle reshaping... */ 5535 /* This personality cannot handle reshaping... */
5526 module_put(pers->owner); 5536 module_put(pers->owner);
5527 return -EINVAL; 5537 err = -EINVAL;
5538 goto abort;
5528 } 5539 }
5529 5540
5530 if (pers->sync_request) { 5541 if (pers->sync_request) {
@@ -5593,7 +5604,7 @@ int md_run(struct mddev *mddev)
5593 mddev->private = NULL; 5604 mddev->private = NULL;
5594 module_put(pers->owner); 5605 module_put(pers->owner);
5595 bitmap_destroy(mddev); 5606 bitmap_destroy(mddev);
5596 return err; 5607 goto abort;
5597 } 5608 }
5598 if (mddev->queue) { 5609 if (mddev->queue) {
5599 bool nonrot = true; 5610 bool nonrot = true;
@@ -5655,6 +5666,18 @@ int md_run(struct mddev *mddev)
5655 sysfs_notify_dirent_safe(mddev->sysfs_action); 5666 sysfs_notify_dirent_safe(mddev->sysfs_action);
5656 sysfs_notify(&mddev->kobj, NULL, "degraded"); 5667 sysfs_notify(&mddev->kobj, NULL, "degraded");
5657 return 0; 5668 return 0;
5669
5670abort:
5671 if (mddev->bio_set) {
5672 bioset_free(mddev->bio_set);
5673 mddev->bio_set = NULL;
5674 }
5675 if (mddev->sync_set) {
5676 bioset_free(mddev->sync_set);
5677 mddev->sync_set = NULL;
5678 }
5679
5680 return err;
5658} 5681}
5659EXPORT_SYMBOL_GPL(md_run); 5682EXPORT_SYMBOL_GPL(md_run);
5660 5683
@@ -8049,6 +8072,7 @@ EXPORT_SYMBOL(md_done_sync);
8049bool md_write_start(struct mddev *mddev, struct bio *bi) 8072bool md_write_start(struct mddev *mddev, struct bio *bi)
8050{ 8073{
8051 int did_change = 0; 8074 int did_change = 0;
8075
8052 if (bio_data_dir(bi) != WRITE) 8076 if (bio_data_dir(bi) != WRITE)
8053 return true; 8077 return true;
8054 8078
@@ -8081,6 +8105,8 @@ bool md_write_start(struct mddev *mddev, struct bio *bi)
8081 rcu_read_unlock(); 8105 rcu_read_unlock();
8082 if (did_change) 8106 if (did_change)
8083 sysfs_notify_dirent_safe(mddev->sysfs_state); 8107 sysfs_notify_dirent_safe(mddev->sysfs_state);
8108 if (!mddev->has_superblocks)
8109 return true;
8084 wait_event(mddev->sb_wait, 8110 wait_event(mddev->sb_wait,
8085 !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags) || 8111 !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags) ||
8086 mddev->suspended); 8112 mddev->suspended);
@@ -8543,6 +8569,19 @@ void md_do_sync(struct md_thread *thread)
8543 set_mask_bits(&mddev->sb_flags, 0, 8569 set_mask_bits(&mddev->sb_flags, 0,
8544 BIT(MD_SB_CHANGE_PENDING) | BIT(MD_SB_CHANGE_DEVS)); 8570 BIT(MD_SB_CHANGE_PENDING) | BIT(MD_SB_CHANGE_DEVS));
8545 8571
8572 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
8573 !test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
8574 mddev->delta_disks > 0 &&
8575 mddev->pers->finish_reshape &&
8576 mddev->pers->size &&
8577 mddev->queue) {
8578 mddev_lock_nointr(mddev);
8579 md_set_array_sectors(mddev, mddev->pers->size(mddev, 0, 0));
8580 mddev_unlock(mddev);
8581 set_capacity(mddev->gendisk, mddev->array_sectors);
8582 revalidate_disk(mddev->gendisk);
8583 }
8584
8546 spin_lock(&mddev->lock); 8585 spin_lock(&mddev->lock);
8547 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { 8586 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
8548 /* We completed so min/max setting can be forgotten if used. */ 8587 /* We completed so min/max setting can be forgotten if used. */
@@ -8569,6 +8608,10 @@ static int remove_and_add_spares(struct mddev *mddev,
8569 int removed = 0; 8608 int removed = 0;
8570 bool remove_some = false; 8609 bool remove_some = false;
8571 8610
8611 if (this && test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))
8612 /* Mustn't remove devices when resync thread is running */
8613 return 0;
8614
8572 rdev_for_each(rdev, mddev) { 8615 rdev_for_each(rdev, mddev) {
8573 if ((this == NULL || rdev == this) && 8616 if ((this == NULL || rdev == this) &&
8574 rdev->raid_disk >= 0 && 8617 rdev->raid_disk >= 0 &&
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 58cd20a5e85e..fbc925cce810 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -468,6 +468,8 @@ struct mddev {
468 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev); 468 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
469 struct md_cluster_info *cluster_info; 469 struct md_cluster_info *cluster_info;
470 unsigned int good_device_nr; /* good device num within cluster raid */ 470 unsigned int good_device_nr; /* good device num within cluster raid */
471
472 bool has_superblocks:1;
471}; 473};
472 474
473enum recovery_flags { 475enum recovery_flags {
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b2eae332e1a2..fe872dc6712e 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1108,7 +1108,7 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
1108 1108
1109 bio_copy_data(behind_bio, bio); 1109 bio_copy_data(behind_bio, bio);
1110skip_copy: 1110skip_copy:
1111 r1_bio->behind_master_bio = behind_bio;; 1111 r1_bio->behind_master_bio = behind_bio;
1112 set_bit(R1BIO_BehindIO, &r1_bio->state); 1112 set_bit(R1BIO_BehindIO, &r1_bio->state);
1113 1113
1114 return; 1114 return;
@@ -1809,6 +1809,17 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
1809 struct md_rdev *repl = 1809 struct md_rdev *repl =
1810 conf->mirrors[conf->raid_disks + number].rdev; 1810 conf->mirrors[conf->raid_disks + number].rdev;
1811 freeze_array(conf, 0); 1811 freeze_array(conf, 0);
1812 if (atomic_read(&repl->nr_pending)) {
1813 /* It means that some queued IO of retry_list
1814 * hold repl. Thus, we cannot set replacement
1815 * as NULL, avoiding rdev NULL pointer
1816 * dereference in sync_request_write and
1817 * handle_write_finished.
1818 */
1819 err = -EBUSY;
1820 unfreeze_array(conf);
1821 goto abort;
1822 }
1812 clear_bit(Replacement, &repl->flags); 1823 clear_bit(Replacement, &repl->flags);
1813 p->rdev = repl; 1824 p->rdev = repl;
1814 conf->mirrors[conf->raid_disks + number].rdev = NULL; 1825 conf->mirrors[conf->raid_disks + number].rdev = NULL;
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index c7294e7557e0..eb84bc68e2fd 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -26,6 +26,18 @@
26#define BARRIER_BUCKETS_NR_BITS (PAGE_SHIFT - ilog2(sizeof(atomic_t))) 26#define BARRIER_BUCKETS_NR_BITS (PAGE_SHIFT - ilog2(sizeof(atomic_t)))
27#define BARRIER_BUCKETS_NR (1<<BARRIER_BUCKETS_NR_BITS) 27#define BARRIER_BUCKETS_NR (1<<BARRIER_BUCKETS_NR_BITS)
28 28
29/* Note: raid1_info.rdev can be set to NULL asynchronously by raid1_remove_disk.
30 * There are three safe ways to access raid1_info.rdev.
31 * 1/ when holding mddev->reconfig_mutex
32 * 2/ when resync/recovery is known to be happening - i.e. in code that is
33 * called as part of performing resync/recovery.
34 * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer
35 * and if it is non-NULL, increment rdev->nr_pending before dropping the
36 * RCU lock.
37 * When .rdev is set to NULL, the nr_pending count checked again and if it has
38 * been incremented, the pointer is put back in .rdev.
39 */
40
29struct raid1_info { 41struct raid1_info {
30 struct md_rdev *rdev; 42 struct md_rdev *rdev;
31 sector_t head_position; 43 sector_t head_position;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 99c9207899a7..c5e6c60fc0d4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -141,7 +141,7 @@ static void r10bio_pool_free(void *r10_bio, void *data)
141#define RESYNC_WINDOW (1024*1024) 141#define RESYNC_WINDOW (1024*1024)
142/* maximum number of concurrent requests, memory permitting */ 142/* maximum number of concurrent requests, memory permitting */
143#define RESYNC_DEPTH (32*1024*1024/RESYNC_BLOCK_SIZE) 143#define RESYNC_DEPTH (32*1024*1024/RESYNC_BLOCK_SIZE)
144#define CLUSTER_RESYNC_WINDOW (16 * RESYNC_WINDOW) 144#define CLUSTER_RESYNC_WINDOW (32 * RESYNC_WINDOW)
145#define CLUSTER_RESYNC_WINDOW_SECTORS (CLUSTER_RESYNC_WINDOW >> 9) 145#define CLUSTER_RESYNC_WINDOW_SECTORS (CLUSTER_RESYNC_WINDOW >> 9)
146 146
147/* 147/*
@@ -2655,7 +2655,8 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio)
2655 for (m = 0; m < conf->copies; m++) { 2655 for (m = 0; m < conf->copies; m++) {
2656 int dev = r10_bio->devs[m].devnum; 2656 int dev = r10_bio->devs[m].devnum;
2657 rdev = conf->mirrors[dev].rdev; 2657 rdev = conf->mirrors[dev].rdev;
2658 if (r10_bio->devs[m].bio == NULL) 2658 if (r10_bio->devs[m].bio == NULL ||
2659 r10_bio->devs[m].bio->bi_end_io == NULL)
2659 continue; 2660 continue;
2660 if (!r10_bio->devs[m].bio->bi_status) { 2661 if (!r10_bio->devs[m].bio->bi_status) {
2661 rdev_clear_badblocks( 2662 rdev_clear_badblocks(
@@ -2670,7 +2671,8 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio)
2670 md_error(conf->mddev, rdev); 2671 md_error(conf->mddev, rdev);
2671 } 2672 }
2672 rdev = conf->mirrors[dev].replacement; 2673 rdev = conf->mirrors[dev].replacement;
2673 if (r10_bio->devs[m].repl_bio == NULL) 2674 if (r10_bio->devs[m].repl_bio == NULL ||
2675 r10_bio->devs[m].repl_bio->bi_end_io == NULL)
2674 continue; 2676 continue;
2675 2677
2676 if (!r10_bio->devs[m].repl_bio->bi_status) { 2678 if (!r10_bio->devs[m].repl_bio->bi_status) {
@@ -3782,7 +3784,7 @@ static int raid10_run(struct mddev *mddev)
3782 if (fc > 1 || fo > 0) { 3784 if (fc > 1 || fo > 0) {
3783 pr_err("only near layout is supported by clustered" 3785 pr_err("only near layout is supported by clustered"
3784 " raid10\n"); 3786 " raid10\n");
3785 goto out; 3787 goto out_free_conf;
3786 } 3788 }
3787 } 3789 }
3788 3790
@@ -4830,17 +4832,11 @@ static void raid10_finish_reshape(struct mddev *mddev)
4830 return; 4832 return;
4831 4833
4832 if (mddev->delta_disks > 0) { 4834 if (mddev->delta_disks > 0) {
4833 sector_t size = raid10_size(mddev, 0, 0);
4834 md_set_array_sectors(mddev, size);
4835 if (mddev->recovery_cp > mddev->resync_max_sectors) { 4835 if (mddev->recovery_cp > mddev->resync_max_sectors) {
4836 mddev->recovery_cp = mddev->resync_max_sectors; 4836 mddev->recovery_cp = mddev->resync_max_sectors;
4837 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 4837 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
4838 } 4838 }
4839 mddev->resync_max_sectors = size; 4839 mddev->resync_max_sectors = mddev->array_sectors;
4840 if (mddev->queue) {
4841 set_capacity(mddev->gendisk, mddev->array_sectors);
4842 revalidate_disk(mddev->gendisk);
4843 }
4844 } else { 4840 } else {
4845 int d; 4841 int d;
4846 rcu_read_lock(); 4842 rcu_read_lock();
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index db2ac22ac1b4..e2e8840de9bf 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -2,6 +2,19 @@
2#ifndef _RAID10_H 2#ifndef _RAID10_H
3#define _RAID10_H 3#define _RAID10_H
4 4
5/* Note: raid10_info.rdev can be set to NULL asynchronously by
6 * raid10_remove_disk.
7 * There are three safe ways to access raid10_info.rdev.
8 * 1/ when holding mddev->reconfig_mutex
9 * 2/ when resync/recovery/reshape is known to be happening - i.e. in code
10 * that is called as part of performing resync/recovery/reshape.
11 * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer
12 * and if it is non-NULL, increment rdev->nr_pending before dropping the
13 * RCU lock.
14 * When .rdev is set to NULL, the nr_pending count checked again and if it has
15 * been incremented, the pointer is put back in .rdev.
16 */
17
5struct raid10_info { 18struct raid10_info {
6 struct md_rdev *rdev, *replacement; 19 struct md_rdev *rdev, *replacement;
7 sector_t head_position; 20 sector_t head_position;
diff --git a/drivers/md/raid5-log.h b/drivers/md/raid5-log.h
index 0c76bcedfc1c..a001808a2b77 100644
--- a/drivers/md/raid5-log.h
+++ b/drivers/md/raid5-log.h
@@ -44,6 +44,7 @@ extern void ppl_write_stripe_run(struct r5conf *conf);
44extern void ppl_stripe_write_finished(struct stripe_head *sh); 44extern void ppl_stripe_write_finished(struct stripe_head *sh);
45extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add); 45extern int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add);
46extern void ppl_quiesce(struct r5conf *conf, int quiesce); 46extern void ppl_quiesce(struct r5conf *conf, int quiesce);
47extern int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio);
47 48
48static inline bool raid5_has_ppl(struct r5conf *conf) 49static inline bool raid5_has_ppl(struct r5conf *conf)
49{ 50{
@@ -104,7 +105,7 @@ static inline int log_handle_flush_request(struct r5conf *conf, struct bio *bio)
104 if (conf->log) 105 if (conf->log)
105 ret = r5l_handle_flush_request(conf->log, bio); 106 ret = r5l_handle_flush_request(conf->log, bio);
106 else if (raid5_has_ppl(conf)) 107 else if (raid5_has_ppl(conf))
107 ret = 0; 108 ret = ppl_handle_flush_request(conf->log, bio);
108 109
109 return ret; 110 return ret;
110} 111}
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 2764c2290062..42890a08375b 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -693,6 +693,16 @@ void ppl_quiesce(struct r5conf *conf, int quiesce)
693 } 693 }
694} 694}
695 695
696int ppl_handle_flush_request(struct r5l_log *log, struct bio *bio)
697{
698 if (bio->bi_iter.bi_size == 0) {
699 bio_endio(bio);
700 return 0;
701 }
702 bio->bi_opf &= ~REQ_PREFLUSH;
703 return -EAGAIN;
704}
705
696void ppl_stripe_write_finished(struct stripe_head *sh) 706void ppl_stripe_write_finished(struct stripe_head *sh)
697{ 707{
698 struct ppl_io_unit *io; 708 struct ppl_io_unit *io;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 50d01144b805..b5d2601483e3 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2196,15 +2196,16 @@ static int grow_one_stripe(struct r5conf *conf, gfp_t gfp)
2196static int grow_stripes(struct r5conf *conf, int num) 2196static int grow_stripes(struct r5conf *conf, int num)
2197{ 2197{
2198 struct kmem_cache *sc; 2198 struct kmem_cache *sc;
2199 size_t namelen = sizeof(conf->cache_name[0]);
2199 int devs = max(conf->raid_disks, conf->previous_raid_disks); 2200 int devs = max(conf->raid_disks, conf->previous_raid_disks);
2200 2201
2201 if (conf->mddev->gendisk) 2202 if (conf->mddev->gendisk)
2202 sprintf(conf->cache_name[0], 2203 snprintf(conf->cache_name[0], namelen,
2203 "raid%d-%s", conf->level, mdname(conf->mddev)); 2204 "raid%d-%s", conf->level, mdname(conf->mddev));
2204 else 2205 else
2205 sprintf(conf->cache_name[0], 2206 snprintf(conf->cache_name[0], namelen,
2206 "raid%d-%p", conf->level, conf->mddev); 2207 "raid%d-%p", conf->level, conf->mddev);
2207 sprintf(conf->cache_name[1], "%s-alt", conf->cache_name[0]); 2208 snprintf(conf->cache_name[1], namelen, "%.27s-alt", conf->cache_name[0]);
2208 2209
2209 conf->active_name = 0; 2210 conf->active_name = 0;
2210 sc = kmem_cache_create(conf->cache_name[conf->active_name], 2211 sc = kmem_cache_create(conf->cache_name[conf->active_name],
@@ -6764,9 +6765,7 @@ static void free_conf(struct r5conf *conf)
6764 6765
6765 log_exit(conf); 6766 log_exit(conf);
6766 6767
6767 if (conf->shrinker.nr_deferred) 6768 unregister_shrinker(&conf->shrinker);
6768 unregister_shrinker(&conf->shrinker);
6769
6770 free_thread_groups(conf); 6769 free_thread_groups(conf);
6771 shrink_stripes(conf); 6770 shrink_stripes(conf);
6772 raid5_free_percpu(conf); 6771 raid5_free_percpu(conf);
@@ -8001,13 +8000,7 @@ static void raid5_finish_reshape(struct mddev *mddev)
8001 8000
8002 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { 8001 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
8003 8002
8004 if (mddev->delta_disks > 0) { 8003 if (mddev->delta_disks <= 0) {
8005 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));
8006 if (mddev->queue) {
8007 set_capacity(mddev->gendisk, mddev->array_sectors);
8008 revalidate_disk(mddev->gendisk);
8009 }
8010 } else {
8011 int d; 8004 int d;
8012 spin_lock_irq(&conf->device_lock); 8005 spin_lock_irq(&conf->device_lock);
8013 mddev->degraded = raid5_calc_degraded(conf); 8006 mddev->degraded = raid5_calc_degraded(conf);
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 2e6123825095..3f8da26032ac 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -450,6 +450,18 @@ enum {
450 * HANDLE gets cleared if stripe_handle leaves nothing locked. 450 * HANDLE gets cleared if stripe_handle leaves nothing locked.
451 */ 451 */
452 452
453/* Note: disk_info.rdev can be set to NULL asynchronously by raid5_remove_disk.
454 * There are three safe ways to access disk_info.rdev.
455 * 1/ when holding mddev->reconfig_mutex
456 * 2/ when resync/recovery/reshape is known to be happening - i.e. in code that
457 * is called as part of performing resync/recovery/reshape.
458 * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer
459 * and if it is non-NULL, increment rdev->nr_pending before dropping the RCU
460 * lock.
461 * When .rdev is set to NULL, the nr_pending count checked again and if
462 * it has been incremented, the pointer is put back in .rdev.
463 */
464
453struct disk_info { 465struct disk_info {
454 struct md_rdev *rdev, *replacement; 466 struct md_rdev *rdev, *replacement;
455 struct page *extra_page; /* extra page to use in prexor */ 467 struct page *extra_page; /* extra page to use in prexor */
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 145e12bfb819..372c074bb1b9 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -147,6 +147,8 @@ config DVB_CORE
147config DVB_MMAP 147config DVB_MMAP
148 bool "Enable DVB memory-mapped API (EXPERIMENTAL)" 148 bool "Enable DVB memory-mapped API (EXPERIMENTAL)"
149 depends on DVB_CORE 149 depends on DVB_CORE
150 depends on VIDEO_V4L2=y || VIDEO_V4L2=DVB_CORE
151 select VIDEOBUF2_VMALLOC
150 default n 152 default n
151 help 153 help
152 This option enables DVB experimental memory-mapped API, with 154 This option enables DVB experimental memory-mapped API, with
diff --git a/drivers/media/common/videobuf2/Kconfig b/drivers/media/common/videobuf2/Kconfig
index 5df05250de94..17c32ea58395 100644
--- a/drivers/media/common/videobuf2/Kconfig
+++ b/drivers/media/common/videobuf2/Kconfig
@@ -3,6 +3,9 @@ config VIDEOBUF2_CORE
3 select DMA_SHARED_BUFFER 3 select DMA_SHARED_BUFFER
4 tristate 4 tristate
5 5
6config VIDEOBUF2_V4L2
7 tristate
8
6config VIDEOBUF2_MEMOPS 9config VIDEOBUF2_MEMOPS
7 tristate 10 tristate
8 select FRAME_VECTOR 11 select FRAME_VECTOR
diff --git a/drivers/media/common/videobuf2/Makefile b/drivers/media/common/videobuf2/Makefile
index 19de5ccda20b..77bebe8b202f 100644
--- a/drivers/media/common/videobuf2/Makefile
+++ b/drivers/media/common/videobuf2/Makefile
@@ -1,5 +1,12 @@
1# SPDX-License-Identifier: GPL-2.0
2videobuf2-common-objs := videobuf2-core.o
1 3
2obj-$(CONFIG_VIDEOBUF2_CORE) += videobuf2-core.o videobuf2-v4l2.o 4ifeq ($(CONFIG_TRACEPOINTS),y)
5 videobuf2-common-objs += vb2-trace.o
6endif
7
8obj-$(CONFIG_VIDEOBUF2_CORE) += videobuf2-common.o
9obj-$(CONFIG_VIDEOBUF2_V4L2) += videobuf2-v4l2.o
3obj-$(CONFIG_VIDEOBUF2_MEMOPS) += videobuf2-memops.o 10obj-$(CONFIG_VIDEOBUF2_MEMOPS) += videobuf2-memops.o
4obj-$(CONFIG_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o 11obj-$(CONFIG_VIDEOBUF2_VMALLOC) += videobuf2-vmalloc.o
5obj-$(CONFIG_VIDEOBUF2_DMA_CONTIG) += videobuf2-dma-contig.o 12obj-$(CONFIG_VIDEOBUF2_DMA_CONTIG) += videobuf2-dma-contig.o
diff --git a/drivers/media/v4l2-core/vb2-trace.c b/drivers/media/common/videobuf2/vb2-trace.c
index 4c0f39d271f0..4c0f39d271f0 100644
--- a/drivers/media/v4l2-core/vb2-trace.c
+++ b/drivers/media/common/videobuf2/vb2-trace.c
diff --git a/drivers/media/dvb-core/Makefile b/drivers/media/dvb-core/Makefile
index 3a105d82019a..62b028ded9f7 100644
--- a/drivers/media/dvb-core/Makefile
+++ b/drivers/media/dvb-core/Makefile
@@ -4,7 +4,7 @@
4# 4#
5 5
6dvb-net-$(CONFIG_DVB_NET) := dvb_net.o 6dvb-net-$(CONFIG_DVB_NET) := dvb_net.o
7dvb-vb2-$(CONFIG_DVB_MMSP) := dvb_vb2.o 7dvb-vb2-$(CONFIG_DVB_MMAP) := dvb_vb2.o
8 8
9dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o \ 9dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o \
10 dvb_ca_en50221.o dvb_frontend.o \ 10 dvb_ca_en50221.o dvb_frontend.o \
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 6d53af00190e..61a750fae465 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -128,11 +128,7 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
128 struct dvb_device *dvbdev = file->private_data; 128 struct dvb_device *dvbdev = file->private_data;
129 struct dmxdev *dmxdev = dvbdev->priv; 129 struct dmxdev *dmxdev = dvbdev->priv;
130 struct dmx_frontend *front; 130 struct dmx_frontend *front;
131#ifndef DVB_MMAP
132 bool need_ringbuffer = false; 131 bool need_ringbuffer = false;
133#else
134 const bool need_ringbuffer = true;
135#endif
136 132
137 dprintk("%s\n", __func__); 133 dprintk("%s\n", __func__);
138 134
@@ -144,17 +140,31 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
144 return -ENODEV; 140 return -ENODEV;
145 } 141 }
146 142
147#ifndef DVB_MMAP 143 dmxdev->may_do_mmap = 0;
144
145 /*
146 * The logic here is a little tricky due to the ifdef.
147 *
148 * The ringbuffer is used for both read and mmap.
149 *
150 * It is not needed, however, on two situations:
151 * - Write devices (access with O_WRONLY);
152 * - For duplex device nodes, opened with O_RDWR.
153 */
154
148 if ((file->f_flags & O_ACCMODE) == O_RDONLY) 155 if ((file->f_flags & O_ACCMODE) == O_RDONLY)
149 need_ringbuffer = true; 156 need_ringbuffer = true;
150#else 157 else if ((file->f_flags & O_ACCMODE) == O_RDWR) {
151 if ((file->f_flags & O_ACCMODE) == O_RDWR) {
152 if (!(dmxdev->capabilities & DMXDEV_CAP_DUPLEX)) { 158 if (!(dmxdev->capabilities & DMXDEV_CAP_DUPLEX)) {
159#ifdef CONFIG_DVB_MMAP
160 dmxdev->may_do_mmap = 1;
161 need_ringbuffer = true;
162#else
153 mutex_unlock(&dmxdev->mutex); 163 mutex_unlock(&dmxdev->mutex);
154 return -EOPNOTSUPP; 164 return -EOPNOTSUPP;
165#endif
155 } 166 }
156 } 167 }
157#endif
158 168
159 if (need_ringbuffer) { 169 if (need_ringbuffer) {
160 void *mem; 170 void *mem;
@@ -169,8 +179,9 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
169 return -ENOMEM; 179 return -ENOMEM;
170 } 180 }
171 dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE); 181 dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE);
172 dvb_vb2_init(&dmxdev->dvr_vb2_ctx, "dvr", 182 if (dmxdev->may_do_mmap)
173 file->f_flags & O_NONBLOCK); 183 dvb_vb2_init(&dmxdev->dvr_vb2_ctx, "dvr",
184 file->f_flags & O_NONBLOCK);
174 dvbdev->readers--; 185 dvbdev->readers--;
175 } 186 }
176 187
@@ -200,11 +211,6 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
200{ 211{
201 struct dvb_device *dvbdev = file->private_data; 212 struct dvb_device *dvbdev = file->private_data;
202 struct dmxdev *dmxdev = dvbdev->priv; 213 struct dmxdev *dmxdev = dvbdev->priv;
203#ifndef DVB_MMAP
204 bool need_ringbuffer = false;
205#else
206 const bool need_ringbuffer = true;
207#endif
208 214
209 mutex_lock(&dmxdev->mutex); 215 mutex_lock(&dmxdev->mutex);
210 216
@@ -213,15 +219,14 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
213 dmxdev->demux->connect_frontend(dmxdev->demux, 219 dmxdev->demux->connect_frontend(dmxdev->demux,
214 dmxdev->dvr_orig_fe); 220 dmxdev->dvr_orig_fe);
215 } 221 }
216#ifndef DVB_MMAP
217 if ((file->f_flags & O_ACCMODE) == O_RDONLY)
218 need_ringbuffer = true;
219#endif
220 222
221 if (need_ringbuffer) { 223 if (((file->f_flags & O_ACCMODE) == O_RDONLY) ||
222 if (dvb_vb2_is_streaming(&dmxdev->dvr_vb2_ctx)) 224 dmxdev->may_do_mmap) {
223 dvb_vb2_stream_off(&dmxdev->dvr_vb2_ctx); 225 if (dmxdev->may_do_mmap) {
224 dvb_vb2_release(&dmxdev->dvr_vb2_ctx); 226 if (dvb_vb2_is_streaming(&dmxdev->dvr_vb2_ctx))
227 dvb_vb2_stream_off(&dmxdev->dvr_vb2_ctx);
228 dvb_vb2_release(&dmxdev->dvr_vb2_ctx);
229 }
225 dvbdev->readers++; 230 dvbdev->readers++;
226 if (dmxdev->dvr_buffer.data) { 231 if (dmxdev->dvr_buffer.data) {
227 void *mem = dmxdev->dvr_buffer.data; 232 void *mem = dmxdev->dvr_buffer.data;
@@ -380,7 +385,8 @@ static void dvb_dmxdev_filter_timer(struct dmxdev_filter *dmxdevfilter)
380 385
381static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len, 386static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
382 const u8 *buffer2, size_t buffer2_len, 387 const u8 *buffer2, size_t buffer2_len,
383 struct dmx_section_filter *filter) 388 struct dmx_section_filter *filter,
389 u32 *buffer_flags)
384{ 390{
385 struct dmxdev_filter *dmxdevfilter = filter->priv; 391 struct dmxdev_filter *dmxdevfilter = filter->priv;
386 int ret; 392 int ret;
@@ -399,10 +405,12 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
399 dprintk("section callback %*ph\n", 6, buffer1); 405 dprintk("section callback %*ph\n", 6, buffer1);
400 if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx)) { 406 if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx)) {
401 ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx, 407 ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx,
402 buffer1, buffer1_len); 408 buffer1, buffer1_len,
409 buffer_flags);
403 if (ret == buffer1_len) 410 if (ret == buffer1_len)
404 ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx, 411 ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx,
405 buffer2, buffer2_len); 412 buffer2, buffer2_len,
413 buffer_flags);
406 } else { 414 } else {
407 ret = dvb_dmxdev_buffer_write(&dmxdevfilter->buffer, 415 ret = dvb_dmxdev_buffer_write(&dmxdevfilter->buffer,
408 buffer1, buffer1_len); 416 buffer1, buffer1_len);
@@ -422,11 +430,12 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
422 430
423static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, 431static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
424 const u8 *buffer2, size_t buffer2_len, 432 const u8 *buffer2, size_t buffer2_len,
425 struct dmx_ts_feed *feed) 433 struct dmx_ts_feed *feed,
434 u32 *buffer_flags)
426{ 435{
427 struct dmxdev_filter *dmxdevfilter = feed->priv; 436 struct dmxdev_filter *dmxdevfilter = feed->priv;
428 struct dvb_ringbuffer *buffer; 437 struct dvb_ringbuffer *buffer;
429#ifdef DVB_MMAP 438#ifdef CONFIG_DVB_MMAP
430 struct dvb_vb2_ctx *ctx; 439 struct dvb_vb2_ctx *ctx;
431#endif 440#endif
432 int ret; 441 int ret;
@@ -440,20 +449,22 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
440 if (dmxdevfilter->params.pes.output == DMX_OUT_TAP || 449 if (dmxdevfilter->params.pes.output == DMX_OUT_TAP ||
441 dmxdevfilter->params.pes.output == DMX_OUT_TSDEMUX_TAP) { 450 dmxdevfilter->params.pes.output == DMX_OUT_TSDEMUX_TAP) {
442 buffer = &dmxdevfilter->buffer; 451 buffer = &dmxdevfilter->buffer;
443#ifdef DVB_MMAP 452#ifdef CONFIG_DVB_MMAP
444 ctx = &dmxdevfilter->vb2_ctx; 453 ctx = &dmxdevfilter->vb2_ctx;
445#endif 454#endif
446 } else { 455 } else {
447 buffer = &dmxdevfilter->dev->dvr_buffer; 456 buffer = &dmxdevfilter->dev->dvr_buffer;
448#ifdef DVB_MMAP 457#ifdef CONFIG_DVB_MMAP
449 ctx = &dmxdevfilter->dev->dvr_vb2_ctx; 458 ctx = &dmxdevfilter->dev->dvr_vb2_ctx;
450#endif 459#endif
451 } 460 }
452 461
453 if (dvb_vb2_is_streaming(ctx)) { 462 if (dvb_vb2_is_streaming(ctx)) {
454 ret = dvb_vb2_fill_buffer(ctx, buffer1, buffer1_len); 463 ret = dvb_vb2_fill_buffer(ctx, buffer1, buffer1_len,
464 buffer_flags);
455 if (ret == buffer1_len) 465 if (ret == buffer1_len)
456 ret = dvb_vb2_fill_buffer(ctx, buffer2, buffer2_len); 466 ret = dvb_vb2_fill_buffer(ctx, buffer2, buffer2_len,
467 buffer_flags);
457 } else { 468 } else {
458 if (buffer->error) { 469 if (buffer->error) {
459 spin_unlock(&dmxdevfilter->dev->lock); 470 spin_unlock(&dmxdevfilter->dev->lock);
@@ -802,6 +813,12 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
802 mutex_init(&dmxdevfilter->mutex); 813 mutex_init(&dmxdevfilter->mutex);
803 file->private_data = dmxdevfilter; 814 file->private_data = dmxdevfilter;
804 815
816#ifdef CONFIG_DVB_MMAP
817 dmxdev->may_do_mmap = 1;
818#else
819 dmxdev->may_do_mmap = 0;
820#endif
821
805 dvb_ringbuffer_init(&dmxdevfilter->buffer, NULL, 8192); 822 dvb_ringbuffer_init(&dmxdevfilter->buffer, NULL, 8192);
806 dvb_vb2_init(&dmxdevfilter->vb2_ctx, "demux_filter", 823 dvb_vb2_init(&dmxdevfilter->vb2_ctx, "demux_filter",
807 file->f_flags & O_NONBLOCK); 824 file->f_flags & O_NONBLOCK);
@@ -1111,7 +1128,7 @@ static int dvb_demux_do_ioctl(struct file *file,
1111 mutex_unlock(&dmxdevfilter->mutex); 1128 mutex_unlock(&dmxdevfilter->mutex);
1112 break; 1129 break;
1113 1130
1114#ifdef DVB_MMAP 1131#ifdef CONFIG_DVB_MMAP
1115 case DMX_REQBUFS: 1132 case DMX_REQBUFS:
1116 if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { 1133 if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
1117 mutex_unlock(&dmxdev->mutex); 1134 mutex_unlock(&dmxdev->mutex);
@@ -1160,7 +1177,7 @@ static int dvb_demux_do_ioctl(struct file *file,
1160 break; 1177 break;
1161#endif 1178#endif
1162 default: 1179 default:
1163 ret = -EINVAL; 1180 ret = -ENOTTY;
1164 break; 1181 break;
1165 } 1182 }
1166 mutex_unlock(&dmxdev->mutex); 1183 mutex_unlock(&dmxdev->mutex);
@@ -1199,13 +1216,16 @@ static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
1199 return mask; 1216 return mask;
1200} 1217}
1201 1218
1202#ifdef DVB_MMAP 1219#ifdef CONFIG_DVB_MMAP
1203static int dvb_demux_mmap(struct file *file, struct vm_area_struct *vma) 1220static int dvb_demux_mmap(struct file *file, struct vm_area_struct *vma)
1204{ 1221{
1205 struct dmxdev_filter *dmxdevfilter = file->private_data; 1222 struct dmxdev_filter *dmxdevfilter = file->private_data;
1206 struct dmxdev *dmxdev = dmxdevfilter->dev; 1223 struct dmxdev *dmxdev = dmxdevfilter->dev;
1207 int ret; 1224 int ret;
1208 1225
1226 if (!dmxdev->may_do_mmap)
1227 return -ENOTTY;
1228
1209 if (mutex_lock_interruptible(&dmxdev->mutex)) 1229 if (mutex_lock_interruptible(&dmxdev->mutex))
1210 return -ERESTARTSYS; 1230 return -ERESTARTSYS;
1211 1231
@@ -1249,7 +1269,7 @@ static const struct file_operations dvb_demux_fops = {
1249 .release = dvb_demux_release, 1269 .release = dvb_demux_release,
1250 .poll = dvb_demux_poll, 1270 .poll = dvb_demux_poll,
1251 .llseek = default_llseek, 1271 .llseek = default_llseek,
1252#ifdef DVB_MMAP 1272#ifdef CONFIG_DVB_MMAP
1253 .mmap = dvb_demux_mmap, 1273 .mmap = dvb_demux_mmap,
1254#endif 1274#endif
1255}; 1275};
@@ -1280,7 +1300,7 @@ static int dvb_dvr_do_ioctl(struct file *file,
1280 ret = dvb_dvr_set_buffer_size(dmxdev, arg); 1300 ret = dvb_dvr_set_buffer_size(dmxdev, arg);
1281 break; 1301 break;
1282 1302
1283#ifdef DVB_MMAP 1303#ifdef CONFIG_DVB_MMAP
1284 case DMX_REQBUFS: 1304 case DMX_REQBUFS:
1285 ret = dvb_vb2_reqbufs(&dmxdev->dvr_vb2_ctx, parg); 1305 ret = dvb_vb2_reqbufs(&dmxdev->dvr_vb2_ctx, parg);
1286 break; 1306 break;
@@ -1304,7 +1324,7 @@ static int dvb_dvr_do_ioctl(struct file *file,
1304 break; 1324 break;
1305#endif 1325#endif
1306 default: 1326 default:
1307 ret = -EINVAL; 1327 ret = -ENOTTY;
1308 break; 1328 break;
1309 } 1329 }
1310 mutex_unlock(&dmxdev->mutex); 1330 mutex_unlock(&dmxdev->mutex);
@@ -1322,11 +1342,6 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1322 struct dvb_device *dvbdev = file->private_data; 1342 struct dvb_device *dvbdev = file->private_data;
1323 struct dmxdev *dmxdev = dvbdev->priv; 1343 struct dmxdev *dmxdev = dvbdev->priv;
1324 __poll_t mask = 0; 1344 __poll_t mask = 0;
1325#ifndef DVB_MMAP
1326 bool need_ringbuffer = false;
1327#else
1328 const bool need_ringbuffer = true;
1329#endif
1330 1345
1331 dprintk("%s\n", __func__); 1346 dprintk("%s\n", __func__);
1332 1347
@@ -1337,11 +1352,8 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1337 1352
1338 poll_wait(file, &dmxdev->dvr_buffer.queue, wait); 1353 poll_wait(file, &dmxdev->dvr_buffer.queue, wait);
1339 1354
1340#ifndef DVB_MMAP 1355 if (((file->f_flags & O_ACCMODE) == O_RDONLY) ||
1341 if ((file->f_flags & O_ACCMODE) == O_RDONLY) 1356 dmxdev->may_do_mmap) {
1342 need_ringbuffer = true;
1343#endif
1344 if (need_ringbuffer) {
1345 if (dmxdev->dvr_buffer.error) 1357 if (dmxdev->dvr_buffer.error)
1346 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR); 1358 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR);
1347 1359
@@ -1353,13 +1365,16 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1353 return mask; 1365 return mask;
1354} 1366}
1355 1367
1356#ifdef DVB_MMAP 1368#ifdef CONFIG_DVB_MMAP
1357static int dvb_dvr_mmap(struct file *file, struct vm_area_struct *vma) 1369static int dvb_dvr_mmap(struct file *file, struct vm_area_struct *vma)
1358{ 1370{
1359 struct dvb_device *dvbdev = file->private_data; 1371 struct dvb_device *dvbdev = file->private_data;
1360 struct dmxdev *dmxdev = dvbdev->priv; 1372 struct dmxdev *dmxdev = dvbdev->priv;
1361 int ret; 1373 int ret;
1362 1374
1375 if (!dmxdev->may_do_mmap)
1376 return -ENOTTY;
1377
1363 if (dmxdev->exit) 1378 if (dmxdev->exit)
1364 return -ENODEV; 1379 return -ENODEV;
1365 1380
@@ -1381,7 +1396,7 @@ static const struct file_operations dvb_dvr_fops = {
1381 .release = dvb_dvr_release, 1396 .release = dvb_dvr_release,
1382 .poll = dvb_dvr_poll, 1397 .poll = dvb_dvr_poll,
1383 .llseek = default_llseek, 1398 .llseek = default_llseek,
1384#ifdef DVB_MMAP 1399#ifdef CONFIG_DVB_MMAP
1385 .mmap = dvb_dvr_mmap, 1400 .mmap = dvb_dvr_mmap,
1386#endif 1401#endif
1387}; 1402};
diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c
index 210eed0269b0..f45091246bdc 100644
--- a/drivers/media/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb-core/dvb_demux.c
@@ -55,6 +55,17 @@ MODULE_PARM_DESC(dvb_demux_feed_err_pkts,
55 dprintk(x); \ 55 dprintk(x); \
56} while (0) 56} while (0)
57 57
58#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
59# define dprintk_sect_loss(x...) dprintk(x)
60#else
61# define dprintk_sect_loss(x...)
62#endif
63
64#define set_buf_flags(__feed, __flag) \
65 do { \
66 (__feed)->buffer_flags |= (__flag); \
67 } while (0)
68
58/****************************************************************************** 69/******************************************************************************
59 * static inlined helper functions 70 * static inlined helper functions
60 ******************************************************************************/ 71 ******************************************************************************/
@@ -104,31 +115,30 @@ static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
104{ 115{
105 int count = payload(buf); 116 int count = payload(buf);
106 int p; 117 int p;
107#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
108 int ccok; 118 int ccok;
109 u8 cc; 119 u8 cc;
110#endif
111 120
112 if (count == 0) 121 if (count == 0)
113 return -1; 122 return -1;
114 123
115 p = 188 - count; 124 p = 188 - count;
116 125
117#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
118 cc = buf[3] & 0x0f; 126 cc = buf[3] & 0x0f;
119 ccok = ((feed->cc + 1) & 0x0f) == cc; 127 ccok = ((feed->cc + 1) & 0x0f) == cc;
120 feed->cc = cc; 128 feed->cc = cc;
121 if (!ccok) 129 if (!ccok) {
122 dprintk("missed packet: %d instead of %d!\n", 130 set_buf_flags(feed, DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
123 cc, (feed->cc + 1) & 0x0f); 131 dprintk_sect_loss("missed packet: %d instead of %d!\n",
124#endif 132 cc, (feed->cc + 1) & 0x0f);
133 }
125 134
126 if (buf[1] & 0x40) // PUSI ? 135 if (buf[1] & 0x40) // PUSI ?
127 feed->peslen = 0xfffa; 136 feed->peslen = 0xfffa;
128 137
129 feed->peslen += count; 138 feed->peslen += count;
130 139
131 return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts); 140 return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts,
141 &feed->buffer_flags);
132} 142}
133 143
134static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed, 144static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed,
@@ -150,7 +160,7 @@ static int dvb_dmx_swfilter_sectionfilter(struct dvb_demux_feed *feed,
150 return 0; 160 return 0;
151 161
152 return feed->cb.sec(feed->feed.sec.secbuf, feed->feed.sec.seclen, 162 return feed->cb.sec(feed->feed.sec.secbuf, feed->feed.sec.seclen,
153 NULL, 0, &f->filter); 163 NULL, 0, &f->filter, &feed->buffer_flags);
154} 164}
155 165
156static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed) 166static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed)
@@ -169,8 +179,10 @@ static inline int dvb_dmx_swfilter_section_feed(struct dvb_demux_feed *feed)
169 if (sec->check_crc) { 179 if (sec->check_crc) {
170 section_syntax_indicator = ((sec->secbuf[1] & 0x80) != 0); 180 section_syntax_indicator = ((sec->secbuf[1] & 0x80) != 0);
171 if (section_syntax_indicator && 181 if (section_syntax_indicator &&
172 demux->check_crc32(feed, sec->secbuf, sec->seclen)) 182 demux->check_crc32(feed, sec->secbuf, sec->seclen)) {
183 set_buf_flags(feed, DMX_BUFFER_FLAG_HAD_CRC32_DISCARD);
173 return -1; 184 return -1;
185 }
174 } 186 }
175 187
176 do { 188 do {
@@ -187,7 +199,6 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
187{ 199{
188 struct dmx_section_feed *sec = &feed->feed.sec; 200 struct dmx_section_feed *sec = &feed->feed.sec;
189 201
190#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
191 if (sec->secbufp < sec->tsfeedp) { 202 if (sec->secbufp < sec->tsfeedp) {
192 int n = sec->tsfeedp - sec->secbufp; 203 int n = sec->tsfeedp - sec->secbufp;
193 204
@@ -197,12 +208,13 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
197 * but just first and last. 208 * but just first and last.
198 */ 209 */
199 if (sec->secbuf[0] != 0xff || sec->secbuf[n - 1] != 0xff) { 210 if (sec->secbuf[0] != 0xff || sec->secbuf[n - 1] != 0xff) {
200 dprintk("section ts padding loss: %d/%d\n", 211 set_buf_flags(feed,
201 n, sec->tsfeedp); 212 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
202 dprintk("pad data: %*ph\n", n, sec->secbuf); 213 dprintk_sect_loss("section ts padding loss: %d/%d\n",
214 n, sec->tsfeedp);
215 dprintk_sect_loss("pad data: %*ph\n", n, sec->secbuf);
203 } 216 }
204 } 217 }
205#endif
206 218
207 sec->tsfeedp = sec->secbufp = sec->seclen = 0; 219 sec->tsfeedp = sec->secbufp = sec->seclen = 0;
208 sec->secbuf = sec->secbuf_base; 220 sec->secbuf = sec->secbuf_base;
@@ -237,11 +249,10 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
237 return 0; 249 return 0;
238 250
239 if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) { 251 if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
240#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 252 set_buf_flags(feed, DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
241 dprintk("section buffer full loss: %d/%d\n", 253 dprintk_sect_loss("section buffer full loss: %d/%d\n",
242 sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE, 254 sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE,
243 DMX_MAX_SECFEED_SIZE); 255 DMX_MAX_SECFEED_SIZE);
244#endif
245 len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp; 256 len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp;
246 } 257 }
247 258
@@ -269,12 +280,13 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
269 sec->seclen = seclen; 280 sec->seclen = seclen;
270 sec->crc_val = ~0; 281 sec->crc_val = ~0;
271 /* dump [secbuf .. secbuf+seclen) */ 282 /* dump [secbuf .. secbuf+seclen) */
272 if (feed->pusi_seen) 283 if (feed->pusi_seen) {
273 dvb_dmx_swfilter_section_feed(feed); 284 dvb_dmx_swfilter_section_feed(feed);
274#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 285 } else {
275 else 286 set_buf_flags(feed,
276 dprintk("pusi not seen, discarding section data\n"); 287 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
277#endif 288 dprintk_sect_loss("pusi not seen, discarding section data\n");
289 }
278 sec->secbufp += seclen; /* secbufp and secbuf moving together is */ 290 sec->secbufp += seclen; /* secbufp and secbuf moving together is */
279 sec->secbuf += seclen; /* redundant but saves pointer arithmetic */ 291 sec->secbuf += seclen; /* redundant but saves pointer arithmetic */
280 } 292 }
@@ -307,18 +319,22 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
307 } 319 }
308 320
309 if (!ccok || dc_i) { 321 if (!ccok || dc_i) {
310#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG 322 if (dc_i) {
311 if (dc_i) 323 set_buf_flags(feed,
312 dprintk("%d frame with disconnect indicator\n", 324 DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR);
325 dprintk_sect_loss("%d frame with disconnect indicator\n",
313 cc); 326 cc);
314 else 327 } else {
315 dprintk("discontinuity: %d instead of %d. %d bytes lost\n", 328 set_buf_flags(feed,
329 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
330 dprintk_sect_loss("discontinuity: %d instead of %d. %d bytes lost\n",
316 cc, (feed->cc + 1) & 0x0f, count + 4); 331 cc, (feed->cc + 1) & 0x0f, count + 4);
332 }
317 /* 333 /*
318 * those bytes under sume circumstances will again be reported 334 * those bytes under some circumstances will again be reported
319 * in the following dvb_dmx_swfilter_section_new 335 * in the following dvb_dmx_swfilter_section_new
320 */ 336 */
321#endif 337
322 /* 338 /*
323 * Discontinuity detected. Reset pusi_seen to 339 * Discontinuity detected. Reset pusi_seen to
324 * stop feeding of suspicious data until next PUSI=1 arrives 340 * stop feeding of suspicious data until next PUSI=1 arrives
@@ -326,6 +342,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
326 * FIXME: does it make sense if the MPEG-TS is the one 342 * FIXME: does it make sense if the MPEG-TS is the one
327 * reporting discontinuity? 343 * reporting discontinuity?
328 */ 344 */
345
329 feed->pusi_seen = false; 346 feed->pusi_seen = false;
330 dvb_dmx_swfilter_section_new(feed); 347 dvb_dmx_swfilter_section_new(feed);
331 } 348 }
@@ -345,11 +362,11 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
345 dvb_dmx_swfilter_section_new(feed); 362 dvb_dmx_swfilter_section_new(feed);
346 dvb_dmx_swfilter_section_copy_dump(feed, after, 363 dvb_dmx_swfilter_section_copy_dump(feed, after,
347 after_len); 364 after_len);
365 } else if (count > 0) {
366 set_buf_flags(feed,
367 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
368 dprintk_sect_loss("PUSI=1 but %d bytes lost\n", count);
348 } 369 }
349#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
350 else if (count > 0)
351 dprintk("PUSI=1 but %d bytes lost\n", count);
352#endif
353 } else { 370 } else {
354 /* PUSI=0 (is not set), no section boundary */ 371 /* PUSI=0 (is not set), no section boundary */
355 dvb_dmx_swfilter_section_copy_dump(feed, &buf[p], count); 372 dvb_dmx_swfilter_section_copy_dump(feed, &buf[p], count);
@@ -369,7 +386,8 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed,
369 if (feed->ts_type & TS_PAYLOAD_ONLY) 386 if (feed->ts_type & TS_PAYLOAD_ONLY)
370 dvb_dmx_swfilter_payload(feed, buf); 387 dvb_dmx_swfilter_payload(feed, buf);
371 else 388 else
372 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts); 389 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts,
390 &feed->buffer_flags);
373 } 391 }
374 /* Used only on full-featured devices */ 392 /* Used only on full-featured devices */
375 if (feed->ts_type & TS_DECODER) 393 if (feed->ts_type & TS_DECODER)
@@ -430,6 +448,11 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
430 } 448 }
431 449
432 if (buf[1] & 0x80) { 450 if (buf[1] & 0x80) {
451 list_for_each_entry(feed, &demux->feed_list, list_head) {
452 if ((feed->pid != pid) && (feed->pid != 0x2000))
453 continue;
454 set_buf_flags(feed, DMX_BUFFER_FLAG_TEI);
455 }
433 dprintk_tscheck("TEI detected. PID=0x%x data1=0x%x\n", 456 dprintk_tscheck("TEI detected. PID=0x%x data1=0x%x\n",
434 pid, buf[1]); 457 pid, buf[1]);
435 /* data in this packet can't be trusted - drop it unless 458 /* data in this packet can't be trusted - drop it unless
@@ -445,6 +468,13 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
445 (demux->cnt_storage[pid] + 1) & 0xf; 468 (demux->cnt_storage[pid] + 1) & 0xf;
446 469
447 if ((buf[3] & 0xf) != demux->cnt_storage[pid]) { 470 if ((buf[3] & 0xf) != demux->cnt_storage[pid]) {
471 list_for_each_entry(feed, &demux->feed_list, list_head) {
472 if ((feed->pid != pid) && (feed->pid != 0x2000))
473 continue;
474 set_buf_flags(feed,
475 DMX_BUFFER_PKT_COUNTER_MISMATCH);
476 }
477
448 dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n", 478 dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n",
449 pid, demux->cnt_storage[pid], 479 pid, demux->cnt_storage[pid],
450 buf[3] & 0xf); 480 buf[3] & 0xf);
@@ -466,7 +496,8 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
466 if (feed->pid == pid) 496 if (feed->pid == pid)
467 dvb_dmx_swfilter_packet_type(feed, buf); 497 dvb_dmx_swfilter_packet_type(feed, buf);
468 else if (feed->pid == 0x2000) 498 else if (feed->pid == 0x2000)
469 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts); 499 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts,
500 &feed->buffer_flags);
470 } 501 }
471} 502}
472 503
@@ -585,7 +616,8 @@ void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, size_t count)
585 616
586 spin_lock_irqsave(&demux->lock, flags); 617 spin_lock_irqsave(&demux->lock, flags);
587 618
588 demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts); 619 demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts,
620 &demux->feed->buffer_flags);
589 621
590 spin_unlock_irqrestore(&demux->lock, flags); 622 spin_unlock_irqrestore(&demux->lock, flags);
591} 623}
@@ -785,6 +817,7 @@ static int dvbdmx_allocate_ts_feed(struct dmx_demux *dmx,
785 feed->demux = demux; 817 feed->demux = demux;
786 feed->pid = 0xffff; 818 feed->pid = 0xffff;
787 feed->peslen = 0xfffa; 819 feed->peslen = 0xfffa;
820 feed->buffer_flags = 0;
788 821
789 (*ts_feed) = &feed->feed.ts; 822 (*ts_feed) = &feed->feed.ts;
790 (*ts_feed)->parent = dmx; 823 (*ts_feed)->parent = dmx;
@@ -1042,6 +1075,7 @@ static int dvbdmx_allocate_section_feed(struct dmx_demux *demux,
1042 dvbdmxfeed->cb.sec = callback; 1075 dvbdmxfeed->cb.sec = callback;
1043 dvbdmxfeed->demux = dvbdmx; 1076 dvbdmxfeed->demux = dvbdmx;
1044 dvbdmxfeed->pid = 0xffff; 1077 dvbdmxfeed->pid = 0xffff;
1078 dvbdmxfeed->buffer_flags = 0;
1045 dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base; 1079 dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base;
1046 dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0; 1080 dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0;
1047 dvbdmxfeed->feed.sec.tsfeedp = 0; 1081 dvbdmxfeed->feed.sec.tsfeedp = 0;
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index b6c7eec863b9..ba39f9942e1d 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -883,7 +883,8 @@ static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len)
883 883
884static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, 884static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
885 const u8 *buffer2, size_t buffer2_len, 885 const u8 *buffer2, size_t buffer2_len,
886 struct dmx_ts_feed *feed) 886 struct dmx_ts_feed *feed,
887 u32 *buffer_flags)
887{ 888{
888 struct net_device *dev = feed->priv; 889 struct net_device *dev = feed->priv;
889 890
@@ -992,7 +993,7 @@ static void dvb_net_sec(struct net_device *dev,
992 993
993static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, 994static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len,
994 const u8 *buffer2, size_t buffer2_len, 995 const u8 *buffer2, size_t buffer2_len,
995 struct dmx_section_filter *filter) 996 struct dmx_section_filter *filter, u32 *buffer_flags)
996{ 997{
997 struct net_device *dev = filter->priv; 998 struct net_device *dev = filter->priv;
998 999
diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c
index 763145d74e83..b811adf88afa 100644
--- a/drivers/media/dvb-core/dvb_vb2.c
+++ b/drivers/media/dvb-core/dvb_vb2.c
@@ -256,7 +256,8 @@ int dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx)
256} 256}
257 257
258int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx, 258int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
259 const unsigned char *src, int len) 259 const unsigned char *src, int len,
260 enum dmx_buffer_flags *buffer_flags)
260{ 261{
261 unsigned long flags = 0; 262 unsigned long flags = 0;
262 void *vbuf = NULL; 263 void *vbuf = NULL;
@@ -264,15 +265,17 @@ int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
264 unsigned char *psrc = (unsigned char *)src; 265 unsigned char *psrc = (unsigned char *)src;
265 int ll = 0; 266 int ll = 0;
266 267
267 dprintk(3, "[%s] %d bytes are rcvd\n", ctx->name, len); 268 /*
268 if (!src) { 269 * normal case: This func is called twice from demux driver
269 dprintk(3, "[%s]:NULL pointer src\n", ctx->name); 270 * one with valid src pointer, second time with NULL pointer
270 /**normal case: This func is called twice from demux driver 271 */
271 * once with valid src pointer, second time with NULL pointer 272 if (!src || !len)
272 */
273 return 0; 273 return 0;
274 }
275 spin_lock_irqsave(&ctx->slock, flags); 274 spin_lock_irqsave(&ctx->slock, flags);
275 if (buffer_flags && *buffer_flags) {
276 ctx->flags |= *buffer_flags;
277 *buffer_flags = 0;
278 }
276 while (todo) { 279 while (todo) {
277 if (!ctx->buf) { 280 if (!ctx->buf) {
278 if (list_empty(&ctx->dvb_q)) { 281 if (list_empty(&ctx->dvb_q)) {
@@ -395,6 +398,7 @@ int dvb_vb2_qbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)
395 398
396int dvb_vb2_dqbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b) 399int dvb_vb2_dqbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)
397{ 400{
401 unsigned long flags;
398 int ret; 402 int ret;
399 403
400 ret = vb2_core_dqbuf(&ctx->vb_q, &b->index, b, ctx->nonblocking); 404 ret = vb2_core_dqbuf(&ctx->vb_q, &b->index, b, ctx->nonblocking);
@@ -402,7 +406,16 @@ int dvb_vb2_dqbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)
402 dprintk(1, "[%s] errno=%d\n", ctx->name, ret); 406 dprintk(1, "[%s] errno=%d\n", ctx->name, ret);
403 return ret; 407 return ret;
404 } 408 }
405 dprintk(5, "[%s] index=%d\n", ctx->name, b->index); 409
410 spin_lock_irqsave(&ctx->slock, flags);
411 b->count = ctx->count++;
412 b->flags = ctx->flags;
413 ctx->flags = 0;
414 spin_unlock_irqrestore(&ctx->slock, flags);
415
416 dprintk(5, "[%s] index=%d, count=%d, flags=%d\n",
417 ctx->name, b->index, ctx->count, b->flags);
418
406 419
407 return 0; 420 return 0;
408} 421}
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 50bce68ffd66..65d157fe76d1 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1262,11 +1262,12 @@ static int m88ds3103_select(struct i2c_mux_core *muxc, u32 chan)
1262 * New users must use I2C client binding directly! 1262 * New users must use I2C client binding directly!
1263 */ 1263 */
1264struct dvb_frontend *m88ds3103_attach(const struct m88ds3103_config *cfg, 1264struct dvb_frontend *m88ds3103_attach(const struct m88ds3103_config *cfg,
1265 struct i2c_adapter *i2c, struct i2c_adapter **tuner_i2c_adapter) 1265 struct i2c_adapter *i2c,
1266 struct i2c_adapter **tuner_i2c_adapter)
1266{ 1267{
1267 struct i2c_client *client; 1268 struct i2c_client *client;
1268 struct i2c_board_info board_info; 1269 struct i2c_board_info board_info;
1269 struct m88ds3103_platform_data pdata; 1270 struct m88ds3103_platform_data pdata = {};
1270 1271
1271 pdata.clk = cfg->clock; 1272 pdata.clk = cfg->clock;
1272 pdata.i2c_wr_max = cfg->i2c_wr_max; 1273 pdata.i2c_wr_max = cfg->i2c_wr_max;
@@ -1409,6 +1410,8 @@ static int m88ds3103_probe(struct i2c_client *client,
1409 case M88DS3103_CHIP_ID: 1410 case M88DS3103_CHIP_ID:
1410 break; 1411 break;
1411 default: 1412 default:
1413 ret = -ENODEV;
1414 dev_err(&client->dev, "Unknown device. Chip_id=%02x\n", dev->chip_id);
1412 goto err_kfree; 1415 goto err_kfree;
1413 } 1416 }
1414 1417
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 3c1851984b90..2476d812f669 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -505,80 +505,77 @@ static struct i2c_vbi_ram_value vbi_ram_default[] =
505 /* FIXME: Current api doesn't handle all VBI types, those not 505 /* FIXME: Current api doesn't handle all VBI types, those not
506 yet supported are placed under #if 0 */ 506 yet supported are placed under #if 0 */
507#if 0 507#if 0
508 {0x010, /* Teletext, SECAM, WST System A */ 508 [0] = {0x010, /* Teletext, SECAM, WST System A */
509 {V4L2_SLICED_TELETEXT_SECAM,6,23,1}, 509 {V4L2_SLICED_TELETEXT_SECAM,6,23,1},
510 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x26, 510 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x26,
511 0xe6, 0xb4, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00 } 511 0xe6, 0xb4, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00 }
512 }, 512 },
513#endif 513#endif
514 {0x030, /* Teletext, PAL, WST System B */ 514 [1] = {0x030, /* Teletext, PAL, WST System B */
515 {V4L2_SLICED_TELETEXT_B,6,22,1}, 515 {V4L2_SLICED_TELETEXT_B,6,22,1},
516 { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x2b, 516 { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x2b,
517 0xa6, 0x72, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00 } 517 0xa6, 0x72, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00 }
518 }, 518 },
519#if 0 519#if 0
520 {0x050, /* Teletext, PAL, WST System C */ 520 [2] = {0x050, /* Teletext, PAL, WST System C */
521 {V4L2_SLICED_TELETEXT_PAL_C,6,22,1}, 521 {V4L2_SLICED_TELETEXT_PAL_C,6,22,1},
522 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22, 522 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22,
523 0xa6, 0x98, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } 523 0xa6, 0x98, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 }
524 }, 524 },
525 {0x070, /* Teletext, NTSC, WST System B */ 525 [3] = {0x070, /* Teletext, NTSC, WST System B */
526 {V4L2_SLICED_TELETEXT_NTSC_B,10,21,1}, 526 {V4L2_SLICED_TELETEXT_NTSC_B,10,21,1},
527 { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x23, 527 { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x23,
528 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } 528 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 }
529 }, 529 },
530 {0x090, /* Tetetext, NTSC NABTS System C */ 530 [4] = {0x090, /* Tetetext, NTSC NABTS System C */
531 {V4L2_SLICED_TELETEXT_NTSC_C,10,21,1}, 531 {V4L2_SLICED_TELETEXT_NTSC_C,10,21,1},
532 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22, 532 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22,
533 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x00 } 533 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x00 }
534 }, 534 },
535 {0x0b0, /* Teletext, NTSC-J, NABTS System D */ 535 [5] = {0x0b0, /* Teletext, NTSC-J, NABTS System D */
536 {V4L2_SLICED_TELETEXT_NTSC_D,10,21,1}, 536 {V4L2_SLICED_TELETEXT_NTSC_D,10,21,1},
537 { 0xaa, 0xaa, 0xff, 0xff, 0xa7, 0x2e, 0x20, 0x23, 537 { 0xaa, 0xaa, 0xff, 0xff, 0xa7, 0x2e, 0x20, 0x23,
538 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } 538 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 }
539 }, 539 },
540 {0x0d0, /* Closed Caption, PAL/SECAM */ 540 [6] = {0x0d0, /* Closed Caption, PAL/SECAM */
541 {V4L2_SLICED_CAPTION_625,22,22,1}, 541 {V4L2_SLICED_CAPTION_625,22,22,1},
542 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, 542 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02,
543 0xa6, 0x7b, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 } 543 0xa6, 0x7b, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 }
544 }, 544 },
545#endif 545#endif
546 {0x0f0, /* Closed Caption, NTSC */ 546 [7] = {0x0f0, /* Closed Caption, NTSC */
547 {V4L2_SLICED_CAPTION_525,21,21,1}, 547 {V4L2_SLICED_CAPTION_525,21,21,1},
548 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, 548 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02,
549 0x69, 0x8c, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 } 549 0x69, 0x8c, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 }
550 }, 550 },
551 {0x110, /* Wide Screen Signal, PAL/SECAM */ 551 [8] = {0x110, /* Wide Screen Signal, PAL/SECAM */
552 {V4L2_SLICED_WSS_625,23,23,1}, 552 {V4L2_SLICED_WSS_625,23,23,1},
553 { 0x5b, 0x55, 0xc5, 0xff, 0x00, 0x71, 0x6e, 0x42, 553 { 0x5b, 0x55, 0xc5, 0xff, 0x00, 0x71, 0x6e, 0x42,
554 0xa6, 0xcd, 0x0f, 0x00, 0x00, 0x00, 0x3a, 0x00 } 554 0xa6, 0xcd, 0x0f, 0x00, 0x00, 0x00, 0x3a, 0x00 }
555 }, 555 },
556#if 0 556#if 0
557 {0x130, /* Wide Screen Signal, NTSC C */ 557 [9] = {0x130, /* Wide Screen Signal, NTSC C */
558 {V4L2_SLICED_WSS_525,20,20,1}, 558 {V4L2_SLICED_WSS_525,20,20,1},
559 { 0x38, 0x00, 0x3f, 0x00, 0x00, 0x71, 0x6e, 0x43, 559 { 0x38, 0x00, 0x3f, 0x00, 0x00, 0x71, 0x6e, 0x43,
560 0x69, 0x7c, 0x08, 0x00, 0x00, 0x00, 0x39, 0x00 } 560 0x69, 0x7c, 0x08, 0x00, 0x00, 0x00, 0x39, 0x00 }
561 }, 561 },
562 {0x150, /* Vertical Interval Timecode (VITC), PAL/SECAM */ 562 [10] = {0x150, /* Vertical Interval Timecode (VITC), PAL/SECAM */
563 {V4l2_SLICED_VITC_625,6,22,0}, 563 {V4l2_SLICED_VITC_625,6,22,0},
564 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49, 564 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49,
565 0xa6, 0x85, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 } 565 0xa6, 0x85, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 }
566 }, 566 },
567 {0x170, /* Vertical Interval Timecode (VITC), NTSC */ 567 [11] = {0x170, /* Vertical Interval Timecode (VITC), NTSC */
568 {V4l2_SLICED_VITC_525,10,20,0}, 568 {V4l2_SLICED_VITC_525,10,20,0},
569 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49, 569 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49,
570 0x69, 0x94, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 } 570 0x69, 0x94, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 }
571 }, 571 },
572#endif 572#endif
573 {0x190, /* Video Program System (VPS), PAL */ 573 [12] = {0x190, /* Video Program System (VPS), PAL */
574 {V4L2_SLICED_VPS,16,16,0}, 574 {V4L2_SLICED_VPS,16,16,0},
575 { 0xaa, 0xaa, 0xff, 0xff, 0xba, 0xce, 0x2b, 0x0d, 575 { 0xaa, 0xaa, 0xff, 0xff, 0xba, 0xce, 0x2b, 0x0d,
576 0xa6, 0xda, 0x0b, 0x00, 0x00, 0x00, 0x60, 0x00 } 576 0xa6, 0xda, 0x0b, 0x00, 0x00, 0x00, 0x60, 0x00 }
577 }, 577 },
578 /* 0x1d0 User programmable */ 578 /* 0x1d0 User programmable */
579
580 /* End of struct */
581 { (u16)-1 }
582}; 579};
583 580
584static int tvp5150_write_inittab(struct v4l2_subdev *sd, 581static int tvp5150_write_inittab(struct v4l2_subdev *sd,
@@ -591,10 +588,10 @@ static int tvp5150_write_inittab(struct v4l2_subdev *sd,
591 return 0; 588 return 0;
592} 589}
593 590
594static int tvp5150_vdp_init(struct v4l2_subdev *sd, 591static int tvp5150_vdp_init(struct v4l2_subdev *sd)
595 const struct i2c_vbi_ram_value *regs)
596{ 592{
597 unsigned int i; 593 unsigned int i;
594 int j;
598 595
599 /* Disable Full Field */ 596 /* Disable Full Field */
600 tvp5150_write(sd, TVP5150_FULL_FIELD_ENA, 0); 597 tvp5150_write(sd, TVP5150_FULL_FIELD_ENA, 0);
@@ -604,14 +601,17 @@ static int tvp5150_vdp_init(struct v4l2_subdev *sd,
604 tvp5150_write(sd, i, 0xff); 601 tvp5150_write(sd, i, 0xff);
605 602
606 /* Load Ram Table */ 603 /* Load Ram Table */
607 while (regs->reg != (u16)-1) { 604 for (j = 0; j < ARRAY_SIZE(vbi_ram_default); j++) {
605 const struct i2c_vbi_ram_value *regs = &vbi_ram_default[j];
606
607 if (!regs->type.vbi_type)
608 continue;
609
608 tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_HIGH, regs->reg >> 8); 610 tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_HIGH, regs->reg >> 8);
609 tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_LOW, regs->reg); 611 tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_LOW, regs->reg);
610 612
611 for (i = 0; i < 16; i++) 613 for (i = 0; i < 16; i++)
612 tvp5150_write(sd, TVP5150_VDP_CONF_RAM_DATA, regs->values[i]); 614 tvp5150_write(sd, TVP5150_VDP_CONF_RAM_DATA, regs->values[i]);
613
614 regs++;
615 } 615 }
616 return 0; 616 return 0;
617} 617}
@@ -620,19 +620,23 @@ static int tvp5150_vdp_init(struct v4l2_subdev *sd,
620static int tvp5150_g_sliced_vbi_cap(struct v4l2_subdev *sd, 620static int tvp5150_g_sliced_vbi_cap(struct v4l2_subdev *sd,
621 struct v4l2_sliced_vbi_cap *cap) 621 struct v4l2_sliced_vbi_cap *cap)
622{ 622{
623 const struct i2c_vbi_ram_value *regs = vbi_ram_default; 623 int line, i;
624 int line;
625 624
626 dev_dbg_lvl(sd->dev, 1, debug, "g_sliced_vbi_cap\n"); 625 dev_dbg_lvl(sd->dev, 1, debug, "g_sliced_vbi_cap\n");
627 memset(cap, 0, sizeof *cap); 626 memset(cap, 0, sizeof *cap);
628 627
629 while (regs->reg != (u16)-1 ) { 628 for (i = 0; i < ARRAY_SIZE(vbi_ram_default); i++) {
630 for (line=regs->type.ini_line;line<=regs->type.end_line;line++) { 629 const struct i2c_vbi_ram_value *regs = &vbi_ram_default[i];
630
631 if (!regs->type.vbi_type)
632 continue;
633
634 for (line = regs->type.ini_line;
635 line <= regs->type.end_line;
636 line++) {
631 cap->service_lines[0][line] |= regs->type.vbi_type; 637 cap->service_lines[0][line] |= regs->type.vbi_type;
632 } 638 }
633 cap->service_set |= regs->type.vbi_type; 639 cap->service_set |= regs->type.vbi_type;
634
635 regs++;
636 } 640 }
637 return 0; 641 return 0;
638} 642}
@@ -651,14 +655,13 @@ static int tvp5150_g_sliced_vbi_cap(struct v4l2_subdev *sd,
651 * MSB = field2 655 * MSB = field2
652 */ 656 */
653static int tvp5150_set_vbi(struct v4l2_subdev *sd, 657static int tvp5150_set_vbi(struct v4l2_subdev *sd,
654 const struct i2c_vbi_ram_value *regs,
655 unsigned int type,u8 flags, int line, 658 unsigned int type,u8 flags, int line,
656 const int fields) 659 const int fields)
657{ 660{
658 struct tvp5150 *decoder = to_tvp5150(sd); 661 struct tvp5150 *decoder = to_tvp5150(sd);
659 v4l2_std_id std = decoder->norm; 662 v4l2_std_id std = decoder->norm;
660 u8 reg; 663 u8 reg;
661 int pos = 0; 664 int i, pos = 0;
662 665
663 if (std == V4L2_STD_ALL) { 666 if (std == V4L2_STD_ALL) {
664 dev_err(sd->dev, "VBI can't be configured without knowing number of lines\n"); 667 dev_err(sd->dev, "VBI can't be configured without knowing number of lines\n");
@@ -671,19 +674,19 @@ static int tvp5150_set_vbi(struct v4l2_subdev *sd,
671 if (line < 6 || line > 27) 674 if (line < 6 || line > 27)
672 return 0; 675 return 0;
673 676
674 while (regs->reg != (u16)-1) { 677 for (i = 0; i < ARRAY_SIZE(vbi_ram_default); i++) {
678 const struct i2c_vbi_ram_value *regs = &vbi_ram_default[i];
679
680 if (!regs->type.vbi_type)
681 continue;
682
675 if ((type & regs->type.vbi_type) && 683 if ((type & regs->type.vbi_type) &&
676 (line >= regs->type.ini_line) && 684 (line >= regs->type.ini_line) &&
677 (line <= regs->type.end_line)) 685 (line <= regs->type.end_line))
678 break; 686 break;
679
680 regs++;
681 pos++; 687 pos++;
682 } 688 }
683 689
684 if (regs->reg == (u16)-1)
685 return 0;
686
687 type = pos | (flags & 0xf0); 690 type = pos | (flags & 0xf0);
688 reg = ((line - 6) << 1) + TVP5150_LINE_MODE_INI; 691 reg = ((line - 6) << 1) + TVP5150_LINE_MODE_INI;
689 692
@@ -696,8 +699,7 @@ static int tvp5150_set_vbi(struct v4l2_subdev *sd,
696 return type; 699 return type;
697} 700}
698 701
699static int tvp5150_get_vbi(struct v4l2_subdev *sd, 702static int tvp5150_get_vbi(struct v4l2_subdev *sd, int line)
700 const struct i2c_vbi_ram_value *regs, int line)
701{ 703{
702 struct tvp5150 *decoder = to_tvp5150(sd); 704 struct tvp5150 *decoder = to_tvp5150(sd);
703 v4l2_std_id std = decoder->norm; 705 v4l2_std_id std = decoder->norm;
@@ -726,8 +728,8 @@ static int tvp5150_get_vbi(struct v4l2_subdev *sd,
726 return 0; 728 return 0;
727 } 729 }
728 pos = ret & 0x0f; 730 pos = ret & 0x0f;
729 if (pos < 0x0f) 731 if (pos < ARRAY_SIZE(vbi_ram_default))
730 type |= regs[pos].type.vbi_type; 732 type |= vbi_ram_default[pos].type.vbi_type;
731 } 733 }
732 734
733 return type; 735 return type;
@@ -788,7 +790,7 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
788 tvp5150_write_inittab(sd, tvp5150_init_default); 790 tvp5150_write_inittab(sd, tvp5150_init_default);
789 791
790 /* Initializes VDP registers */ 792 /* Initializes VDP registers */
791 tvp5150_vdp_init(sd, vbi_ram_default); 793 tvp5150_vdp_init(sd);
792 794
793 /* Selects decoder input */ 795 /* Selects decoder input */
794 tvp5150_selmux(sd); 796 tvp5150_selmux(sd);
@@ -1121,8 +1123,8 @@ static int tvp5150_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f
1121 for (i = 0; i <= 23; i++) { 1123 for (i = 0; i <= 23; i++) {
1122 svbi->service_lines[1][i] = 0; 1124 svbi->service_lines[1][i] = 0;
1123 svbi->service_lines[0][i] = 1125 svbi->service_lines[0][i] =
1124 tvp5150_set_vbi(sd, vbi_ram_default, 1126 tvp5150_set_vbi(sd, svbi->service_lines[0][i],
1125 svbi->service_lines[0][i], 0xf0, i, 3); 1127 0xf0, i, 3);
1126 } 1128 }
1127 /* Enables FIFO */ 1129 /* Enables FIFO */
1128 tvp5150_write(sd, TVP5150_FIFO_OUT_CTRL, 1); 1130 tvp5150_write(sd, TVP5150_FIFO_OUT_CTRL, 1);
@@ -1148,7 +1150,7 @@ static int tvp5150_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_f
1148 1150
1149 for (i = 0; i <= 23; i++) { 1151 for (i = 0; i <= 23; i++) {
1150 svbi->service_lines[0][i] = 1152 svbi->service_lines[0][i] =
1151 tvp5150_get_vbi(sd, vbi_ram_default, i); 1153 tvp5150_get_vbi(sd, i);
1152 mask |= svbi->service_lines[0][i]; 1154 mask |= svbi->service_lines[0][i];
1153 } 1155 }
1154 svbi->service_set = mask; 1156 svbi->service_set = mask;
diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c
index dc8e577b2f74..d6816effb878 100644
--- a/drivers/media/pci/ttpci/av7110.c
+++ b/drivers/media/pci/ttpci/av7110.c
@@ -324,14 +324,15 @@ static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
324 } 324 }
325 return dvbdmxfilter->feed->cb.sec(buffer1, buffer1_len, 325 return dvbdmxfilter->feed->cb.sec(buffer1, buffer1_len,
326 buffer2, buffer2_len, 326 buffer2, buffer2_len,
327 &dvbdmxfilter->filter); 327 &dvbdmxfilter->filter, NULL);
328 case DMX_TYPE_TS: 328 case DMX_TYPE_TS:
329 if (!(dvbdmxfilter->feed->ts_type & TS_PACKET)) 329 if (!(dvbdmxfilter->feed->ts_type & TS_PACKET))
330 return 0; 330 return 0;
331 if (dvbdmxfilter->feed->ts_type & TS_PAYLOAD_ONLY) 331 if (dvbdmxfilter->feed->ts_type & TS_PAYLOAD_ONLY)
332 return dvbdmxfilter->feed->cb.ts(buffer1, buffer1_len, 332 return dvbdmxfilter->feed->cb.ts(buffer1, buffer1_len,
333 buffer2, buffer2_len, 333 buffer2, buffer2_len,
334 &dvbdmxfilter->feed->feed.ts); 334 &dvbdmxfilter->feed->feed.ts,
335 NULL);
335 else 336 else
336 av7110_p2t_write(buffer1, buffer1_len, 337 av7110_p2t_write(buffer1, buffer1_len,
337 dvbdmxfilter->feed->pid, 338 dvbdmxfilter->feed->pid,
diff --git a/drivers/media/pci/ttpci/av7110_av.c b/drivers/media/pci/ttpci/av7110_av.c
index 4daba76ec240..ef1bc17cdc4d 100644
--- a/drivers/media/pci/ttpci/av7110_av.c
+++ b/drivers/media/pci/ttpci/av7110_av.c
@@ -99,7 +99,7 @@ int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
99 buf[4] = buf[5] = 0; 99 buf[4] = buf[5] = 0;
100 if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY) 100 if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
101 return dvbdmxfeed->cb.ts(buf, len, NULL, 0, 101 return dvbdmxfeed->cb.ts(buf, len, NULL, 0,
102 &dvbdmxfeed->feed.ts); 102 &dvbdmxfeed->feed.ts, NULL);
103 else 103 else
104 return dvb_filter_pes2ts(p2t, buf, len, 1); 104 return dvb_filter_pes2ts(p2t, buf, len, 1);
105} 105}
@@ -109,7 +109,7 @@ static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
109 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv; 109 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv;
110 110
111 dvbdmxfeed->cb.ts(data, 188, NULL, 0, 111 dvbdmxfeed->cb.ts(data, 188, NULL, 0,
112 &dvbdmxfeed->feed.ts); 112 &dvbdmxfeed->feed.ts, NULL);
113 return 0; 113 return 0;
114} 114}
115 115
@@ -814,7 +814,7 @@ static void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter,
814 memcpy(obuf + l, buf + c, TS_SIZE - l); 814 memcpy(obuf + l, buf + c, TS_SIZE - l);
815 c = length; 815 c = length;
816 } 816 }
817 feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts); 817 feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts, NULL);
818 pes_start = 0; 818 pes_start = 0;
819 } 819 }
820} 820}
diff --git a/drivers/media/usb/au0828/Kconfig b/drivers/media/usb/au0828/Kconfig
index 70521e0b4c53..bfaa806633df 100644
--- a/drivers/media/usb/au0828/Kconfig
+++ b/drivers/media/usb/au0828/Kconfig
@@ -1,7 +1,7 @@
1 1
2config VIDEO_AU0828 2config VIDEO_AU0828
3 tristate "Auvitek AU0828 support" 3 tristate "Auvitek AU0828 support"
4 depends on I2C && INPUT && DVB_CORE && USB 4 depends on I2C && INPUT && DVB_CORE && USB && VIDEO_V4L2
5 select I2C_ALGOBIT 5 select I2C_ALGOBIT
6 select VIDEO_TVEEPROM 6 select VIDEO_TVEEPROM
7 select VIDEOBUF2_VMALLOC 7 select VIDEOBUF2_VMALLOC
diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index a8900f5571f7..44ca66cb9b8f 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -428,7 +428,7 @@ static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
428 struct ttusb_dec *dec = priv; 428 struct ttusb_dec *dec = priv;
429 429
430 dec->audio_filter->feed->cb.ts(data, 188, NULL, 0, 430 dec->audio_filter->feed->cb.ts(data, 188, NULL, 0,
431 &dec->audio_filter->feed->feed.ts); 431 &dec->audio_filter->feed->feed.ts, NULL);
432 432
433 return 0; 433 return 0;
434} 434}
@@ -438,7 +438,7 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
438 struct ttusb_dec *dec = priv; 438 struct ttusb_dec *dec = priv;
439 439
440 dec->video_filter->feed->cb.ts(data, 188, NULL, 0, 440 dec->video_filter->feed->cb.ts(data, 188, NULL, 0,
441 &dec->video_filter->feed->feed.ts); 441 &dec->video_filter->feed->feed.ts, NULL);
442 442
443 return 0; 443 return 0;
444} 444}
@@ -490,7 +490,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
490 490
491 if (output_pva) { 491 if (output_pva) {
492 dec->video_filter->feed->cb.ts(pva, length, NULL, 0, 492 dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
493 &dec->video_filter->feed->feed.ts); 493 &dec->video_filter->feed->feed.ts, NULL);
494 return; 494 return;
495 } 495 }
496 496
@@ -551,7 +551,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
551 case 0x02: /* MainAudioStream */ 551 case 0x02: /* MainAudioStream */
552 if (output_pva) { 552 if (output_pva) {
553 dec->audio_filter->feed->cb.ts(pva, length, NULL, 0, 553 dec->audio_filter->feed->cb.ts(pva, length, NULL, 0,
554 &dec->audio_filter->feed->feed.ts); 554 &dec->audio_filter->feed->feed.ts, NULL);
555 return; 555 return;
556 } 556 }
557 557
@@ -589,7 +589,7 @@ static void ttusb_dec_process_filter(struct ttusb_dec *dec, u8 *packet,
589 589
590 if (filter) 590 if (filter)
591 filter->feed->cb.sec(&packet[2], length - 2, NULL, 0, 591 filter->feed->cb.sec(&packet[2], length - 2, NULL, 0,
592 &filter->filter); 592 &filter->filter, NULL);
593} 593}
594 594
595static void ttusb_dec_process_packet(struct ttusb_dec *dec) 595static void ttusb_dec_process_packet(struct ttusb_dec *dec)
diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index bf52fbd07aed..8e37e7c5e0f7 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -7,6 +7,7 @@ config VIDEO_V4L2
7 tristate 7 tristate
8 depends on (I2C || I2C=n) && VIDEO_DEV 8 depends on (I2C || I2C=n) && VIDEO_DEV
9 select RATIONAL 9 select RATIONAL
10 select VIDEOBUF2_V4L2 if VIDEOBUF2_CORE
10 default (I2C || I2C=n) && VIDEO_DEV 11 default (I2C || I2C=n) && VIDEO_DEV
11 12
12config VIDEO_ADV_DEBUG 13config VIDEO_ADV_DEBUG
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 80de2cb9c476..7df54582e956 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -13,7 +13,7 @@ ifeq ($(CONFIG_COMPAT),y)
13endif 13endif
14obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o 14obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
15ifeq ($(CONFIG_TRACEPOINTS),y) 15ifeq ($(CONFIG_TRACEPOINTS),y)
16 videodev-objs += vb2-trace.o v4l2-trace.o 16 videodev-objs += v4l2-trace.o
17endif 17endif
18videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o 18videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
19 19
@@ -35,4 +35,3 @@ obj-$(CONFIG_VIDEOBUF_DVB) += videobuf-dvb.o
35 35
36ccflags-y += -I$(srctree)/drivers/media/dvb-frontends 36ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
37ccflags-y += -I$(srctree)/drivers/media/tuners 37ccflags-y += -I$(srctree)/drivers/media/tuners
38
diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c
index 0a7bdbed3a6f..e9c1485c32b9 100644
--- a/drivers/memory/brcmstb_dpfe.c
+++ b/drivers/memory/brcmstb_dpfe.c
@@ -45,8 +45,16 @@
45#define REG_TO_DCPU_MBOX 0x10 45#define REG_TO_DCPU_MBOX 0x10
46#define REG_TO_HOST_MBOX 0x14 46#define REG_TO_HOST_MBOX 0x14
47 47
48/* Macros to process offsets returned by the DCPU */
49#define DRAM_MSG_ADDR_OFFSET 0x0
50#define DRAM_MSG_TYPE_OFFSET 0x1c
51#define DRAM_MSG_ADDR_MASK ((1UL << DRAM_MSG_TYPE_OFFSET) - 1)
52#define DRAM_MSG_TYPE_MASK ((1UL << \
53 (BITS_PER_LONG - DRAM_MSG_TYPE_OFFSET)) - 1)
54
48/* Message RAM */ 55/* Message RAM */
49#define DCPU_MSG_RAM(x) (0x100 + (x) * sizeof(u32)) 56#define DCPU_MSG_RAM_START 0x100
57#define DCPU_MSG_RAM(x) (DCPU_MSG_RAM_START + (x) * sizeof(u32))
50 58
51/* DRAM Info Offsets & Masks */ 59/* DRAM Info Offsets & Masks */
52#define DRAM_INFO_INTERVAL 0x0 60#define DRAM_INFO_INTERVAL 0x0
@@ -255,6 +263,40 @@ static unsigned int get_msg_chksum(const u32 msg[])
255 return sum; 263 return sum;
256} 264}
257 265
266static void __iomem *get_msg_ptr(struct private_data *priv, u32 response,
267 char *buf, ssize_t *size)
268{
269 unsigned int msg_type;
270 unsigned int offset;
271 void __iomem *ptr = NULL;
272
273 msg_type = (response >> DRAM_MSG_TYPE_OFFSET) & DRAM_MSG_TYPE_MASK;
274 offset = (response >> DRAM_MSG_ADDR_OFFSET) & DRAM_MSG_ADDR_MASK;
275
276 /*
277 * msg_type == 1: the offset is relative to the message RAM
278 * msg_type == 0: the offset is relative to the data RAM (this is the
279 * previous way of passing data)
280 * msg_type is anything else: there's critical hardware problem
281 */
282 switch (msg_type) {
283 case 1:
284 ptr = priv->regs + DCPU_MSG_RAM_START + offset;
285 break;
286 case 0:
287 ptr = priv->dmem + offset;
288 break;
289 default:
290 dev_emerg(priv->dev, "invalid message reply from DCPU: %#x\n",
291 response);
292 if (buf && size)
293 *size = sprintf(buf,
294 "FATAL: communication error with DCPU\n");
295 }
296
297 return ptr;
298}
299
258static int __send_command(struct private_data *priv, unsigned int cmd, 300static int __send_command(struct private_data *priv, unsigned int cmd,
259 u32 result[]) 301 u32 result[])
260{ 302{
@@ -507,7 +549,7 @@ static ssize_t show_info(struct device *dev, struct device_attribute *devattr,
507{ 549{
508 u32 response[MSG_FIELD_MAX]; 550 u32 response[MSG_FIELD_MAX];
509 unsigned int info; 551 unsigned int info;
510 int ret; 552 ssize_t ret;
511 553
512 ret = generic_show(DPFE_CMD_GET_INFO, response, dev, buf); 554 ret = generic_show(DPFE_CMD_GET_INFO, response, dev, buf);
513 if (ret) 555 if (ret)
@@ -528,18 +570,19 @@ static ssize_t show_refresh(struct device *dev,
528 u32 response[MSG_FIELD_MAX]; 570 u32 response[MSG_FIELD_MAX];
529 void __iomem *info; 571 void __iomem *info;
530 struct private_data *priv; 572 struct private_data *priv;
531 unsigned int offset;
532 u8 refresh, sr_abort, ppre, thermal_offs, tuf; 573 u8 refresh, sr_abort, ppre, thermal_offs, tuf;
533 u32 mr4; 574 u32 mr4;
534 int ret; 575 ssize_t ret;
535 576
536 ret = generic_show(DPFE_CMD_GET_REFRESH, response, dev, buf); 577 ret = generic_show(DPFE_CMD_GET_REFRESH, response, dev, buf);
537 if (ret) 578 if (ret)
538 return ret; 579 return ret;
539 580
540 priv = dev_get_drvdata(dev); 581 priv = dev_get_drvdata(dev);
541 offset = response[MSG_ARG0]; 582
542 info = priv->dmem + offset; 583 info = get_msg_ptr(priv, response[MSG_ARG0], buf, &ret);
584 if (!info)
585 return ret;
543 586
544 mr4 = readl_relaxed(info + DRAM_INFO_MR4) & DRAM_INFO_MR4_MASK; 587 mr4 = readl_relaxed(info + DRAM_INFO_MR4) & DRAM_INFO_MR4_MASK;
545 588
@@ -561,7 +604,6 @@ static ssize_t store_refresh(struct device *dev, struct device_attribute *attr,
561 u32 response[MSG_FIELD_MAX]; 604 u32 response[MSG_FIELD_MAX];
562 struct private_data *priv; 605 struct private_data *priv;
563 void __iomem *info; 606 void __iomem *info;
564 unsigned int offset;
565 unsigned long val; 607 unsigned long val;
566 int ret; 608 int ret;
567 609
@@ -574,8 +616,10 @@ static ssize_t store_refresh(struct device *dev, struct device_attribute *attr,
574 if (ret) 616 if (ret)
575 return ret; 617 return ret;
576 618
577 offset = response[MSG_ARG0]; 619 info = get_msg_ptr(priv, response[MSG_ARG0], NULL, NULL);
578 info = priv->dmem + offset; 620 if (!info)
621 return -EIO;
622
579 writel_relaxed(val, info + DRAM_INFO_INTERVAL); 623 writel_relaxed(val, info + DRAM_INFO_INTERVAL);
580 624
581 return count; 625 return count;
@@ -587,23 +631,25 @@ static ssize_t show_vendor(struct device *dev, struct device_attribute *devattr,
587 u32 response[MSG_FIELD_MAX]; 631 u32 response[MSG_FIELD_MAX];
588 struct private_data *priv; 632 struct private_data *priv;
589 void __iomem *info; 633 void __iomem *info;
590 unsigned int offset; 634 ssize_t ret;
591 int ret;
592 635
593 ret = generic_show(DPFE_CMD_GET_VENDOR, response, dev, buf); 636 ret = generic_show(DPFE_CMD_GET_VENDOR, response, dev, buf);
594 if (ret) 637 if (ret)
595 return ret; 638 return ret;
596 639
597 offset = response[MSG_ARG0];
598 priv = dev_get_drvdata(dev); 640 priv = dev_get_drvdata(dev);
599 info = priv->dmem + offset; 641
642 info = get_msg_ptr(priv, response[MSG_ARG0], buf, &ret);
643 if (!info)
644 return ret;
600 645
601 return sprintf(buf, "%#x %#x %#x %#x %#x\n", 646 return sprintf(buf, "%#x %#x %#x %#x %#x\n",
602 readl_relaxed(info + DRAM_VENDOR_MR5) & DRAM_VENDOR_MASK, 647 readl_relaxed(info + DRAM_VENDOR_MR5) & DRAM_VENDOR_MASK,
603 readl_relaxed(info + DRAM_VENDOR_MR6) & DRAM_VENDOR_MASK, 648 readl_relaxed(info + DRAM_VENDOR_MR6) & DRAM_VENDOR_MASK,
604 readl_relaxed(info + DRAM_VENDOR_MR7) & DRAM_VENDOR_MASK, 649 readl_relaxed(info + DRAM_VENDOR_MR7) & DRAM_VENDOR_MASK,
605 readl_relaxed(info + DRAM_VENDOR_MR8) & DRAM_VENDOR_MASK, 650 readl_relaxed(info + DRAM_VENDOR_MR8) & DRAM_VENDOR_MASK,
606 readl_relaxed(info + DRAM_VENDOR_ERROR)); 651 readl_relaxed(info + DRAM_VENDOR_ERROR) &
652 DRAM_VENDOR_MASK);
607} 653}
608 654
609static int brcmstb_dpfe_resume(struct platform_device *pdev) 655static int brcmstb_dpfe_resume(struct platform_device *pdev)
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 8d12017b9893..4470630dd545 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -2687,6 +2687,8 @@ mptctl_hp_targetinfo(unsigned long arg)
2687 __FILE__, __LINE__, iocnum); 2687 __FILE__, __LINE__, iocnum);
2688 return -ENODEV; 2688 return -ENODEV;
2689 } 2689 }
2690 if (karg.hdr.id >= MPT_MAX_FC_DEVICES)
2691 return -EINVAL;
2690 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", 2692 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n",
2691 ioc->name)); 2693 ioc->name));
2692 2694
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 3e5eabdae8d9..772d02922529 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -548,12 +548,6 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
548 goto out; 548 goto out;
549 } 549 }
550 550
551 if (bus->dev_state == MEI_DEV_POWER_DOWN) {
552 dev_dbg(bus->dev, "Device is powering down, don't bother with disconnection\n");
553 err = 0;
554 goto out;
555 }
556
557 err = mei_cl_disconnect(cl); 551 err = mei_cl_disconnect(cl);
558 if (err < 0) 552 if (err < 0)
559 dev_err(bus->dev, "Could not disconnect from the ME client\n"); 553 dev_err(bus->dev, "Could not disconnect from the ME client\n");
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index be64969d986a..7e60c1817c31 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -945,6 +945,12 @@ int mei_cl_disconnect(struct mei_cl *cl)
945 return 0; 945 return 0;
946 } 946 }
947 947
948 if (dev->dev_state == MEI_DEV_POWER_DOWN) {
949 cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n");
950 mei_cl_set_disconnected(cl);
951 return 0;
952 }
953
948 rets = pm_runtime_get(dev->dev); 954 rets = pm_runtime_get(dev->dev);
949 if (rets < 0 && rets != -EINPROGRESS) { 955 if (rets < 0 && rets != -EINPROGRESS) {
950 pm_runtime_put_noidle(dev->dev); 956 pm_runtime_put_noidle(dev->dev);
diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
index 0ccccbaf530d..e4b10b2d1a08 100644
--- a/drivers/misc/mei/hw-me-regs.h
+++ b/drivers/misc/mei/hw-me-regs.h
@@ -132,6 +132,11 @@
132#define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */ 132#define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */
133#define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */ 133#define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */
134 134
135#define MEI_DEV_ID_CNP_LP 0x9DE0 /* Cannon Point LP */
136#define MEI_DEV_ID_CNP_LP_4 0x9DE4 /* Cannon Point LP 4 (iTouch) */
137#define MEI_DEV_ID_CNP_H 0xA360 /* Cannon Point H */
138#define MEI_DEV_ID_CNP_H_4 0xA364 /* Cannon Point H 4 (iTouch) */
139
135/* 140/*
136 * MEI HW Section 141 * MEI HW Section
137 */ 142 */
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 4a0ccda4d04b..ea4e152270a3 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -98,6 +98,11 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
98 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)}, 98 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)},
99 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)}, 99 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)},
100 100
101 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH8_CFG)},
102 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_4, MEI_ME_PCH8_CFG)},
103 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH8_CFG)},
104 {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)},
105
101 /* required last entry */ 106 /* required last entry */
102 {0, } 107 {0, }
103}; 108};
diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
index d9aa407db06a..337462e1569f 100644
--- a/drivers/misc/ocxl/file.c
+++ b/drivers/misc/ocxl/file.c
@@ -133,8 +133,10 @@ static long afu_ioctl(struct file *file, unsigned int cmd,
133 if (!rc) { 133 if (!rc) {
134 rc = copy_to_user((u64 __user *) args, &irq_offset, 134 rc = copy_to_user((u64 __user *) args, &irq_offset,
135 sizeof(irq_offset)); 135 sizeof(irq_offset));
136 if (rc) 136 if (rc) {
137 ocxl_afu_irq_free(ctx, irq_offset); 137 ocxl_afu_irq_free(ctx, irq_offset);
138 return -EFAULT;
139 }
138 } 140 }
139 break; 141 break;
140 142
@@ -277,7 +279,7 @@ static ssize_t afu_read(struct file *file, char __user *buf, size_t count,
277 struct ocxl_context *ctx = file->private_data; 279 struct ocxl_context *ctx = file->private_data;
278 struct ocxl_kernel_event_header header; 280 struct ocxl_kernel_event_header header;
279 ssize_t rc; 281 ssize_t rc;
280 size_t used = 0; 282 ssize_t used = 0;
281 DEFINE_WAIT(event_wait); 283 DEFINE_WAIT(event_wait);
282 284
283 memset(&header, 0, sizeof(header)); 285 memset(&header, 0, sizeof(header));
@@ -329,7 +331,7 @@ static ssize_t afu_read(struct file *file, char __user *buf, size_t count,
329 331
330 used += sizeof(header); 332 used += sizeof(header);
331 333
332 rc = (ssize_t) used; 334 rc = used;
333 return rc; 335 return rc;
334} 336}
335 337
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 908e4db03535..42d6aa89a48a 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -848,7 +848,6 @@ int mmc_interrupt_hpi(struct mmc_card *card)
848 return 1; 848 return 1;
849 } 849 }
850 850
851 mmc_claim_host(card->host);
852 err = mmc_send_status(card, &status); 851 err = mmc_send_status(card, &status);
853 if (err) { 852 if (err) {
854 pr_err("%s: Get card status fail\n", mmc_hostname(card->host)); 853 pr_err("%s: Get card status fail\n", mmc_hostname(card->host));
@@ -890,7 +889,6 @@ int mmc_interrupt_hpi(struct mmc_card *card)
890 } while (!err); 889 } while (!err);
891 890
892out: 891out:
893 mmc_release_host(card->host);
894 return err; 892 return err;
895} 893}
896 894
@@ -932,9 +930,7 @@ static int mmc_read_bkops_status(struct mmc_card *card)
932 int err; 930 int err;
933 u8 *ext_csd; 931 u8 *ext_csd;
934 932
935 mmc_claim_host(card->host);
936 err = mmc_get_ext_csd(card, &ext_csd); 933 err = mmc_get_ext_csd(card, &ext_csd);
937 mmc_release_host(card->host);
938 if (err) 934 if (err)
939 return err; 935 return err;
940 936
diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 229dc18f0581..768972af8b85 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -1265,7 +1265,8 @@ static int bcm2835_add_host(struct bcm2835_host *host)
1265 char pio_limit_string[20]; 1265 char pio_limit_string[20];
1266 int ret; 1266 int ret;
1267 1267
1268 mmc->f_max = host->max_clk; 1268 if (!mmc->f_max || mmc->f_max > host->max_clk)
1269 mmc->f_max = host->max_clk;
1269 mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; 1270 mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV;
1270 1271
1271 mmc->max_busy_timeout = ~0 / (mmc->f_max / 1000); 1272 mmc->max_busy_timeout = ~0 / (mmc->f_max / 1000);
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index 35026795be28..fa41d9422d57 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -487,6 +487,7 @@ static unsigned long exynos_dwmmc_caps[4] = {
487 487
488static const struct dw_mci_drv_data exynos_drv_data = { 488static const struct dw_mci_drv_data exynos_drv_data = {
489 .caps = exynos_dwmmc_caps, 489 .caps = exynos_dwmmc_caps,
490 .num_caps = ARRAY_SIZE(exynos_dwmmc_caps),
490 .init = dw_mci_exynos_priv_init, 491 .init = dw_mci_exynos_priv_init,
491 .set_ios = dw_mci_exynos_set_ios, 492 .set_ios = dw_mci_exynos_set_ios,
492 .parse_dt = dw_mci_exynos_parse_dt, 493 .parse_dt = dw_mci_exynos_parse_dt,
diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index 73fd75c3c824..89cdb3d533bb 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -135,6 +135,9 @@ static int dw_mci_hi6220_parse_dt(struct dw_mci *host)
135 if (priv->ctrl_id < 0) 135 if (priv->ctrl_id < 0)
136 priv->ctrl_id = 0; 136 priv->ctrl_id = 0;
137 137
138 if (priv->ctrl_id >= TIMING_MODE)
139 return -EINVAL;
140
138 host->priv = priv; 141 host->priv = priv;
139 return 0; 142 return 0;
140} 143}
@@ -207,6 +210,7 @@ static int dw_mci_hi6220_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
207 210
208static const struct dw_mci_drv_data hi6220_data = { 211static const struct dw_mci_drv_data hi6220_data = {
209 .caps = dw_mci_hi6220_caps, 212 .caps = dw_mci_hi6220_caps,
213 .num_caps = ARRAY_SIZE(dw_mci_hi6220_caps),
210 .switch_voltage = dw_mci_hi6220_switch_voltage, 214 .switch_voltage = dw_mci_hi6220_switch_voltage,
211 .set_ios = dw_mci_hi6220_set_ios, 215 .set_ios = dw_mci_hi6220_set_ios,
212 .parse_dt = dw_mci_hi6220_parse_dt, 216 .parse_dt = dw_mci_hi6220_parse_dt,
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index a3f1c2b30145..339295212935 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -319,6 +319,7 @@ static const struct dw_mci_drv_data rk2928_drv_data = {
319 319
320static const struct dw_mci_drv_data rk3288_drv_data = { 320static const struct dw_mci_drv_data rk3288_drv_data = {
321 .caps = dw_mci_rk3288_dwmmc_caps, 321 .caps = dw_mci_rk3288_dwmmc_caps,
322 .num_caps = ARRAY_SIZE(dw_mci_rk3288_dwmmc_caps),
322 .set_ios = dw_mci_rk3288_set_ios, 323 .set_ios = dw_mci_rk3288_set_ios,
323 .execute_tuning = dw_mci_rk3288_execute_tuning, 324 .execute_tuning = dw_mci_rk3288_execute_tuning,
324 .parse_dt = dw_mci_rk3288_parse_dt, 325 .parse_dt = dw_mci_rk3288_parse_dt,
diff --git a/drivers/mmc/host/dw_mmc-zx.c b/drivers/mmc/host/dw_mmc-zx.c
index d38e94ae2b85..c06b5393312f 100644
--- a/drivers/mmc/host/dw_mmc-zx.c
+++ b/drivers/mmc/host/dw_mmc-zx.c
@@ -195,6 +195,7 @@ static unsigned long zx_dwmmc_caps[3] = {
195 195
196static const struct dw_mci_drv_data zx_drv_data = { 196static const struct dw_mci_drv_data zx_drv_data = {
197 .caps = zx_dwmmc_caps, 197 .caps = zx_dwmmc_caps,
198 .num_caps = ARRAY_SIZE(zx_dwmmc_caps),
198 .execute_tuning = dw_mci_zx_execute_tuning, 199 .execute_tuning = dw_mci_zx_execute_tuning,
199 .prepare_hs400_tuning = dw_mci_zx_prepare_hs400_tuning, 200 .prepare_hs400_tuning = dw_mci_zx_prepare_hs400_tuning,
200 .parse_dt = dw_mci_zx_parse_dt, 201 .parse_dt = dw_mci_zx_parse_dt,
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 0aa39975f33b..d9b4acefed31 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -165,6 +165,8 @@ static int dw_mci_regs_show(struct seq_file *s, void *v)
165{ 165{
166 struct dw_mci *host = s->private; 166 struct dw_mci *host = s->private;
167 167
168 pm_runtime_get_sync(host->dev);
169
168 seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS)); 170 seq_printf(s, "STATUS:\t0x%08x\n", mci_readl(host, STATUS));
169 seq_printf(s, "RINTSTS:\t0x%08x\n", mci_readl(host, RINTSTS)); 171 seq_printf(s, "RINTSTS:\t0x%08x\n", mci_readl(host, RINTSTS));
170 seq_printf(s, "CMD:\t0x%08x\n", mci_readl(host, CMD)); 172 seq_printf(s, "CMD:\t0x%08x\n", mci_readl(host, CMD));
@@ -172,6 +174,8 @@ static int dw_mci_regs_show(struct seq_file *s, void *v)
172 seq_printf(s, "INTMASK:\t0x%08x\n", mci_readl(host, INTMASK)); 174 seq_printf(s, "INTMASK:\t0x%08x\n", mci_readl(host, INTMASK));
173 seq_printf(s, "CLKENA:\t0x%08x\n", mci_readl(host, CLKENA)); 175 seq_printf(s, "CLKENA:\t0x%08x\n", mci_readl(host, CLKENA));
174 176
177 pm_runtime_put_autosuspend(host->dev);
178
175 return 0; 179 return 0;
176} 180}
177 181
@@ -2778,12 +2782,57 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
2778 return IRQ_HANDLED; 2782 return IRQ_HANDLED;
2779} 2783}
2780 2784
2785static int dw_mci_init_slot_caps(struct dw_mci_slot *slot)
2786{
2787 struct dw_mci *host = slot->host;
2788 const struct dw_mci_drv_data *drv_data = host->drv_data;
2789 struct mmc_host *mmc = slot->mmc;
2790 int ctrl_id;
2791
2792 if (host->pdata->caps)
2793 mmc->caps = host->pdata->caps;
2794
2795 /*
2796 * Support MMC_CAP_ERASE by default.
2797 * It needs to use trim/discard/erase commands.
2798 */
2799 mmc->caps |= MMC_CAP_ERASE;
2800
2801 if (host->pdata->pm_caps)
2802 mmc->pm_caps = host->pdata->pm_caps;
2803
2804 if (host->dev->of_node) {
2805 ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
2806 if (ctrl_id < 0)
2807 ctrl_id = 0;
2808 } else {
2809 ctrl_id = to_platform_device(host->dev)->id;
2810 }
2811
2812 if (drv_data && drv_data->caps) {
2813 if (ctrl_id >= drv_data->num_caps) {
2814 dev_err(host->dev, "invalid controller id %d\n",
2815 ctrl_id);
2816 return -EINVAL;
2817 }
2818 mmc->caps |= drv_data->caps[ctrl_id];
2819 }
2820
2821 if (host->pdata->caps2)
2822 mmc->caps2 = host->pdata->caps2;
2823
2824 /* Process SDIO IRQs through the sdio_irq_work. */
2825 if (mmc->caps & MMC_CAP_SDIO_IRQ)
2826 mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
2827
2828 return 0;
2829}
2830
2781static int dw_mci_init_slot(struct dw_mci *host) 2831static int dw_mci_init_slot(struct dw_mci *host)
2782{ 2832{
2783 struct mmc_host *mmc; 2833 struct mmc_host *mmc;
2784 struct dw_mci_slot *slot; 2834 struct dw_mci_slot *slot;
2785 const struct dw_mci_drv_data *drv_data = host->drv_data; 2835 int ret;
2786 int ctrl_id, ret;
2787 u32 freq[2]; 2836 u32 freq[2];
2788 2837
2789 mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); 2838 mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev);
@@ -2817,38 +2866,13 @@ static int dw_mci_init_slot(struct dw_mci *host)
2817 if (!mmc->ocr_avail) 2866 if (!mmc->ocr_avail)
2818 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; 2867 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
2819 2868
2820 if (host->pdata->caps)
2821 mmc->caps = host->pdata->caps;
2822
2823 /*
2824 * Support MMC_CAP_ERASE by default.
2825 * It needs to use trim/discard/erase commands.
2826 */
2827 mmc->caps |= MMC_CAP_ERASE;
2828
2829 if (host->pdata->pm_caps)
2830 mmc->pm_caps = host->pdata->pm_caps;
2831
2832 if (host->dev->of_node) {
2833 ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
2834 if (ctrl_id < 0)
2835 ctrl_id = 0;
2836 } else {
2837 ctrl_id = to_platform_device(host->dev)->id;
2838 }
2839 if (drv_data && drv_data->caps)
2840 mmc->caps |= drv_data->caps[ctrl_id];
2841
2842 if (host->pdata->caps2)
2843 mmc->caps2 = host->pdata->caps2;
2844
2845 ret = mmc_of_parse(mmc); 2869 ret = mmc_of_parse(mmc);
2846 if (ret) 2870 if (ret)
2847 goto err_host_allocated; 2871 goto err_host_allocated;
2848 2872
2849 /* Process SDIO IRQs through the sdio_irq_work. */ 2873 ret = dw_mci_init_slot_caps(slot);
2850 if (mmc->caps & MMC_CAP_SDIO_IRQ) 2874 if (ret)
2851 mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; 2875 goto err_host_allocated;
2852 2876
2853 /* Useful defaults if platform data is unset. */ 2877 /* Useful defaults if platform data is unset. */
2854 if (host->use_dma == TRANS_MODE_IDMAC) { 2878 if (host->use_dma == TRANS_MODE_IDMAC) {
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index e3124f06a47e..1424bd490dd1 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -543,6 +543,7 @@ struct dw_mci_slot {
543/** 543/**
544 * dw_mci driver data - dw-mshc implementation specific driver data. 544 * dw_mci driver data - dw-mshc implementation specific driver data.
545 * @caps: mmc subsystem specified capabilities of the controller(s). 545 * @caps: mmc subsystem specified capabilities of the controller(s).
546 * @num_caps: number of capabilities specified by @caps.
546 * @init: early implementation specific initialization. 547 * @init: early implementation specific initialization.
547 * @set_ios: handle bus specific extensions. 548 * @set_ios: handle bus specific extensions.
548 * @parse_dt: parse implementation specific device tree properties. 549 * @parse_dt: parse implementation specific device tree properties.
@@ -554,6 +555,7 @@ struct dw_mci_slot {
554 */ 555 */
555struct dw_mci_drv_data { 556struct dw_mci_drv_data {
556 unsigned long *caps; 557 unsigned long *caps;
558 u32 num_caps;
557 int (*init)(struct dw_mci *host); 559 int (*init)(struct dw_mci *host);
558 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); 560 void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
559 int (*parse_dt)(struct dw_mci *host); 561 int (*parse_dt)(struct dw_mci *host);
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 22438ebfe4e6..4f972b879fe6 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -717,22 +717,6 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode,
717static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) 717static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
718{ 718{
719 struct meson_host *host = mmc_priv(mmc); 719 struct meson_host *host = mmc_priv(mmc);
720 int ret;
721
722 /*
723 * If this is the initial tuning, try to get a sane Rx starting
724 * phase before doing the actual tuning.
725 */
726 if (!mmc->doing_retune) {
727 ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
728
729 if (ret)
730 return ret;
731 }
732
733 ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->tx_clk);
734 if (ret)
735 return ret;
736 720
737 return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); 721 return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
738} 722}
@@ -763,9 +747,8 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
763 if (!IS_ERR(mmc->supply.vmmc)) 747 if (!IS_ERR(mmc->supply.vmmc))
764 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); 748 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
765 749
766 /* Reset phases */ 750 /* Reset rx phase */
767 clk_set_phase(host->rx_clk, 0); 751 clk_set_phase(host->rx_clk, 0);
768 clk_set_phase(host->tx_clk, 270);
769 752
770 break; 753 break;
771 754
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 6d1a983e6227..82c4f05f91d8 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -654,9 +654,36 @@ static void byt_read_dsm(struct sdhci_pci_slot *slot)
654 slot->chip->rpm_retune = intel_host->d3_retune; 654 slot->chip->rpm_retune = intel_host->d3_retune;
655} 655}
656 656
657static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) 657static int intel_execute_tuning(struct mmc_host *mmc, u32 opcode)
658{
659 int err = sdhci_execute_tuning(mmc, opcode);
660 struct sdhci_host *host = mmc_priv(mmc);
661
662 if (err)
663 return err;
664
665 /*
666 * Tuning can leave the IP in an active state (Buffer Read Enable bit
667 * set) which prevents the entry to low power states (i.e. S0i3). Data
668 * reset will clear it.
669 */
670 sdhci_reset(host, SDHCI_RESET_DATA);
671
672 return 0;
673}
674
675static void byt_probe_slot(struct sdhci_pci_slot *slot)
658{ 676{
677 struct mmc_host_ops *ops = &slot->host->mmc_host_ops;
678
659 byt_read_dsm(slot); 679 byt_read_dsm(slot);
680
681 ops->execute_tuning = intel_execute_tuning;
682}
683
684static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
685{
686 byt_probe_slot(slot);
660 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | 687 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
661 MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR | 688 MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR |
662 MMC_CAP_CMD_DURING_TFR | 689 MMC_CAP_CMD_DURING_TFR |
@@ -779,7 +806,7 @@ static int ni_byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
779{ 806{
780 int err; 807 int err;
781 808
782 byt_read_dsm(slot); 809 byt_probe_slot(slot);
783 810
784 err = ni_set_max_freq(slot); 811 err = ni_set_max_freq(slot);
785 if (err) 812 if (err)
@@ -792,7 +819,7 @@ static int ni_byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
792 819
793static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) 820static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
794{ 821{
795 byt_read_dsm(slot); 822 byt_probe_slot(slot);
796 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | 823 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE |
797 MMC_CAP_WAIT_WHILE_BUSY; 824 MMC_CAP_WAIT_WHILE_BUSY;
798 return 0; 825 return 0;
@@ -800,7 +827,7 @@ static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
800 827
801static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) 828static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
802{ 829{
803 byt_read_dsm(slot); 830 byt_probe_slot(slot);
804 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | 831 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY |
805 MMC_CAP_AGGRESSIVE_PM | MMC_CAP_CD_WAKE; 832 MMC_CAP_AGGRESSIVE_PM | MMC_CAP_CD_WAKE;
806 slot->cd_idx = 0; 833 slot->cd_idx = 0;
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index e6b8c59f2c0d..736ac887303c 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -328,7 +328,7 @@ config MTD_NAND_MARVELL
328 tristate "NAND controller support on Marvell boards" 328 tristate "NAND controller support on Marvell boards"
329 depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \ 329 depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \
330 COMPILE_TEST 330 COMPILE_TEST
331 depends on HAS_IOMEM 331 depends on HAS_IOMEM && HAS_DMA
332 help 332 help
333 This enables the NAND flash controller driver for Marvell boards, 333 This enables the NAND flash controller driver for Marvell boards,
334 including: 334 including:
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 80d31a58e558..f367144f3c6f 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -752,10 +752,8 @@ static int vf610_nfc_probe(struct platform_device *pdev)
752 if (mtd->oobsize > 64) 752 if (mtd->oobsize > 64)
753 mtd->oobsize = 64; 753 mtd->oobsize = 64;
754 754
755 /* 755 /* Use default large page ECC layout defined in NAND core */
756 * mtd->ecclayout is not specified here because we're using the 756 mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
757 * default large page ECC layout defined in NAND core.
758 */
759 if (chip->ecc.strength == 32) { 757 if (chip->ecc.strength == 32) {
760 nfc->ecc_mode = ECC_60_BYTE; 758 nfc->ecc_mode = ECC_60_BYTE;
761 chip->ecc.bytes = 60; 759 chip->ecc.bytes = 60;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
index 3e5833cf1fab..eb23f9ba1a9a 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
@@ -426,6 +426,8 @@ static int xgbe_pci_resume(struct pci_dev *pdev)
426 struct net_device *netdev = pdata->netdev; 426 struct net_device *netdev = pdata->netdev;
427 int ret = 0; 427 int ret = 0;
428 428
429 XP_IOWRITE(pdata, XP_INT_EN, 0x1fffff);
430
429 pdata->lpm_ctrl &= ~MDIO_CTRL1_LPOWER; 431 pdata->lpm_ctrl &= ~MDIO_CTRL1_LPOWER;
430 XMDIO_WRITE(pdata, MDIO_MMD_PCS, MDIO_CTRL1, pdata->lpm_ctrl); 432 XMDIO_WRITE(pdata, MDIO_MMD_PCS, MDIO_CTRL1, pdata->lpm_ctrl);
431 433
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index 22889fc158f2..87c4308b52a7 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -226,6 +226,10 @@ static int aq_pci_probe(struct pci_dev *pdev,
226 goto err_ioremap; 226 goto err_ioremap;
227 227
228 self->aq_hw = kzalloc(sizeof(*self->aq_hw), GFP_KERNEL); 228 self->aq_hw = kzalloc(sizeof(*self->aq_hw), GFP_KERNEL);
229 if (!self->aq_hw) {
230 err = -ENOMEM;
231 goto err_ioremap;
232 }
229 self->aq_hw->aq_nic_cfg = aq_nic_get_cfg(self); 233 self->aq_hw->aq_nic_cfg = aq_nic_get_cfg(self);
230 234
231 for (bar = 0; bar < 4; ++bar) { 235 for (bar = 0; bar < 4; ++bar) {
@@ -235,19 +239,19 @@ static int aq_pci_probe(struct pci_dev *pdev,
235 mmio_pa = pci_resource_start(pdev, bar); 239 mmio_pa = pci_resource_start(pdev, bar);
236 if (mmio_pa == 0U) { 240 if (mmio_pa == 0U) {
237 err = -EIO; 241 err = -EIO;
238 goto err_ioremap; 242 goto err_free_aq_hw;
239 } 243 }
240 244
241 reg_sz = pci_resource_len(pdev, bar); 245 reg_sz = pci_resource_len(pdev, bar);
242 if ((reg_sz <= 24 /*ATL_REGS_SIZE*/)) { 246 if ((reg_sz <= 24 /*ATL_REGS_SIZE*/)) {
243 err = -EIO; 247 err = -EIO;
244 goto err_ioremap; 248 goto err_free_aq_hw;
245 } 249 }
246 250
247 self->aq_hw->mmio = ioremap_nocache(mmio_pa, reg_sz); 251 self->aq_hw->mmio = ioremap_nocache(mmio_pa, reg_sz);
248 if (!self->aq_hw->mmio) { 252 if (!self->aq_hw->mmio) {
249 err = -EIO; 253 err = -EIO;
250 goto err_ioremap; 254 goto err_free_aq_hw;
251 } 255 }
252 break; 256 break;
253 } 257 }
@@ -255,7 +259,7 @@ static int aq_pci_probe(struct pci_dev *pdev,
255 259
256 if (bar == 4) { 260 if (bar == 4) {
257 err = -EIO; 261 err = -EIO;
258 goto err_ioremap; 262 goto err_free_aq_hw;
259 } 263 }
260 264
261 numvecs = min((u8)AQ_CFG_VECS_DEF, 265 numvecs = min((u8)AQ_CFG_VECS_DEF,
@@ -290,6 +294,8 @@ err_register:
290 aq_pci_free_irq_vectors(self); 294 aq_pci_free_irq_vectors(self);
291err_hwinit: 295err_hwinit:
292 iounmap(self->aq_hw->mmio); 296 iounmap(self->aq_hw->mmio);
297err_free_aq_hw:
298 kfree(self->aq_hw);
293err_ioremap: 299err_ioremap:
294 free_netdev(ndev); 300 free_netdev(ndev);
295err_pci_func: 301err_pci_func:
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index a77ee2f8fb8d..c1841db1b500 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -820,7 +820,7 @@ static int tg3_ape_event_lock(struct tg3 *tp, u32 timeout_us)
820 820
821 tg3_ape_unlock(tp, TG3_APE_LOCK_MEM); 821 tg3_ape_unlock(tp, TG3_APE_LOCK_MEM);
822 822
823 udelay(10); 823 usleep_range(10, 20);
824 timeout_us -= (timeout_us > 10) ? 10 : timeout_us; 824 timeout_us -= (timeout_us > 10) ? 10 : timeout_us;
825 } 825 }
826 826
@@ -922,8 +922,8 @@ static int tg3_ape_send_event(struct tg3 *tp, u32 event)
922 if (!(apedata & APE_FW_STATUS_READY)) 922 if (!(apedata & APE_FW_STATUS_READY))
923 return -EAGAIN; 923 return -EAGAIN;
924 924
925 /* Wait for up to 1 millisecond for APE to service previous event. */ 925 /* Wait for up to 20 millisecond for APE to service previous event. */
926 err = tg3_ape_event_lock(tp, 1000); 926 err = tg3_ape_event_lock(tp, 20000);
927 if (err) 927 if (err)
928 return err; 928 return err;
929 929
@@ -946,6 +946,7 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
946 946
947 switch (kind) { 947 switch (kind) {
948 case RESET_KIND_INIT: 948 case RESET_KIND_INIT:
949 tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_COUNT, tp->ape_hb++);
949 tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 950 tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG,
950 APE_HOST_SEG_SIG_MAGIC); 951 APE_HOST_SEG_SIG_MAGIC);
951 tg3_ape_write32(tp, TG3_APE_HOST_SEG_LEN, 952 tg3_ape_write32(tp, TG3_APE_HOST_SEG_LEN,
@@ -962,13 +963,6 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
962 event = APE_EVENT_STATUS_STATE_START; 963 event = APE_EVENT_STATUS_STATE_START;
963 break; 964 break;
964 case RESET_KIND_SHUTDOWN: 965 case RESET_KIND_SHUTDOWN:
965 /* With the interface we are currently using,
966 * APE does not track driver state. Wiping
967 * out the HOST SEGMENT SIGNATURE forces
968 * the APE to assume OS absent status.
969 */
970 tg3_ape_write32(tp, TG3_APE_HOST_SEG_SIG, 0x0);
971
972 if (device_may_wakeup(&tp->pdev->dev) && 966 if (device_may_wakeup(&tp->pdev->dev) &&
973 tg3_flag(tp, WOL_ENABLE)) { 967 tg3_flag(tp, WOL_ENABLE)) {
974 tg3_ape_write32(tp, TG3_APE_HOST_WOL_SPEED, 968 tg3_ape_write32(tp, TG3_APE_HOST_WOL_SPEED,
@@ -990,6 +984,18 @@ static void tg3_ape_driver_state_change(struct tg3 *tp, int kind)
990 tg3_ape_send_event(tp, event); 984 tg3_ape_send_event(tp, event);
991} 985}
992 986
987static void tg3_send_ape_heartbeat(struct tg3 *tp,
988 unsigned long interval)
989{
990 /* Check if hb interval has exceeded */
991 if (!tg3_flag(tp, ENABLE_APE) ||
992 time_before(jiffies, tp->ape_hb_jiffies + interval))
993 return;
994
995 tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_COUNT, tp->ape_hb++);
996 tp->ape_hb_jiffies = jiffies;
997}
998
993static void tg3_disable_ints(struct tg3 *tp) 999static void tg3_disable_ints(struct tg3 *tp)
994{ 1000{
995 int i; 1001 int i;
@@ -7262,6 +7268,7 @@ static int tg3_poll_msix(struct napi_struct *napi, int budget)
7262 } 7268 }
7263 } 7269 }
7264 7270
7271 tg3_send_ape_heartbeat(tp, TG3_APE_HB_INTERVAL << 1);
7265 return work_done; 7272 return work_done;
7266 7273
7267tx_recovery: 7274tx_recovery:
@@ -7344,6 +7351,7 @@ static int tg3_poll(struct napi_struct *napi, int budget)
7344 } 7351 }
7345 } 7352 }
7346 7353
7354 tg3_send_ape_heartbeat(tp, TG3_APE_HB_INTERVAL << 1);
7347 return work_done; 7355 return work_done;
7348 7356
7349tx_recovery: 7357tx_recovery:
@@ -10732,7 +10740,7 @@ static int tg3_reset_hw(struct tg3 *tp, bool reset_phy)
10732 if (tg3_flag(tp, ENABLE_APE)) 10740 if (tg3_flag(tp, ENABLE_APE))
10733 /* Write our heartbeat update interval to APE. */ 10741 /* Write our heartbeat update interval to APE. */
10734 tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS, 10742 tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS,
10735 APE_HOST_HEARTBEAT_INT_DISABLE); 10743 APE_HOST_HEARTBEAT_INT_5SEC);
10736 10744
10737 tg3_write_sig_post_reset(tp, RESET_KIND_INIT); 10745 tg3_write_sig_post_reset(tp, RESET_KIND_INIT);
10738 10746
@@ -11077,6 +11085,9 @@ static void tg3_timer(struct timer_list *t)
11077 tp->asf_counter = tp->asf_multiplier; 11085 tp->asf_counter = tp->asf_multiplier;
11078 } 11086 }
11079 11087
11088 /* Update the APE heartbeat every 5 seconds.*/
11089 tg3_send_ape_heartbeat(tp, TG3_APE_HB_INTERVAL);
11090
11080 spin_unlock(&tp->lock); 11091 spin_unlock(&tp->lock);
11081 11092
11082restart_timer: 11093restart_timer:
@@ -16653,6 +16664,8 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
16653 pci_state_reg); 16664 pci_state_reg);
16654 16665
16655 tg3_ape_lock_init(tp); 16666 tg3_ape_lock_init(tp);
16667 tp->ape_hb_interval =
16668 msecs_to_jiffies(APE_HOST_HEARTBEAT_INT_5SEC);
16656 } 16669 }
16657 16670
16658 /* Set up tp->grc_local_ctrl before calling 16671 /* Set up tp->grc_local_ctrl before calling
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 47f51cc0566d..1d61aa3efda1 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2508,6 +2508,7 @@
2508#define TG3_APE_LOCK_PHY3 5 2508#define TG3_APE_LOCK_PHY3 5
2509#define TG3_APE_LOCK_GPIO 7 2509#define TG3_APE_LOCK_GPIO 7
2510 2510
2511#define TG3_APE_HB_INTERVAL (tp->ape_hb_interval)
2511#define TG3_EEPROM_SB_F1R2_MBA_OFF 0x10 2512#define TG3_EEPROM_SB_F1R2_MBA_OFF 0x10
2512 2513
2513 2514
@@ -3423,6 +3424,10 @@ struct tg3 {
3423 struct device *hwmon_dev; 3424 struct device *hwmon_dev;
3424 bool link_up; 3425 bool link_up;
3425 bool pcierr_recovery; 3426 bool pcierr_recovery;
3427
3428 u32 ape_hb;
3429 unsigned long ape_hb_interval;
3430 unsigned long ape_hb_jiffies;
3426}; 3431};
3427 3432
3428/* Accessor macros for chip and asic attributes 3433/* Accessor macros for chip and asic attributes
diff --git a/drivers/net/ethernet/cavium/common/cavium_ptp.c b/drivers/net/ethernet/cavium/common/cavium_ptp.c
index c87c9c684a33..d59497a7bdce 100644
--- a/drivers/net/ethernet/cavium/common/cavium_ptp.c
+++ b/drivers/net/ethernet/cavium/common/cavium_ptp.c
@@ -75,6 +75,8 @@ EXPORT_SYMBOL(cavium_ptp_get);
75 75
76void cavium_ptp_put(struct cavium_ptp *ptp) 76void cavium_ptp_put(struct cavium_ptp *ptp)
77{ 77{
78 if (!ptp)
79 return;
78 pci_dev_put(ptp->pdev); 80 pci_dev_put(ptp->pdev);
79} 81}
80EXPORT_SYMBOL(cavium_ptp_put); 82EXPORT_SYMBOL(cavium_ptp_put);
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index b68cde9f17d2..7d9c5ffbd041 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -67,11 +67,6 @@ module_param(cpi_alg, int, S_IRUGO);
67MODULE_PARM_DESC(cpi_alg, 67MODULE_PARM_DESC(cpi_alg,
68 "PFC algorithm (0=none, 1=VLAN, 2=VLAN16, 3=IP Diffserv)"); 68 "PFC algorithm (0=none, 1=VLAN, 2=VLAN16, 3=IP Diffserv)");
69 69
70struct nicvf_xdp_tx {
71 u64 dma_addr;
72 u8 qidx;
73};
74
75static inline u8 nicvf_netdev_qidx(struct nicvf *nic, u8 qidx) 70static inline u8 nicvf_netdev_qidx(struct nicvf *nic, u8 qidx)
76{ 71{
77 if (nic->sqs_mode) 72 if (nic->sqs_mode)
@@ -507,29 +502,14 @@ static int nicvf_init_resources(struct nicvf *nic)
507 return 0; 502 return 0;
508} 503}
509 504
510static void nicvf_unmap_page(struct nicvf *nic, struct page *page, u64 dma_addr)
511{
512 /* Check if it's a recycled page, if not unmap the DMA mapping.
513 * Recycled page holds an extra reference.
514 */
515 if (page_ref_count(page) == 1) {
516 dma_addr &= PAGE_MASK;
517 dma_unmap_page_attrs(&nic->pdev->dev, dma_addr,
518 RCV_FRAG_LEN + XDP_HEADROOM,
519 DMA_FROM_DEVICE,
520 DMA_ATTR_SKIP_CPU_SYNC);
521 }
522}
523
524static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog, 505static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
525 struct cqe_rx_t *cqe_rx, struct snd_queue *sq, 506 struct cqe_rx_t *cqe_rx, struct snd_queue *sq,
526 struct rcv_queue *rq, struct sk_buff **skb) 507 struct rcv_queue *rq, struct sk_buff **skb)
527{ 508{
528 struct xdp_buff xdp; 509 struct xdp_buff xdp;
529 struct page *page; 510 struct page *page;
530 struct nicvf_xdp_tx *xdp_tx = NULL;
531 u32 action; 511 u32 action;
532 u16 len, err, offset = 0; 512 u16 len, offset = 0;
533 u64 dma_addr, cpu_addr; 513 u64 dma_addr, cpu_addr;
534 void *orig_data; 514 void *orig_data;
535 515
@@ -543,7 +523,7 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
543 cpu_addr = (u64)phys_to_virt(cpu_addr); 523 cpu_addr = (u64)phys_to_virt(cpu_addr);
544 page = virt_to_page((void *)cpu_addr); 524 page = virt_to_page((void *)cpu_addr);
545 525
546 xdp.data_hard_start = page_address(page) + RCV_BUF_HEADROOM; 526 xdp.data_hard_start = page_address(page);
547 xdp.data = (void *)cpu_addr; 527 xdp.data = (void *)cpu_addr;
548 xdp_set_data_meta_invalid(&xdp); 528 xdp_set_data_meta_invalid(&xdp);
549 xdp.data_end = xdp.data + len; 529 xdp.data_end = xdp.data + len;
@@ -563,7 +543,18 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
563 543
564 switch (action) { 544 switch (action) {
565 case XDP_PASS: 545 case XDP_PASS:
566 nicvf_unmap_page(nic, page, dma_addr); 546 /* Check if it's a recycled page, if not
547 * unmap the DMA mapping.
548 *
549 * Recycled page holds an extra reference.
550 */
551 if (page_ref_count(page) == 1) {
552 dma_addr &= PAGE_MASK;
553 dma_unmap_page_attrs(&nic->pdev->dev, dma_addr,
554 RCV_FRAG_LEN + XDP_PACKET_HEADROOM,
555 DMA_FROM_DEVICE,
556 DMA_ATTR_SKIP_CPU_SYNC);
557 }
567 558
568 /* Build SKB and pass on packet to network stack */ 559 /* Build SKB and pass on packet to network stack */
569 *skb = build_skb(xdp.data, 560 *skb = build_skb(xdp.data,
@@ -576,20 +567,6 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
576 case XDP_TX: 567 case XDP_TX:
577 nicvf_xdp_sq_append_pkt(nic, sq, (u64)xdp.data, dma_addr, len); 568 nicvf_xdp_sq_append_pkt(nic, sq, (u64)xdp.data, dma_addr, len);
578 return true; 569 return true;
579 case XDP_REDIRECT:
580 /* Save DMA address for use while transmitting */
581 xdp_tx = (struct nicvf_xdp_tx *)page_address(page);
582 xdp_tx->dma_addr = dma_addr;
583 xdp_tx->qidx = nicvf_netdev_qidx(nic, cqe_rx->rq_idx);
584
585 err = xdp_do_redirect(nic->pnicvf->netdev, &xdp, prog);
586 if (!err)
587 return true;
588
589 /* Free the page on error */
590 nicvf_unmap_page(nic, page, dma_addr);
591 put_page(page);
592 break;
593 default: 570 default:
594 bpf_warn_invalid_xdp_action(action); 571 bpf_warn_invalid_xdp_action(action);
595 /* fall through */ 572 /* fall through */
@@ -597,7 +574,18 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
597 trace_xdp_exception(nic->netdev, prog, action); 574 trace_xdp_exception(nic->netdev, prog, action);
598 /* fall through */ 575 /* fall through */
599 case XDP_DROP: 576 case XDP_DROP:
600 nicvf_unmap_page(nic, page, dma_addr); 577 /* Check if it's a recycled page, if not
578 * unmap the DMA mapping.
579 *
580 * Recycled page holds an extra reference.
581 */
582 if (page_ref_count(page) == 1) {
583 dma_addr &= PAGE_MASK;
584 dma_unmap_page_attrs(&nic->pdev->dev, dma_addr,
585 RCV_FRAG_LEN + XDP_PACKET_HEADROOM,
586 DMA_FROM_DEVICE,
587 DMA_ATTR_SKIP_CPU_SYNC);
588 }
601 put_page(page); 589 put_page(page);
602 return true; 590 return true;
603 } 591 }
@@ -1864,50 +1852,6 @@ static int nicvf_xdp(struct net_device *netdev, struct netdev_bpf *xdp)
1864 } 1852 }
1865} 1853}
1866 1854
1867static int nicvf_xdp_xmit(struct net_device *netdev, struct xdp_buff *xdp)
1868{
1869 struct nicvf *nic = netdev_priv(netdev);
1870 struct nicvf *snic = nic;
1871 struct nicvf_xdp_tx *xdp_tx;
1872 struct snd_queue *sq;
1873 struct page *page;
1874 int err, qidx;
1875
1876 if (!netif_running(netdev) || !nic->xdp_prog)
1877 return -EINVAL;
1878
1879 page = virt_to_page(xdp->data);
1880 xdp_tx = (struct nicvf_xdp_tx *)page_address(page);
1881 qidx = xdp_tx->qidx;
1882
1883 if (xdp_tx->qidx >= nic->xdp_tx_queues)
1884 return -EINVAL;
1885
1886 /* Get secondary Qset's info */
1887 if (xdp_tx->qidx >= MAX_SND_QUEUES_PER_QS) {
1888 qidx = xdp_tx->qidx / MAX_SND_QUEUES_PER_QS;
1889 snic = (struct nicvf *)nic->snicvf[qidx - 1];
1890 if (!snic)
1891 return -EINVAL;
1892 qidx = xdp_tx->qidx % MAX_SND_QUEUES_PER_QS;
1893 }
1894
1895 sq = &snic->qs->sq[qidx];
1896 err = nicvf_xdp_sq_append_pkt(snic, sq, (u64)xdp->data,
1897 xdp_tx->dma_addr,
1898 xdp->data_end - xdp->data);
1899 if (err)
1900 return -ENOMEM;
1901
1902 nicvf_xdp_sq_doorbell(snic, sq, qidx);
1903 return 0;
1904}
1905
1906static void nicvf_xdp_flush(struct net_device *dev)
1907{
1908 return;
1909}
1910
1911static int nicvf_config_hwtstamp(struct net_device *netdev, struct ifreq *ifr) 1855static int nicvf_config_hwtstamp(struct net_device *netdev, struct ifreq *ifr)
1912{ 1856{
1913 struct hwtstamp_config config; 1857 struct hwtstamp_config config;
@@ -1986,8 +1930,6 @@ static const struct net_device_ops nicvf_netdev_ops = {
1986 .ndo_fix_features = nicvf_fix_features, 1930 .ndo_fix_features = nicvf_fix_features,
1987 .ndo_set_features = nicvf_set_features, 1931 .ndo_set_features = nicvf_set_features,
1988 .ndo_bpf = nicvf_xdp, 1932 .ndo_bpf = nicvf_xdp,
1989 .ndo_xdp_xmit = nicvf_xdp_xmit,
1990 .ndo_xdp_flush = nicvf_xdp_flush,
1991 .ndo_do_ioctl = nicvf_ioctl, 1933 .ndo_do_ioctl = nicvf_ioctl,
1992}; 1934};
1993 1935
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
index 3eae9ff9b53a..d42704d07484 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
@@ -204,7 +204,7 @@ static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, struct rbdr *rbdr,
204 204
205 /* Reserve space for header modifications by BPF program */ 205 /* Reserve space for header modifications by BPF program */
206 if (rbdr->is_xdp) 206 if (rbdr->is_xdp)
207 buf_len += XDP_HEADROOM; 207 buf_len += XDP_PACKET_HEADROOM;
208 208
209 /* Check if it's recycled */ 209 /* Check if it's recycled */
210 if (pgcache) 210 if (pgcache)
@@ -224,9 +224,8 @@ ret:
224 nic->rb_page = NULL; 224 nic->rb_page = NULL;
225 return -ENOMEM; 225 return -ENOMEM;
226 } 226 }
227
228 if (pgcache) 227 if (pgcache)
229 pgcache->dma_addr = *rbuf + XDP_HEADROOM; 228 pgcache->dma_addr = *rbuf + XDP_PACKET_HEADROOM;
230 nic->rb_page_offset += buf_len; 229 nic->rb_page_offset += buf_len;
231 } 230 }
232 231
@@ -1244,7 +1243,7 @@ int nicvf_xdp_sq_append_pkt(struct nicvf *nic, struct snd_queue *sq,
1244 int qentry; 1243 int qentry;
1245 1244
1246 if (subdesc_cnt > sq->xdp_free_cnt) 1245 if (subdesc_cnt > sq->xdp_free_cnt)
1247 return -1; 1246 return 0;
1248 1247
1249 qentry = nicvf_get_sq_desc(sq, subdesc_cnt); 1248 qentry = nicvf_get_sq_desc(sq, subdesc_cnt);
1250 1249
@@ -1255,7 +1254,7 @@ int nicvf_xdp_sq_append_pkt(struct nicvf *nic, struct snd_queue *sq,
1255 1254
1256 sq->xdp_desc_cnt += subdesc_cnt; 1255 sq->xdp_desc_cnt += subdesc_cnt;
1257 1256
1258 return 0; 1257 return 1;
1259} 1258}
1260 1259
1261/* Calculate no of SQ subdescriptors needed to transmit all 1260/* Calculate no of SQ subdescriptors needed to transmit all
@@ -1656,7 +1655,7 @@ static void nicvf_unmap_rcv_buffer(struct nicvf *nic, u64 dma_addr,
1656 if (page_ref_count(page) != 1) 1655 if (page_ref_count(page) != 1)
1657 return; 1656 return;
1658 1657
1659 len += XDP_HEADROOM; 1658 len += XDP_PACKET_HEADROOM;
1660 /* Receive buffers in XDP mode are mapped from page start */ 1659 /* Receive buffers in XDP mode are mapped from page start */
1661 dma_addr &= PAGE_MASK; 1660 dma_addr &= PAGE_MASK;
1662 } 1661 }
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
index ce1eed7a6d63..5e9a03cf1b4d 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
@@ -11,7 +11,6 @@
11 11
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <linux/iommu.h> 13#include <linux/iommu.h>
14#include <linux/bpf.h>
15#include <net/xdp.h> 14#include <net/xdp.h>
16#include "q_struct.h" 15#include "q_struct.h"
17 16
@@ -94,9 +93,6 @@
94#define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \ 93#define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \
95 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 94 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
96 95
97#define RCV_BUF_HEADROOM 128 /* To store dma address for XDP redirect */
98#define XDP_HEADROOM (XDP_PACKET_HEADROOM + RCV_BUF_HEADROOM)
99
100#define MAX_CQES_FOR_TX ((SND_QUEUE_LEN / MIN_SQ_DESC_PER_PKT_XMIT) * \ 96#define MAX_CQES_FOR_TX ((SND_QUEUE_LEN / MIN_SQ_DESC_PER_PKT_XMIT) * \
101 MAX_CQE_PER_PKT_XMIT) 97 MAX_CQE_PER_PKT_XMIT)
102 98
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index 557fd8bfd54e..00a1d2d13169 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -472,7 +472,7 @@ int cudbg_collect_cim_la(struct cudbg_init *pdbg_init,
472 472
473 if (is_t6(padap->params.chip)) { 473 if (is_t6(padap->params.chip)) {
474 size = padap->params.cim_la_size / 10 + 1; 474 size = padap->params.cim_la_size / 10 + 1;
475 size *= 11 * sizeof(u32); 475 size *= 10 * sizeof(u32);
476 } else { 476 } else {
477 size = padap->params.cim_la_size / 8; 477 size = padap->params.cim_la_size / 8;
478 size *= 8 * sizeof(u32); 478 size *= 8 * sizeof(u32);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
index 30485f9a598f..143686c60234 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
@@ -102,7 +102,7 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity)
102 case CUDBG_CIM_LA: 102 case CUDBG_CIM_LA:
103 if (is_t6(adap->params.chip)) { 103 if (is_t6(adap->params.chip)) {
104 len = adap->params.cim_la_size / 10 + 1; 104 len = adap->params.cim_la_size / 10 + 1;
105 len *= 11 * sizeof(u32); 105 len *= 10 * sizeof(u32);
106 } else { 106 } else {
107 len = adap->params.cim_la_size / 8; 107 len = adap->params.cim_la_size / 8;
108 len *= 8 * sizeof(u32); 108 len *= 8 * sizeof(u32);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 56bc626ef006..7b452e85de2a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -4982,9 +4982,10 @@ static int cxgb4_iov_configure(struct pci_dev *pdev, int num_vfs)
4982 4982
4983 pcie_fw = readl(adap->regs + PCIE_FW_A); 4983 pcie_fw = readl(adap->regs + PCIE_FW_A);
4984 /* Check if cxgb4 is the MASTER and fw is initialized */ 4984 /* Check if cxgb4 is the MASTER and fw is initialized */
4985 if (!(pcie_fw & PCIE_FW_INIT_F) || 4985 if (num_vfs &&
4986 (!(pcie_fw & PCIE_FW_INIT_F) ||
4986 !(pcie_fw & PCIE_FW_MASTER_VLD_F) || 4987 !(pcie_fw & PCIE_FW_MASTER_VLD_F) ||
4987 PCIE_FW_MASTER_G(pcie_fw) != CXGB4_UNIFIED_PF) { 4988 PCIE_FW_MASTER_G(pcie_fw) != CXGB4_UNIFIED_PF)) {
4988 dev_warn(&pdev->dev, 4989 dev_warn(&pdev->dev,
4989 "cxgb4 driver needs to be MASTER to support SRIOV\n"); 4990 "cxgb4 driver needs to be MASTER to support SRIOV\n");
4990 return -EOPNOTSUPP; 4991 return -EOPNOTSUPP;
@@ -5599,24 +5600,24 @@ static void remove_one(struct pci_dev *pdev)
5599#if IS_ENABLED(CONFIG_IPV6) 5600#if IS_ENABLED(CONFIG_IPV6)
5600 t4_cleanup_clip_tbl(adapter); 5601 t4_cleanup_clip_tbl(adapter);
5601#endif 5602#endif
5602 iounmap(adapter->regs);
5603 if (!is_t4(adapter->params.chip)) 5603 if (!is_t4(adapter->params.chip))
5604 iounmap(adapter->bar2); 5604 iounmap(adapter->bar2);
5605 pci_disable_pcie_error_reporting(pdev);
5606 if ((adapter->flags & DEV_ENABLED)) {
5607 pci_disable_device(pdev);
5608 adapter->flags &= ~DEV_ENABLED;
5609 }
5610 pci_release_regions(pdev);
5611 kfree(adapter->mbox_log);
5612 synchronize_rcu();
5613 kfree(adapter);
5614 } 5605 }
5615#ifdef CONFIG_PCI_IOV 5606#ifdef CONFIG_PCI_IOV
5616 else { 5607 else {
5617 cxgb4_iov_configure(adapter->pdev, 0); 5608 cxgb4_iov_configure(adapter->pdev, 0);
5618 } 5609 }
5619#endif 5610#endif
5611 iounmap(adapter->regs);
5612 pci_disable_pcie_error_reporting(pdev);
5613 if ((adapter->flags & DEV_ENABLED)) {
5614 pci_disable_device(pdev);
5615 adapter->flags &= ~DEV_ENABLED;
5616 }
5617 pci_release_regions(pdev);
5618 kfree(adapter->mbox_log);
5619 synchronize_rcu();
5620 kfree(adapter);
5620} 5621}
5621 5622
5622/* "Shutdown" quiesces the device, stopping Ingress Packet and Interrupt 5623/* "Shutdown" quiesces the device, stopping Ingress Packet and Interrupt
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 047609ef0515..920bccd6bc40 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -2637,7 +2637,6 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)
2637} 2637}
2638 2638
2639#define EEPROM_STAT_ADDR 0x7bfc 2639#define EEPROM_STAT_ADDR 0x7bfc
2640#define VPD_SIZE 0x800
2641#define VPD_BASE 0x400 2640#define VPD_BASE 0x400
2642#define VPD_BASE_OLD 0 2641#define VPD_BASE_OLD 0
2643#define VPD_LEN 1024 2642#define VPD_LEN 1024
@@ -2704,15 +2703,6 @@ int t4_get_raw_vpd_params(struct adapter *adapter, struct vpd_params *p)
2704 if (!vpd) 2703 if (!vpd)
2705 return -ENOMEM; 2704 return -ENOMEM;
2706 2705
2707 /* We have two VPD data structures stored in the adapter VPD area.
2708 * By default, Linux calculates the size of the VPD area by traversing
2709 * the first VPD area at offset 0x0, so we need to tell the OS what
2710 * our real VPD size is.
2711 */
2712 ret = pci_set_vpd_size(adapter->pdev, VPD_SIZE);
2713 if (ret < 0)
2714 goto out;
2715
2716 /* Card information normally starts at VPD_BASE but early cards had 2706 /* Card information normally starts at VPD_BASE but early cards had
2717 * it at 0. 2707 * it at 0.
2718 */ 2708 */
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 3bdeb295514b..f5c87bd35fa1 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2934,29 +2934,17 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus,
2934{ 2934{
2935 int size = lstatus & BD_LENGTH_MASK; 2935 int size = lstatus & BD_LENGTH_MASK;
2936 struct page *page = rxb->page; 2936 struct page *page = rxb->page;
2937 bool last = !!(lstatus & BD_LFLAG(RXBD_LAST));
2938
2939 /* Remove the FCS from the packet length */
2940 if (last)
2941 size -= ETH_FCS_LEN;
2942 2937
2943 if (likely(first)) { 2938 if (likely(first)) {
2944 skb_put(skb, size); 2939 skb_put(skb, size);
2945 } else { 2940 } else {
2946 /* the last fragments' length contains the full frame length */ 2941 /* the last fragments' length contains the full frame length */
2947 if (last) 2942 if (lstatus & BD_LFLAG(RXBD_LAST))
2948 size -= skb->len; 2943 size -= skb->len;
2949 2944
2950 /* Add the last fragment if it contains something other than 2945 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2951 * the FCS, otherwise drop it and trim off any part of the FCS 2946 rxb->page_offset + RXBUF_ALIGNMENT,
2952 * that was already received. 2947 size, GFAR_RXB_TRUESIZE);
2953 */
2954 if (size > 0)
2955 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
2956 rxb->page_offset + RXBUF_ALIGNMENT,
2957 size, GFAR_RXB_TRUESIZE);
2958 else if (size < 0)
2959 pskb_trim(skb, skb->len + size);
2960 } 2948 }
2961 2949
2962 /* try reuse page */ 2950 /* try reuse page */
@@ -3069,6 +3057,9 @@ static void gfar_process_frame(struct net_device *ndev, struct sk_buff *skb)
3069 if (priv->padding) 3057 if (priv->padding)
3070 skb_pull(skb, priv->padding); 3058 skb_pull(skb, priv->padding);
3071 3059
3060 /* Trim off the FCS */
3061 pskb_trim(skb, skb->len - ETH_FCS_LEN);
3062
3072 if (ndev->features & NETIF_F_RXCSUM) 3063 if (ndev->features & NETIF_F_RXCSUM)
3073 gfar_rx_checksum(skb, fcb); 3064 gfar_rx_checksum(skb, fcb);
3074 3065
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 27447260215d..1b3cc8bb0705 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -791,6 +791,18 @@ static int ibmvnic_login(struct net_device *netdev)
791 return 0; 791 return 0;
792} 792}
793 793
794static void release_login_buffer(struct ibmvnic_adapter *adapter)
795{
796 kfree(adapter->login_buf);
797 adapter->login_buf = NULL;
798}
799
800static void release_login_rsp_buffer(struct ibmvnic_adapter *adapter)
801{
802 kfree(adapter->login_rsp_buf);
803 adapter->login_rsp_buf = NULL;
804}
805
794static void release_resources(struct ibmvnic_adapter *adapter) 806static void release_resources(struct ibmvnic_adapter *adapter)
795{ 807{
796 int i; 808 int i;
@@ -813,6 +825,10 @@ static void release_resources(struct ibmvnic_adapter *adapter)
813 } 825 }
814 } 826 }
815 } 827 }
828 kfree(adapter->napi);
829 adapter->napi = NULL;
830
831 release_login_rsp_buffer(adapter);
816} 832}
817 833
818static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state) 834static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state)
@@ -1057,6 +1073,35 @@ static int ibmvnic_open(struct net_device *netdev)
1057 return rc; 1073 return rc;
1058} 1074}
1059 1075
1076static void clean_rx_pools(struct ibmvnic_adapter *adapter)
1077{
1078 struct ibmvnic_rx_pool *rx_pool;
1079 u64 rx_entries;
1080 int rx_scrqs;
1081 int i, j;
1082
1083 if (!adapter->rx_pool)
1084 return;
1085
1086 rx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs);
1087 rx_entries = adapter->req_rx_add_entries_per_subcrq;
1088
1089 /* Free any remaining skbs in the rx buffer pools */
1090 for (i = 0; i < rx_scrqs; i++) {
1091 rx_pool = &adapter->rx_pool[i];
1092 if (!rx_pool)
1093 continue;
1094
1095 netdev_dbg(adapter->netdev, "Cleaning rx_pool[%d]\n", i);
1096 for (j = 0; j < rx_entries; j++) {
1097 if (rx_pool->rx_buff[j].skb) {
1098 dev_kfree_skb_any(rx_pool->rx_buff[j].skb);
1099 rx_pool->rx_buff[j].skb = NULL;
1100 }
1101 }
1102 }
1103}
1104
1060static void clean_tx_pools(struct ibmvnic_adapter *adapter) 1105static void clean_tx_pools(struct ibmvnic_adapter *adapter)
1061{ 1106{
1062 struct ibmvnic_tx_pool *tx_pool; 1107 struct ibmvnic_tx_pool *tx_pool;
@@ -1134,7 +1179,7 @@ static int __ibmvnic_close(struct net_device *netdev)
1134 } 1179 }
1135 } 1180 }
1136 } 1181 }
1137 1182 clean_rx_pools(adapter);
1138 clean_tx_pools(adapter); 1183 clean_tx_pools(adapter);
1139 adapter->state = VNIC_CLOSED; 1184 adapter->state = VNIC_CLOSED;
1140 return rc; 1185 return rc;
@@ -1670,8 +1715,6 @@ static int do_reset(struct ibmvnic_adapter *adapter,
1670 return 0; 1715 return 0;
1671 } 1716 }
1672 1717
1673 netif_carrier_on(netdev);
1674
1675 /* kick napi */ 1718 /* kick napi */
1676 for (i = 0; i < adapter->req_rx_queues; i++) 1719 for (i = 0; i < adapter->req_rx_queues; i++)
1677 napi_schedule(&adapter->napi[i]); 1720 napi_schedule(&adapter->napi[i]);
@@ -1679,6 +1722,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
1679 if (adapter->reset_reason != VNIC_RESET_FAILOVER) 1722 if (adapter->reset_reason != VNIC_RESET_FAILOVER)
1680 netdev_notify_peers(netdev); 1723 netdev_notify_peers(netdev);
1681 1724
1725 netif_carrier_on(netdev);
1726
1682 return 0; 1727 return 0;
1683} 1728}
1684 1729
@@ -1853,6 +1898,12 @@ restart_poll:
1853 be16_to_cpu(next->rx_comp.rc)); 1898 be16_to_cpu(next->rx_comp.rc));
1854 /* free the entry */ 1899 /* free the entry */
1855 next->rx_comp.first = 0; 1900 next->rx_comp.first = 0;
1901 dev_kfree_skb_any(rx_buff->skb);
1902 remove_buff_from_pool(adapter, rx_buff);
1903 continue;
1904 } else if (!rx_buff->skb) {
1905 /* free the entry */
1906 next->rx_comp.first = 0;
1856 remove_buff_from_pool(adapter, rx_buff); 1907 remove_buff_from_pool(adapter, rx_buff);
1857 continue; 1908 continue;
1858 } 1909 }
@@ -3013,6 +3064,7 @@ static void send_login(struct ibmvnic_adapter *adapter)
3013 struct vnic_login_client_data *vlcd; 3064 struct vnic_login_client_data *vlcd;
3014 int i; 3065 int i;
3015 3066
3067 release_login_rsp_buffer(adapter);
3016 client_data_len = vnic_client_data_len(adapter); 3068 client_data_len = vnic_client_data_len(adapter);
3017 3069
3018 buffer_size = 3070 buffer_size =
@@ -3738,6 +3790,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
3738 ibmvnic_remove(adapter->vdev); 3790 ibmvnic_remove(adapter->vdev);
3739 return -EIO; 3791 return -EIO;
3740 } 3792 }
3793 release_login_buffer(adapter);
3741 complete(&adapter->init_done); 3794 complete(&adapter->init_done);
3742 3795
3743 return 0; 3796 return 0;
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index a1d7b88cf083..5a1668cdb461 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -7137,6 +7137,7 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
7137 int id = port->id; 7137 int id = port->id;
7138 bool allmulti = dev->flags & IFF_ALLMULTI; 7138 bool allmulti = dev->flags & IFF_ALLMULTI;
7139 7139
7140retry:
7140 mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC); 7141 mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC);
7141 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti); 7142 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti);
7142 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti); 7143 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti);
@@ -7144,9 +7145,13 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
7144 /* Remove all port->id's mcast enries */ 7145 /* Remove all port->id's mcast enries */
7145 mvpp2_prs_mcast_del_all(priv, id); 7146 mvpp2_prs_mcast_del_all(priv, id);
7146 7147
7147 if (allmulti && !netdev_mc_empty(dev)) { 7148 if (!allmulti) {
7148 netdev_for_each_mc_addr(ha, dev) 7149 netdev_for_each_mc_addr(ha, dev) {
7149 mvpp2_prs_mac_da_accept(priv, id, ha->addr, true); 7150 if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) {
7151 allmulti = true;
7152 goto retry;
7153 }
7154 }
7150 } 7155 }
7151} 7156}
7152 7157
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
index 0be4575b58a2..fd509160c8f6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
@@ -96,10 +96,10 @@ static void print_lyr_2_4_hdrs(struct trace_seq *p,
96 "%pI4"); 96 "%pI4");
97 } else if (ethertype.v == ETH_P_IPV6) { 97 } else if (ethertype.v == ETH_P_IPV6) {
98 static const struct in6_addr full_ones = { 98 static const struct in6_addr full_ones = {
99 .in6_u.u6_addr32 = {htonl(0xffffffff), 99 .in6_u.u6_addr32 = {__constant_htonl(0xffffffff),
100 htonl(0xffffffff), 100 __constant_htonl(0xffffffff),
101 htonl(0xffffffff), 101 __constant_htonl(0xffffffff),
102 htonl(0xffffffff)}, 102 __constant_htonl(0xffffffff)},
103 }; 103 };
104 DECLARE_MASK_VAL(struct in6_addr, src_ipv6); 104 DECLARE_MASK_VAL(struct in6_addr, src_ipv6);
105 DECLARE_MASK_VAL(struct in6_addr, dst_ipv6); 105 DECLARE_MASK_VAL(struct in6_addr, dst_ipv6);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 47bab842c5ee..da94c8cba5ee 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1768,13 +1768,16 @@ static void mlx5e_build_rq_param(struct mlx5e_priv *priv,
1768 param->wq.linear = 1; 1768 param->wq.linear = 1;
1769} 1769}
1770 1770
1771static void mlx5e_build_drop_rq_param(struct mlx5e_rq_param *param) 1771static void mlx5e_build_drop_rq_param(struct mlx5_core_dev *mdev,
1772 struct mlx5e_rq_param *param)
1772{ 1773{
1773 void *rqc = param->rqc; 1774 void *rqc = param->rqc;
1774 void *wq = MLX5_ADDR_OF(rqc, rqc, wq); 1775 void *wq = MLX5_ADDR_OF(rqc, rqc, wq);
1775 1776
1776 MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_LINKED_LIST); 1777 MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_LINKED_LIST);
1777 MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe))); 1778 MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe)));
1779
1780 param->wq.buf_numa_node = dev_to_node(&mdev->pdev->dev);
1778} 1781}
1779 1782
1780static void mlx5e_build_sq_param_common(struct mlx5e_priv *priv, 1783static void mlx5e_build_sq_param_common(struct mlx5e_priv *priv,
@@ -2634,6 +2637,9 @@ static int mlx5e_alloc_drop_cq(struct mlx5_core_dev *mdev,
2634 struct mlx5e_cq *cq, 2637 struct mlx5e_cq *cq,
2635 struct mlx5e_cq_param *param) 2638 struct mlx5e_cq_param *param)
2636{ 2639{
2640 param->wq.buf_numa_node = dev_to_node(&mdev->pdev->dev);
2641 param->wq.db_numa_node = dev_to_node(&mdev->pdev->dev);
2642
2637 return mlx5e_alloc_cq_common(mdev, param, cq); 2643 return mlx5e_alloc_cq_common(mdev, param, cq);
2638} 2644}
2639 2645
@@ -2645,7 +2651,7 @@ static int mlx5e_open_drop_rq(struct mlx5_core_dev *mdev,
2645 struct mlx5e_cq *cq = &drop_rq->cq; 2651 struct mlx5e_cq *cq = &drop_rq->cq;
2646 int err; 2652 int err;
2647 2653
2648 mlx5e_build_drop_rq_param(&rq_param); 2654 mlx5e_build_drop_rq_param(mdev, &rq_param);
2649 2655
2650 err = mlx5e_alloc_drop_cq(mdev, cq, &cq_param); 2656 err = mlx5e_alloc_drop_cq(mdev, cq, &cq_param);
2651 if (err) 2657 if (err)
@@ -2994,8 +3000,8 @@ static int mlx5e_setup_tc_block(struct net_device *dev,
2994} 3000}
2995#endif 3001#endif
2996 3002
2997int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type, 3003static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
2998 void *type_data) 3004 void *type_data)
2999{ 3005{
3000 switch (type) { 3006 switch (type) {
3001#ifdef CONFIG_MLX5_ESWITCH 3007#ifdef CONFIG_MLX5_ESWITCH
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 0d4bb0688faa..e5c3ab46a24a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -36,6 +36,7 @@
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/bpf_trace.h> 37#include <linux/bpf_trace.h>
38#include <net/busy_poll.h> 38#include <net/busy_poll.h>
39#include <net/ip6_checksum.h>
39#include "en.h" 40#include "en.h"
40#include "en_tc.h" 41#include "en_tc.h"
41#include "eswitch.h" 42#include "eswitch.h"
@@ -546,20 +547,33 @@ bool mlx5e_post_rx_mpwqes(struct mlx5e_rq *rq)
546 return true; 547 return true;
547} 548}
548 549
550static void mlx5e_lro_update_tcp_hdr(struct mlx5_cqe64 *cqe, struct tcphdr *tcp)
551{
552 u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe);
553 u8 tcp_ack = (l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA) ||
554 (l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA);
555
556 tcp->check = 0;
557 tcp->psh = get_cqe_lro_tcppsh(cqe);
558
559 if (tcp_ack) {
560 tcp->ack = 1;
561 tcp->ack_seq = cqe->lro_ack_seq_num;
562 tcp->window = cqe->lro_tcp_win;
563 }
564}
565
549static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe, 566static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe,
550 u32 cqe_bcnt) 567 u32 cqe_bcnt)
551{ 568{
552 struct ethhdr *eth = (struct ethhdr *)(skb->data); 569 struct ethhdr *eth = (struct ethhdr *)(skb->data);
553 struct tcphdr *tcp; 570 struct tcphdr *tcp;
554 int network_depth = 0; 571 int network_depth = 0;
572 __wsum check;
555 __be16 proto; 573 __be16 proto;
556 u16 tot_len; 574 u16 tot_len;
557 void *ip_p; 575 void *ip_p;
558 576
559 u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe);
560 u8 tcp_ack = (l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA) ||
561 (l4_hdr_type == CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA);
562
563 proto = __vlan_get_protocol(skb, eth->h_proto, &network_depth); 577 proto = __vlan_get_protocol(skb, eth->h_proto, &network_depth);
564 578
565 tot_len = cqe_bcnt - network_depth; 579 tot_len = cqe_bcnt - network_depth;
@@ -576,23 +590,30 @@ static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe,
576 ipv4->check = 0; 590 ipv4->check = 0;
577 ipv4->check = ip_fast_csum((unsigned char *)ipv4, 591 ipv4->check = ip_fast_csum((unsigned char *)ipv4,
578 ipv4->ihl); 592 ipv4->ihl);
593
594 mlx5e_lro_update_tcp_hdr(cqe, tcp);
595 check = csum_partial(tcp, tcp->doff * 4,
596 csum_unfold((__force __sum16)cqe->check_sum));
597 /* Almost done, don't forget the pseudo header */
598 tcp->check = csum_tcpudp_magic(ipv4->saddr, ipv4->daddr,
599 tot_len - sizeof(struct iphdr),
600 IPPROTO_TCP, check);
579 } else { 601 } else {
602 u16 payload_len = tot_len - sizeof(struct ipv6hdr);
580 struct ipv6hdr *ipv6 = ip_p; 603 struct ipv6hdr *ipv6 = ip_p;
581 604
582 tcp = ip_p + sizeof(struct ipv6hdr); 605 tcp = ip_p + sizeof(struct ipv6hdr);
583 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; 606 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
584 607
585 ipv6->hop_limit = cqe->lro_min_ttl; 608 ipv6->hop_limit = cqe->lro_min_ttl;
586 ipv6->payload_len = cpu_to_be16(tot_len - 609 ipv6->payload_len = cpu_to_be16(payload_len);
587 sizeof(struct ipv6hdr)); 610
588 } 611 mlx5e_lro_update_tcp_hdr(cqe, tcp);
589 612 check = csum_partial(tcp, tcp->doff * 4,
590 tcp->psh = get_cqe_lro_tcppsh(cqe); 613 csum_unfold((__force __sum16)cqe->check_sum));
591 614 /* Almost done, don't forget the pseudo header */
592 if (tcp_ack) { 615 tcp->check = csum_ipv6_magic(&ipv6->saddr, &ipv6->daddr, payload_len,
593 tcp->ack = 1; 616 IPPROTO_TCP, check);
594 tcp->ack_seq = cqe->lro_ack_seq_num;
595 tcp->window = cqe->lro_tcp_win;
596 } 617 }
597} 618}
598 619
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
index 5a4608281f38..707976482c09 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
@@ -216,7 +216,8 @@ mlx5e_test_loopback_validate(struct sk_buff *skb,
216 if (iph->protocol != IPPROTO_UDP) 216 if (iph->protocol != IPPROTO_UDP)
217 goto out; 217 goto out;
218 218
219 udph = udp_hdr(skb); 219 /* Don't assume skb_transport_header() was set */
220 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl);
220 if (udph->dest != htons(9)) 221 if (udph->dest != htons(9))
221 goto out; 222 goto out;
222 223
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index fd98b0dc610f..fa86a1466718 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2529,7 +2529,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
2529 if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) { 2529 if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) {
2530 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP; 2530 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP;
2531 } else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) { 2531 } else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) {
2532 if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q)) 2532 if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q) ||
2533 tcf_vlan_push_prio(a))
2533 return -EOPNOTSUPP; 2534 return -EOPNOTSUPP;
2534 2535
2535 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH; 2536 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 569b42a01026..11b4f1089d1c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -176,7 +176,7 @@ static inline u16 mlx5e_calc_min_inline(enum mlx5_inline_modes mode,
176 default: 176 default:
177 hlen = mlx5e_skb_l2_header_offset(skb); 177 hlen = mlx5e_skb_l2_header_offset(skb);
178 } 178 }
179 return min_t(u16, hlen, skb->len); 179 return min_t(u16, hlen, skb_headlen(skb));
180} 180}
181 181
182static inline void mlx5e_tx_skb_pull_inline(unsigned char **skb_data, 182static inline void mlx5e_tx_skb_pull_inline(unsigned char **skb_data,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 5ecf2cddc16d..c2b1d7d351fc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1529,6 +1529,10 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,
1529 1529
1530 esw_debug(esw->dev, "Enabling VPORT(%d)\n", vport_num); 1530 esw_debug(esw->dev, "Enabling VPORT(%d)\n", vport_num);
1531 1531
1532 /* Create steering drop counters for ingress and egress ACLs */
1533 if (vport_num && esw->mode == SRIOV_LEGACY)
1534 esw_vport_create_drop_counters(vport);
1535
1532 /* Restore old vport configuration */ 1536 /* Restore old vport configuration */
1533 esw_apply_vport_conf(esw, vport); 1537 esw_apply_vport_conf(esw, vport);
1534 1538
@@ -1545,10 +1549,6 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,
1545 if (!vport_num) 1549 if (!vport_num)
1546 vport->info.trusted = true; 1550 vport->info.trusted = true;
1547 1551
1548 /* create steering drop counters for ingress and egress ACLs */
1549 if (vport_num && esw->mode == SRIOV_LEGACY)
1550 esw_vport_create_drop_counters(vport);
1551
1552 esw_vport_change_handle_locked(vport); 1552 esw_vport_change_handle_locked(vport);
1553 1553
1554 esw->enabled_vports++; 1554 esw->enabled_vports++;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index c025c98700e4..31fc2cfac3b3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1429,7 +1429,8 @@ static bool check_conflicting_actions(u32 action1, u32 action2)
1429 1429
1430 if (xored_actions & (MLX5_FLOW_CONTEXT_ACTION_DROP | 1430 if (xored_actions & (MLX5_FLOW_CONTEXT_ACTION_DROP |
1431 MLX5_FLOW_CONTEXT_ACTION_ENCAP | 1431 MLX5_FLOW_CONTEXT_ACTION_ENCAP |
1432 MLX5_FLOW_CONTEXT_ACTION_DECAP)) 1432 MLX5_FLOW_CONTEXT_ACTION_DECAP |
1433 MLX5_FLOW_CONTEXT_ACTION_MOD_HDR))
1433 return true; 1434 return true;
1434 1435
1435 return false; 1436 return false;
@@ -1758,8 +1759,11 @@ search_again_locked:
1758 1759
1759 /* Collect all fgs which has a matching match_criteria */ 1760 /* Collect all fgs which has a matching match_criteria */
1760 err = build_match_list(&match_head, ft, spec); 1761 err = build_match_list(&match_head, ft, spec);
1761 if (err) 1762 if (err) {
1763 if (take_write)
1764 up_write_ref_node(&ft->node);
1762 return ERR_PTR(err); 1765 return ERR_PTR(err);
1766 }
1763 1767
1764 if (!take_write) 1768 if (!take_write)
1765 up_read_ref_node(&ft->node); 1769 up_read_ref_node(&ft->node);
@@ -1768,8 +1772,11 @@ search_again_locked:
1768 dest_num, version); 1772 dest_num, version);
1769 free_match_list(&match_head); 1773 free_match_list(&match_head);
1770 if (!IS_ERR(rule) || 1774 if (!IS_ERR(rule) ||
1771 (PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN)) 1775 (PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN)) {
1776 if (take_write)
1777 up_write_ref_node(&ft->node);
1772 return rule; 1778 return rule;
1779 }
1773 1780
1774 if (!take_write) { 1781 if (!take_write) {
1775 nested_down_write_ref_node(&ft->node, FS_LOCK_GRANDPARENT); 1782 nested_down_write_ref_node(&ft->node, FS_LOCK_GRANDPARENT);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index e159243e0fcf..857035583ccd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -34,6 +34,7 @@
34#include <linux/highmem.h> 34#include <linux/highmem.h>
35#include <rdma/mlx5-abi.h> 35#include <rdma/mlx5-abi.h>
36#include "en.h" 36#include "en.h"
37#include "clock.h"
37 38
38enum { 39enum {
39 MLX5_CYCLES_SHIFT = 23 40 MLX5_CYCLES_SHIFT = 23
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 2ef641c91c26..ae391e4b7070 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -551,7 +551,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
551 MLX5_SET(cmd_hca_cap, 551 MLX5_SET(cmd_hca_cap,
552 set_hca_cap, 552 set_hca_cap,
553 cache_line_128byte, 553 cache_line_128byte,
554 cache_line_size() == 128 ? 1 : 0); 554 cache_line_size() >= 128 ? 1 : 0);
555 555
556 if (MLX5_CAP_GEN_MAX(dev, dct)) 556 if (MLX5_CAP_GEN_MAX(dev, dct))
557 MLX5_SET(cmd_hca_cap, set_hca_cap, dct, 1); 557 MLX5_SET(cmd_hca_cap, set_hca_cap, dct, 1);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index f0b25baba09a..f7948e983637 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -788,6 +788,9 @@ static struct mlxsw_sp_vr *mlxsw_sp_vr_create(struct mlxsw_sp *mlxsw_sp,
788 u32 tb_id, 788 u32 tb_id,
789 struct netlink_ext_ack *extack) 789 struct netlink_ext_ack *extack)
790{ 790{
791 struct mlxsw_sp_mr_table *mr4_table;
792 struct mlxsw_sp_fib *fib4;
793 struct mlxsw_sp_fib *fib6;
791 struct mlxsw_sp_vr *vr; 794 struct mlxsw_sp_vr *vr;
792 int err; 795 int err;
793 796
@@ -796,29 +799,30 @@ static struct mlxsw_sp_vr *mlxsw_sp_vr_create(struct mlxsw_sp *mlxsw_sp,
796 NL_SET_ERR_MSG(extack, "spectrum: Exceeded number of supported virtual routers"); 799 NL_SET_ERR_MSG(extack, "spectrum: Exceeded number of supported virtual routers");
797 return ERR_PTR(-EBUSY); 800 return ERR_PTR(-EBUSY);
798 } 801 }
799 vr->fib4 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV4); 802 fib4 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV4);
800 if (IS_ERR(vr->fib4)) 803 if (IS_ERR(fib4))
801 return ERR_CAST(vr->fib4); 804 return ERR_CAST(fib4);
802 vr->fib6 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV6); 805 fib6 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV6);
803 if (IS_ERR(vr->fib6)) { 806 if (IS_ERR(fib6)) {
804 err = PTR_ERR(vr->fib6); 807 err = PTR_ERR(fib6);
805 goto err_fib6_create; 808 goto err_fib6_create;
806 } 809 }
807 vr->mr4_table = mlxsw_sp_mr_table_create(mlxsw_sp, vr->id, 810 mr4_table = mlxsw_sp_mr_table_create(mlxsw_sp, vr->id,
808 MLXSW_SP_L3_PROTO_IPV4); 811 MLXSW_SP_L3_PROTO_IPV4);
809 if (IS_ERR(vr->mr4_table)) { 812 if (IS_ERR(mr4_table)) {
810 err = PTR_ERR(vr->mr4_table); 813 err = PTR_ERR(mr4_table);
811 goto err_mr_table_create; 814 goto err_mr_table_create;
812 } 815 }
816 vr->fib4 = fib4;
817 vr->fib6 = fib6;
818 vr->mr4_table = mr4_table;
813 vr->tb_id = tb_id; 819 vr->tb_id = tb_id;
814 return vr; 820 return vr;
815 821
816err_mr_table_create: 822err_mr_table_create:
817 mlxsw_sp_fib_destroy(mlxsw_sp, vr->fib6); 823 mlxsw_sp_fib_destroy(mlxsw_sp, fib6);
818 vr->fib6 = NULL;
819err_fib6_create: 824err_fib6_create:
820 mlxsw_sp_fib_destroy(mlxsw_sp, vr->fib4); 825 mlxsw_sp_fib_destroy(mlxsw_sp, fib4);
821 vr->fib4 = NULL;
822 return ERR_PTR(err); 826 return ERR_PTR(err);
823} 827}
824 828
@@ -3790,6 +3794,9 @@ mlxsw_sp_fib4_entry_offload_unset(struct mlxsw_sp_fib_entry *fib_entry)
3790 struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group; 3794 struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group;
3791 int i; 3795 int i;
3792 3796
3797 if (!list_is_singular(&nh_grp->fib_list))
3798 return;
3799
3793 for (i = 0; i < nh_grp->count; i++) { 3800 for (i = 0; i < nh_grp->count; i++) {
3794 struct mlxsw_sp_nexthop *nh = &nh_grp->nexthops[i]; 3801 struct mlxsw_sp_nexthop *nh = &nh_grp->nexthops[i];
3795 3802
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 7e7704daf5f1..c4949183eef3 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -43,12 +43,6 @@
43 43
44/* Local Definitions and Declarations */ 44/* Local Definitions and Declarations */
45 45
46struct rmnet_walk_data {
47 struct net_device *real_dev;
48 struct list_head *head;
49 struct rmnet_port *port;
50};
51
52static int rmnet_is_real_dev_registered(const struct net_device *real_dev) 46static int rmnet_is_real_dev_registered(const struct net_device *real_dev)
53{ 47{
54 return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler; 48 return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler;
@@ -112,17 +106,14 @@ static int rmnet_register_real_device(struct net_device *real_dev)
112static void rmnet_unregister_bridge(struct net_device *dev, 106static void rmnet_unregister_bridge(struct net_device *dev,
113 struct rmnet_port *port) 107 struct rmnet_port *port)
114{ 108{
115 struct net_device *rmnet_dev, *bridge_dev;
116 struct rmnet_port *bridge_port; 109 struct rmnet_port *bridge_port;
110 struct net_device *bridge_dev;
117 111
118 if (port->rmnet_mode != RMNET_EPMODE_BRIDGE) 112 if (port->rmnet_mode != RMNET_EPMODE_BRIDGE)
119 return; 113 return;
120 114
121 /* bridge slave handling */ 115 /* bridge slave handling */
122 if (!port->nr_rmnet_devs) { 116 if (!port->nr_rmnet_devs) {
123 rmnet_dev = netdev_master_upper_dev_get_rcu(dev);
124 netdev_upper_dev_unlink(dev, rmnet_dev);
125
126 bridge_dev = port->bridge_ep; 117 bridge_dev = port->bridge_ep;
127 118
128 bridge_port = rmnet_get_port_rtnl(bridge_dev); 119 bridge_port = rmnet_get_port_rtnl(bridge_dev);
@@ -132,9 +123,6 @@ static void rmnet_unregister_bridge(struct net_device *dev,
132 bridge_dev = port->bridge_ep; 123 bridge_dev = port->bridge_ep;
133 124
134 bridge_port = rmnet_get_port_rtnl(bridge_dev); 125 bridge_port = rmnet_get_port_rtnl(bridge_dev);
135 rmnet_dev = netdev_master_upper_dev_get_rcu(bridge_dev);
136 netdev_upper_dev_unlink(bridge_dev, rmnet_dev);
137
138 rmnet_unregister_real_device(bridge_dev, bridge_port); 126 rmnet_unregister_real_device(bridge_dev, bridge_port);
139 } 127 }
140} 128}
@@ -173,10 +161,6 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev,
173 if (err) 161 if (err)
174 goto err1; 162 goto err1;
175 163
176 err = netdev_master_upper_dev_link(dev, real_dev, NULL, NULL, extack);
177 if (err)
178 goto err2;
179
180 port->rmnet_mode = mode; 164 port->rmnet_mode = mode;
181 165
182 hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]); 166 hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]);
@@ -193,8 +177,6 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev,
193 177
194 return 0; 178 return 0;
195 179
196err2:
197 rmnet_vnd_dellink(mux_id, port, ep);
198err1: 180err1:
199 rmnet_unregister_real_device(real_dev, port); 181 rmnet_unregister_real_device(real_dev, port);
200err0: 182err0:
@@ -204,14 +186,13 @@ err0:
204 186
205static void rmnet_dellink(struct net_device *dev, struct list_head *head) 187static void rmnet_dellink(struct net_device *dev, struct list_head *head)
206{ 188{
189 struct rmnet_priv *priv = netdev_priv(dev);
207 struct net_device *real_dev; 190 struct net_device *real_dev;
208 struct rmnet_endpoint *ep; 191 struct rmnet_endpoint *ep;
209 struct rmnet_port *port; 192 struct rmnet_port *port;
210 u8 mux_id; 193 u8 mux_id;
211 194
212 rcu_read_lock(); 195 real_dev = priv->real_dev;
213 real_dev = netdev_master_upper_dev_get_rcu(dev);
214 rcu_read_unlock();
215 196
216 if (!real_dev || !rmnet_is_real_dev_registered(real_dev)) 197 if (!real_dev || !rmnet_is_real_dev_registered(real_dev))
217 return; 198 return;
@@ -219,7 +200,6 @@ static void rmnet_dellink(struct net_device *dev, struct list_head *head)
219 port = rmnet_get_port_rtnl(real_dev); 200 port = rmnet_get_port_rtnl(real_dev);
220 201
221 mux_id = rmnet_vnd_get_mux(dev); 202 mux_id = rmnet_vnd_get_mux(dev);
222 netdev_upper_dev_unlink(dev, real_dev);
223 203
224 ep = rmnet_get_endpoint(port, mux_id); 204 ep = rmnet_get_endpoint(port, mux_id);
225 if (ep) { 205 if (ep) {
@@ -233,30 +213,13 @@ static void rmnet_dellink(struct net_device *dev, struct list_head *head)
233 unregister_netdevice_queue(dev, head); 213 unregister_netdevice_queue(dev, head);
234} 214}
235 215
236static int rmnet_dev_walk_unreg(struct net_device *rmnet_dev, void *data)
237{
238 struct rmnet_walk_data *d = data;
239 struct rmnet_endpoint *ep;
240 u8 mux_id;
241
242 mux_id = rmnet_vnd_get_mux(rmnet_dev);
243 ep = rmnet_get_endpoint(d->port, mux_id);
244 if (ep) {
245 hlist_del_init_rcu(&ep->hlnode);
246 rmnet_vnd_dellink(mux_id, d->port, ep);
247 kfree(ep);
248 }
249 netdev_upper_dev_unlink(rmnet_dev, d->real_dev);
250 unregister_netdevice_queue(rmnet_dev, d->head);
251
252 return 0;
253}
254
255static void rmnet_force_unassociate_device(struct net_device *dev) 216static void rmnet_force_unassociate_device(struct net_device *dev)
256{ 217{
257 struct net_device *real_dev = dev; 218 struct net_device *real_dev = dev;
258 struct rmnet_walk_data d; 219 struct hlist_node *tmp_ep;
220 struct rmnet_endpoint *ep;
259 struct rmnet_port *port; 221 struct rmnet_port *port;
222 unsigned long bkt_ep;
260 LIST_HEAD(list); 223 LIST_HEAD(list);
261 224
262 if (!rmnet_is_real_dev_registered(real_dev)) 225 if (!rmnet_is_real_dev_registered(real_dev))
@@ -264,16 +227,19 @@ static void rmnet_force_unassociate_device(struct net_device *dev)
264 227
265 ASSERT_RTNL(); 228 ASSERT_RTNL();
266 229
267 d.real_dev = real_dev;
268 d.head = &list;
269
270 port = rmnet_get_port_rtnl(dev); 230 port = rmnet_get_port_rtnl(dev);
271 d.port = port;
272 231
273 rcu_read_lock(); 232 rcu_read_lock();
274 rmnet_unregister_bridge(dev, port); 233 rmnet_unregister_bridge(dev, port);
275 234
276 netdev_walk_all_lower_dev_rcu(real_dev, rmnet_dev_walk_unreg, &d); 235 hash_for_each_safe(port->muxed_ep, bkt_ep, tmp_ep, ep, hlnode) {
236 unregister_netdevice_queue(ep->egress_dev, &list);
237 rmnet_vnd_dellink(ep->mux_id, port, ep);
238
239 hlist_del_init_rcu(&ep->hlnode);
240 kfree(ep);
241 }
242
277 rcu_read_unlock(); 243 rcu_read_unlock();
278 unregister_netdevice_many(&list); 244 unregister_netdevice_many(&list);
279 245
@@ -422,11 +388,6 @@ int rmnet_add_bridge(struct net_device *rmnet_dev,
422 if (err) 388 if (err)
423 return -EBUSY; 389 return -EBUSY;
424 390
425 err = netdev_master_upper_dev_link(slave_dev, rmnet_dev, NULL, NULL,
426 extack);
427 if (err)
428 return -EINVAL;
429
430 slave_port = rmnet_get_port(slave_dev); 391 slave_port = rmnet_get_port(slave_dev);
431 slave_port->rmnet_mode = RMNET_EPMODE_BRIDGE; 392 slave_port->rmnet_mode = RMNET_EPMODE_BRIDGE;
432 slave_port->bridge_ep = real_dev; 393 slave_port->bridge_ep = real_dev;
@@ -449,7 +410,6 @@ int rmnet_del_bridge(struct net_device *rmnet_dev,
449 port->rmnet_mode = RMNET_EPMODE_VND; 410 port->rmnet_mode = RMNET_EPMODE_VND;
450 port->bridge_ep = NULL; 411 port->bridge_ep = NULL;
451 412
452 netdev_upper_dev_unlink(slave_dev, rmnet_dev);
453 slave_port = rmnet_get_port(slave_dev); 413 slave_port = rmnet_get_port(slave_dev);
454 rmnet_unregister_real_device(slave_dev, slave_port); 414 rmnet_unregister_real_device(slave_dev, slave_port);
455 415
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
index 6bc328fb88e1..b0dbca070c00 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
@@ -38,6 +38,11 @@ static u8 rmnet_map_do_flow_control(struct sk_buff *skb,
38 } 38 }
39 39
40 ep = rmnet_get_endpoint(port, mux_id); 40 ep = rmnet_get_endpoint(port, mux_id);
41 if (!ep) {
42 kfree_skb(skb);
43 return RX_HANDLER_CONSUMED;
44 }
45
41 vnd = ep->egress_dev; 46 vnd = ep->egress_dev;
42 47
43 ip_family = cmd->flow_control.ip_family; 48 ip_family = cmd->flow_control.ip_family;
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 570a227acdd8..346d310914df 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -121,7 +121,7 @@ static void rmnet_get_stats64(struct net_device *dev,
121 memset(&total_stats, 0, sizeof(struct rmnet_vnd_stats)); 121 memset(&total_stats, 0, sizeof(struct rmnet_vnd_stats));
122 122
123 for_each_possible_cpu(cpu) { 123 for_each_possible_cpu(cpu) {
124 pcpu_ptr = this_cpu_ptr(priv->pcpu_stats); 124 pcpu_ptr = per_cpu_ptr(priv->pcpu_stats, cpu);
125 125
126 do { 126 do {
127 start = u64_stats_fetch_begin_irq(&pcpu_ptr->syncp); 127 start = u64_stats_fetch_begin_irq(&pcpu_ptr->syncp);
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index c87f57ca4437..a95fbd5510d9 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2255,9 +2255,6 @@ static int ravb_wol_setup(struct net_device *ndev)
2255 /* Enable MagicPacket */ 2255 /* Enable MagicPacket */
2256 ravb_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); 2256 ravb_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE);
2257 2257
2258 /* Increased clock usage so device won't be suspended */
2259 clk_enable(priv->clk);
2260
2261 return enable_irq_wake(priv->emac_irq); 2258 return enable_irq_wake(priv->emac_irq);
2262} 2259}
2263 2260
@@ -2276,9 +2273,6 @@ static int ravb_wol_restore(struct net_device *ndev)
2276 if (ret < 0) 2273 if (ret < 0)
2277 return ret; 2274 return ret;
2278 2275
2279 /* Restore clock usage count */
2280 clk_disable(priv->clk);
2281
2282 return disable_irq_wake(priv->emac_irq); 2276 return disable_irq_wake(priv->emac_irq);
2283} 2277}
2284 2278
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index a197e11f3a56..92dcf8717fc6 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -40,7 +40,6 @@
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/ethtool.h> 41#include <linux/ethtool.h>
42#include <linux/if_vlan.h> 42#include <linux/if_vlan.h>
43#include <linux/clk.h>
44#include <linux/sh_eth.h> 43#include <linux/sh_eth.h>
45#include <linux/of_mdio.h> 44#include <linux/of_mdio.h>
46 45
@@ -2304,7 +2303,7 @@ static void sh_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
2304 wol->supported = 0; 2303 wol->supported = 0;
2305 wol->wolopts = 0; 2304 wol->wolopts = 0;
2306 2305
2307 if (mdp->cd->magic && mdp->clk) { 2306 if (mdp->cd->magic) {
2308 wol->supported = WAKE_MAGIC; 2307 wol->supported = WAKE_MAGIC;
2309 wol->wolopts = mdp->wol_enabled ? WAKE_MAGIC : 0; 2308 wol->wolopts = mdp->wol_enabled ? WAKE_MAGIC : 0;
2310 } 2309 }
@@ -2314,7 +2313,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
2314{ 2313{
2315 struct sh_eth_private *mdp = netdev_priv(ndev); 2314 struct sh_eth_private *mdp = netdev_priv(ndev);
2316 2315
2317 if (!mdp->cd->magic || !mdp->clk || wol->wolopts & ~WAKE_MAGIC) 2316 if (!mdp->cd->magic || wol->wolopts & ~WAKE_MAGIC)
2318 return -EOPNOTSUPP; 2317 return -EOPNOTSUPP;
2319 2318
2320 mdp->wol_enabled = !!(wol->wolopts & WAKE_MAGIC); 2319 mdp->wol_enabled = !!(wol->wolopts & WAKE_MAGIC);
@@ -3153,11 +3152,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
3153 goto out_release; 3152 goto out_release;
3154 } 3153 }
3155 3154
3156 /* Get clock, if not found that's OK but Wake-On-Lan is unavailable */
3157 mdp->clk = devm_clk_get(&pdev->dev, NULL);
3158 if (IS_ERR(mdp->clk))
3159 mdp->clk = NULL;
3160
3161 ndev->base_addr = res->start; 3155 ndev->base_addr = res->start;
3162 3156
3163 spin_lock_init(&mdp->lock); 3157 spin_lock_init(&mdp->lock);
@@ -3278,7 +3272,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
3278 if (ret) 3272 if (ret)
3279 goto out_napi_del; 3273 goto out_napi_del;
3280 3274
3281 if (mdp->cd->magic && mdp->clk) 3275 if (mdp->cd->magic)
3282 device_set_wakeup_capable(&pdev->dev, 1); 3276 device_set_wakeup_capable(&pdev->dev, 1);
3283 3277
3284 /* print device information */ 3278 /* print device information */
@@ -3331,9 +3325,6 @@ static int sh_eth_wol_setup(struct net_device *ndev)
3331 /* Enable MagicPacket */ 3325 /* Enable MagicPacket */
3332 sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); 3326 sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE);
3333 3327
3334 /* Increased clock usage so device won't be suspended */
3335 clk_enable(mdp->clk);
3336
3337 return enable_irq_wake(ndev->irq); 3328 return enable_irq_wake(ndev->irq);
3338} 3329}
3339 3330
@@ -3359,9 +3350,6 @@ static int sh_eth_wol_restore(struct net_device *ndev)
3359 if (ret < 0) 3350 if (ret < 0)
3360 return ret; 3351 return ret;
3361 3352
3362 /* Restore clock usage count */
3363 clk_disable(mdp->clk);
3364
3365 return disable_irq_wake(ndev->irq); 3353 return disable_irq_wake(ndev->irq);
3366} 3354}
3367 3355
diff --git a/drivers/net/ethernet/smsc/Kconfig b/drivers/net/ethernet/smsc/Kconfig
index 63aca9f847e1..4c2f612e4414 100644
--- a/drivers/net/ethernet/smsc/Kconfig
+++ b/drivers/net/ethernet/smsc/Kconfig
@@ -20,7 +20,7 @@ if NET_VENDOR_SMSC
20 20
21config SMC9194 21config SMC9194
22 tristate "SMC 9194 support" 22 tristate "SMC 9194 support"
23 depends on (ISA || MAC && BROKEN) 23 depends on ISA
24 select CRC32 24 select CRC32
25 ---help--- 25 ---help---
26 This is support for the SMC9xxx based Ethernet cards. Choose this 26 This is support for the SMC9xxx based Ethernet cards. Choose this
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index a0f2be81d52e..8fc02d9db3d0 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1451,7 +1451,7 @@ destroy_macvlan_port:
1451 /* the macvlan port may be freed by macvlan_uninit when fail to register. 1451 /* the macvlan port may be freed by macvlan_uninit when fail to register.
1452 * so we destroy the macvlan port only when it's valid. 1452 * so we destroy the macvlan port only when it's valid.
1453 */ 1453 */
1454 if (create && macvlan_port_get_rtnl(dev)) 1454 if (create && macvlan_port_get_rtnl(lowerdev))
1455 macvlan_port_destroy(port->dev); 1455 macvlan_port_destroy(port->dev);
1456 return err; 1456 return err;
1457} 1457}
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b13eed21c87d..d39ae77707ef 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1382,7 +1382,7 @@ int genphy_setup_forced(struct phy_device *phydev)
1382 ctl |= BMCR_FULLDPLX; 1382 ctl |= BMCR_FULLDPLX;
1383 1383
1384 return phy_modify(phydev, MII_BMCR, 1384 return phy_modify(phydev, MII_BMCR,
1385 BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN, ctl); 1385 ~(BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN), ctl);
1386} 1386}
1387EXPORT_SYMBOL(genphy_setup_forced); 1387EXPORT_SYMBOL(genphy_setup_forced);
1388 1388
diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c
index ca5e375de27c..e0d6760f3219 100644
--- a/drivers/net/thunderbolt.c
+++ b/drivers/net/thunderbolt.c
@@ -166,6 +166,8 @@ struct tbnet_ring {
166 * @connected_work: Worker that finalizes the ThunderboltIP connection 166 * @connected_work: Worker that finalizes the ThunderboltIP connection
167 * setup and enables DMA paths for high speed data 167 * setup and enables DMA paths for high speed data
168 * transfers 168 * transfers
169 * @disconnect_work: Worker that handles tearing down the ThunderboltIP
170 * connection
169 * @rx_hdr: Copy of the currently processed Rx frame. Used when a 171 * @rx_hdr: Copy of the currently processed Rx frame. Used when a
170 * network packet consists of multiple Thunderbolt frames. 172 * network packet consists of multiple Thunderbolt frames.
171 * In host byte order. 173 * In host byte order.
@@ -190,6 +192,7 @@ struct tbnet {
190 int login_retries; 192 int login_retries;
191 struct delayed_work login_work; 193 struct delayed_work login_work;
192 struct work_struct connected_work; 194 struct work_struct connected_work;
195 struct work_struct disconnect_work;
193 struct thunderbolt_ip_frame_header rx_hdr; 196 struct thunderbolt_ip_frame_header rx_hdr;
194 struct tbnet_ring rx_ring; 197 struct tbnet_ring rx_ring;
195 atomic_t frame_id; 198 atomic_t frame_id;
@@ -445,7 +448,7 @@ static int tbnet_handle_packet(const void *buf, size_t size, void *data)
445 case TBIP_LOGOUT: 448 case TBIP_LOGOUT:
446 ret = tbnet_logout_response(net, route, sequence, command_id); 449 ret = tbnet_logout_response(net, route, sequence, command_id);
447 if (!ret) 450 if (!ret)
448 tbnet_tear_down(net, false); 451 queue_work(system_long_wq, &net->disconnect_work);
449 break; 452 break;
450 453
451 default: 454 default:
@@ -659,6 +662,13 @@ static void tbnet_login_work(struct work_struct *work)
659 } 662 }
660} 663}
661 664
665static void tbnet_disconnect_work(struct work_struct *work)
666{
667 struct tbnet *net = container_of(work, typeof(*net), disconnect_work);
668
669 tbnet_tear_down(net, false);
670}
671
662static bool tbnet_check_frame(struct tbnet *net, const struct tbnet_frame *tf, 672static bool tbnet_check_frame(struct tbnet *net, const struct tbnet_frame *tf,
663 const struct thunderbolt_ip_frame_header *hdr) 673 const struct thunderbolt_ip_frame_header *hdr)
664{ 674{
@@ -881,6 +891,7 @@ static int tbnet_stop(struct net_device *dev)
881 891
882 napi_disable(&net->napi); 892 napi_disable(&net->napi);
883 893
894 cancel_work_sync(&net->disconnect_work);
884 tbnet_tear_down(net, true); 895 tbnet_tear_down(net, true);
885 896
886 tb_ring_free(net->rx_ring.ring); 897 tb_ring_free(net->rx_ring.ring);
@@ -1195,6 +1206,7 @@ static int tbnet_probe(struct tb_service *svc, const struct tb_service_id *id)
1195 net = netdev_priv(dev); 1206 net = netdev_priv(dev);
1196 INIT_DELAYED_WORK(&net->login_work, tbnet_login_work); 1207 INIT_DELAYED_WORK(&net->login_work, tbnet_login_work);
1197 INIT_WORK(&net->connected_work, tbnet_connected_work); 1208 INIT_WORK(&net->connected_work, tbnet_connected_work);
1209 INIT_WORK(&net->disconnect_work, tbnet_disconnect_work);
1198 mutex_init(&net->connection_lock); 1210 mutex_init(&net->connection_lock);
1199 atomic_set(&net->command_id, 0); 1211 atomic_set(&net->command_id, 0);
1200 atomic_set(&net->frame_id, 0); 1212 atomic_set(&net->frame_id, 0);
@@ -1270,10 +1282,7 @@ static int __maybe_unused tbnet_suspend(struct device *dev)
1270 stop_login(net); 1282 stop_login(net);
1271 if (netif_running(net->dev)) { 1283 if (netif_running(net->dev)) {
1272 netif_device_detach(net->dev); 1284 netif_device_detach(net->dev);
1273 tb_ring_stop(net->rx_ring.ring); 1285 tbnet_tear_down(net, true);
1274 tb_ring_stop(net->tx_ring.ring);
1275 tbnet_free_buffers(&net->rx_ring);
1276 tbnet_free_buffers(&net->tx_ring);
1277 } 1286 }
1278 1287
1279 return 0; 1288 return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 81e6cc951e7f..b52258c327d2 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1489,27 +1489,23 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile,
1489 skb->truesize += skb->data_len; 1489 skb->truesize += skb->data_len;
1490 1490
1491 for (i = 1; i < it->nr_segs; i++) { 1491 for (i = 1; i < it->nr_segs; i++) {
1492 struct page_frag *pfrag = &current->task_frag;
1492 size_t fragsz = it->iov[i].iov_len; 1493 size_t fragsz = it->iov[i].iov_len;
1493 unsigned long offset;
1494 struct page *page;
1495 void *data;
1496 1494
1497 if (fragsz == 0 || fragsz > PAGE_SIZE) { 1495 if (fragsz == 0 || fragsz > PAGE_SIZE) {
1498 err = -EINVAL; 1496 err = -EINVAL;
1499 goto free; 1497 goto free;
1500 } 1498 }
1501 1499
1502 local_bh_disable(); 1500 if (!skb_page_frag_refill(fragsz, pfrag, GFP_KERNEL)) {
1503 data = napi_alloc_frag(fragsz);
1504 local_bh_enable();
1505 if (!data) {
1506 err = -ENOMEM; 1501 err = -ENOMEM;
1507 goto free; 1502 goto free;
1508 } 1503 }
1509 1504
1510 page = virt_to_head_page(data); 1505 skb_fill_page_desc(skb, i - 1, pfrag->page,
1511 offset = data - page_address(page); 1506 pfrag->offset, fragsz);
1512 skb_fill_page_desc(skb, i - 1, page, offset, fragsz); 1507 page_ref_inc(pfrag->page);
1508 pfrag->offset += fragsz;
1513 } 1509 }
1514 1510
1515 return skb; 1511 return skb;
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index d0a113743195..7a6a1fe79309 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -954,10 +954,11 @@ static int smsc75xx_set_features(struct net_device *netdev,
954 /* it's racing here! */ 954 /* it's racing here! */
955 955
956 ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); 956 ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
957 if (ret < 0) 957 if (ret < 0) {
958 netdev_warn(dev->net, "Error writing RFE_CTL\n"); 958 netdev_warn(dev->net, "Error writing RFE_CTL\n");
959 959 return ret;
960 return ret; 960 }
961 return 0;
961} 962}
962 963
963static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm) 964static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 626c27352ae2..9bb9e562b893 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -443,12 +443,8 @@ static bool __virtnet_xdp_xmit(struct virtnet_info *vi,
443 sg_init_one(sq->sg, xdp->data, xdp->data_end - xdp->data); 443 sg_init_one(sq->sg, xdp->data, xdp->data_end - xdp->data);
444 444
445 err = virtqueue_add_outbuf(sq->vq, sq->sg, 1, xdp->data, GFP_ATOMIC); 445 err = virtqueue_add_outbuf(sq->vq, sq->sg, 1, xdp->data, GFP_ATOMIC);
446 if (unlikely(err)) { 446 if (unlikely(err))
447 struct page *page = virt_to_head_page(xdp->data); 447 return false; /* Caller handle free/refcnt */
448
449 put_page(page);
450 return false;
451 }
452 448
453 return true; 449 return true;
454} 450}
@@ -456,8 +452,18 @@ static bool __virtnet_xdp_xmit(struct virtnet_info *vi,
456static int virtnet_xdp_xmit(struct net_device *dev, struct xdp_buff *xdp) 452static int virtnet_xdp_xmit(struct net_device *dev, struct xdp_buff *xdp)
457{ 453{
458 struct virtnet_info *vi = netdev_priv(dev); 454 struct virtnet_info *vi = netdev_priv(dev);
459 bool sent = __virtnet_xdp_xmit(vi, xdp); 455 struct receive_queue *rq = vi->rq;
456 struct bpf_prog *xdp_prog;
457 bool sent;
460 458
459 /* Only allow ndo_xdp_xmit if XDP is loaded on dev, as this
460 * indicate XDP resources have been successfully allocated.
461 */
462 xdp_prog = rcu_dereference(rq->xdp_prog);
463 if (!xdp_prog)
464 return -ENXIO;
465
466 sent = __virtnet_xdp_xmit(vi, xdp);
461 if (!sent) 467 if (!sent)
462 return -ENOSPC; 468 return -ENOSPC;
463 return 0; 469 return 0;
@@ -546,8 +552,11 @@ static struct sk_buff *receive_small(struct net_device *dev,
546 unsigned int buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) + 552 unsigned int buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) +
547 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); 553 SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
548 struct page *page = virt_to_head_page(buf); 554 struct page *page = virt_to_head_page(buf);
549 unsigned int delta = 0, err; 555 unsigned int delta = 0;
550 struct page *xdp_page; 556 struct page *xdp_page;
557 bool sent;
558 int err;
559
551 len -= vi->hdr_len; 560 len -= vi->hdr_len;
552 561
553 rcu_read_lock(); 562 rcu_read_lock();
@@ -558,7 +567,7 @@ static struct sk_buff *receive_small(struct net_device *dev,
558 void *orig_data; 567 void *orig_data;
559 u32 act; 568 u32 act;
560 569
561 if (unlikely(hdr->hdr.gso_type || hdr->hdr.flags)) 570 if (unlikely(hdr->hdr.gso_type))
562 goto err_xdp; 571 goto err_xdp;
563 572
564 if (unlikely(xdp_headroom < virtnet_get_headroom(vi))) { 573 if (unlikely(xdp_headroom < virtnet_get_headroom(vi))) {
@@ -596,16 +605,19 @@ static struct sk_buff *receive_small(struct net_device *dev,
596 delta = orig_data - xdp.data; 605 delta = orig_data - xdp.data;
597 break; 606 break;
598 case XDP_TX: 607 case XDP_TX:
599 if (unlikely(!__virtnet_xdp_xmit(vi, &xdp))) 608 sent = __virtnet_xdp_xmit(vi, &xdp);
609 if (unlikely(!sent)) {
600 trace_xdp_exception(vi->dev, xdp_prog, act); 610 trace_xdp_exception(vi->dev, xdp_prog, act);
601 else 611 goto err_xdp;
602 *xdp_xmit = true; 612 }
613 *xdp_xmit = true;
603 rcu_read_unlock(); 614 rcu_read_unlock();
604 goto xdp_xmit; 615 goto xdp_xmit;
605 case XDP_REDIRECT: 616 case XDP_REDIRECT:
606 err = xdp_do_redirect(dev, &xdp, xdp_prog); 617 err = xdp_do_redirect(dev, &xdp, xdp_prog);
607 if (!err) 618 if (err)
608 *xdp_xmit = true; 619 goto err_xdp;
620 *xdp_xmit = true;
609 rcu_read_unlock(); 621 rcu_read_unlock();
610 goto xdp_xmit; 622 goto xdp_xmit;
611 default: 623 default:
@@ -677,7 +689,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
677 struct bpf_prog *xdp_prog; 689 struct bpf_prog *xdp_prog;
678 unsigned int truesize; 690 unsigned int truesize;
679 unsigned int headroom = mergeable_ctx_to_headroom(ctx); 691 unsigned int headroom = mergeable_ctx_to_headroom(ctx);
680 int err; 692 bool sent;
681 693
682 head_skb = NULL; 694 head_skb = NULL;
683 695
@@ -746,20 +758,18 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
746 } 758 }
747 break; 759 break;
748 case XDP_TX: 760 case XDP_TX:
749 if (unlikely(!__virtnet_xdp_xmit(vi, &xdp))) 761 sent = __virtnet_xdp_xmit(vi, &xdp);
762 if (unlikely(!sent)) {
750 trace_xdp_exception(vi->dev, xdp_prog, act); 763 trace_xdp_exception(vi->dev, xdp_prog, act);
751 else 764 if (unlikely(xdp_page != page))
752 *xdp_xmit = true; 765 put_page(xdp_page);
766 goto err_xdp;
767 }
768 *xdp_xmit = true;
753 if (unlikely(xdp_page != page)) 769 if (unlikely(xdp_page != page))
754 goto err_xdp; 770 goto err_xdp;
755 rcu_read_unlock(); 771 rcu_read_unlock();
756 goto xdp_xmit; 772 goto xdp_xmit;
757 case XDP_REDIRECT:
758 err = xdp_do_redirect(dev, &xdp, xdp_prog);
759 if (!err)
760 *xdp_xmit = true;
761 rcu_read_unlock();
762 goto xdp_xmit;
763 default: 773 default:
764 bpf_warn_invalid_xdp_action(act); 774 bpf_warn_invalid_xdp_action(act);
765 case XDP_ABORTED: 775 case XDP_ABORTED:
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 1cf22e62e3dd..6e0af815f25e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3516,7 +3516,7 @@ static int __init init_mac80211_hwsim(void)
3516 3516
3517 spin_lock_init(&hwsim_radio_lock); 3517 spin_lock_init(&hwsim_radio_lock);
3518 3518
3519 hwsim_wq = alloc_workqueue("hwsim_wq",WQ_MEM_RECLAIM,0); 3519 hwsim_wq = alloc_workqueue("hwsim_wq", 0, 0);
3520 if (!hwsim_wq) 3520 if (!hwsim_wq)
3521 return -ENOMEM; 3521 return -ENOMEM;
3522 rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params); 3522 rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 8328d395e332..3127bc8633ca 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2005,7 +2005,10 @@ static void netback_changed(struct xenbus_device *dev,
2005 case XenbusStateInitialised: 2005 case XenbusStateInitialised:
2006 case XenbusStateReconfiguring: 2006 case XenbusStateReconfiguring:
2007 case XenbusStateReconfigured: 2007 case XenbusStateReconfigured:
2008 break;
2009
2008 case XenbusStateUnknown: 2010 case XenbusStateUnknown:
2011 wake_up_all(&module_unload_q);
2009 break; 2012 break;
2010 2013
2011 case XenbusStateInitWait: 2014 case XenbusStateInitWait:
@@ -2136,7 +2139,9 @@ static int xennet_remove(struct xenbus_device *dev)
2136 xenbus_switch_state(dev, XenbusStateClosing); 2139 xenbus_switch_state(dev, XenbusStateClosing);
2137 wait_event(module_unload_q, 2140 wait_event(module_unload_q,
2138 xenbus_read_driver_state(dev->otherend) == 2141 xenbus_read_driver_state(dev->otherend) ==
2139 XenbusStateClosing); 2142 XenbusStateClosing ||
2143 xenbus_read_driver_state(dev->otherend) ==
2144 XenbusStateUnknown);
2140 2145
2141 xenbus_switch_state(dev, XenbusStateClosed); 2146 xenbus_switch_state(dev, XenbusStateClosed);
2142 wait_event(module_unload_q, 2147 wait_event(module_unload_q,
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 10041ac4032c..06f8dcc52ca6 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -335,8 +335,7 @@ static int pmem_attach_disk(struct device *dev,
335 dev_warn(dev, "unable to guarantee persistence of writes\n"); 335 dev_warn(dev, "unable to guarantee persistence of writes\n");
336 fua = 0; 336 fua = 0;
337 } 337 }
338 wbc = nvdimm_has_cache(nd_region) && 338 wbc = nvdimm_has_cache(nd_region);
339 !test_bit(ND_REGION_PERSIST_CACHE, &nd_region->flags);
340 339
341 if (!devm_request_mem_region(dev, res->start, resource_size(res), 340 if (!devm_request_mem_region(dev, res->start, resource_size(res),
342 dev_name(&ndns->dev))) { 341 dev_name(&ndns->dev))) {
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f431c32774f3..817e5e2766da 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -120,8 +120,12 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl)
120 int ret; 120 int ret;
121 121
122 ret = nvme_reset_ctrl(ctrl); 122 ret = nvme_reset_ctrl(ctrl);
123 if (!ret) 123 if (!ret) {
124 flush_work(&ctrl->reset_work); 124 flush_work(&ctrl->reset_work);
125 if (ctrl->state != NVME_CTRL_LIVE)
126 ret = -ENETRESET;
127 }
128
125 return ret; 129 return ret;
126} 130}
127EXPORT_SYMBOL_GPL(nvme_reset_ctrl_sync); 131EXPORT_SYMBOL_GPL(nvme_reset_ctrl_sync);
@@ -265,7 +269,7 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
265 switch (new_state) { 269 switch (new_state) {
266 case NVME_CTRL_ADMIN_ONLY: 270 case NVME_CTRL_ADMIN_ONLY:
267 switch (old_state) { 271 switch (old_state) {
268 case NVME_CTRL_RECONNECTING: 272 case NVME_CTRL_CONNECTING:
269 changed = true; 273 changed = true;
270 /* FALLTHRU */ 274 /* FALLTHRU */
271 default: 275 default:
@@ -276,7 +280,7 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
276 switch (old_state) { 280 switch (old_state) {
277 case NVME_CTRL_NEW: 281 case NVME_CTRL_NEW:
278 case NVME_CTRL_RESETTING: 282 case NVME_CTRL_RESETTING:
279 case NVME_CTRL_RECONNECTING: 283 case NVME_CTRL_CONNECTING:
280 changed = true; 284 changed = true;
281 /* FALLTHRU */ 285 /* FALLTHRU */
282 default: 286 default:
@@ -294,9 +298,9 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
294 break; 298 break;
295 } 299 }
296 break; 300 break;
297 case NVME_CTRL_RECONNECTING: 301 case NVME_CTRL_CONNECTING:
298 switch (old_state) { 302 switch (old_state) {
299 case NVME_CTRL_LIVE: 303 case NVME_CTRL_NEW:
300 case NVME_CTRL_RESETTING: 304 case NVME_CTRL_RESETTING:
301 changed = true; 305 changed = true;
302 /* FALLTHRU */ 306 /* FALLTHRU */
@@ -309,7 +313,7 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
309 case NVME_CTRL_LIVE: 313 case NVME_CTRL_LIVE:
310 case NVME_CTRL_ADMIN_ONLY: 314 case NVME_CTRL_ADMIN_ONLY:
311 case NVME_CTRL_RESETTING: 315 case NVME_CTRL_RESETTING:
312 case NVME_CTRL_RECONNECTING: 316 case NVME_CTRL_CONNECTING:
313 changed = true; 317 changed = true;
314 /* FALLTHRU */ 318 /* FALLTHRU */
315 default: 319 default:
@@ -518,9 +522,11 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,
518 u64 slba = nvme_block_nr(ns, bio->bi_iter.bi_sector); 522 u64 slba = nvme_block_nr(ns, bio->bi_iter.bi_sector);
519 u32 nlb = bio->bi_iter.bi_size >> ns->lba_shift; 523 u32 nlb = bio->bi_iter.bi_size >> ns->lba_shift;
520 524
521 range[n].cattr = cpu_to_le32(0); 525 if (n < segments) {
522 range[n].nlb = cpu_to_le32(nlb); 526 range[n].cattr = cpu_to_le32(0);
523 range[n].slba = cpu_to_le64(slba); 527 range[n].nlb = cpu_to_le32(nlb);
528 range[n].slba = cpu_to_le64(slba);
529 }
524 n++; 530 n++;
525 } 531 }
526 532
@@ -794,13 +800,9 @@ static void nvme_keep_alive_end_io(struct request *rq, blk_status_t status)
794 800
795static int nvme_keep_alive(struct nvme_ctrl *ctrl) 801static int nvme_keep_alive(struct nvme_ctrl *ctrl)
796{ 802{
797 struct nvme_command c;
798 struct request *rq; 803 struct request *rq;
799 804
800 memset(&c, 0, sizeof(c)); 805 rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd, BLK_MQ_REQ_RESERVED,
801 c.common.opcode = nvme_admin_keep_alive;
802
803 rq = nvme_alloc_request(ctrl->admin_q, &c, BLK_MQ_REQ_RESERVED,
804 NVME_QID_ANY); 806 NVME_QID_ANY);
805 if (IS_ERR(rq)) 807 if (IS_ERR(rq))
806 return PTR_ERR(rq); 808 return PTR_ERR(rq);
@@ -832,6 +834,8 @@ void nvme_start_keep_alive(struct nvme_ctrl *ctrl)
832 return; 834 return;
833 835
834 INIT_DELAYED_WORK(&ctrl->ka_work, nvme_keep_alive_work); 836 INIT_DELAYED_WORK(&ctrl->ka_work, nvme_keep_alive_work);
837 memset(&ctrl->ka_cmd, 0, sizeof(ctrl->ka_cmd));
838 ctrl->ka_cmd.common.opcode = nvme_admin_keep_alive;
835 schedule_delayed_work(&ctrl->ka_work, ctrl->kato * HZ); 839 schedule_delayed_work(&ctrl->ka_work, ctrl->kato * HZ);
836} 840}
837EXPORT_SYMBOL_GPL(nvme_start_keep_alive); 841EXPORT_SYMBOL_GPL(nvme_start_keep_alive);
@@ -1117,14 +1121,19 @@ static u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
1117 1121
1118static void nvme_update_formats(struct nvme_ctrl *ctrl) 1122static void nvme_update_formats(struct nvme_ctrl *ctrl)
1119{ 1123{
1120 struct nvme_ns *ns; 1124 struct nvme_ns *ns, *next;
1125 LIST_HEAD(rm_list);
1121 1126
1122 mutex_lock(&ctrl->namespaces_mutex); 1127 mutex_lock(&ctrl->namespaces_mutex);
1123 list_for_each_entry(ns, &ctrl->namespaces, list) { 1128 list_for_each_entry(ns, &ctrl->namespaces, list) {
1124 if (ns->disk && nvme_revalidate_disk(ns->disk)) 1129 if (ns->disk && nvme_revalidate_disk(ns->disk)) {
1125 nvme_ns_remove(ns); 1130 list_move_tail(&ns->list, &rm_list);
1131 }
1126 } 1132 }
1127 mutex_unlock(&ctrl->namespaces_mutex); 1133 mutex_unlock(&ctrl->namespaces_mutex);
1134
1135 list_for_each_entry_safe(ns, next, &rm_list, list)
1136 nvme_ns_remove(ns);
1128} 1137}
1129 1138
1130static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects) 1139static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects)
@@ -2687,7 +2696,7 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
2687 [NVME_CTRL_LIVE] = "live", 2696 [NVME_CTRL_LIVE] = "live",
2688 [NVME_CTRL_ADMIN_ONLY] = "only-admin", 2697 [NVME_CTRL_ADMIN_ONLY] = "only-admin",
2689 [NVME_CTRL_RESETTING] = "resetting", 2698 [NVME_CTRL_RESETTING] = "resetting",
2690 [NVME_CTRL_RECONNECTING]= "reconnecting", 2699 [NVME_CTRL_CONNECTING] = "connecting",
2691 [NVME_CTRL_DELETING] = "deleting", 2700 [NVME_CTRL_DELETING] = "deleting",
2692 [NVME_CTRL_DEAD] = "dead", 2701 [NVME_CTRL_DEAD] = "dead",
2693 }; 2702 };
@@ -2835,7 +2844,7 @@ out:
2835} 2844}
2836 2845
2837static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid, 2846static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
2838 struct nvme_id_ns *id, bool *new) 2847 struct nvme_id_ns *id)
2839{ 2848{
2840 struct nvme_ctrl *ctrl = ns->ctrl; 2849 struct nvme_ctrl *ctrl = ns->ctrl;
2841 bool is_shared = id->nmic & (1 << 0); 2850 bool is_shared = id->nmic & (1 << 0);
@@ -2851,8 +2860,6 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
2851 ret = PTR_ERR(head); 2860 ret = PTR_ERR(head);
2852 goto out_unlock; 2861 goto out_unlock;
2853 } 2862 }
2854
2855 *new = true;
2856 } else { 2863 } else {
2857 struct nvme_ns_ids ids; 2864 struct nvme_ns_ids ids;
2858 2865
@@ -2864,8 +2871,6 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
2864 ret = -EINVAL; 2871 ret = -EINVAL;
2865 goto out_unlock; 2872 goto out_unlock;
2866 } 2873 }
2867
2868 *new = false;
2869 } 2874 }
2870 2875
2871 list_add_tail(&ns->siblings, &head->list); 2876 list_add_tail(&ns->siblings, &head->list);
@@ -2936,7 +2941,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
2936 struct nvme_id_ns *id; 2941 struct nvme_id_ns *id;
2937 char disk_name[DISK_NAME_LEN]; 2942 char disk_name[DISK_NAME_LEN];
2938 int node = dev_to_node(ctrl->dev), flags = GENHD_FL_EXT_DEVT; 2943 int node = dev_to_node(ctrl->dev), flags = GENHD_FL_EXT_DEVT;
2939 bool new = true;
2940 2944
2941 ns = kzalloc_node(sizeof(*ns), GFP_KERNEL, node); 2945 ns = kzalloc_node(sizeof(*ns), GFP_KERNEL, node);
2942 if (!ns) 2946 if (!ns)
@@ -2962,7 +2966,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
2962 if (id->ncap == 0) 2966 if (id->ncap == 0)
2963 goto out_free_id; 2967 goto out_free_id;
2964 2968
2965 if (nvme_init_ns_head(ns, nsid, id, &new)) 2969 if (nvme_init_ns_head(ns, nsid, id))
2966 goto out_free_id; 2970 goto out_free_id;
2967 nvme_setup_streams_ns(ctrl, ns); 2971 nvme_setup_streams_ns(ctrl, ns);
2968 2972
@@ -3028,8 +3032,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3028 pr_warn("%s: failed to register lightnvm sysfs group for identification\n", 3032 pr_warn("%s: failed to register lightnvm sysfs group for identification\n",
3029 ns->disk->disk_name); 3033 ns->disk->disk_name);
3030 3034
3031 if (new) 3035 nvme_mpath_add_disk(ns->head);
3032 nvme_mpath_add_disk(ns->head);
3033 nvme_mpath_add_disk_links(ns); 3036 nvme_mpath_add_disk_links(ns);
3034 return; 3037 return;
3035 out_unlink_ns: 3038 out_unlink_ns:
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 5dd4ceefed8f..a1c58e35075e 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -493,7 +493,7 @@ EXPORT_SYMBOL_GPL(nvmf_should_reconnect);
493 */ 493 */
494int nvmf_register_transport(struct nvmf_transport_ops *ops) 494int nvmf_register_transport(struct nvmf_transport_ops *ops)
495{ 495{
496 if (!ops->create_ctrl || !ops->module) 496 if (!ops->create_ctrl)
497 return -EINVAL; 497 return -EINVAL;
498 498
499 down_write(&nvmf_transports_rwsem); 499 down_write(&nvmf_transports_rwsem);
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index 25b19f722f5b..a3145d90c1d2 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -171,13 +171,14 @@ static inline blk_status_t nvmf_check_init_req(struct nvme_ctrl *ctrl,
171 cmd->common.opcode != nvme_fabrics_command || 171 cmd->common.opcode != nvme_fabrics_command ||
172 cmd->fabrics.fctype != nvme_fabrics_type_connect) { 172 cmd->fabrics.fctype != nvme_fabrics_type_connect) {
173 /* 173 /*
174 * Reconnecting state means transport disruption, which can take 174 * Connecting state means transport disruption or initial
175 * a long time and even might fail permanently, fail fast to 175 * establishment, which can take a long time and even might
176 * give upper layers a chance to failover. 176 * fail permanently, fail fast to give upper layers a chance
177 * to failover.
177 * Deleting state means that the ctrl will never accept commands 178 * Deleting state means that the ctrl will never accept commands
178 * again, fail it permanently. 179 * again, fail it permanently.
179 */ 180 */
180 if (ctrl->state == NVME_CTRL_RECONNECTING || 181 if (ctrl->state == NVME_CTRL_CONNECTING ||
181 ctrl->state == NVME_CTRL_DELETING) { 182 ctrl->state == NVME_CTRL_DELETING) {
182 nvme_req(rq)->status = NVME_SC_ABORT_REQ; 183 nvme_req(rq)->status = NVME_SC_ABORT_REQ;
183 return BLK_STS_IOERR; 184 return BLK_STS_IOERR;
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index b856d7c919d2..7f51f8414b97 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -55,9 +55,7 @@ struct nvme_fc_queue {
55 55
56enum nvme_fcop_flags { 56enum nvme_fcop_flags {
57 FCOP_FLAGS_TERMIO = (1 << 0), 57 FCOP_FLAGS_TERMIO = (1 << 0),
58 FCOP_FLAGS_RELEASED = (1 << 1), 58 FCOP_FLAGS_AEN = (1 << 1),
59 FCOP_FLAGS_COMPLETE = (1 << 2),
60 FCOP_FLAGS_AEN = (1 << 3),
61}; 59};
62 60
63struct nvmefc_ls_req_op { 61struct nvmefc_ls_req_op {
@@ -532,7 +530,7 @@ nvme_fc_resume_controller(struct nvme_fc_ctrl *ctrl)
532{ 530{
533 switch (ctrl->ctrl.state) { 531 switch (ctrl->ctrl.state) {
534 case NVME_CTRL_NEW: 532 case NVME_CTRL_NEW:
535 case NVME_CTRL_RECONNECTING: 533 case NVME_CTRL_CONNECTING:
536 /* 534 /*
537 * As all reconnects were suppressed, schedule a 535 * As all reconnects were suppressed, schedule a
538 * connect. 536 * connect.
@@ -777,7 +775,7 @@ nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl)
777 } 775 }
778 break; 776 break;
779 777
780 case NVME_CTRL_RECONNECTING: 778 case NVME_CTRL_CONNECTING:
781 /* 779 /*
782 * The association has already been terminated and the 780 * The association has already been terminated and the
783 * controller is attempting reconnects. No need to do anything 781 * controller is attempting reconnects. No need to do anything
@@ -1470,7 +1468,6 @@ nvme_fc_xmt_disconnect_assoc(struct nvme_fc_ctrl *ctrl)
1470 1468
1471/* *********************** NVME Ctrl Routines **************************** */ 1469/* *********************** NVME Ctrl Routines **************************** */
1472 1470
1473static void __nvme_fc_final_op_cleanup(struct request *rq);
1474static void nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg); 1471static void nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg);
1475 1472
1476static int 1473static int
@@ -1512,13 +1509,19 @@ nvme_fc_exit_request(struct blk_mq_tag_set *set, struct request *rq,
1512static int 1509static int
1513__nvme_fc_abort_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_fcp_op *op) 1510__nvme_fc_abort_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_fcp_op *op)
1514{ 1511{
1515 int state; 1512 unsigned long flags;
1513 int opstate;
1514
1515 spin_lock_irqsave(&ctrl->lock, flags);
1516 opstate = atomic_xchg(&op->state, FCPOP_STATE_ABORTED);
1517 if (opstate != FCPOP_STATE_ACTIVE)
1518 atomic_set(&op->state, opstate);
1519 else if (ctrl->flags & FCCTRL_TERMIO)
1520 ctrl->iocnt++;
1521 spin_unlock_irqrestore(&ctrl->lock, flags);
1516 1522
1517 state = atomic_xchg(&op->state, FCPOP_STATE_ABORTED); 1523 if (opstate != FCPOP_STATE_ACTIVE)
1518 if (state != FCPOP_STATE_ACTIVE) {
1519 atomic_set(&op->state, state);
1520 return -ECANCELED; 1524 return -ECANCELED;
1521 }
1522 1525
1523 ctrl->lport->ops->fcp_abort(&ctrl->lport->localport, 1526 ctrl->lport->ops->fcp_abort(&ctrl->lport->localport,
1524 &ctrl->rport->remoteport, 1527 &ctrl->rport->remoteport,
@@ -1532,60 +1535,26 @@ static void
1532nvme_fc_abort_aen_ops(struct nvme_fc_ctrl *ctrl) 1535nvme_fc_abort_aen_ops(struct nvme_fc_ctrl *ctrl)
1533{ 1536{
1534 struct nvme_fc_fcp_op *aen_op = ctrl->aen_ops; 1537 struct nvme_fc_fcp_op *aen_op = ctrl->aen_ops;
1535 unsigned long flags; 1538 int i;
1536 int i, ret;
1537
1538 for (i = 0; i < NVME_NR_AEN_COMMANDS; i++, aen_op++) {
1539 if (atomic_read(&aen_op->state) != FCPOP_STATE_ACTIVE)
1540 continue;
1541
1542 spin_lock_irqsave(&ctrl->lock, flags);
1543 if (ctrl->flags & FCCTRL_TERMIO) {
1544 ctrl->iocnt++;
1545 aen_op->flags |= FCOP_FLAGS_TERMIO;
1546 }
1547 spin_unlock_irqrestore(&ctrl->lock, flags);
1548
1549 ret = __nvme_fc_abort_op(ctrl, aen_op);
1550 if (ret) {
1551 /*
1552 * if __nvme_fc_abort_op failed the io wasn't
1553 * active. Thus this call path is running in
1554 * parallel to the io complete. Treat as non-error.
1555 */
1556 1539
1557 /* back out the flags/counters */ 1540 for (i = 0; i < NVME_NR_AEN_COMMANDS; i++, aen_op++)
1558 spin_lock_irqsave(&ctrl->lock, flags); 1541 __nvme_fc_abort_op(ctrl, aen_op);
1559 if (ctrl->flags & FCCTRL_TERMIO)
1560 ctrl->iocnt--;
1561 aen_op->flags &= ~FCOP_FLAGS_TERMIO;
1562 spin_unlock_irqrestore(&ctrl->lock, flags);
1563 return;
1564 }
1565 }
1566} 1542}
1567 1543
1568static inline int 1544static inline void
1569__nvme_fc_fcpop_chk_teardowns(struct nvme_fc_ctrl *ctrl, 1545__nvme_fc_fcpop_chk_teardowns(struct nvme_fc_ctrl *ctrl,
1570 struct nvme_fc_fcp_op *op) 1546 struct nvme_fc_fcp_op *op, int opstate)
1571{ 1547{
1572 unsigned long flags; 1548 unsigned long flags;
1573 bool complete_rq = false;
1574 1549
1575 spin_lock_irqsave(&ctrl->lock, flags); 1550 if (opstate == FCPOP_STATE_ABORTED) {
1576 if (unlikely(op->flags & FCOP_FLAGS_TERMIO)) { 1551 spin_lock_irqsave(&ctrl->lock, flags);
1577 if (ctrl->flags & FCCTRL_TERMIO) { 1552 if (ctrl->flags & FCCTRL_TERMIO) {
1578 if (!--ctrl->iocnt) 1553 if (!--ctrl->iocnt)
1579 wake_up(&ctrl->ioabort_wait); 1554 wake_up(&ctrl->ioabort_wait);
1580 } 1555 }
1556 spin_unlock_irqrestore(&ctrl->lock, flags);
1581 } 1557 }
1582 if (op->flags & FCOP_FLAGS_RELEASED)
1583 complete_rq = true;
1584 else
1585 op->flags |= FCOP_FLAGS_COMPLETE;
1586 spin_unlock_irqrestore(&ctrl->lock, flags);
1587
1588 return complete_rq;
1589} 1558}
1590 1559
1591static void 1560static void
@@ -1601,6 +1570,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
1601 __le16 status = cpu_to_le16(NVME_SC_SUCCESS << 1); 1570 __le16 status = cpu_to_le16(NVME_SC_SUCCESS << 1);
1602 union nvme_result result; 1571 union nvme_result result;
1603 bool terminate_assoc = true; 1572 bool terminate_assoc = true;
1573 int opstate;
1604 1574
1605 /* 1575 /*
1606 * WARNING: 1576 * WARNING:
@@ -1639,11 +1609,12 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
1639 * association to be terminated. 1609 * association to be terminated.
1640 */ 1610 */
1641 1611
1612 opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE);
1613
1642 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma, 1614 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma,
1643 sizeof(op->rsp_iu), DMA_FROM_DEVICE); 1615 sizeof(op->rsp_iu), DMA_FROM_DEVICE);
1644 1616
1645 if (atomic_read(&op->state) == FCPOP_STATE_ABORTED || 1617 if (opstate == FCPOP_STATE_ABORTED)
1646 op->flags & FCOP_FLAGS_TERMIO)
1647 status = cpu_to_le16(NVME_SC_ABORT_REQ << 1); 1618 status = cpu_to_le16(NVME_SC_ABORT_REQ << 1);
1648 else if (freq->status) 1619 else if (freq->status)
1649 status = cpu_to_le16(NVME_SC_INTERNAL << 1); 1620 status = cpu_to_le16(NVME_SC_INTERNAL << 1);
@@ -1708,7 +1679,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
1708done: 1679done:
1709 if (op->flags & FCOP_FLAGS_AEN) { 1680 if (op->flags & FCOP_FLAGS_AEN) {
1710 nvme_complete_async_event(&queue->ctrl->ctrl, status, &result); 1681 nvme_complete_async_event(&queue->ctrl->ctrl, status, &result);
1711 __nvme_fc_fcpop_chk_teardowns(ctrl, op); 1682 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
1712 atomic_set(&op->state, FCPOP_STATE_IDLE); 1683 atomic_set(&op->state, FCPOP_STATE_IDLE);
1713 op->flags = FCOP_FLAGS_AEN; /* clear other flags */ 1684 op->flags = FCOP_FLAGS_AEN; /* clear other flags */
1714 nvme_fc_ctrl_put(ctrl); 1685 nvme_fc_ctrl_put(ctrl);
@@ -1722,13 +1693,11 @@ done:
1722 if (status && 1693 if (status &&
1723 (blk_queue_dying(rq->q) || 1694 (blk_queue_dying(rq->q) ||
1724 ctrl->ctrl.state == NVME_CTRL_NEW || 1695 ctrl->ctrl.state == NVME_CTRL_NEW ||
1725 ctrl->ctrl.state == NVME_CTRL_RECONNECTING)) 1696 ctrl->ctrl.state == NVME_CTRL_CONNECTING))
1726 status |= cpu_to_le16(NVME_SC_DNR << 1); 1697 status |= cpu_to_le16(NVME_SC_DNR << 1);
1727 1698
1728 if (__nvme_fc_fcpop_chk_teardowns(ctrl, op)) 1699 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
1729 __nvme_fc_final_op_cleanup(rq); 1700 nvme_end_request(rq, status, result);
1730 else
1731 nvme_end_request(rq, status, result);
1732 1701
1733check_error: 1702check_error:
1734 if (terminate_assoc) 1703 if (terminate_assoc)
@@ -2415,46 +2384,16 @@ nvme_fc_submit_async_event(struct nvme_ctrl *arg)
2415} 2384}
2416 2385
2417static void 2386static void
2418__nvme_fc_final_op_cleanup(struct request *rq) 2387nvme_fc_complete_rq(struct request *rq)
2419{ 2388{
2420 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq); 2389 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq);
2421 struct nvme_fc_ctrl *ctrl = op->ctrl; 2390 struct nvme_fc_ctrl *ctrl = op->ctrl;
2422 2391
2423 atomic_set(&op->state, FCPOP_STATE_IDLE); 2392 atomic_set(&op->state, FCPOP_STATE_IDLE);
2424 op->flags &= ~(FCOP_FLAGS_TERMIO | FCOP_FLAGS_RELEASED |
2425 FCOP_FLAGS_COMPLETE);
2426 2393
2427 nvme_fc_unmap_data(ctrl, rq, op); 2394 nvme_fc_unmap_data(ctrl, rq, op);
2428 nvme_complete_rq(rq); 2395 nvme_complete_rq(rq);
2429 nvme_fc_ctrl_put(ctrl); 2396 nvme_fc_ctrl_put(ctrl);
2430
2431}
2432
2433static void
2434nvme_fc_complete_rq(struct request *rq)
2435{
2436 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq);
2437 struct nvme_fc_ctrl *ctrl = op->ctrl;
2438 unsigned long flags;
2439 bool completed = false;
2440
2441 /*
2442 * the core layer, on controller resets after calling
2443 * nvme_shutdown_ctrl(), calls complete_rq without our
2444 * calling blk_mq_complete_request(), thus there may still
2445 * be live i/o outstanding with the LLDD. Means transport has
2446 * to track complete calls vs fcpio_done calls to know what
2447 * path to take on completes and dones.
2448 */
2449 spin_lock_irqsave(&ctrl->lock, flags);
2450 if (op->flags & FCOP_FLAGS_COMPLETE)
2451 completed = true;
2452 else
2453 op->flags |= FCOP_FLAGS_RELEASED;
2454 spin_unlock_irqrestore(&ctrl->lock, flags);
2455
2456 if (completed)
2457 __nvme_fc_final_op_cleanup(rq);
2458} 2397}
2459 2398
2460/* 2399/*
@@ -2476,35 +2415,11 @@ nvme_fc_terminate_exchange(struct request *req, void *data, bool reserved)
2476 struct nvme_ctrl *nctrl = data; 2415 struct nvme_ctrl *nctrl = data;
2477 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); 2416 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
2478 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(req); 2417 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(req);
2479 unsigned long flags;
2480 int status;
2481 2418
2482 if (!blk_mq_request_started(req)) 2419 if (!blk_mq_request_started(req))
2483 return; 2420 return;
2484 2421
2485 spin_lock_irqsave(&ctrl->lock, flags); 2422 __nvme_fc_abort_op(ctrl, op);
2486 if (ctrl->flags & FCCTRL_TERMIO) {
2487 ctrl->iocnt++;
2488 op->flags |= FCOP_FLAGS_TERMIO;
2489 }
2490 spin_unlock_irqrestore(&ctrl->lock, flags);
2491
2492 status = __nvme_fc_abort_op(ctrl, op);
2493 if (status) {
2494 /*
2495 * if __nvme_fc_abort_op failed the io wasn't
2496 * active. Thus this call path is running in
2497 * parallel to the io complete. Treat as non-error.
2498 */
2499
2500 /* back out the flags/counters */
2501 spin_lock_irqsave(&ctrl->lock, flags);
2502 if (ctrl->flags & FCCTRL_TERMIO)
2503 ctrl->iocnt--;
2504 op->flags &= ~FCOP_FLAGS_TERMIO;
2505 spin_unlock_irqrestore(&ctrl->lock, flags);
2506 return;
2507 }
2508} 2423}
2509 2424
2510 2425
@@ -2943,7 +2858,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status)
2943 unsigned long recon_delay = ctrl->ctrl.opts->reconnect_delay * HZ; 2858 unsigned long recon_delay = ctrl->ctrl.opts->reconnect_delay * HZ;
2944 bool recon = true; 2859 bool recon = true;
2945 2860
2946 if (ctrl->ctrl.state != NVME_CTRL_RECONNECTING) 2861 if (ctrl->ctrl.state != NVME_CTRL_CONNECTING)
2947 return; 2862 return;
2948 2863
2949 if (portptr->port_state == FC_OBJSTATE_ONLINE) 2864 if (portptr->port_state == FC_OBJSTATE_ONLINE)
@@ -2991,10 +2906,10 @@ nvme_fc_reset_ctrl_work(struct work_struct *work)
2991 /* will block will waiting for io to terminate */ 2906 /* will block will waiting for io to terminate */
2992 nvme_fc_delete_association(ctrl); 2907 nvme_fc_delete_association(ctrl);
2993 2908
2994 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RECONNECTING)) { 2909 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
2995 dev_err(ctrl->ctrl.device, 2910 dev_err(ctrl->ctrl.device,
2996 "NVME-FC{%d}: error_recovery: Couldn't change state " 2911 "NVME-FC{%d}: error_recovery: Couldn't change state "
2997 "to RECONNECTING\n", ctrl->cnum); 2912 "to CONNECTING\n", ctrl->cnum);
2998 return; 2913 return;
2999 } 2914 }
3000 2915
@@ -3195,7 +3110,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
3195 * transport errors (frame drop, LS failure) inherently must kill 3110 * transport errors (frame drop, LS failure) inherently must kill
3196 * the association. The transport is coded so that any command used 3111 * the association. The transport is coded so that any command used
3197 * to create the association (prior to a LIVE state transition 3112 * to create the association (prior to a LIVE state transition
3198 * while NEW or RECONNECTING) will fail if it completes in error or 3113 * while NEW or CONNECTING) will fail if it completes in error or
3199 * times out. 3114 * times out.
3200 * 3115 *
3201 * As such: as the connect request was mostly likely due to a 3116 * As such: as the connect request was mostly likely due to a
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 3b211d9e58b8..b7e5c6db4d92 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -198,11 +198,16 @@ void nvme_mpath_add_disk(struct nvme_ns_head *head)
198{ 198{
199 if (!head->disk) 199 if (!head->disk)
200 return; 200 return;
201 device_add_disk(&head->subsys->dev, head->disk); 201
202 if (sysfs_create_group(&disk_to_dev(head->disk)->kobj, 202 mutex_lock(&head->subsys->lock);
203 &nvme_ns_id_attr_group)) 203 if (!(head->disk->flags & GENHD_FL_UP)) {
204 pr_warn("%s: failed to create sysfs group for identification\n", 204 device_add_disk(&head->subsys->dev, head->disk);
205 head->disk->disk_name); 205 if (sysfs_create_group(&disk_to_dev(head->disk)->kobj,
206 &nvme_ns_id_attr_group))
207 pr_warn("%s: failed to create sysfs group for identification\n",
208 head->disk->disk_name);
209 }
210 mutex_unlock(&head->subsys->lock);
206} 211}
207 212
208void nvme_mpath_add_disk_links(struct nvme_ns *ns) 213void nvme_mpath_add_disk_links(struct nvme_ns *ns)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 8e4550fa08f8..0521e4707d1c 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -123,7 +123,7 @@ enum nvme_ctrl_state {
123 NVME_CTRL_LIVE, 123 NVME_CTRL_LIVE,
124 NVME_CTRL_ADMIN_ONLY, /* Only admin queue live */ 124 NVME_CTRL_ADMIN_ONLY, /* Only admin queue live */
125 NVME_CTRL_RESETTING, 125 NVME_CTRL_RESETTING,
126 NVME_CTRL_RECONNECTING, 126 NVME_CTRL_CONNECTING,
127 NVME_CTRL_DELETING, 127 NVME_CTRL_DELETING,
128 NVME_CTRL_DEAD, 128 NVME_CTRL_DEAD,
129}; 129};
@@ -183,6 +183,7 @@ struct nvme_ctrl {
183 struct work_struct scan_work; 183 struct work_struct scan_work;
184 struct work_struct async_event_work; 184 struct work_struct async_event_work;
185 struct delayed_work ka_work; 185 struct delayed_work ka_work;
186 struct nvme_command ka_cmd;
186 struct work_struct fw_act_work; 187 struct work_struct fw_act_work;
187 188
188 /* Power saving configuration */ 189 /* Power saving configuration */
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 6fe7af00a1f4..5933a5c732e8 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1141,7 +1141,7 @@ static bool nvme_should_reset(struct nvme_dev *dev, u32 csts)
1141 /* If there is a reset/reinit ongoing, we shouldn't reset again. */ 1141 /* If there is a reset/reinit ongoing, we shouldn't reset again. */
1142 switch (dev->ctrl.state) { 1142 switch (dev->ctrl.state) {
1143 case NVME_CTRL_RESETTING: 1143 case NVME_CTRL_RESETTING:
1144 case NVME_CTRL_RECONNECTING: 1144 case NVME_CTRL_CONNECTING:
1145 return false; 1145 return false;
1146 default: 1146 default:
1147 break; 1147 break;
@@ -1215,13 +1215,17 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
1215 * cancellation error. All outstanding requests are completed on 1215 * cancellation error. All outstanding requests are completed on
1216 * shutdown, so we return BLK_EH_HANDLED. 1216 * shutdown, so we return BLK_EH_HANDLED.
1217 */ 1217 */
1218 if (dev->ctrl.state == NVME_CTRL_RESETTING) { 1218 switch (dev->ctrl.state) {
1219 case NVME_CTRL_CONNECTING:
1220 case NVME_CTRL_RESETTING:
1219 dev_warn(dev->ctrl.device, 1221 dev_warn(dev->ctrl.device,
1220 "I/O %d QID %d timeout, disable controller\n", 1222 "I/O %d QID %d timeout, disable controller\n",
1221 req->tag, nvmeq->qid); 1223 req->tag, nvmeq->qid);
1222 nvme_dev_disable(dev, false); 1224 nvme_dev_disable(dev, false);
1223 nvme_req(req)->flags |= NVME_REQ_CANCELLED; 1225 nvme_req(req)->flags |= NVME_REQ_CANCELLED;
1224 return BLK_EH_HANDLED; 1226 return BLK_EH_HANDLED;
1227 default:
1228 break;
1225 } 1229 }
1226 1230
1227 /* 1231 /*
@@ -1364,18 +1368,14 @@ static int nvme_cmb_qdepth(struct nvme_dev *dev, int nr_io_queues,
1364static int nvme_alloc_sq_cmds(struct nvme_dev *dev, struct nvme_queue *nvmeq, 1368static int nvme_alloc_sq_cmds(struct nvme_dev *dev, struct nvme_queue *nvmeq,
1365 int qid, int depth) 1369 int qid, int depth)
1366{ 1370{
1367 if (qid && dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) { 1371 /* CMB SQEs will be mapped before creation */
1368 unsigned offset = (qid - 1) * roundup(SQ_SIZE(depth), 1372 if (qid && dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS))
1369 dev->ctrl.page_size); 1373 return 0;
1370 nvmeq->sq_dma_addr = dev->cmb_bus_addr + offset;
1371 nvmeq->sq_cmds_io = dev->cmb + offset;
1372 } else {
1373 nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(depth),
1374 &nvmeq->sq_dma_addr, GFP_KERNEL);
1375 if (!nvmeq->sq_cmds)
1376 return -ENOMEM;
1377 }
1378 1374
1375 nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(depth),
1376 &nvmeq->sq_dma_addr, GFP_KERNEL);
1377 if (!nvmeq->sq_cmds)
1378 return -ENOMEM;
1379 return 0; 1379 return 0;
1380} 1380}
1381 1381
@@ -1449,10 +1449,17 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
1449 struct nvme_dev *dev = nvmeq->dev; 1449 struct nvme_dev *dev = nvmeq->dev;
1450 int result; 1450 int result;
1451 1451
1452 if (dev->cmb && use_cmb_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) {
1453 unsigned offset = (qid - 1) * roundup(SQ_SIZE(nvmeq->q_depth),
1454 dev->ctrl.page_size);
1455 nvmeq->sq_dma_addr = dev->cmb_bus_addr + offset;
1456 nvmeq->sq_cmds_io = dev->cmb + offset;
1457 }
1458
1452 nvmeq->cq_vector = qid - 1; 1459 nvmeq->cq_vector = qid - 1;
1453 result = adapter_alloc_cq(dev, qid, nvmeq); 1460 result = adapter_alloc_cq(dev, qid, nvmeq);
1454 if (result < 0) 1461 if (result < 0)
1455 return result; 1462 goto release_vector;
1456 1463
1457 result = adapter_alloc_sq(dev, qid, nvmeq); 1464 result = adapter_alloc_sq(dev, qid, nvmeq);
1458 if (result < 0) 1465 if (result < 0)
@@ -1466,9 +1473,12 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
1466 return result; 1473 return result;
1467 1474
1468 release_sq: 1475 release_sq:
1476 dev->online_queues--;
1469 adapter_delete_sq(dev, qid); 1477 adapter_delete_sq(dev, qid);
1470 release_cq: 1478 release_cq:
1471 adapter_delete_cq(dev, qid); 1479 adapter_delete_cq(dev, qid);
1480 release_vector:
1481 nvmeq->cq_vector = -1;
1472 return result; 1482 return result;
1473} 1483}
1474 1484
@@ -2288,12 +2298,12 @@ static void nvme_reset_work(struct work_struct *work)
2288 nvme_dev_disable(dev, false); 2298 nvme_dev_disable(dev, false);
2289 2299
2290 /* 2300 /*
2291 * Introduce RECONNECTING state from nvme-fc/rdma transports to mark the 2301 * Introduce CONNECTING state from nvme-fc/rdma transports to mark the
2292 * initializing procedure here. 2302 * initializing procedure here.
2293 */ 2303 */
2294 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RECONNECTING)) { 2304 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_CONNECTING)) {
2295 dev_warn(dev->ctrl.device, 2305 dev_warn(dev->ctrl.device,
2296 "failed to mark controller RECONNECTING\n"); 2306 "failed to mark controller CONNECTING\n");
2297 goto out; 2307 goto out;
2298 } 2308 }
2299 2309
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 2bc059f7d73c..4d84a73ee12d 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -887,7 +887,7 @@ free_ctrl:
887static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl) 887static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl)
888{ 888{
889 /* If we are resetting/deleting then do nothing */ 889 /* If we are resetting/deleting then do nothing */
890 if (ctrl->ctrl.state != NVME_CTRL_RECONNECTING) { 890 if (ctrl->ctrl.state != NVME_CTRL_CONNECTING) {
891 WARN_ON_ONCE(ctrl->ctrl.state == NVME_CTRL_NEW || 891 WARN_ON_ONCE(ctrl->ctrl.state == NVME_CTRL_NEW ||
892 ctrl->ctrl.state == NVME_CTRL_LIVE); 892 ctrl->ctrl.state == NVME_CTRL_LIVE);
893 return; 893 return;
@@ -973,7 +973,7 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work)
973 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); 973 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
974 nvme_start_queues(&ctrl->ctrl); 974 nvme_start_queues(&ctrl->ctrl);
975 975
976 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RECONNECTING)) { 976 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
977 /* state change failure should never happen */ 977 /* state change failure should never happen */
978 WARN_ON_ONCE(1); 978 WARN_ON_ONCE(1);
979 return; 979 return;
@@ -1051,7 +1051,7 @@ static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue,
1051 struct nvme_rdma_device *dev = queue->device; 1051 struct nvme_rdma_device *dev = queue->device;
1052 struct ib_device *ibdev = dev->dev; 1052 struct ib_device *ibdev = dev->dev;
1053 1053
1054 if (!blk_rq_bytes(rq)) 1054 if (!blk_rq_payload_bytes(rq))
1055 return; 1055 return;
1056 1056
1057 if (req->mr) { 1057 if (req->mr) {
@@ -1166,7 +1166,7 @@ static int nvme_rdma_map_data(struct nvme_rdma_queue *queue,
1166 1166
1167 c->common.flags |= NVME_CMD_SGL_METABUF; 1167 c->common.flags |= NVME_CMD_SGL_METABUF;
1168 1168
1169 if (!blk_rq_bytes(rq)) 1169 if (!blk_rq_payload_bytes(rq))
1170 return nvme_rdma_set_sg_null(c); 1170 return nvme_rdma_set_sg_null(c);
1171 1171
1172 req->sg_table.sgl = req->first_sgl; 1172 req->sg_table.sgl = req->first_sgl;
@@ -1756,7 +1756,7 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
1756 nvme_stop_ctrl(&ctrl->ctrl); 1756 nvme_stop_ctrl(&ctrl->ctrl);
1757 nvme_rdma_shutdown_ctrl(ctrl, false); 1757 nvme_rdma_shutdown_ctrl(ctrl, false);
1758 1758
1759 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RECONNECTING)) { 1759 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
1760 /* state change failure should never happen */ 1760 /* state change failure should never happen */
1761 WARN_ON_ONCE(1); 1761 WARN_ON_ONCE(1);
1762 return; 1762 return;
@@ -1784,11 +1784,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
1784 return; 1784 return;
1785 1785
1786out_fail: 1786out_fail:
1787 dev_warn(ctrl->ctrl.device, "Removing after reset failure\n"); 1787 ++ctrl->ctrl.nr_reconnects;
1788 nvme_remove_namespaces(&ctrl->ctrl); 1788 nvme_rdma_reconnect_or_remove(ctrl);
1789 nvme_rdma_shutdown_ctrl(ctrl, true);
1790 nvme_uninit_ctrl(&ctrl->ctrl);
1791 nvme_put_ctrl(&ctrl->ctrl);
1792} 1789}
1793 1790
1794static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = { 1791static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
@@ -1942,6 +1939,9 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
1942 if (!ctrl->queues) 1939 if (!ctrl->queues)
1943 goto out_uninit_ctrl; 1940 goto out_uninit_ctrl;
1944 1941
1942 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING);
1943 WARN_ON_ONCE(!changed);
1944
1945 ret = nvme_rdma_configure_admin_queue(ctrl, true); 1945 ret = nvme_rdma_configure_admin_queue(ctrl, true);
1946 if (ret) 1946 if (ret)
1947 goto out_kfree_queues; 1947 goto out_kfree_queues;
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 0bd737117a80..a78029e4e5f4 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -520,9 +520,12 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
520 goto fail; 520 goto fail;
521 } 521 }
522 522
523 /* either variant of SGLs is fine, as we don't support metadata */ 523 /*
524 if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF && 524 * For fabrics, PSDT field shall describe metadata pointer (MPTR) that
525 (flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METASEG)) { 525 * contains an address of a single contiguous physical buffer that is
526 * byte aligned.
527 */
528 if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF)) {
526 status = NVME_SC_INVALID_FIELD | NVME_SC_DNR; 529 status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
527 goto fail; 530 goto fail;
528 } 531 }
diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c
index 0a4372a016f2..28bbdff4a88b 100644
--- a/drivers/nvme/target/io-cmd.c
+++ b/drivers/nvme/target/io-cmd.c
@@ -105,10 +105,13 @@ static void nvmet_execute_flush(struct nvmet_req *req)
105static u16 nvmet_discard_range(struct nvmet_ns *ns, 105static u16 nvmet_discard_range(struct nvmet_ns *ns,
106 struct nvme_dsm_range *range, struct bio **bio) 106 struct nvme_dsm_range *range, struct bio **bio)
107{ 107{
108 if (__blkdev_issue_discard(ns->bdev, 108 int ret;
109
110 ret = __blkdev_issue_discard(ns->bdev,
109 le64_to_cpu(range->slba) << (ns->blksize_shift - 9), 111 le64_to_cpu(range->slba) << (ns->blksize_shift - 9),
110 le32_to_cpu(range->nlb) << (ns->blksize_shift - 9), 112 le32_to_cpu(range->nlb) << (ns->blksize_shift - 9),
111 GFP_KERNEL, 0, bio)) 113 GFP_KERNEL, 0, bio);
114 if (ret && ret != -EOPNOTSUPP)
112 return NVME_SC_INTERNAL | NVME_SC_DNR; 115 return NVME_SC_INTERNAL | NVME_SC_DNR;
113 return 0; 116 return 0;
114} 117}
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 7991ec3a17db..861d1509b22b 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -184,7 +184,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
184 return BLK_STS_OK; 184 return BLK_STS_OK;
185 } 185 }
186 186
187 if (blk_rq_bytes(req)) { 187 if (blk_rq_payload_bytes(req)) {
188 iod->sg_table.sgl = iod->first_sgl; 188 iod->sg_table.sgl = iod->first_sgl;
189 if (sg_alloc_table_chained(&iod->sg_table, 189 if (sg_alloc_table_chained(&iod->sg_table,
190 blk_rq_nr_phys_segments(req), 190 blk_rq_nr_phys_segments(req),
@@ -193,7 +193,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
193 193
194 iod->req.sg = iod->sg_table.sgl; 194 iod->req.sg = iod->sg_table.sgl;
195 iod->req.sg_cnt = blk_rq_map_sg(req->q, req, iod->sg_table.sgl); 195 iod->req.sg_cnt = blk_rq_map_sg(req->q, req, iod->sg_table.sgl);
196 iod->req.transfer_len = blk_rq_bytes(req); 196 iod->req.transfer_len = blk_rq_payload_bytes(req);
197 } 197 }
198 198
199 blk_mq_start_request(req); 199 blk_mq_start_request(req);
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 36ed84e26d9c..f46828e3b082 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -977,11 +977,11 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
977 return 0; 977 return 0;
978} 978}
979 979
980static void * 980static const void *
981of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, 981of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
982 const struct device *dev) 982 const struct device *dev)
983{ 983{
984 return (void *)of_device_get_match_data(dev); 984 return of_device_get_match_data(dev);
985} 985}
986 986
987const struct fwnode_operations of_fwnode_ops = { 987const struct fwnode_operations of_fwnode_ops = {
diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c
index 2d87bc1adf38..0c0910709435 100644
--- a/drivers/opp/cpu.c
+++ b/drivers/opp/cpu.c
@@ -55,7 +55,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
55 if (max_opps <= 0) 55 if (max_opps <= 0)
56 return max_opps ? max_opps : -ENODATA; 56 return max_opps ? max_opps : -ENODATA;
57 57
58 freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC); 58 freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL);
59 if (!freq_table) 59 if (!freq_table)
60 return -ENOMEM; 60 return -ENOMEM;
61 61
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index fc734014206f..8b14bd326d4a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3419,22 +3419,29 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PORT_RIDGE,
3419 3419
3420static void quirk_chelsio_extend_vpd(struct pci_dev *dev) 3420static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
3421{ 3421{
3422 pci_set_vpd_size(dev, 8192); 3422 int chip = (dev->device & 0xf000) >> 12;
3423} 3423 int func = (dev->device & 0x0f00) >> 8;
3424 3424 int prod = (dev->device & 0x00ff) >> 0;
3425DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x20, quirk_chelsio_extend_vpd); 3425
3426DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x21, quirk_chelsio_extend_vpd); 3426 /*
3427DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x22, quirk_chelsio_extend_vpd); 3427 * If this is a T3-based adapter, there's a 1KB VPD area at offset
3428DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x23, quirk_chelsio_extend_vpd); 3428 * 0xc00 which contains the preferred VPD values. If this is a T4 or
3429DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x24, quirk_chelsio_extend_vpd); 3429 * later based adapter, the special VPD is at offset 0x400 for the
3430DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x25, quirk_chelsio_extend_vpd); 3430 * Physical Functions (the SR-IOV Virtual Functions have no VPD
3431DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x26, quirk_chelsio_extend_vpd); 3431 * Capabilities). The PCI VPD Access core routines will normally
3432DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x30, quirk_chelsio_extend_vpd); 3432 * compute the size of the VPD by parsing the VPD Data Structure at
3433DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x31, quirk_chelsio_extend_vpd); 3433 * offset 0x000. This will result in silent failures when attempting
3434DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x32, quirk_chelsio_extend_vpd); 3434 * to accesses these other VPD areas which are beyond those computed
3435DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x35, quirk_chelsio_extend_vpd); 3435 * limits.
3436DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x36, quirk_chelsio_extend_vpd); 3436 */
3437DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x37, quirk_chelsio_extend_vpd); 3437 if (chip == 0x0 && prod >= 0x20)
3438 pci_set_vpd_size(dev, 8192);
3439 else if (chip >= 0x4 && func < 0x8)
3440 pci_set_vpd_size(dev, 2048);
3441}
3442
3443DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
3444 quirk_chelsio_extend_vpd);
3438 3445
3439#ifdef CONFIG_ACPI 3446#ifdef CONFIG_ACPI
3440/* 3447/*
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 369d48d6c6f1..365447240d95 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -401,6 +401,10 @@ void pci_release_resource(struct pci_dev *dev, int resno)
401 struct resource *res = dev->resource + resno; 401 struct resource *res = dev->resource + resno;
402 402
403 pci_info(dev, "BAR %d: releasing %pR\n", resno, res); 403 pci_info(dev, "BAR %d: releasing %pR\n", resno, res);
404
405 if (!res->parent)
406 return;
407
404 release_resource(res); 408 release_resource(res);
405 res->end = resource_size(res) - 1; 409 res->end = resource_size(res) - 1;
406 res->start = 0; 410 res->start = 0;
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 7bc5eee96b31..0c2ed11c0603 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -17,7 +17,6 @@
17#include <linux/export.h> 17#include <linux/export.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/perf/arm_pmu.h> 19#include <linux/perf/arm_pmu.h>
20#include <linux/platform_device.h>
21#include <linux/slab.h> 20#include <linux/slab.h>
22#include <linux/sched/clock.h> 21#include <linux/sched/clock.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
@@ -26,6 +25,9 @@
26 25
27#include <asm/irq_regs.h> 26#include <asm/irq_regs.h>
28 27
28static DEFINE_PER_CPU(struct arm_pmu *, cpu_armpmu);
29static DEFINE_PER_CPU(int, cpu_irq);
30
29static int 31static int
30armpmu_map_cache_event(const unsigned (*cache_map) 32armpmu_map_cache_event(const unsigned (*cache_map)
31 [PERF_COUNT_HW_CACHE_MAX] 33 [PERF_COUNT_HW_CACHE_MAX]
@@ -320,17 +322,9 @@ validate_group(struct perf_event *event)
320 return 0; 322 return 0;
321} 323}
322 324
323static struct arm_pmu_platdata *armpmu_get_platdata(struct arm_pmu *armpmu)
324{
325 struct platform_device *pdev = armpmu->plat_device;
326
327 return pdev ? dev_get_platdata(&pdev->dev) : NULL;
328}
329
330static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) 325static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
331{ 326{
332 struct arm_pmu *armpmu; 327 struct arm_pmu *armpmu;
333 struct arm_pmu_platdata *plat;
334 int ret; 328 int ret;
335 u64 start_clock, finish_clock; 329 u64 start_clock, finish_clock;
336 330
@@ -341,14 +335,11 @@ static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
341 * dereference. 335 * dereference.
342 */ 336 */
343 armpmu = *(void **)dev; 337 armpmu = *(void **)dev;
344 338 if (WARN_ON_ONCE(!armpmu))
345 plat = armpmu_get_platdata(armpmu); 339 return IRQ_NONE;
346 340
347 start_clock = sched_clock(); 341 start_clock = sched_clock();
348 if (plat && plat->handle_irq) 342 ret = armpmu->handle_irq(irq, armpmu);
349 ret = plat->handle_irq(irq, armpmu, armpmu->handle_irq);
350 else
351 ret = armpmu->handle_irq(irq, armpmu);
352 finish_clock = sched_clock(); 343 finish_clock = sched_clock();
353 344
354 perf_sample_event_took(finish_clock - start_clock); 345 perf_sample_event_took(finish_clock - start_clock);
@@ -531,54 +522,41 @@ int perf_num_counters(void)
531} 522}
532EXPORT_SYMBOL_GPL(perf_num_counters); 523EXPORT_SYMBOL_GPL(perf_num_counters);
533 524
534void armpmu_free_irq(struct arm_pmu *armpmu, int cpu) 525static int armpmu_count_irq_users(const int irq)
535{ 526{
536 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events; 527 int cpu, count = 0;
537 int irq = per_cpu(hw_events->irq, cpu);
538 528
539 if (!cpumask_test_and_clear_cpu(cpu, &armpmu->active_irqs)) 529 for_each_possible_cpu(cpu) {
540 return; 530 if (per_cpu(cpu_irq, cpu) == irq)
541 531 count++;
542 if (irq_is_percpu_devid(irq)) {
543 free_percpu_irq(irq, &hw_events->percpu_pmu);
544 cpumask_clear(&armpmu->active_irqs);
545 return;
546 } 532 }
547 533
548 free_irq(irq, per_cpu_ptr(&hw_events->percpu_pmu, cpu)); 534 return count;
549} 535}
550 536
551void armpmu_free_irqs(struct arm_pmu *armpmu) 537void armpmu_free_irq(int irq, int cpu)
552{ 538{
553 int cpu; 539 if (per_cpu(cpu_irq, cpu) == 0)
540 return;
541 if (WARN_ON(irq != per_cpu(cpu_irq, cpu)))
542 return;
543
544 if (!irq_is_percpu_devid(irq))
545 free_irq(irq, per_cpu_ptr(&cpu_armpmu, cpu));
546 else if (armpmu_count_irq_users(irq) == 1)
547 free_percpu_irq(irq, &cpu_armpmu);
554 548
555 for_each_cpu(cpu, &armpmu->supported_cpus) 549 per_cpu(cpu_irq, cpu) = 0;
556 armpmu_free_irq(armpmu, cpu);
557} 550}
558 551
559int armpmu_request_irq(struct arm_pmu *armpmu, int cpu) 552int armpmu_request_irq(int irq, int cpu)
560{ 553{
561 int err = 0; 554 int err = 0;
562 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events;
563 const irq_handler_t handler = armpmu_dispatch_irq; 555 const irq_handler_t handler = armpmu_dispatch_irq;
564 int irq = per_cpu(hw_events->irq, cpu);
565 if (!irq) 556 if (!irq)
566 return 0; 557 return 0;
567 558
568 if (irq_is_percpu_devid(irq) && cpumask_empty(&armpmu->active_irqs)) { 559 if (!irq_is_percpu_devid(irq)) {
569 err = request_percpu_irq(irq, handler, "arm-pmu",
570 &hw_events->percpu_pmu);
571 } else if (irq_is_percpu_devid(irq)) {
572 int other_cpu = cpumask_first(&armpmu->active_irqs);
573 int other_irq = per_cpu(hw_events->irq, other_cpu);
574
575 if (irq != other_irq) {
576 pr_warn("mismatched PPIs detected.\n");
577 err = -EINVAL;
578 goto err_out;
579 }
580 } else {
581 struct arm_pmu_platdata *platdata = armpmu_get_platdata(armpmu);
582 unsigned long irq_flags; 560 unsigned long irq_flags;
583 561
584 err = irq_force_affinity(irq, cpumask_of(cpu)); 562 err = irq_force_affinity(irq, cpumask_of(cpu));
@@ -589,22 +567,22 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
589 goto err_out; 567 goto err_out;
590 } 568 }
591 569
592 if (platdata && platdata->irq_flags) { 570 irq_flags = IRQF_PERCPU |
593 irq_flags = platdata->irq_flags; 571 IRQF_NOBALANCING |
594 } else { 572 IRQF_NO_THREAD;
595 irq_flags = IRQF_PERCPU |
596 IRQF_NOBALANCING |
597 IRQF_NO_THREAD;
598 }
599 573
574 irq_set_status_flags(irq, IRQ_NOAUTOEN);
600 err = request_irq(irq, handler, irq_flags, "arm-pmu", 575 err = request_irq(irq, handler, irq_flags, "arm-pmu",
601 per_cpu_ptr(&hw_events->percpu_pmu, cpu)); 576 per_cpu_ptr(&cpu_armpmu, cpu));
577 } else if (armpmu_count_irq_users(irq) == 0) {
578 err = request_percpu_irq(irq, handler, "arm-pmu",
579 &cpu_armpmu);
602 } 580 }
603 581
604 if (err) 582 if (err)
605 goto err_out; 583 goto err_out;
606 584
607 cpumask_set_cpu(cpu, &armpmu->active_irqs); 585 per_cpu(cpu_irq, cpu) = irq;
608 return 0; 586 return 0;
609 587
610err_out: 588err_out:
@@ -612,19 +590,6 @@ err_out:
612 return err; 590 return err;
613} 591}
614 592
615int armpmu_request_irqs(struct arm_pmu *armpmu)
616{
617 int cpu, err;
618
619 for_each_cpu(cpu, &armpmu->supported_cpus) {
620 err = armpmu_request_irq(armpmu, cpu);
621 if (err)
622 break;
623 }
624
625 return err;
626}
627
628static int armpmu_get_cpu_irq(struct arm_pmu *pmu, int cpu) 593static int armpmu_get_cpu_irq(struct arm_pmu *pmu, int cpu)
629{ 594{
630 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; 595 struct pmu_hw_events __percpu *hw_events = pmu->hw_events;
@@ -647,12 +612,14 @@ static int arm_perf_starting_cpu(unsigned int cpu, struct hlist_node *node)
647 if (pmu->reset) 612 if (pmu->reset)
648 pmu->reset(pmu); 613 pmu->reset(pmu);
649 614
615 per_cpu(cpu_armpmu, cpu) = pmu;
616
650 irq = armpmu_get_cpu_irq(pmu, cpu); 617 irq = armpmu_get_cpu_irq(pmu, cpu);
651 if (irq) { 618 if (irq) {
652 if (irq_is_percpu_devid(irq)) { 619 if (irq_is_percpu_devid(irq))
653 enable_percpu_irq(irq, IRQ_TYPE_NONE); 620 enable_percpu_irq(irq, IRQ_TYPE_NONE);
654 return 0; 621 else
655 } 622 enable_irq(irq);
656 } 623 }
657 624
658 return 0; 625 return 0;
@@ -667,8 +634,14 @@ static int arm_perf_teardown_cpu(unsigned int cpu, struct hlist_node *node)
667 return 0; 634 return 0;
668 635
669 irq = armpmu_get_cpu_irq(pmu, cpu); 636 irq = armpmu_get_cpu_irq(pmu, cpu);
670 if (irq && irq_is_percpu_devid(irq)) 637 if (irq) {
671 disable_percpu_irq(irq); 638 if (irq_is_percpu_devid(irq))
639 disable_percpu_irq(irq);
640 else
641 disable_irq(irq);
642 }
643
644 per_cpu(cpu_armpmu, cpu) = NULL;
672 645
673 return 0; 646 return 0;
674} 647}
@@ -800,18 +773,18 @@ static void cpu_pmu_destroy(struct arm_pmu *cpu_pmu)
800 &cpu_pmu->node); 773 &cpu_pmu->node);
801} 774}
802 775
803struct arm_pmu *armpmu_alloc(void) 776static struct arm_pmu *__armpmu_alloc(gfp_t flags)
804{ 777{
805 struct arm_pmu *pmu; 778 struct arm_pmu *pmu;
806 int cpu; 779 int cpu;
807 780
808 pmu = kzalloc(sizeof(*pmu), GFP_KERNEL); 781 pmu = kzalloc(sizeof(*pmu), flags);
809 if (!pmu) { 782 if (!pmu) {
810 pr_info("failed to allocate PMU device!\n"); 783 pr_info("failed to allocate PMU device!\n");
811 goto out; 784 goto out;
812 } 785 }
813 786
814 pmu->hw_events = alloc_percpu(struct pmu_hw_events); 787 pmu->hw_events = alloc_percpu_gfp(struct pmu_hw_events, flags);
815 if (!pmu->hw_events) { 788 if (!pmu->hw_events) {
816 pr_info("failed to allocate per-cpu PMU data.\n"); 789 pr_info("failed to allocate per-cpu PMU data.\n");
817 goto out_free_pmu; 790 goto out_free_pmu;
@@ -857,6 +830,17 @@ out:
857 return NULL; 830 return NULL;
858} 831}
859 832
833struct arm_pmu *armpmu_alloc(void)
834{
835 return __armpmu_alloc(GFP_KERNEL);
836}
837
838struct arm_pmu *armpmu_alloc_atomic(void)
839{
840 return __armpmu_alloc(GFP_ATOMIC);
841}
842
843
860void armpmu_free(struct arm_pmu *pmu) 844void armpmu_free(struct arm_pmu *pmu)
861{ 845{
862 free_percpu(pmu->hw_events); 846 free_percpu(pmu->hw_events);
diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c
index 705f1a390e31..0f197516d708 100644
--- a/drivers/perf/arm_pmu_acpi.c
+++ b/drivers/perf/arm_pmu_acpi.c
@@ -11,6 +11,8 @@
11#include <linux/acpi.h> 11#include <linux/acpi.h>
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/irq.h>
15#include <linux/irqdesc.h>
14#include <linux/percpu.h> 16#include <linux/percpu.h>
15#include <linux/perf/arm_pmu.h> 17#include <linux/perf/arm_pmu.h>
16 18
@@ -87,7 +89,13 @@ static int arm_pmu_acpi_parse_irqs(void)
87 pr_warn("No ACPI PMU IRQ for CPU%d\n", cpu); 89 pr_warn("No ACPI PMU IRQ for CPU%d\n", cpu);
88 } 90 }
89 91
92 /*
93 * Log and request the IRQ so the core arm_pmu code can manage
94 * it. We'll have to sanity-check IRQs later when we associate
95 * them with their PMUs.
96 */
90 per_cpu(pmu_irqs, cpu) = irq; 97 per_cpu(pmu_irqs, cpu) = irq;
98 armpmu_request_irq(irq, cpu);
91 } 99 }
92 100
93 return 0; 101 return 0;
@@ -127,7 +135,7 @@ static struct arm_pmu *arm_pmu_acpi_find_alloc_pmu(void)
127 return pmu; 135 return pmu;
128 } 136 }
129 137
130 pmu = armpmu_alloc(); 138 pmu = armpmu_alloc_atomic();
131 if (!pmu) { 139 if (!pmu) {
132 pr_warn("Unable to allocate PMU for CPU%d\n", 140 pr_warn("Unable to allocate PMU for CPU%d\n",
133 smp_processor_id()); 141 smp_processor_id());
@@ -140,6 +148,35 @@ static struct arm_pmu *arm_pmu_acpi_find_alloc_pmu(void)
140} 148}
141 149
142/* 150/*
151 * Check whether the new IRQ is compatible with those already associated with
152 * the PMU (e.g. we don't have mismatched PPIs).
153 */
154static bool pmu_irq_matches(struct arm_pmu *pmu, int irq)
155{
156 struct pmu_hw_events __percpu *hw_events = pmu->hw_events;
157 int cpu;
158
159 if (!irq)
160 return true;
161
162 for_each_cpu(cpu, &pmu->supported_cpus) {
163 int other_irq = per_cpu(hw_events->irq, cpu);
164 if (!other_irq)
165 continue;
166
167 if (irq == other_irq)
168 continue;
169 if (!irq_is_percpu_devid(irq) && !irq_is_percpu_devid(other_irq))
170 continue;
171
172 pr_warn("mismatched PPIs detected\n");
173 return false;
174 }
175
176 return true;
177}
178
179/*
143 * This must run before the common arm_pmu hotplug logic, so that we can 180 * This must run before the common arm_pmu hotplug logic, so that we can
144 * associate a CPU and its interrupt before the common code tries to manage the 181 * associate a CPU and its interrupt before the common code tries to manage the
145 * affinity and so on. 182 * affinity and so on.
@@ -164,19 +201,14 @@ static int arm_pmu_acpi_cpu_starting(unsigned int cpu)
164 if (!pmu) 201 if (!pmu)
165 return -ENOMEM; 202 return -ENOMEM;
166 203
167 cpumask_set_cpu(cpu, &pmu->supported_cpus);
168
169 per_cpu(probed_pmus, cpu) = pmu; 204 per_cpu(probed_pmus, cpu) = pmu;
170 205
171 /* 206 if (pmu_irq_matches(pmu, irq)) {
172 * Log and request the IRQ so the core arm_pmu code can manage it. In 207 hw_events = pmu->hw_events;
173 * some situations (e.g. mismatched PPIs), we may fail to request the 208 per_cpu(hw_events->irq, cpu) = irq;
174 * IRQ. However, it may be too late for us to do anything about it. 209 }
175 * The common ARM PMU code will log a warning in this case. 210
176 */ 211 cpumask_set_cpu(cpu, &pmu->supported_cpus);
177 hw_events = pmu->hw_events;
178 per_cpu(hw_events->irq, cpu) = irq;
179 armpmu_request_irq(pmu, cpu);
180 212
181 /* 213 /*
182 * Ideally, we'd probe the PMU here when we find the first matching 214 * Ideally, we'd probe the PMU here when we find the first matching
@@ -247,11 +279,6 @@ static int arm_pmu_acpi_init(void)
247 if (acpi_disabled) 279 if (acpi_disabled)
248 return 0; 280 return 0;
249 281
250 /*
251 * We can't request IRQs yet, since we don't know the cookie value
252 * until we know which CPUs share the same logical PMU. We'll handle
253 * that in arm_pmu_acpi_cpu_starting().
254 */
255 ret = arm_pmu_acpi_parse_irqs(); 282 ret = arm_pmu_acpi_parse_irqs();
256 if (ret) 283 if (ret)
257 return ret; 284 return ret;
diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 46501cc79fd7..7729eda5909d 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -127,13 +127,6 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
127 pdev->dev.of_node); 127 pdev->dev.of_node);
128 } 128 }
129 129
130 /*
131 * Some platforms have all PMU IRQs OR'd into a single IRQ, with a
132 * special platdata function that attempts to demux them.
133 */
134 if (dev_get_platdata(&pdev->dev))
135 cpumask_setall(&pmu->supported_cpus);
136
137 for (i = 0; i < num_irqs; i++) { 130 for (i = 0; i < num_irqs; i++) {
138 int cpu, irq; 131 int cpu, irq;
139 132
@@ -164,6 +157,36 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
164 return 0; 157 return 0;
165} 158}
166 159
160static int armpmu_request_irqs(struct arm_pmu *armpmu)
161{
162 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events;
163 int cpu, err;
164
165 for_each_cpu(cpu, &armpmu->supported_cpus) {
166 int irq = per_cpu(hw_events->irq, cpu);
167 if (!irq)
168 continue;
169
170 err = armpmu_request_irq(irq, cpu);
171 if (err)
172 break;
173 }
174
175 return err;
176}
177
178static void armpmu_free_irqs(struct arm_pmu *armpmu)
179{
180 int cpu;
181 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events;
182
183 for_each_cpu(cpu, &armpmu->supported_cpus) {
184 int irq = per_cpu(hw_events->irq, cpu);
185
186 armpmu_free_irq(irq, cpu);
187 }
188}
189
167int arm_pmu_device_probe(struct platform_device *pdev, 190int arm_pmu_device_probe(struct platform_device *pdev,
168 const struct of_device_id *of_table, 191 const struct of_device_id *of_table,
169 const struct pmu_probe_info *probe_table) 192 const struct pmu_probe_info *probe_table)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c
index 1fda9d6c7ea3..4b91ff74779b 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-axg.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c
@@ -716,7 +716,7 @@ static const char * const uart_b_groups[] = {
716 "uart_tx_b_x", "uart_rx_b_x", "uart_cts_b_x", "uart_rts_b_x", 716 "uart_tx_b_x", "uart_rx_b_x", "uart_cts_b_x", "uart_rts_b_x",
717}; 717};
718 718
719static const char * const uart_ao_b_gpioz_groups[] = { 719static const char * const uart_ao_b_z_groups[] = {
720 "uart_ao_tx_b_z", "uart_ao_rx_b_z", 720 "uart_ao_tx_b_z", "uart_ao_rx_b_z",
721 "uart_ao_cts_b_z", "uart_ao_rts_b_z", 721 "uart_ao_cts_b_z", "uart_ao_rts_b_z",
722}; 722};
@@ -855,7 +855,7 @@ static struct meson_pmx_func meson_axg_periphs_functions[] = {
855 FUNCTION(nand), 855 FUNCTION(nand),
856 FUNCTION(uart_a), 856 FUNCTION(uart_a),
857 FUNCTION(uart_b), 857 FUNCTION(uart_b),
858 FUNCTION(uart_ao_b_gpioz), 858 FUNCTION(uart_ao_b_z),
859 FUNCTION(i2c0), 859 FUNCTION(i2c0),
860 FUNCTION(i2c1), 860 FUNCTION(i2c1),
861 FUNCTION(i2c2), 861 FUNCTION(i2c2),
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 2a68f59d2228..c52c6723374b 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -127,24 +127,6 @@ static const struct dmi_system_id dell_device_table[] __initconst = {
127 }, 127 },
128 }, 128 },
129 { 129 {
130 .matches = {
131 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
132 DMI_MATCH(DMI_CHASSIS_TYPE, "30"), /*Tablet*/
133 },
134 },
135 {
136 .matches = {
137 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
138 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /*Convertible*/
139 },
140 },
141 {
142 .matches = {
143 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
144 DMI_MATCH(DMI_CHASSIS_TYPE, "32"), /*Detachable*/
145 },
146 },
147 {
148 .ident = "Dell Computer Corporation", 130 .ident = "Dell Computer Corporation",
149 .matches = { 131 .matches = {
150 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), 132 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
@@ -1279,7 +1261,7 @@ static int kbd_get_state(struct kbd_state *state)
1279 struct calling_interface_buffer buffer; 1261 struct calling_interface_buffer buffer;
1280 int ret; 1262 int ret;
1281 1263
1282 dell_fill_request(&buffer, 0, 0, 0, 0); 1264 dell_fill_request(&buffer, 0x1, 0, 0, 0);
1283 ret = dell_send_request(&buffer, 1265 ret = dell_send_request(&buffer,
1284 CLASS_KBD_BACKLIGHT, SELECT_KBD_BACKLIGHT); 1266 CLASS_KBD_BACKLIGHT, SELECT_KBD_BACKLIGHT);
1285 if (ret) 1267 if (ret)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 5b6f18b18801..535199c9e6bc 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -113,7 +113,7 @@ MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth.");
113/* 113/*
114 * ACPI Helpers 114 * ACPI Helpers
115 */ 115 */
116#define IDEAPAD_EC_TIMEOUT (100) /* in ms */ 116#define IDEAPAD_EC_TIMEOUT (200) /* in ms */
117 117
118static int read_method_int(acpi_handle handle, const char *method, int *val) 118static int read_method_int(acpi_handle handle, const char *method, int *val)
119{ 119{
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index d1a01311c1a2..5e3df194723e 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -376,6 +376,7 @@ static int intel_hid_remove(struct platform_device *device)
376{ 376{
377 acpi_handle handle = ACPI_HANDLE(&device->dev); 377 acpi_handle handle = ACPI_HANDLE(&device->dev);
378 378
379 device_init_wakeup(&device->dev, false);
379 acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler); 380 acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
380 intel_hid_set_enable(&device->dev, false); 381 intel_hid_set_enable(&device->dev, false);
381 intel_button_array_enable(&device->dev, false); 382 intel_button_array_enable(&device->dev, false);
diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
index b703d6f5b099..c13780b8dabb 100644
--- a/drivers/platform/x86/intel-vbtn.c
+++ b/drivers/platform/x86/intel-vbtn.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/acpi.h> 9#include <linux/acpi.h>
10#include <linux/dmi.h>
10#include <linux/input.h> 11#include <linux/input.h>
11#include <linux/input/sparse-keymap.h> 12#include <linux/input/sparse-keymap.h>
12#include <linux/kernel.h> 13#include <linux/kernel.h>
@@ -97,9 +98,35 @@ out_unknown:
97 dev_dbg(&device->dev, "unknown event index 0x%x\n", event); 98 dev_dbg(&device->dev, "unknown event index 0x%x\n", event);
98} 99}
99 100
100static int intel_vbtn_probe(struct platform_device *device) 101static void detect_tablet_mode(struct platform_device *device)
101{ 102{
103 const char *chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
104 struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
105 acpi_handle handle = ACPI_HANDLE(&device->dev);
102 struct acpi_buffer vgbs_output = { ACPI_ALLOCATE_BUFFER, NULL }; 106 struct acpi_buffer vgbs_output = { ACPI_ALLOCATE_BUFFER, NULL };
107 union acpi_object *obj;
108 acpi_status status;
109 int m;
110
111 if (!(chassis_type && strcmp(chassis_type, "31") == 0))
112 goto out;
113
114 status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output);
115 if (ACPI_FAILURE(status))
116 goto out;
117
118 obj = vgbs_output.pointer;
119 if (!(obj && obj->type == ACPI_TYPE_INTEGER))
120 goto out;
121
122 m = !(obj->integer.value & TABLET_MODE_FLAG);
123 input_report_switch(priv->input_dev, SW_TABLET_MODE, m);
124out:
125 kfree(vgbs_output.pointer);
126}
127
128static int intel_vbtn_probe(struct platform_device *device)
129{
103 acpi_handle handle = ACPI_HANDLE(&device->dev); 130 acpi_handle handle = ACPI_HANDLE(&device->dev);
104 struct intel_vbtn_priv *priv; 131 struct intel_vbtn_priv *priv;
105 acpi_status status; 132 acpi_status status;
@@ -122,22 +149,7 @@ static int intel_vbtn_probe(struct platform_device *device)
122 return err; 149 return err;
123 } 150 }
124 151
125 /* 152 detect_tablet_mode(device);
126 * VGBS being present and returning something means we have
127 * a tablet mode switch.
128 */
129 status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output);
130 if (ACPI_SUCCESS(status)) {
131 union acpi_object *obj = vgbs_output.pointer;
132
133 if (obj && obj->type == ACPI_TYPE_INTEGER) {
134 int m = !(obj->integer.value & TABLET_MODE_FLAG);
135
136 input_report_switch(priv->input_dev, SW_TABLET_MODE, m);
137 }
138 }
139
140 kfree(vgbs_output.pointer);
141 153
142 status = acpi_install_notify_handler(handle, 154 status = acpi_install_notify_handler(handle,
143 ACPI_DEVICE_NOTIFY, 155 ACPI_DEVICE_NOTIFY,
@@ -154,6 +166,7 @@ static int intel_vbtn_remove(struct platform_device *device)
154{ 166{
155 acpi_handle handle = ACPI_HANDLE(&device->dev); 167 acpi_handle handle = ACPI_HANDLE(&device->dev);
156 168
169 device_init_wakeup(&device->dev, false);
157 acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler); 170 acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler);
158 171
159 /* 172 /*
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index daa68acbc900..8796211ef24a 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -933,7 +933,7 @@ static int wmi_dev_probe(struct device *dev)
933 goto probe_failure; 933 goto probe_failure;
934 } 934 }
935 935
936 buf = kmalloc(strlen(wdriver->driver.name) + 4, GFP_KERNEL); 936 buf = kmalloc(strlen(wdriver->driver.name) + 5, GFP_KERNEL);
937 if (!buf) { 937 if (!buf) {
938 ret = -ENOMEM; 938 ret = -ENOMEM;
939 goto probe_string_failure; 939 goto probe_string_failure;
@@ -945,7 +945,7 @@ static int wmi_dev_probe(struct device *dev)
945 wblock->char_dev.mode = 0444; 945 wblock->char_dev.mode = 0444;
946 ret = misc_register(&wblock->char_dev); 946 ret = misc_register(&wblock->char_dev);
947 if (ret) { 947 if (ret) {
948 dev_warn(dev, "failed to register char dev: %d", ret); 948 dev_warn(dev, "failed to register char dev: %d\n", ret);
949 ret = -ENOMEM; 949 ret = -ENOMEM;
950 goto probe_misc_failure; 950 goto probe_misc_failure;
951 } 951 }
@@ -1048,7 +1048,7 @@ static int wmi_create_device(struct device *wmi_bus_dev,
1048 1048
1049 if (result) { 1049 if (result) {
1050 dev_warn(wmi_bus_dev, 1050 dev_warn(wmi_bus_dev,
1051 "%s data block query control method not found", 1051 "%s data block query control method not found\n",
1052 method); 1052 method);
1053 return result; 1053 return result;
1054 } 1054 }
@@ -1198,7 +1198,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
1198 1198
1199 retval = device_add(&wblock->dev.dev); 1199 retval = device_add(&wblock->dev.dev);
1200 if (retval) { 1200 if (retval) {
1201 dev_err(wmi_bus_dev, "failed to register %pULL\n", 1201 dev_err(wmi_bus_dev, "failed to register %pUL\n",
1202 wblock->gblock.guid); 1202 wblock->gblock.guid);
1203 if (debug_event) 1203 if (debug_event)
1204 wmi_method_enable(wblock, 0); 1204 wmi_method_enable(wblock, 0);
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index ba2e0856d22c..8f5c1d7f751a 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -1297,6 +1297,9 @@ static int virtio_ccw_cio_notify(struct ccw_device *cdev, int event)
1297 vcdev->device_lost = true; 1297 vcdev->device_lost = true;
1298 rc = NOTIFY_DONE; 1298 rc = NOTIFY_DONE;
1299 break; 1299 break;
1300 case CIO_OPER:
1301 rc = NOTIFY_OK;
1302 break;
1300 default: 1303 default:
1301 rc = NOTIFY_DONE; 1304 rc = NOTIFY_DONE;
1302 break; 1305 break;
@@ -1309,6 +1312,27 @@ static struct ccw_device_id virtio_ids[] = {
1309 {}, 1312 {},
1310}; 1313};
1311 1314
1315#ifdef CONFIG_PM_SLEEP
1316static int virtio_ccw_freeze(struct ccw_device *cdev)
1317{
1318 struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);
1319
1320 return virtio_device_freeze(&vcdev->vdev);
1321}
1322
1323static int virtio_ccw_restore(struct ccw_device *cdev)
1324{
1325 struct virtio_ccw_device *vcdev = dev_get_drvdata(&cdev->dev);
1326 int ret;
1327
1328 ret = virtio_ccw_set_transport_rev(vcdev);
1329 if (ret)
1330 return ret;
1331
1332 return virtio_device_restore(&vcdev->vdev);
1333}
1334#endif
1335
1312static struct ccw_driver virtio_ccw_driver = { 1336static struct ccw_driver virtio_ccw_driver = {
1313 .driver = { 1337 .driver = {
1314 .owner = THIS_MODULE, 1338 .owner = THIS_MODULE,
@@ -1321,6 +1345,11 @@ static struct ccw_driver virtio_ccw_driver = {
1321 .set_online = virtio_ccw_online, 1345 .set_online = virtio_ccw_online,
1322 .notify = virtio_ccw_cio_notify, 1346 .notify = virtio_ccw_cio_notify,
1323 .int_class = IRQIO_VIR, 1347 .int_class = IRQIO_VIR,
1348#ifdef CONFIG_PM_SLEEP
1349 .freeze = virtio_ccw_freeze,
1350 .thaw = virtio_ccw_restore,
1351 .restore = virtio_ccw_restore,
1352#endif
1324}; 1353};
1325 1354
1326static int __init pure_hex(char **cp, unsigned int *val, int min_digit, 1355static int __init pure_hex(char **cp, unsigned int *val, int min_digit,
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index fcfd28d2884c..de1b3fce936d 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -185,7 +185,6 @@ ncr53c8xx-flags-$(CONFIG_SCSI_ZALON) \
185CFLAGS_ncr53c8xx.o := $(ncr53c8xx-flags-y) $(ncr53c8xx-flags-m) 185CFLAGS_ncr53c8xx.o := $(ncr53c8xx-flags-y) $(ncr53c8xx-flags-m)
186zalon7xx-objs := zalon.o ncr53c8xx.o 186zalon7xx-objs := zalon.o ncr53c8xx.o
187NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o 187NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o
188oktagon_esp_mod-objs := oktagon_esp.o oktagon_io.o
189 188
190# Files generated that shall be removed upon make clean 189# Files generated that shall be removed upon make clean
191clean-files := 53c700_d.h 53c700_u.h 190clean-files := 53c700_d.h 53c700_u.h
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index b3b931ab77eb..2664ea0df35f 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1693,8 +1693,10 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1693 * Map in the registers from the adapter. 1693 * Map in the registers from the adapter.
1694 */ 1694 */
1695 aac->base_size = AAC_MIN_FOOTPRINT_SIZE; 1695 aac->base_size = AAC_MIN_FOOTPRINT_SIZE;
1696 if ((*aac_drivers[index].init)(aac)) 1696 if ((*aac_drivers[index].init)(aac)) {
1697 error = -ENODEV;
1697 goto out_unmap; 1698 goto out_unmap;
1699 }
1698 1700
1699 if (aac->sync_mode) { 1701 if (aac->sync_mode) {
1700 if (aac_sync_mode) 1702 if (aac_sync_mode)
diff --git a/drivers/scsi/aic7xxx/aiclib.c b/drivers/scsi/aic7xxx/aiclib.c
deleted file mode 100644
index 828ae3d9a510..000000000000
--- a/drivers/scsi/aic7xxx/aiclib.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Implementation of Utility functions for all SCSI device types.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions, and the following disclaimer,
13 * without modification, immediately at the beginning of the file.
14 * 2. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.38 2002/09/23 04:56:35 mjacob Exp $
30 * $Id$
31 */
32
33#include "aiclib.h"
34
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 8e2f767147cb..5a645b8b9af1 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1889,6 +1889,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
1889 /* we will not receive ABTS response for this IO */ 1889 /* we will not receive ABTS response for this IO */
1890 BNX2FC_IO_DBG(io_req, "Timer context finished processing " 1890 BNX2FC_IO_DBG(io_req, "Timer context finished processing "
1891 "this scsi cmd\n"); 1891 "this scsi cmd\n");
1892 return;
1892 } 1893 }
1893 1894
1894 /* Cancel the timeout_work, as we received IO completion */ 1895 /* Cancel the timeout_work, as we received IO completion */
diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
index be5ee2d37815..7dbbbb81a1e7 100644
--- a/drivers/scsi/csiostor/csio_lnode.c
+++ b/drivers/scsi/csiostor/csio_lnode.c
@@ -114,7 +114,7 @@ static enum csio_ln_ev fwevt_to_lnevt[] = {
114static struct csio_lnode * 114static struct csio_lnode *
115csio_ln_lookup_by_portid(struct csio_hw *hw, uint8_t portid) 115csio_ln_lookup_by_portid(struct csio_hw *hw, uint8_t portid)
116{ 116{
117 struct csio_lnode *ln = hw->rln; 117 struct csio_lnode *ln;
118 struct list_head *tmp; 118 struct list_head *tmp;
119 119
120 /* Match siblings lnode with portid */ 120 /* Match siblings lnode with portid */
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 022e421c2185..4b44325d1a82 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -876,6 +876,11 @@ static void alua_rtpg_work(struct work_struct *work)
876 876
877/** 877/**
878 * alua_rtpg_queue() - cause RTPG to be submitted asynchronously 878 * alua_rtpg_queue() - cause RTPG to be submitted asynchronously
879 * @pg: ALUA port group associated with @sdev.
880 * @sdev: SCSI device for which to submit an RTPG.
881 * @qdata: Information about the callback to invoke after the RTPG.
882 * @force: Whether or not to submit an RTPG if a work item that will submit an
883 * RTPG already has been scheduled.
879 * 884 *
880 * Returns true if and only if alua_rtpg_work() will be called asynchronously. 885 * Returns true if and only if alua_rtpg_work() will be called asynchronously.
881 * That function is responsible for calling @qdata->fn(). 886 * That function is responsible for calling @qdata->fn().
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
index 9a0696f68f37..b81a53c4a9a8 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.h
+++ b/drivers/scsi/ibmvscsi/ibmvfc.h
@@ -367,7 +367,7 @@ enum ibmvfc_fcp_rsp_info_codes {
367}; 367};
368 368
369struct ibmvfc_fcp_rsp_info { 369struct ibmvfc_fcp_rsp_info {
370 __be16 reserved; 370 u8 reserved[3];
371 u8 rsp_code; 371 u8 rsp_code;
372 u8 reserved2[4]; 372 u8 reserved2[4];
373}__attribute__((packed, aligned (2))); 373}__attribute__((packed, aligned (2)));
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 13d6e4ec3022..59a87ca328d3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2410,8 +2410,11 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
2410 continue; 2410 continue;
2411 } 2411 }
2412 2412
2413 for_each_cpu(cpu, mask) 2413 for_each_cpu_and(cpu, mask, cpu_online_mask) {
2414 if (cpu >= ioc->cpu_msix_table_sz)
2415 break;
2414 ioc->cpu_msix_table[cpu] = reply_q->msix_index; 2416 ioc->cpu_msix_table[cpu] = reply_q->msix_index;
2417 }
2415 } 2418 }
2416 return; 2419 return;
2417 } 2420 }
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index 029e2e69b29f..f57a94b4f0d9 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -1724,7 +1724,6 @@ static ssize_t qedi_show_boot_eth_info(void *data, int type, char *buf)
1724{ 1724{
1725 struct qedi_ctx *qedi = data; 1725 struct qedi_ctx *qedi = data;
1726 struct nvm_iscsi_initiator *initiator; 1726 struct nvm_iscsi_initiator *initiator;
1727 char *str = buf;
1728 int rc = 1; 1727 int rc = 1;
1729 u32 ipv6_en, dhcp_en, ip_len; 1728 u32 ipv6_en, dhcp_en, ip_len;
1730 struct nvm_iscsi_block *block; 1729 struct nvm_iscsi_block *block;
@@ -1758,32 +1757,32 @@ static ssize_t qedi_show_boot_eth_info(void *data, int type, char *buf)
1758 1757
1759 switch (type) { 1758 switch (type) {
1760 case ISCSI_BOOT_ETH_IP_ADDR: 1759 case ISCSI_BOOT_ETH_IP_ADDR:
1761 rc = snprintf(str, ip_len, fmt, ip); 1760 rc = snprintf(buf, ip_len, fmt, ip);
1762 break; 1761 break;
1763 case ISCSI_BOOT_ETH_SUBNET_MASK: 1762 case ISCSI_BOOT_ETH_SUBNET_MASK:
1764 rc = snprintf(str, ip_len, fmt, sub); 1763 rc = snprintf(buf, ip_len, fmt, sub);
1765 break; 1764 break;
1766 case ISCSI_BOOT_ETH_GATEWAY: 1765 case ISCSI_BOOT_ETH_GATEWAY:
1767 rc = snprintf(str, ip_len, fmt, gw); 1766 rc = snprintf(buf, ip_len, fmt, gw);
1768 break; 1767 break;
1769 case ISCSI_BOOT_ETH_FLAGS: 1768 case ISCSI_BOOT_ETH_FLAGS:
1770 rc = snprintf(str, 3, "%hhd\n", 1769 rc = snprintf(buf, 3, "%hhd\n",
1771 SYSFS_FLAG_FW_SEL_BOOT); 1770 SYSFS_FLAG_FW_SEL_BOOT);
1772 break; 1771 break;
1773 case ISCSI_BOOT_ETH_INDEX: 1772 case ISCSI_BOOT_ETH_INDEX:
1774 rc = snprintf(str, 3, "0\n"); 1773 rc = snprintf(buf, 3, "0\n");
1775 break; 1774 break;
1776 case ISCSI_BOOT_ETH_MAC: 1775 case ISCSI_BOOT_ETH_MAC:
1777 rc = sysfs_format_mac(str, qedi->mac, ETH_ALEN); 1776 rc = sysfs_format_mac(buf, qedi->mac, ETH_ALEN);
1778 break; 1777 break;
1779 case ISCSI_BOOT_ETH_VLAN: 1778 case ISCSI_BOOT_ETH_VLAN:
1780 rc = snprintf(str, 12, "%d\n", 1779 rc = snprintf(buf, 12, "%d\n",
1781 GET_FIELD2(initiator->generic_cont0, 1780 GET_FIELD2(initiator->generic_cont0,
1782 NVM_ISCSI_CFG_INITIATOR_VLAN)); 1781 NVM_ISCSI_CFG_INITIATOR_VLAN));
1783 break; 1782 break;
1784 case ISCSI_BOOT_ETH_ORIGIN: 1783 case ISCSI_BOOT_ETH_ORIGIN:
1785 if (dhcp_en) 1784 if (dhcp_en)
1786 rc = snprintf(str, 3, "3\n"); 1785 rc = snprintf(buf, 3, "3\n");
1787 break; 1786 break;
1788 default: 1787 default:
1789 rc = 0; 1788 rc = 0;
@@ -1819,7 +1818,6 @@ static ssize_t qedi_show_boot_ini_info(void *data, int type, char *buf)
1819{ 1818{
1820 struct qedi_ctx *qedi = data; 1819 struct qedi_ctx *qedi = data;
1821 struct nvm_iscsi_initiator *initiator; 1820 struct nvm_iscsi_initiator *initiator;
1822 char *str = buf;
1823 int rc; 1821 int rc;
1824 struct nvm_iscsi_block *block; 1822 struct nvm_iscsi_block *block;
1825 1823
@@ -1831,8 +1829,8 @@ static ssize_t qedi_show_boot_ini_info(void *data, int type, char *buf)
1831 1829
1832 switch (type) { 1830 switch (type) {
1833 case ISCSI_BOOT_INI_INITIATOR_NAME: 1831 case ISCSI_BOOT_INI_INITIATOR_NAME:
1834 rc = snprintf(str, NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN, "%s\n", 1832 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN,
1835 initiator->initiator_name.byte); 1833 initiator->initiator_name.byte);
1836 break; 1834 break;
1837 default: 1835 default:
1838 rc = 0; 1836 rc = 0;
@@ -1860,7 +1858,6 @@ static ssize_t
1860qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type, 1858qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
1861 char *buf, enum qedi_nvm_tgts idx) 1859 char *buf, enum qedi_nvm_tgts idx)
1862{ 1860{
1863 char *str = buf;
1864 int rc = 1; 1861 int rc = 1;
1865 u32 ctrl_flags, ipv6_en, chap_en, mchap_en, ip_len; 1862 u32 ctrl_flags, ipv6_en, chap_en, mchap_en, ip_len;
1866 struct nvm_iscsi_block *block; 1863 struct nvm_iscsi_block *block;
@@ -1899,48 +1896,48 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
1899 1896
1900 switch (type) { 1897 switch (type) {
1901 case ISCSI_BOOT_TGT_NAME: 1898 case ISCSI_BOOT_TGT_NAME:
1902 rc = snprintf(str, NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN, "%s\n", 1899 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN,
1903 block->target[idx].target_name.byte); 1900 block->target[idx].target_name.byte);
1904 break; 1901 break;
1905 case ISCSI_BOOT_TGT_IP_ADDR: 1902 case ISCSI_BOOT_TGT_IP_ADDR:
1906 if (ipv6_en) 1903 if (ipv6_en)
1907 rc = snprintf(str, ip_len, "%pI6\n", 1904 rc = snprintf(buf, ip_len, "%pI6\n",
1908 block->target[idx].ipv6_addr.byte); 1905 block->target[idx].ipv6_addr.byte);
1909 else 1906 else
1910 rc = snprintf(str, ip_len, "%pI4\n", 1907 rc = snprintf(buf, ip_len, "%pI4\n",
1911 block->target[idx].ipv4_addr.byte); 1908 block->target[idx].ipv4_addr.byte);
1912 break; 1909 break;
1913 case ISCSI_BOOT_TGT_PORT: 1910 case ISCSI_BOOT_TGT_PORT:
1914 rc = snprintf(str, 12, "%d\n", 1911 rc = snprintf(buf, 12, "%d\n",
1915 GET_FIELD2(block->target[idx].generic_cont0, 1912 GET_FIELD2(block->target[idx].generic_cont0,
1916 NVM_ISCSI_CFG_TARGET_TCP_PORT)); 1913 NVM_ISCSI_CFG_TARGET_TCP_PORT));
1917 break; 1914 break;
1918 case ISCSI_BOOT_TGT_LUN: 1915 case ISCSI_BOOT_TGT_LUN:
1919 rc = snprintf(str, 22, "%.*d\n", 1916 rc = snprintf(buf, 22, "%.*d\n",
1920 block->target[idx].lun.value[1], 1917 block->target[idx].lun.value[1],
1921 block->target[idx].lun.value[0]); 1918 block->target[idx].lun.value[0]);
1922 break; 1919 break;
1923 case ISCSI_BOOT_TGT_CHAP_NAME: 1920 case ISCSI_BOOT_TGT_CHAP_NAME:
1924 rc = snprintf(str, NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, "%s\n", 1921 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1925 chap_name); 1922 chap_name);
1926 break; 1923 break;
1927 case ISCSI_BOOT_TGT_CHAP_SECRET: 1924 case ISCSI_BOOT_TGT_CHAP_SECRET:
1928 rc = snprintf(str, NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, "%s\n", 1925 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1929 chap_secret); 1926 chap_secret);
1930 break; 1927 break;
1931 case ISCSI_BOOT_TGT_REV_CHAP_NAME: 1928 case ISCSI_BOOT_TGT_REV_CHAP_NAME:
1932 rc = snprintf(str, NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, "%s\n", 1929 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1933 mchap_name); 1930 mchap_name);
1934 break; 1931 break;
1935 case ISCSI_BOOT_TGT_REV_CHAP_SECRET: 1932 case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
1936 rc = snprintf(str, NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, "%s\n", 1933 rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1937 mchap_secret); 1934 mchap_secret);
1938 break; 1935 break;
1939 case ISCSI_BOOT_TGT_FLAGS: 1936 case ISCSI_BOOT_TGT_FLAGS:
1940 rc = snprintf(str, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT); 1937 rc = snprintf(buf, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT);
1941 break; 1938 break;
1942 case ISCSI_BOOT_TGT_NIC_ASSOC: 1939 case ISCSI_BOOT_TGT_NIC_ASSOC:
1943 rc = snprintf(str, 3, "0\n"); 1940 rc = snprintf(buf, 3, "0\n");
1944 break; 1941 break;
1945 default: 1942 default:
1946 rc = 0; 1943 rc = 0;
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index aececf664654..2dea1129d396 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -59,8 +59,6 @@ qla2x00_sp_timeout(struct timer_list *t)
59 req->outstanding_cmds[sp->handle] = NULL; 59 req->outstanding_cmds[sp->handle] = NULL;
60 iocb = &sp->u.iocb_cmd; 60 iocb = &sp->u.iocb_cmd;
61 iocb->timeout(sp); 61 iocb->timeout(sp);
62 if (sp->type != SRB_ELS_DCMD)
63 sp->free(sp);
64 spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); 62 spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
65} 63}
66 64
@@ -102,7 +100,6 @@ qla2x00_async_iocb_timeout(void *data)
102 srb_t *sp = data; 100 srb_t *sp = data;
103 fc_port_t *fcport = sp->fcport; 101 fc_port_t *fcport = sp->fcport;
104 struct srb_iocb *lio = &sp->u.iocb_cmd; 102 struct srb_iocb *lio = &sp->u.iocb_cmd;
105 struct event_arg ea;
106 103
107 if (fcport) { 104 if (fcport) {
108 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, 105 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071,
@@ -117,25 +114,13 @@ qla2x00_async_iocb_timeout(void *data)
117 114
118 switch (sp->type) { 115 switch (sp->type) {
119 case SRB_LOGIN_CMD: 116 case SRB_LOGIN_CMD:
120 if (!fcport)
121 break;
122 /* Retry as needed. */ 117 /* Retry as needed. */
123 lio->u.logio.data[0] = MBS_COMMAND_ERROR; 118 lio->u.logio.data[0] = MBS_COMMAND_ERROR;
124 lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? 119 lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ?
125 QLA_LOGIO_LOGIN_RETRIED : 0; 120 QLA_LOGIO_LOGIN_RETRIED : 0;
126 memset(&ea, 0, sizeof(ea)); 121 sp->done(sp, QLA_FUNCTION_TIMEOUT);
127 ea.event = FCME_PLOGI_DONE;
128 ea.fcport = sp->fcport;
129 ea.data[0] = lio->u.logio.data[0];
130 ea.data[1] = lio->u.logio.data[1];
131 ea.sp = sp;
132 qla24xx_handle_plogi_done_event(fcport->vha, &ea);
133 break; 122 break;
134 case SRB_LOGOUT_CMD: 123 case SRB_LOGOUT_CMD:
135 if (!fcport)
136 break;
137 qlt_logo_completion_handler(fcport, QLA_FUNCTION_TIMEOUT);
138 break;
139 case SRB_CT_PTHRU_CMD: 124 case SRB_CT_PTHRU_CMD:
140 case SRB_MB_IOCB: 125 case SRB_MB_IOCB:
141 case SRB_NACK_PLOGI: 126 case SRB_NACK_PLOGI:
@@ -235,12 +220,10 @@ static void
235qla2x00_async_logout_sp_done(void *ptr, int res) 220qla2x00_async_logout_sp_done(void *ptr, int res)
236{ 221{
237 srb_t *sp = ptr; 222 srb_t *sp = ptr;
238 struct srb_iocb *lio = &sp->u.iocb_cmd;
239 223
240 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); 224 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
241 if (!test_bit(UNLOADING, &sp->vha->dpc_flags)) 225 sp->fcport->login_gen++;
242 qla2x00_post_async_logout_done_work(sp->vha, sp->fcport, 226 qlt_logo_completion_handler(sp->fcport, res);
243 lio->u.logio.data);
244 sp->free(sp); 227 sp->free(sp);
245} 228}
246 229
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 1b62e943ec49..8d00d559bd26 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -3275,12 +3275,11 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
3275 memset(abt_iocb, 0, sizeof(struct abort_entry_24xx)); 3275 memset(abt_iocb, 0, sizeof(struct abort_entry_24xx));
3276 abt_iocb->entry_type = ABORT_IOCB_TYPE; 3276 abt_iocb->entry_type = ABORT_IOCB_TYPE;
3277 abt_iocb->entry_count = 1; 3277 abt_iocb->entry_count = 1;
3278 abt_iocb->handle = 3278 abt_iocb->handle = cpu_to_le32(MAKE_HANDLE(req->id, sp->handle));
3279 cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no,
3280 aio->u.abt.cmd_hndl));
3281 abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id); 3279 abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id);
3282 abt_iocb->handle_to_abort = 3280 abt_iocb->handle_to_abort =
3283 cpu_to_le32(MAKE_HANDLE(req->id, aio->u.abt.cmd_hndl)); 3281 cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no,
3282 aio->u.abt.cmd_hndl));
3284 abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; 3283 abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa;
3285 abt_iocb->port_id[1] = sp->fcport->d_id.b.area; 3284 abt_iocb->port_id[1] = sp->fcport->d_id.b.area;
3286 abt_iocb->port_id[2] = sp->fcport->d_id.b.domain; 3285 abt_iocb->port_id[2] = sp->fcport->d_id.b.domain;
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 14109d86c3f6..89f93ebd819d 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -272,7 +272,8 @@ qla2x00_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
272 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 272 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
273 273
274 /* Read all mbox registers? */ 274 /* Read all mbox registers? */
275 mboxes = (1 << ha->mbx_count) - 1; 275 WARN_ON_ONCE(ha->mbx_count > 32);
276 mboxes = (1ULL << ha->mbx_count) - 1;
276 if (!ha->mcp) 277 if (!ha->mcp)
277 ql_dbg(ql_dbg_async, vha, 0x5001, "MBX pointer ERROR.\n"); 278 ql_dbg(ql_dbg_async, vha, 0x5001, "MBX pointer ERROR.\n");
278 else 279 else
@@ -2880,7 +2881,8 @@ qla24xx_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
2880 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 2881 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
2881 2882
2882 /* Read all mbox registers? */ 2883 /* Read all mbox registers? */
2883 mboxes = (1 << ha->mbx_count) - 1; 2884 WARN_ON_ONCE(ha->mbx_count > 32);
2885 mboxes = (1ULL << ha->mbx_count) - 1;
2884 if (!ha->mcp) 2886 if (!ha->mcp)
2885 ql_dbg(ql_dbg_async, vha, 0x504e, "MBX pointer ERROR.\n"); 2887 ql_dbg(ql_dbg_async, vha, 0x504e, "MBX pointer ERROR.\n");
2886 else 2888 else
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 12ee6e02d146..afcb5567998a 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3625,6 +3625,8 @@ qla2x00_remove_one(struct pci_dev *pdev)
3625 } 3625 }
3626 qla2x00_wait_for_hba_ready(base_vha); 3626 qla2x00_wait_for_hba_ready(base_vha);
3627 3627
3628 qla2x00_wait_for_sess_deletion(base_vha);
3629
3628 /* 3630 /*
3629 * if UNLOAD flag is already set, then continue unload, 3631 * if UNLOAD flag is already set, then continue unload,
3630 * where it was set first. 3632 * where it was set first.
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index fc89af8fe256..896b2d8bd803 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -4871,8 +4871,6 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
4871 sess); 4871 sess);
4872 qlt_send_term_imm_notif(vha, iocb, 1); 4872 qlt_send_term_imm_notif(vha, iocb, 1);
4873 res = 0; 4873 res = 0;
4874 spin_lock_irqsave(&tgt->ha->tgt.sess_lock,
4875 flags);
4876 break; 4874 break;
4877 } 4875 }
4878 4876
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index fc233717355f..817f312023a9 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -168,6 +168,8 @@
168#define DEV_DB_NON_PERSISTENT 0 168#define DEV_DB_NON_PERSISTENT 0
169#define DEV_DB_PERSISTENT 1 169#define DEV_DB_PERSISTENT 1
170 170
171#define QL4_ISP_REG_DISCONNECT 0xffffffffU
172
171#define COPY_ISID(dst_isid, src_isid) { \ 173#define COPY_ISID(dst_isid, src_isid) { \
172 int i, j; \ 174 int i, j; \
173 for (i = 0, j = ISID_SIZE - 1; i < ISID_SIZE;) \ 175 for (i = 0, j = ISID_SIZE - 1; i < ISID_SIZE;) \
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 82e889bbe0ed..fc2c97d9a0d6 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -262,6 +262,24 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
262 262
263static struct scsi_transport_template *qla4xxx_scsi_transport; 263static struct scsi_transport_template *qla4xxx_scsi_transport;
264 264
265static int qla4xxx_isp_check_reg(struct scsi_qla_host *ha)
266{
267 u32 reg_val = 0;
268 int rval = QLA_SUCCESS;
269
270 if (is_qla8022(ha))
271 reg_val = readl(&ha->qla4_82xx_reg->host_status);
272 else if (is_qla8032(ha) || is_qla8042(ha))
273 reg_val = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
274 else
275 reg_val = readw(&ha->reg->ctrl_status);
276
277 if (reg_val == QL4_ISP_REG_DISCONNECT)
278 rval = QLA_ERROR;
279
280 return rval;
281}
282
265static int qla4xxx_send_ping(struct Scsi_Host *shost, uint32_t iface_num, 283static int qla4xxx_send_ping(struct Scsi_Host *shost, uint32_t iface_num,
266 uint32_t iface_type, uint32_t payload_size, 284 uint32_t iface_type, uint32_t payload_size,
267 uint32_t pid, struct sockaddr *dst_addr) 285 uint32_t pid, struct sockaddr *dst_addr)
@@ -9186,10 +9204,17 @@ static int qla4xxx_eh_abort(struct scsi_cmnd *cmd)
9186 struct srb *srb = NULL; 9204 struct srb *srb = NULL;
9187 int ret = SUCCESS; 9205 int ret = SUCCESS;
9188 int wait = 0; 9206 int wait = 0;
9207 int rval;
9189 9208
9190 ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%llu: Abort command issued cmd=%p, cdb=0x%x\n", 9209 ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%llu: Abort command issued cmd=%p, cdb=0x%x\n",
9191 ha->host_no, id, lun, cmd, cmd->cmnd[0]); 9210 ha->host_no, id, lun, cmd, cmd->cmnd[0]);
9192 9211
9212 rval = qla4xxx_isp_check_reg(ha);
9213 if (rval != QLA_SUCCESS) {
9214 ql4_printk(KERN_INFO, ha, "PCI/Register disconnect, exiting.\n");
9215 return FAILED;
9216 }
9217
9193 spin_lock_irqsave(&ha->hardware_lock, flags); 9218 spin_lock_irqsave(&ha->hardware_lock, flags);
9194 srb = (struct srb *) CMD_SP(cmd); 9219 srb = (struct srb *) CMD_SP(cmd);
9195 if (!srb) { 9220 if (!srb) {
@@ -9241,6 +9266,7 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
9241 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); 9266 struct scsi_qla_host *ha = to_qla_host(cmd->device->host);
9242 struct ddb_entry *ddb_entry = cmd->device->hostdata; 9267 struct ddb_entry *ddb_entry = cmd->device->hostdata;
9243 int ret = FAILED, stat; 9268 int ret = FAILED, stat;
9269 int rval;
9244 9270
9245 if (!ddb_entry) 9271 if (!ddb_entry)
9246 return ret; 9272 return ret;
@@ -9260,6 +9286,12 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
9260 cmd, jiffies, cmd->request->timeout / HZ, 9286 cmd, jiffies, cmd->request->timeout / HZ,
9261 ha->dpc_flags, cmd->result, cmd->allowed)); 9287 ha->dpc_flags, cmd->result, cmd->allowed));
9262 9288
9289 rval = qla4xxx_isp_check_reg(ha);
9290 if (rval != QLA_SUCCESS) {
9291 ql4_printk(KERN_INFO, ha, "PCI/Register disconnect, exiting.\n");
9292 return FAILED;
9293 }
9294
9263 /* FIXME: wait for hba to go online */ 9295 /* FIXME: wait for hba to go online */
9264 stat = qla4xxx_reset_lun(ha, ddb_entry, cmd->device->lun); 9296 stat = qla4xxx_reset_lun(ha, ddb_entry, cmd->device->lun);
9265 if (stat != QLA_SUCCESS) { 9297 if (stat != QLA_SUCCESS) {
@@ -9303,6 +9335,7 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)
9303 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); 9335 struct scsi_qla_host *ha = to_qla_host(cmd->device->host);
9304 struct ddb_entry *ddb_entry = cmd->device->hostdata; 9336 struct ddb_entry *ddb_entry = cmd->device->hostdata;
9305 int stat, ret; 9337 int stat, ret;
9338 int rval;
9306 9339
9307 if (!ddb_entry) 9340 if (!ddb_entry)
9308 return FAILED; 9341 return FAILED;
@@ -9320,6 +9353,12 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)
9320 ha->host_no, cmd, jiffies, cmd->request->timeout / HZ, 9353 ha->host_no, cmd, jiffies, cmd->request->timeout / HZ,
9321 ha->dpc_flags, cmd->result, cmd->allowed)); 9354 ha->dpc_flags, cmd->result, cmd->allowed));
9322 9355
9356 rval = qla4xxx_isp_check_reg(ha);
9357 if (rval != QLA_SUCCESS) {
9358 ql4_printk(KERN_INFO, ha, "PCI/Register disconnect, exiting.\n");
9359 return FAILED;
9360 }
9361
9323 stat = qla4xxx_reset_target(ha, ddb_entry); 9362 stat = qla4xxx_reset_target(ha, ddb_entry);
9324 if (stat != QLA_SUCCESS) { 9363 if (stat != QLA_SUCCESS) {
9325 starget_printk(KERN_INFO, scsi_target(cmd->device), 9364 starget_printk(KERN_INFO, scsi_target(cmd->device),
@@ -9374,9 +9413,16 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd)
9374{ 9413{
9375 int return_status = FAILED; 9414 int return_status = FAILED;
9376 struct scsi_qla_host *ha; 9415 struct scsi_qla_host *ha;
9416 int rval;
9377 9417
9378 ha = to_qla_host(cmd->device->host); 9418 ha = to_qla_host(cmd->device->host);
9379 9419
9420 rval = qla4xxx_isp_check_reg(ha);
9421 if (rval != QLA_SUCCESS) {
9422 ql4_printk(KERN_INFO, ha, "PCI/Register disconnect, exiting.\n");
9423 return FAILED;
9424 }
9425
9380 if ((is_qla8032(ha) || is_qla8042(ha)) && ql4xdontresethba) 9426 if ((is_qla8032(ha) || is_qla8042(ha)) && ql4xdontresethba)
9381 qla4_83xx_set_idc_dontreset(ha); 9427 qla4_83xx_set_idc_dontreset(ha);
9382 9428
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 40fc7a590e81..6be5ab32c94f 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1657,7 +1657,7 @@ static struct scsi_host_template scsi_driver = {
1657 .eh_timed_out = storvsc_eh_timed_out, 1657 .eh_timed_out = storvsc_eh_timed_out,
1658 .slave_alloc = storvsc_device_alloc, 1658 .slave_alloc = storvsc_device_alloc,
1659 .slave_configure = storvsc_device_configure, 1659 .slave_configure = storvsc_device_configure,
1660 .cmd_per_lun = 255, 1660 .cmd_per_lun = 2048,
1661 .this_id = -1, 1661 .this_id = -1,
1662 .use_clustering = ENABLE_CLUSTERING, 1662 .use_clustering = ENABLE_CLUSTERING,
1663 /* Make sure we dont get a sg segment crosses a page boundary */ 1663 /* Make sure we dont get a sg segment crosses a page boundary */
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index ca360daa6a25..378af306fda1 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -536,7 +536,7 @@ sym_getsync(struct sym_hcb *np, u_char dt, u_char sfac, u_char *divp, u_char *fa
536 * Look for the greatest clock divisor that allows an 536 * Look for the greatest clock divisor that allows an
537 * input speed faster than the period. 537 * input speed faster than the period.
538 */ 538 */
539 while (div-- > 0) 539 while (--div > 0)
540 if (kpc >= (div_10M[div] << 2)) break; 540 if (kpc >= (div_10M[div] << 2)) break;
541 541
542 /* 542 /*
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a355d989b414..c7da2c185990 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4352,6 +4352,8 @@ static int ufshcd_slave_alloc(struct scsi_device *sdev)
4352 /* REPORT SUPPORTED OPERATION CODES is not supported */ 4352 /* REPORT SUPPORTED OPERATION CODES is not supported */
4353 sdev->no_report_opcodes = 1; 4353 sdev->no_report_opcodes = 1;
4354 4354
4355 /* WRITE_SAME command is not supported */
4356 sdev->no_write_same = 1;
4355 4357
4356 ufshcd_set_queue_depth(sdev); 4358 ufshcd_set_queue_depth(sdev);
4357 4359
diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c
index f2d8c3c53ea4..8bdaa9b43d49 100644
--- a/drivers/soc/amlogic/meson-gx-socinfo.c
+++ b/drivers/soc/amlogic/meson-gx-socinfo.c
@@ -41,6 +41,7 @@ static const struct meson_gx_package_id {
41 unsigned int pack_id; 41 unsigned int pack_id;
42} soc_packages[] = { 42} soc_packages[] = {
43 { "S905", 0x1f, 0 }, 43 { "S905", 0x1f, 0 },
44 { "S905H", 0x1f, 0x13 },
44 { "S905M", 0x1f, 0x20 }, 45 { "S905M", 0x1f, 0x20 },
45 { "S905D", 0x21, 0 }, 46 { "S905D", 0x21, 0 },
46 { "S905X", 0x21, 0x80 }, 47 { "S905X", 0x21, 0x80 },
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 53f7275d6cbd..750f93197411 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -348,7 +348,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap,
348 if (i == 1) { 348 if (i == 1) {
349 domain->supply = devm_regulator_get(dev, "pu"); 349 domain->supply = devm_regulator_get(dev, "pu");
350 if (IS_ERR(domain->supply)) 350 if (IS_ERR(domain->supply))
351 return PTR_ERR(domain->supply);; 351 return PTR_ERR(domain->supply);
352 352
353 ret = imx_pgc_get_clocks(dev, domain); 353 ret = imx_pgc_get_clocks(dev, domain);
354 if (ret) 354 if (ret)
@@ -470,13 +470,21 @@ static int imx_gpc_probe(struct platform_device *pdev)
470 470
471static int imx_gpc_remove(struct platform_device *pdev) 471static int imx_gpc_remove(struct platform_device *pdev)
472{ 472{
473 struct device_node *pgc_node;
473 int ret; 474 int ret;
474 475
476 pgc_node = of_get_child_by_name(pdev->dev.of_node, "pgc");
477
478 /* bail out if DT too old and doesn't provide the necessary info */
479 if (!of_property_read_bool(pdev->dev.of_node, "#power-domain-cells") &&
480 !pgc_node)
481 return 0;
482
475 /* 483 /*
476 * If the old DT binding is used the toplevel driver needs to 484 * If the old DT binding is used the toplevel driver needs to
477 * de-register the power domains 485 * de-register the power domains
478 */ 486 */
479 if (!of_get_child_by_name(pdev->dev.of_node, "pgc")) { 487 if (!pgc_node) {
480 of_genpd_del_provider(pdev->dev.of_node); 488 of_genpd_del_provider(pdev->dev.of_node);
481 489
482 ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_PU].base); 490 ret = pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_PU].base);
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index bbdc53b686dd..6dbba5aff191 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -702,30 +702,32 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
702 size_t pgstart, pgend; 702 size_t pgstart, pgend;
703 int ret = -EINVAL; 703 int ret = -EINVAL;
704 704
705 mutex_lock(&ashmem_mutex);
706
705 if (unlikely(!asma->file)) 707 if (unlikely(!asma->file))
706 return -EINVAL; 708 goto out_unlock;
707 709
708 if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) 710 if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) {
709 return -EFAULT; 711 ret = -EFAULT;
712 goto out_unlock;
713 }
710 714
711 /* per custom, you can pass zero for len to mean "everything onward" */ 715 /* per custom, you can pass zero for len to mean "everything onward" */
712 if (!pin.len) 716 if (!pin.len)
713 pin.len = PAGE_ALIGN(asma->size) - pin.offset; 717 pin.len = PAGE_ALIGN(asma->size) - pin.offset;
714 718
715 if (unlikely((pin.offset | pin.len) & ~PAGE_MASK)) 719 if (unlikely((pin.offset | pin.len) & ~PAGE_MASK))
716 return -EINVAL; 720 goto out_unlock;
717 721
718 if (unlikely(((__u32)-1) - pin.offset < pin.len)) 722 if (unlikely(((__u32)-1) - pin.offset < pin.len))
719 return -EINVAL; 723 goto out_unlock;
720 724
721 if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len)) 725 if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len))
722 return -EINVAL; 726 goto out_unlock;
723 727
724 pgstart = pin.offset / PAGE_SIZE; 728 pgstart = pin.offset / PAGE_SIZE;
725 pgend = pgstart + (pin.len / PAGE_SIZE) - 1; 729 pgend = pgstart + (pin.len / PAGE_SIZE) - 1;
726 730
727 mutex_lock(&ashmem_mutex);
728
729 switch (cmd) { 731 switch (cmd) {
730 case ASHMEM_PIN: 732 case ASHMEM_PIN:
731 ret = ashmem_pin(asma, pgstart, pgend); 733 ret = ashmem_pin(asma, pgstart, pgend);
@@ -738,6 +740,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd,
738 break; 740 break;
739 } 741 }
740 742
743out_unlock:
741 mutex_unlock(&ashmem_mutex); 744 mutex_unlock(&ashmem_mutex);
742 745
743 return ret; 746 return ret;
diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index 94e06925c712..49718c96bf9e 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -12,6 +12,7 @@
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/cma.h> 13#include <linux/cma.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/highmem.h>
15 16
16#include "ion.h" 17#include "ion.h"
17 18
@@ -42,6 +43,22 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
42 if (!pages) 43 if (!pages)
43 return -ENOMEM; 44 return -ENOMEM;
44 45
46 if (PageHighMem(pages)) {
47 unsigned long nr_clear_pages = nr_pages;
48 struct page *page = pages;
49
50 while (nr_clear_pages > 0) {
51 void *vaddr = kmap_atomic(page);
52
53 memset(vaddr, 0, PAGE_SIZE);
54 kunmap_atomic(vaddr);
55 page++;
56 nr_clear_pages--;
57 }
58 } else {
59 memset(page_address(pages), 0, size);
60 }
61
45 table = kmalloc(sizeof(*table), GFP_KERNEL); 62 table = kmalloc(sizeof(*table), GFP_KERNEL);
46 if (!table) 63 if (!table)
47 goto err; 64 goto err;
diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig
index 1f9100049176..b35ef7ee6901 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -7,7 +7,7 @@
7 7
8config FSL_MC_BUS 8config FSL_MC_BUS
9 bool "QorIQ DPAA2 fsl-mc bus driver" 9 bool "QorIQ DPAA2 fsl-mc bus driver"
10 depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86 || PPC))) 10 depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86_LOCAL_APIC || PPC)))
11 select GENERIC_MSI_IRQ_DOMAIN 11 select GENERIC_MSI_IRQ_DOMAIN
12 help 12 help
13 Driver to enable the bus infrastructure for the QorIQ DPAA2 13 Driver to enable the bus infrastructure for the QorIQ DPAA2
diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 5064d5ddf581..fc2013aade51 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -73,6 +73,8 @@ static int __init its_fsl_mc_msi_init(void)
73 73
74 for (np = of_find_matching_node(NULL, its_device_id); np; 74 for (np = of_find_matching_node(NULL, its_device_id); np;
75 np = of_find_matching_node(np, its_device_id)) { 75 np = of_find_matching_node(np, its_device_id)) {
76 if (!of_device_is_available(np))
77 continue;
76 if (!of_property_read_bool(np, "msi-controller")) 78 if (!of_property_read_bool(np, "msi-controller"))
77 continue; 79 continue;
78 80
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index f01595593ce2..425e8b82533b 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -141,6 +141,8 @@
141#define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */ 141#define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */
142#define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */ 142#define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */
143 143
144#define AD7192_EXT_FREQ_MHZ_MIN 2457600
145#define AD7192_EXT_FREQ_MHZ_MAX 5120000
144#define AD7192_INT_FREQ_MHZ 4915200 146#define AD7192_INT_FREQ_MHZ 4915200
145 147
146/* NOTE: 148/* NOTE:
@@ -218,6 +220,12 @@ static int ad7192_calibrate_all(struct ad7192_state *st)
218 ARRAY_SIZE(ad7192_calib_arr)); 220 ARRAY_SIZE(ad7192_calib_arr));
219} 221}
220 222
223static inline bool ad7192_valid_external_frequency(u32 freq)
224{
225 return (freq >= AD7192_EXT_FREQ_MHZ_MIN &&
226 freq <= AD7192_EXT_FREQ_MHZ_MAX);
227}
228
221static int ad7192_setup(struct ad7192_state *st, 229static int ad7192_setup(struct ad7192_state *st,
222 const struct ad7192_platform_data *pdata) 230 const struct ad7192_platform_data *pdata)
223{ 231{
@@ -243,17 +251,20 @@ static int ad7192_setup(struct ad7192_state *st,
243 id); 251 id);
244 252
245 switch (pdata->clock_source_sel) { 253 switch (pdata->clock_source_sel) {
246 case AD7192_CLK_EXT_MCLK1_2:
247 case AD7192_CLK_EXT_MCLK2:
248 st->mclk = AD7192_INT_FREQ_MHZ;
249 break;
250 case AD7192_CLK_INT: 254 case AD7192_CLK_INT:
251 case AD7192_CLK_INT_CO: 255 case AD7192_CLK_INT_CO:
252 if (pdata->ext_clk_hz) 256 st->mclk = AD7192_INT_FREQ_MHZ;
253 st->mclk = pdata->ext_clk_hz;
254 else
255 st->mclk = AD7192_INT_FREQ_MHZ;
256 break; 257 break;
258 case AD7192_CLK_EXT_MCLK1_2:
259 case AD7192_CLK_EXT_MCLK2:
260 if (ad7192_valid_external_frequency(pdata->ext_clk_hz)) {
261 st->mclk = pdata->ext_clk_hz;
262 break;
263 }
264 dev_err(&st->sd.spi->dev, "Invalid frequency setting %u\n",
265 pdata->ext_clk_hz);
266 ret = -EINVAL;
267 goto out;
257 default: 268 default:
258 ret = -EINVAL; 269 ret = -EINVAL;
259 goto out; 270 goto out;
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 2b28fb9c0048..3bcf49466361 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -648,8 +648,6 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
648 /* Ring buffer functions - here trigger setup related */ 648 /* Ring buffer functions - here trigger setup related */
649 indio_dev->setup_ops = &ad5933_ring_setup_ops; 649 indio_dev->setup_ops = &ad5933_ring_setup_ops;
650 650
651 indio_dev->modes |= INDIO_BUFFER_HARDWARE;
652
653 return 0; 651 return 0;
654} 652}
655 653
@@ -762,7 +760,7 @@ static int ad5933_probe(struct i2c_client *client,
762 indio_dev->dev.parent = &client->dev; 760 indio_dev->dev.parent = &client->dev;
763 indio_dev->info = &ad5933_info; 761 indio_dev->info = &ad5933_info;
764 indio_dev->name = id->name; 762 indio_dev->name = id->name;
765 indio_dev->modes = INDIO_DIRECT_MODE; 763 indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE);
766 indio_dev->channels = ad5933_channels; 764 indio_dev->channels = ad5933_channels;
767 indio_dev->num_channels = ARRAY_SIZE(ad5933_channels); 765 indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
768 766
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index f699abab1787..148f3ee70286 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -19,6 +19,12 @@ config USB_EHCI_BIG_ENDIAN_MMIO
19config USB_EHCI_BIG_ENDIAN_DESC 19config USB_EHCI_BIG_ENDIAN_DESC
20 bool 20 bool
21 21
22config USB_UHCI_BIG_ENDIAN_MMIO
23 bool
24
25config USB_UHCI_BIG_ENDIAN_DESC
26 bool
27
22menuconfig USB_SUPPORT 28menuconfig USB_SUPPORT
23 bool "USB support" 29 bool "USB support"
24 depends on HAS_IOMEM 30 depends on HAS_IOMEM
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 06b3b54a0e68..7b366a6c0b49 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -174,6 +174,7 @@ static int acm_wb_alloc(struct acm *acm)
174 wb = &acm->wb[wbn]; 174 wb = &acm->wb[wbn];
175 if (!wb->use) { 175 if (!wb->use) {
176 wb->use = 1; 176 wb->use = 1;
177 wb->len = 0;
177 return wbn; 178 return wbn;
178 } 179 }
179 wbn = (wbn + 1) % ACM_NW; 180 wbn = (wbn + 1) % ACM_NW;
@@ -805,16 +806,18 @@ static int acm_tty_write(struct tty_struct *tty,
805static void acm_tty_flush_chars(struct tty_struct *tty) 806static void acm_tty_flush_chars(struct tty_struct *tty)
806{ 807{
807 struct acm *acm = tty->driver_data; 808 struct acm *acm = tty->driver_data;
808 struct acm_wb *cur = acm->putbuffer; 809 struct acm_wb *cur;
809 int err; 810 int err;
810 unsigned long flags; 811 unsigned long flags;
811 812
813 spin_lock_irqsave(&acm->write_lock, flags);
814
815 cur = acm->putbuffer;
812 if (!cur) /* nothing to do */ 816 if (!cur) /* nothing to do */
813 return; 817 goto out;
814 818
815 acm->putbuffer = NULL; 819 acm->putbuffer = NULL;
816 err = usb_autopm_get_interface_async(acm->control); 820 err = usb_autopm_get_interface_async(acm->control);
817 spin_lock_irqsave(&acm->write_lock, flags);
818 if (err < 0) { 821 if (err < 0) {
819 cur->use = 0; 822 cur->use = 0;
820 acm->putbuffer = cur; 823 acm->putbuffer = cur;
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 4024926c1d68..f4a548471f0f 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -226,6 +226,9 @@ static const struct usb_device_id usb_quirk_list[] = {
226 { USB_DEVICE(0x1a0a, 0x0200), .driver_info = 226 { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
227 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, 227 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
228 228
229 /* Corsair K70 RGB */
230 { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT },
231
229 /* Corsair Strafe RGB */ 232 /* Corsair Strafe RGB */
230 { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, 233 { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
231 234
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index e4c3ce0de5de..5bcad1d869b5 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -1917,7 +1917,9 @@ static void dwc2_hsotg_program_zlp(struct dwc2_hsotg *hsotg,
1917 /* Not specific buffer needed for ep0 ZLP */ 1917 /* Not specific buffer needed for ep0 ZLP */
1918 dma_addr_t dma = hs_ep->desc_list_dma; 1918 dma_addr_t dma = hs_ep->desc_list_dma;
1919 1919
1920 dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep); 1920 if (!index)
1921 dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep);
1922
1921 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, dma, 0); 1923 dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, dma, 0);
1922 } else { 1924 } else {
1923 dwc2_writel(DXEPTSIZ_MC(1) | DXEPTSIZ_PKTCNT(1) | 1925 dwc2_writel(DXEPTSIZ_MC(1) | DXEPTSIZ_PKTCNT(1) |
@@ -2974,9 +2976,13 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
2974 if (ints & DXEPINT_STSPHSERCVD) { 2976 if (ints & DXEPINT_STSPHSERCVD) {
2975 dev_dbg(hsotg->dev, "%s: StsPhseRcvd\n", __func__); 2977 dev_dbg(hsotg->dev, "%s: StsPhseRcvd\n", __func__);
2976 2978
2977 /* Move to STATUS IN for DDMA */ 2979 /* Safety check EP0 state when STSPHSERCVD asserted */
2978 if (using_desc_dma(hsotg)) 2980 if (hsotg->ep0_state == DWC2_EP0_DATA_OUT) {
2979 dwc2_hsotg_ep0_zlp(hsotg, true); 2981 /* Move to STATUS IN for DDMA */
2982 if (using_desc_dma(hsotg))
2983 dwc2_hsotg_ep0_zlp(hsotg, true);
2984 }
2985
2980 } 2986 }
2981 2987
2982 if (ints & DXEPINT_BACK2BACKSETUP) 2988 if (ints & DXEPINT_BACK2BACKSETUP)
@@ -3375,12 +3381,6 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
3375 dwc2_writel(dwc2_hsotg_ep0_mps(hsotg->eps_out[0]->ep.maxpacket) | 3381 dwc2_writel(dwc2_hsotg_ep0_mps(hsotg->eps_out[0]->ep.maxpacket) |
3376 DXEPCTL_USBACTEP, hsotg->regs + DIEPCTL0); 3382 DXEPCTL_USBACTEP, hsotg->regs + DIEPCTL0);
3377 3383
3378 dwc2_hsotg_enqueue_setup(hsotg);
3379
3380 dev_dbg(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n",
3381 dwc2_readl(hsotg->regs + DIEPCTL0),
3382 dwc2_readl(hsotg->regs + DOEPCTL0));
3383
3384 /* clear global NAKs */ 3384 /* clear global NAKs */
3385 val = DCTL_CGOUTNAK | DCTL_CGNPINNAK; 3385 val = DCTL_CGOUTNAK | DCTL_CGNPINNAK;
3386 if (!is_usb_reset) 3386 if (!is_usb_reset)
@@ -3391,6 +3391,12 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
3391 mdelay(3); 3391 mdelay(3);
3392 3392
3393 hsotg->lx_state = DWC2_L0; 3393 hsotg->lx_state = DWC2_L0;
3394
3395 dwc2_hsotg_enqueue_setup(hsotg);
3396
3397 dev_dbg(hsotg->dev, "EP0: DIEPCTL0=0x%08x, DOEPCTL0=0x%08x\n",
3398 dwc2_readl(hsotg->regs + DIEPCTL0),
3399 dwc2_readl(hsotg->regs + DOEPCTL0));
3394} 3400}
3395 3401
3396static void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg) 3402static void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index ade2ab00d37a..f1d838a4acd6 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -100,6 +100,8 @@ static void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
100 reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG)); 100 reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
101 reg |= DWC3_GCTL_PRTCAPDIR(mode); 101 reg |= DWC3_GCTL_PRTCAPDIR(mode);
102 dwc3_writel(dwc->regs, DWC3_GCTL, reg); 102 dwc3_writel(dwc->regs, DWC3_GCTL, reg);
103
104 dwc->current_dr_role = mode;
103} 105}
104 106
105static void __dwc3_set_mode(struct work_struct *work) 107static void __dwc3_set_mode(struct work_struct *work)
@@ -133,8 +135,6 @@ static void __dwc3_set_mode(struct work_struct *work)
133 135
134 dwc3_set_prtcap(dwc, dwc->desired_dr_role); 136 dwc3_set_prtcap(dwc, dwc->desired_dr_role);
135 137
136 dwc->current_dr_role = dwc->desired_dr_role;
137
138 spin_unlock_irqrestore(&dwc->lock, flags); 138 spin_unlock_irqrestore(&dwc->lock, flags);
139 139
140 switch (dwc->desired_dr_role) { 140 switch (dwc->desired_dr_role) {
@@ -219,7 +219,7 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
219 * XHCI driver will reset the host block. If dwc3 was configured for 219 * XHCI driver will reset the host block. If dwc3 was configured for
220 * host-only mode, then we can return early. 220 * host-only mode, then we can return early.
221 */ 221 */
222 if (dwc->dr_mode == USB_DR_MODE_HOST) 222 if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
223 return 0; 223 return 0;
224 224
225 reg = dwc3_readl(dwc->regs, DWC3_DCTL); 225 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
@@ -234,6 +234,9 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
234 udelay(1); 234 udelay(1);
235 } while (--retries); 235 } while (--retries);
236 236
237 phy_exit(dwc->usb3_generic_phy);
238 phy_exit(dwc->usb2_generic_phy);
239
237 return -ETIMEDOUT; 240 return -ETIMEDOUT;
238} 241}
239 242
@@ -483,6 +486,22 @@ static void dwc3_cache_hwparams(struct dwc3 *dwc)
483 parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8); 486 parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8);
484} 487}
485 488
489static int dwc3_core_ulpi_init(struct dwc3 *dwc)
490{
491 int intf;
492 int ret = 0;
493
494 intf = DWC3_GHWPARAMS3_HSPHY_IFC(dwc->hwparams.hwparams3);
495
496 if (intf == DWC3_GHWPARAMS3_HSPHY_IFC_ULPI ||
497 (intf == DWC3_GHWPARAMS3_HSPHY_IFC_UTMI_ULPI &&
498 dwc->hsphy_interface &&
499 !strncmp(dwc->hsphy_interface, "ulpi", 4)))
500 ret = dwc3_ulpi_init(dwc);
501
502 return ret;
503}
504
486/** 505/**
487 * dwc3_phy_setup - Configure USB PHY Interface of DWC3 Core 506 * dwc3_phy_setup - Configure USB PHY Interface of DWC3 Core
488 * @dwc: Pointer to our controller context structure 507 * @dwc: Pointer to our controller context structure
@@ -494,7 +513,6 @@ static void dwc3_cache_hwparams(struct dwc3 *dwc)
494static int dwc3_phy_setup(struct dwc3 *dwc) 513static int dwc3_phy_setup(struct dwc3 *dwc)
495{ 514{
496 u32 reg; 515 u32 reg;
497 int ret;
498 516
499 reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); 517 reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
500 518
@@ -565,9 +583,6 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
565 } 583 }
566 /* FALLTHROUGH */ 584 /* FALLTHROUGH */
567 case DWC3_GHWPARAMS3_HSPHY_IFC_ULPI: 585 case DWC3_GHWPARAMS3_HSPHY_IFC_ULPI:
568 ret = dwc3_ulpi_init(dwc);
569 if (ret)
570 return ret;
571 /* FALLTHROUGH */ 586 /* FALLTHROUGH */
572 default: 587 default:
573 break; 588 break;
@@ -724,6 +739,7 @@ static void dwc3_core_setup_global_control(struct dwc3 *dwc)
724} 739}
725 740
726static int dwc3_core_get_phy(struct dwc3 *dwc); 741static int dwc3_core_get_phy(struct dwc3 *dwc);
742static int dwc3_core_ulpi_init(struct dwc3 *dwc);
727 743
728/** 744/**
729 * dwc3_core_init - Low-level initialization of DWC3 Core 745 * dwc3_core_init - Low-level initialization of DWC3 Core
@@ -755,17 +771,27 @@ static int dwc3_core_init(struct dwc3 *dwc)
755 dwc->maximum_speed = USB_SPEED_HIGH; 771 dwc->maximum_speed = USB_SPEED_HIGH;
756 } 772 }
757 773
758 ret = dwc3_core_get_phy(dwc); 774 ret = dwc3_phy_setup(dwc);
759 if (ret) 775 if (ret)
760 goto err0; 776 goto err0;
761 777
762 ret = dwc3_core_soft_reset(dwc); 778 if (!dwc->ulpi_ready) {
763 if (ret) 779 ret = dwc3_core_ulpi_init(dwc);
764 goto err0; 780 if (ret)
781 goto err0;
782 dwc->ulpi_ready = true;
783 }
765 784
766 ret = dwc3_phy_setup(dwc); 785 if (!dwc->phys_ready) {
786 ret = dwc3_core_get_phy(dwc);
787 if (ret)
788 goto err0a;
789 dwc->phys_ready = true;
790 }
791
792 ret = dwc3_core_soft_reset(dwc);
767 if (ret) 793 if (ret)
768 goto err0; 794 goto err0a;
769 795
770 dwc3_core_setup_global_control(dwc); 796 dwc3_core_setup_global_control(dwc);
771 dwc3_core_num_eps(dwc); 797 dwc3_core_num_eps(dwc);
@@ -838,6 +864,9 @@ err1:
838 phy_exit(dwc->usb2_generic_phy); 864 phy_exit(dwc->usb2_generic_phy);
839 phy_exit(dwc->usb3_generic_phy); 865 phy_exit(dwc->usb3_generic_phy);
840 866
867err0a:
868 dwc3_ulpi_exit(dwc);
869
841err0: 870err0:
842 return ret; 871 return ret;
843} 872}
@@ -916,7 +945,6 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
916 945
917 switch (dwc->dr_mode) { 946 switch (dwc->dr_mode) {
918 case USB_DR_MODE_PERIPHERAL: 947 case USB_DR_MODE_PERIPHERAL:
919 dwc->current_dr_role = DWC3_GCTL_PRTCAP_DEVICE;
920 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE); 948 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
921 949
922 if (dwc->usb2_phy) 950 if (dwc->usb2_phy)
@@ -932,7 +960,6 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
932 } 960 }
933 break; 961 break;
934 case USB_DR_MODE_HOST: 962 case USB_DR_MODE_HOST:
935 dwc->current_dr_role = DWC3_GCTL_PRTCAP_HOST;
936 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST); 963 dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST);
937 964
938 if (dwc->usb2_phy) 965 if (dwc->usb2_phy)
@@ -1234,7 +1261,6 @@ err4:
1234 1261
1235err3: 1262err3:
1236 dwc3_free_event_buffers(dwc); 1263 dwc3_free_event_buffers(dwc);
1237 dwc3_ulpi_exit(dwc);
1238 1264
1239err2: 1265err2:
1240 pm_runtime_allow(&pdev->dev); 1266 pm_runtime_allow(&pdev->dev);
@@ -1284,7 +1310,7 @@ static int dwc3_remove(struct platform_device *pdev)
1284} 1310}
1285 1311
1286#ifdef CONFIG_PM 1312#ifdef CONFIG_PM
1287static int dwc3_suspend_common(struct dwc3 *dwc) 1313static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
1288{ 1314{
1289 unsigned long flags; 1315 unsigned long flags;
1290 1316
@@ -1296,6 +1322,10 @@ static int dwc3_suspend_common(struct dwc3 *dwc)
1296 dwc3_core_exit(dwc); 1322 dwc3_core_exit(dwc);
1297 break; 1323 break;
1298 case DWC3_GCTL_PRTCAP_HOST: 1324 case DWC3_GCTL_PRTCAP_HOST:
1325 /* do nothing during host runtime_suspend */
1326 if (!PMSG_IS_AUTO(msg))
1327 dwc3_core_exit(dwc);
1328 break;
1299 default: 1329 default:
1300 /* do nothing */ 1330 /* do nothing */
1301 break; 1331 break;
@@ -1304,7 +1334,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc)
1304 return 0; 1334 return 0;
1305} 1335}
1306 1336
1307static int dwc3_resume_common(struct dwc3 *dwc) 1337static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
1308{ 1338{
1309 unsigned long flags; 1339 unsigned long flags;
1310 int ret; 1340 int ret;
@@ -1320,6 +1350,13 @@ static int dwc3_resume_common(struct dwc3 *dwc)
1320 spin_unlock_irqrestore(&dwc->lock, flags); 1350 spin_unlock_irqrestore(&dwc->lock, flags);
1321 break; 1351 break;
1322 case DWC3_GCTL_PRTCAP_HOST: 1352 case DWC3_GCTL_PRTCAP_HOST:
1353 /* nothing to do on host runtime_resume */
1354 if (!PMSG_IS_AUTO(msg)) {
1355 ret = dwc3_core_init(dwc);
1356 if (ret)
1357 return ret;
1358 }
1359 break;
1323 default: 1360 default:
1324 /* do nothing */ 1361 /* do nothing */
1325 break; 1362 break;
@@ -1331,12 +1368,11 @@ static int dwc3_resume_common(struct dwc3 *dwc)
1331static int dwc3_runtime_checks(struct dwc3 *dwc) 1368static int dwc3_runtime_checks(struct dwc3 *dwc)
1332{ 1369{
1333 switch (dwc->current_dr_role) { 1370 switch (dwc->current_dr_role) {
1334 case USB_DR_MODE_PERIPHERAL: 1371 case DWC3_GCTL_PRTCAP_DEVICE:
1335 case USB_DR_MODE_OTG:
1336 if (dwc->connected) 1372 if (dwc->connected)
1337 return -EBUSY; 1373 return -EBUSY;
1338 break; 1374 break;
1339 case USB_DR_MODE_HOST: 1375 case DWC3_GCTL_PRTCAP_HOST:
1340 default: 1376 default:
1341 /* do nothing */ 1377 /* do nothing */
1342 break; 1378 break;
@@ -1353,7 +1389,7 @@ static int dwc3_runtime_suspend(struct device *dev)
1353 if (dwc3_runtime_checks(dwc)) 1389 if (dwc3_runtime_checks(dwc))
1354 return -EBUSY; 1390 return -EBUSY;
1355 1391
1356 ret = dwc3_suspend_common(dwc); 1392 ret = dwc3_suspend_common(dwc, PMSG_AUTO_SUSPEND);
1357 if (ret) 1393 if (ret)
1358 return ret; 1394 return ret;
1359 1395
@@ -1369,7 +1405,7 @@ static int dwc3_runtime_resume(struct device *dev)
1369 1405
1370 device_init_wakeup(dev, false); 1406 device_init_wakeup(dev, false);
1371 1407
1372 ret = dwc3_resume_common(dwc); 1408 ret = dwc3_resume_common(dwc, PMSG_AUTO_RESUME);
1373 if (ret) 1409 if (ret)
1374 return ret; 1410 return ret;
1375 1411
@@ -1416,7 +1452,7 @@ static int dwc3_suspend(struct device *dev)
1416 struct dwc3 *dwc = dev_get_drvdata(dev); 1452 struct dwc3 *dwc = dev_get_drvdata(dev);
1417 int ret; 1453 int ret;
1418 1454
1419 ret = dwc3_suspend_common(dwc); 1455 ret = dwc3_suspend_common(dwc, PMSG_SUSPEND);
1420 if (ret) 1456 if (ret)
1421 return ret; 1457 return ret;
1422 1458
@@ -1432,7 +1468,7 @@ static int dwc3_resume(struct device *dev)
1432 1468
1433 pinctrl_pm_select_default_state(dev); 1469 pinctrl_pm_select_default_state(dev);
1434 1470
1435 ret = dwc3_resume_common(dwc); 1471 ret = dwc3_resume_common(dwc, PMSG_RESUME);
1436 if (ret) 1472 if (ret)
1437 return ret; 1473 return ret;
1438 1474
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 03c7aaaac926..860d2bc184d1 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -158,13 +158,15 @@
158#define DWC3_GDBGFIFOSPACE_TYPE(n) (((n) << 5) & 0x1e0) 158#define DWC3_GDBGFIFOSPACE_TYPE(n) (((n) << 5) & 0x1e0)
159#define DWC3_GDBGFIFOSPACE_SPACE_AVAILABLE(n) (((n) >> 16) & 0xffff) 159#define DWC3_GDBGFIFOSPACE_SPACE_AVAILABLE(n) (((n) >> 16) & 0xffff)
160 160
161#define DWC3_TXFIFOQ 1 161#define DWC3_TXFIFOQ 0
162#define DWC3_RXFIFOQ 3 162#define DWC3_RXFIFOQ 1
163#define DWC3_TXREQQ 5 163#define DWC3_TXREQQ 2
164#define DWC3_RXREQQ 7 164#define DWC3_RXREQQ 3
165#define DWC3_RXINFOQ 9 165#define DWC3_RXINFOQ 4
166#define DWC3_DESCFETCHQ 13 166#define DWC3_PSTATQ 5
167#define DWC3_EVENTQ 15 167#define DWC3_DESCFETCHQ 6
168#define DWC3_EVENTQ 7
169#define DWC3_AUXEVENTQ 8
168 170
169/* Global RX Threshold Configuration Register */ 171/* Global RX Threshold Configuration Register */
170#define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 19) 172#define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 19)
@@ -795,7 +797,9 @@ struct dwc3_scratchpad_array {
795 * @usb3_phy: pointer to USB3 PHY 797 * @usb3_phy: pointer to USB3 PHY
796 * @usb2_generic_phy: pointer to USB2 PHY 798 * @usb2_generic_phy: pointer to USB2 PHY
797 * @usb3_generic_phy: pointer to USB3 PHY 799 * @usb3_generic_phy: pointer to USB3 PHY
800 * @phys_ready: flag to indicate that PHYs are ready
798 * @ulpi: pointer to ulpi interface 801 * @ulpi: pointer to ulpi interface
802 * @ulpi_ready: flag to indicate that ULPI is initialized
799 * @u2sel: parameter from Set SEL request. 803 * @u2sel: parameter from Set SEL request.
800 * @u2pel: parameter from Set SEL request. 804 * @u2pel: parameter from Set SEL request.
801 * @u1sel: parameter from Set SEL request. 805 * @u1sel: parameter from Set SEL request.
@@ -893,7 +897,10 @@ struct dwc3 {
893 struct phy *usb2_generic_phy; 897 struct phy *usb2_generic_phy;
894 struct phy *usb3_generic_phy; 898 struct phy *usb3_generic_phy;
895 899
900 bool phys_ready;
901
896 struct ulpi *ulpi; 902 struct ulpi *ulpi;
903 bool ulpi_ready;
897 904
898 void __iomem *regs; 905 void __iomem *regs;
899 size_t regs_size; 906 size_t regs_size;
diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
index 7ae0eefc7cc7..e54c3622eb28 100644
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -143,6 +143,7 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
143 clk_disable_unprepare(simple->clks[i]); 143 clk_disable_unprepare(simple->clks[i]);
144 clk_put(simple->clks[i]); 144 clk_put(simple->clks[i]);
145 } 145 }
146 simple->num_clocks = 0;
146 147
147 reset_control_assert(simple->resets); 148 reset_control_assert(simple->resets);
148 reset_control_put(simple->resets); 149 reset_control_put(simple->resets);
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index a4719e853b85..ed8b86517675 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -582,9 +582,25 @@ static int dwc3_omap_resume(struct device *dev)
582 return 0; 582 return 0;
583} 583}
584 584
585static void dwc3_omap_complete(struct device *dev)
586{
587 struct dwc3_omap *omap = dev_get_drvdata(dev);
588
589 if (extcon_get_state(omap->edev, EXTCON_USB))
590 dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
591 else
592 dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
593
594 if (extcon_get_state(omap->edev, EXTCON_USB_HOST))
595 dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
596 else
597 dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
598}
599
585static const struct dev_pm_ops dwc3_omap_dev_pm_ops = { 600static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
586 601
587 SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume) 602 SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
603 .complete = dwc3_omap_complete,
588}; 604};
589 605
590#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops) 606#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 9c2e4a17918e..18be31d5743a 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -854,7 +854,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
854 trb++; 854 trb++;
855 trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 855 trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
856 trace_dwc3_complete_trb(ep0, trb); 856 trace_dwc3_complete_trb(ep0, trb);
857 ep0->trb_enqueue = 0; 857
858 if (r->direction)
859 dwc->eps[1]->trb_enqueue = 0;
860 else
861 dwc->eps[0]->trb_enqueue = 0;
862
858 dwc->ep0_bounced = false; 863 dwc->ep0_bounced = false;
859 } 864 }
860 865
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 616ef49ccb49..2bda4eb1e9ac 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2745,6 +2745,8 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
2745 break; 2745 break;
2746 } 2746 }
2747 2747
2748 dwc->eps[1]->endpoint.maxpacket = dwc->gadget.ep0->maxpacket;
2749
2748 /* Enable USB2 LPM Capability */ 2750 /* Enable USB2 LPM Capability */
2749 2751
2750 if ((dwc->revision > DWC3_REVISION_194A) && 2752 if ((dwc->revision > DWC3_REVISION_194A) &&
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 8f2cf3baa19c..c2592d883f67 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -1855,44 +1855,20 @@ static int ffs_func_eps_enable(struct ffs_function *func)
1855 1855
1856 spin_lock_irqsave(&func->ffs->eps_lock, flags); 1856 spin_lock_irqsave(&func->ffs->eps_lock, flags);
1857 while(count--) { 1857 while(count--) {
1858 struct usb_endpoint_descriptor *ds;
1859 struct usb_ss_ep_comp_descriptor *comp_desc = NULL;
1860 int needs_comp_desc = false;
1861 int desc_idx;
1862
1863 if (ffs->gadget->speed == USB_SPEED_SUPER) {
1864 desc_idx = 2;
1865 needs_comp_desc = true;
1866 } else if (ffs->gadget->speed == USB_SPEED_HIGH)
1867 desc_idx = 1;
1868 else
1869 desc_idx = 0;
1870
1871 /* fall-back to lower speed if desc missing for current speed */
1872 do {
1873 ds = ep->descs[desc_idx];
1874 } while (!ds && --desc_idx >= 0);
1875
1876 if (!ds) {
1877 ret = -EINVAL;
1878 break;
1879 }
1880
1881 ep->ep->driver_data = ep; 1858 ep->ep->driver_data = ep;
1882 ep->ep->desc = ds;
1883 1859
1884 if (needs_comp_desc) { 1860 ret = config_ep_by_speed(func->gadget, &func->function, ep->ep);
1885 comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + 1861 if (ret) {
1886 USB_DT_ENDPOINT_SIZE); 1862 pr_err("%s: config_ep_by_speed(%s) returned %d\n",
1887 ep->ep->maxburst = comp_desc->bMaxBurst + 1; 1863 __func__, ep->ep->name, ret);
1888 ep->ep->comp_desc = comp_desc; 1864 break;
1889 } 1865 }
1890 1866
1891 ret = usb_ep_enable(ep->ep); 1867 ret = usb_ep_enable(ep->ep);
1892 if (likely(!ret)) { 1868 if (likely(!ret)) {
1893 epfile->ep = ep; 1869 epfile->ep = ep;
1894 epfile->in = usb_endpoint_dir_in(ds); 1870 epfile->in = usb_endpoint_dir_in(ep->ep->desc);
1895 epfile->isoc = usb_endpoint_xfer_isoc(ds); 1871 epfile->isoc = usb_endpoint_xfer_isoc(ep->ep->desc);
1896 } else { 1872 } else {
1897 break; 1873 break;
1898 } 1874 }
@@ -2979,10 +2955,8 @@ static int _ffs_func_bind(struct usb_configuration *c,
2979 struct ffs_data *ffs = func->ffs; 2955 struct ffs_data *ffs = func->ffs;
2980 2956
2981 const int full = !!func->ffs->fs_descs_count; 2957 const int full = !!func->ffs->fs_descs_count;
2982 const int high = gadget_is_dualspeed(func->gadget) && 2958 const int high = !!func->ffs->hs_descs_count;
2983 func->ffs->hs_descs_count; 2959 const int super = !!func->ffs->ss_descs_count;
2984 const int super = gadget_is_superspeed(func->gadget) &&
2985 func->ffs->ss_descs_count;
2986 2960
2987 int fs_len, hs_len, ss_len, ret, i; 2961 int fs_len, hs_len, ss_len, ret, i;
2988 struct ffs_ep *eps_ptr; 2962 struct ffs_ep *eps_ptr;
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 11fe788b4308..d2dc1f00180b 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -524,6 +524,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
524 dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); 524 dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
525 return ret; 525 return ret;
526 } 526 }
527 iad_desc.bFirstInterface = ret;
528
527 std_ac_if_desc.bInterfaceNumber = ret; 529 std_ac_if_desc.bInterfaceNumber = ret;
528 uac2->ac_intf = ret; 530 uac2->ac_intf = ret;
529 uac2->ac_alt = 0; 531 uac2->ac_alt = 0;
diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
index 1e9567091d86..0875d38476ee 100644
--- a/drivers/usb/gadget/udc/Kconfig
+++ b/drivers/usb/gadget/udc/Kconfig
@@ -274,7 +274,6 @@ config USB_SNP_UDC_PLAT
274 tristate "Synopsys USB 2.0 Device controller" 274 tristate "Synopsys USB 2.0 Device controller"
275 depends on USB_GADGET && OF && HAS_DMA 275 depends on USB_GADGET && OF && HAS_DMA
276 depends on EXTCON || EXTCON=n 276 depends on EXTCON || EXTCON=n
277 select USB_GADGET_DUALSPEED
278 select USB_SNP_CORE 277 select USB_SNP_CORE
279 default ARCH_BCM_IPROC 278 default ARCH_BCM_IPROC
280 help 279 help
diff --git a/drivers/usb/gadget/udc/bdc/bdc_pci.c b/drivers/usb/gadget/udc/bdc/bdc_pci.c
index 1e940f054cb8..6dbc489513cd 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_pci.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_pci.c
@@ -77,6 +77,7 @@ static int bdc_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
77 if (ret) { 77 if (ret) {
78 dev_err(&pci->dev, 78 dev_err(&pci->dev,
79 "couldn't add resources to bdc device\n"); 79 "couldn't add resources to bdc device\n");
80 platform_device_put(bdc);
80 return ret; 81 return ret;
81 } 82 }
82 83
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index 859d5b11ba4c..1f8b19d9cf97 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -180,8 +180,8 @@ EXPORT_SYMBOL_GPL(usb_ep_alloc_request);
180void usb_ep_free_request(struct usb_ep *ep, 180void usb_ep_free_request(struct usb_ep *ep,
181 struct usb_request *req) 181 struct usb_request *req)
182{ 182{
183 ep->ops->free_request(ep, req);
184 trace_usb_ep_free_request(ep, req, 0); 183 trace_usb_ep_free_request(ep, req, 0);
184 ep->ops->free_request(ep, req);
185} 185}
186EXPORT_SYMBOL_GPL(usb_ep_free_request); 186EXPORT_SYMBOL_GPL(usb_ep_free_request);
187 187
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index e5b4ee96c4bf..56b517a38865 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -1305,7 +1305,7 @@ static void udc_reset_ep_queue(struct fsl_udc *udc, u8 pipe)
1305{ 1305{
1306 struct fsl_ep *ep = get_ep_by_pipe(udc, pipe); 1306 struct fsl_ep *ep = get_ep_by_pipe(udc, pipe);
1307 1307
1308 if (ep->name) 1308 if (ep->ep.name)
1309 nuke(ep, -ESHUTDOWN); 1309 nuke(ep, -ESHUTDOWN);
1310} 1310}
1311 1311
@@ -1693,7 +1693,7 @@ static void dtd_complete_irq(struct fsl_udc *udc)
1693 curr_ep = get_ep_by_pipe(udc, i); 1693 curr_ep = get_ep_by_pipe(udc, i);
1694 1694
1695 /* If the ep is configured */ 1695 /* If the ep is configured */
1696 if (curr_ep->name == NULL) { 1696 if (!curr_ep->ep.name) {
1697 WARNING("Invalid EP?"); 1697 WARNING("Invalid EP?");
1698 continue; 1698 continue;
1699 } 1699 }
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 6e87af248367..409cde4e6a51 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2410,7 +2410,7 @@ static int renesas_usb3_remove(struct platform_device *pdev)
2410 __renesas_usb3_ep_free_request(usb3->ep0_req); 2410 __renesas_usb3_ep_free_request(usb3->ep0_req);
2411 if (usb3->phy) 2411 if (usb3->phy)
2412 phy_put(usb3->phy); 2412 phy_put(usb3->phy);
2413 pm_runtime_disable(usb3_to_dev(usb3)); 2413 pm_runtime_disable(&pdev->dev);
2414 2414
2415 return 0; 2415 return 0;
2416} 2416}
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 6150bed7cfa8..4fcfb3084b36 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -633,14 +633,6 @@ config USB_UHCI_ASPEED
633 bool 633 bool
634 default y if ARCH_ASPEED 634 default y if ARCH_ASPEED
635 635
636config USB_UHCI_BIG_ENDIAN_MMIO
637 bool
638 default y if SPARC_LEON
639
640config USB_UHCI_BIG_ENDIAN_DESC
641 bool
642 default y if SPARC_LEON
643
644config USB_FHCI_HCD 636config USB_FHCI_HCD
645 tristate "Freescale QE USB Host Controller support" 637 tristate "Freescale QE USB Host Controller support"
646 depends on OF_GPIO && QE_GPIO && QUICC_ENGINE 638 depends on OF_GPIO && QE_GPIO && QUICC_ENGINE
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index facafdf8fb95..d7641cbdee43 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -774,12 +774,12 @@ static struct urb *request_single_step_set_feature_urb(
774 atomic_inc(&urb->use_count); 774 atomic_inc(&urb->use_count);
775 atomic_inc(&urb->dev->urbnum); 775 atomic_inc(&urb->dev->urbnum);
776 urb->setup_dma = dma_map_single( 776 urb->setup_dma = dma_map_single(
777 hcd->self.controller, 777 hcd->self.sysdev,
778 urb->setup_packet, 778 urb->setup_packet,
779 sizeof(struct usb_ctrlrequest), 779 sizeof(struct usb_ctrlrequest),
780 DMA_TO_DEVICE); 780 DMA_TO_DEVICE);
781 urb->transfer_dma = dma_map_single( 781 urb->transfer_dma = dma_map_single(
782 hcd->self.controller, 782 hcd->self.sysdev,
783 urb->transfer_buffer, 783 urb->transfer_buffer,
784 urb->transfer_buffer_length, 784 urb->transfer_buffer_length,
785 DMA_FROM_DEVICE); 785 DMA_FROM_DEVICE);
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 88158324dcae..327630405695 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1188,10 +1188,10 @@ static int submit_single_step_set_feature(
1188 * 15 secs after the setup 1188 * 15 secs after the setup
1189 */ 1189 */
1190 if (is_setup) { 1190 if (is_setup) {
1191 /* SETUP pid */ 1191 /* SETUP pid, and interrupt after SETUP completion */
1192 qtd_fill(ehci, qtd, urb->setup_dma, 1192 qtd_fill(ehci, qtd, urb->setup_dma,
1193 sizeof(struct usb_ctrlrequest), 1193 sizeof(struct usb_ctrlrequest),
1194 token | (2 /* "setup" */ << 8), 8); 1194 QTD_IOC | token | (2 /* "setup" */ << 8), 8);
1195 1195
1196 submit_async(ehci, urb, &qtd_list, GFP_ATOMIC); 1196 submit_async(ehci, urb, &qtd_list, GFP_ATOMIC);
1197 return 0; /*Return now; we shall come back after 15 seconds*/ 1197 return 0; /*Return now; we shall come back after 15 seconds*/
@@ -1228,12 +1228,8 @@ static int submit_single_step_set_feature(
1228 qtd_prev->hw_next = QTD_NEXT(ehci, qtd->qtd_dma); 1228 qtd_prev->hw_next = QTD_NEXT(ehci, qtd->qtd_dma);
1229 list_add_tail(&qtd->qtd_list, head); 1229 list_add_tail(&qtd->qtd_list, head);
1230 1230
1231 /* dont fill any data in such packets */ 1231 /* Interrupt after STATUS completion */
1232 qtd_fill(ehci, qtd, 0, 0, token, 0); 1232 qtd_fill(ehci, qtd, 0, 0, token | QTD_IOC, 0);
1233
1234 /* by default, enable interrupt on urb completion */
1235 if (likely(!(urb->transfer_flags & URB_NO_INTERRUPT)))
1236 qtd->hw_token |= cpu_to_hc32(ehci, QTD_IOC);
1237 1233
1238 submit_async(ehci, urb, &qtd_list, GFP_KERNEL); 1234 submit_async(ehci, urb, &qtd_list, GFP_KERNEL);
1239 1235
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index ee9676349333..84f88fa411cd 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -74,6 +74,7 @@ static const char hcd_name [] = "ohci_hcd";
74 74
75#define STATECHANGE_DELAY msecs_to_jiffies(300) 75#define STATECHANGE_DELAY msecs_to_jiffies(300)
76#define IO_WATCHDOG_DELAY msecs_to_jiffies(275) 76#define IO_WATCHDOG_DELAY msecs_to_jiffies(275)
77#define IO_WATCHDOG_OFF 0xffffff00
77 78
78#include "ohci.h" 79#include "ohci.h"
79#include "pci-quirks.h" 80#include "pci-quirks.h"
@@ -231,7 +232,7 @@ static int ohci_urb_enqueue (
231 } 232 }
232 233
233 /* Start up the I/O watchdog timer, if it's not running */ 234 /* Start up the I/O watchdog timer, if it's not running */
234 if (!timer_pending(&ohci->io_watchdog) && 235 if (ohci->prev_frame_no == IO_WATCHDOG_OFF &&
235 list_empty(&ohci->eds_in_use) && 236 list_empty(&ohci->eds_in_use) &&
236 !(ohci->flags & OHCI_QUIRK_QEMU)) { 237 !(ohci->flags & OHCI_QUIRK_QEMU)) {
237 ohci->prev_frame_no = ohci_frame_no(ohci); 238 ohci->prev_frame_no = ohci_frame_no(ohci);
@@ -501,6 +502,7 @@ static int ohci_init (struct ohci_hcd *ohci)
501 return 0; 502 return 0;
502 503
503 timer_setup(&ohci->io_watchdog, io_watchdog_func, 0); 504 timer_setup(&ohci->io_watchdog, io_watchdog_func, 0);
505 ohci->prev_frame_no = IO_WATCHDOG_OFF;
504 506
505 ohci->hcca = dma_alloc_coherent (hcd->self.controller, 507 ohci->hcca = dma_alloc_coherent (hcd->self.controller,
506 sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL); 508 sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
@@ -730,7 +732,7 @@ static void io_watchdog_func(struct timer_list *t)
730 u32 head; 732 u32 head;
731 struct ed *ed; 733 struct ed *ed;
732 struct td *td, *td_start, *td_next; 734 struct td *td, *td_start, *td_next;
733 unsigned frame_no; 735 unsigned frame_no, prev_frame_no = IO_WATCHDOG_OFF;
734 unsigned long flags; 736 unsigned long flags;
735 737
736 spin_lock_irqsave(&ohci->lock, flags); 738 spin_lock_irqsave(&ohci->lock, flags);
@@ -835,7 +837,7 @@ static void io_watchdog_func(struct timer_list *t)
835 } 837 }
836 } 838 }
837 if (!list_empty(&ohci->eds_in_use)) { 839 if (!list_empty(&ohci->eds_in_use)) {
838 ohci->prev_frame_no = frame_no; 840 prev_frame_no = frame_no;
839 ohci->prev_wdh_cnt = ohci->wdh_cnt; 841 ohci->prev_wdh_cnt = ohci->wdh_cnt;
840 ohci->prev_donehead = ohci_readl(ohci, 842 ohci->prev_donehead = ohci_readl(ohci,
841 &ohci->regs->donehead); 843 &ohci->regs->donehead);
@@ -845,6 +847,7 @@ static void io_watchdog_func(struct timer_list *t)
845 } 847 }
846 848
847 done: 849 done:
850 ohci->prev_frame_no = prev_frame_no;
848 spin_unlock_irqrestore(&ohci->lock, flags); 851 spin_unlock_irqrestore(&ohci->lock, flags);
849} 852}
850 853
@@ -973,6 +976,7 @@ static void ohci_stop (struct usb_hcd *hcd)
973 if (quirk_nec(ohci)) 976 if (quirk_nec(ohci))
974 flush_work(&ohci->nec_work); 977 flush_work(&ohci->nec_work);
975 del_timer_sync(&ohci->io_watchdog); 978 del_timer_sync(&ohci->io_watchdog);
979 ohci->prev_frame_no = IO_WATCHDOG_OFF;
976 980
977 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); 981 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
978 ohci_usb_reset(ohci); 982 ohci_usb_reset(ohci);
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index fb7aaa3b9d06..634f3c7bf774 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -311,8 +311,10 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
311 rc = ohci_rh_suspend (ohci, 0); 311 rc = ohci_rh_suspend (ohci, 0);
312 spin_unlock_irq (&ohci->lock); 312 spin_unlock_irq (&ohci->lock);
313 313
314 if (rc == 0) 314 if (rc == 0) {
315 del_timer_sync(&ohci->io_watchdog); 315 del_timer_sync(&ohci->io_watchdog);
316 ohci->prev_frame_no = IO_WATCHDOG_OFF;
317 }
316 return rc; 318 return rc;
317} 319}
318 320
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index b2ec8c399363..4ccb85a67bb3 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -1019,6 +1019,8 @@ skip_ed:
1019 * have modified this list. normally it's just prepending 1019 * have modified this list. normally it's just prepending
1020 * entries (which we'd ignore), but paranoia won't hurt. 1020 * entries (which we'd ignore), but paranoia won't hurt.
1021 */ 1021 */
1022 *last = ed->ed_next;
1023 ed->ed_next = NULL;
1022 modified = 0; 1024 modified = 0;
1023 1025
1024 /* unlink urbs as requested, but rescan the list after 1026 /* unlink urbs as requested, but rescan the list after
@@ -1077,21 +1079,22 @@ rescan_this:
1077 goto rescan_this; 1079 goto rescan_this;
1078 1080
1079 /* 1081 /*
1080 * If no TDs are queued, take ED off the ed_rm_list. 1082 * If no TDs are queued, ED is now idle.
1081 * Otherwise, if the HC is running, reschedule. 1083 * Otherwise, if the HC is running, reschedule.
1082 * If not, leave it on the list for further dequeues. 1084 * If the HC isn't running, add ED back to the
1085 * start of the list for later processing.
1083 */ 1086 */
1084 if (list_empty(&ed->td_list)) { 1087 if (list_empty(&ed->td_list)) {
1085 *last = ed->ed_next;
1086 ed->ed_next = NULL;
1087 ed->state = ED_IDLE; 1088 ed->state = ED_IDLE;
1088 list_del(&ed->in_use_list); 1089 list_del(&ed->in_use_list);
1089 } else if (ohci->rh_state == OHCI_RH_RUNNING) { 1090 } else if (ohci->rh_state == OHCI_RH_RUNNING) {
1090 *last = ed->ed_next;
1091 ed->ed_next = NULL;
1092 ed_schedule(ohci, ed); 1091 ed_schedule(ohci, ed);
1093 } else { 1092 } else {
1094 last = &ed->ed_next; 1093 ed->ed_next = ohci->ed_rm_list;
1094 ohci->ed_rm_list = ed;
1095 /* Don't loop on the same ED */
1096 if (last == &ohci->ed_rm_list)
1097 last = &ed->ed_next;
1095 } 1098 }
1096 1099
1097 if (modified) 1100 if (modified)
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 161536717025..67ad4bb6919a 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -66,6 +66,23 @@
66#define AX_INDXC 0x30 66#define AX_INDXC 0x30
67#define AX_DATAC 0x34 67#define AX_DATAC 0x34
68 68
69#define PT_ADDR_INDX 0xE8
70#define PT_READ_INDX 0xE4
71#define PT_SIG_1_ADDR 0xA520
72#define PT_SIG_2_ADDR 0xA521
73#define PT_SIG_3_ADDR 0xA522
74#define PT_SIG_4_ADDR 0xA523
75#define PT_SIG_1_DATA 0x78
76#define PT_SIG_2_DATA 0x56
77#define PT_SIG_3_DATA 0x34
78#define PT_SIG_4_DATA 0x12
79#define PT4_P1_REG 0xB521
80#define PT4_P2_REG 0xB522
81#define PT2_P1_REG 0xD520
82#define PT2_P2_REG 0xD521
83#define PT1_P1_REG 0xD522
84#define PT1_P2_REG 0xD523
85
69#define NB_PCIE_INDX_ADDR 0xe0 86#define NB_PCIE_INDX_ADDR 0xe0
70#define NB_PCIE_INDX_DATA 0xe4 87#define NB_PCIE_INDX_DATA 0xe4
71#define PCIE_P_CNTL 0x10040 88#define PCIE_P_CNTL 0x10040
@@ -513,6 +530,98 @@ void usb_amd_dev_put(void)
513EXPORT_SYMBOL_GPL(usb_amd_dev_put); 530EXPORT_SYMBOL_GPL(usb_amd_dev_put);
514 531
515/* 532/*
533 * Check if port is disabled in BIOS on AMD Promontory host.
534 * BIOS Disabled ports may wake on connect/disconnect and need
535 * driver workaround to keep them disabled.
536 * Returns true if port is marked disabled.
537 */
538bool usb_amd_pt_check_port(struct device *device, int port)
539{
540 unsigned char value, port_shift;
541 struct pci_dev *pdev;
542 u16 reg;
543
544 pdev = to_pci_dev(device);
545 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_1_ADDR);
546
547 pci_read_config_byte(pdev, PT_READ_INDX, &value);
548 if (value != PT_SIG_1_DATA)
549 return false;
550
551 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_2_ADDR);
552
553 pci_read_config_byte(pdev, PT_READ_INDX, &value);
554 if (value != PT_SIG_2_DATA)
555 return false;
556
557 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_3_ADDR);
558
559 pci_read_config_byte(pdev, PT_READ_INDX, &value);
560 if (value != PT_SIG_3_DATA)
561 return false;
562
563 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_4_ADDR);
564
565 pci_read_config_byte(pdev, PT_READ_INDX, &value);
566 if (value != PT_SIG_4_DATA)
567 return false;
568
569 /* Check disabled port setting, if bit is set port is enabled */
570 switch (pdev->device) {
571 case 0x43b9:
572 case 0x43ba:
573 /*
574 * device is AMD_PROMONTORYA_4(0x43b9) or PROMONTORYA_3(0x43ba)
575 * PT4_P1_REG bits[7..1] represents USB2.0 ports 6 to 0
576 * PT4_P2_REG bits[6..0] represents ports 13 to 7
577 */
578 if (port > 6) {
579 reg = PT4_P2_REG;
580 port_shift = port - 7;
581 } else {
582 reg = PT4_P1_REG;
583 port_shift = port + 1;
584 }
585 break;
586 case 0x43bb:
587 /*
588 * device is AMD_PROMONTORYA_2(0x43bb)
589 * PT2_P1_REG bits[7..5] represents USB2.0 ports 2 to 0
590 * PT2_P2_REG bits[5..0] represents ports 9 to 3
591 */
592 if (port > 2) {
593 reg = PT2_P2_REG;
594 port_shift = port - 3;
595 } else {
596 reg = PT2_P1_REG;
597 port_shift = port + 5;
598 }
599 break;
600 case 0x43bc:
601 /*
602 * device is AMD_PROMONTORYA_1(0x43bc)
603 * PT1_P1_REG[7..4] represents USB2.0 ports 3 to 0
604 * PT1_P2_REG[5..0] represents ports 9 to 4
605 */
606 if (port > 3) {
607 reg = PT1_P2_REG;
608 port_shift = port - 4;
609 } else {
610 reg = PT1_P1_REG;
611 port_shift = port + 4;
612 }
613 break;
614 default:
615 return false;
616 }
617 pci_write_config_word(pdev, PT_ADDR_INDX, reg);
618 pci_read_config_byte(pdev, PT_READ_INDX, &value);
619
620 return !(value & BIT(port_shift));
621}
622EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
623
624/*
516 * Make sure the controller is completely inactive, unable to 625 * Make sure the controller is completely inactive, unable to
517 * generate interrupts or do DMA. 626 * generate interrupts or do DMA.
518 */ 627 */
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
index b68dcb5dd0fd..4ca0d9b7e463 100644
--- a/drivers/usb/host/pci-quirks.h
+++ b/drivers/usb/host/pci-quirks.h
@@ -17,6 +17,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
17void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); 17void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
18void sb800_prefetch(struct device *dev, int on); 18void sb800_prefetch(struct device *dev, int on);
19bool usb_xhci_needs_pci_reset(struct pci_dev *pdev); 19bool usb_xhci_needs_pci_reset(struct pci_dev *pdev);
20bool usb_amd_pt_check_port(struct device *device, int port);
20#else 21#else
21struct pci_dev; 22struct pci_dev;
22static inline void usb_amd_quirk_pll_disable(void) {} 23static inline void usb_amd_quirk_pll_disable(void) {}
@@ -25,6 +26,10 @@ static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
25static inline void usb_amd_dev_put(void) {} 26static inline void usb_amd_dev_put(void) {}
26static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} 27static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
27static inline void sb800_prefetch(struct device *dev, int on) {} 28static inline void sb800_prefetch(struct device *dev, int on) {}
29static inline bool usb_amd_pt_check_port(struct device *device, int port)
30{
31 return false;
32}
28#endif /* CONFIG_USB_PCI */ 33#endif /* CONFIG_USB_PCI */
29 34
30#endif /* __LINUX_USB_PCI_QUIRKS_H */ 35#endif /* __LINUX_USB_PCI_QUIRKS_H */
diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c
index e26e685d8a57..5851052d4668 100644
--- a/drivers/usb/host/xhci-debugfs.c
+++ b/drivers/usb/host/xhci-debugfs.c
@@ -211,7 +211,7 @@ static void xhci_ring_dump_segment(struct seq_file *s,
211static int xhci_ring_trb_show(struct seq_file *s, void *unused) 211static int xhci_ring_trb_show(struct seq_file *s, void *unused)
212{ 212{
213 int i; 213 int i;
214 struct xhci_ring *ring = s->private; 214 struct xhci_ring *ring = *(struct xhci_ring **)s->private;
215 struct xhci_segment *seg = ring->first_seg; 215 struct xhci_segment *seg = ring->first_seg;
216 216
217 for (i = 0; i < ring->num_segs; i++) { 217 for (i = 0; i < ring->num_segs; i++) {
@@ -387,7 +387,7 @@ void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci,
387 387
388 snprintf(epriv->name, sizeof(epriv->name), "ep%02d", ep_index); 388 snprintf(epriv->name, sizeof(epriv->name), "ep%02d", ep_index);
389 epriv->root = xhci_debugfs_create_ring_dir(xhci, 389 epriv->root = xhci_debugfs_create_ring_dir(xhci,
390 &dev->eps[ep_index].new_ring, 390 &dev->eps[ep_index].ring,
391 epriv->name, 391 epriv->name,
392 spriv->root); 392 spriv->root);
393 spriv->eps[ep_index] = epriv; 393 spriv->eps[ep_index] = epriv;
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 46d5e08f05f1..72ebbc908e19 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1224,17 +1224,17 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1224 temp = readl(port_array[wIndex]); 1224 temp = readl(port_array[wIndex]);
1225 break; 1225 break;
1226 } 1226 }
1227 1227 /* Port must be enabled */
1228 /* Software should not attempt to set 1228 if (!(temp & PORT_PE)) {
1229 * port link state above '3' (U3) and the port 1229 retval = -ENODEV;
1230 * must be enabled. 1230 break;
1231 */ 1231 }
1232 if ((temp & PORT_PE) == 0 || 1232 /* Can't set port link state above '3' (U3) */
1233 (link_state > USB_SS_PORT_LS_U3)) { 1233 if (link_state > USB_SS_PORT_LS_U3) {
1234 xhci_warn(xhci, "Cannot set link state.\n"); 1234 xhci_warn(xhci, "Cannot set port %d link state %d\n",
1235 wIndex, link_state);
1235 goto error; 1236 goto error;
1236 } 1237 }
1237
1238 if (link_state == USB_SS_PORT_LS_U3) { 1238 if (link_state == USB_SS_PORT_LS_U3) {
1239 slot_id = xhci_find_slot_id_by_port(hcd, xhci, 1239 slot_id = xhci_find_slot_id_by_port(hcd, xhci,
1240 wIndex + 1); 1240 wIndex + 1);
@@ -1522,6 +1522,13 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
1522 t2 |= PORT_WKOC_E | PORT_WKCONN_E; 1522 t2 |= PORT_WKOC_E | PORT_WKCONN_E;
1523 t2 &= ~PORT_WKDISC_E; 1523 t2 &= ~PORT_WKDISC_E;
1524 } 1524 }
1525
1526 if ((xhci->quirks & XHCI_U2_DISABLE_WAKE) &&
1527 (hcd->speed < HCD_USB3)) {
1528 if (usb_amd_pt_check_port(hcd->self.controller,
1529 port_index))
1530 t2 &= ~PORT_WAKE_BITS;
1531 }
1525 } else 1532 } else
1526 t2 &= ~PORT_WAKE_BITS; 1533 t2 &= ~PORT_WAKE_BITS;
1527 1534
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 6c79037876db..5262fa571a5d 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -42,6 +42,10 @@
42#define PCI_DEVICE_ID_INTEL_APL_XHCI 0x5aa8 42#define PCI_DEVICE_ID_INTEL_APL_XHCI 0x5aa8
43#define PCI_DEVICE_ID_INTEL_DNV_XHCI 0x19d0 43#define PCI_DEVICE_ID_INTEL_DNV_XHCI 0x19d0
44 44
45#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
46#define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba
47#define PCI_DEVICE_ID_AMD_PROMONTORYA_2 0x43bb
48#define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc
45#define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142 49#define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
46 50
47static const char hcd_name[] = "xhci_hcd"; 51static const char hcd_name[] = "xhci_hcd";
@@ -125,6 +129,13 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
125 if (pdev->vendor == PCI_VENDOR_ID_AMD) 129 if (pdev->vendor == PCI_VENDOR_ID_AMD)
126 xhci->quirks |= XHCI_TRUST_TX_LENGTH; 130 xhci->quirks |= XHCI_TRUST_TX_LENGTH;
127 131
132 if ((pdev->vendor == PCI_VENDOR_ID_AMD) &&
133 ((pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4) ||
134 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_3) ||
135 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2) ||
136 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1)))
137 xhci->quirks |= XHCI_U2_DISABLE_WAKE;
138
128 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { 139 if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
129 xhci->quirks |= XHCI_LPM_SUPPORT; 140 xhci->quirks |= XHCI_LPM_SUPPORT;
130 xhci->quirks |= XHCI_INTEL_HOST; 141 xhci->quirks |= XHCI_INTEL_HOST;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 1eeb3396300f..25d4b748a56f 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -646,8 +646,6 @@ static void xhci_stop(struct usb_hcd *hcd)
646 return; 646 return;
647 } 647 }
648 648
649 xhci_debugfs_exit(xhci);
650
651 xhci_dbc_exit(xhci); 649 xhci_dbc_exit(xhci);
652 650
653 spin_lock_irq(&xhci->lock); 651 spin_lock_irq(&xhci->lock);
@@ -680,6 +678,7 @@ static void xhci_stop(struct usb_hcd *hcd)
680 678
681 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "cleaning up memory"); 679 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "cleaning up memory");
682 xhci_mem_cleanup(xhci); 680 xhci_mem_cleanup(xhci);
681 xhci_debugfs_exit(xhci);
683 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 682 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
684 "xhci_stop completed - status = %x", 683 "xhci_stop completed - status = %x",
685 readl(&xhci->op_regs->status)); 684 readl(&xhci->op_regs->status));
@@ -1014,6 +1013,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1014 1013
1015 xhci_dbg(xhci, "cleaning up memory\n"); 1014 xhci_dbg(xhci, "cleaning up memory\n");
1016 xhci_mem_cleanup(xhci); 1015 xhci_mem_cleanup(xhci);
1016 xhci_debugfs_exit(xhci);
1017 xhci_dbg(xhci, "xhci_stop completed - status = %x\n", 1017 xhci_dbg(xhci, "xhci_stop completed - status = %x\n",
1018 readl(&xhci->op_regs->status)); 1018 readl(&xhci->op_regs->status));
1019 1019
@@ -3544,12 +3544,10 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
3544 virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; 3544 virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING;
3545 del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); 3545 del_timer_sync(&virt_dev->eps[i].stop_cmd_timer);
3546 } 3546 }
3547 3547 xhci_debugfs_remove_slot(xhci, udev->slot_id);
3548 ret = xhci_disable_slot(xhci, udev->slot_id); 3548 ret = xhci_disable_slot(xhci, udev->slot_id);
3549 if (ret) { 3549 if (ret)
3550 xhci_debugfs_remove_slot(xhci, udev->slot_id);
3551 xhci_free_virt_device(xhci, udev->slot_id); 3550 xhci_free_virt_device(xhci, udev->slot_id);
3552 }
3553} 3551}
3554 3552
3555int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) 3553int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 96099a245c69..e4d7d3d06a75 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1822,7 +1822,7 @@ struct xhci_hcd {
1822/* For controller with a broken Port Disable implementation */ 1822/* For controller with a broken Port Disable implementation */
1823#define XHCI_BROKEN_PORT_PED (1 << 25) 1823#define XHCI_BROKEN_PORT_PED (1 << 25)
1824#define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26) 1824#define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26)
1825/* Reserved. It was XHCI_U2_DISABLE_WAKE */ 1825#define XHCI_U2_DISABLE_WAKE (1 << 27)
1826#define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28) 1826#define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28)
1827#define XHCI_HW_LPM_DISABLE (1 << 29) 1827#define XHCI_HW_LPM_DISABLE (1 << 29)
1828 1828
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 63b9e85dc0e9..236a60f53099 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -42,6 +42,9 @@
42#define USB_DEVICE_ID_LD_MICROCASSYTIME 0x1033 /* USB Product ID of Micro-CASSY Time (reserved) */ 42#define USB_DEVICE_ID_LD_MICROCASSYTIME 0x1033 /* USB Product ID of Micro-CASSY Time (reserved) */
43#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE 0x1035 /* USB Product ID of Micro-CASSY Temperature */ 43#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE 0x1035 /* USB Product ID of Micro-CASSY Temperature */
44#define USB_DEVICE_ID_LD_MICROCASSYPH 0x1038 /* USB Product ID of Micro-CASSY pH */ 44#define USB_DEVICE_ID_LD_MICROCASSYPH 0x1038 /* USB Product ID of Micro-CASSY pH */
45#define USB_DEVICE_ID_LD_POWERANALYSERCASSY 0x1040 /* USB Product ID of Power Analyser CASSY */
46#define USB_DEVICE_ID_LD_CONVERTERCONTROLLERCASSY 0x1042 /* USB Product ID of Converter Controller CASSY */
47#define USB_DEVICE_ID_LD_MACHINETESTCASSY 0x1043 /* USB Product ID of Machine Test CASSY */
45#define USB_DEVICE_ID_LD_JWM 0x1080 /* USB Product ID of Joule and Wattmeter */ 48#define USB_DEVICE_ID_LD_JWM 0x1080 /* USB Product ID of Joule and Wattmeter */
46#define USB_DEVICE_ID_LD_DMMP 0x1081 /* USB Product ID of Digital Multimeter P (reserved) */ 49#define USB_DEVICE_ID_LD_DMMP 0x1081 /* USB Product ID of Digital Multimeter P (reserved) */
47#define USB_DEVICE_ID_LD_UMIP 0x1090 /* USB Product ID of UMI P */ 50#define USB_DEVICE_ID_LD_UMIP 0x1090 /* USB Product ID of UMI P */
@@ -84,6 +87,9 @@ static const struct usb_device_id ld_usb_table[] = {
84 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTIME) }, 87 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTIME) },
85 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE) }, 88 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE) },
86 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYPH) }, 89 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYPH) },
90 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERANALYSERCASSY) },
91 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CONVERTERCONTROLLERCASSY) },
92 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETESTCASSY) },
87 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) }, 93 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) },
88 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) }, 94 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) },
89 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) }, 95 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) },
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 968bf1e8b0fe..eef4ad578b31 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2708,7 +2708,8 @@ static int musb_resume(struct device *dev)
2708 if ((devctl & mask) != (musb->context.devctl & mask)) 2708 if ((devctl & mask) != (musb->context.devctl & mask))
2709 musb->port1_status = 0; 2709 musb->port1_status = 0;
2710 2710
2711 musb_start(musb); 2711 musb_enable_interrupts(musb);
2712 musb_platform_enable(musb);
2712 2713
2713 spin_lock_irqsave(&musb->lock, flags); 2714 spin_lock_irqsave(&musb->lock, flags);
2714 error = musb_run_resume_work(musb); 2715 error = musb_run_resume_work(musb);
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 394b4ac86161..45ed32c2cba9 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -391,13 +391,7 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
391 } 391 }
392 } 392 }
393 393
394 /* 394 if (qh != NULL && qh->is_ready) {
395 * The pipe must be broken if current urb->status is set, so don't
396 * start next urb.
397 * TODO: to minimize the risk of regression, only check urb->status
398 * for RX, until we have a test case to understand the behavior of TX.
399 */
400 if ((!status || !is_in) && qh && qh->is_ready) {
401 musb_dbg(musb, "... next ep%d %cX urb %p", 395 musb_dbg(musb, "... next ep%d %cX urb %p",
402 hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh)); 396 hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh));
403 musb_start_urb(musb, is_in, qh); 397 musb_start_urb(musb, is_in, qh);
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index da031c45395a..fbec863350f6 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -602,6 +602,9 @@ static enum usb_charger_type mxs_phy_charger_detect(struct usb_phy *phy)
602 void __iomem *base = phy->io_priv; 602 void __iomem *base = phy->io_priv;
603 enum usb_charger_type chgr_type = UNKNOWN_TYPE; 603 enum usb_charger_type chgr_type = UNKNOWN_TYPE;
604 604
605 if (!regmap)
606 return UNKNOWN_TYPE;
607
605 if (mxs_charger_data_contact_detect(mxs_phy)) 608 if (mxs_charger_data_contact_detect(mxs_phy))
606 return chgr_type; 609 return chgr_type;
607 610
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 5925d111bd47..39fa2fc1b8b7 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -982,6 +982,10 @@ static int usbhsf_dma_prepare_pop_with_usb_dmac(struct usbhs_pkt *pkt,
982 if ((uintptr_t)pkt->buf & (USBHS_USB_DMAC_XFER_SIZE - 1)) 982 if ((uintptr_t)pkt->buf & (USBHS_USB_DMAC_XFER_SIZE - 1))
983 goto usbhsf_pio_prepare_pop; 983 goto usbhsf_pio_prepare_pop;
984 984
985 /* return at this time if the pipe is running */
986 if (usbhs_pipe_is_running(pipe))
987 return 0;
988
985 usbhs_pipe_config_change_bfre(pipe, 1); 989 usbhs_pipe_config_change_bfre(pipe, 1);
986 990
987 ret = usbhsf_fifo_select(pipe, fifo, 0); 991 ret = usbhsf_fifo_select(pipe, fifo, 0);
@@ -1172,6 +1176,7 @@ static int usbhsf_dma_pop_done_with_usb_dmac(struct usbhs_pkt *pkt,
1172 usbhsf_fifo_clear(pipe, fifo); 1176 usbhsf_fifo_clear(pipe, fifo);
1173 pkt->actual = usbhs_dma_calc_received_size(pkt, chan, rcv_len); 1177 pkt->actual = usbhs_dma_calc_received_size(pkt, chan, rcv_len);
1174 1178
1179 usbhs_pipe_running(pipe, 0);
1175 usbhsf_dma_stop(pipe, fifo); 1180 usbhsf_dma_stop(pipe, fifo);
1176 usbhsf_dma_unmap(pkt); 1181 usbhsf_dma_unmap(pkt);
1177 usbhsf_fifo_unselect(pipe, pipe->fifo); 1182 usbhsf_fifo_unselect(pipe, pipe->fifo);
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 5db8ed517e0e..2d8d9150da0c 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -241,6 +241,7 @@ static void option_instat_callback(struct urb *urb);
241#define QUECTEL_PRODUCT_EC21 0x0121 241#define QUECTEL_PRODUCT_EC21 0x0121
242#define QUECTEL_PRODUCT_EC25 0x0125 242#define QUECTEL_PRODUCT_EC25 0x0125
243#define QUECTEL_PRODUCT_BG96 0x0296 243#define QUECTEL_PRODUCT_BG96 0x0296
244#define QUECTEL_PRODUCT_EP06 0x0306
244 245
245#define CMOTECH_VENDOR_ID 0x16d8 246#define CMOTECH_VENDOR_ID 0x16d8
246#define CMOTECH_PRODUCT_6001 0x6001 247#define CMOTECH_PRODUCT_6001 0x6001
@@ -689,6 +690,10 @@ static const struct option_blacklist_info yuga_clm920_nc5_blacklist = {
689 .reserved = BIT(1) | BIT(4), 690 .reserved = BIT(1) | BIT(4),
690}; 691};
691 692
693static const struct option_blacklist_info quectel_ep06_blacklist = {
694 .reserved = BIT(4) | BIT(5),
695};
696
692static const struct usb_device_id option_ids[] = { 697static const struct usb_device_id option_ids[] = {
693 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 698 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
694 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 699 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1203,6 +1208,8 @@ static const struct usb_device_id option_ids[] = {
1203 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1208 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1204 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), 1209 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
1205 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1210 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1211 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06),
1212 .driver_info = (kernel_ulong_t)&quectel_ep06_blacklist },
1206 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1213 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
1207 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 1214 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
1208 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), 1215 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
index 49e552472c3f..dd8ef36ab10e 100644
--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -73,6 +73,7 @@ static ssize_t usbip_sockfd_store(struct device *dev, struct device_attribute *a
73 goto err; 73 goto err;
74 74
75 sdev->ud.tcp_socket = socket; 75 sdev->ud.tcp_socket = socket;
76 sdev->ud.sockfd = sockfd;
76 77
77 spin_unlock_irq(&sdev->ud.lock); 78 spin_unlock_irq(&sdev->ud.lock);
78 79
@@ -172,6 +173,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)
172 if (ud->tcp_socket) { 173 if (ud->tcp_socket) {
173 sockfd_put(ud->tcp_socket); 174 sockfd_put(ud->tcp_socket);
174 ud->tcp_socket = NULL; 175 ud->tcp_socket = NULL;
176 ud->sockfd = -1;
175 } 177 }
176 178
177 /* 3. free used data */ 179 /* 3. free used data */
@@ -266,6 +268,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev)
266 sdev->ud.status = SDEV_ST_AVAILABLE; 268 sdev->ud.status = SDEV_ST_AVAILABLE;
267 spin_lock_init(&sdev->ud.lock); 269 spin_lock_init(&sdev->ud.lock);
268 sdev->ud.tcp_socket = NULL; 270 sdev->ud.tcp_socket = NULL;
271 sdev->ud.sockfd = -1;
269 272
270 INIT_LIST_HEAD(&sdev->priv_init); 273 INIT_LIST_HEAD(&sdev->priv_init);
271 INIT_LIST_HEAD(&sdev->priv_tx); 274 INIT_LIST_HEAD(&sdev->priv_tx);
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index c3e1008aa491..20e3d4609583 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -984,6 +984,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
984 if (vdev->ud.tcp_socket) { 984 if (vdev->ud.tcp_socket) {
985 sockfd_put(vdev->ud.tcp_socket); 985 sockfd_put(vdev->ud.tcp_socket);
986 vdev->ud.tcp_socket = NULL; 986 vdev->ud.tcp_socket = NULL;
987 vdev->ud.sockfd = -1;
987 } 988 }
988 pr_info("release socket\n"); 989 pr_info("release socket\n");
989 990
@@ -1030,6 +1031,7 @@ static void vhci_device_reset(struct usbip_device *ud)
1030 if (ud->tcp_socket) { 1031 if (ud->tcp_socket) {
1031 sockfd_put(ud->tcp_socket); 1032 sockfd_put(ud->tcp_socket);
1032 ud->tcp_socket = NULL; 1033 ud->tcp_socket = NULL;
1034 ud->sockfd = -1;
1033 } 1035 }
1034 ud->status = VDEV_ST_NULL; 1036 ud->status = VDEV_ST_NULL;
1035 1037
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index e30e29ae4819..45657e2b1ff7 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -338,11 +338,12 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr,
338{ 338{
339 struct page *page[1]; 339 struct page *page[1];
340 struct vm_area_struct *vma; 340 struct vm_area_struct *vma;
341 struct vm_area_struct *vmas[1];
341 int ret; 342 int ret;
342 343
343 if (mm == current->mm) { 344 if (mm == current->mm) {
344 ret = get_user_pages_fast(vaddr, 1, !!(prot & IOMMU_WRITE), 345 ret = get_user_pages_longterm(vaddr, 1, !!(prot & IOMMU_WRITE),
345 page); 346 page, vmas);
346 } else { 347 } else {
347 unsigned int flags = 0; 348 unsigned int flags = 0;
348 349
@@ -351,7 +352,18 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr,
351 352
352 down_read(&mm->mmap_sem); 353 down_read(&mm->mmap_sem);
353 ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page, 354 ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page,
354 NULL, NULL); 355 vmas, NULL);
356 /*
357 * The lifetime of a vaddr_get_pfn() page pin is
358 * userspace-controlled. In the fs-dax case this could
359 * lead to indefinite stalls in filesystem operations.
360 * Disallow attempts to pin fs-dax pages via this
361 * interface.
362 */
363 if (ret > 0 && vma_is_fsdax(vmas[0])) {
364 ret = -EOPNOTSUPP;
365 put_page(page[0]);
366 }
355 up_read(&mm->mmap_sem); 367 up_read(&mm->mmap_sem);
356 } 368 }
357 369
diff --git a/drivers/video/fbdev/geode/video_gx.c b/drivers/video/fbdev/geode/video_gx.c
index 6082f653c68a..67773e8bbb95 100644
--- a/drivers/video/fbdev/geode/video_gx.c
+++ b/drivers/video/fbdev/geode/video_gx.c
@@ -127,7 +127,7 @@ void gx_set_dclk_frequency(struct fb_info *info)
127 int timeout = 1000; 127 int timeout = 1000;
128 128
129 /* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */ 129 /* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */
130 if (cpu_data(0).x86_mask == 1) { 130 if (cpu_data(0).x86_stepping == 1) {
131 pll_table = gx_pll_table_14MHz; 131 pll_table = gx_pll_table_14MHz;
132 pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz); 132 pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz);
133 } else { 133 } else {
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index aff773bcebdb..37460cd6cabb 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -226,6 +226,7 @@ config ZIIRAVE_WATCHDOG
226config RAVE_SP_WATCHDOG 226config RAVE_SP_WATCHDOG
227 tristate "RAVE SP Watchdog timer" 227 tristate "RAVE SP Watchdog timer"
228 depends on RAVE_SP_CORE 228 depends on RAVE_SP_CORE
229 depends on NVMEM || !NVMEM
229 select WATCHDOG_CORE 230 select WATCHDOG_CORE
230 help 231 help
231 Support for the watchdog on RAVE SP device. 232 Support for the watchdog on RAVE SP device.
@@ -903,6 +904,7 @@ config F71808E_WDT
903config SP5100_TCO 904config SP5100_TCO
904 tristate "AMD/ATI SP5100 TCO Timer/Watchdog" 905 tristate "AMD/ATI SP5100 TCO Timer/Watchdog"
905 depends on X86 && PCI 906 depends on X86 && PCI
907 select WATCHDOG_CORE
906 ---help--- 908 ---help---
907 Hardware watchdog driver for the AMD/ATI SP5100 chipset. The TCO 909 Hardware watchdog driver for the AMD/ATI SP5100 chipset. The TCO
908 (Total Cost of Ownership) timer is a watchdog timer that will reboot 910 (Total Cost of Ownership) timer is a watchdog timer that will reboot
@@ -1008,6 +1010,7 @@ config WAFER_WDT
1008config I6300ESB_WDT 1010config I6300ESB_WDT
1009 tristate "Intel 6300ESB Timer/Watchdog" 1011 tristate "Intel 6300ESB Timer/Watchdog"
1010 depends on PCI 1012 depends on PCI
1013 select WATCHDOG_CORE
1011 ---help--- 1014 ---help---
1012 Hardware driver for the watchdog timer built into the Intel 1015 Hardware driver for the watchdog timer built into the Intel
1013 6300ESB controller hub. 1016 6300ESB controller hub.
@@ -1837,6 +1840,7 @@ config WATCHDOG_SUN4V
1837config XEN_WDT 1840config XEN_WDT
1838 tristate "Xen Watchdog support" 1841 tristate "Xen Watchdog support"
1839 depends on XEN 1842 depends on XEN
1843 select WATCHDOG_CORE
1840 help 1844 help
1841 Say Y here to support the hypervisor watchdog capability provided 1845 Say Y here to support the hypervisor watchdog capability provided
1842 by Xen 4.0 and newer. The watchdog timeout period is normally one 1846 by Xen 4.0 and newer. The watchdog timeout period is normally one
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 1ab4bd11f5f3..762378f1811c 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -755,8 +755,8 @@ out:
755 mutex_unlock(&irq_mapping_update_lock); 755 mutex_unlock(&irq_mapping_update_lock);
756 return irq; 756 return irq;
757error_irq: 757error_irq:
758 for (; i >= 0; i--) 758 while (nvec--)
759 __unbind_from_irq(irq + i); 759 __unbind_from_irq(irq + nvec);
760 mutex_unlock(&irq_mapping_update_lock); 760 mutex_unlock(&irq_mapping_update_lock);
761 return ret; 761 return ret;
762} 762}
diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
index 156e5aea36db..b1092fbefa63 100644
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -416,7 +416,7 @@ static int pvcalls_back_connect(struct xenbus_device *dev,
416 sock); 416 sock);
417 if (!map) { 417 if (!map) {
418 ret = -EFAULT; 418 ret = -EFAULT;
419 sock_release(map->sock); 419 sock_release(sock);
420 } 420 }
421 421
422out: 422out:
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 753d9cb437d0..2f11ca72a281 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -60,6 +60,7 @@ struct sock_mapping {
60 bool active_socket; 60 bool active_socket;
61 struct list_head list; 61 struct list_head list;
62 struct socket *sock; 62 struct socket *sock;
63 atomic_t refcount;
63 union { 64 union {
64 struct { 65 struct {
65 int irq; 66 int irq;
@@ -72,20 +73,25 @@ struct sock_mapping {
72 wait_queue_head_t inflight_conn_req; 73 wait_queue_head_t inflight_conn_req;
73 } active; 74 } active;
74 struct { 75 struct {
75 /* Socket status */ 76 /*
77 * Socket status, needs to be 64-bit aligned due to the
78 * test_and_* functions which have this requirement on arm64.
79 */
76#define PVCALLS_STATUS_UNINITALIZED 0 80#define PVCALLS_STATUS_UNINITALIZED 0
77#define PVCALLS_STATUS_BIND 1 81#define PVCALLS_STATUS_BIND 1
78#define PVCALLS_STATUS_LISTEN 2 82#define PVCALLS_STATUS_LISTEN 2
79 uint8_t status; 83 uint8_t status __attribute__((aligned(8)));
80 /* 84 /*
81 * Internal state-machine flags. 85 * Internal state-machine flags.
82 * Only one accept operation can be inflight for a socket. 86 * Only one accept operation can be inflight for a socket.
83 * Only one poll operation can be inflight for a given socket. 87 * Only one poll operation can be inflight for a given socket.
88 * flags needs to be 64-bit aligned due to the test_and_*
89 * functions which have this requirement on arm64.
84 */ 90 */
85#define PVCALLS_FLAG_ACCEPT_INFLIGHT 0 91#define PVCALLS_FLAG_ACCEPT_INFLIGHT 0
86#define PVCALLS_FLAG_POLL_INFLIGHT 1 92#define PVCALLS_FLAG_POLL_INFLIGHT 1
87#define PVCALLS_FLAG_POLL_RET 2 93#define PVCALLS_FLAG_POLL_RET 2
88 uint8_t flags; 94 uint8_t flags __attribute__((aligned(8)));
89 uint32_t inflight_req_id; 95 uint32_t inflight_req_id;
90 struct sock_mapping *accept_map; 96 struct sock_mapping *accept_map;
91 wait_queue_head_t inflight_accept_req; 97 wait_queue_head_t inflight_accept_req;
@@ -93,6 +99,32 @@ struct sock_mapping {
93 }; 99 };
94}; 100};
95 101
102static inline struct sock_mapping *pvcalls_enter_sock(struct socket *sock)
103{
104 struct sock_mapping *map;
105
106 if (!pvcalls_front_dev ||
107 dev_get_drvdata(&pvcalls_front_dev->dev) == NULL)
108 return ERR_PTR(-ENOTCONN);
109
110 map = (struct sock_mapping *)sock->sk->sk_send_head;
111 if (map == NULL)
112 return ERR_PTR(-ENOTSOCK);
113
114 pvcalls_enter();
115 atomic_inc(&map->refcount);
116 return map;
117}
118
119static inline void pvcalls_exit_sock(struct socket *sock)
120{
121 struct sock_mapping *map;
122
123 map = (struct sock_mapping *)sock->sk->sk_send_head;
124 atomic_dec(&map->refcount);
125 pvcalls_exit();
126}
127
96static inline int get_request(struct pvcalls_bedata *bedata, int *req_id) 128static inline int get_request(struct pvcalls_bedata *bedata, int *req_id)
97{ 129{
98 *req_id = bedata->ring.req_prod_pvt & (RING_SIZE(&bedata->ring) - 1); 130 *req_id = bedata->ring.req_prod_pvt & (RING_SIZE(&bedata->ring) - 1);
@@ -369,31 +401,23 @@ int pvcalls_front_connect(struct socket *sock, struct sockaddr *addr,
369 if (addr->sa_family != AF_INET || sock->type != SOCK_STREAM) 401 if (addr->sa_family != AF_INET || sock->type != SOCK_STREAM)
370 return -EOPNOTSUPP; 402 return -EOPNOTSUPP;
371 403
372 pvcalls_enter(); 404 map = pvcalls_enter_sock(sock);
373 if (!pvcalls_front_dev) { 405 if (IS_ERR(map))
374 pvcalls_exit(); 406 return PTR_ERR(map);
375 return -ENOTCONN;
376 }
377 407
378 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 408 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
379 409
380 map = (struct sock_mapping *)sock->sk->sk_send_head;
381 if (!map) {
382 pvcalls_exit();
383 return -ENOTSOCK;
384 }
385
386 spin_lock(&bedata->socket_lock); 410 spin_lock(&bedata->socket_lock);
387 ret = get_request(bedata, &req_id); 411 ret = get_request(bedata, &req_id);
388 if (ret < 0) { 412 if (ret < 0) {
389 spin_unlock(&bedata->socket_lock); 413 spin_unlock(&bedata->socket_lock);
390 pvcalls_exit(); 414 pvcalls_exit_sock(sock);
391 return ret; 415 return ret;
392 } 416 }
393 ret = create_active(map, &evtchn); 417 ret = create_active(map, &evtchn);
394 if (ret < 0) { 418 if (ret < 0) {
395 spin_unlock(&bedata->socket_lock); 419 spin_unlock(&bedata->socket_lock);
396 pvcalls_exit(); 420 pvcalls_exit_sock(sock);
397 return ret; 421 return ret;
398 } 422 }
399 423
@@ -423,7 +447,7 @@ int pvcalls_front_connect(struct socket *sock, struct sockaddr *addr,
423 smp_rmb(); 447 smp_rmb();
424 ret = bedata->rsp[req_id].ret; 448 ret = bedata->rsp[req_id].ret;
425 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID; 449 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID;
426 pvcalls_exit(); 450 pvcalls_exit_sock(sock);
427 return ret; 451 return ret;
428} 452}
429 453
@@ -488,23 +512,15 @@ int pvcalls_front_sendmsg(struct socket *sock, struct msghdr *msg,
488 if (flags & (MSG_CONFIRM|MSG_DONTROUTE|MSG_EOR|MSG_OOB)) 512 if (flags & (MSG_CONFIRM|MSG_DONTROUTE|MSG_EOR|MSG_OOB))
489 return -EOPNOTSUPP; 513 return -EOPNOTSUPP;
490 514
491 pvcalls_enter(); 515 map = pvcalls_enter_sock(sock);
492 if (!pvcalls_front_dev) { 516 if (IS_ERR(map))
493 pvcalls_exit(); 517 return PTR_ERR(map);
494 return -ENOTCONN;
495 }
496 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 518 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
497 519
498 map = (struct sock_mapping *) sock->sk->sk_send_head;
499 if (!map) {
500 pvcalls_exit();
501 return -ENOTSOCK;
502 }
503
504 mutex_lock(&map->active.out_mutex); 520 mutex_lock(&map->active.out_mutex);
505 if ((flags & MSG_DONTWAIT) && !pvcalls_front_write_todo(map)) { 521 if ((flags & MSG_DONTWAIT) && !pvcalls_front_write_todo(map)) {
506 mutex_unlock(&map->active.out_mutex); 522 mutex_unlock(&map->active.out_mutex);
507 pvcalls_exit(); 523 pvcalls_exit_sock(sock);
508 return -EAGAIN; 524 return -EAGAIN;
509 } 525 }
510 if (len > INT_MAX) 526 if (len > INT_MAX)
@@ -526,7 +542,7 @@ again:
526 tot_sent = sent; 542 tot_sent = sent;
527 543
528 mutex_unlock(&map->active.out_mutex); 544 mutex_unlock(&map->active.out_mutex);
529 pvcalls_exit(); 545 pvcalls_exit_sock(sock);
530 return tot_sent; 546 return tot_sent;
531} 547}
532 548
@@ -591,19 +607,11 @@ int pvcalls_front_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
591 if (flags & (MSG_CMSG_CLOEXEC|MSG_ERRQUEUE|MSG_OOB|MSG_TRUNC)) 607 if (flags & (MSG_CMSG_CLOEXEC|MSG_ERRQUEUE|MSG_OOB|MSG_TRUNC))
592 return -EOPNOTSUPP; 608 return -EOPNOTSUPP;
593 609
594 pvcalls_enter(); 610 map = pvcalls_enter_sock(sock);
595 if (!pvcalls_front_dev) { 611 if (IS_ERR(map))
596 pvcalls_exit(); 612 return PTR_ERR(map);
597 return -ENOTCONN;
598 }
599 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 613 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
600 614
601 map = (struct sock_mapping *) sock->sk->sk_send_head;
602 if (!map) {
603 pvcalls_exit();
604 return -ENOTSOCK;
605 }
606
607 mutex_lock(&map->active.in_mutex); 615 mutex_lock(&map->active.in_mutex);
608 if (len > XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER)) 616 if (len > XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER))
609 len = XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER); 617 len = XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER);
@@ -623,7 +631,7 @@ int pvcalls_front_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
623 ret = 0; 631 ret = 0;
624 632
625 mutex_unlock(&map->active.in_mutex); 633 mutex_unlock(&map->active.in_mutex);
626 pvcalls_exit(); 634 pvcalls_exit_sock(sock);
627 return ret; 635 return ret;
628} 636}
629 637
@@ -637,24 +645,16 @@ int pvcalls_front_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
637 if (addr->sa_family != AF_INET || sock->type != SOCK_STREAM) 645 if (addr->sa_family != AF_INET || sock->type != SOCK_STREAM)
638 return -EOPNOTSUPP; 646 return -EOPNOTSUPP;
639 647
640 pvcalls_enter(); 648 map = pvcalls_enter_sock(sock);
641 if (!pvcalls_front_dev) { 649 if (IS_ERR(map))
642 pvcalls_exit(); 650 return PTR_ERR(map);
643 return -ENOTCONN;
644 }
645 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 651 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
646 652
647 map = (struct sock_mapping *) sock->sk->sk_send_head;
648 if (map == NULL) {
649 pvcalls_exit();
650 return -ENOTSOCK;
651 }
652
653 spin_lock(&bedata->socket_lock); 653 spin_lock(&bedata->socket_lock);
654 ret = get_request(bedata, &req_id); 654 ret = get_request(bedata, &req_id);
655 if (ret < 0) { 655 if (ret < 0) {
656 spin_unlock(&bedata->socket_lock); 656 spin_unlock(&bedata->socket_lock);
657 pvcalls_exit(); 657 pvcalls_exit_sock(sock);
658 return ret; 658 return ret;
659 } 659 }
660 req = RING_GET_REQUEST(&bedata->ring, req_id); 660 req = RING_GET_REQUEST(&bedata->ring, req_id);
@@ -684,7 +684,7 @@ int pvcalls_front_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
684 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID; 684 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID;
685 685
686 map->passive.status = PVCALLS_STATUS_BIND; 686 map->passive.status = PVCALLS_STATUS_BIND;
687 pvcalls_exit(); 687 pvcalls_exit_sock(sock);
688 return 0; 688 return 0;
689} 689}
690 690
@@ -695,21 +695,13 @@ int pvcalls_front_listen(struct socket *sock, int backlog)
695 struct xen_pvcalls_request *req; 695 struct xen_pvcalls_request *req;
696 int notify, req_id, ret; 696 int notify, req_id, ret;
697 697
698 pvcalls_enter(); 698 map = pvcalls_enter_sock(sock);
699 if (!pvcalls_front_dev) { 699 if (IS_ERR(map))
700 pvcalls_exit(); 700 return PTR_ERR(map);
701 return -ENOTCONN;
702 }
703 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 701 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
704 702
705 map = (struct sock_mapping *) sock->sk->sk_send_head;
706 if (!map) {
707 pvcalls_exit();
708 return -ENOTSOCK;
709 }
710
711 if (map->passive.status != PVCALLS_STATUS_BIND) { 703 if (map->passive.status != PVCALLS_STATUS_BIND) {
712 pvcalls_exit(); 704 pvcalls_exit_sock(sock);
713 return -EOPNOTSUPP; 705 return -EOPNOTSUPP;
714 } 706 }
715 707
@@ -717,7 +709,7 @@ int pvcalls_front_listen(struct socket *sock, int backlog)
717 ret = get_request(bedata, &req_id); 709 ret = get_request(bedata, &req_id);
718 if (ret < 0) { 710 if (ret < 0) {
719 spin_unlock(&bedata->socket_lock); 711 spin_unlock(&bedata->socket_lock);
720 pvcalls_exit(); 712 pvcalls_exit_sock(sock);
721 return ret; 713 return ret;
722 } 714 }
723 req = RING_GET_REQUEST(&bedata->ring, req_id); 715 req = RING_GET_REQUEST(&bedata->ring, req_id);
@@ -741,7 +733,7 @@ int pvcalls_front_listen(struct socket *sock, int backlog)
741 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID; 733 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID;
742 734
743 map->passive.status = PVCALLS_STATUS_LISTEN; 735 map->passive.status = PVCALLS_STATUS_LISTEN;
744 pvcalls_exit(); 736 pvcalls_exit_sock(sock);
745 return ret; 737 return ret;
746} 738}
747 739
@@ -753,21 +745,13 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
753 struct xen_pvcalls_request *req; 745 struct xen_pvcalls_request *req;
754 int notify, req_id, ret, evtchn, nonblock; 746 int notify, req_id, ret, evtchn, nonblock;
755 747
756 pvcalls_enter(); 748 map = pvcalls_enter_sock(sock);
757 if (!pvcalls_front_dev) { 749 if (IS_ERR(map))
758 pvcalls_exit(); 750 return PTR_ERR(map);
759 return -ENOTCONN;
760 }
761 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 751 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
762 752
763 map = (struct sock_mapping *) sock->sk->sk_send_head;
764 if (!map) {
765 pvcalls_exit();
766 return -ENOTSOCK;
767 }
768
769 if (map->passive.status != PVCALLS_STATUS_LISTEN) { 753 if (map->passive.status != PVCALLS_STATUS_LISTEN) {
770 pvcalls_exit(); 754 pvcalls_exit_sock(sock);
771 return -EINVAL; 755 return -EINVAL;
772 } 756 }
773 757
@@ -785,13 +769,13 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
785 goto received; 769 goto received;
786 } 770 }
787 if (nonblock) { 771 if (nonblock) {
788 pvcalls_exit(); 772 pvcalls_exit_sock(sock);
789 return -EAGAIN; 773 return -EAGAIN;
790 } 774 }
791 if (wait_event_interruptible(map->passive.inflight_accept_req, 775 if (wait_event_interruptible(map->passive.inflight_accept_req,
792 !test_and_set_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, 776 !test_and_set_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
793 (void *)&map->passive.flags))) { 777 (void *)&map->passive.flags))) {
794 pvcalls_exit(); 778 pvcalls_exit_sock(sock);
795 return -EINTR; 779 return -EINTR;
796 } 780 }
797 } 781 }
@@ -802,7 +786,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
802 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, 786 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
803 (void *)&map->passive.flags); 787 (void *)&map->passive.flags);
804 spin_unlock(&bedata->socket_lock); 788 spin_unlock(&bedata->socket_lock);
805 pvcalls_exit(); 789 pvcalls_exit_sock(sock);
806 return ret; 790 return ret;
807 } 791 }
808 map2 = kzalloc(sizeof(*map2), GFP_ATOMIC); 792 map2 = kzalloc(sizeof(*map2), GFP_ATOMIC);
@@ -810,7 +794,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
810 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, 794 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
811 (void *)&map->passive.flags); 795 (void *)&map->passive.flags);
812 spin_unlock(&bedata->socket_lock); 796 spin_unlock(&bedata->socket_lock);
813 pvcalls_exit(); 797 pvcalls_exit_sock(sock);
814 return -ENOMEM; 798 return -ENOMEM;
815 } 799 }
816 ret = create_active(map2, &evtchn); 800 ret = create_active(map2, &evtchn);
@@ -819,7 +803,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
819 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, 803 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
820 (void *)&map->passive.flags); 804 (void *)&map->passive.flags);
821 spin_unlock(&bedata->socket_lock); 805 spin_unlock(&bedata->socket_lock);
822 pvcalls_exit(); 806 pvcalls_exit_sock(sock);
823 return ret; 807 return ret;
824 } 808 }
825 list_add_tail(&map2->list, &bedata->socket_mappings); 809 list_add_tail(&map2->list, &bedata->socket_mappings);
@@ -841,13 +825,13 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
841 /* We could check if we have received a response before returning. */ 825 /* We could check if we have received a response before returning. */
842 if (nonblock) { 826 if (nonblock) {
843 WRITE_ONCE(map->passive.inflight_req_id, req_id); 827 WRITE_ONCE(map->passive.inflight_req_id, req_id);
844 pvcalls_exit(); 828 pvcalls_exit_sock(sock);
845 return -EAGAIN; 829 return -EAGAIN;
846 } 830 }
847 831
848 if (wait_event_interruptible(bedata->inflight_req, 832 if (wait_event_interruptible(bedata->inflight_req,
849 READ_ONCE(bedata->rsp[req_id].req_id) == req_id)) { 833 READ_ONCE(bedata->rsp[req_id].req_id) == req_id)) {
850 pvcalls_exit(); 834 pvcalls_exit_sock(sock);
851 return -EINTR; 835 return -EINTR;
852 } 836 }
853 /* read req_id, then the content */ 837 /* read req_id, then the content */
@@ -862,7 +846,7 @@ received:
862 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, 846 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
863 (void *)&map->passive.flags); 847 (void *)&map->passive.flags);
864 pvcalls_front_free_map(bedata, map2); 848 pvcalls_front_free_map(bedata, map2);
865 pvcalls_exit(); 849 pvcalls_exit_sock(sock);
866 return -ENOMEM; 850 return -ENOMEM;
867 } 851 }
868 newsock->sk->sk_send_head = (void *)map2; 852 newsock->sk->sk_send_head = (void *)map2;
@@ -874,7 +858,7 @@ received:
874 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, (void *)&map->passive.flags); 858 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, (void *)&map->passive.flags);
875 wake_up(&map->passive.inflight_accept_req); 859 wake_up(&map->passive.inflight_accept_req);
876 860
877 pvcalls_exit(); 861 pvcalls_exit_sock(sock);
878 return ret; 862 return ret;
879} 863}
880 864
@@ -965,23 +949,16 @@ __poll_t pvcalls_front_poll(struct file *file, struct socket *sock,
965 struct sock_mapping *map; 949 struct sock_mapping *map;
966 __poll_t ret; 950 __poll_t ret;
967 951
968 pvcalls_enter(); 952 map = pvcalls_enter_sock(sock);
969 if (!pvcalls_front_dev) { 953 if (IS_ERR(map))
970 pvcalls_exit();
971 return EPOLLNVAL; 954 return EPOLLNVAL;
972 }
973 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 955 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
974 956
975 map = (struct sock_mapping *) sock->sk->sk_send_head;
976 if (!map) {
977 pvcalls_exit();
978 return EPOLLNVAL;
979 }
980 if (map->active_socket) 957 if (map->active_socket)
981 ret = pvcalls_front_poll_active(file, bedata, map, wait); 958 ret = pvcalls_front_poll_active(file, bedata, map, wait);
982 else 959 else
983 ret = pvcalls_front_poll_passive(file, bedata, map, wait); 960 ret = pvcalls_front_poll_passive(file, bedata, map, wait);
984 pvcalls_exit(); 961 pvcalls_exit_sock(sock);
985 return ret; 962 return ret;
986} 963}
987 964
@@ -995,25 +972,20 @@ int pvcalls_front_release(struct socket *sock)
995 if (sock->sk == NULL) 972 if (sock->sk == NULL)
996 return 0; 973 return 0;
997 974
998 pvcalls_enter(); 975 map = pvcalls_enter_sock(sock);
999 if (!pvcalls_front_dev) { 976 if (IS_ERR(map)) {
1000 pvcalls_exit(); 977 if (PTR_ERR(map) == -ENOTCONN)
1001 return -EIO; 978 return -EIO;
979 else
980 return 0;
1002 } 981 }
1003
1004 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 982 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
1005 983
1006 map = (struct sock_mapping *) sock->sk->sk_send_head;
1007 if (map == NULL) {
1008 pvcalls_exit();
1009 return 0;
1010 }
1011
1012 spin_lock(&bedata->socket_lock); 984 spin_lock(&bedata->socket_lock);
1013 ret = get_request(bedata, &req_id); 985 ret = get_request(bedata, &req_id);
1014 if (ret < 0) { 986 if (ret < 0) {
1015 spin_unlock(&bedata->socket_lock); 987 spin_unlock(&bedata->socket_lock);
1016 pvcalls_exit(); 988 pvcalls_exit_sock(sock);
1017 return ret; 989 return ret;
1018 } 990 }
1019 sock->sk->sk_send_head = NULL; 991 sock->sk->sk_send_head = NULL;
@@ -1043,14 +1015,20 @@ int pvcalls_front_release(struct socket *sock)
1043 /* 1015 /*
1044 * We need to make sure that sendmsg/recvmsg on this socket have 1016 * We need to make sure that sendmsg/recvmsg on this socket have
1045 * not started before we've cleared sk_send_head here. The 1017 * not started before we've cleared sk_send_head here. The
1046 * easiest (though not optimal) way to guarantee this is to see 1018 * easiest way to guarantee this is to see that no pvcalls
1047 * that no pvcall (other than us) is in progress. 1019 * (other than us) is in progress on this socket.
1048 */ 1020 */
1049 while (atomic_read(&pvcalls_refcount) > 1) 1021 while (atomic_read(&map->refcount) > 1)
1050 cpu_relax(); 1022 cpu_relax();
1051 1023
1052 pvcalls_front_free_map(bedata, map); 1024 pvcalls_front_free_map(bedata, map);
1053 } else { 1025 } else {
1026 wake_up(&bedata->inflight_req);
1027 wake_up(&map->passive.inflight_accept_req);
1028
1029 while (atomic_read(&map->refcount) > 1)
1030 cpu_relax();
1031
1054 spin_lock(&bedata->socket_lock); 1032 spin_lock(&bedata->socket_lock);
1055 list_del(&map->list); 1033 list_del(&map->list);
1056 spin_unlock(&bedata->socket_lock); 1034 spin_unlock(&bedata->socket_lock);
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index bf13d1ec51f3..04e7b3b29bac 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -284,6 +284,10 @@ static int tmem_frontswap_store(unsigned type, pgoff_t offset,
284 int pool = tmem_frontswap_poolid; 284 int pool = tmem_frontswap_poolid;
285 int ret; 285 int ret;
286 286
287 /* THP isn't supported */
288 if (PageTransHuge(page))
289 return -1;
290
287 if (pool < 0) 291 if (pool < 0)
288 return -1; 292 return -1;
289 if (ind64 != ind) 293 if (ind64 != ind)
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
index 149c5e7efc89..092981171df1 100644
--- a/drivers/xen/xenbus/xenbus.h
+++ b/drivers/xen/xenbus/xenbus.h
@@ -76,6 +76,7 @@ struct xb_req_data {
76 struct list_head list; 76 struct list_head list;
77 wait_queue_head_t wq; 77 wait_queue_head_t wq;
78 struct xsd_sockmsg msg; 78 struct xsd_sockmsg msg;
79 uint32_t caller_req_id;
79 enum xsd_sockmsg_type type; 80 enum xsd_sockmsg_type type;
80 char *body; 81 char *body;
81 const struct kvec *vec; 82 const struct kvec *vec;
diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c
index 5b081a01779d..d239fc3c5e3d 100644
--- a/drivers/xen/xenbus/xenbus_comms.c
+++ b/drivers/xen/xenbus/xenbus_comms.c
@@ -309,6 +309,7 @@ static int process_msg(void)
309 goto out; 309 goto out;
310 310
311 if (req->state == xb_req_state_wait_reply) { 311 if (req->state == xb_req_state_wait_reply) {
312 req->msg.req_id = req->caller_req_id;
312 req->msg.type = state.msg.type; 313 req->msg.type = state.msg.type;
313 req->msg.len = state.msg.len; 314 req->msg.len = state.msg.len;
314 req->body = state.body; 315 req->body = state.body;
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 3e59590c7254..3f3b29398ab8 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -227,6 +227,8 @@ static void xs_send(struct xb_req_data *req, struct xsd_sockmsg *msg)
227 req->state = xb_req_state_queued; 227 req->state = xb_req_state_queued;
228 init_waitqueue_head(&req->wq); 228 init_waitqueue_head(&req->wq);
229 229
230 /* Save the caller req_id and restore it later in the reply */
231 req->caller_req_id = req->msg.req_id;
230 req->msg.req_id = xs_request_enter(req); 232 req->msg.req_id = xs_request_enter(req);
231 233
232 mutex_lock(&xb_write_mutex); 234 mutex_lock(&xb_write_mutex);
@@ -310,6 +312,7 @@ static void *xs_talkv(struct xenbus_transaction t,
310 req->num_vecs = num_vecs; 312 req->num_vecs = num_vecs;
311 req->cb = xs_wake_up; 313 req->cb = xs_wake_up;
312 314
315 msg.req_id = 0;
313 msg.tx_id = t.id; 316 msg.tx_id = t.id;
314 msg.type = type; 317 msg.type = type;
315 msg.len = 0; 318 msg.len = 0;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 4a181fcb5175..fe09ef9c21f3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1058,6 +1058,27 @@ retry:
1058 return 0; 1058 return 0;
1059} 1059}
1060 1060
1061static struct gendisk *bdev_get_gendisk(struct block_device *bdev, int *partno)
1062{
1063 struct gendisk *disk = get_gendisk(bdev->bd_dev, partno);
1064
1065 if (!disk)
1066 return NULL;
1067 /*
1068 * Now that we hold gendisk reference we make sure bdev we looked up is
1069 * not stale. If it is, it means device got removed and created before
1070 * we looked up gendisk and we fail open in such case. Associating
1071 * unhashed bdev with newly created gendisk could lead to two bdevs
1072 * (and thus two independent caches) being associated with one device
1073 * which is bad.
1074 */
1075 if (inode_unhashed(bdev->bd_inode)) {
1076 put_disk_and_module(disk);
1077 return NULL;
1078 }
1079 return disk;
1080}
1081
1061/** 1082/**
1062 * bd_start_claiming - start claiming a block device 1083 * bd_start_claiming - start claiming a block device
1063 * @bdev: block device of interest 1084 * @bdev: block device of interest
@@ -1094,7 +1115,7 @@ static struct block_device *bd_start_claiming(struct block_device *bdev,
1094 * @bdev might not have been initialized properly yet, look up 1115 * @bdev might not have been initialized properly yet, look up
1095 * and grab the outer block device the hard way. 1116 * and grab the outer block device the hard way.
1096 */ 1117 */
1097 disk = get_gendisk(bdev->bd_dev, &partno); 1118 disk = bdev_get_gendisk(bdev, &partno);
1098 if (!disk) 1119 if (!disk)
1099 return ERR_PTR(-ENXIO); 1120 return ERR_PTR(-ENXIO);
1100 1121
@@ -1111,8 +1132,7 @@ static struct block_device *bd_start_claiming(struct block_device *bdev,
1111 else 1132 else
1112 whole = bdgrab(bdev); 1133 whole = bdgrab(bdev);
1113 1134
1114 module_put(disk->fops->owner); 1135 put_disk_and_module(disk);
1115 put_disk(disk);
1116 if (!whole) 1136 if (!whole)
1117 return ERR_PTR(-ENOMEM); 1137 return ERR_PTR(-ENOMEM);
1118 1138
@@ -1407,10 +1427,10 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
1407static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) 1427static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1408{ 1428{
1409 struct gendisk *disk; 1429 struct gendisk *disk;
1410 struct module *owner;
1411 int ret; 1430 int ret;
1412 int partno; 1431 int partno;
1413 int perm = 0; 1432 int perm = 0;
1433 bool first_open = false;
1414 1434
1415 if (mode & FMODE_READ) 1435 if (mode & FMODE_READ)
1416 perm |= MAY_READ; 1436 perm |= MAY_READ;
@@ -1430,14 +1450,14 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1430 restart: 1450 restart:
1431 1451
1432 ret = -ENXIO; 1452 ret = -ENXIO;
1433 disk = get_gendisk(bdev->bd_dev, &partno); 1453 disk = bdev_get_gendisk(bdev, &partno);
1434 if (!disk) 1454 if (!disk)
1435 goto out; 1455 goto out;
1436 owner = disk->fops->owner;
1437 1456
1438 disk_block_events(disk); 1457 disk_block_events(disk);
1439 mutex_lock_nested(&bdev->bd_mutex, for_part); 1458 mutex_lock_nested(&bdev->bd_mutex, for_part);
1440 if (!bdev->bd_openers) { 1459 if (!bdev->bd_openers) {
1460 first_open = true;
1441 bdev->bd_disk = disk; 1461 bdev->bd_disk = disk;
1442 bdev->bd_queue = disk->queue; 1462 bdev->bd_queue = disk->queue;
1443 bdev->bd_contains = bdev; 1463 bdev->bd_contains = bdev;
@@ -1463,8 +1483,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1463 bdev->bd_queue = NULL; 1483 bdev->bd_queue = NULL;
1464 mutex_unlock(&bdev->bd_mutex); 1484 mutex_unlock(&bdev->bd_mutex);
1465 disk_unblock_events(disk); 1485 disk_unblock_events(disk);
1466 put_disk(disk); 1486 put_disk_and_module(disk);
1467 module_put(owner);
1468 goto restart; 1487 goto restart;
1469 } 1488 }
1470 } 1489 }
@@ -1524,15 +1543,15 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1524 if (ret) 1543 if (ret)
1525 goto out_unlock_bdev; 1544 goto out_unlock_bdev;
1526 } 1545 }
1527 /* only one opener holds refs to the module and disk */
1528 put_disk(disk);
1529 module_put(owner);
1530 } 1546 }
1531 bdev->bd_openers++; 1547 bdev->bd_openers++;
1532 if (for_part) 1548 if (for_part)
1533 bdev->bd_part_count++; 1549 bdev->bd_part_count++;
1534 mutex_unlock(&bdev->bd_mutex); 1550 mutex_unlock(&bdev->bd_mutex);
1535 disk_unblock_events(disk); 1551 disk_unblock_events(disk);
1552 /* only one opener holds refs to the module and disk */
1553 if (!first_open)
1554 put_disk_and_module(disk);
1536 return 0; 1555 return 0;
1537 1556
1538 out_clear: 1557 out_clear:
@@ -1546,8 +1565,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1546 out_unlock_bdev: 1565 out_unlock_bdev:
1547 mutex_unlock(&bdev->bd_mutex); 1566 mutex_unlock(&bdev->bd_mutex);
1548 disk_unblock_events(disk); 1567 disk_unblock_events(disk);
1549 put_disk(disk); 1568 put_disk_and_module(disk);
1550 module_put(owner);
1551 out: 1569 out:
1552 bdput(bdev); 1570 bdput(bdev);
1553 1571
@@ -1770,8 +1788,6 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1770 disk->fops->release(disk, mode); 1788 disk->fops->release(disk, mode);
1771 } 1789 }
1772 if (!bdev->bd_openers) { 1790 if (!bdev->bd_openers) {
1773 struct module *owner = disk->fops->owner;
1774
1775 disk_put_part(bdev->bd_part); 1791 disk_put_part(bdev->bd_part);
1776 bdev->bd_part = NULL; 1792 bdev->bd_part = NULL;
1777 bdev->bd_disk = NULL; 1793 bdev->bd_disk = NULL;
@@ -1779,8 +1795,7 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)
1779 victim = bdev->bd_contains; 1795 victim = bdev->bd_contains;
1780 bdev->bd_contains = NULL; 1796 bdev->bd_contains = NULL;
1781 1797
1782 put_disk(disk); 1798 put_disk_and_module(disk);
1783 module_put(owner);
1784 } 1799 }
1785 mutex_unlock(&bdev->bd_mutex); 1800 mutex_unlock(&bdev->bd_mutex);
1786 bdput(bdev); 1801 bdput(bdev);
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index e4054e533f6d..f94b2d8c744a 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1264,7 +1264,16 @@ again:
1264 while (node) { 1264 while (node) {
1265 ref = rb_entry(node, struct prelim_ref, rbnode); 1265 ref = rb_entry(node, struct prelim_ref, rbnode);
1266 node = rb_next(&ref->rbnode); 1266 node = rb_next(&ref->rbnode);
1267 WARN_ON(ref->count < 0); 1267 /*
1268 * ref->count < 0 can happen here if there are delayed
1269 * refs with a node->action of BTRFS_DROP_DELAYED_REF.
1270 * prelim_ref_insert() relies on this when merging
1271 * identical refs to keep the overall count correct.
1272 * prelim_ref_insert() will merge only those refs
1273 * which compare identically. Any refs having
1274 * e.g. different offsets would not be merged,
1275 * and would retain their original ref->count < 0.
1276 */
1268 if (roots && ref->count && ref->root_id && ref->parent == 0) { 1277 if (roots && ref->count && ref->root_id && ref->parent == 0) {
1269 if (sc && sc->root_objectid && 1278 if (sc && sc->root_objectid &&
1270 ref->root_id != sc->root_objectid) { 1279 ref->root_id != sc->root_objectid) {
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 1a462ab85c49..da308774b8a4 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2974,7 +2974,7 @@ static inline void free_fs_info(struct btrfs_fs_info *fs_info)
2974 kfree(fs_info->super_copy); 2974 kfree(fs_info->super_copy);
2975 kfree(fs_info->super_for_commit); 2975 kfree(fs_info->super_for_commit);
2976 security_free_mnt_opts(&fs_info->security_opts); 2976 security_free_mnt_opts(&fs_info->security_opts);
2977 kfree(fs_info); 2977 kvfree(fs_info);
2978} 2978}
2979 2979
2980/* tree mod log functions from ctree.c */ 2980/* tree mod log functions from ctree.c */
@@ -3095,7 +3095,10 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
3095 u64 inode_objectid, u64 ref_objectid, int ins_len, 3095 u64 inode_objectid, u64 ref_objectid, int ins_len,
3096 int cow); 3096 int cow);
3097 3097
3098int btrfs_find_name_in_ext_backref(struct btrfs_path *path, 3098int btrfs_find_name_in_backref(struct extent_buffer *leaf, int slot,
3099 const char *name,
3100 int name_len, struct btrfs_inode_ref **ref_ret);
3101int btrfs_find_name_in_ext_backref(struct extent_buffer *leaf, int slot,
3099 u64 ref_objectid, const char *name, 3102 u64 ref_objectid, const char *name,
3100 int name_len, 3103 int name_len,
3101 struct btrfs_inode_extref **extref_ret); 3104 struct btrfs_inode_extref **extref_ret);
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index a1a40cf382e3..7ab5e0128f0c 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -821,7 +821,8 @@ int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info,
821 spin_unlock(&delayed_refs->lock); 821 spin_unlock(&delayed_refs->lock);
822 822
823 if (qrecord_inserted) 823 if (qrecord_inserted)
824 return btrfs_qgroup_trace_extent_post(fs_info, record); 824 btrfs_qgroup_trace_extent_post(fs_info, record);
825
825 return 0; 826 return 0;
826 827
827free_head_ref: 828free_head_ref:
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 05751a677da4..c1618ab9fecf 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2147,6 +2147,10 @@ int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
2147 u64 bytes; 2147 u64 bytes;
2148 struct request_queue *req_q; 2148 struct request_queue *req_q;
2149 2149
2150 if (!stripe->dev->bdev) {
2151 ASSERT(btrfs_test_opt(fs_info, DEGRADED));
2152 continue;
2153 }
2150 req_q = bdev_get_queue(stripe->dev->bdev); 2154 req_q = bdev_get_queue(stripe->dev->bdev);
2151 if (!blk_queue_discard(req_q)) 2155 if (!blk_queue_discard(req_q))
2152 continue; 2156 continue;
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 39c968f80157..65e1a76bf755 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -22,10 +22,10 @@
22#include "transaction.h" 22#include "transaction.h"
23#include "print-tree.h" 23#include "print-tree.h"
24 24
25static int find_name_in_backref(struct btrfs_path *path, const char *name, 25int btrfs_find_name_in_backref(struct extent_buffer *leaf, int slot,
26 int name_len, struct btrfs_inode_ref **ref_ret) 26 const char *name,
27 int name_len, struct btrfs_inode_ref **ref_ret)
27{ 28{
28 struct extent_buffer *leaf;
29 struct btrfs_inode_ref *ref; 29 struct btrfs_inode_ref *ref;
30 unsigned long ptr; 30 unsigned long ptr;
31 unsigned long name_ptr; 31 unsigned long name_ptr;
@@ -33,9 +33,8 @@ static int find_name_in_backref(struct btrfs_path *path, const char *name,
33 u32 cur_offset = 0; 33 u32 cur_offset = 0;
34 int len; 34 int len;
35 35
36 leaf = path->nodes[0]; 36 item_size = btrfs_item_size_nr(leaf, slot);
37 item_size = btrfs_item_size_nr(leaf, path->slots[0]); 37 ptr = btrfs_item_ptr_offset(leaf, slot);
38 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
39 while (cur_offset < item_size) { 38 while (cur_offset < item_size) {
40 ref = (struct btrfs_inode_ref *)(ptr + cur_offset); 39 ref = (struct btrfs_inode_ref *)(ptr + cur_offset);
41 len = btrfs_inode_ref_name_len(leaf, ref); 40 len = btrfs_inode_ref_name_len(leaf, ref);
@@ -44,18 +43,19 @@ static int find_name_in_backref(struct btrfs_path *path, const char *name,
44 if (len != name_len) 43 if (len != name_len)
45 continue; 44 continue;
46 if (memcmp_extent_buffer(leaf, name, name_ptr, name_len) == 0) { 45 if (memcmp_extent_buffer(leaf, name, name_ptr, name_len) == 0) {
47 *ref_ret = ref; 46 if (ref_ret)
47 *ref_ret = ref;
48 return 1; 48 return 1;
49 } 49 }
50 } 50 }
51 return 0; 51 return 0;
52} 52}
53 53
54int btrfs_find_name_in_ext_backref(struct btrfs_path *path, u64 ref_objectid, 54int btrfs_find_name_in_ext_backref(struct extent_buffer *leaf, int slot,
55 u64 ref_objectid,
55 const char *name, int name_len, 56 const char *name, int name_len,
56 struct btrfs_inode_extref **extref_ret) 57 struct btrfs_inode_extref **extref_ret)
57{ 58{
58 struct extent_buffer *leaf;
59 struct btrfs_inode_extref *extref; 59 struct btrfs_inode_extref *extref;
60 unsigned long ptr; 60 unsigned long ptr;
61 unsigned long name_ptr; 61 unsigned long name_ptr;
@@ -63,9 +63,8 @@ int btrfs_find_name_in_ext_backref(struct btrfs_path *path, u64 ref_objectid,
63 u32 cur_offset = 0; 63 u32 cur_offset = 0;
64 int ref_name_len; 64 int ref_name_len;
65 65
66 leaf = path->nodes[0]; 66 item_size = btrfs_item_size_nr(leaf, slot);
67 item_size = btrfs_item_size_nr(leaf, path->slots[0]); 67 ptr = btrfs_item_ptr_offset(leaf, slot);
68 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
69 68
70 /* 69 /*
71 * Search all extended backrefs in this item. We're only 70 * Search all extended backrefs in this item. We're only
@@ -113,7 +112,9 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
113 return ERR_PTR(ret); 112 return ERR_PTR(ret);
114 if (ret > 0) 113 if (ret > 0)
115 return NULL; 114 return NULL;
116 if (!btrfs_find_name_in_ext_backref(path, ref_objectid, name, name_len, &extref)) 115 if (!btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0],
116 ref_objectid, name, name_len,
117 &extref))
117 return NULL; 118 return NULL;
118 return extref; 119 return extref;
119} 120}
@@ -155,7 +156,8 @@ static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
155 * This should always succeed so error here will make the FS 156 * This should always succeed so error here will make the FS
156 * readonly. 157 * readonly.
157 */ 158 */
158 if (!btrfs_find_name_in_ext_backref(path, ref_objectid, 159 if (!btrfs_find_name_in_ext_backref(path->nodes[0], path->slots[0],
160 ref_objectid,
159 name, name_len, &extref)) { 161 name, name_len, &extref)) {
160 btrfs_handle_fs_error(root->fs_info, -ENOENT, NULL); 162 btrfs_handle_fs_error(root->fs_info, -ENOENT, NULL);
161 ret = -EROFS; 163 ret = -EROFS;
@@ -225,7 +227,8 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
225 } else if (ret < 0) { 227 } else if (ret < 0) {
226 goto out; 228 goto out;
227 } 229 }
228 if (!find_name_in_backref(path, name, name_len, &ref)) { 230 if (!btrfs_find_name_in_backref(path->nodes[0], path->slots[0],
231 name, name_len, &ref)) {
229 ret = -ENOENT; 232 ret = -ENOENT;
230 search_ext_refs = 1; 233 search_ext_refs = 1;
231 goto out; 234 goto out;
@@ -293,7 +296,9 @@ static int btrfs_insert_inode_extref(struct btrfs_trans_handle *trans,
293 ret = btrfs_insert_empty_item(trans, root, path, &key, 296 ret = btrfs_insert_empty_item(trans, root, path, &key,
294 ins_len); 297 ins_len);
295 if (ret == -EEXIST) { 298 if (ret == -EEXIST) {
296 if (btrfs_find_name_in_ext_backref(path, ref_objectid, 299 if (btrfs_find_name_in_ext_backref(path->nodes[0],
300 path->slots[0],
301 ref_objectid,
297 name, name_len, NULL)) 302 name, name_len, NULL))
298 goto out; 303 goto out;
299 304
@@ -351,7 +356,8 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
351 if (ret == -EEXIST) { 356 if (ret == -EEXIST) {
352 u32 old_size; 357 u32 old_size;
353 358
354 if (find_name_in_backref(path, name, name_len, &ref)) 359 if (btrfs_find_name_in_backref(path->nodes[0], path->slots[0],
360 name, name_len, &ref))
355 goto out; 361 goto out;
356 362
357 old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); 363 old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]);
@@ -365,7 +371,9 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
365 ret = 0; 371 ret = 0;
366 } else if (ret < 0) { 372 } else if (ret < 0) {
367 if (ret == -EOVERFLOW) { 373 if (ret == -EOVERFLOW) {
368 if (find_name_in_backref(path, name, name_len, &ref)) 374 if (btrfs_find_name_in_backref(path->nodes[0],
375 path->slots[0],
376 name, name_len, &ref))
369 ret = -EEXIST; 377 ret = -EEXIST;
370 else 378 else
371 ret = -EMLINK; 379 ret = -EMLINK;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 53ca025655fc..f53470112670 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1335,8 +1335,11 @@ next_slot:
1335 leaf = path->nodes[0]; 1335 leaf = path->nodes[0];
1336 if (path->slots[0] >= btrfs_header_nritems(leaf)) { 1336 if (path->slots[0] >= btrfs_header_nritems(leaf)) {
1337 ret = btrfs_next_leaf(root, path); 1337 ret = btrfs_next_leaf(root, path);
1338 if (ret < 0) 1338 if (ret < 0) {
1339 if (cow_start != (u64)-1)
1340 cur_offset = cow_start;
1339 goto error; 1341 goto error;
1342 }
1340 if (ret > 0) 1343 if (ret > 0)
1341 break; 1344 break;
1342 leaf = path->nodes[0]; 1345 leaf = path->nodes[0];
@@ -2040,12 +2043,15 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
2040 struct inode *inode, struct list_head *list) 2043 struct inode *inode, struct list_head *list)
2041{ 2044{
2042 struct btrfs_ordered_sum *sum; 2045 struct btrfs_ordered_sum *sum;
2046 int ret;
2043 2047
2044 list_for_each_entry(sum, list, list) { 2048 list_for_each_entry(sum, list, list) {
2045 trans->adding_csums = true; 2049 trans->adding_csums = true;
2046 btrfs_csum_file_blocks(trans, 2050 ret = btrfs_csum_file_blocks(trans,
2047 BTRFS_I(inode)->root->fs_info->csum_root, sum); 2051 BTRFS_I(inode)->root->fs_info->csum_root, sum);
2048 trans->adding_csums = false; 2052 trans->adding_csums = false;
2053 if (ret)
2054 return ret;
2049 } 2055 }
2050 return 0; 2056 return 0;
2051} 2057}
@@ -3059,7 +3065,11 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
3059 goto out; 3065 goto out;
3060 } 3066 }
3061 3067
3062 add_pending_csums(trans, inode, &ordered_extent->list); 3068 ret = add_pending_csums(trans, inode, &ordered_extent->list);
3069 if (ret) {
3070 btrfs_abort_transaction(trans, ret);
3071 goto out;
3072 }
3063 3073
3064 btrfs_ordered_update_i_size(inode, 0, ordered_extent); 3074 btrfs_ordered_update_i_size(inode, 0, ordered_extent);
3065 ret = btrfs_update_inode_fallback(trans, root, inode); 3075 ret = btrfs_update_inode_fallback(trans, root, inode);
@@ -3385,6 +3395,11 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans,
3385 ret = btrfs_orphan_reserve_metadata(trans, inode); 3395 ret = btrfs_orphan_reserve_metadata(trans, inode);
3386 ASSERT(!ret); 3396 ASSERT(!ret);
3387 if (ret) { 3397 if (ret) {
3398 /*
3399 * dec doesn't need spin_lock as ->orphan_block_rsv
3400 * would be released only if ->orphan_inodes is
3401 * zero.
3402 */
3388 atomic_dec(&root->orphan_inodes); 3403 atomic_dec(&root->orphan_inodes);
3389 clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, 3404 clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
3390 &inode->runtime_flags); 3405 &inode->runtime_flags);
@@ -3399,12 +3414,17 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans,
3399 if (insert >= 1) { 3414 if (insert >= 1) {
3400 ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode)); 3415 ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode));
3401 if (ret) { 3416 if (ret) {
3402 atomic_dec(&root->orphan_inodes);
3403 if (reserve) { 3417 if (reserve) {
3404 clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, 3418 clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
3405 &inode->runtime_flags); 3419 &inode->runtime_flags);
3406 btrfs_orphan_release_metadata(inode); 3420 btrfs_orphan_release_metadata(inode);
3407 } 3421 }
3422 /*
3423 * btrfs_orphan_commit_root may race with us and set
3424 * ->orphan_block_rsv to zero, in order to avoid that,
3425 * decrease ->orphan_inodes after everything is done.
3426 */
3427 atomic_dec(&root->orphan_inodes);
3408 if (ret != -EEXIST) { 3428 if (ret != -EEXIST) {
3409 clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, 3429 clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
3410 &inode->runtime_flags); 3430 &inode->runtime_flags);
@@ -3436,28 +3456,26 @@ static int btrfs_orphan_del(struct btrfs_trans_handle *trans,
3436{ 3456{
3437 struct btrfs_root *root = inode->root; 3457 struct btrfs_root *root = inode->root;
3438 int delete_item = 0; 3458 int delete_item = 0;
3439 int release_rsv = 0;
3440 int ret = 0; 3459 int ret = 0;
3441 3460
3442 spin_lock(&root->orphan_lock);
3443 if (test_and_clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, 3461 if (test_and_clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
3444 &inode->runtime_flags)) 3462 &inode->runtime_flags))
3445 delete_item = 1; 3463 delete_item = 1;
3446 3464
3465 if (delete_item && trans)
3466 ret = btrfs_del_orphan_item(trans, root, btrfs_ino(inode));
3467
3447 if (test_and_clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, 3468 if (test_and_clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
3448 &inode->runtime_flags)) 3469 &inode->runtime_flags))
3449 release_rsv = 1; 3470 btrfs_orphan_release_metadata(inode);
3450 spin_unlock(&root->orphan_lock);
3451 3471
3452 if (delete_item) { 3472 /*
3473 * btrfs_orphan_commit_root may race with us and set ->orphan_block_rsv
3474 * to zero, in order to avoid that, decrease ->orphan_inodes after
3475 * everything is done.
3476 */
3477 if (delete_item)
3453 atomic_dec(&root->orphan_inodes); 3478 atomic_dec(&root->orphan_inodes);
3454 if (trans)
3455 ret = btrfs_del_orphan_item(trans, root,
3456 btrfs_ino(inode));
3457 }
3458
3459 if (release_rsv)
3460 btrfs_orphan_release_metadata(inode);
3461 3479
3462 return ret; 3480 return ret;
3463} 3481}
@@ -5281,7 +5299,7 @@ void btrfs_evict_inode(struct inode *inode)
5281 trace_btrfs_inode_evict(inode); 5299 trace_btrfs_inode_evict(inode);
5282 5300
5283 if (!root) { 5301 if (!root) {
5284 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); 5302 clear_inode(inode);
5285 return; 5303 return;
5286 } 5304 }
5287 5305
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 9e61dd624f7b..aa259d6986e1 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1442,8 +1442,13 @@ int btrfs_qgroup_trace_extent_post(struct btrfs_fs_info *fs_info,
1442 int ret; 1442 int ret;
1443 1443
1444 ret = btrfs_find_all_roots(NULL, fs_info, bytenr, 0, &old_root, false); 1444 ret = btrfs_find_all_roots(NULL, fs_info, bytenr, 0, &old_root, false);
1445 if (ret < 0) 1445 if (ret < 0) {
1446 return ret; 1446 fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
1447 btrfs_warn(fs_info,
1448"error accounting new delayed refs extent (err code: %d), quota inconsistent",
1449 ret);
1450 return 0;
1451 }
1447 1452
1448 /* 1453 /*
1449 * Here we don't need to get the lock of 1454 * Here we don't need to get the lock of
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index f0c3f00e97cb..cd2298d185dd 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3268,8 +3268,22 @@ static int relocate_file_extent_cluster(struct inode *inode,
3268 nr++; 3268 nr++;
3269 } 3269 }
3270 3270
3271 btrfs_set_extent_delalloc(inode, page_start, page_end, 0, NULL, 3271 ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
3272 0); 3272 NULL, 0);
3273 if (ret) {
3274 unlock_page(page);
3275 put_page(page);
3276 btrfs_delalloc_release_metadata(BTRFS_I(inode),
3277 PAGE_SIZE);
3278 btrfs_delalloc_release_extents(BTRFS_I(inode),
3279 PAGE_SIZE);
3280
3281 clear_extent_bits(&BTRFS_I(inode)->io_tree,
3282 page_start, page_end,
3283 EXTENT_LOCKED | EXTENT_BOUNDARY);
3284 goto out;
3285
3286 }
3273 set_page_dirty(page); 3287 set_page_dirty(page);
3274 3288
3275 unlock_extent(&BTRFS_I(inode)->io_tree, 3289 unlock_extent(&BTRFS_I(inode)->io_tree,
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index f306c608dc28..484e2af793de 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -5005,6 +5005,9 @@ static int send_hole(struct send_ctx *sctx, u64 end)
5005 u64 len; 5005 u64 len;
5006 int ret = 0; 5006 int ret = 0;
5007 5007
5008 if (sctx->flags & BTRFS_SEND_FLAG_NO_FILE_DATA)
5009 return send_update_extent(sctx, offset, end - offset);
5010
5008 p = fs_path_alloc(); 5011 p = fs_path_alloc();
5009 if (!p) 5012 if (!p)
5010 return -ENOMEM; 5013 return -ENOMEM;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 6e71a2a78363..4b817947e00f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1545,7 +1545,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
1545 * it for searching for existing supers, so this lets us do that and 1545 * it for searching for existing supers, so this lets us do that and
1546 * then open_ctree will properly initialize everything later. 1546 * then open_ctree will properly initialize everything later.
1547 */ 1547 */
1548 fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL); 1548 fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
1549 if (!fs_info) { 1549 if (!fs_info) {
1550 error = -ENOMEM; 1550 error = -ENOMEM;
1551 goto error_sec_opts; 1551 goto error_sec_opts;
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index a8bafed931f4..d11c70bff5a9 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -423,7 +423,7 @@ static ssize_t btrfs_nodesize_show(struct kobject *kobj,
423{ 423{
424 struct btrfs_fs_info *fs_info = to_fs_info(kobj); 424 struct btrfs_fs_info *fs_info = to_fs_info(kobj);
425 425
426 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->nodesize); 426 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->nodesize);
427} 427}
428 428
429BTRFS_ATTR(, nodesize, btrfs_nodesize_show); 429BTRFS_ATTR(, nodesize, btrfs_nodesize_show);
@@ -433,8 +433,7 @@ static ssize_t btrfs_sectorsize_show(struct kobject *kobj,
433{ 433{
434 struct btrfs_fs_info *fs_info = to_fs_info(kobj); 434 struct btrfs_fs_info *fs_info = to_fs_info(kobj);
435 435
436 return snprintf(buf, PAGE_SIZE, "%u\n", 436 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->sectorsize);
437 fs_info->super_copy->sectorsize);
438} 437}
439 438
440BTRFS_ATTR(, sectorsize, btrfs_sectorsize_show); 439BTRFS_ATTR(, sectorsize, btrfs_sectorsize_show);
@@ -444,8 +443,7 @@ static ssize_t btrfs_clone_alignment_show(struct kobject *kobj,
444{ 443{
445 struct btrfs_fs_info *fs_info = to_fs_info(kobj); 444 struct btrfs_fs_info *fs_info = to_fs_info(kobj);
446 445
447 return snprintf(buf, PAGE_SIZE, "%u\n", 446 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->sectorsize);
448 fs_info->super_copy->sectorsize);
449} 447}
450 448
451BTRFS_ATTR(, clone_alignment, btrfs_clone_alignment_show); 449BTRFS_ATTR(, clone_alignment, btrfs_clone_alignment_show);
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 04f07144b45c..9220f004001c 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1722,19 +1722,23 @@ static void update_super_roots(struct btrfs_fs_info *fs_info)
1722 1722
1723 super = fs_info->super_copy; 1723 super = fs_info->super_copy;
1724 1724
1725 /* update latest btrfs_super_block::chunk_root refs */
1725 root_item = &fs_info->chunk_root->root_item; 1726 root_item = &fs_info->chunk_root->root_item;
1726 super->chunk_root = root_item->bytenr; 1727 btrfs_set_super_chunk_root(super, root_item->bytenr);
1727 super->chunk_root_generation = root_item->generation; 1728 btrfs_set_super_chunk_root_generation(super, root_item->generation);
1728 super->chunk_root_level = root_item->level; 1729 btrfs_set_super_chunk_root_level(super, root_item->level);
1729 1730
1731 /* update latest btrfs_super_block::root refs */
1730 root_item = &fs_info->tree_root->root_item; 1732 root_item = &fs_info->tree_root->root_item;
1731 super->root = root_item->bytenr; 1733 btrfs_set_super_root(super, root_item->bytenr);
1732 super->generation = root_item->generation; 1734 btrfs_set_super_generation(super, root_item->generation);
1733 super->root_level = root_item->level; 1735 btrfs_set_super_root_level(super, root_item->level);
1736
1734 if (btrfs_test_opt(fs_info, SPACE_CACHE)) 1737 if (btrfs_test_opt(fs_info, SPACE_CACHE))
1735 super->cache_generation = root_item->generation; 1738 btrfs_set_super_cache_generation(super, root_item->generation);
1736 if (test_bit(BTRFS_FS_UPDATE_UUID_TREE_GEN, &fs_info->flags)) 1739 if (test_bit(BTRFS_FS_UPDATE_UUID_TREE_GEN, &fs_info->flags))
1737 super->uuid_tree_generation = root_item->generation; 1740 btrfs_set_super_uuid_tree_generation(super,
1741 root_item->generation);
1738} 1742}
1739 1743
1740int btrfs_transaction_in_commit(struct btrfs_fs_info *info) 1744int btrfs_transaction_in_commit(struct btrfs_fs_info *info)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index afadaadab18e..434457794c27 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -29,6 +29,7 @@
29#include "hash.h" 29#include "hash.h"
30#include "compression.h" 30#include "compression.h"
31#include "qgroup.h" 31#include "qgroup.h"
32#include "inode-map.h"
32 33
33/* magic values for the inode_only field in btrfs_log_inode: 34/* magic values for the inode_only field in btrfs_log_inode:
34 * 35 *
@@ -966,7 +967,9 @@ static noinline int backref_in_log(struct btrfs_root *log,
966 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); 967 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]);
967 968
968 if (key->type == BTRFS_INODE_EXTREF_KEY) { 969 if (key->type == BTRFS_INODE_EXTREF_KEY) {
969 if (btrfs_find_name_in_ext_backref(path, ref_objectid, 970 if (btrfs_find_name_in_ext_backref(path->nodes[0],
971 path->slots[0],
972 ref_objectid,
970 name, namelen, NULL)) 973 name, namelen, NULL))
971 match = 1; 974 match = 1;
972 975
@@ -1190,7 +1193,8 @@ static int extref_get_fields(struct extent_buffer *eb, unsigned long ref_ptr,
1190 read_extent_buffer(eb, *name, (unsigned long)&extref->name, 1193 read_extent_buffer(eb, *name, (unsigned long)&extref->name,
1191 *namelen); 1194 *namelen);
1192 1195
1193 *index = btrfs_inode_extref_index(eb, extref); 1196 if (index)
1197 *index = btrfs_inode_extref_index(eb, extref);
1194 if (parent_objectid) 1198 if (parent_objectid)
1195 *parent_objectid = btrfs_inode_extref_parent(eb, extref); 1199 *parent_objectid = btrfs_inode_extref_parent(eb, extref);
1196 1200
@@ -1211,12 +1215,102 @@ static int ref_get_fields(struct extent_buffer *eb, unsigned long ref_ptr,
1211 1215
1212 read_extent_buffer(eb, *name, (unsigned long)(ref + 1), *namelen); 1216 read_extent_buffer(eb, *name, (unsigned long)(ref + 1), *namelen);
1213 1217
1214 *index = btrfs_inode_ref_index(eb, ref); 1218 if (index)
1219 *index = btrfs_inode_ref_index(eb, ref);
1215 1220
1216 return 0; 1221 return 0;
1217} 1222}
1218 1223
1219/* 1224/*
1225 * Take an inode reference item from the log tree and iterate all names from the
1226 * inode reference item in the subvolume tree with the same key (if it exists).
1227 * For any name that is not in the inode reference item from the log tree, do a
1228 * proper unlink of that name (that is, remove its entry from the inode
1229 * reference item and both dir index keys).
1230 */
1231static int unlink_old_inode_refs(struct btrfs_trans_handle *trans,
1232 struct btrfs_root *root,
1233 struct btrfs_path *path,
1234 struct btrfs_inode *inode,
1235 struct extent_buffer *log_eb,
1236 int log_slot,
1237 struct btrfs_key *key)
1238{
1239 int ret;
1240 unsigned long ref_ptr;
1241 unsigned long ref_end;
1242 struct extent_buffer *eb;
1243
1244again:
1245 btrfs_release_path(path);
1246 ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
1247 if (ret > 0) {
1248 ret = 0;
1249 goto out;
1250 }
1251 if (ret < 0)
1252 goto out;
1253
1254 eb = path->nodes[0];
1255 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]);
1256 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]);
1257 while (ref_ptr < ref_end) {
1258 char *name = NULL;
1259 int namelen;
1260 u64 parent_id;
1261
1262 if (key->type == BTRFS_INODE_EXTREF_KEY) {
1263 ret = extref_get_fields(eb, ref_ptr, &namelen, &name,
1264 NULL, &parent_id);
1265 } else {
1266 parent_id = key->offset;
1267 ret = ref_get_fields(eb, ref_ptr, &namelen, &name,
1268 NULL);
1269 }
1270 if (ret)
1271 goto out;
1272
1273 if (key->type == BTRFS_INODE_EXTREF_KEY)
1274 ret = btrfs_find_name_in_ext_backref(log_eb, log_slot,
1275 parent_id, name,
1276 namelen, NULL);
1277 else
1278 ret = btrfs_find_name_in_backref(log_eb, log_slot, name,
1279 namelen, NULL);
1280
1281 if (!ret) {
1282 struct inode *dir;
1283
1284 btrfs_release_path(path);
1285 dir = read_one_inode(root, parent_id);
1286 if (!dir) {
1287 ret = -ENOENT;
1288 kfree(name);
1289 goto out;
1290 }
1291 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
1292 inode, name, namelen);
1293 kfree(name);
1294 iput(dir);
1295 if (ret)
1296 goto out;
1297 goto again;
1298 }
1299
1300 kfree(name);
1301 ref_ptr += namelen;
1302 if (key->type == BTRFS_INODE_EXTREF_KEY)
1303 ref_ptr += sizeof(struct btrfs_inode_extref);
1304 else
1305 ref_ptr += sizeof(struct btrfs_inode_ref);
1306 }
1307 ret = 0;
1308 out:
1309 btrfs_release_path(path);
1310 return ret;
1311}
1312
1313/*
1220 * replay one inode back reference item found in the log tree. 1314 * replay one inode back reference item found in the log tree.
1221 * eb, slot and key refer to the buffer and key found in the log tree. 1315 * eb, slot and key refer to the buffer and key found in the log tree.
1222 * root is the destination we are replaying into, and path is for temp 1316 * root is the destination we are replaying into, and path is for temp
@@ -1344,6 +1438,19 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
1344 } 1438 }
1345 } 1439 }
1346 1440
1441 /*
1442 * Before we overwrite the inode reference item in the subvolume tree
1443 * with the item from the log tree, we must unlink all names from the
1444 * parent directory that are in the subvolume's tree inode reference
1445 * item, otherwise we end up with an inconsistent subvolume tree where
1446 * dir index entries exist for a name but there is no inode reference
1447 * item with the same name.
1448 */
1449 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot,
1450 key);
1451 if (ret)
1452 goto out;
1453
1347 /* finally write the back reference in the inode */ 1454 /* finally write the back reference in the inode */
1348 ret = overwrite_item(trans, root, path, eb, slot, key); 1455 ret = overwrite_item(trans, root, path, eb, slot, key);
1349out: 1456out:
@@ -2472,6 +2579,9 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
2472 clean_tree_block(fs_info, next); 2579 clean_tree_block(fs_info, next);
2473 btrfs_wait_tree_block_writeback(next); 2580 btrfs_wait_tree_block_writeback(next);
2474 btrfs_tree_unlock(next); 2581 btrfs_tree_unlock(next);
2582 } else {
2583 if (test_and_clear_bit(EXTENT_BUFFER_DIRTY, &next->bflags))
2584 clear_extent_buffer_dirty(next);
2475 } 2585 }
2476 2586
2477 WARN_ON(root_owner != 2587 WARN_ON(root_owner !=
@@ -2552,6 +2662,9 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
2552 clean_tree_block(fs_info, next); 2662 clean_tree_block(fs_info, next);
2553 btrfs_wait_tree_block_writeback(next); 2663 btrfs_wait_tree_block_writeback(next);
2554 btrfs_tree_unlock(next); 2664 btrfs_tree_unlock(next);
2665 } else {
2666 if (test_and_clear_bit(EXTENT_BUFFER_DIRTY, &next->bflags))
2667 clear_extent_buffer_dirty(next);
2555 } 2668 }
2556 2669
2557 WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID); 2670 WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID);
@@ -2630,6 +2743,9 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,
2630 clean_tree_block(fs_info, next); 2743 clean_tree_block(fs_info, next);
2631 btrfs_wait_tree_block_writeback(next); 2744 btrfs_wait_tree_block_writeback(next);
2632 btrfs_tree_unlock(next); 2745 btrfs_tree_unlock(next);
2746 } else {
2747 if (test_and_clear_bit(EXTENT_BUFFER_DIRTY, &next->bflags))
2748 clear_extent_buffer_dirty(next);
2633 } 2749 }
2634 2750
2635 WARN_ON(log->root_key.objectid != 2751 WARN_ON(log->root_key.objectid !=
@@ -3018,13 +3134,14 @@ static void free_log_tree(struct btrfs_trans_handle *trans,
3018 3134
3019 while (1) { 3135 while (1) {
3020 ret = find_first_extent_bit(&log->dirty_log_pages, 3136 ret = find_first_extent_bit(&log->dirty_log_pages,
3021 0, &start, &end, EXTENT_DIRTY | EXTENT_NEW, 3137 0, &start, &end,
3138 EXTENT_DIRTY | EXTENT_NEW | EXTENT_NEED_WAIT,
3022 NULL); 3139 NULL);
3023 if (ret) 3140 if (ret)
3024 break; 3141 break;
3025 3142
3026 clear_extent_bits(&log->dirty_log_pages, start, end, 3143 clear_extent_bits(&log->dirty_log_pages, start, end,
3027 EXTENT_DIRTY | EXTENT_NEW); 3144 EXTENT_DIRTY | EXTENT_NEW | EXTENT_NEED_WAIT);
3028 } 3145 }
3029 3146
3030 /* 3147 /*
@@ -5677,6 +5794,23 @@ again:
5677 path); 5794 path);
5678 } 5795 }
5679 5796
5797 if (!ret && wc.stage == LOG_WALK_REPLAY_ALL) {
5798 struct btrfs_root *root = wc.replay_dest;
5799
5800 btrfs_release_path(path);
5801
5802 /*
5803 * We have just replayed everything, and the highest
5804 * objectid of fs roots probably has changed in case
5805 * some inode_item's got replayed.
5806 *
5807 * root->objectid_mutex is not acquired as log replay
5808 * could only happen during mount.
5809 */
5810 ret = btrfs_find_highest_objectid(root,
5811 &root->highest_objectid);
5812 }
5813
5680 key.offset = found_key.offset - 1; 5814 key.offset = found_key.offset - 1;
5681 wc.replay_dest->log_root = NULL; 5815 wc.replay_dest->log_root = NULL;
5682 free_extent_buffer(log->node); 5816 free_extent_buffer(log->node);
@@ -5825,7 +5959,7 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans,
5825 * this will force the logging code to walk the dentry chain 5959 * this will force the logging code to walk the dentry chain
5826 * up for the file 5960 * up for the file
5827 */ 5961 */
5828 if (S_ISREG(inode->vfs_inode.i_mode)) 5962 if (!S_ISDIR(inode->vfs_inode.i_mode))
5829 inode->last_unlink_trans = trans->transid; 5963 inode->last_unlink_trans = trans->transid;
5830 5964
5831 /* 5965 /*
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b5036bd69e6a..b2d05c6b1c56 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -645,6 +645,7 @@ static void btrfs_free_stale_devices(const char *path,
645 btrfs_sysfs_remove_fsid(fs_devs); 645 btrfs_sysfs_remove_fsid(fs_devs);
646 list_del(&fs_devs->list); 646 list_del(&fs_devs->list);
647 free_fs_devices(fs_devs); 647 free_fs_devices(fs_devs);
648 break;
648 } else { 649 } else {
649 fs_devs->num_devices--; 650 fs_devs->num_devices--;
650 list_del(&dev->dev_list); 651 list_del(&dev->dev_list);
@@ -4828,10 +4829,13 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
4828 ndevs = min(ndevs, devs_max); 4829 ndevs = min(ndevs, devs_max);
4829 4830
4830 /* 4831 /*
4831 * the primary goal is to maximize the number of stripes, so use as many 4832 * The primary goal is to maximize the number of stripes, so use as
4832 * devices as possible, even if the stripes are not maximum sized. 4833 * many devices as possible, even if the stripes are not maximum sized.
4834 *
4835 * The DUP profile stores more than one stripe per device, the
4836 * max_avail is the total size so we have to adjust.
4833 */ 4837 */
4834 stripe_size = devices_info[ndevs-1].max_avail; 4838 stripe_size = div_u64(devices_info[ndevs - 1].max_avail, dev_stripes);
4835 num_stripes = ndevs * dev_stripes; 4839 num_stripes = ndevs * dev_stripes;
4836 4840
4837 /* 4841 /*
@@ -4866,8 +4870,6 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
4866 stripe_size = devices_info[ndevs-1].max_avail; 4870 stripe_size = devices_info[ndevs-1].max_avail;
4867 } 4871 }
4868 4872
4869 stripe_size = div_u64(stripe_size, dev_stripes);
4870
4871 /* align to BTRFS_STRIPE_LEN */ 4873 /* align to BTRFS_STRIPE_LEN */
4872 stripe_size = round_down(stripe_size, BTRFS_STRIPE_LEN); 4874 stripe_size = round_down(stripe_size, BTRFS_STRIPE_LEN);
4873 4875
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 6582c4507e6c..0e5bd3e3344e 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3965,6 +3965,32 @@ void ceph_put_fmode(struct ceph_inode_info *ci, int fmode)
3965} 3965}
3966 3966
3967/* 3967/*
3968 * For a soon-to-be unlinked file, drop the AUTH_RDCACHE caps. If it
3969 * looks like the link count will hit 0, drop any other caps (other
3970 * than PIN) we don't specifically want (due to the file still being
3971 * open).
3972 */
3973int ceph_drop_caps_for_unlink(struct inode *inode)
3974{
3975 struct ceph_inode_info *ci = ceph_inode(inode);
3976 int drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;
3977
3978 spin_lock(&ci->i_ceph_lock);
3979 if (inode->i_nlink == 1) {
3980 drop |= ~(__ceph_caps_wanted(ci) | CEPH_CAP_PIN);
3981
3982 ci->i_ceph_flags |= CEPH_I_NODELAY;
3983 if (__ceph_caps_dirty(ci)) {
3984 struct ceph_mds_client *mdsc =
3985 ceph_inode_to_client(inode)->mdsc;
3986 __cap_delay_requeue_front(mdsc, ci);
3987 }
3988 }
3989 spin_unlock(&ci->i_ceph_lock);
3990 return drop;
3991}
3992
3993/*
3968 * Helpers for embedding cap and dentry lease releases into mds 3994 * Helpers for embedding cap and dentry lease releases into mds
3969 * requests. 3995 * requests.
3970 * 3996 *
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 0c4346806e17..f1d9c6cc0491 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1003,26 +1003,6 @@ static int ceph_link(struct dentry *old_dentry, struct inode *dir,
1003} 1003}
1004 1004
1005/* 1005/*
1006 * For a soon-to-be unlinked file, drop the AUTH_RDCACHE caps. If it
1007 * looks like the link count will hit 0, drop any other caps (other
1008 * than PIN) we don't specifically want (due to the file still being
1009 * open).
1010 */
1011static int drop_caps_for_unlink(struct inode *inode)
1012{
1013 struct ceph_inode_info *ci = ceph_inode(inode);
1014 int drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;
1015
1016 spin_lock(&ci->i_ceph_lock);
1017 if (inode->i_nlink == 1) {
1018 drop |= ~(__ceph_caps_wanted(ci) | CEPH_CAP_PIN);
1019 ci->i_ceph_flags |= CEPH_I_NODELAY;
1020 }
1021 spin_unlock(&ci->i_ceph_lock);
1022 return drop;
1023}
1024
1025/*
1026 * rmdir and unlink are differ only by the metadata op code 1006 * rmdir and unlink are differ only by the metadata op code
1027 */ 1007 */
1028static int ceph_unlink(struct inode *dir, struct dentry *dentry) 1008static int ceph_unlink(struct inode *dir, struct dentry *dentry)
@@ -1056,7 +1036,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
1056 set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); 1036 set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags);
1057 req->r_dentry_drop = CEPH_CAP_FILE_SHARED; 1037 req->r_dentry_drop = CEPH_CAP_FILE_SHARED;
1058 req->r_dentry_unless = CEPH_CAP_FILE_EXCL; 1038 req->r_dentry_unless = CEPH_CAP_FILE_EXCL;
1059 req->r_inode_drop = drop_caps_for_unlink(inode); 1039 req->r_inode_drop = ceph_drop_caps_for_unlink(inode);
1060 err = ceph_mdsc_do_request(mdsc, dir, req); 1040 err = ceph_mdsc_do_request(mdsc, dir, req);
1061 if (!err && !req->r_reply_info.head->is_dentry) 1041 if (!err && !req->r_reply_info.head->is_dentry)
1062 d_delete(dentry); 1042 d_delete(dentry);
@@ -1104,8 +1084,10 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
1104 req->r_dentry_unless = CEPH_CAP_FILE_EXCL; 1084 req->r_dentry_unless = CEPH_CAP_FILE_EXCL;
1105 /* release LINK_RDCACHE on source inode (mds will lock it) */ 1085 /* release LINK_RDCACHE on source inode (mds will lock it) */
1106 req->r_old_inode_drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL; 1086 req->r_old_inode_drop = CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL;
1107 if (d_really_is_positive(new_dentry)) 1087 if (d_really_is_positive(new_dentry)) {
1108 req->r_inode_drop = drop_caps_for_unlink(d_inode(new_dentry)); 1088 req->r_inode_drop =
1089 ceph_drop_caps_for_unlink(d_inode(new_dentry));
1090 }
1109 err = ceph_mdsc_do_request(mdsc, old_dir, req); 1091 err = ceph_mdsc_do_request(mdsc, old_dir, req);
1110 if (!err && !req->r_reply_info.head->is_dentry) { 1092 if (!err && !req->r_reply_info.head->is_dentry) {
1111 /* 1093 /*
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index a62d2a9841dc..fb2bc9c15a23 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -225,6 +225,7 @@ static int parse_fsopt_token(char *c, void *private)
225 return -ENOMEM; 225 return -ENOMEM;
226 break; 226 break;
227 case Opt_mds_namespace: 227 case Opt_mds_namespace:
228 kfree(fsopt->mds_namespace);
228 fsopt->mds_namespace = kstrndup(argstr[0].from, 229 fsopt->mds_namespace = kstrndup(argstr[0].from,
229 argstr[0].to-argstr[0].from, 230 argstr[0].to-argstr[0].from,
230 GFP_KERNEL); 231 GFP_KERNEL);
@@ -232,6 +233,7 @@ static int parse_fsopt_token(char *c, void *private)
232 return -ENOMEM; 233 return -ENOMEM;
233 break; 234 break;
234 case Opt_fscache_uniq: 235 case Opt_fscache_uniq:
236 kfree(fsopt->fscache_uniq);
235 fsopt->fscache_uniq = kstrndup(argstr[0].from, 237 fsopt->fscache_uniq = kstrndup(argstr[0].from,
236 argstr[0].to-argstr[0].from, 238 argstr[0].to-argstr[0].from,
237 GFP_KERNEL); 239 GFP_KERNEL);
@@ -711,14 +713,17 @@ static int __init init_caches(void)
711 goto bad_dentry; 713 goto bad_dentry;
712 714
713 ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD); 715 ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD);
714
715 if (!ceph_file_cachep) 716 if (!ceph_file_cachep)
716 goto bad_file; 717 goto bad_file;
717 718
718 if ((error = ceph_fscache_register())) 719 error = ceph_fscache_register();
719 goto bad_file; 720 if (error)
721 goto bad_fscache;
720 722
721 return 0; 723 return 0;
724
725bad_fscache:
726 kmem_cache_destroy(ceph_file_cachep);
722bad_file: 727bad_file:
723 kmem_cache_destroy(ceph_dentry_cachep); 728 kmem_cache_destroy(ceph_dentry_cachep);
724bad_dentry: 729bad_dentry:
@@ -836,7 +841,6 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
836 int err; 841 int err;
837 unsigned long started = jiffies; /* note the start time */ 842 unsigned long started = jiffies; /* note the start time */
838 struct dentry *root; 843 struct dentry *root;
839 int first = 0; /* first vfsmount for this super_block */
840 844
841 dout("mount start %p\n", fsc); 845 dout("mount start %p\n", fsc);
842 mutex_lock(&fsc->client->mount_mutex); 846 mutex_lock(&fsc->client->mount_mutex);
@@ -861,17 +865,17 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
861 path = fsc->mount_options->server_path + 1; 865 path = fsc->mount_options->server_path + 1;
862 dout("mount opening path %s\n", path); 866 dout("mount opening path %s\n", path);
863 } 867 }
868
869 err = ceph_fs_debugfs_init(fsc);
870 if (err < 0)
871 goto out;
872
864 root = open_root_dentry(fsc, path, started); 873 root = open_root_dentry(fsc, path, started);
865 if (IS_ERR(root)) { 874 if (IS_ERR(root)) {
866 err = PTR_ERR(root); 875 err = PTR_ERR(root);
867 goto out; 876 goto out;
868 } 877 }
869 fsc->sb->s_root = dget(root); 878 fsc->sb->s_root = dget(root);
870 first = 1;
871
872 err = ceph_fs_debugfs_init(fsc);
873 if (err < 0)
874 goto fail;
875 } else { 879 } else {
876 root = dget(fsc->sb->s_root); 880 root = dget(fsc->sb->s_root);
877 } 881 }
@@ -881,11 +885,6 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
881 mutex_unlock(&fsc->client->mount_mutex); 885 mutex_unlock(&fsc->client->mount_mutex);
882 return root; 886 return root;
883 887
884fail:
885 if (first) {
886 dput(fsc->sb->s_root);
887 fsc->sb->s_root = NULL;
888 }
889out: 888out:
890 mutex_unlock(&fsc->client->mount_mutex); 889 mutex_unlock(&fsc->client->mount_mutex);
891 return ERR_PTR(err); 890 return ERR_PTR(err);
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 21b2e5b004eb..1c2086e0fec2 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -987,7 +987,7 @@ extern void ceph_check_caps(struct ceph_inode_info *ci, int flags,
987 struct ceph_mds_session *session); 987 struct ceph_mds_session *session);
988extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc); 988extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc);
989extern void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc); 989extern void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc);
990 990extern int ceph_drop_caps_for_unlink(struct inode *inode);
991extern int ceph_encode_inode_release(void **p, struct inode *inode, 991extern int ceph_encode_inode_release(void **p, struct inode *inode,
992 int mds, int drop, int unless, int force); 992 int mds, int drop, int unless, int force);
993extern int ceph_encode_dentry_release(void **p, struct dentry *dn, 993extern int ceph_encode_dentry_release(void **p, struct dentry *dn,
diff --git a/fs/direct-io.c b/fs/direct-io.c
index a0ca9e48e993..1357ef563893 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1274,8 +1274,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
1274 */ 1274 */
1275 if (dio->is_async && iov_iter_rw(iter) == WRITE) { 1275 if (dio->is_async && iov_iter_rw(iter) == WRITE) {
1276 retval = 0; 1276 retval = 0;
1277 if ((iocb->ki_filp->f_flags & O_DSYNC) || 1277 if (iocb->ki_flags & IOCB_DSYNC)
1278 IS_SYNC(iocb->ki_filp->f_mapping->host))
1279 retval = dio_set_defer_completion(dio); 1278 retval = dio_set_defer_completion(dio);
1280 else if (!dio->inode->i_sb->s_dio_done_wq) { 1279 else if (!dio->inode->i_sb->s_dio_done_wq) {
1281 /* 1280 /*
diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c
index 5f22e74bbade..8e568428c88b 100644
--- a/fs/efivarfs/file.c
+++ b/fs/efivarfs/file.c
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include <linux/efi.h> 10#include <linux/efi.h>
11#include <linux/delay.h>
11#include <linux/fs.h> 12#include <linux/fs.h>
12#include <linux/slab.h> 13#include <linux/slab.h>
13#include <linux/mount.h> 14#include <linux/mount.h>
@@ -74,6 +75,11 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf,
74 ssize_t size = 0; 75 ssize_t size = 0;
75 int err; 76 int err;
76 77
78 while (!__ratelimit(&file->f_cred->user->ratelimit)) {
79 if (!msleep_interruptible(50))
80 return -EINTR;
81 }
82
77 err = efivar_entry_size(var, &datasize); 83 err = efivar_entry_size(var, &datasize);
78 84
79 /* 85 /*
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 86863792f36a..86d6a4435c87 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -716,7 +716,7 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
716 __be64 *ptr; 716 __be64 *ptr;
717 sector_t lblock; 717 sector_t lblock;
718 sector_t lend; 718 sector_t lend;
719 int ret; 719 int ret = 0;
720 int eob; 720 int eob;
721 unsigned int len; 721 unsigned int len;
722 struct buffer_head *bh; 722 struct buffer_head *bh;
@@ -728,12 +728,14 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
728 goto out; 728 goto out;
729 } 729 }
730 730
731 if ((flags & IOMAP_REPORT) && gfs2_is_stuffed(ip)) { 731 if (gfs2_is_stuffed(ip)) {
732 gfs2_stuffed_iomap(inode, iomap); 732 if (flags & IOMAP_REPORT) {
733 if (pos >= iomap->length) 733 gfs2_stuffed_iomap(inode, iomap);
734 return -ENOENT; 734 if (pos >= iomap->length)
735 ret = 0; 735 ret = -ENOENT;
736 goto out; 736 goto out;
737 }
738 BUG_ON(!(flags & IOMAP_WRITE));
737 } 739 }
738 740
739 lblock = pos >> inode->i_blkbits; 741 lblock = pos >> inode->i_blkbits;
@@ -744,7 +746,7 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
744 iomap->type = IOMAP_HOLE; 746 iomap->type = IOMAP_HOLE;
745 iomap->length = (u64)(lend - lblock) << inode->i_blkbits; 747 iomap->length = (u64)(lend - lblock) << inode->i_blkbits;
746 iomap->flags = IOMAP_F_MERGED; 748 iomap->flags = IOMAP_F_MERGED;
747 bmap_lock(ip, 0); 749 bmap_lock(ip, flags & IOMAP_WRITE);
748 750
749 /* 751 /*
750 * Directory data blocks have a struct gfs2_meta_header header, so the 752 * Directory data blocks have a struct gfs2_meta_header header, so the
@@ -787,27 +789,28 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length,
787 iomap->flags |= IOMAP_F_BOUNDARY; 789 iomap->flags |= IOMAP_F_BOUNDARY;
788 iomap->length = (u64)len << inode->i_blkbits; 790 iomap->length = (u64)len << inode->i_blkbits;
789 791
790 ret = 0;
791
792out_release: 792out_release:
793 release_metapath(&mp); 793 release_metapath(&mp);
794 bmap_unlock(ip, 0); 794 bmap_unlock(ip, flags & IOMAP_WRITE);
795out: 795out:
796 trace_gfs2_iomap_end(ip, iomap, ret); 796 trace_gfs2_iomap_end(ip, iomap, ret);
797 return ret; 797 return ret;
798 798
799do_alloc: 799do_alloc:
800 if (!(flags & IOMAP_WRITE)) { 800 if (flags & IOMAP_WRITE) {
801 if (pos >= i_size_read(inode)) { 801 ret = gfs2_iomap_alloc(inode, iomap, flags, &mp);
802 } else if (flags & IOMAP_REPORT) {
803 loff_t size = i_size_read(inode);
804 if (pos >= size)
802 ret = -ENOENT; 805 ret = -ENOENT;
803 goto out_release; 806 else if (height <= ip->i_height)
804 } 807 iomap->length = hole_size(inode, lblock, &mp);
805 ret = 0; 808 else
806 iomap->length = hole_size(inode, lblock, &mp); 809 iomap->length = size - pos;
807 goto out_release; 810 } else {
811 if (height <= ip->i_height)
812 iomap->length = hole_size(inode, lblock, &mp);
808 } 813 }
809
810 ret = gfs2_iomap_alloc(inode, iomap, flags, &mp);
811 goto out_release; 814 goto out_release;
812} 815}
813 816
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 2435af56b87e..a50d7813e3ea 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -572,7 +572,7 @@ out:
572} 572}
573 573
574static bool 574static bool
575validate_bitmap_values(unsigned long mask) 575validate_bitmap_values(unsigned int mask)
576{ 576{
577 return (mask & ~RCA4_TYPE_MASK_ALL) == 0; 577 return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
578} 578}
@@ -596,17 +596,15 @@ __be32 nfs4_callback_recallany(void *argp, void *resp,
596 goto out; 596 goto out;
597 597
598 status = cpu_to_be32(NFS4_OK); 598 status = cpu_to_be32(NFS4_OK);
599 if (test_bit(RCA4_TYPE_MASK_RDATA_DLG, (const unsigned long *) 599 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_RDATA_DLG))
600 &args->craa_type_mask))
601 flags = FMODE_READ; 600 flags = FMODE_READ;
602 if (test_bit(RCA4_TYPE_MASK_WDATA_DLG, (const unsigned long *) 601 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_WDATA_DLG))
603 &args->craa_type_mask))
604 flags |= FMODE_WRITE; 602 flags |= FMODE_WRITE;
605 if (test_bit(RCA4_TYPE_MASK_FILE_LAYOUT, (const unsigned long *)
606 &args->craa_type_mask))
607 pnfs_recall_all_layouts(cps->clp);
608 if (flags) 603 if (flags)
609 nfs_expire_unused_delegation_types(cps->clp, flags); 604 nfs_expire_unused_delegation_types(cps->clp, flags);
605
606 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_FILE_LAYOUT))
607 pnfs_recall_all_layouts(cps->clp);
610out: 608out:
611 dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); 609 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
612 return status; 610 return status;
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 49f848fd1f04..7327930ad970 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -873,7 +873,7 @@ static void nfs3_nlm_release_call(void *data)
873 } 873 }
874} 874}
875 875
876const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = { 876static const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = {
877 .nlmclnt_alloc_call = nfs3_nlm_alloc_call, 877 .nlmclnt_alloc_call = nfs3_nlm_alloc_call,
878 .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare, 878 .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare,
879 .nlmclnt_release_call = nfs3_nlm_release_call, 879 .nlmclnt_release_call = nfs3_nlm_release_call,
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 04612c24d394..979631411a0e 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -868,8 +868,10 @@ static int nfs4_set_client(struct nfs_server *server,
868 if (IS_ERR(clp)) 868 if (IS_ERR(clp))
869 return PTR_ERR(clp); 869 return PTR_ERR(clp);
870 870
871 if (server->nfs_client == clp) 871 if (server->nfs_client == clp) {
872 nfs_put_client(clp);
872 return -ELOOP; 873 return -ELOOP;
874 }
873 875
874 /* 876 /*
875 * Query for the lease time on clientid setup or renewal 877 * Query for the lease time on clientid setup or renewal
@@ -1244,11 +1246,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
1244 clp->cl_proto, clnt->cl_timeout, 1246 clp->cl_proto, clnt->cl_timeout,
1245 clp->cl_minorversion, net); 1247 clp->cl_minorversion, net);
1246 clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status); 1248 clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status);
1247 nfs_put_client(clp);
1248 if (error != 0) { 1249 if (error != 0) {
1249 nfs_server_insert_lists(server); 1250 nfs_server_insert_lists(server);
1250 return error; 1251 return error;
1251 } 1252 }
1253 nfs_put_client(clp);
1252 1254
1253 if (server->nfs_client->cl_hostname == NULL) 1255 if (server->nfs_client->cl_hostname == NULL)
1254 server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL); 1256 server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index e8a93bc8285d..d1e82761de81 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -510,6 +510,10 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
510 /* we have to zero-fill user buffer even if no read */ 510 /* we have to zero-fill user buffer even if no read */
511 if (copy_to_user(buffer, buf, tsz)) 511 if (copy_to_user(buffer, buf, tsz))
512 return -EFAULT; 512 return -EFAULT;
513 } else if (m->type == KCORE_USER) {
514 /* User page is handled prior to normal kernel page: */
515 if (copy_to_user(buffer, (char *)start, tsz))
516 return -EFAULT;
513 } else { 517 } else {
514 if (kern_addr_valid(start)) { 518 if (kern_addr_valid(start)) {
515 /* 519 /*
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 9990957264e3..76bf9cc62074 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -118,13 +118,22 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
118 err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno); 118 err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno);
119#endif 119#endif
120#ifdef BUS_MCEERR_AO 120#ifdef BUS_MCEERR_AO
121 /* 121 /*
122 * Other callers might not initialize the si_lsb field,
123 * so check explicitly for the right codes here.
124 */
125 if (kinfo->si_signo == SIGBUS &&
126 kinfo->si_code == BUS_MCEERR_AO)
127 err |= __put_user((short) kinfo->si_addr_lsb,
128 &uinfo->ssi_addr_lsb);
129#endif
130#ifdef BUS_MCEERR_AR
131 /*
122 * Other callers might not initialize the si_lsb field, 132 * Other callers might not initialize the si_lsb field,
123 * so check explicitly for the right codes here. 133 * so check explicitly for the right codes here.
124 */ 134 */
125 if (kinfo->si_signo == SIGBUS && 135 if (kinfo->si_signo == SIGBUS &&
126 (kinfo->si_code == BUS_MCEERR_AR || 136 kinfo->si_code == BUS_MCEERR_AR)
127 kinfo->si_code == BUS_MCEERR_AO))
128 err |= __put_user((short) kinfo->si_addr_lsb, 137 err |= __put_user((short) kinfo->si_addr_lsb,
129 &uinfo->ssi_addr_lsb); 138 &uinfo->ssi_addr_lsb);
130#endif 139#endif
diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index fd975524f460..05c66e05ae20 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -767,7 +767,7 @@ int
767xfs_scrub_agfl( 767xfs_scrub_agfl(
768 struct xfs_scrub_context *sc) 768 struct xfs_scrub_context *sc)
769{ 769{
770 struct xfs_scrub_agfl_info sai = { 0 }; 770 struct xfs_scrub_agfl_info sai;
771 struct xfs_agf *agf; 771 struct xfs_agf *agf;
772 xfs_agnumber_t agno; 772 xfs_agnumber_t agno;
773 unsigned int agflcount; 773 unsigned int agflcount;
@@ -795,6 +795,7 @@ xfs_scrub_agfl(
795 xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp); 795 xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
796 goto out; 796 goto out;
797 } 797 }
798 memset(&sai, 0, sizeof(sai));
798 sai.sz_entries = agflcount; 799 sai.sz_entries = agflcount;
799 sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS); 800 sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS);
800 if (!sai.entries) { 801 if (!sai.entries) {
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index 3a55d6fc271b..7a39f40645f7 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -23,6 +23,7 @@
23#include "xfs_log_format.h" 23#include "xfs_log_format.h"
24#include "xfs_trans_resv.h" 24#include "xfs_trans_resv.h"
25#include "xfs_bit.h" 25#include "xfs_bit.h"
26#include "xfs_shared.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_defer.h" 28#include "xfs_defer.h"
28#include "xfs_trans.h" 29#include "xfs_trans.h"
@@ -456,10 +457,12 @@ xfs_cui_recover(
456 * transaction. Normally, any work that needs to be deferred 457 * transaction. Normally, any work that needs to be deferred
457 * gets attached to the same defer_ops that scheduled the 458 * gets attached to the same defer_ops that scheduled the
458 * refcount update. However, we're in log recovery here, so we 459 * refcount update. However, we're in log recovery here, so we
459 * we create our own defer_ops and use that to finish up any 460 * we use the passed in defer_ops and to finish up any work that
460 * work that doesn't fit. 461 * doesn't fit. We need to reserve enough blocks to handle a
462 * full btree split on either end of the refcount range.
461 */ 463 */
462 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); 464 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
465 mp->m_refc_maxlevels * 2, 0, XFS_TRANS_RESERVE, &tp);
463 if (error) 466 if (error)
464 return error; 467 return error;
465 cudp = xfs_trans_get_cud(tp, cuip); 468 cudp = xfs_trans_get_cud(tp, cuip);
diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c
index f3b139c9aa16..49d3124863a8 100644
--- a/fs/xfs/xfs_rmap_item.c
+++ b/fs/xfs/xfs_rmap_item.c
@@ -23,6 +23,7 @@
23#include "xfs_log_format.h" 23#include "xfs_log_format.h"
24#include "xfs_trans_resv.h" 24#include "xfs_trans_resv.h"
25#include "xfs_bit.h" 25#include "xfs_bit.h"
26#include "xfs_shared.h"
26#include "xfs_mount.h" 27#include "xfs_mount.h"
27#include "xfs_defer.h" 28#include "xfs_defer.h"
28#include "xfs_trans.h" 29#include "xfs_trans.h"
@@ -470,7 +471,8 @@ xfs_rui_recover(
470 } 471 }
471 } 472 }
472 473
473 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); 474 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
475 mp->m_rmap_maxlevels, 0, XFS_TRANS_RESERVE, &tp);
474 if (error) 476 if (error)
475 return error; 477 return error;
476 rudp = xfs_trans_get_rud(tp, ruip); 478 rudp = xfs_trans_get_rud(tp, ruip);
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 7aba628dc527..93588ea3d3d2 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -250,6 +250,7 @@ xfs_parseargs(
250 return -EINVAL; 250 return -EINVAL;
251 break; 251 break;
252 case Opt_logdev: 252 case Opt_logdev:
253 kfree(mp->m_logname);
253 mp->m_logname = match_strdup(args); 254 mp->m_logname = match_strdup(args);
254 if (!mp->m_logname) 255 if (!mp->m_logname)
255 return -ENOMEM; 256 return -ENOMEM;
@@ -258,6 +259,7 @@ xfs_parseargs(
258 xfs_warn(mp, "%s option not allowed on this system", p); 259 xfs_warn(mp, "%s option not allowed on this system", p);
259 return -EINVAL; 260 return -EINVAL;
260 case Opt_rtdev: 261 case Opt_rtdev:
262 kfree(mp->m_rtname);
261 mp->m_rtname = match_strdup(args); 263 mp->m_rtname = match_strdup(args);
262 if (!mp->m_rtname) 264 if (!mp->m_rtname)
263 return -ENOMEM; 265 return -ENOMEM;
diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h
index bc397573c43a..67ab280ad134 100644
--- a/include/asm-generic/bitops/lock.h
+++ b/include/asm-generic/bitops/lock.h
@@ -7,7 +7,8 @@
7 * @nr: Bit to set 7 * @nr: Bit to set
8 * @addr: Address to count from 8 * @addr: Address to count from
9 * 9 *
10 * This operation is atomic and provides acquire barrier semantics. 10 * This operation is atomic and provides acquire barrier semantics if
11 * the returned value is 0.
11 * It can be used to implement bit locks. 12 * It can be used to implement bit locks.
12 */ 13 */
13#define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr) 14#define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 963b755d19b0..a7613e1b0c87 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -52,6 +52,7 @@ struct bug_entry {
52#ifndef HAVE_ARCH_BUG 52#ifndef HAVE_ARCH_BUG
53#define BUG() do { \ 53#define BUG() do { \
54 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ 54 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
55 barrier_before_unreachable(); \
55 panic("BUG!"); \ 56 panic("BUG!"); \
56} while (0) 57} while (0)
57#endif 58#endif
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 1c27526c499e..cf13842a6dbd 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -134,6 +134,15 @@ struct drm_crtc_commit {
134 * &drm_pending_vblank_event pointer to clean up private events. 134 * &drm_pending_vblank_event pointer to clean up private events.
135 */ 135 */
136 struct drm_pending_vblank_event *event; 136 struct drm_pending_vblank_event *event;
137
138 /**
139 * @abort_completion:
140 *
141 * A flag that's set after drm_atomic_helper_setup_commit takes a second
142 * reference for the completion of $drm_crtc_state.event. It's used by
143 * the free code to remove the second reference if commit fails.
144 */
145 bool abort_completion;
137}; 146};
138 147
139struct __drm_planes_state { 148struct __drm_planes_state {
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index 76e237bd989b..6914633037a5 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -77,5 +77,6 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev);
77 77
78void drm_kms_helper_poll_disable(struct drm_device *dev); 78void drm_kms_helper_poll_disable(struct drm_device *dev);
79void drm_kms_helper_poll_enable(struct drm_device *dev); 79void drm_kms_helper_poll_enable(struct drm_device *dev);
80bool drm_kms_helper_is_poll_worker(void);
80 81
81#endif 82#endif
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index d32b688eb346..d23dcdd1bd95 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -56,6 +56,7 @@ struct drm_printer;
56#define DRIVER_ATOMIC 0x10000 56#define DRIVER_ATOMIC 0x10000
57#define DRIVER_KMS_LEGACY_CONTEXT 0x20000 57#define DRIVER_KMS_LEGACY_CONTEXT 0x20000
58#define DRIVER_SYNCOBJ 0x40000 58#define DRIVER_SYNCOBJ 0x40000
59#define DRIVER_PREFER_XBGR_30BPP 0x80000
59 60
60/** 61/**
61 * struct drm_driver - DRM driver structure 62 * struct drm_driver - DRM driver structure
diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
index e2f99ae72d5c..b2325d3e236a 100644
--- a/include/dt-bindings/clock/imx7d-clock.h
+++ b/include/dt-bindings/clock/imx7d-clock.h
@@ -452,5 +452,8 @@
452#define IMX7D_OCOTP_CLK 439 452#define IMX7D_OCOTP_CLK 439
453#define IMX7D_NAND_RAWNAND_CLK 440 453#define IMX7D_NAND_RAWNAND_CLK 440
454#define IMX7D_NAND_USDHC_BUS_RAWNAND_CLK 441 454#define IMX7D_NAND_USDHC_BUS_RAWNAND_CLK 441
455#define IMX7D_CLK_END 442 455#define IMX7D_SNVS_CLK 442
456#define IMX7D_CAAM_CLK 443
457#define IMX7D_KPP_ROOT_CLK 444
458#define IMX7D_CLK_END 445
456#endif /* __DT_BINDINGS_CLOCK_IMX7D_H */ 459#endif /* __DT_BINDINGS_CLOCK_IMX7D_H */
diff --git a/include/dt-bindings/clock/tegra194-clock.h b/include/dt-bindings/clock/tegra194-clock.h
new file mode 100644
index 000000000000..a2ff66342d69
--- /dev/null
+++ b/include/dt-bindings/clock/tegra194-clock.h
@@ -0,0 +1,321 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. */
3
4#ifndef __ABI_MACH_T194_CLOCK_H
5#define __ABI_MACH_T194_CLOCK_H
6
7#define TEGRA194_CLK_ACTMON 1
8#define TEGRA194_CLK_ADSP 2
9#define TEGRA194_CLK_ADSPNEON 3
10#define TEGRA194_CLK_AHUB 4
11#define TEGRA194_CLK_APB2APE 5
12#define TEGRA194_CLK_APE 6
13#define TEGRA194_CLK_AUD_MCLK 7
14#define TEGRA194_CLK_AXI_CBB 8
15#define TEGRA194_CLK_CAN1 9
16#define TEGRA194_CLK_CAN1_HOST 10
17#define TEGRA194_CLK_CAN2 11
18#define TEGRA194_CLK_CAN2_HOST 12
19#define TEGRA194_CLK_CEC 13
20#define TEGRA194_CLK_CLK_M 14
21#define TEGRA194_CLK_DMIC1 15
22#define TEGRA194_CLK_DMIC2 16
23#define TEGRA194_CLK_DMIC3 17
24#define TEGRA194_CLK_DMIC4 18
25#define TEGRA194_CLK_DPAUX 19
26#define TEGRA194_CLK_DPAUX1 20
27#define TEGRA194_CLK_ACLK 21
28#define TEGRA194_CLK_MSS_ENCRYPT 22
29#define TEGRA194_CLK_EQOS_RX_INPUT 23
30#define TEGRA194_CLK_IQC2 24
31#define TEGRA194_CLK_AON_APB 25
32#define TEGRA194_CLK_AON_NIC 26
33#define TEGRA194_CLK_AON_CPU_NIC 27
34#define TEGRA194_CLK_PLLA1 28
35#define TEGRA194_CLK_DSPK1 29
36#define TEGRA194_CLK_DSPK2 30
37#define TEGRA194_CLK_EMC 31
38#define TEGRA194_CLK_EQOS_AXI 32
39#define TEGRA194_CLK_EQOS_PTP_REF 33
40#define TEGRA194_CLK_EQOS_RX 34
41#define TEGRA194_CLK_EQOS_TX 35
42#define TEGRA194_CLK_EXTPERIPH1 36
43#define TEGRA194_CLK_EXTPERIPH2 37
44#define TEGRA194_CLK_EXTPERIPH3 38
45#define TEGRA194_CLK_EXTPERIPH4 39
46#define TEGRA194_CLK_FUSE 40
47#define TEGRA194_CLK_GPCCLK 41
48#define TEGRA194_CLK_GPU_PWR 42
49#define TEGRA194_CLK_HDA 43
50#define TEGRA194_CLK_HDA2CODEC_2X 44
51#define TEGRA194_CLK_HDA2HDMICODEC 45
52#define TEGRA194_CLK_HOST1X 46
53#define TEGRA194_CLK_HSIC_TRK 47
54#define TEGRA194_CLK_I2C1 48
55#define TEGRA194_CLK_I2C2 49
56#define TEGRA194_CLK_I2C3 50
57#define TEGRA194_CLK_I2C4 51
58#define TEGRA194_CLK_I2C6 52
59#define TEGRA194_CLK_I2C7 53
60#define TEGRA194_CLK_I2C8 54
61#define TEGRA194_CLK_I2C9 55
62#define TEGRA194_CLK_I2S1 56
63#define TEGRA194_CLK_I2S1_SYNC_INPUT 57
64#define TEGRA194_CLK_I2S2 58
65#define TEGRA194_CLK_I2S2_SYNC_INPUT 59
66#define TEGRA194_CLK_I2S3 60
67#define TEGRA194_CLK_I2S3_SYNC_INPUT 61
68#define TEGRA194_CLK_I2S4 62
69#define TEGRA194_CLK_I2S4_SYNC_INPUT 63
70#define TEGRA194_CLK_I2S5 64
71#define TEGRA194_CLK_I2S5_SYNC_INPUT 65
72#define TEGRA194_CLK_I2S6 66
73#define TEGRA194_CLK_I2S6_SYNC_INPUT 67
74#define TEGRA194_CLK_IQC1 68
75#define TEGRA194_CLK_ISP 69
76#define TEGRA194_CLK_KFUSE 70
77#define TEGRA194_CLK_MAUD 71
78#define TEGRA194_CLK_MIPI_CAL 72
79#define TEGRA194_CLK_MPHY_CORE_PLL_FIXED 73
80#define TEGRA194_CLK_MPHY_L0_RX_ANA 74
81#define TEGRA194_CLK_MPHY_L0_RX_LS_BIT 75
82#define TEGRA194_CLK_MPHY_L0_RX_SYMB 76
83#define TEGRA194_CLK_MPHY_L0_TX_LS_3XBIT 77
84#define TEGRA194_CLK_MPHY_L0_TX_SYMB 78
85#define TEGRA194_CLK_MPHY_L1_RX_ANA 79
86#define TEGRA194_CLK_MPHY_TX_1MHZ_REF 80
87#define TEGRA194_CLK_NVCSI 81
88#define TEGRA194_CLK_NVCSILP 82
89#define TEGRA194_CLK_NVDEC 83
90#define TEGRA194_CLK_NVDISPLAYHUB 84
91#define TEGRA194_CLK_NVDISPLAY_DISP 85
92#define TEGRA194_CLK_NVDISPLAY_P0 86
93#define TEGRA194_CLK_NVDISPLAY_P1 87
94#define TEGRA194_CLK_NVDISPLAY_P2 88
95#define TEGRA194_CLK_NVENC 89
96#define TEGRA194_CLK_NVJPG 90
97#define TEGRA194_CLK_OSC 91
98#define TEGRA194_CLK_AON_TOUCH 92
99#define TEGRA194_CLK_PLLA 93
100#define TEGRA194_CLK_PLLAON 94
101#define TEGRA194_CLK_PLLD 95
102#define TEGRA194_CLK_PLLD2 96
103#define TEGRA194_CLK_PLLD3 97
104#define TEGRA194_CLK_PLLDP 98
105#define TEGRA194_CLK_PLLD4 99
106#define TEGRA194_CLK_PLLE 100
107#define TEGRA194_CLK_PLLP 101
108#define TEGRA194_CLK_PLLP_OUT0 102
109#define TEGRA194_CLK_UTMIPLL 103
110#define TEGRA194_CLK_PLLA_OUT0 104
111#define TEGRA194_CLK_PWM1 105
112#define TEGRA194_CLK_PWM2 106
113#define TEGRA194_CLK_PWM3 107
114#define TEGRA194_CLK_PWM4 108
115#define TEGRA194_CLK_PWM5 109
116#define TEGRA194_CLK_PWM6 110
117#define TEGRA194_CLK_PWM7 111
118#define TEGRA194_CLK_PWM8 112
119#define TEGRA194_CLK_RCE_CPU_NIC 113
120#define TEGRA194_CLK_RCE_NIC 114
121#define TEGRA194_CLK_SATA 115
122#define TEGRA194_CLK_SATA_OOB 116
123#define TEGRA194_CLK_AON_I2C_SLOW 117
124#define TEGRA194_CLK_SCE_CPU_NIC 118
125#define TEGRA194_CLK_SCE_NIC 119
126#define TEGRA194_CLK_SDMMC1 120
127#define TEGRA194_CLK_UPHY_PLL3 121
128#define TEGRA194_CLK_SDMMC3 122
129#define TEGRA194_CLK_SDMMC4 123
130#define TEGRA194_CLK_SE 124
131#define TEGRA194_CLK_SOR0_OUT 125
132#define TEGRA194_CLK_SOR0_REF 126
133#define TEGRA194_CLK_SOR0_PAD_CLKOUT 127
134#define TEGRA194_CLK_SOR1_OUT 128
135#define TEGRA194_CLK_SOR1_REF 129
136#define TEGRA194_CLK_SOR1_PAD_CLKOUT 130
137#define TEGRA194_CLK_SOR_SAFE 131
138#define TEGRA194_CLK_IQC1_IN 132
139#define TEGRA194_CLK_IQC2_IN 133
140#define TEGRA194_CLK_DMIC5 134
141#define TEGRA194_CLK_SPI1 135
142#define TEGRA194_CLK_SPI2 136
143#define TEGRA194_CLK_SPI3 137
144#define TEGRA194_CLK_I2C_SLOW 138
145#define TEGRA194_CLK_SYNC_DMIC1 139
146#define TEGRA194_CLK_SYNC_DMIC2 140
147#define TEGRA194_CLK_SYNC_DMIC3 141
148#define TEGRA194_CLK_SYNC_DMIC4 142
149#define TEGRA194_CLK_SYNC_DSPK1 143
150#define TEGRA194_CLK_SYNC_DSPK2 144
151#define TEGRA194_CLK_SYNC_I2S1 145
152#define TEGRA194_CLK_SYNC_I2S2 146
153#define TEGRA194_CLK_SYNC_I2S3 147
154#define TEGRA194_CLK_SYNC_I2S4 148
155#define TEGRA194_CLK_SYNC_I2S5 149
156#define TEGRA194_CLK_SYNC_I2S6 150
157#define TEGRA194_CLK_MPHY_FORCE_LS_MODE 151
158#define TEGRA194_CLK_TACH 152
159#define TEGRA194_CLK_TSEC 153
160#define TEGRA194_CLK_TSECB 154
161#define TEGRA194_CLK_UARTA 155
162#define TEGRA194_CLK_UARTB 156
163#define TEGRA194_CLK_UARTC 157
164#define TEGRA194_CLK_UARTD 158
165#define TEGRA194_CLK_UARTE 159
166#define TEGRA194_CLK_UARTF 160
167#define TEGRA194_CLK_UARTG 161
168#define TEGRA194_CLK_UART_FST_MIPI_CAL 162
169#define TEGRA194_CLK_UFSDEV_REF 163
170#define TEGRA194_CLK_UFSHC 164
171#define TEGRA194_CLK_USB2_TRK 165
172#define TEGRA194_CLK_VI 166
173#define TEGRA194_CLK_VIC 167
174#define TEGRA194_CLK_PVA0_AXI 168
175#define TEGRA194_CLK_PVA0_VPS0 169
176#define TEGRA194_CLK_PVA0_VPS1 170
177#define TEGRA194_CLK_PVA1_AXI 171
178#define TEGRA194_CLK_PVA1_VPS0 172
179#define TEGRA194_CLK_PVA1_VPS1 173
180#define TEGRA194_CLK_DLA0_FALCON 174
181#define TEGRA194_CLK_DLA0_CORE 175
182#define TEGRA194_CLK_DLA1_FALCON 176
183#define TEGRA194_CLK_DLA1_CORE 177
184#define TEGRA194_CLK_SOR2_OUT 178
185#define TEGRA194_CLK_SOR2_REF 179
186#define TEGRA194_CLK_SOR2_PAD_CLKOUT 180
187#define TEGRA194_CLK_SOR3_OUT 181
188#define TEGRA194_CLK_SOR3_REF 182
189#define TEGRA194_CLK_SOR3_PAD_CLKOUT 183
190#define TEGRA194_CLK_NVDISPLAY_P3 184
191#define TEGRA194_CLK_DPAUX2 185
192#define TEGRA194_CLK_DPAUX3 186
193#define TEGRA194_CLK_NVDEC1 187
194#define TEGRA194_CLK_NVENC1 188
195#define TEGRA194_CLK_SE_FREE 189
196#define TEGRA194_CLK_UARTH 190
197#define TEGRA194_CLK_FUSE_SERIAL 191
198#define TEGRA194_CLK_QSPI0 192
199#define TEGRA194_CLK_QSPI1 193
200#define TEGRA194_CLK_QSPI0_PM 194
201#define TEGRA194_CLK_QSPI1_PM 195
202#define TEGRA194_CLK_VI_CONST 196
203#define TEGRA194_CLK_NAFLL_BPMP 197
204#define TEGRA194_CLK_NAFLL_SCE 198
205#define TEGRA194_CLK_NAFLL_NVDEC 199
206#define TEGRA194_CLK_NAFLL_NVJPG 200
207#define TEGRA194_CLK_NAFLL_TSEC 201
208#define TEGRA194_CLK_NAFLL_TSECB 202
209#define TEGRA194_CLK_NAFLL_VI 203
210#define TEGRA194_CLK_NAFLL_SE 204
211#define TEGRA194_CLK_NAFLL_NVENC 205
212#define TEGRA194_CLK_NAFLL_ISP 206
213#define TEGRA194_CLK_NAFLL_VIC 207
214#define TEGRA194_CLK_NAFLL_NVDISPLAYHUB 208
215#define TEGRA194_CLK_NAFLL_AXICBB 209
216#define TEGRA194_CLK_NAFLL_DLA 210
217#define TEGRA194_CLK_NAFLL_PVA_CORE 211
218#define TEGRA194_CLK_NAFLL_PVA_VPS 212
219#define TEGRA194_CLK_NAFLL_CVNAS 213
220#define TEGRA194_CLK_NAFLL_RCE 214
221#define TEGRA194_CLK_NAFLL_NVENC1 215
222#define TEGRA194_CLK_NAFLL_DLA_FALCON 216
223#define TEGRA194_CLK_NAFLL_NVDEC1 217
224#define TEGRA194_CLK_NAFLL_GPU 218
225#define TEGRA194_CLK_SDMMC_LEGACY_TM 219
226#define TEGRA194_CLK_PEX0_CORE_0 220
227#define TEGRA194_CLK_PEX0_CORE_1 221
228#define TEGRA194_CLK_PEX0_CORE_2 222
229#define TEGRA194_CLK_PEX0_CORE_3 223
230#define TEGRA194_CLK_PEX0_CORE_4 224
231#define TEGRA194_CLK_PEX1_CORE_5 225
232#define TEGRA194_CLK_PEX_REF1 226
233#define TEGRA194_CLK_PEX_REF2 227
234#define TEGRA194_CLK_CSI_A 229
235#define TEGRA194_CLK_CSI_B 230
236#define TEGRA194_CLK_CSI_C 231
237#define TEGRA194_CLK_CSI_D 232
238#define TEGRA194_CLK_CSI_E 233
239#define TEGRA194_CLK_CSI_F 234
240#define TEGRA194_CLK_CSI_G 235
241#define TEGRA194_CLK_CSI_H 236
242#define TEGRA194_CLK_PLLC4 237
243#define TEGRA194_CLK_PLLC4_OUT 238
244#define TEGRA194_CLK_PLLC4_OUT1 239
245#define TEGRA194_CLK_PLLC4_OUT2 240
246#define TEGRA194_CLK_PLLC4_MUXED 241
247#define TEGRA194_CLK_PLLC4_VCO_DIV2 242
248#define TEGRA194_CLK_CSI_A_PAD 244
249#define TEGRA194_CLK_CSI_B_PAD 245
250#define TEGRA194_CLK_CSI_C_PAD 246
251#define TEGRA194_CLK_CSI_D_PAD 247
252#define TEGRA194_CLK_CSI_E_PAD 248
253#define TEGRA194_CLK_CSI_F_PAD 249
254#define TEGRA194_CLK_CSI_G_PAD 250
255#define TEGRA194_CLK_CSI_H_PAD 251
256#define TEGRA194_CLK_PEX_SATA_USB_RX_BYP 254
257#define TEGRA194_CLK_PEX_USB_PAD_PLL0_MGMT 255
258#define TEGRA194_CLK_PEX_USB_PAD_PLL1_MGMT 256
259#define TEGRA194_CLK_PEX_USB_PAD_PLL2_MGMT 257
260#define TEGRA194_CLK_PEX_USB_PAD_PLL3_MGMT 258
261#define TEGRA194_CLK_XUSB_CORE_DEV 265
262#define TEGRA194_CLK_XUSB_CORE_MUX 266
263#define TEGRA194_CLK_XUSB_CORE_HOST 267
264#define TEGRA194_CLK_XUSB_CORE_SS 268
265#define TEGRA194_CLK_XUSB_FALCON 269
266#define TEGRA194_CLK_XUSB_FALCON_HOST 270
267#define TEGRA194_CLK_XUSB_FALCON_SS 271
268#define TEGRA194_CLK_XUSB_FS 272
269#define TEGRA194_CLK_XUSB_FS_HOST 273
270#define TEGRA194_CLK_XUSB_FS_DEV 274
271#define TEGRA194_CLK_XUSB_SS 275
272#define TEGRA194_CLK_XUSB_SS_DEV 276
273#define TEGRA194_CLK_XUSB_SS_SUPERSPEED 277
274#define TEGRA194_CLK_PLLDISPHUB 278
275#define TEGRA194_CLK_PLLDISPHUB_DIV 279
276#define TEGRA194_CLK_NAFLL_CLUSTER0 280
277#define TEGRA194_CLK_NAFLL_CLUSTER1 281
278#define TEGRA194_CLK_NAFLL_CLUSTER2 282
279#define TEGRA194_CLK_NAFLL_CLUSTER3 283
280#define TEGRA194_CLK_CAN1_CORE 284
281#define TEGRA194_CLK_CAN2_CORE 285
282#define TEGRA194_CLK_PLLA1_OUT1 286
283#define TEGRA194_CLK_PLLREFE_VCOOUT 288
284#define TEGRA194_CLK_CLK_32K 289
285#define TEGRA194_CLK_SPDIFIN_SYNC_INPUT 290
286#define TEGRA194_CLK_UTMIPLL_CLKOUT48 291
287#define TEGRA194_CLK_UTMIPLL_CLKOUT480 292
288#define TEGRA194_CLK_CVNAS 293
289#define TEGRA194_CLK_PLLNVCSI 294
290#define TEGRA194_CLK_PVA0_CPU_AXI 295
291#define TEGRA194_CLK_PVA1_CPU_AXI 296
292#define TEGRA194_CLK_PVA0_VPS 297
293#define TEGRA194_CLK_PVA1_VPS 298
294#define TEGRA194_CLK_DLA0_FALCON_MUX 299
295#define TEGRA194_CLK_DLA1_FALCON_MUX 300
296#define TEGRA194_CLK_DLA0_CORE_MUX 301
297#define TEGRA194_CLK_DLA1_CORE_MUX 302
298#define TEGRA194_CLK_UTMIPLL_HPS 304
299#define TEGRA194_CLK_I2C5 305
300#define TEGRA194_CLK_I2C10 306
301#define TEGRA194_CLK_BPMP_CPU_NIC 307
302#define TEGRA194_CLK_BPMP_APB 308
303#define TEGRA194_CLK_TSC 309
304#define TEGRA194_CLK_EMCSA 310
305#define TEGRA194_CLK_EMCSB 311
306#define TEGRA194_CLK_EMCSC 312
307#define TEGRA194_CLK_EMCSD 313
308#define TEGRA194_CLK_PLLC 314
309#define TEGRA194_CLK_PLLC2 315
310#define TEGRA194_CLK_PLLC3 316
311#define TEGRA194_CLK_TSC_REF 317
312#define TEGRA194_CLK_FUSE_BURN 318
313#define TEGRA194_CLK_PEX0_CORE_0M 319
314#define TEGRA194_CLK_PEX0_CORE_1M 320
315#define TEGRA194_CLK_PEX0_CORE_2M 321
316#define TEGRA194_CLK_PEX0_CORE_3M 322
317#define TEGRA194_CLK_PEX0_CORE_4M 323
318#define TEGRA194_CLK_PEX1_CORE_5M 324
319#define TEGRA194_CLK_PLLE_HPS 326
320
321#endif
diff --git a/include/dt-bindings/gpio/tegra194-gpio.h b/include/dt-bindings/gpio/tegra194-gpio.h
new file mode 100644
index 000000000000..ede860225f6b
--- /dev/null
+++ b/include/dt-bindings/gpio/tegra194-gpio.h
@@ -0,0 +1,61 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. */
3
4/*
5 * This header provides constants for binding nvidia,tegra194-gpio*.
6 *
7 * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below
8 * provide names for this.
9 *
10 * The second cell contains standard flag values specified in gpio.h.
11 */
12
13#ifndef _DT_BINDINGS_GPIO_TEGRA194_GPIO_H
14#define _DT_BINDINGS_GPIO_TEGRA194_GPIO_H
15
16#include <dt-bindings/gpio/gpio.h>
17
18/* GPIOs implemented by main GPIO controller */
19#define TEGRA194_MAIN_GPIO_PORT_A 0
20#define TEGRA194_MAIN_GPIO_PORT_B 1
21#define TEGRA194_MAIN_GPIO_PORT_C 2
22#define TEGRA194_MAIN_GPIO_PORT_D 3
23#define TEGRA194_MAIN_GPIO_PORT_E 4
24#define TEGRA194_MAIN_GPIO_PORT_F 5
25#define TEGRA194_MAIN_GPIO_PORT_G 6
26#define TEGRA194_MAIN_GPIO_PORT_H 7
27#define TEGRA194_MAIN_GPIO_PORT_I 8
28#define TEGRA194_MAIN_GPIO_PORT_J 9
29#define TEGRA194_MAIN_GPIO_PORT_K 10
30#define TEGRA194_MAIN_GPIO_PORT_L 11
31#define TEGRA194_MAIN_GPIO_PORT_M 12
32#define TEGRA194_MAIN_GPIO_PORT_N 13
33#define TEGRA194_MAIN_GPIO_PORT_O 14
34#define TEGRA194_MAIN_GPIO_PORT_P 15
35#define TEGRA194_MAIN_GPIO_PORT_Q 16
36#define TEGRA194_MAIN_GPIO_PORT_R 17
37#define TEGRA194_MAIN_GPIO_PORT_S 18
38#define TEGRA194_MAIN_GPIO_PORT_T 19
39#define TEGRA194_MAIN_GPIO_PORT_U 20
40#define TEGRA194_MAIN_GPIO_PORT_V 21
41#define TEGRA194_MAIN_GPIO_PORT_W 22
42#define TEGRA194_MAIN_GPIO_PORT_X 23
43#define TEGRA194_MAIN_GPIO_PORT_Y 24
44#define TEGRA194_MAIN_GPIO_PORT_Z 25
45#define TEGRA194_MAIN_GPIO_PORT_FF 26
46#define TEGRA194_MAIN_GPIO_PORT_GG 27
47
48#define TEGRA194_MAIN_GPIO(port, offset) \
49 ((TEGRA194_MAIN_GPIO_PORT_##port * 8) + offset)
50
51/* GPIOs implemented by AON GPIO controller */
52#define TEGRA194_AON_GPIO_PORT_AA 0
53#define TEGRA194_AON_GPIO_PORT_BB 1
54#define TEGRA194_AON_GPIO_PORT_CC 2
55#define TEGRA194_AON_GPIO_PORT_DD 3
56#define TEGRA194_AON_GPIO_PORT_EE 4
57
58#define TEGRA194_AON_GPIO(port, offset) \
59 ((TEGRA194_AON_GPIO_PORT_##port * 8) + offset)
60
61#endif
diff --git a/include/dt-bindings/mfd/stm32f7-rcc.h b/include/dt-bindings/mfd/stm32f7-rcc.h
index 8b7b7197ffd7..a90f3613c584 100644
--- a/include/dt-bindings/mfd/stm32f7-rcc.h
+++ b/include/dt-bindings/mfd/stm32f7-rcc.h
@@ -91,6 +91,7 @@
91#define STM32F7_RCC_APB2_TIM8 1 91#define STM32F7_RCC_APB2_TIM8 1
92#define STM32F7_RCC_APB2_USART1 4 92#define STM32F7_RCC_APB2_USART1 4
93#define STM32F7_RCC_APB2_USART6 5 93#define STM32F7_RCC_APB2_USART6 5
94#define STM32F7_RCC_APB2_SDMMC2 7
94#define STM32F7_RCC_APB2_ADC1 8 95#define STM32F7_RCC_APB2_ADC1 8
95#define STM32F7_RCC_APB2_ADC2 9 96#define STM32F7_RCC_APB2_ADC2 9
96#define STM32F7_RCC_APB2_ADC3 10 97#define STM32F7_RCC_APB2_ADC3 10
diff --git a/include/dt-bindings/power/tegra194-powergate.h b/include/dt-bindings/power/tegra194-powergate.h
new file mode 100644
index 000000000000..82253742a493
--- /dev/null
+++ b/include/dt-bindings/power/tegra194-powergate.h
@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. */
3
4#ifndef __ABI_MACH_T194_POWERGATE_T194_H_
5#define __ABI_MACH_T194_POWERGATE_T194_H_
6
7#define TEGRA194_POWER_DOMAIN_AUD 1
8#define TEGRA194_POWER_DOMAIN_DISP 2
9#define TEGRA194_POWER_DOMAIN_DISPB 3
10#define TEGRA194_POWER_DOMAIN_DISPC 4
11#define TEGRA194_POWER_DOMAIN_ISPA 5
12#define TEGRA194_POWER_DOMAIN_NVDECA 6
13#define TEGRA194_POWER_DOMAIN_NVJPG 7
14#define TEGRA194_POWER_DOMAIN_NVENCA 8
15#define TEGRA194_POWER_DOMAIN_NVENCB 9
16#define TEGRA194_POWER_DOMAIN_NVDECB 10
17#define TEGRA194_POWER_DOMAIN_SAX 11
18#define TEGRA194_POWER_DOMAIN_VE 12
19#define TEGRA194_POWER_DOMAIN_VIC 13
20#define TEGRA194_POWER_DOMAIN_XUSBA 14
21#define TEGRA194_POWER_DOMAIN_XUSBB 15
22#define TEGRA194_POWER_DOMAIN_XUSBC 16
23#define TEGRA194_POWER_DOMAIN_PCIEX8A 17
24#define TEGRA194_POWER_DOMAIN_PCIEX4A 18
25#define TEGRA194_POWER_DOMAIN_PCIEX1A 19
26#define TEGRA194_POWER_DOMAIN_PCIEX8B 21
27#define TEGRA194_POWER_DOMAIN_PVAA 22
28#define TEGRA194_POWER_DOMAIN_PVAB 23
29#define TEGRA194_POWER_DOMAIN_DLAA 24
30#define TEGRA194_POWER_DOMAIN_DLAB 25
31#define TEGRA194_POWER_DOMAIN_CV 26
32#define TEGRA194_POWER_DOMAIN_GPU 27
33#define TEGRA194_POWER_DOMAIN_MAX 27
34
35#endif
diff --git a/include/dt-bindings/reset/tegra194-reset.h b/include/dt-bindings/reset/tegra194-reset.h
new file mode 100644
index 000000000000..473afaa25bfb
--- /dev/null
+++ b/include/dt-bindings/reset/tegra194-reset.h
@@ -0,0 +1,152 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. */
3
4#ifndef __ABI_MACH_T194_RESET_H
5#define __ABI_MACH_T194_RESET_H
6
7#define TEGRA194_RESET_ACTMON 1
8#define TEGRA194_RESET_ADSP_ALL 2
9#define TEGRA194_RESET_AFI 3
10#define TEGRA194_RESET_CAN1 4
11#define TEGRA194_RESET_CAN2 5
12#define TEGRA194_RESET_DLA0 6
13#define TEGRA194_RESET_DLA1 7
14#define TEGRA194_RESET_DPAUX 8
15#define TEGRA194_RESET_DPAUX1 9
16#define TEGRA194_RESET_DPAUX2 10
17#define TEGRA194_RESET_DPAUX3 11
18#define TEGRA194_RESET_EQOS 17
19#define TEGRA194_RESET_GPCDMA 18
20#define TEGRA194_RESET_GPU 19
21#define TEGRA194_RESET_HDA 20
22#define TEGRA194_RESET_HDA2CODEC_2X 21
23#define TEGRA194_RESET_HDA2HDMICODEC 22
24#define TEGRA194_RESET_HOST1X 23
25#define TEGRA194_RESET_I2C1 24
26#define TEGRA194_RESET_I2C10 25
27#define TEGRA194_RESET_RSVD_26 26
28#define TEGRA194_RESET_RSVD_27 27
29#define TEGRA194_RESET_RSVD_28 28
30#define TEGRA194_RESET_I2C2 29
31#define TEGRA194_RESET_I2C3 30
32#define TEGRA194_RESET_I2C4 31
33#define TEGRA194_RESET_I2C6 32
34#define TEGRA194_RESET_I2C7 33
35#define TEGRA194_RESET_I2C8 34
36#define TEGRA194_RESET_I2C9 35
37#define TEGRA194_RESET_ISP 36
38#define TEGRA194_RESET_MIPI_CAL 37
39#define TEGRA194_RESET_MPHY_CLK_CTL 38
40#define TEGRA194_RESET_MPHY_L0_RX 39
41#define TEGRA194_RESET_MPHY_L0_TX 40
42#define TEGRA194_RESET_MPHY_L1_RX 41
43#define TEGRA194_RESET_MPHY_L1_TX 42
44#define TEGRA194_RESET_NVCSI 43
45#define TEGRA194_RESET_NVDEC 44
46#define TEGRA194_RESET_NVDISPLAY0_HEAD0 45
47#define TEGRA194_RESET_NVDISPLAY0_HEAD1 46
48#define TEGRA194_RESET_NVDISPLAY0_HEAD2 47
49#define TEGRA194_RESET_NVDISPLAY0_HEAD3 48
50#define TEGRA194_RESET_NVDISPLAY0_MISC 49
51#define TEGRA194_RESET_NVDISPLAY0_WGRP0 50
52#define TEGRA194_RESET_NVDISPLAY0_WGRP1 51
53#define TEGRA194_RESET_NVDISPLAY0_WGRP2 52
54#define TEGRA194_RESET_NVDISPLAY0_WGRP3 53
55#define TEGRA194_RESET_NVDISPLAY0_WGRP4 54
56#define TEGRA194_RESET_NVDISPLAY0_WGRP5 55
57#define TEGRA194_RESET_RSVD_56 56
58#define TEGRA194_RESET_RSVD_57 57
59#define TEGRA194_RESET_RSVD_58 58
60#define TEGRA194_RESET_NVENC 59
61#define TEGRA194_RESET_NVENC1 60
62#define TEGRA194_RESET_NVJPG 61
63#define TEGRA194_RESET_PCIE 62
64#define TEGRA194_RESET_PCIEXCLK 63
65#define TEGRA194_RESET_RSVD_64 64
66#define TEGRA194_RESET_RSVD_65 65
67#define TEGRA194_RESET_PVA0_ALL 66
68#define TEGRA194_RESET_PVA1_ALL 67
69#define TEGRA194_RESET_PWM1 68
70#define TEGRA194_RESET_PWM2 69
71#define TEGRA194_RESET_PWM3 70
72#define TEGRA194_RESET_PWM4 71
73#define TEGRA194_RESET_PWM5 72
74#define TEGRA194_RESET_PWM6 73
75#define TEGRA194_RESET_PWM7 74
76#define TEGRA194_RESET_PWM8 75
77#define TEGRA194_RESET_QSPI0 76
78#define TEGRA194_RESET_QSPI1 77
79#define TEGRA194_RESET_SATA 78
80#define TEGRA194_RESET_SATACOLD 79
81#define TEGRA194_RESET_SCE_ALL 80
82#define TEGRA194_RESET_RCE_ALL 81
83#define TEGRA194_RESET_SDMMC1 82
84#define TEGRA194_RESET_RSVD_83 83
85#define TEGRA194_RESET_SDMMC3 84
86#define TEGRA194_RESET_SDMMC4 85
87#define TEGRA194_RESET_SE 86
88#define TEGRA194_RESET_SOR0 87
89#define TEGRA194_RESET_SOR1 88
90#define TEGRA194_RESET_SOR2 89
91#define TEGRA194_RESET_SOR3 90
92#define TEGRA194_RESET_SPI1 91
93#define TEGRA194_RESET_SPI2 92
94#define TEGRA194_RESET_SPI3 93
95#define TEGRA194_RESET_SPI4 94
96#define TEGRA194_RESET_TACH 95
97#define TEGRA194_RESET_RSVD_96 96
98#define TEGRA194_RESET_TSCTNVI 97
99#define TEGRA194_RESET_TSEC 98
100#define TEGRA194_RESET_TSECB 99
101#define TEGRA194_RESET_UARTA 100
102#define TEGRA194_RESET_UARTB 101
103#define TEGRA194_RESET_UARTC 102
104#define TEGRA194_RESET_UARTD 103
105#define TEGRA194_RESET_UARTE 104
106#define TEGRA194_RESET_UARTF 105
107#define TEGRA194_RESET_UARTG 106
108#define TEGRA194_RESET_UARTH 107
109#define TEGRA194_RESET_UFSHC 108
110#define TEGRA194_RESET_UFSHC_AXI_M 109
111#define TEGRA194_RESET_UFSHC_LP_SEQ 110
112#define TEGRA194_RESET_RSVD_111 111
113#define TEGRA194_RESET_VI 112
114#define TEGRA194_RESET_VIC 113
115#define TEGRA194_RESET_XUSB_PADCTL 114
116#define TEGRA194_RESET_NVDEC1 115
117#define TEGRA194_RESET_PEX0_CORE_0 116
118#define TEGRA194_RESET_PEX0_CORE_1 117
119#define TEGRA194_RESET_PEX0_CORE_2 118
120#define TEGRA194_RESET_PEX0_CORE_3 119
121#define TEGRA194_RESET_PEX0_CORE_4 120
122#define TEGRA194_RESET_PEX0_CORE_0_APB 121
123#define TEGRA194_RESET_PEX0_CORE_1_APB 122
124#define TEGRA194_RESET_PEX0_CORE_2_APB 123
125#define TEGRA194_RESET_PEX0_CORE_3_APB 124
126#define TEGRA194_RESET_PEX0_CORE_4_APB 125
127#define TEGRA194_RESET_PEX0_COMMON_APB 126
128#define TEGRA194_RESET_PEX1_CORE_5 129
129#define TEGRA194_RESET_PEX1_CORE_5_APB 130
130#define TEGRA194_RESET_CVNAS 131
131#define TEGRA194_RESET_CVNAS_FCM 132
132#define TEGRA194_RESET_DMIC5 144
133#define TEGRA194_RESET_APE 145
134#define TEGRA194_RESET_PEX_USB_UPHY 146
135#define TEGRA194_RESET_PEX_USB_UPHY_L0 147
136#define TEGRA194_RESET_PEX_USB_UPHY_L1 148
137#define TEGRA194_RESET_PEX_USB_UPHY_L2 149
138#define TEGRA194_RESET_PEX_USB_UPHY_L3 150
139#define TEGRA194_RESET_PEX_USB_UPHY_L4 151
140#define TEGRA194_RESET_PEX_USB_UPHY_L5 152
141#define TEGRA194_RESET_PEX_USB_UPHY_L6 153
142#define TEGRA194_RESET_PEX_USB_UPHY_L7 154
143#define TEGRA194_RESET_PEX_USB_UPHY_L8 155
144#define TEGRA194_RESET_PEX_USB_UPHY_L9 156
145#define TEGRA194_RESET_PEX_USB_UPHY_L10 157
146#define TEGRA194_RESET_PEX_USB_UPHY_L11 158
147#define TEGRA194_RESET_PEX_USB_UPHY_PLL0 159
148#define TEGRA194_RESET_PEX_USB_UPHY_PLL1 160
149#define TEGRA194_RESET_PEX_USB_UPHY_PLL2 161
150#define TEGRA194_RESET_PEX_USB_UPHY_PLL3 162
151
152#endif
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 64e10746f282..968173ec2726 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -587,7 +587,7 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
587const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, 587const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
588 const struct device *dev); 588 const struct device *dev);
589 589
590void *acpi_get_match_data(const struct device *dev); 590const void *acpi_device_get_match_data(const struct device *dev);
591extern bool acpi_driver_match_device(struct device *dev, 591extern bool acpi_driver_match_device(struct device *dev,
592 const struct device_driver *drv); 592 const struct device_driver *drv);
593int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); 593int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
@@ -766,7 +766,7 @@ static inline const struct acpi_device_id *acpi_match_device(
766 return NULL; 766 return NULL;
767} 767}
768 768
769static inline void *acpi_get_match_data(const struct device *dev) 769static inline const void *acpi_device_get_match_data(const struct device *dev)
770{ 770{
771 return NULL; 771 return NULL;
772} 772}
diff --git a/include/linux/bio.h b/include/linux/bio.h
index d0eb659fa733..ce547a25e8ae 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -511,6 +511,7 @@ void zero_fill_bio(struct bio *bio);
511extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *); 511extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *);
512extern void bvec_free(mempool_t *, struct bio_vec *, unsigned int); 512extern void bvec_free(mempool_t *, struct bio_vec *, unsigned int);
513extern unsigned int bvec_nr_vecs(unsigned short idx); 513extern unsigned int bvec_nr_vecs(unsigned short idx);
514extern const char *bio_devname(struct bio *bio, char *buffer);
514 515
515#define bio_set_dev(bio, bdev) \ 516#define bio_set_dev(bio, bdev) \
516do { \ 517do { \
@@ -529,9 +530,6 @@ do { \
529#define bio_dev(bio) \ 530#define bio_dev(bio) \
530 disk_devt((bio)->bi_disk) 531 disk_devt((bio)->bi_disk)
531 532
532#define bio_devname(bio, buf) \
533 __bdevname(bio_dev(bio), (buf))
534
535#ifdef CONFIG_BLK_CGROUP 533#ifdef CONFIG_BLK_CGROUP
536int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css); 534int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css);
537void bio_disassociate_task(struct bio *bio); 535void bio_disassociate_task(struct bio *bio);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4f3df807cf8f..ed63f3b69c12 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -49,7 +49,7 @@ struct blk_stat_callback;
49#define BLKDEV_MIN_RQ 4 49#define BLKDEV_MIN_RQ 4
50#define BLKDEV_MAX_RQ 128 /* Default maximum */ 50#define BLKDEV_MAX_RQ 128 /* Default maximum */
51 51
52/* Must be consisitent with blk_mq_poll_stats_bkt() */ 52/* Must be consistent with blk_mq_poll_stats_bkt() */
53#define BLK_MQ_POLL_STATS_BKTS 16 53#define BLK_MQ_POLL_STATS_BKTS 16
54 54
55/* 55/*
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d02a4df3f473..d3f264a5b04d 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -27,3 +27,8 @@
27#if __has_feature(address_sanitizer) 27#if __has_feature(address_sanitizer)
28#define __SANITIZE_ADDRESS__ 28#define __SANITIZE_ADDRESS__
29#endif 29#endif
30
31/* Clang doesn't have a way to turn it off per-function, yet. */
32#ifdef __noretpoline
33#undef __noretpoline
34#endif
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 631354acfa72..e2c7f4369eff 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -93,6 +93,10 @@
93#define __weak __attribute__((weak)) 93#define __weak __attribute__((weak))
94#define __alias(symbol) __attribute__((alias(#symbol))) 94#define __alias(symbol) __attribute__((alias(#symbol)))
95 95
96#ifdef RETPOLINE
97#define __noretpoline __attribute__((indirect_branch("keep")))
98#endif
99
96/* 100/*
97 * it doesn't make sense on ARM (currently the only user of __naked) 101 * it doesn't make sense on ARM (currently the only user of __naked)
98 * to trace naked functions because then mcount is called without 102 * to trace naked functions because then mcount is called without
@@ -167,8 +171,6 @@
167 171
168#if GCC_VERSION >= 40100 172#if GCC_VERSION >= 40100
169# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 173# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
170
171#define __nostackprotector __attribute__((__optimize__("no-stack-protector")))
172#endif 174#endif
173 175
174#if GCC_VERSION >= 40300 176#if GCC_VERSION >= 40300
@@ -196,6 +198,11 @@
196#endif /* __CHECKER__ */ 198#endif /* __CHECKER__ */
197#endif /* GCC_VERSION >= 40300 */ 199#endif /* GCC_VERSION >= 40300 */
198 200
201#if GCC_VERSION >= 40400
202#define __optimize(level) __attribute__((__optimize__(level)))
203#define __nostackprotector __optimize("no-stack-protector")
204#endif /* GCC_VERSION >= 40400 */
205
199#if GCC_VERSION >= 40500 206#if GCC_VERSION >= 40500
200 207
201#ifndef __CHECKER__ 208#ifndef __CHECKER__
@@ -205,6 +212,15 @@
205#endif 212#endif
206 213
207/* 214/*
215 * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
216 * confuse the stack allocation in gcc, leading to overly large stack
217 * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
218 *
219 * Adding an empty inline assembly before it works around the problem
220 */
221#define barrier_before_unreachable() asm volatile("")
222
223/*
208 * Mark a position in code as unreachable. This can be used to 224 * Mark a position in code as unreachable. This can be used to
209 * suppress control flow warnings after asm blocks that transfer 225 * suppress control flow warnings after asm blocks that transfer
210 * control elsewhere. 226 * control elsewhere.
@@ -214,7 +230,11 @@
214 * unreleased. Really, we need to have autoconf for the kernel. 230 * unreleased. Really, we need to have autoconf for the kernel.
215 */ 231 */
216#define unreachable() \ 232#define unreachable() \
217 do { annotate_unreachable(); __builtin_unreachable(); } while (0) 233 do { \
234 annotate_unreachable(); \
235 barrier_before_unreachable(); \
236 __builtin_unreachable(); \
237 } while (0)
218 238
219/* Mark a function definition as prohibited from being cloned. */ 239/* Mark a function definition as prohibited from being cloned. */
220#define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) 240#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index c2cc57a2f508..ab4711c63601 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -86,6 +86,11 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
86# define barrier_data(ptr) barrier() 86# define barrier_data(ptr) barrier()
87#endif 87#endif
88 88
89/* workaround for GCC PR82365 if needed */
90#ifndef barrier_before_unreachable
91# define barrier_before_unreachable() do { } while (0)
92#endif
93
89/* Unreachable code */ 94/* Unreachable code */
90#ifdef CONFIG_STACK_VALIDATION 95#ifdef CONFIG_STACK_VALIDATION
91/* 96/*
@@ -277,6 +282,10 @@ unsigned long read_word_at_a_time(const void *addr)
277 282
278#endif /* __ASSEMBLY__ */ 283#endif /* __ASSEMBLY__ */
279 284
285#ifndef __optimize
286# define __optimize(level)
287#endif
288
280/* Compile time object size, -1 for unknown */ 289/* Compile time object size, -1 for unknown */
281#ifndef __compiletime_object_size 290#ifndef __compiletime_object_size
282# define __compiletime_object_size(obj) -1 291# define __compiletime_object_size(obj) -1
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 871f9e21810c..0b3fc229086c 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -225,7 +225,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev,
225} 225}
226#endif 226#endif
227 227
228#ifdef CONFIG_ARCH_HAS_CPU_RELAX 228#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX)
229void cpuidle_poll_state_init(struct cpuidle_driver *drv); 229void cpuidle_poll_state_init(struct cpuidle_driver *drv);
230#else 230#else
231static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} 231static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index d4a2a7dcd72d..bf53d893ad02 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -170,6 +170,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node)
170 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) 170 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
171#define for_each_cpu_not(cpu, mask) \ 171#define for_each_cpu_not(cpu, mask) \
172 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) 172 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
173#define for_each_cpu_wrap(cpu, mask, start) \
174 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
173#define for_each_cpu_and(cpu, mask, and) \ 175#define for_each_cpu_and(cpu, mask, and) \
174 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) 176 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and)
175#else 177#else
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 34fe8463d10e..eb9eab4ecd6d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -578,7 +578,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
578 578
579/* 579/*
580 * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please 580 * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please
581 * don't use this is new code. 581 * don't use this in new code.
582 */ 582 */
583#ifndef arch_dma_supported 583#ifndef arch_dma_supported
584#define arch_dma_supported(dev, mask) (1) 584#define arch_dma_supported(dev, mask) (1)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2a815560fda0..79c413985305 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3198,7 +3198,7 @@ static inline bool vma_is_fsdax(struct vm_area_struct *vma)
3198 if (!vma_is_dax(vma)) 3198 if (!vma_is_dax(vma))
3199 return false; 3199 return false;
3200 inode = file_inode(vma->vm_file); 3200 inode = file_inode(vma->vm_file);
3201 if (inode->i_mode == S_IFCHR) 3201 if (S_ISCHR(inode->i_mode))
3202 return false; /* device-dax */ 3202 return false; /* device-dax */
3203 return true; 3203 return true;
3204} 3204}
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 4fa1a489efe4..4fe8f289b3f6 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -73,8 +73,8 @@ struct fwnode_operations {
73 struct fwnode_handle *(*get)(struct fwnode_handle *fwnode); 73 struct fwnode_handle *(*get)(struct fwnode_handle *fwnode);
74 void (*put)(struct fwnode_handle *fwnode); 74 void (*put)(struct fwnode_handle *fwnode);
75 bool (*device_is_available)(const struct fwnode_handle *fwnode); 75 bool (*device_is_available)(const struct fwnode_handle *fwnode);
76 void *(*device_get_match_data)(const struct fwnode_handle *fwnode, 76 const void *(*device_get_match_data)(const struct fwnode_handle *fwnode,
77 const struct device *dev); 77 const struct device *dev);
78 bool (*property_present)(const struct fwnode_handle *fwnode, 78 bool (*property_present)(const struct fwnode_handle *fwnode,
79 const char *propname); 79 const char *propname);
80 int (*property_read_int_array)(const struct fwnode_handle *fwnode, 80 int (*property_read_int_array)(const struct fwnode_handle *fwnode,
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 5e3531027b51..c826b0b5232a 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -198,6 +198,7 @@ struct gendisk {
198 void *private_data; 198 void *private_data;
199 199
200 int flags; 200 int flags;
201 struct rw_semaphore lookup_sem;
201 struct kobject *slave_dir; 202 struct kobject *slave_dir;
202 203
203 struct timer_rand_state *random; 204 struct timer_rand_state *random;
@@ -600,8 +601,9 @@ extern void delete_partition(struct gendisk *, int);
600extern void printk_all_partitions(void); 601extern void printk_all_partitions(void);
601 602
602extern struct gendisk *__alloc_disk_node(int minors, int node_id); 603extern struct gendisk *__alloc_disk_node(int minors, int node_id);
603extern struct kobject *get_disk(struct gendisk *disk); 604extern struct kobject *get_disk_and_module(struct gendisk *disk);
604extern void put_disk(struct gendisk *disk); 605extern void put_disk(struct gendisk *disk);
606extern void put_disk_and_module(struct gendisk *disk);
605extern void blk_register_region(dev_t devt, unsigned long range, 607extern void blk_register_region(dev_t devt, unsigned long range,
606 struct module *module, 608 struct module *module,
607 struct kobject *(*probe)(dev_t, int *, void *), 609 struct kobject *(*probe)(dev_t, int *, void *),
diff --git a/include/linux/init.h b/include/linux/init.h
index 506a98151131..bc27cf03c41e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -6,10 +6,10 @@
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8/* Built-in __init functions needn't be compiled with retpoline */ 8/* Built-in __init functions needn't be compiled with retpoline */
9#if defined(RETPOLINE) && !defined(MODULE) 9#if defined(__noretpoline) && !defined(MODULE)
10#define __noretpoline __attribute__((indirect_branch("keep"))) 10#define __noinitretpoline __noretpoline
11#else 11#else
12#define __noretpoline 12#define __noinitretpoline
13#endif 13#endif
14 14
15/* These macros are used to mark some functions or 15/* These macros are used to mark some functions or
@@ -47,7 +47,7 @@
47 47
48/* These are for everybody (although not all archs will actually 48/* These are for everybody (although not all archs will actually
49 discard it in modules) */ 49 discard it in modules) */
50#define __init __section(.init.text) __cold __latent_entropy __noretpoline 50#define __init __section(.init.text) __cold __latent_entropy __noinitretpoline
51#define __initdata __section(.init.data) 51#define __initdata __section(.init.data)
52#define __initconst __section(.init.rodata) 52#define __initconst __section(.init.rodata)
53#define __exitdata __section(.exit.data) 53#define __exitdata __section(.exit.data)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index b6a29c126cc4..2168cc6b8b30 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -151,6 +151,7 @@ extern struct jump_entry __start___jump_table[];
151extern struct jump_entry __stop___jump_table[]; 151extern struct jump_entry __stop___jump_table[];
152 152
153extern void jump_label_init(void); 153extern void jump_label_init(void);
154extern void jump_label_invalidate_init(void);
154extern void jump_label_lock(void); 155extern void jump_label_lock(void);
155extern void jump_label_unlock(void); 156extern void jump_label_unlock(void);
156extern void arch_jump_label_transform(struct jump_entry *entry, 157extern void arch_jump_label_transform(struct jump_entry *entry,
@@ -198,6 +199,8 @@ static __always_inline void jump_label_init(void)
198 static_key_initialized = true; 199 static_key_initialized = true;
199} 200}
200 201
202static inline void jump_label_invalidate_init(void) {}
203
201static __always_inline bool static_key_false(struct static_key *key) 204static __always_inline bool static_key_false(struct static_key *key)
202{ 205{
203 if (unlikely(static_key_count(key) > 0)) 206 if (unlikely(static_key_count(key) > 0))
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index fec5076eda91..dcde9471897d 100644
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -4,6 +4,12 @@
4 4
5#include <generated/autoconf.h> 5#include <generated/autoconf.h>
6 6
7#ifdef CONFIG_CPU_BIG_ENDIAN
8#define __BIG_ENDIAN 4321
9#else
10#define __LITTLE_ENDIAN 1234
11#endif
12
7#define __ARG_PLACEHOLDER_1 0, 13#define __ARG_PLACEHOLDER_1 0,
8#define __take_second_arg(__ignored, val, ...) val 14#define __take_second_arg(__ignored, val, ...) val
9 15
@@ -64,4 +70,7 @@
64 */ 70 */
65#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) 71#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
66 72
73/* Make sure we always have all types and struct attributes defined. */
74#include <linux/compiler_types.h>
75
67#endif /* __LINUX_KCONFIG_H */ 76#endif /* __LINUX_KCONFIG_H */
diff --git a/include/linux/kcore.h b/include/linux/kcore.h
index 7ff25a808fef..80db19d3a505 100644
--- a/include/linux/kcore.h
+++ b/include/linux/kcore.h
@@ -10,6 +10,7 @@ enum kcore_type {
10 KCORE_VMALLOC, 10 KCORE_VMALLOC,
11 KCORE_RAM, 11 KCORE_RAM,
12 KCORE_VMEMMAP, 12 KCORE_VMEMMAP,
13 KCORE_USER,
13 KCORE_OTHER, 14 KCORE_OTHER,
14}; 15};
15 16
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ce51455e2adf..3fd291503576 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -472,6 +472,7 @@ extern bool parse_option_str(const char *str, const char *option);
472extern char *next_arg(char *args, char **param, char **val); 472extern char *next_arg(char *args, char **param, char **val);
473 473
474extern int core_kernel_text(unsigned long addr); 474extern int core_kernel_text(unsigned long addr);
475extern int init_kernel_text(unsigned long addr);
475extern int core_kernel_data(unsigned long addr); 476extern int core_kernel_data(unsigned long addr);
476extern int __kernel_text_address(unsigned long addr); 477extern int __kernel_text_address(unsigned long addr);
477extern int kernel_text_address(unsigned long addr); 478extern int kernel_text_address(unsigned long addr);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ac0062b74aed..6930c63126c7 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1105,7 +1105,6 @@ static inline void kvm_irq_routing_update(struct kvm *kvm)
1105{ 1105{
1106} 1106}
1107#endif 1107#endif
1108void kvm_arch_irq_routing_update(struct kvm *kvm);
1109 1108
1110static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) 1109static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
1111{ 1110{
@@ -1114,6 +1113,8 @@ static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
1114 1113
1115#endif /* CONFIG_HAVE_KVM_EVENTFD */ 1114#endif /* CONFIG_HAVE_KVM_EVENTFD */
1116 1115
1116void kvm_arch_irq_routing_update(struct kvm *kvm);
1117
1117static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) 1118static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu)
1118{ 1119{
1119 /* 1120 /*
@@ -1272,4 +1273,7 @@ static inline long kvm_arch_vcpu_async_ioctl(struct file *filp,
1272} 1273}
1273#endif /* CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL */ 1274#endif /* CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL */
1274 1275
1276void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
1277 unsigned long start, unsigned long end);
1278
1275#endif 1279#endif
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 882046863581..c46016bb25eb 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -523,9 +523,11 @@ static inline void __mod_memcg_state(struct mem_cgroup *memcg,
523static inline void mod_memcg_state(struct mem_cgroup *memcg, 523static inline void mod_memcg_state(struct mem_cgroup *memcg,
524 int idx, int val) 524 int idx, int val)
525{ 525{
526 preempt_disable(); 526 unsigned long flags;
527
528 local_irq_save(flags);
527 __mod_memcg_state(memcg, idx, val); 529 __mod_memcg_state(memcg, idx, val);
528 preempt_enable(); 530 local_irq_restore(flags);
529} 531}
530 532
531/** 533/**
@@ -606,9 +608,11 @@ static inline void __mod_lruvec_state(struct lruvec *lruvec,
606static inline void mod_lruvec_state(struct lruvec *lruvec, 608static inline void mod_lruvec_state(struct lruvec *lruvec,
607 enum node_stat_item idx, int val) 609 enum node_stat_item idx, int val)
608{ 610{
609 preempt_disable(); 611 unsigned long flags;
612
613 local_irq_save(flags);
610 __mod_lruvec_state(lruvec, idx, val); 614 __mod_lruvec_state(lruvec, idx, val);
611 preempt_enable(); 615 local_irq_restore(flags);
612} 616}
613 617
614static inline void __mod_lruvec_page_state(struct page *page, 618static inline void __mod_lruvec_page_state(struct page *page,
@@ -630,9 +634,11 @@ static inline void __mod_lruvec_page_state(struct page *page,
630static inline void mod_lruvec_page_state(struct page *page, 634static inline void mod_lruvec_page_state(struct page *page,
631 enum node_stat_item idx, int val) 635 enum node_stat_item idx, int val)
632{ 636{
633 preempt_disable(); 637 unsigned long flags;
638
639 local_irq_save(flags);
634 __mod_lruvec_page_state(page, idx, val); 640 __mod_lruvec_page_state(page, idx, val);
635 preempt_enable(); 641 local_irq_restore(flags);
636} 642}
637 643
638unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, 644unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
@@ -659,9 +665,11 @@ static inline void __count_memcg_events(struct mem_cgroup *memcg,
659static inline void count_memcg_events(struct mem_cgroup *memcg, 665static inline void count_memcg_events(struct mem_cgroup *memcg,
660 int idx, unsigned long count) 666 int idx, unsigned long count)
661{ 667{
662 preempt_disable(); 668 unsigned long flags;
669
670 local_irq_save(flags);
663 __count_memcg_events(memcg, idx, count); 671 __count_memcg_events(memcg, idx, count);
664 preempt_enable(); 672 local_irq_restore(flags);
665} 673}
666 674
667/* idx can be of type enum memcg_event_item or vm_event_item */ 675/* idx can be of type enum memcg_event_item or vm_event_item */
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index c30b32e3c862..10191c28fc04 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -127,10 +127,4 @@ static __always_inline enum lru_list page_lru(struct page *page)
127 127
128#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) 128#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
129 129
130#ifdef arch_unmap_kpfn
131extern void arch_unmap_kpfn(unsigned long pfn);
132#else
133static __always_inline void arch_unmap_kpfn(unsigned long pfn) { }
134#endif
135
136#endif 130#endif
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index f25c13423bd4..cb3bbed4e633 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -66,6 +66,11 @@ struct mutex {
66#endif 66#endif
67}; 67};
68 68
69/*
70 * Internal helper function; C doesn't allow us to hide it :/
71 *
72 * DO NOT USE (outside of mutex code).
73 */
69static inline struct task_struct *__mutex_owner(struct mutex *lock) 74static inline struct task_struct *__mutex_owner(struct mutex *lock)
70{ 75{
71 return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07); 76 return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07);
diff --git a/include/linux/nospec.h b/include/linux/nospec.h
index b99bced39ac2..e791ebc65c9c 100644
--- a/include/linux/nospec.h
+++ b/include/linux/nospec.h
@@ -5,6 +5,7 @@
5 5
6#ifndef _LINUX_NOSPEC_H 6#ifndef _LINUX_NOSPEC_H
7#define _LINUX_NOSPEC_H 7#define _LINUX_NOSPEC_H
8#include <asm/barrier.h>
8 9
9/** 10/**
10 * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise 11 * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise
@@ -20,20 +21,6 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
20 unsigned long size) 21 unsigned long size)
21{ 22{
22 /* 23 /*
23 * Warn developers about inappropriate array_index_nospec() usage.
24 *
25 * Even if the CPU speculates past the WARN_ONCE branch, the
26 * sign bit of @index is taken into account when generating the
27 * mask.
28 *
29 * This warning is compiled out when the compiler can infer that
30 * @index and @size are less than LONG_MAX.
31 */
32 if (WARN_ONCE(index > LONG_MAX || size > LONG_MAX,
33 "array_index_nospec() limited to range of [0, LONG_MAX]\n"))
34 return 0;
35
36 /*
37 * Always calculate and emit the mask even if the compiler 24 * Always calculate and emit the mask even if the compiler
38 * thinks the mask is not needed. The compiler does not take 25 * thinks the mask is not needed. The compiler does not take
39 * into account the value of @index under speculation. 26 * into account the value of @index under speculation.
@@ -66,7 +53,6 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
66 BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ 53 BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \
67 BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ 54 BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \
68 \ 55 \
69 _i &= _mask; \ 56 (typeof(_i)) (_i & _mask); \
70 _i; \
71}) 57})
72#endif /* _LINUX_NOSPEC_H */ 58#endif /* _LINUX_NOSPEC_H */
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
index af0f44effd44..40036a57d072 100644
--- a/include/linux/perf/arm_pmu.h
+++ b/include/linux/perf/arm_pmu.h
@@ -14,26 +14,10 @@
14 14
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/perf_event.h> 16#include <linux/perf_event.h>
17#include <linux/platform_device.h>
17#include <linux/sysfs.h> 18#include <linux/sysfs.h>
18#include <asm/cputype.h> 19#include <asm/cputype.h>
19 20
20/*
21 * struct arm_pmu_platdata - ARM PMU platform data
22 *
23 * @handle_irq: an optional handler which will be called from the
24 * interrupt and passed the address of the low level handler,
25 * and can be used to implement any platform specific handling
26 * before or after calling it.
27 *
28 * @irq_flags: if non-zero, these flags will be passed to request_irq
29 * when requesting interrupts for this PMU device.
30 */
31struct arm_pmu_platdata {
32 irqreturn_t (*handle_irq)(int irq, void *dev,
33 irq_handler_t pmu_handler);
34 unsigned long irq_flags;
35};
36
37#ifdef CONFIG_ARM_PMU 21#ifdef CONFIG_ARM_PMU
38 22
39/* 23/*
@@ -92,7 +76,6 @@ enum armpmu_attr_groups {
92 76
93struct arm_pmu { 77struct arm_pmu {
94 struct pmu pmu; 78 struct pmu pmu;
95 cpumask_t active_irqs;
96 cpumask_t supported_cpus; 79 cpumask_t supported_cpus;
97 char *name; 80 char *name;
98 irqreturn_t (*handle_irq)(int irq_num, void *dev); 81 irqreturn_t (*handle_irq)(int irq_num, void *dev);
@@ -174,12 +157,11 @@ static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }
174 157
175/* Internal functions only for core arm_pmu code */ 158/* Internal functions only for core arm_pmu code */
176struct arm_pmu *armpmu_alloc(void); 159struct arm_pmu *armpmu_alloc(void);
160struct arm_pmu *armpmu_alloc_atomic(void);
177void armpmu_free(struct arm_pmu *pmu); 161void armpmu_free(struct arm_pmu *pmu);
178int armpmu_register(struct arm_pmu *pmu); 162int armpmu_register(struct arm_pmu *pmu);
179int armpmu_request_irqs(struct arm_pmu *armpmu); 163int armpmu_request_irq(int irq, int cpu);
180void armpmu_free_irqs(struct arm_pmu *armpmu); 164void armpmu_free_irq(int irq, int cpu);
181int armpmu_request_irq(struct arm_pmu *armpmu, int cpu);
182void armpmu_free_irq(struct arm_pmu *armpmu, int cpu);
183 165
184#define ARMV8_PMU_PDEV_NAME "armv8-pmu" 166#define ARMV8_PMU_PDEV_NAME "armv8-pmu"
185 167
diff --git a/include/linux/property.h b/include/linux/property.h
index 769d372c1edf..2eea4b310fc2 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -283,7 +283,7 @@ bool device_dma_supported(struct device *dev);
283 283
284enum dev_dma_attr device_get_dma_attr(struct device *dev); 284enum dev_dma_attr device_get_dma_attr(struct device *dev);
285 285
286void *device_get_match_data(struct device *dev); 286const void *device_get_match_data(struct device *dev);
287 287
288int device_get_phy_mode(struct device *dev); 288int device_get_phy_mode(struct device *dev);
289 289
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index b884b7794187..e6335227b844 100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -469,7 +469,7 @@ static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r,
469 */ 469 */
470static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) 470static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp)
471{ 471{
472 if (size * sizeof(void *) > KMALLOC_MAX_SIZE) 472 if (size > KMALLOC_MAX_SIZE / sizeof(void *))
473 return NULL; 473 return NULL;
474 return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); 474 return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO);
475} 475}
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
index 1149533aa2fa..9806184bb3d5 100644
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@ -36,7 +36,18 @@ static inline void mmgrab(struct mm_struct *mm)
36 atomic_inc(&mm->mm_count); 36 atomic_inc(&mm->mm_count);
37} 37}
38 38
39extern void mmdrop(struct mm_struct *mm); 39extern void __mmdrop(struct mm_struct *mm);
40
41static inline void mmdrop(struct mm_struct *mm)
42{
43 /*
44 * The implicit full barrier implied by atomic_dec_and_test() is
45 * required by the membarrier system call before returning to
46 * user-space, after storing to rq->curr.
47 */
48 if (unlikely(atomic_dec_and_test(&mm->mm_count)))
49 __mmdrop(mm);
50}
40 51
41/** 52/**
42 * mmget() - Pin the address space associated with a &struct mm_struct. 53 * mmget() - Pin the address space associated with a &struct mm_struct.
diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h
index 0dcf4e480ef7..96fe289c4c6e 100644
--- a/include/linux/sched/user.h
+++ b/include/linux/sched/user.h
@@ -4,6 +4,7 @@
4 4
5#include <linux/uidgid.h> 5#include <linux/uidgid.h>
6#include <linux/atomic.h> 6#include <linux/atomic.h>
7#include <linux/ratelimit.h>
7 8
8struct key; 9struct key;
9 10
@@ -41,6 +42,9 @@ struct user_struct {
41 defined(CONFIG_NET) 42 defined(CONFIG_NET)
42 atomic_long_t locked_vm; 43 atomic_long_t locked_vm;
43#endif 44#endif
45
46 /* Miscellaneous per-user rate limit */
47 struct ratelimit_state ratelimit;
44}; 48};
45 49
46extern int uids_sysfs_init(void); 50extern int uids_sysfs_init(void);
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index dc368b8ce215..11c86fbfeb98 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * Distributed under the terms of the GNU GPL, version 2 5 * Distributed under the terms of the GNU GPL, version 2
6 * 6 *
7 * Please see kernel/semaphore.c for documentation of these functions 7 * Please see kernel/locking/semaphore.c for documentation of these functions
8 */ 8 */
9#ifndef __LINUX_SEMAPHORE_H 9#ifndef __LINUX_SEMAPHORE_H
10#define __LINUX_SEMAPHORE_H 10#define __LINUX_SEMAPHORE_H
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5ebc0f869720..c1e66bdcf583 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3646,7 +3646,7 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb,
3646 return true; 3646 return true;
3647} 3647}
3648 3648
3649/* For small packets <= CHECKSUM_BREAK peform checksum complete directly 3649/* For small packets <= CHECKSUM_BREAK perform checksum complete directly
3650 * in checksum_init. 3650 * in checksum_init.
3651 */ 3651 */
3652#define CHECKSUM_BREAK 76 3652#define CHECKSUM_BREAK 76
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 7b6a59f722a3..a1a3f4ed94ce 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -337,8 +337,6 @@ extern void deactivate_file_page(struct page *page);
337extern void mark_page_lazyfree(struct page *page); 337extern void mark_page_lazyfree(struct page *page);
338extern void swap_setup(void); 338extern void swap_setup(void);
339 339
340extern void add_page_to_unevictable_list(struct page *page);
341
342extern void lru_cache_add_active_or_unevictable(struct page *page, 340extern void lru_cache_add_active_or_unevictable(struct page *page,
343 struct vm_area_struct *vma); 341 struct vm_area_struct *vma);
344 342
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 4a54ef96aff5..bc0cda180c8b 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -465,6 +465,7 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork);
465 465
466extern void workqueue_set_max_active(struct workqueue_struct *wq, 466extern void workqueue_set_max_active(struct workqueue_struct *wq,
467 int max_active); 467 int max_active);
468extern struct work_struct *current_work(void);
468extern bool current_is_workqueue_rescuer(void); 469extern bool current_is_workqueue_rescuer(void);
469extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); 470extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
470extern unsigned int work_busy(struct work_struct *work); 471extern unsigned int work_busy(struct work_struct *work);
diff --git a/include/media/demux.h b/include/media/demux.h
index c4df6cee48e6..bf00a5a41a90 100644
--- a/include/media/demux.h
+++ b/include/media/demux.h
@@ -117,7 +117,7 @@ struct dmx_ts_feed {
117 * specified by @filter_value that will be used on the filter 117 * specified by @filter_value that will be used on the filter
118 * match logic. 118 * match logic.
119 * @filter_mode: Contains a 16 bytes (128 bits) filter mode. 119 * @filter_mode: Contains a 16 bytes (128 bits) filter mode.
120 * @parent: Pointer to struct dmx_section_feed. 120 * @parent: Back-pointer to struct dmx_section_feed.
121 * @priv: Pointer to private data of the API client. 121 * @priv: Pointer to private data of the API client.
122 * 122 *
123 * 123 *
@@ -130,8 +130,9 @@ struct dmx_section_filter {
130 u8 filter_value[DMX_MAX_FILTER_SIZE]; 130 u8 filter_value[DMX_MAX_FILTER_SIZE];
131 u8 filter_mask[DMX_MAX_FILTER_SIZE]; 131 u8 filter_mask[DMX_MAX_FILTER_SIZE];
132 u8 filter_mode[DMX_MAX_FILTER_SIZE]; 132 u8 filter_mode[DMX_MAX_FILTER_SIZE];
133 struct dmx_section_feed *parent; /* Back-pointer */ 133 struct dmx_section_feed *parent;
134 void *priv; /* Pointer to private data of the API client */ 134
135 void *priv;
135}; 136};
136 137
137/** 138/**
@@ -193,6 +194,10 @@ struct dmx_section_feed {
193 * @buffer2: Pointer to the tail of the filtered TS packets, or NULL. 194 * @buffer2: Pointer to the tail of the filtered TS packets, or NULL.
194 * @buffer2_length: Length of the TS data in buffer2. 195 * @buffer2_length: Length of the TS data in buffer2.
195 * @source: Indicates which TS feed is the source of the callback. 196 * @source: Indicates which TS feed is the source of the callback.
197 * @buffer_flags: Address where buffer flags are stored. Those are
198 * used to report discontinuity users via DVB
199 * memory mapped API, as defined by
200 * &enum dmx_buffer_flags.
196 * 201 *
197 * This function callback prototype, provided by the client of the demux API, 202 * This function callback prototype, provided by the client of the demux API,
198 * is called from the demux code. The function is only called when filtering 203 * is called from the demux code. The function is only called when filtering
@@ -245,7 +250,8 @@ typedef int (*dmx_ts_cb)(const u8 *buffer1,
245 size_t buffer1_length, 250 size_t buffer1_length,
246 const u8 *buffer2, 251 const u8 *buffer2,
247 size_t buffer2_length, 252 size_t buffer2_length,
248 struct dmx_ts_feed *source); 253 struct dmx_ts_feed *source,
254 u32 *buffer_flags);
249 255
250/** 256/**
251 * typedef dmx_section_cb - DVB demux TS filter callback function prototype 257 * typedef dmx_section_cb - DVB demux TS filter callback function prototype
@@ -261,6 +267,10 @@ typedef int (*dmx_ts_cb)(const u8 *buffer1,
261 * including headers and CRC. 267 * including headers and CRC.
262 * @source: Indicates which section feed is the source of the 268 * @source: Indicates which section feed is the source of the
263 * callback. 269 * callback.
270 * @buffer_flags: Address where buffer flags are stored. Those are
271 * used to report discontinuity users via DVB
272 * memory mapped API, as defined by
273 * &enum dmx_buffer_flags.
264 * 274 *
265 * This function callback prototype, provided by the client of the demux API, 275 * This function callback prototype, provided by the client of the demux API,
266 * is called from the demux code. The function is only called when 276 * is called from the demux code. The function is only called when
@@ -286,7 +296,8 @@ typedef int (*dmx_section_cb)(const u8 *buffer1,
286 size_t buffer1_len, 296 size_t buffer1_len,
287 const u8 *buffer2, 297 const u8 *buffer2,
288 size_t buffer2_len, 298 size_t buffer2_len,
289 struct dmx_section_filter *source); 299 struct dmx_section_filter *source,
300 u32 *buffer_flags);
290 301
291/* 302/*
292 * DVB Front-End 303 * DVB Front-End
diff --git a/include/media/dmxdev.h b/include/media/dmxdev.h
index 2f5cb2c7b6a7..baafa3b8aca4 100644
--- a/include/media/dmxdev.h
+++ b/include/media/dmxdev.h
@@ -163,6 +163,7 @@ struct dmxdev_filter {
163 * @demux: pointer to &struct dmx_demux. 163 * @demux: pointer to &struct dmx_demux.
164 * @filternum: number of filters. 164 * @filternum: number of filters.
165 * @capabilities: demux capabilities as defined by &enum dmx_demux_caps. 165 * @capabilities: demux capabilities as defined by &enum dmx_demux_caps.
166 * @may_do_mmap: flag used to indicate if the device may do mmap.
166 * @exit: flag to indicate that the demux is being released. 167 * @exit: flag to indicate that the demux is being released.
167 * @dvr_orig_fe: pointer to &struct dmx_frontend. 168 * @dvr_orig_fe: pointer to &struct dmx_frontend.
168 * @dvr_buffer: embedded &struct dvb_ringbuffer for DVB output. 169 * @dvr_buffer: embedded &struct dvb_ringbuffer for DVB output.
@@ -180,6 +181,7 @@ struct dmxdev {
180 int filternum; 181 int filternum;
181 int capabilities; 182 int capabilities;
182 183
184 unsigned int may_do_mmap:1;
183 unsigned int exit:1; 185 unsigned int exit:1;
184#define DMXDEV_CAP_DUPLEX 1 186#define DMXDEV_CAP_DUPLEX 1
185 struct dmx_frontend *dvr_orig_fe; 187 struct dmx_frontend *dvr_orig_fe;
diff --git a/include/media/dvb_demux.h b/include/media/dvb_demux.h
index b07092038f4b..3b6aeca7a49e 100644
--- a/include/media/dvb_demux.h
+++ b/include/media/dvb_demux.h
@@ -115,6 +115,8 @@ struct dvb_demux_filter {
115 * @pid: PID to be filtered. 115 * @pid: PID to be filtered.
116 * @timeout: feed timeout. 116 * @timeout: feed timeout.
117 * @filter: pointer to &struct dvb_demux_filter. 117 * @filter: pointer to &struct dvb_demux_filter.
118 * @buffer_flags: Buffer flags used to report discontinuity users via DVB
119 * memory mapped API, as defined by &enum dmx_buffer_flags.
118 * @ts_type: type of TS, as defined by &enum ts_filter_type. 120 * @ts_type: type of TS, as defined by &enum ts_filter_type.
119 * @pes_type: type of PES, as defined by &enum dmx_ts_pes. 121 * @pes_type: type of PES, as defined by &enum dmx_ts_pes.
120 * @cc: MPEG-TS packet continuity counter 122 * @cc: MPEG-TS packet continuity counter
@@ -145,6 +147,8 @@ struct dvb_demux_feed {
145 ktime_t timeout; 147 ktime_t timeout;
146 struct dvb_demux_filter *filter; 148 struct dvb_demux_filter *filter;
147 149
150 u32 buffer_flags;
151
148 enum ts_filter_type ts_type; 152 enum ts_filter_type ts_type;
149 enum dmx_ts_pes pes_type; 153 enum dmx_ts_pes pes_type;
150 154
diff --git a/include/media/dvb_vb2.h b/include/media/dvb_vb2.h
index 01d1202d1a55..8cb88452cd6c 100644
--- a/include/media/dvb_vb2.h
+++ b/include/media/dvb_vb2.h
@@ -85,6 +85,12 @@ struct dvb_buffer {
85 * @nonblocking: 85 * @nonblocking:
86 * If different than zero, device is operating on non-blocking 86 * If different than zero, device is operating on non-blocking
87 * mode. 87 * mode.
88 * @flags: buffer flags as defined by &enum dmx_buffer_flags.
89 * Filled only at &DMX_DQBUF. &DMX_QBUF should zero this field.
90 * @count: monotonic counter for filled buffers. Helps to identify
91 * data stream loses. Filled only at &DMX_DQBUF. &DMX_QBUF should
92 * zero this field.
93 *
88 * @name: name of the device type. Currently, it can either be 94 * @name: name of the device type. Currently, it can either be
89 * "dvr" or "demux_filter". 95 * "dvr" or "demux_filter".
90 */ 96 */
@@ -100,10 +106,14 @@ struct dvb_vb2_ctx {
100 int buf_siz; 106 int buf_siz;
101 int buf_cnt; 107 int buf_cnt;
102 int nonblocking; 108 int nonblocking;
109
110 enum dmx_buffer_flags flags;
111 u32 count;
112
103 char name[DVB_VB2_NAME_MAX + 1]; 113 char name[DVB_VB2_NAME_MAX + 1];
104}; 114};
105 115
106#ifndef DVB_MMAP 116#ifndef CONFIG_DVB_MMAP
107static inline int dvb_vb2_init(struct dvb_vb2_ctx *ctx, 117static inline int dvb_vb2_init(struct dvb_vb2_ctx *ctx,
108 const char *name, int non_blocking) 118 const char *name, int non_blocking)
109{ 119{
@@ -114,7 +124,7 @@ static inline int dvb_vb2_release(struct dvb_vb2_ctx *ctx)
114 return 0; 124 return 0;
115}; 125};
116#define dvb_vb2_is_streaming(ctx) (0) 126#define dvb_vb2_is_streaming(ctx) (0)
117#define dvb_vb2_fill_buffer(ctx, file, wait) (0) 127#define dvb_vb2_fill_buffer(ctx, file, wait, flags) (0)
118 128
119static inline __poll_t dvb_vb2_poll(struct dvb_vb2_ctx *ctx, 129static inline __poll_t dvb_vb2_poll(struct dvb_vb2_ctx *ctx,
120 struct file *file, 130 struct file *file,
@@ -153,9 +163,13 @@ int dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx);
153 * @ctx: control struct for VB2 handler 163 * @ctx: control struct for VB2 handler
154 * @src: place where the data is stored 164 * @src: place where the data is stored
155 * @len: number of bytes to be copied from @src 165 * @len: number of bytes to be copied from @src
166 * @buffer_flags:
167 * pointer to buffer flags as defined by &enum dmx_buffer_flags.
168 * can be NULL.
156 */ 169 */
157int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx, 170int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
158 const unsigned char *src, int len); 171 const unsigned char *src, int len,
172 enum dmx_buffer_flags *buffer_flags);
159 173
160/** 174/**
161 * dvb_vb2_poll - Wrapper to vb2_core_streamon() for Digital TV 175 * dvb_vb2_poll - Wrapper to vb2_core_streamon() for Digital TV
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 906e90223066..c96511fa9198 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4149,7 +4149,7 @@ void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, u8 tid);
4149 * The TX headroom reserved by mac80211 for its own tx_status functions. 4149 * The TX headroom reserved by mac80211 for its own tx_status functions.
4150 * This is enough for the radiotap header. 4150 * This is enough for the radiotap header.
4151 */ 4151 */
4152#define IEEE80211_TX_STATUS_HEADROOM 14 4152#define IEEE80211_TX_STATUS_HEADROOM ALIGN(14, 4)
4153 4153
4154/** 4154/**
4155 * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames 4155 * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index ebc5a2ed8631..f83cacce3308 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -78,7 +78,7 @@ struct regulatory_request {
78 int wiphy_idx; 78 int wiphy_idx;
79 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
80 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
81 char alpha2[2]; 81 char alpha2[3];
82 enum nl80211_dfs_regions dfs_region; 82 enum nl80211_dfs_regions dfs_region;
83 bool intersect; 83 bool intersect;
84 bool processed; 84 bool processed;
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 81bdbf97319b..9185e45b997f 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -64,6 +64,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
64 UDP_SKB_CB(skb)->cscov = cscov; 64 UDP_SKB_CB(skb)->cscov = cscov;
65 if (skb->ip_summed == CHECKSUM_COMPLETE) 65 if (skb->ip_summed == CHECKSUM_COMPLETE)
66 skb->ip_summed = CHECKSUM_NONE; 66 skb->ip_summed = CHECKSUM_NONE;
67 skb->csum_valid = 0;
67 } 68 }
68 69
69 return 0; 70 return 0;
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
index c2d81167c858..2cdf8dcf4bdc 100644
--- a/include/rdma/restrack.h
+++ b/include/rdma/restrack.h
@@ -29,10 +29,6 @@ enum rdma_restrack_type {
29 */ 29 */
30 RDMA_RESTRACK_QP, 30 RDMA_RESTRACK_QP,
31 /** 31 /**
32 * @RDMA_RESTRACK_XRCD: XRC domain (XRCD)
33 */
34 RDMA_RESTRACK_XRCD,
35 /**
36 * @RDMA_RESTRACK_MAX: Last entry, used for array dclarations 32 * @RDMA_RESTRACK_MAX: Last entry, used for array dclarations
37 */ 33 */
38 RDMA_RESTRACK_MAX 34 RDMA_RESTRACK_MAX
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index 6da44079aa58..38287d9d23a1 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -276,10 +276,7 @@ struct uverbs_object_tree_def {
276 */ 276 */
277 277
278struct uverbs_ptr_attr { 278struct uverbs_ptr_attr {
279 union { 279 u64 data;
280 u64 data;
281 void __user *ptr;
282 };
283 u16 len; 280 u16 len;
284 /* Combination of bits from enum UVERBS_ATTR_F_XXXX */ 281 /* Combination of bits from enum UVERBS_ATTR_F_XXXX */
285 u16 flags; 282 u16 flags;
@@ -351,38 +348,60 @@ static inline const struct uverbs_attr *uverbs_attr_get(const struct uverbs_attr
351} 348}
352 349
353static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle, 350static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle,
354 size_t idx, const void *from) 351 size_t idx, const void *from, size_t size)
355{ 352{
356 const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); 353 const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx);
357 u16 flags; 354 u16 flags;
355 size_t min_size;
358 356
359 if (IS_ERR(attr)) 357 if (IS_ERR(attr))
360 return PTR_ERR(attr); 358 return PTR_ERR(attr);
361 359
360 min_size = min_t(size_t, attr->ptr_attr.len, size);
361 if (copy_to_user(u64_to_user_ptr(attr->ptr_attr.data), from, min_size))
362 return -EFAULT;
363
362 flags = attr->ptr_attr.flags | UVERBS_ATTR_F_VALID_OUTPUT; 364 flags = attr->ptr_attr.flags | UVERBS_ATTR_F_VALID_OUTPUT;
363 return (!copy_to_user(attr->ptr_attr.ptr, from, attr->ptr_attr.len) && 365 if (put_user(flags, &attr->uattr->flags))
364 !put_user(flags, &attr->uattr->flags)) ? 0 : -EFAULT; 366 return -EFAULT;
367
368 return 0;
365} 369}
366 370
367static inline int _uverbs_copy_from(void *to, size_t to_size, 371static inline bool uverbs_attr_ptr_is_inline(const struct uverbs_attr *attr)
372{
373 return attr->ptr_attr.len <= sizeof(attr->ptr_attr.data);
374}
375
376static inline int _uverbs_copy_from(void *to,
368 const struct uverbs_attr_bundle *attrs_bundle, 377 const struct uverbs_attr_bundle *attrs_bundle,
369 size_t idx) 378 size_t idx,
379 size_t size)
370{ 380{
371 const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); 381 const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx);
372 382
373 if (IS_ERR(attr)) 383 if (IS_ERR(attr))
374 return PTR_ERR(attr); 384 return PTR_ERR(attr);
375 385
376 if (to_size <= sizeof(((struct ib_uverbs_attr *)0)->data)) 386 /*
387 * Validation ensures attr->ptr_attr.len >= size. If the caller is
388 * using UVERBS_ATTR_SPEC_F_MIN_SZ then it must call copy_from with
389 * the right size.
390 */
391 if (unlikely(size < attr->ptr_attr.len))
392 return -EINVAL;
393
394 if (uverbs_attr_ptr_is_inline(attr))
377 memcpy(to, &attr->ptr_attr.data, attr->ptr_attr.len); 395 memcpy(to, &attr->ptr_attr.data, attr->ptr_attr.len);
378 else if (copy_from_user(to, attr->ptr_attr.ptr, attr->ptr_attr.len)) 396 else if (copy_from_user(to, u64_to_user_ptr(attr->ptr_attr.data),
397 attr->ptr_attr.len))
379 return -EFAULT; 398 return -EFAULT;
380 399
381 return 0; 400 return 0;
382} 401}
383 402
384#define uverbs_copy_from(to, attrs_bundle, idx) \ 403#define uverbs_copy_from(to, attrs_bundle, idx) \
385 _uverbs_copy_from(to, sizeof(*(to)), attrs_bundle, idx) 404 _uverbs_copy_from(to, attrs_bundle, idx, sizeof(*to))
386 405
387/* ================================================= 406/* =================================================
388 * Definitions -> Specs infrastructure 407 * Definitions -> Specs infrastructure
diff --git a/include/soc/arc/mcip.h b/include/soc/arc/mcip.h
index c2d1b15da136..a91f25151a5b 100644
--- a/include/soc/arc/mcip.h
+++ b/include/soc/arc/mcip.h
@@ -15,6 +15,7 @@
15 15
16#define ARC_REG_MCIP_BCR 0x0d0 16#define ARC_REG_MCIP_BCR 0x0d0
17#define ARC_REG_MCIP_IDU_BCR 0x0D5 17#define ARC_REG_MCIP_IDU_BCR 0x0D5
18#define ARC_REG_GFRC_BUILD 0x0D6
18#define ARC_REG_MCIP_CMD 0x600 19#define ARC_REG_MCIP_CMD 0x600
19#define ARC_REG_MCIP_WDATA 0x601 20#define ARC_REG_MCIP_WDATA 0x601
20#define ARC_REG_MCIP_READBACK 0x602 21#define ARC_REG_MCIP_READBACK 0x602
@@ -36,10 +37,14 @@ struct mcip_cmd {
36#define CMD_SEMA_RELEASE 0x12 37#define CMD_SEMA_RELEASE 0x12
37 38
38#define CMD_DEBUG_SET_MASK 0x34 39#define CMD_DEBUG_SET_MASK 0x34
40#define CMD_DEBUG_READ_MASK 0x35
39#define CMD_DEBUG_SET_SELECT 0x36 41#define CMD_DEBUG_SET_SELECT 0x36
42#define CMD_DEBUG_READ_SELECT 0x37
40 43
41#define CMD_GFRC_READ_LO 0x42 44#define CMD_GFRC_READ_LO 0x42
42#define CMD_GFRC_READ_HI 0x43 45#define CMD_GFRC_READ_HI 0x43
46#define CMD_GFRC_SET_CORE 0x47
47#define CMD_GFRC_READ_CORE 0x48
43 48
44#define CMD_IDU_ENABLE 0x71 49#define CMD_IDU_ENABLE 0x71
45#define CMD_IDU_DISABLE 0x72 50#define CMD_IDU_DISABLE 0x72
diff --git a/include/sound/ac97/regs.h b/include/sound/ac97/regs.h
index 4bb86d379bd5..9a4fa0c3264a 100644
--- a/include/sound/ac97/regs.h
+++ b/include/sound/ac97/regs.h
@@ -31,7 +31,7 @@
31#define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */ 31#define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */
32#define AC97_MASTER_MONO 0x06 /* Master Volume Mono (optional) */ 32#define AC97_MASTER_MONO 0x06 /* Master Volume Mono (optional) */
33#define AC97_MASTER_TONE 0x08 /* Master Tone (Bass & Treble) (optional) */ 33#define AC97_MASTER_TONE 0x08 /* Master Tone (Bass & Treble) (optional) */
34#define AC97_PC_BEEP 0x0a /* PC Beep Volume (optinal) */ 34#define AC97_PC_BEEP 0x0a /* PC Beep Volume (optional) */
35#define AC97_PHONE 0x0c /* Phone Volume (optional) */ 35#define AC97_PHONE 0x0c /* Phone Volume (optional) */
36#define AC97_MIC 0x0e /* MIC Volume */ 36#define AC97_MIC 0x0e /* MIC Volume */
37#define AC97_LINE 0x10 /* Line In Volume */ 37#define AC97_LINE 0x10 /* Line In Volume */
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index b8adf05c534e..7dd8f34c37df 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -368,7 +368,7 @@ TRACE_EVENT(xen_mmu_flush_tlb,
368 TP_printk("%s", "") 368 TP_printk("%s", "")
369 ); 369 );
370 370
371TRACE_EVENT(xen_mmu_flush_tlb_single, 371TRACE_EVENT(xen_mmu_flush_tlb_one_user,
372 TP_PROTO(unsigned long addr), 372 TP_PROTO(unsigned long addr),
373 TP_ARGS(addr), 373 TP_ARGS(addr),
374 TP_STRUCT__entry( 374 TP_STRUCT__entry(
diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index 91a31ffed828..9a781f0611df 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -63,6 +63,7 @@ struct drm_virtgpu_execbuffer {
63}; 63};
64 64
65#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */ 65#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
66#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
66 67
67struct drm_virtgpu_getparam { 68struct drm_virtgpu_getparam {
68 __u64 param; 69 __u64 param;
diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
index 20d1490d6377..3c50e07ee833 100644
--- a/include/uapi/linux/blktrace_api.h
+++ b/include/uapi/linux/blktrace_api.h
@@ -131,7 +131,7 @@ enum {
131#define BLKTRACE_BDEV_SIZE 32 131#define BLKTRACE_BDEV_SIZE 32
132 132
133/* 133/*
134 * User setup structure passed with BLKTRACESTART 134 * User setup structure passed with BLKTRACESETUP
135 */ 135 */
136struct blk_user_trace_setup { 136struct blk_user_trace_setup {
137 char name[BLKTRACE_BDEV_SIZE]; /* output */ 137 char name[BLKTRACE_BDEV_SIZE]; /* output */
diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h
index 5f3c5a918f00..b4112f0b6dd3 100644
--- a/include/uapi/linux/dvb/dmx.h
+++ b/include/uapi/linux/dvb/dmx.h
@@ -212,6 +212,32 @@ struct dmx_stc {
212}; 212};
213 213
214/** 214/**
215 * enum dmx_buffer_flags - DMX memory-mapped buffer flags
216 *
217 * @DMX_BUFFER_FLAG_HAD_CRC32_DISCARD:
218 * Indicates that the Kernel discarded one or more frames due to wrong
219 * CRC32 checksum.
220 * @DMX_BUFFER_FLAG_TEI:
221 * Indicates that the Kernel has detected a Transport Error indicator
222 * (TEI) on a filtered pid.
223 * @DMX_BUFFER_PKT_COUNTER_MISMATCH:
224 * Indicates that the Kernel has detected a packet counter mismatch
225 * on a filtered pid.
226 * @DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED:
227 * Indicates that the Kernel has detected one or more frame discontinuity.
228 * @DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR:
229 * Received at least one packet with a frame discontinuity indicator.
230 */
231
232enum dmx_buffer_flags {
233 DMX_BUFFER_FLAG_HAD_CRC32_DISCARD = 1 << 0,
234 DMX_BUFFER_FLAG_TEI = 1 << 1,
235 DMX_BUFFER_PKT_COUNTER_MISMATCH = 1 << 2,
236 DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED = 1 << 3,
237 DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR = 1 << 4,
238};
239
240/**
215 * struct dmx_buffer - dmx buffer info 241 * struct dmx_buffer - dmx buffer info
216 * 242 *
217 * @index: id number of the buffer 243 * @index: id number of the buffer
@@ -220,15 +246,24 @@ struct dmx_stc {
220 * offset from the start of the device memory for this plane, 246 * offset from the start of the device memory for this plane,
221 * (or a "cookie" that should be passed to mmap() as offset) 247 * (or a "cookie" that should be passed to mmap() as offset)
222 * @length: size in bytes of the buffer 248 * @length: size in bytes of the buffer
249 * @flags: bit array of buffer flags as defined by &enum dmx_buffer_flags.
250 * Filled only at &DMX_DQBUF.
251 * @count: monotonic counter for filled buffers. Helps to identify
252 * data stream loses. Filled only at &DMX_DQBUF.
223 * 253 *
224 * Contains data exchanged by application and driver using one of the streaming 254 * Contains data exchanged by application and driver using one of the streaming
225 * I/O methods. 255 * I/O methods.
256 *
257 * Please notice that, for &DMX_QBUF, only @index should be filled.
258 * On &DMX_DQBUF calls, all fields will be filled by the Kernel.
226 */ 259 */
227struct dmx_buffer { 260struct dmx_buffer {
228 __u32 index; 261 __u32 index;
229 __u32 bytesused; 262 __u32 bytesused;
230 __u32 offset; 263 __u32 offset;
231 __u32 length; 264 __u32 length;
265 __u32 flags;
266 __u32 count;
232}; 267};
233 268
234/** 269/**
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index f8cb5760ea4f..8bbbcb5cd94b 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -23,7 +23,6 @@
23#define _UAPI_LINUX_IF_ETHER_H 23#define _UAPI_LINUX_IF_ETHER_H
24 24
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/libc-compat.h>
27 26
28/* 27/*
29 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 28 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
@@ -151,6 +150,11 @@
151 * This is an Ethernet frame header. 150 * This is an Ethernet frame header.
152 */ 151 */
153 152
153/* allow libcs like musl to deactivate this, glibc does not implement this. */
154#ifndef __UAPI_DEF_ETHHDR
155#define __UAPI_DEF_ETHHDR 1
156#endif
157
154#if __UAPI_DEF_ETHHDR 158#if __UAPI_DEF_ETHHDR
155struct ethhdr { 159struct ethhdr {
156 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 160 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 0fb5ef939732..7b26d4b0b052 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -761,6 +761,7 @@ struct kvm_ppc_resize_hpt {
761#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07 761#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
762#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08 762#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
763#define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2) 763#define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2)
764#define KVM_GET_MSR_FEATURE_INDEX_LIST _IOWR(KVMIO, 0x0a, struct kvm_msr_list)
764 765
765/* 766/*
766 * Extension capability list. 767 * Extension capability list.
@@ -934,6 +935,7 @@ struct kvm_ppc_resize_hpt {
934#define KVM_CAP_S390_AIS_MIGRATION 150 935#define KVM_CAP_S390_AIS_MIGRATION 150
935#define KVM_CAP_PPC_GET_CPU_CHAR 151 936#define KVM_CAP_PPC_GET_CPU_CHAR 151
936#define KVM_CAP_S390_BPB 152 937#define KVM_CAP_S390_BPB 152
938#define KVM_CAP_GET_MSR_FEATURES 153
937 939
938#ifdef KVM_CAP_IRQ_ROUTING 940#ifdef KVM_CAP_IRQ_ROUTING
939 941
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index fc29efaa918c..8254c937c9f4 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -264,10 +264,4 @@
264 264
265#endif /* __GLIBC__ */ 265#endif /* __GLIBC__ */
266 266
267/* Definitions for if_ether.h */
268/* allow libcs like musl to deactivate this, glibc does not implement this. */
269#ifndef __UAPI_DEF_ETHHDR
270#define __UAPI_DEF_ETHHDR 1
271#endif
272
273#endif /* _UAPI_LIBC_COMPAT_H */ 267#endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h
index 3d77fe91239a..9008f31c7eb6 100644
--- a/include/uapi/linux/psp-sev.h
+++ b/include/uapi/linux/psp-sev.h
@@ -42,7 +42,7 @@ typedef enum {
42 SEV_RET_INVALID_PLATFORM_STATE, 42 SEV_RET_INVALID_PLATFORM_STATE,
43 SEV_RET_INVALID_GUEST_STATE, 43 SEV_RET_INVALID_GUEST_STATE,
44 SEV_RET_INAVLID_CONFIG, 44 SEV_RET_INAVLID_CONFIG,
45 SEV_RET_INVALID_len, 45 SEV_RET_INVALID_LEN,
46 SEV_RET_ALREADY_OWNED, 46 SEV_RET_ALREADY_OWNED,
47 SEV_RET_INVALID_CERTIFICATE, 47 SEV_RET_INVALID_CERTIFICATE,
48 SEV_RET_POLICY_FAILURE, 48 SEV_RET_POLICY_FAILURE,
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
index e46d82b91166..d5a1b8a492b9 100644
--- a/include/uapi/linux/ptrace.h
+++ b/include/uapi/linux/ptrace.h
@@ -69,8 +69,8 @@ struct ptrace_peeksiginfo_args {
69#define PTRACE_SECCOMP_GET_METADATA 0x420d 69#define PTRACE_SECCOMP_GET_METADATA 0x420d
70 70
71struct seccomp_metadata { 71struct seccomp_metadata {
72 unsigned long filter_off; /* Input: which filter */ 72 __u64 filter_off; /* Input: which filter */
73 unsigned int flags; /* Output: filter's flags */ 73 __u64 flags; /* Output: filter's flags */
74}; 74};
75 75
76/* Read signals from a shared (process wide) queue */ 76/* Read signals from a shared (process wide) queue */
diff --git a/include/uapi/rdma/rdma_user_ioctl.h b/include/uapi/rdma/rdma_user_ioctl.h
index 03557b5f9aa6..46de0885e800 100644
--- a/include/uapi/rdma/rdma_user_ioctl.h
+++ b/include/uapi/rdma/rdma_user_ioctl.h
@@ -65,7 +65,7 @@ struct ib_uverbs_attr {
65 __u16 len; /* only for pointers */ 65 __u16 len; /* only for pointers */
66 __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */ 66 __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */
67 __u16 reserved; 67 __u16 reserved;
68 __u64 data; /* ptr to command, inline data or idr/fd */ 68 __aligned_u64 data; /* ptr to command, inline data or idr/fd */
69}; 69};
70 70
71struct ib_uverbs_ioctl_hdr { 71struct ib_uverbs_ioctl_hdr {
@@ -73,7 +73,7 @@ struct ib_uverbs_ioctl_hdr {
73 __u16 object_id; 73 __u16 object_id;
74 __u16 method_id; 74 __u16 method_id;
75 __u16 num_attrs; 75 __u16 num_attrs;
76 __u64 reserved; 76 __aligned_u64 reserved;
77 struct ib_uverbs_attr attrs[0]; 77 struct ib_uverbs_attr attrs[0];
78}; 78};
79 79
diff --git a/init/main.c b/init/main.c
index a8100b954839..969eaf140ef0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -89,6 +89,7 @@
89#include <linux/io.h> 89#include <linux/io.h>
90#include <linux/cache.h> 90#include <linux/cache.h>
91#include <linux/rodata_test.h> 91#include <linux/rodata_test.h>
92#include <linux/jump_label.h>
92 93
93#include <asm/io.h> 94#include <asm/io.h>
94#include <asm/bugs.h> 95#include <asm/bugs.h>
@@ -1000,6 +1001,7 @@ static int __ref kernel_init(void *unused)
1000 /* need to finish all async __init code before freeing the memory */ 1001 /* need to finish all async __init code before freeing the memory */
1001 async_synchronize_full(); 1002 async_synchronize_full();
1002 ftrace_free_init_mem(); 1003 ftrace_free_init_mem();
1004 jump_label_invalidate_init();
1003 free_initmem(); 1005 free_initmem();
1004 mark_readonly(); 1006 mark_readonly();
1005 system_state = SYSTEM_RUNNING; 1007 system_state = SYSTEM_RUNNING;
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index b1f66480135b..14750e7c5ee4 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -26,8 +26,10 @@ static void bpf_array_free_percpu(struct bpf_array *array)
26{ 26{
27 int i; 27 int i;
28 28
29 for (i = 0; i < array->map.max_entries; i++) 29 for (i = 0; i < array->map.max_entries; i++) {
30 free_percpu(array->pptrs[i]); 30 free_percpu(array->pptrs[i]);
31 cond_resched();
32 }
31} 33}
32 34
33static int bpf_array_alloc_percpu(struct bpf_array *array) 35static int bpf_array_alloc_percpu(struct bpf_array *array)
@@ -43,6 +45,7 @@ static int bpf_array_alloc_percpu(struct bpf_array *array)
43 return -ENOMEM; 45 return -ENOMEM;
44 } 46 }
45 array->pptrs[i] = ptr; 47 array->pptrs[i] = ptr;
48 cond_resched();
46 } 49 }
47 50
48 return 0; 51 return 0;
@@ -73,11 +76,11 @@ static int array_map_alloc_check(union bpf_attr *attr)
73static struct bpf_map *array_map_alloc(union bpf_attr *attr) 76static struct bpf_map *array_map_alloc(union bpf_attr *attr)
74{ 77{
75 bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY; 78 bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY;
76 int numa_node = bpf_map_attr_numa_node(attr); 79 int ret, numa_node = bpf_map_attr_numa_node(attr);
77 u32 elem_size, index_mask, max_entries; 80 u32 elem_size, index_mask, max_entries;
78 bool unpriv = !capable(CAP_SYS_ADMIN); 81 bool unpriv = !capable(CAP_SYS_ADMIN);
82 u64 cost, array_size, mask64;
79 struct bpf_array *array; 83 struct bpf_array *array;
80 u64 array_size, mask64;
81 84
82 elem_size = round_up(attr->value_size, 8); 85 elem_size = round_up(attr->value_size, 8);
83 86
@@ -109,8 +112,19 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
109 array_size += (u64) max_entries * elem_size; 112 array_size += (u64) max_entries * elem_size;
110 113
111 /* make sure there is no u32 overflow later in round_up() */ 114 /* make sure there is no u32 overflow later in round_up() */
112 if (array_size >= U32_MAX - PAGE_SIZE) 115 cost = array_size;
116 if (cost >= U32_MAX - PAGE_SIZE)
113 return ERR_PTR(-ENOMEM); 117 return ERR_PTR(-ENOMEM);
118 if (percpu) {
119 cost += (u64)attr->max_entries * elem_size * num_possible_cpus();
120 if (cost >= U32_MAX - PAGE_SIZE)
121 return ERR_PTR(-ENOMEM);
122 }
123 cost = round_up(cost, PAGE_SIZE) >> PAGE_SHIFT;
124
125 ret = bpf_map_precharge_memlock(cost);
126 if (ret < 0)
127 return ERR_PTR(ret);
114 128
115 /* allocate all map elements and zero-initialize them */ 129 /* allocate all map elements and zero-initialize them */
116 array = bpf_map_area_alloc(array_size, numa_node); 130 array = bpf_map_area_alloc(array_size, numa_node);
@@ -121,20 +135,13 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
121 135
122 /* copy mandatory map attributes */ 136 /* copy mandatory map attributes */
123 bpf_map_init_from_attr(&array->map, attr); 137 bpf_map_init_from_attr(&array->map, attr);
138 array->map.pages = cost;
124 array->elem_size = elem_size; 139 array->elem_size = elem_size;
125 140
126 if (!percpu) 141 if (percpu && bpf_array_alloc_percpu(array)) {
127 goto out;
128
129 array_size += (u64) attr->max_entries * elem_size * num_possible_cpus();
130
131 if (array_size >= U32_MAX - PAGE_SIZE ||
132 bpf_array_alloc_percpu(array)) {
133 bpf_map_area_free(array); 142 bpf_map_area_free(array);
134 return ERR_PTR(-ENOMEM); 143 return ERR_PTR(-ENOMEM);
135 } 144 }
136out:
137 array->map.pages = round_up(array_size, PAGE_SIZE) >> PAGE_SHIFT;
138 145
139 return &array->map; 146 return &array->map;
140} 147}
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 29ca9208dcfa..d315b393abdd 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1590,7 +1590,7 @@ int bpf_prog_array_copy_to_user(struct bpf_prog_array __rcu *progs,
1590 * so always copy 'cnt' prog_ids to the user. 1590 * so always copy 'cnt' prog_ids to the user.
1591 * In a rare race the user will see zero prog_ids 1591 * In a rare race the user will see zero prog_ids
1592 */ 1592 */
1593 ids = kcalloc(cnt, sizeof(u32), GFP_USER); 1593 ids = kcalloc(cnt, sizeof(u32), GFP_USER | __GFP_NOWARN);
1594 if (!ids) 1594 if (!ids)
1595 return -ENOMEM; 1595 return -ENOMEM;
1596 rcu_read_lock(); 1596 rcu_read_lock();
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index fbfdada6caee..a4bb0b34375a 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -334,7 +334,7 @@ static int cpu_map_kthread_run(void *data)
334static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, 334static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu,
335 int map_id) 335 int map_id)
336{ 336{
337 gfp_t gfp = GFP_ATOMIC|__GFP_NOWARN; 337 gfp_t gfp = GFP_KERNEL | __GFP_NOWARN;
338 struct bpf_cpu_map_entry *rcpu; 338 struct bpf_cpu_map_entry *rcpu;
339 int numa, err; 339 int numa, err;
340 340
diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
index 7b469d10d0e9..b4b5b81e7251 100644
--- a/kernel/bpf/lpm_trie.c
+++ b/kernel/bpf/lpm_trie.c
@@ -555,7 +555,10 @@ static void trie_free(struct bpf_map *map)
555 struct lpm_trie_node __rcu **slot; 555 struct lpm_trie_node __rcu **slot;
556 struct lpm_trie_node *node; 556 struct lpm_trie_node *node;
557 557
558 raw_spin_lock(&trie->lock); 558 /* Wait for outstanding programs to complete
559 * update/lookup/delete/get_next_key and free the trie.
560 */
561 synchronize_rcu();
559 562
560 /* Always start at the root and walk down to a node that has no 563 /* Always start at the root and walk down to a node that has no
561 * children. Then free that node, nullify its reference in the parent 564 * children. Then free that node, nullify its reference in the parent
@@ -566,10 +569,9 @@ static void trie_free(struct bpf_map *map)
566 slot = &trie->root; 569 slot = &trie->root;
567 570
568 for (;;) { 571 for (;;) {
569 node = rcu_dereference_protected(*slot, 572 node = rcu_dereference_protected(*slot, 1);
570 lockdep_is_held(&trie->lock));
571 if (!node) 573 if (!node)
572 goto unlock; 574 goto out;
573 575
574 if (rcu_access_pointer(node->child[0])) { 576 if (rcu_access_pointer(node->child[0])) {
575 slot = &node->child[0]; 577 slot = &node->child[0];
@@ -587,8 +589,8 @@ static void trie_free(struct bpf_map *map)
587 } 589 }
588 } 590 }
589 591
590unlock: 592out:
591 raw_spin_unlock(&trie->lock); 593 kfree(trie);
592} 594}
593 595
594static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key) 596static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 48c33417d13c..a927e89dad6e 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -521,8 +521,8 @@ static struct smap_psock *smap_init_psock(struct sock *sock,
521static struct bpf_map *sock_map_alloc(union bpf_attr *attr) 521static struct bpf_map *sock_map_alloc(union bpf_attr *attr)
522{ 522{
523 struct bpf_stab *stab; 523 struct bpf_stab *stab;
524 int err = -EINVAL;
525 u64 cost; 524 u64 cost;
525 int err;
526 526
527 if (!capable(CAP_NET_ADMIN)) 527 if (!capable(CAP_NET_ADMIN))
528 return ERR_PTR(-EPERM); 528 return ERR_PTR(-EPERM);
@@ -547,6 +547,7 @@ static struct bpf_map *sock_map_alloc(union bpf_attr *attr)
547 547
548 /* make sure page count doesn't overflow */ 548 /* make sure page count doesn't overflow */
549 cost = (u64) stab->map.max_entries * sizeof(struct sock *); 549 cost = (u64) stab->map.max_entries * sizeof(struct sock *);
550 err = -EINVAL;
550 if (cost >= U32_MAX - PAGE_SIZE) 551 if (cost >= U32_MAX - PAGE_SIZE)
551 goto free_stab; 552 goto free_stab;
552 553
diff --git a/kernel/extable.c b/kernel/extable.c
index a17fdb63dc3e..6a5b61ebc66c 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -64,7 +64,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
64 return e; 64 return e;
65} 65}
66 66
67static inline int init_kernel_text(unsigned long addr) 67int init_kernel_text(unsigned long addr)
68{ 68{
69 if (addr >= (unsigned long)_sinittext && 69 if (addr >= (unsigned long)_sinittext &&
70 addr < (unsigned long)_einittext) 70 addr < (unsigned long)_einittext)
diff --git a/kernel/fork.c b/kernel/fork.c
index be8aa5b98666..e5d9d405ae4e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -592,7 +592,7 @@ static void check_mm(struct mm_struct *mm)
592 * is dropped: either by a lazy thread or by 592 * is dropped: either by a lazy thread or by
593 * mmput. Free the page directory and the mm. 593 * mmput. Free the page directory and the mm.
594 */ 594 */
595static void __mmdrop(struct mm_struct *mm) 595void __mmdrop(struct mm_struct *mm)
596{ 596{
597 BUG_ON(mm == &init_mm); 597 BUG_ON(mm == &init_mm);
598 mm_free_pgd(mm); 598 mm_free_pgd(mm);
@@ -603,18 +603,7 @@ static void __mmdrop(struct mm_struct *mm)
603 put_user_ns(mm->user_ns); 603 put_user_ns(mm->user_ns);
604 free_mm(mm); 604 free_mm(mm);
605} 605}
606 606EXPORT_SYMBOL_GPL(__mmdrop);
607void mmdrop(struct mm_struct *mm)
608{
609 /*
610 * The implicit full barrier implied by atomic_dec_and_test() is
611 * required by the membarrier system call before returning to
612 * user-space, after storing to rq->curr.
613 */
614 if (unlikely(atomic_dec_and_test(&mm->mm_count)))
615 __mmdrop(mm);
616}
617EXPORT_SYMBOL_GPL(mmdrop);
618 607
619static void mmdrop_async_fn(struct work_struct *work) 608static void mmdrop_async_fn(struct work_struct *work)
620{ 609{
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index e6a9c36470ee..82b8b18ee1eb 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1726,25 +1726,14 @@ static int irq_domain_debug_show(struct seq_file *m, void *p)
1726 irq_domain_debug_show_one(m, d, 0); 1726 irq_domain_debug_show_one(m, d, 0);
1727 return 0; 1727 return 0;
1728} 1728}
1729 1729DEFINE_SHOW_ATTRIBUTE(irq_domain_debug);
1730static int irq_domain_debug_open(struct inode *inode, struct file *file)
1731{
1732 return single_open(file, irq_domain_debug_show, inode->i_private);
1733}
1734
1735static const struct file_operations dfs_domain_ops = {
1736 .open = irq_domain_debug_open,
1737 .read = seq_read,
1738 .llseek = seq_lseek,
1739 .release = single_release,
1740};
1741 1730
1742static void debugfs_add_domain_dir(struct irq_domain *d) 1731static void debugfs_add_domain_dir(struct irq_domain *d)
1743{ 1732{
1744 if (!d->name || !domain_dir || d->debugfs_file) 1733 if (!d->name || !domain_dir || d->debugfs_file)
1745 return; 1734 return;
1746 d->debugfs_file = debugfs_create_file(d->name, 0444, domain_dir, d, 1735 d->debugfs_file = debugfs_create_file(d->name, 0444, domain_dir, d,
1747 &dfs_domain_ops); 1736 &irq_domain_debug_fops);
1748} 1737}
1749 1738
1750static void debugfs_remove_domain_dir(struct irq_domain *d) 1739static void debugfs_remove_domain_dir(struct irq_domain *d)
@@ -1760,7 +1749,8 @@ void __init irq_domain_debugfs_init(struct dentry *root)
1760 if (!domain_dir) 1749 if (!domain_dir)
1761 return; 1750 return;
1762 1751
1763 debugfs_create_file("default", 0444, domain_dir, NULL, &dfs_domain_ops); 1752 debugfs_create_file("default", 0444, domain_dir, NULL,
1753 &irq_domain_debug_fops);
1764 mutex_lock(&irq_domain_mutex); 1754 mutex_lock(&irq_domain_mutex);
1765 list_for_each_entry(d, &irq_domain_list, link) 1755 list_for_each_entry(d, &irq_domain_list, link)
1766 debugfs_add_domain_dir(d); 1756 debugfs_add_domain_dir(d);
diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 5187dfe809ac..4c5770407031 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -16,6 +16,7 @@ struct cpumap {
16 unsigned int available; 16 unsigned int available;
17 unsigned int allocated; 17 unsigned int allocated;
18 unsigned int managed; 18 unsigned int managed;
19 bool initialized;
19 bool online; 20 bool online;
20 unsigned long alloc_map[IRQ_MATRIX_SIZE]; 21 unsigned long alloc_map[IRQ_MATRIX_SIZE];
21 unsigned long managed_map[IRQ_MATRIX_SIZE]; 22 unsigned long managed_map[IRQ_MATRIX_SIZE];
@@ -81,9 +82,11 @@ void irq_matrix_online(struct irq_matrix *m)
81 82
82 BUG_ON(cm->online); 83 BUG_ON(cm->online);
83 84
84 bitmap_zero(cm->alloc_map, m->matrix_bits); 85 if (!cm->initialized) {
85 cm->available = m->alloc_size - (cm->managed + m->systembits_inalloc); 86 cm->available = m->alloc_size;
86 cm->allocated = 0; 87 cm->available -= cm->managed + m->systembits_inalloc;
88 cm->initialized = true;
89 }
87 m->global_available += cm->available; 90 m->global_available += cm->available;
88 cm->online = true; 91 cm->online = true;
89 m->online_maps++; 92 m->online_maps++;
@@ -370,14 +373,16 @@ void irq_matrix_free(struct irq_matrix *m, unsigned int cpu,
370 if (WARN_ON_ONCE(bit < m->alloc_start || bit >= m->alloc_end)) 373 if (WARN_ON_ONCE(bit < m->alloc_start || bit >= m->alloc_end))
371 return; 374 return;
372 375
373 if (cm->online) { 376 clear_bit(bit, cm->alloc_map);
374 clear_bit(bit, cm->alloc_map); 377 cm->allocated--;
375 cm->allocated--; 378
379 if (cm->online)
376 m->total_allocated--; 380 m->total_allocated--;
377 if (!managed) { 381
378 cm->available++; 382 if (!managed) {
383 cm->available++;
384 if (cm->online)
379 m->global_available++; 385 m->global_available++;
380 }
381 } 386 }
382 trace_irq_matrix_free(bit, cpu, m, cm); 387 trace_irq_matrix_free(bit, cpu, m, cm);
383} 388}
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index b4517095db6a..52a0a7af8640 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -366,12 +366,15 @@ static void __jump_label_update(struct static_key *key,
366{ 366{
367 for (; (entry < stop) && (jump_entry_key(entry) == key); entry++) { 367 for (; (entry < stop) && (jump_entry_key(entry) == key); entry++) {
368 /* 368 /*
369 * entry->code set to 0 invalidates module init text sections 369 * An entry->code of 0 indicates an entry which has been
370 * kernel_text_address() verifies we are not in core kernel 370 * disabled because it was in an init text area.
371 * init code, see jump_label_invalidate_module_init().
372 */ 371 */
373 if (entry->code && kernel_text_address(entry->code)) 372 if (entry->code) {
374 arch_jump_label_transform(entry, jump_label_type(entry)); 373 if (kernel_text_address(entry->code))
374 arch_jump_label_transform(entry, jump_label_type(entry));
375 else
376 WARN_ONCE(1, "can't patch jump_label at %pS", (void *)entry->code);
377 }
375 } 378 }
376} 379}
377 380
@@ -417,6 +420,19 @@ void __init jump_label_init(void)
417 cpus_read_unlock(); 420 cpus_read_unlock();
418} 421}
419 422
423/* Disable any jump label entries in __init code */
424void __init jump_label_invalidate_init(void)
425{
426 struct jump_entry *iter_start = __start___jump_table;
427 struct jump_entry *iter_stop = __stop___jump_table;
428 struct jump_entry *iter;
429
430 for (iter = iter_start; iter < iter_stop; iter++) {
431 if (init_kernel_text(iter->code))
432 iter->code = 0;
433 }
434}
435
420#ifdef CONFIG_MODULES 436#ifdef CONFIG_MODULES
421 437
422static enum jump_label_type jump_label_init_type(struct jump_entry *entry) 438static enum jump_label_type jump_label_init_type(struct jump_entry *entry)
@@ -633,6 +649,7 @@ static void jump_label_del_module(struct module *mod)
633 } 649 }
634} 650}
635 651
652/* Disable any jump label entries in module init code */
636static void jump_label_invalidate_module_init(struct module *mod) 653static void jump_label_invalidate_module_init(struct module *mod)
637{ 654{
638 struct jump_entry *iter_start = mod->jump_entries; 655 struct jump_entry *iter_start = mod->jump_entries;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index da2ccf142358..102160ff5c66 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -978,67 +978,90 @@ static int prepare_kprobe(struct kprobe *p)
978} 978}
979 979
980/* Caller must lock kprobe_mutex */ 980/* Caller must lock kprobe_mutex */
981static void arm_kprobe_ftrace(struct kprobe *p) 981static int arm_kprobe_ftrace(struct kprobe *p)
982{ 982{
983 int ret; 983 int ret = 0;
984 984
985 ret = ftrace_set_filter_ip(&kprobe_ftrace_ops, 985 ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
986 (unsigned long)p->addr, 0, 0); 986 (unsigned long)p->addr, 0, 0);
987 WARN(ret < 0, "Failed to arm kprobe-ftrace at %p (%d)\n", p->addr, ret); 987 if (ret) {
988 kprobe_ftrace_enabled++; 988 pr_debug("Failed to arm kprobe-ftrace at %p (%d)\n", p->addr, ret);
989 if (kprobe_ftrace_enabled == 1) { 989 return ret;
990 }
991
992 if (kprobe_ftrace_enabled == 0) {
990 ret = register_ftrace_function(&kprobe_ftrace_ops); 993 ret = register_ftrace_function(&kprobe_ftrace_ops);
991 WARN(ret < 0, "Failed to init kprobe-ftrace (%d)\n", ret); 994 if (ret) {
995 pr_debug("Failed to init kprobe-ftrace (%d)\n", ret);
996 goto err_ftrace;
997 }
992 } 998 }
999
1000 kprobe_ftrace_enabled++;
1001 return ret;
1002
1003err_ftrace:
1004 /*
1005 * Note: Since kprobe_ftrace_ops has IPMODIFY set, and ftrace requires a
1006 * non-empty filter_hash for IPMODIFY ops, we're safe from an accidental
1007 * empty filter_hash which would undesirably trace all functions.
1008 */
1009 ftrace_set_filter_ip(&kprobe_ftrace_ops, (unsigned long)p->addr, 1, 0);
1010 return ret;
993} 1011}
994 1012
995/* Caller must lock kprobe_mutex */ 1013/* Caller must lock kprobe_mutex */
996static void disarm_kprobe_ftrace(struct kprobe *p) 1014static int disarm_kprobe_ftrace(struct kprobe *p)
997{ 1015{
998 int ret; 1016 int ret = 0;
999 1017
1000 kprobe_ftrace_enabled--; 1018 if (kprobe_ftrace_enabled == 1) {
1001 if (kprobe_ftrace_enabled == 0) {
1002 ret = unregister_ftrace_function(&kprobe_ftrace_ops); 1019 ret = unregister_ftrace_function(&kprobe_ftrace_ops);
1003 WARN(ret < 0, "Failed to init kprobe-ftrace (%d)\n", ret); 1020 if (WARN(ret < 0, "Failed to unregister kprobe-ftrace (%d)\n", ret))
1021 return ret;
1004 } 1022 }
1023
1024 kprobe_ftrace_enabled--;
1025
1005 ret = ftrace_set_filter_ip(&kprobe_ftrace_ops, 1026 ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
1006 (unsigned long)p->addr, 1, 0); 1027 (unsigned long)p->addr, 1, 0);
1007 WARN(ret < 0, "Failed to disarm kprobe-ftrace at %p (%d)\n", p->addr, ret); 1028 WARN(ret < 0, "Failed to disarm kprobe-ftrace at %p (%d)\n", p->addr, ret);
1029 return ret;
1008} 1030}
1009#else /* !CONFIG_KPROBES_ON_FTRACE */ 1031#else /* !CONFIG_KPROBES_ON_FTRACE */
1010#define prepare_kprobe(p) arch_prepare_kprobe(p) 1032#define prepare_kprobe(p) arch_prepare_kprobe(p)
1011#define arm_kprobe_ftrace(p) do {} while (0) 1033#define arm_kprobe_ftrace(p) (-ENODEV)
1012#define disarm_kprobe_ftrace(p) do {} while (0) 1034#define disarm_kprobe_ftrace(p) (-ENODEV)
1013#endif 1035#endif
1014 1036
1015/* Arm a kprobe with text_mutex */ 1037/* Arm a kprobe with text_mutex */
1016static void arm_kprobe(struct kprobe *kp) 1038static int arm_kprobe(struct kprobe *kp)
1017{ 1039{
1018 if (unlikely(kprobe_ftrace(kp))) { 1040 if (unlikely(kprobe_ftrace(kp)))
1019 arm_kprobe_ftrace(kp); 1041 return arm_kprobe_ftrace(kp);
1020 return; 1042
1021 }
1022 cpus_read_lock(); 1043 cpus_read_lock();
1023 mutex_lock(&text_mutex); 1044 mutex_lock(&text_mutex);
1024 __arm_kprobe(kp); 1045 __arm_kprobe(kp);
1025 mutex_unlock(&text_mutex); 1046 mutex_unlock(&text_mutex);
1026 cpus_read_unlock(); 1047 cpus_read_unlock();
1048
1049 return 0;
1027} 1050}
1028 1051
1029/* Disarm a kprobe with text_mutex */ 1052/* Disarm a kprobe with text_mutex */
1030static void disarm_kprobe(struct kprobe *kp, bool reopt) 1053static int disarm_kprobe(struct kprobe *kp, bool reopt)
1031{ 1054{
1032 if (unlikely(kprobe_ftrace(kp))) { 1055 if (unlikely(kprobe_ftrace(kp)))
1033 disarm_kprobe_ftrace(kp); 1056 return disarm_kprobe_ftrace(kp);
1034 return;
1035 }
1036 1057
1037 cpus_read_lock(); 1058 cpus_read_lock();
1038 mutex_lock(&text_mutex); 1059 mutex_lock(&text_mutex);
1039 __disarm_kprobe(kp, reopt); 1060 __disarm_kprobe(kp, reopt);
1040 mutex_unlock(&text_mutex); 1061 mutex_unlock(&text_mutex);
1041 cpus_read_unlock(); 1062 cpus_read_unlock();
1063
1064 return 0;
1042} 1065}
1043 1066
1044/* 1067/*
@@ -1362,9 +1385,15 @@ out:
1362 1385
1363 if (ret == 0 && kprobe_disabled(ap) && !kprobe_disabled(p)) { 1386 if (ret == 0 && kprobe_disabled(ap) && !kprobe_disabled(p)) {
1364 ap->flags &= ~KPROBE_FLAG_DISABLED; 1387 ap->flags &= ~KPROBE_FLAG_DISABLED;
1365 if (!kprobes_all_disarmed) 1388 if (!kprobes_all_disarmed) {
1366 /* Arm the breakpoint again. */ 1389 /* Arm the breakpoint again. */
1367 arm_kprobe(ap); 1390 ret = arm_kprobe(ap);
1391 if (ret) {
1392 ap->flags |= KPROBE_FLAG_DISABLED;
1393 list_del_rcu(&p->list);
1394 synchronize_sched();
1395 }
1396 }
1368 } 1397 }
1369 return ret; 1398 return ret;
1370} 1399}
@@ -1573,8 +1602,14 @@ int register_kprobe(struct kprobe *p)
1573 hlist_add_head_rcu(&p->hlist, 1602 hlist_add_head_rcu(&p->hlist,
1574 &kprobe_table[hash_ptr(p->addr, KPROBE_HASH_BITS)]); 1603 &kprobe_table[hash_ptr(p->addr, KPROBE_HASH_BITS)]);
1575 1604
1576 if (!kprobes_all_disarmed && !kprobe_disabled(p)) 1605 if (!kprobes_all_disarmed && !kprobe_disabled(p)) {
1577 arm_kprobe(p); 1606 ret = arm_kprobe(p);
1607 if (ret) {
1608 hlist_del_rcu(&p->hlist);
1609 synchronize_sched();
1610 goto out;
1611 }
1612 }
1578 1613
1579 /* Try to optimize kprobe */ 1614 /* Try to optimize kprobe */
1580 try_to_optimize_kprobe(p); 1615 try_to_optimize_kprobe(p);
@@ -1608,11 +1643,12 @@ static int aggr_kprobe_disabled(struct kprobe *ap)
1608static struct kprobe *__disable_kprobe(struct kprobe *p) 1643static struct kprobe *__disable_kprobe(struct kprobe *p)
1609{ 1644{
1610 struct kprobe *orig_p; 1645 struct kprobe *orig_p;
1646 int ret;
1611 1647
1612 /* Get an original kprobe for return */ 1648 /* Get an original kprobe for return */
1613 orig_p = __get_valid_kprobe(p); 1649 orig_p = __get_valid_kprobe(p);
1614 if (unlikely(orig_p == NULL)) 1650 if (unlikely(orig_p == NULL))
1615 return NULL; 1651 return ERR_PTR(-EINVAL);
1616 1652
1617 if (!kprobe_disabled(p)) { 1653 if (!kprobe_disabled(p)) {
1618 /* Disable probe if it is a child probe */ 1654 /* Disable probe if it is a child probe */
@@ -1626,8 +1662,13 @@ static struct kprobe *__disable_kprobe(struct kprobe *p)
1626 * should have already been disarmed, so 1662 * should have already been disarmed, so
1627 * skip unneed disarming process. 1663 * skip unneed disarming process.
1628 */ 1664 */
1629 if (!kprobes_all_disarmed) 1665 if (!kprobes_all_disarmed) {
1630 disarm_kprobe(orig_p, true); 1666 ret = disarm_kprobe(orig_p, true);
1667 if (ret) {
1668 p->flags &= ~KPROBE_FLAG_DISABLED;
1669 return ERR_PTR(ret);
1670 }
1671 }
1631 orig_p->flags |= KPROBE_FLAG_DISABLED; 1672 orig_p->flags |= KPROBE_FLAG_DISABLED;
1632 } 1673 }
1633 } 1674 }
@@ -1644,8 +1685,8 @@ static int __unregister_kprobe_top(struct kprobe *p)
1644 1685
1645 /* Disable kprobe. This will disarm it if needed. */ 1686 /* Disable kprobe. This will disarm it if needed. */
1646 ap = __disable_kprobe(p); 1687 ap = __disable_kprobe(p);
1647 if (ap == NULL) 1688 if (IS_ERR(ap))
1648 return -EINVAL; 1689 return PTR_ERR(ap);
1649 1690
1650 if (ap == p) 1691 if (ap == p)
1651 /* 1692 /*
@@ -2078,12 +2119,14 @@ static void kill_kprobe(struct kprobe *p)
2078int disable_kprobe(struct kprobe *kp) 2119int disable_kprobe(struct kprobe *kp)
2079{ 2120{
2080 int ret = 0; 2121 int ret = 0;
2122 struct kprobe *p;
2081 2123
2082 mutex_lock(&kprobe_mutex); 2124 mutex_lock(&kprobe_mutex);
2083 2125
2084 /* Disable this kprobe */ 2126 /* Disable this kprobe */
2085 if (__disable_kprobe(kp) == NULL) 2127 p = __disable_kprobe(kp);
2086 ret = -EINVAL; 2128 if (IS_ERR(p))
2129 ret = PTR_ERR(p);
2087 2130
2088 mutex_unlock(&kprobe_mutex); 2131 mutex_unlock(&kprobe_mutex);
2089 return ret; 2132 return ret;
@@ -2116,7 +2159,9 @@ int enable_kprobe(struct kprobe *kp)
2116 2159
2117 if (!kprobes_all_disarmed && kprobe_disabled(p)) { 2160 if (!kprobes_all_disarmed && kprobe_disabled(p)) {
2118 p->flags &= ~KPROBE_FLAG_DISABLED; 2161 p->flags &= ~KPROBE_FLAG_DISABLED;
2119 arm_kprobe(p); 2162 ret = arm_kprobe(p);
2163 if (ret)
2164 p->flags |= KPROBE_FLAG_DISABLED;
2120 } 2165 }
2121out: 2166out:
2122 mutex_unlock(&kprobe_mutex); 2167 mutex_unlock(&kprobe_mutex);
@@ -2407,11 +2452,12 @@ static const struct file_operations debugfs_kprobe_blacklist_ops = {
2407 .release = seq_release, 2452 .release = seq_release,
2408}; 2453};
2409 2454
2410static void arm_all_kprobes(void) 2455static int arm_all_kprobes(void)
2411{ 2456{
2412 struct hlist_head *head; 2457 struct hlist_head *head;
2413 struct kprobe *p; 2458 struct kprobe *p;
2414 unsigned int i; 2459 unsigned int i, total = 0, errors = 0;
2460 int err, ret = 0;
2415 2461
2416 mutex_lock(&kprobe_mutex); 2462 mutex_lock(&kprobe_mutex);
2417 2463
@@ -2428,46 +2474,74 @@ static void arm_all_kprobes(void)
2428 /* Arming kprobes doesn't optimize kprobe itself */ 2474 /* Arming kprobes doesn't optimize kprobe itself */
2429 for (i = 0; i < KPROBE_TABLE_SIZE; i++) { 2475 for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
2430 head = &kprobe_table[i]; 2476 head = &kprobe_table[i];
2431 hlist_for_each_entry_rcu(p, head, hlist) 2477 /* Arm all kprobes on a best-effort basis */
2432 if (!kprobe_disabled(p)) 2478 hlist_for_each_entry_rcu(p, head, hlist) {
2433 arm_kprobe(p); 2479 if (!kprobe_disabled(p)) {
2480 err = arm_kprobe(p);
2481 if (err) {
2482 errors++;
2483 ret = err;
2484 }
2485 total++;
2486 }
2487 }
2434 } 2488 }
2435 2489
2436 printk(KERN_INFO "Kprobes globally enabled\n"); 2490 if (errors)
2491 pr_warn("Kprobes globally enabled, but failed to arm %d out of %d probes\n",
2492 errors, total);
2493 else
2494 pr_info("Kprobes globally enabled\n");
2437 2495
2438already_enabled: 2496already_enabled:
2439 mutex_unlock(&kprobe_mutex); 2497 mutex_unlock(&kprobe_mutex);
2440 return; 2498 return ret;
2441} 2499}
2442 2500
2443static void disarm_all_kprobes(void) 2501static int disarm_all_kprobes(void)
2444{ 2502{
2445 struct hlist_head *head; 2503 struct hlist_head *head;
2446 struct kprobe *p; 2504 struct kprobe *p;
2447 unsigned int i; 2505 unsigned int i, total = 0, errors = 0;
2506 int err, ret = 0;
2448 2507
2449 mutex_lock(&kprobe_mutex); 2508 mutex_lock(&kprobe_mutex);
2450 2509
2451 /* If kprobes are already disarmed, just return */ 2510 /* If kprobes are already disarmed, just return */
2452 if (kprobes_all_disarmed) { 2511 if (kprobes_all_disarmed) {
2453 mutex_unlock(&kprobe_mutex); 2512 mutex_unlock(&kprobe_mutex);
2454 return; 2513 return 0;
2455 } 2514 }
2456 2515
2457 kprobes_all_disarmed = true; 2516 kprobes_all_disarmed = true;
2458 printk(KERN_INFO "Kprobes globally disabled\n");
2459 2517
2460 for (i = 0; i < KPROBE_TABLE_SIZE; i++) { 2518 for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
2461 head = &kprobe_table[i]; 2519 head = &kprobe_table[i];
2520 /* Disarm all kprobes on a best-effort basis */
2462 hlist_for_each_entry_rcu(p, head, hlist) { 2521 hlist_for_each_entry_rcu(p, head, hlist) {
2463 if (!arch_trampoline_kprobe(p) && !kprobe_disabled(p)) 2522 if (!arch_trampoline_kprobe(p) && !kprobe_disabled(p)) {
2464 disarm_kprobe(p, false); 2523 err = disarm_kprobe(p, false);
2524 if (err) {
2525 errors++;
2526 ret = err;
2527 }
2528 total++;
2529 }
2465 } 2530 }
2466 } 2531 }
2532
2533 if (errors)
2534 pr_warn("Kprobes globally disabled, but failed to disarm %d out of %d probes\n",
2535 errors, total);
2536 else
2537 pr_info("Kprobes globally disabled\n");
2538
2467 mutex_unlock(&kprobe_mutex); 2539 mutex_unlock(&kprobe_mutex);
2468 2540
2469 /* Wait for disarming all kprobes by optimizer */ 2541 /* Wait for disarming all kprobes by optimizer */
2470 wait_for_kprobe_optimizer(); 2542 wait_for_kprobe_optimizer();
2543
2544 return ret;
2471} 2545}
2472 2546
2473/* 2547/*
@@ -2494,6 +2568,7 @@ static ssize_t write_enabled_file_bool(struct file *file,
2494{ 2568{
2495 char buf[32]; 2569 char buf[32];
2496 size_t buf_size; 2570 size_t buf_size;
2571 int ret = 0;
2497 2572
2498 buf_size = min(count, (sizeof(buf)-1)); 2573 buf_size = min(count, (sizeof(buf)-1));
2499 if (copy_from_user(buf, user_buf, buf_size)) 2574 if (copy_from_user(buf, user_buf, buf_size))
@@ -2504,17 +2579,20 @@ static ssize_t write_enabled_file_bool(struct file *file,
2504 case 'y': 2579 case 'y':
2505 case 'Y': 2580 case 'Y':
2506 case '1': 2581 case '1':
2507 arm_all_kprobes(); 2582 ret = arm_all_kprobes();
2508 break; 2583 break;
2509 case 'n': 2584 case 'n':
2510 case 'N': 2585 case 'N':
2511 case '0': 2586 case '0':
2512 disarm_all_kprobes(); 2587 ret = disarm_all_kprobes();
2513 break; 2588 break;
2514 default: 2589 default:
2515 return -EINVAL; 2590 return -EINVAL;
2516 } 2591 }
2517 2592
2593 if (ret)
2594 return ret;
2595
2518 return count; 2596 return count;
2519} 2597}
2520 2598
diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c
index 38ece035039e..d880296245c5 100644
--- a/kernel/locking/qspinlock.c
+++ b/kernel/locking/qspinlock.c
@@ -379,6 +379,14 @@ queue:
379 tail = encode_tail(smp_processor_id(), idx); 379 tail = encode_tail(smp_processor_id(), idx);
380 380
381 node += idx; 381 node += idx;
382
383 /*
384 * Ensure that we increment the head node->count before initialising
385 * the actual node. If the compiler is kind enough to reorder these
386 * stores, then an IRQ could overwrite our assignments.
387 */
388 barrier();
389
382 node->locked = 0; 390 node->locked = 0;
383 node->next = NULL; 391 node->next = NULL;
384 pv_init_node(node); 392 pv_init_node(node);
@@ -408,14 +416,15 @@ queue:
408 */ 416 */
409 if (old & _Q_TAIL_MASK) { 417 if (old & _Q_TAIL_MASK) {
410 prev = decode_tail(old); 418 prev = decode_tail(old);
419
411 /* 420 /*
412 * The above xchg_tail() is also a load of @lock which 421 * We must ensure that the stores to @node are observed before
413 * generates, through decode_tail(), a pointer. The address 422 * the write to prev->next. The address dependency from
414 * dependency matches the RELEASE of xchg_tail() such that 423 * xchg_tail is not sufficient to ensure this because the read
415 * the subsequent access to @prev happens after. 424 * component of xchg_tail is unordered with respect to the
425 * initialisation of @node.
416 */ 426 */
417 427 smp_store_release(&prev->next, node);
418 WRITE_ONCE(prev->next, node);
419 428
420 pv_wait_node(node, prev); 429 pv_wait_node(node, prev);
421 arch_mcs_spin_lock_contended(&node->locked); 430 arch_mcs_spin_lock_contended(&node->locked);
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 4849be5f9b3c..4dd4274cabe2 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -275,8 +275,15 @@ static unsigned long pfn_end(struct dev_pagemap *pgmap)
275 return (res->start + resource_size(res)) >> PAGE_SHIFT; 275 return (res->start + resource_size(res)) >> PAGE_SHIFT;
276} 276}
277 277
278static unsigned long pfn_next(unsigned long pfn)
279{
280 if (pfn % 1024 == 0)
281 cond_resched();
282 return pfn + 1;
283}
284
278#define for_each_device_pfn(pfn, map) \ 285#define for_each_device_pfn(pfn, map) \
279 for (pfn = pfn_first(map); pfn < pfn_end(map); pfn++) 286 for (pfn = pfn_first(map); pfn < pfn_end(map); pfn = pfn_next(pfn))
280 287
281static void devm_memremap_pages_release(void *data) 288static void devm_memremap_pages_release(void *data)
282{ 289{
@@ -337,10 +344,10 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
337 resource_size_t align_start, align_size, align_end; 344 resource_size_t align_start, align_size, align_end;
338 struct vmem_altmap *altmap = pgmap->altmap_valid ? 345 struct vmem_altmap *altmap = pgmap->altmap_valid ?
339 &pgmap->altmap : NULL; 346 &pgmap->altmap : NULL;
347 struct resource *res = &pgmap->res;
340 unsigned long pfn, pgoff, order; 348 unsigned long pfn, pgoff, order;
341 pgprot_t pgprot = PAGE_KERNEL; 349 pgprot_t pgprot = PAGE_KERNEL;
342 int error, nid, is_ram, i = 0; 350 int error, nid, is_ram;
343 struct resource *res = &pgmap->res;
344 351
345 align_start = res->start & ~(SECTION_SIZE - 1); 352 align_start = res->start & ~(SECTION_SIZE - 1);
346 align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE) 353 align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE)
@@ -409,8 +416,6 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
409 list_del(&page->lru); 416 list_del(&page->lru);
410 page->pgmap = pgmap; 417 page->pgmap = pgmap;
411 percpu_ref_get(pgmap->ref); 418 percpu_ref_get(pgmap->ref);
412 if (!(++i % 1024))
413 cond_resched();
414 } 419 }
415 420
416 devm_add_action(dev, devm_memremap_pages_release, pgmap); 421 devm_add_action(dev, devm_memremap_pages_release, pgmap);
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc1123583fa6..f274fbef821d 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2397,7 +2397,7 @@ skip:
2397 2397
2398 if (console_lock_spinning_disable_and_check()) { 2398 if (console_lock_spinning_disable_and_check()) {
2399 printk_safe_exit_irqrestore(flags); 2399 printk_safe_exit_irqrestore(flags);
2400 return; 2400 goto out;
2401 } 2401 }
2402 2402
2403 printk_safe_exit_irqrestore(flags); 2403 printk_safe_exit_irqrestore(flags);
@@ -2430,6 +2430,7 @@ skip:
2430 if (retry && console_trylock()) 2430 if (retry && console_trylock())
2431 goto again; 2431 goto again;
2432 2432
2433out:
2433 if (wake_klogd) 2434 if (wake_klogd)
2434 wake_up_klogd(); 2435 wake_up_klogd();
2435} 2436}
diff --git a/kernel/relay.c b/kernel/relay.c
index c3029402f15c..c955b10c973c 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -163,7 +163,7 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan)
163{ 163{
164 struct rchan_buf *buf; 164 struct rchan_buf *buf;
165 165
166 if (chan->n_subbufs > UINT_MAX / sizeof(size_t *)) 166 if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t *))
167 return NULL; 167 return NULL;
168 168
169 buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL); 169 buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index bf724c1952ea..e7c535eee0a6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2601,19 +2601,31 @@ static inline void finish_task(struct task_struct *prev)
2601#endif 2601#endif
2602} 2602}
2603 2603
2604static inline void finish_lock_switch(struct rq *rq) 2604static inline void
2605prepare_lock_switch(struct rq *rq, struct task_struct *next, struct rq_flags *rf)
2605{ 2606{
2607 /*
2608 * Since the runqueue lock will be released by the next
2609 * task (which is an invalid locking op but in the case
2610 * of the scheduler it's an obvious special-case), so we
2611 * do an early lockdep release here:
2612 */
2613 rq_unpin_lock(rq, rf);
2614 spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
2606#ifdef CONFIG_DEBUG_SPINLOCK 2615#ifdef CONFIG_DEBUG_SPINLOCK
2607 /* this is a valid case when another task releases the spinlock */ 2616 /* this is a valid case when another task releases the spinlock */
2608 rq->lock.owner = current; 2617 rq->lock.owner = next;
2609#endif 2618#endif
2619}
2620
2621static inline void finish_lock_switch(struct rq *rq)
2622{
2610 /* 2623 /*
2611 * If we are tracking spinlock dependencies then we have to 2624 * If we are tracking spinlock dependencies then we have to
2612 * fix up the runqueue lock - which gets 'carried over' from 2625 * fix up the runqueue lock - which gets 'carried over' from
2613 * prev into current: 2626 * prev into current:
2614 */ 2627 */
2615 spin_acquire(&rq->lock.dep_map, 0, 0, _THIS_IP_); 2628 spin_acquire(&rq->lock.dep_map, 0, 0, _THIS_IP_);
2616
2617 raw_spin_unlock_irq(&rq->lock); 2629 raw_spin_unlock_irq(&rq->lock);
2618} 2630}
2619 2631
@@ -2844,14 +2856,7 @@ context_switch(struct rq *rq, struct task_struct *prev,
2844 2856
2845 rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP); 2857 rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP);
2846 2858
2847 /* 2859 prepare_lock_switch(rq, next, rf);
2848 * Since the runqueue lock will be released by the next
2849 * task (which is an invalid locking op but in the case
2850 * of the scheduler it's an obvious special-case), so we
2851 * do an early lockdep release here:
2852 */
2853 rq_unpin_lock(rq, rf);
2854 spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
2855 2860
2856 /* Here we just switch the register state and the stack. */ 2861 /* Here we just switch the register state and the stack. */
2857 switch_to(prev, next, prev); 2862 switch_to(prev, next, prev);
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index dd062a1c8cf0..7936f548e071 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -19,8 +19,6 @@
19 19
20#include "sched.h" 20#include "sched.h"
21 21
22#define SUGOV_KTHREAD_PRIORITY 50
23
24struct sugov_tunables { 22struct sugov_tunables {
25 struct gov_attr_set attr_set; 23 struct gov_attr_set attr_set;
26 unsigned int rate_limit_us; 24 unsigned int rate_limit_us;
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 9bb0e0c412ec..9df09782025c 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1153,6 +1153,7 @@ static void update_curr_dl(struct rq *rq)
1153 struct sched_dl_entity *dl_se = &curr->dl; 1153 struct sched_dl_entity *dl_se = &curr->dl;
1154 u64 delta_exec, scaled_delta_exec; 1154 u64 delta_exec, scaled_delta_exec;
1155 int cpu = cpu_of(rq); 1155 int cpu = cpu_of(rq);
1156 u64 now;
1156 1157
1157 if (!dl_task(curr) || !on_dl_rq(dl_se)) 1158 if (!dl_task(curr) || !on_dl_rq(dl_se))
1158 return; 1159 return;
@@ -1165,7 +1166,8 @@ static void update_curr_dl(struct rq *rq)
1165 * natural solution, but the full ramifications of this 1166 * natural solution, but the full ramifications of this
1166 * approach need further study. 1167 * approach need further study.
1167 */ 1168 */
1168 delta_exec = rq_clock_task(rq) - curr->se.exec_start; 1169 now = rq_clock_task(rq);
1170 delta_exec = now - curr->se.exec_start;
1169 if (unlikely((s64)delta_exec <= 0)) { 1171 if (unlikely((s64)delta_exec <= 0)) {
1170 if (unlikely(dl_se->dl_yielded)) 1172 if (unlikely(dl_se->dl_yielded))
1171 goto throttle; 1173 goto throttle;
@@ -1178,7 +1180,7 @@ static void update_curr_dl(struct rq *rq)
1178 curr->se.sum_exec_runtime += delta_exec; 1180 curr->se.sum_exec_runtime += delta_exec;
1179 account_group_exec_runtime(curr, delta_exec); 1181 account_group_exec_runtime(curr, delta_exec);
1180 1182
1181 curr->se.exec_start = rq_clock_task(rq); 1183 curr->se.exec_start = now;
1182 cgroup_account_cputime(curr, delta_exec); 1184 cgroup_account_cputime(curr, delta_exec);
1183 1185
1184 sched_rt_avg_update(rq, delta_exec); 1186 sched_rt_avg_update(rq, delta_exec);
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 663b2355a3aa..aad49451584e 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -950,12 +950,13 @@ static void update_curr_rt(struct rq *rq)
950{ 950{
951 struct task_struct *curr = rq->curr; 951 struct task_struct *curr = rq->curr;
952 struct sched_rt_entity *rt_se = &curr->rt; 952 struct sched_rt_entity *rt_se = &curr->rt;
953 u64 now = rq_clock_task(rq);
954 u64 delta_exec; 953 u64 delta_exec;
954 u64 now;
955 955
956 if (curr->sched_class != &rt_sched_class) 956 if (curr->sched_class != &rt_sched_class)
957 return; 957 return;
958 958
959 now = rq_clock_task(rq);
959 delta_exec = now - curr->se.exec_start; 960 delta_exec = now - curr->se.exec_start;
960 if (unlikely((s64)delta_exec <= 0)) 961 if (unlikely((s64)delta_exec <= 0))
961 return; 962 return;
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 940fa408a288..dc77548167ef 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -1076,14 +1076,16 @@ long seccomp_get_metadata(struct task_struct *task,
1076 1076
1077 size = min_t(unsigned long, size, sizeof(kmd)); 1077 size = min_t(unsigned long, size, sizeof(kmd));
1078 1078
1079 if (copy_from_user(&kmd, data, size)) 1079 if (size < sizeof(kmd.filter_off))
1080 return -EINVAL;
1081
1082 if (copy_from_user(&kmd.filter_off, data, sizeof(kmd.filter_off)))
1080 return -EFAULT; 1083 return -EFAULT;
1081 1084
1082 filter = get_nth_filter(task, kmd.filter_off); 1085 filter = get_nth_filter(task, kmd.filter_off);
1083 if (IS_ERR(filter)) 1086 if (IS_ERR(filter))
1084 return PTR_ERR(filter); 1087 return PTR_ERR(filter);
1085 1088
1086 memset(&kmd, 0, sizeof(kmd));
1087 if (filter->log) 1089 if (filter->log)
1088 kmd.flags |= SECCOMP_FILTER_FLAG_LOG; 1090 kmd.flags |= SECCOMP_FILTER_FLAG_LOG;
1089 1091
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 48150ab42de9..4a4fd567fb26 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1894,6 +1894,12 @@ int timers_dead_cpu(unsigned int cpu)
1894 raw_spin_lock_irq(&new_base->lock); 1894 raw_spin_lock_irq(&new_base->lock);
1895 raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); 1895 raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
1896 1896
1897 /*
1898 * The current CPUs base clock might be stale. Update it
1899 * before moving the timers over.
1900 */
1901 forward_timer_base(new_base);
1902
1897 BUG_ON(old_base->running_timer); 1903 BUG_ON(old_base->running_timer);
1898 1904
1899 for (i = 0; i < WHEEL_SIZE; i++) 1905 for (i = 0; i < WHEEL_SIZE; i++)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index fc2838ac8b78..c0a9e310d715 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -872,6 +872,8 @@ int perf_event_query_prog_array(struct perf_event *event, void __user *info)
872 return -EINVAL; 872 return -EINVAL;
873 if (copy_from_user(&query, uquery, sizeof(query))) 873 if (copy_from_user(&query, uquery, sizeof(query)))
874 return -EFAULT; 874 return -EFAULT;
875 if (query.ids_len > BPF_TRACE_MAX_PROGS)
876 return -E2BIG;
875 877
876 mutex_lock(&bpf_event_mutex); 878 mutex_lock(&bpf_event_mutex);
877 ret = bpf_prog_array_copy_info(event->tp_event->prog_array, 879 ret = bpf_prog_array_copy_info(event->tp_event->prog_array,
diff --git a/kernel/user.c b/kernel/user.c
index 9a20acce460d..36288d840675 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -101,6 +101,7 @@ struct user_struct root_user = {
101 .sigpending = ATOMIC_INIT(0), 101 .sigpending = ATOMIC_INIT(0),
102 .locked_shm = 0, 102 .locked_shm = 0,
103 .uid = GLOBAL_ROOT_UID, 103 .uid = GLOBAL_ROOT_UID,
104 .ratelimit = RATELIMIT_STATE_INIT(root_user.ratelimit, 0, 0),
104}; 105};
105 106
106/* 107/*
@@ -191,6 +192,8 @@ struct user_struct *alloc_uid(kuid_t uid)
191 192
192 new->uid = uid; 193 new->uid = uid;
193 atomic_set(&new->__count, 1); 194 atomic_set(&new->__count, 1);
195 ratelimit_state_init(&new->ratelimit, HZ, 100);
196 ratelimit_set_flags(&new->ratelimit, RATELIMIT_MSG_ON_RELEASE);
194 197
195 /* 198 /*
196 * Before adding this, check whether we raced 199 * Before adding this, check whether we raced
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 017044c26233..bb9a519cbf50 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4180,6 +4180,22 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
4180EXPORT_SYMBOL_GPL(workqueue_set_max_active); 4180EXPORT_SYMBOL_GPL(workqueue_set_max_active);
4181 4181
4182/** 4182/**
4183 * current_work - retrieve %current task's work struct
4184 *
4185 * Determine if %current task is a workqueue worker and what it's working on.
4186 * Useful to find out the context that the %current task is running in.
4187 *
4188 * Return: work struct if %current task is a workqueue worker, %NULL otherwise.
4189 */
4190struct work_struct *current_work(void)
4191{
4192 struct worker *worker = current_wq_worker();
4193
4194 return worker ? worker->current_work : NULL;
4195}
4196EXPORT_SYMBOL(current_work);
4197
4198/**
4183 * current_is_workqueue_rescuer - is %current workqueue rescuer? 4199 * current_is_workqueue_rescuer - is %current workqueue rescuer?
4184 * 4200 *
4185 * Determine whether %current is a workqueue rescuer. Can be used from 4201 * Determine whether %current is a workqueue rescuer. Can be used from
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 6088408ef26c..64155e310a9f 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1642,6 +1642,7 @@ config DMA_API_DEBUG
1642 1642
1643menuconfig RUNTIME_TESTING_MENU 1643menuconfig RUNTIME_TESTING_MENU
1644 bool "Runtime Testing" 1644 bool "Runtime Testing"
1645 def_bool y
1645 1646
1646if RUNTIME_TESTING_MENU 1647if RUNTIME_TESTING_MENU
1647 1648
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 1b34d210452c..7f5cdc1e6b29 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -1491,12 +1491,12 @@ void debug_dma_alloc_coherent(struct device *dev, size_t size,
1491 if (unlikely(virt == NULL)) 1491 if (unlikely(virt == NULL))
1492 return; 1492 return;
1493 1493
1494 entry = dma_entry_alloc(); 1494 /* handle vmalloc and linear addresses */
1495 if (!entry) 1495 if (!is_vmalloc_addr(virt) && !virt_addr_valid(virt))
1496 return; 1496 return;
1497 1497
1498 /* handle vmalloc and linear addresses */ 1498 entry = dma_entry_alloc();
1499 if (!is_vmalloc_addr(virt) && !virt_to_page(virt)) 1499 if (!entry)
1500 return; 1500 return;
1501 1501
1502 entry->type = dma_debug_coherent; 1502 entry->type = dma_debug_coherent;
@@ -1528,7 +1528,7 @@ void debug_dma_free_coherent(struct device *dev, size_t size,
1528 }; 1528 };
1529 1529
1530 /* handle vmalloc and linear addresses */ 1530 /* handle vmalloc and linear addresses */
1531 if (!is_vmalloc_addr(virt) && !virt_to_page(virt)) 1531 if (!is_vmalloc_addr(virt) && !virt_addr_valid(virt))
1532 return; 1532 return;
1533 1533
1534 if (is_vmalloc_addr(virt)) 1534 if (is_vmalloc_addr(virt))
diff --git a/lib/dma-direct.c b/lib/dma-direct.c
index 40b1f92f2214..c9e8e21cb334 100644
--- a/lib/dma-direct.c
+++ b/lib/dma-direct.c
@@ -84,6 +84,10 @@ again:
84 return page_address(page); 84 return page_address(page);
85} 85}
86 86
87/*
88 * NOTE: this function must never look at the dma_addr argument, because we want
89 * to be able to use it as a helper for iommu implementations as well.
90 */
87void dma_direct_free(struct device *dev, size_t size, void *cpu_addr, 91void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
88 dma_addr_t dma_addr, unsigned long attrs) 92 dma_addr_t dma_addr, unsigned long attrs)
89{ 93{
@@ -152,5 +156,6 @@ const struct dma_map_ops dma_direct_ops = {
152 .map_sg = dma_direct_map_sg, 156 .map_sg = dma_direct_map_sg,
153 .dma_supported = dma_direct_supported, 157 .dma_supported = dma_direct_supported,
154 .mapping_error = dma_direct_mapping_error, 158 .mapping_error = dma_direct_mapping_error,
159 .is_phys = 1,
155}; 160};
156EXPORT_SYMBOL(dma_direct_ops); 161EXPORT_SYMBOL(dma_direct_ops);
diff --git a/lib/idr.c b/lib/idr.c
index c98d77fcf393..823b813f08f8 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -36,8 +36,8 @@ int idr_alloc_u32(struct idr *idr, void *ptr, u32 *nextid,
36{ 36{
37 struct radix_tree_iter iter; 37 struct radix_tree_iter iter;
38 void __rcu **slot; 38 void __rcu **slot;
39 int base = idr->idr_base; 39 unsigned int base = idr->idr_base;
40 int id = *nextid; 40 unsigned int id = *nextid;
41 41
42 if (WARN_ON_ONCE(radix_tree_is_internal_node(ptr))) 42 if (WARN_ON_ONCE(radix_tree_is_internal_node(ptr)))
43 return -EINVAL; 43 return -EINVAL;
@@ -204,10 +204,11 @@ int idr_for_each(const struct idr *idr,
204 204
205 radix_tree_for_each_slot(slot, &idr->idr_rt, &iter, 0) { 205 radix_tree_for_each_slot(slot, &idr->idr_rt, &iter, 0) {
206 int ret; 206 int ret;
207 unsigned long id = iter.index + base;
207 208
208 if (WARN_ON_ONCE(iter.index > INT_MAX)) 209 if (WARN_ON_ONCE(id > INT_MAX))
209 break; 210 break;
210 ret = fn(iter.index + base, rcu_dereference_raw(*slot), data); 211 ret = fn(id, rcu_dereference_raw(*slot), data);
211 if (ret) 212 if (ret)
212 return ret; 213 return ret;
213 } 214 }
@@ -230,8 +231,8 @@ void *idr_get_next(struct idr *idr, int *nextid)
230{ 231{
231 struct radix_tree_iter iter; 232 struct radix_tree_iter iter;
232 void __rcu **slot; 233 void __rcu **slot;
233 int base = idr->idr_base; 234 unsigned long base = idr->idr_base;
234 int id = *nextid; 235 unsigned long id = *nextid;
235 236
236 id = (id < base) ? 0 : id - base; 237 id = (id < base) ? 0 : id - base;
237 slot = radix_tree_iter_find(&idr->idr_rt, &iter, id); 238 slot = radix_tree_iter_find(&idr->idr_rt, &iter, id);
@@ -431,7 +432,6 @@ int ida_get_new_above(struct ida *ida, int start, int *id)
431 bitmap = this_cpu_xchg(ida_bitmap, NULL); 432 bitmap = this_cpu_xchg(ida_bitmap, NULL);
432 if (!bitmap) 433 if (!bitmap)
433 return -EAGAIN; 434 return -EAGAIN;
434 memset(bitmap, 0, sizeof(*bitmap));
435 bitmap->bitmap[0] = tmp >> RADIX_TREE_EXCEPTIONAL_SHIFT; 435 bitmap->bitmap[0] = tmp >> RADIX_TREE_EXCEPTIONAL_SHIFT;
436 rcu_assign_pointer(*slot, bitmap); 436 rcu_assign_pointer(*slot, bitmap);
437 } 437 }
@@ -464,7 +464,6 @@ int ida_get_new_above(struct ida *ida, int start, int *id)
464 bitmap = this_cpu_xchg(ida_bitmap, NULL); 464 bitmap = this_cpu_xchg(ida_bitmap, NULL);
465 if (!bitmap) 465 if (!bitmap)
466 return -EAGAIN; 466 return -EAGAIN;
467 memset(bitmap, 0, sizeof(*bitmap));
468 __set_bit(bit, bitmap->bitmap); 467 __set_bit(bit, bitmap->bitmap);
469 radix_tree_iter_replace(root, &iter, slot, bitmap); 468 radix_tree_iter_replace(root, &iter, slot, bitmap);
470 } 469 }
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 0a7ae3288a24..8e00138d593f 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -2125,7 +2125,7 @@ int ida_pre_get(struct ida *ida, gfp_t gfp)
2125 preempt_enable(); 2125 preempt_enable();
2126 2126
2127 if (!this_cpu_read(ida_bitmap)) { 2127 if (!this_cpu_read(ida_bitmap)) {
2128 struct ida_bitmap *bitmap = kmalloc(sizeof(*bitmap), gfp); 2128 struct ida_bitmap *bitmap = kzalloc(sizeof(*bitmap), gfp);
2129 if (!bitmap) 2129 if (!bitmap)
2130 return 0; 2130 return 0;
2131 if (this_cpu_cmpxchg(ida_bitmap, NULL, bitmap)) 2131 if (this_cpu_cmpxchg(ida_bitmap, NULL, bitmap))
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 77ee6ced11b1..d7a708f82559 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
1849{ 1849{
1850 const int default_width = 2 * sizeof(void *); 1850 const int default_width = 2 * sizeof(void *);
1851 1851
1852 if (!ptr && *fmt != 'K') { 1852 if (!ptr && *fmt != 'K' && *fmt != 'x') {
1853 /* 1853 /*
1854 * Print (null) with the same width as a pointer so it makes 1854 * Print (null) with the same width as a pointer so it makes
1855 * tabular output look nice. 1855 * tabular output look nice.
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 4b80ccee4535..8291b75f42c8 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1139,8 +1139,6 @@ int memory_failure(unsigned long pfn, int flags)
1139 return 0; 1139 return 0;
1140 } 1140 }
1141 1141
1142 arch_unmap_kpfn(pfn);
1143
1144 orig_head = hpage = compound_head(p); 1142 orig_head = hpage = compound_head(p);
1145 num_poisoned_pages_inc(); 1143 num_poisoned_pages_inc();
1146 1144
diff --git a/mm/memory.c b/mm/memory.c
index dd8de96f5547..5fcfc24904d1 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -80,7 +80,7 @@
80 80
81#include "internal.h" 81#include "internal.h"
82 82
83#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS 83#if defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS) && !defined(CONFIG_COMPILE_TEST)
84#warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. 84#warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid.
85#endif 85#endif
86 86
diff --git a/mm/mlock.c b/mm/mlock.c
index 79398200e423..74e5a6547c3d 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -64,6 +64,12 @@ void clear_page_mlock(struct page *page)
64 mod_zone_page_state(page_zone(page), NR_MLOCK, 64 mod_zone_page_state(page_zone(page), NR_MLOCK,
65 -hpage_nr_pages(page)); 65 -hpage_nr_pages(page));
66 count_vm_event(UNEVICTABLE_PGCLEARED); 66 count_vm_event(UNEVICTABLE_PGCLEARED);
67 /*
68 * The previous TestClearPageMlocked() corresponds to the smp_mb()
69 * in __pagevec_lru_add_fn().
70 *
71 * See __pagevec_lru_add_fn for more explanation.
72 */
67 if (!isolate_lru_page(page)) { 73 if (!isolate_lru_page(page)) {
68 putback_lru_page(page); 74 putback_lru_page(page);
69 } else { 75 } else {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 81e18ceef579..cb416723538f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -46,6 +46,7 @@
46#include <linux/stop_machine.h> 46#include <linux/stop_machine.h>
47#include <linux/sort.h> 47#include <linux/sort.h>
48#include <linux/pfn.h> 48#include <linux/pfn.h>
49#include <xen/xen.h>
49#include <linux/backing-dev.h> 50#include <linux/backing-dev.h>
50#include <linux/fault-inject.h> 51#include <linux/fault-inject.h>
51#include <linux/page-isolation.h> 52#include <linux/page-isolation.h>
@@ -347,6 +348,9 @@ static inline bool update_defer_init(pg_data_t *pgdat,
347 /* Always populate low zones for address-constrained allocations */ 348 /* Always populate low zones for address-constrained allocations */
348 if (zone_end < pgdat_end_pfn(pgdat)) 349 if (zone_end < pgdat_end_pfn(pgdat))
349 return true; 350 return true;
351 /* Xen PV domains need page structures early */
352 if (xen_pv_domain())
353 return true;
350 (*nr_initialised)++; 354 (*nr_initialised)++;
351 if ((*nr_initialised > pgdat->static_init_pgcnt) && 355 if ((*nr_initialised > pgdat->static_init_pgcnt) &&
352 (pfn & (PAGES_PER_SECTION - 1)) == 0) { 356 (pfn & (PAGES_PER_SECTION - 1)) == 0) {
diff --git a/mm/swap.c b/mm/swap.c
index 567a7b96e41d..0f17330dd0e5 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -446,30 +446,6 @@ void lru_cache_add(struct page *page)
446} 446}
447 447
448/** 448/**
449 * add_page_to_unevictable_list - add a page to the unevictable list
450 * @page: the page to be added to the unevictable list
451 *
452 * Add page directly to its zone's unevictable list. To avoid races with
453 * tasks that might be making the page evictable, through eg. munlock,
454 * munmap or exit, while it's not on the lru, we want to add the page
455 * while it's locked or otherwise "invisible" to other tasks. This is
456 * difficult to do when using the pagevec cache, so bypass that.
457 */
458void add_page_to_unevictable_list(struct page *page)
459{
460 struct pglist_data *pgdat = page_pgdat(page);
461 struct lruvec *lruvec;
462
463 spin_lock_irq(&pgdat->lru_lock);
464 lruvec = mem_cgroup_page_lruvec(page, pgdat);
465 ClearPageActive(page);
466 SetPageUnevictable(page);
467 SetPageLRU(page);
468 add_page_to_lru_list(page, lruvec, LRU_UNEVICTABLE);
469 spin_unlock_irq(&pgdat->lru_lock);
470}
471
472/**
473 * lru_cache_add_active_or_unevictable 449 * lru_cache_add_active_or_unevictable
474 * @page: the page to be added to LRU 450 * @page: the page to be added to LRU
475 * @vma: vma in which page is mapped for determining reclaimability 451 * @vma: vma in which page is mapped for determining reclaimability
@@ -484,13 +460,9 @@ void lru_cache_add_active_or_unevictable(struct page *page,
484{ 460{
485 VM_BUG_ON_PAGE(PageLRU(page), page); 461 VM_BUG_ON_PAGE(PageLRU(page), page);
486 462
487 if (likely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) != VM_LOCKED)) { 463 if (likely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) != VM_LOCKED))
488 SetPageActive(page); 464 SetPageActive(page);
489 lru_cache_add(page); 465 else if (!TestSetPageMlocked(page)) {
490 return;
491 }
492
493 if (!TestSetPageMlocked(page)) {
494 /* 466 /*
495 * We use the irq-unsafe __mod_zone_page_stat because this 467 * We use the irq-unsafe __mod_zone_page_stat because this
496 * counter is not modified from interrupt context, and the pte 468 * counter is not modified from interrupt context, and the pte
@@ -500,7 +472,7 @@ void lru_cache_add_active_or_unevictable(struct page *page,
500 hpage_nr_pages(page)); 472 hpage_nr_pages(page));
501 count_vm_event(UNEVICTABLE_PGMLOCKED); 473 count_vm_event(UNEVICTABLE_PGMLOCKED);
502 } 474 }
503 add_page_to_unevictable_list(page); 475 lru_cache_add(page);
504} 476}
505 477
506/* 478/*
@@ -886,15 +858,55 @@ void lru_add_page_tail(struct page *page, struct page *page_tail,
886static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, 858static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,
887 void *arg) 859 void *arg)
888{ 860{
889 int file = page_is_file_cache(page); 861 enum lru_list lru;
890 int active = PageActive(page); 862 int was_unevictable = TestClearPageUnevictable(page);
891 enum lru_list lru = page_lru(page);
892 863
893 VM_BUG_ON_PAGE(PageLRU(page), page); 864 VM_BUG_ON_PAGE(PageLRU(page), page);
894 865
895 SetPageLRU(page); 866 SetPageLRU(page);
867 /*
868 * Page becomes evictable in two ways:
869 * 1) Within LRU lock [munlock_vma_pages() and __munlock_pagevec()].
870 * 2) Before acquiring LRU lock to put the page to correct LRU and then
871 * a) do PageLRU check with lock [check_move_unevictable_pages]
872 * b) do PageLRU check before lock [clear_page_mlock]
873 *
874 * (1) & (2a) are ok as LRU lock will serialize them. For (2b), we need
875 * following strict ordering:
876 *
877 * #0: __pagevec_lru_add_fn #1: clear_page_mlock
878 *
879 * SetPageLRU() TestClearPageMlocked()
880 * smp_mb() // explicit ordering // above provides strict
881 * // ordering
882 * PageMlocked() PageLRU()
883 *
884 *
885 * if '#1' does not observe setting of PG_lru by '#0' and fails
886 * isolation, the explicit barrier will make sure that page_evictable
887 * check will put the page in correct LRU. Without smp_mb(), SetPageLRU
888 * can be reordered after PageMlocked check and can make '#1' to fail
889 * the isolation of the page whose Mlocked bit is cleared (#0 is also
890 * looking at the same page) and the evictable page will be stranded
891 * in an unevictable LRU.
892 */
893 smp_mb();
894
895 if (page_evictable(page)) {
896 lru = page_lru(page);
897 update_page_reclaim_stat(lruvec, page_is_file_cache(page),
898 PageActive(page));
899 if (was_unevictable)
900 count_vm_event(UNEVICTABLE_PGRESCUED);
901 } else {
902 lru = LRU_UNEVICTABLE;
903 ClearPageActive(page);
904 SetPageUnevictable(page);
905 if (!was_unevictable)
906 count_vm_event(UNEVICTABLE_PGCULLED);
907 }
908
896 add_page_to_lru_list(page, lruvec, lru); 909 add_page_to_lru_list(page, lruvec, lru);
897 update_page_reclaim_stat(lruvec, file, active);
898 trace_mm_lru_insertion(page, lru); 910 trace_mm_lru_insertion(page, lru);
899} 911}
900 912
@@ -913,7 +925,7 @@ EXPORT_SYMBOL(__pagevec_lru_add);
913 * @pvec: Where the resulting entries are placed 925 * @pvec: Where the resulting entries are placed
914 * @mapping: The address_space to search 926 * @mapping: The address_space to search
915 * @start: The starting entry index 927 * @start: The starting entry index
916 * @nr_pages: The maximum number of pages 928 * @nr_entries: The maximum number of pages
917 * @indices: The cache indices corresponding to the entries in @pvec 929 * @indices: The cache indices corresponding to the entries in @pvec
918 * 930 *
919 * pagevec_lookup_entries() will search for and return a group of up 931 * pagevec_lookup_entries() will search for and return a group of up
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 673942094328..ebff729cc956 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1943,11 +1943,15 @@ void *vmalloc_exec(unsigned long size)
1943} 1943}
1944 1944
1945#if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32) 1945#if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
1946#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL 1946#define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL)
1947#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA) 1947#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
1948#define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL 1948#define GFP_VMALLOC32 (GFP_DMA | GFP_KERNEL)
1949#else 1949#else
1950#define GFP_VMALLOC32 GFP_KERNEL 1950/*
1951 * 64b systems should always have either DMA or DMA32 zones. For others
1952 * GFP_DMA32 should do the right thing and use the normal zone.
1953 */
1954#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
1951#endif 1955#endif
1952 1956
1953/** 1957/**
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 444749669187..bee53495a829 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -769,64 +769,7 @@ int remove_mapping(struct address_space *mapping, struct page *page)
769 */ 769 */
770void putback_lru_page(struct page *page) 770void putback_lru_page(struct page *page)
771{ 771{
772 bool is_unevictable; 772 lru_cache_add(page);
773 int was_unevictable = PageUnevictable(page);
774
775 VM_BUG_ON_PAGE(PageLRU(page), page);
776
777redo:
778 ClearPageUnevictable(page);
779
780 if (page_evictable(page)) {
781 /*
782 * For evictable pages, we can use the cache.
783 * In event of a race, worst case is we end up with an
784 * unevictable page on [in]active list.
785 * We know how to handle that.
786 */
787 is_unevictable = false;
788 lru_cache_add(page);
789 } else {
790 /*
791 * Put unevictable pages directly on zone's unevictable
792 * list.
793 */
794 is_unevictable = true;
795 add_page_to_unevictable_list(page);
796 /*
797 * When racing with an mlock or AS_UNEVICTABLE clearing
798 * (page is unlocked) make sure that if the other thread
799 * does not observe our setting of PG_lru and fails
800 * isolation/check_move_unevictable_pages,
801 * we see PG_mlocked/AS_UNEVICTABLE cleared below and move
802 * the page back to the evictable list.
803 *
804 * The other side is TestClearPageMlocked() or shmem_lock().
805 */
806 smp_mb();
807 }
808
809 /*
810 * page's status can change while we move it among lru. If an evictable
811 * page is on unevictable list, it never be freed. To avoid that,
812 * check after we added it to the list, again.
813 */
814 if (is_unevictable && page_evictable(page)) {
815 if (!isolate_lru_page(page)) {
816 put_page(page);
817 goto redo;
818 }
819 /* This means someone else dropped this page from LRU
820 * So, it will be freed or putback to LRU again. There is
821 * nothing to do here.
822 */
823 }
824
825 if (was_unevictable && !is_unevictable)
826 count_vm_event(UNEVICTABLE_PGRESCUED);
827 else if (!was_unevictable && is_unevictable)
828 count_vm_event(UNEVICTABLE_PGCULLED);
829
830 put_page(page); /* drop ref from isolate */ 773 put_page(page); /* drop ref from isolate */
831} 774}
832 775
diff --git a/mm/zpool.c b/mm/zpool.c
index f8cb83e7699b..01a771e304fa 100644
--- a/mm/zpool.c
+++ b/mm/zpool.c
@@ -360,7 +360,7 @@ u64 zpool_get_total_size(struct zpool *zpool)
360 360
361/** 361/**
362 * zpool_evictable() - Test if zpool is potentially evictable 362 * zpool_evictable() - Test if zpool is potentially evictable
363 * @pool The zpool to test 363 * @zpool: The zpool to test
364 * 364 *
365 * Zpool is only potentially evictable when it's created with struct 365 * Zpool is only potentially evictable when it's created with struct
366 * zpool_ops.evict and its driver implements struct zpool_driver.shrink. 366 * zpool_ops.evict and its driver implements struct zpool_driver.shrink.
diff --git a/mm/zswap.c b/mm/zswap.c
index c004aa4fd3f4..61a5c41972db 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1007,6 +1007,12 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset,
1007 u8 *src, *dst; 1007 u8 *src, *dst;
1008 struct zswap_header zhdr = { .swpentry = swp_entry(type, offset) }; 1008 struct zswap_header zhdr = { .swpentry = swp_entry(type, offset) };
1009 1009
1010 /* THP isn't supported */
1011 if (PageTransHuge(page)) {
1012 ret = -EINVAL;
1013 goto reject;
1014 }
1015
1010 if (!zswap_enabled || !tree) { 1016 if (!zswap_enabled || !tree) {
1011 ret = -ENODEV; 1017 ret = -ENODEV;
1012 goto reject; 1018 goto reject;
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index f3a4efcf1456..3aa5a93ad107 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -160,7 +160,8 @@ static void req_done(struct virtqueue *vq)
160 spin_unlock_irqrestore(&chan->lock, flags); 160 spin_unlock_irqrestore(&chan->lock, flags);
161 /* Wakeup if anyone waiting for VirtIO ring space. */ 161 /* Wakeup if anyone waiting for VirtIO ring space. */
162 wake_up(chan->vc_wq); 162 wake_up(chan->vc_wq);
163 p9_client_cb(chan->client, req, REQ_STATUS_RCVD); 163 if (len)
164 p9_client_cb(chan->client, req, REQ_STATUS_RCVD);
164 } 165 }
165} 166}
166 167
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 0254c35b2bf0..126a8ea73c96 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -255,6 +255,9 @@ static ssize_t brport_show(struct kobject *kobj,
255 struct brport_attribute *brport_attr = to_brport_attr(attr); 255 struct brport_attribute *brport_attr = to_brport_attr(attr);
256 struct net_bridge_port *p = to_brport(kobj); 256 struct net_bridge_port *p = to_brport(kobj);
257 257
258 if (!brport_attr->show)
259 return -EINVAL;
260
258 return brport_attr->show(p, buf); 261 return brport_attr->show(p, buf);
259} 262}
260 263
diff --git a/net/bridge/netfilter/ebt_among.c b/net/bridge/netfilter/ebt_among.c
index 279527f8b1fe..ce7152a12bd8 100644
--- a/net/bridge/netfilter/ebt_among.c
+++ b/net/bridge/netfilter/ebt_among.c
@@ -187,17 +187,17 @@ static int ebt_among_mt_check(const struct xt_mtchk_param *par)
187 expected_length += ebt_mac_wormhash_size(wh_src); 187 expected_length += ebt_mac_wormhash_size(wh_src);
188 188
189 if (em->match_size != EBT_ALIGN(expected_length)) { 189 if (em->match_size != EBT_ALIGN(expected_length)) {
190 pr_info("wrong size: %d against expected %d, rounded to %zd\n", 190 pr_err_ratelimited("wrong size: %d against expected %d, rounded to %zd\n",
191 em->match_size, expected_length, 191 em->match_size, expected_length,
192 EBT_ALIGN(expected_length)); 192 EBT_ALIGN(expected_length));
193 return -EINVAL; 193 return -EINVAL;
194 } 194 }
195 if (wh_dst && (err = ebt_mac_wormhash_check_integrity(wh_dst))) { 195 if (wh_dst && (err = ebt_mac_wormhash_check_integrity(wh_dst))) {
196 pr_info("dst integrity fail: %x\n", -err); 196 pr_err_ratelimited("dst integrity fail: %x\n", -err);
197 return -EINVAL; 197 return -EINVAL;
198 } 198 }
199 if (wh_src && (err = ebt_mac_wormhash_check_integrity(wh_src))) { 199 if (wh_src && (err = ebt_mac_wormhash_check_integrity(wh_src))) {
200 pr_info("src integrity fail: %x\n", -err); 200 pr_err_ratelimited("src integrity fail: %x\n", -err);
201 return -EINVAL; 201 return -EINVAL;
202 } 202 }
203 return 0; 203 return 0;
diff --git a/net/bridge/netfilter/ebt_limit.c b/net/bridge/netfilter/ebt_limit.c
index 61a9f1be1263..165b9d678cf1 100644
--- a/net/bridge/netfilter/ebt_limit.c
+++ b/net/bridge/netfilter/ebt_limit.c
@@ -72,8 +72,8 @@ static int ebt_limit_mt_check(const struct xt_mtchk_param *par)
72 /* Check for overflow. */ 72 /* Check for overflow. */
73 if (info->burst == 0 || 73 if (info->burst == 0 ||
74 user2credits(info->avg * info->burst) < user2credits(info->avg)) { 74 user2credits(info->avg * info->burst) < user2credits(info->avg)) {
75 pr_info("overflow, try lower: %u/%u\n", 75 pr_info_ratelimited("overflow, try lower: %u/%u\n",
76 info->avg, info->burst); 76 info->avg, info->burst);
77 return -EINVAL; 77 return -EINVAL;
78 } 78 }
79 79
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 1e492ef2a33d..4d4c82229e9e 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -418,6 +418,7 @@ ceph_parse_options(char *options, const char *dev_name,
418 opt->flags |= CEPH_OPT_FSID; 418 opt->flags |= CEPH_OPT_FSID;
419 break; 419 break;
420 case Opt_name: 420 case Opt_name:
421 kfree(opt->name);
421 opt->name = kstrndup(argstr[0].from, 422 opt->name = kstrndup(argstr[0].from,
422 argstr[0].to-argstr[0].from, 423 argstr[0].to-argstr[0].from,
423 GFP_KERNEL); 424 GFP_KERNEL);
@@ -427,6 +428,9 @@ ceph_parse_options(char *options, const char *dev_name,
427 } 428 }
428 break; 429 break;
429 case Opt_secret: 430 case Opt_secret:
431 ceph_crypto_key_destroy(opt->key);
432 kfree(opt->key);
433
430 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); 434 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
431 if (!opt->key) { 435 if (!opt->key) {
432 err = -ENOMEM; 436 err = -ENOMEM;
@@ -437,6 +441,9 @@ ceph_parse_options(char *options, const char *dev_name,
437 goto out; 441 goto out;
438 break; 442 break;
439 case Opt_key: 443 case Opt_key:
444 ceph_crypto_key_destroy(opt->key);
445 kfree(opt->key);
446
440 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL); 447 opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);
441 if (!opt->key) { 448 if (!opt->key) {
442 err = -ENOMEM; 449 err = -ENOMEM;
diff --git a/net/core/dev.c b/net/core/dev.c
index dda9d7b9a840..d4362befe7e2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2382,8 +2382,11 @@ EXPORT_SYMBOL(netdev_set_num_tc);
2382 */ 2382 */
2383int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) 2383int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
2384{ 2384{
2385 bool disabling;
2385 int rc; 2386 int rc;
2386 2387
2388 disabling = txq < dev->real_num_tx_queues;
2389
2387 if (txq < 1 || txq > dev->num_tx_queues) 2390 if (txq < 1 || txq > dev->num_tx_queues)
2388 return -EINVAL; 2391 return -EINVAL;
2389 2392
@@ -2399,15 +2402,19 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
2399 if (dev->num_tc) 2402 if (dev->num_tc)
2400 netif_setup_tc(dev, txq); 2403 netif_setup_tc(dev, txq);
2401 2404
2402 if (txq < dev->real_num_tx_queues) { 2405 dev->real_num_tx_queues = txq;
2406
2407 if (disabling) {
2408 synchronize_net();
2403 qdisc_reset_all_tx_gt(dev, txq); 2409 qdisc_reset_all_tx_gt(dev, txq);
2404#ifdef CONFIG_XPS 2410#ifdef CONFIG_XPS
2405 netif_reset_xps_queues_gt(dev, txq); 2411 netif_reset_xps_queues_gt(dev, txq);
2406#endif 2412#endif
2407 } 2413 }
2414 } else {
2415 dev->real_num_tx_queues = txq;
2408 } 2416 }
2409 2417
2410 dev->real_num_tx_queues = txq;
2411 return 0; 2418 return 0;
2412} 2419}
2413EXPORT_SYMBOL(netif_set_real_num_tx_queues); 2420EXPORT_SYMBOL(netif_set_real_num_tx_queues);
diff --git a/net/core/filter.c b/net/core/filter.c
index 08ab4c65a998..0c121adbdbaa 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3381,17 +3381,13 @@ BPF_CALL_2(bpf_sock_ops_cb_flags_set, struct bpf_sock_ops_kern *, bpf_sock,
3381 struct sock *sk = bpf_sock->sk; 3381 struct sock *sk = bpf_sock->sk;
3382 int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS; 3382 int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS;
3383 3383
3384 if (!sk_fullsock(sk)) 3384 if (!IS_ENABLED(CONFIG_INET) || !sk_fullsock(sk))
3385 return -EINVAL; 3385 return -EINVAL;
3386 3386
3387#ifdef CONFIG_INET
3388 if (val) 3387 if (val)
3389 tcp_sk(sk)->bpf_sock_ops_cb_flags = val; 3388 tcp_sk(sk)->bpf_sock_ops_cb_flags = val;
3390 3389
3391 return argval & (~BPF_SOCK_OPS_ALL_CB_FLAGS); 3390 return argval & (~BPF_SOCK_OPS_ALL_CB_FLAGS);
3392#else
3393 return -EINVAL;
3394#endif
3395} 3391}
3396 3392
3397static const struct bpf_func_proto bpf_sock_ops_cb_flags_set_proto = { 3393static const struct bpf_func_proto bpf_sock_ops_cb_flags_set_proto = {
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c
index 0a3f88f08727..98fd12721221 100644
--- a/net/core/gen_estimator.c
+++ b/net/core/gen_estimator.c
@@ -66,6 +66,7 @@ struct net_rate_estimator {
66static void est_fetch_counters(struct net_rate_estimator *e, 66static void est_fetch_counters(struct net_rate_estimator *e,
67 struct gnet_stats_basic_packed *b) 67 struct gnet_stats_basic_packed *b)
68{ 68{
69 memset(b, 0, sizeof(*b));
69 if (e->stats_lock) 70 if (e->stats_lock)
70 spin_lock(e->stats_lock); 71 spin_lock(e->stats_lock);
71 72
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 91dd09f79808..791aff68af88 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1338,6 +1338,12 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use
1338 lock_sock(sk); 1338 lock_sock(sk);
1339 err = __dn_setsockopt(sock, level, optname, optval, optlen, 0); 1339 err = __dn_setsockopt(sock, level, optname, optval, optlen, 0);
1340 release_sock(sk); 1340 release_sock(sk);
1341#ifdef CONFIG_NETFILTER
1342 /* we need to exclude all possible ENOPROTOOPTs except default case */
1343 if (err == -ENOPROTOOPT && optname != DSO_LINKINFO &&
1344 optname != DSO_STREAM && optname != DSO_SEQPACKET)
1345 err = nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
1346#endif
1341 1347
1342 return err; 1348 return err;
1343} 1349}
@@ -1445,15 +1451,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
1445 dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation); 1451 dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation);
1446 break; 1452 break;
1447 1453
1448 default:
1449#ifdef CONFIG_NETFILTER
1450 return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen);
1451#endif
1452 case DSO_LINKINFO:
1453 case DSO_STREAM:
1454 case DSO_SEQPACKET:
1455 return -ENOPROTOOPT;
1456
1457 case DSO_MAXWINDOW: 1454 case DSO_MAXWINDOW:
1458 if (optlen != sizeof(unsigned long)) 1455 if (optlen != sizeof(unsigned long))
1459 return -EINVAL; 1456 return -EINVAL;
@@ -1501,6 +1498,12 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
1501 return -EINVAL; 1498 return -EINVAL;
1502 scp->info_loc = u.info; 1499 scp->info_loc = u.info;
1503 break; 1500 break;
1501
1502 case DSO_LINKINFO:
1503 case DSO_STREAM:
1504 case DSO_SEQPACKET:
1505 default:
1506 return -ENOPROTOOPT;
1504 } 1507 }
1505 1508
1506 return 0; 1509 return 0;
@@ -1514,6 +1517,20 @@ static int dn_getsockopt(struct socket *sock, int level, int optname, char __use
1514 lock_sock(sk); 1517 lock_sock(sk);
1515 err = __dn_getsockopt(sock, level, optname, optval, optlen, 0); 1518 err = __dn_getsockopt(sock, level, optname, optval, optlen, 0);
1516 release_sock(sk); 1519 release_sock(sk);
1520#ifdef CONFIG_NETFILTER
1521 if (err == -ENOPROTOOPT && optname != DSO_STREAM &&
1522 optname != DSO_SEQPACKET && optname != DSO_CONACCEPT &&
1523 optname != DSO_CONREJECT) {
1524 int len;
1525
1526 if (get_user(len, optlen))
1527 return -EFAULT;
1528
1529 err = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
1530 if (err >= 0)
1531 err = put_user(len, optlen);
1532 }
1533#endif
1517 1534
1518 return err; 1535 return err;
1519} 1536}
@@ -1579,26 +1596,6 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
1579 r_data = &link; 1596 r_data = &link;
1580 break; 1597 break;
1581 1598
1582 default:
1583#ifdef CONFIG_NETFILTER
1584 {
1585 int ret, len;
1586
1587 if (get_user(len, optlen))
1588 return -EFAULT;
1589
1590 ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len);
1591 if (ret >= 0)
1592 ret = put_user(len, optlen);
1593 return ret;
1594 }
1595#endif
1596 case DSO_STREAM:
1597 case DSO_SEQPACKET:
1598 case DSO_CONACCEPT:
1599 case DSO_CONREJECT:
1600 return -ENOPROTOOPT;
1601
1602 case DSO_MAXWINDOW: 1599 case DSO_MAXWINDOW:
1603 if (r_len > sizeof(unsigned long)) 1600 if (r_len > sizeof(unsigned long))
1604 r_len = sizeof(unsigned long); 1601 r_len = sizeof(unsigned long);
@@ -1630,6 +1627,13 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
1630 r_len = sizeof(unsigned char); 1627 r_len = sizeof(unsigned char);
1631 r_data = &scp->info_rem; 1628 r_data = &scp->info_rem;
1632 break; 1629 break;
1630
1631 case DSO_STREAM:
1632 case DSO_SEQPACKET:
1633 case DSO_CONACCEPT:
1634 case DSO_CONREJECT:
1635 default:
1636 return -ENOPROTOOPT;
1633 } 1637 }
1634 1638
1635 if (r_data) { 1639 if (r_data) {
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index c586597da20d..7d36a950d961 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -646,6 +646,11 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi,
646 fi->fib_nh, cfg, extack)) 646 fi->fib_nh, cfg, extack))
647 return 1; 647 return 1;
648 } 648 }
649#ifdef CONFIG_IP_ROUTE_CLASSID
650 if (cfg->fc_flow &&
651 cfg->fc_flow != fi->fib_nh->nh_tclassid)
652 return 1;
653#endif
649 if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) && 654 if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) &&
650 (!cfg->fc_gw || cfg->fc_gw == fi->fib_nh->nh_gw)) 655 (!cfg->fc_gw || cfg->fc_gw == fi->fib_nh->nh_gw))
651 return 0; 656 return 0;
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 008be04ac1cc..9c41a0cef1a5 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1567,10 +1567,7 @@ int ip_getsockopt(struct sock *sk, int level,
1567 if (get_user(len, optlen)) 1567 if (get_user(len, optlen))
1568 return -EFAULT; 1568 return -EFAULT;
1569 1569
1570 lock_sock(sk); 1570 err = nf_getsockopt(sk, PF_INET, optname, optval, &len);
1571 err = nf_getsockopt(sk, PF_INET, optname, optval,
1572 &len);
1573 release_sock(sk);
1574 if (err >= 0) 1571 if (err >= 0)
1575 err = put_user(len, optlen); 1572 err = put_user(len, optlen);
1576 return err; 1573 return err;
@@ -1602,9 +1599,7 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname,
1602 if (get_user(len, optlen)) 1599 if (get_user(len, optlen))
1603 return -EFAULT; 1600 return -EFAULT;
1604 1601
1605 lock_sock(sk);
1606 err = compat_nf_getsockopt(sk, PF_INET, optname, optval, &len); 1602 err = compat_nf_getsockopt(sk, PF_INET, optname, optval, &len);
1607 release_sock(sk);
1608 if (err >= 0) 1603 if (err >= 0)
1609 err = put_user(len, optlen); 1604 err = put_user(len, optlen);
1610 return err; 1605 return err;
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 4ffe302f9b82..e3e420f3ba7b 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -252,6 +252,10 @@ unsigned int arpt_do_table(struct sk_buff *skb,
252 } 252 }
253 if (table_base + v 253 if (table_base + v
254 != arpt_next_entry(e)) { 254 != arpt_next_entry(e)) {
255 if (unlikely(stackidx >= private->stacksize)) {
256 verdict = NF_DROP;
257 break;
258 }
255 jumpstack[stackidx++] = e; 259 jumpstack[stackidx++] = e;
256 } 260 }
257 261
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 9a71f3149507..e38395a8dcf2 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -330,8 +330,13 @@ ipt_do_table(struct sk_buff *skb,
330 continue; 330 continue;
331 } 331 }
332 if (table_base + v != ipt_next_entry(e) && 332 if (table_base + v != ipt_next_entry(e) &&
333 !(e->ip.flags & IPT_F_GOTO)) 333 !(e->ip.flags & IPT_F_GOTO)) {
334 if (unlikely(stackidx >= private->stacksize)) {
335 verdict = NF_DROP;
336 break;
337 }
334 jumpstack[stackidx++] = e; 338 jumpstack[stackidx++] = e;
339 }
335 340
336 e = get_entry(table_base, v); 341 e = get_entry(table_base, v);
337 continue; 342 continue;
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 3a84a60f6b39..4b02ab39ebc5 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -107,12 +107,6 @@ clusterip_config_entry_put(struct net *net, struct clusterip_config *c)
107 107
108 local_bh_disable(); 108 local_bh_disable();
109 if (refcount_dec_and_lock(&c->entries, &cn->lock)) { 109 if (refcount_dec_and_lock(&c->entries, &cn->lock)) {
110 list_del_rcu(&c->list);
111 spin_unlock(&cn->lock);
112 local_bh_enable();
113
114 unregister_netdevice_notifier(&c->notifier);
115
116 /* In case anyone still accesses the file, the open/close 110 /* In case anyone still accesses the file, the open/close
117 * functions are also incrementing the refcount on their own, 111 * functions are also incrementing the refcount on their own,
118 * so it's safe to remove the entry even if it's in use. */ 112 * so it's safe to remove the entry even if it's in use. */
@@ -120,6 +114,12 @@ clusterip_config_entry_put(struct net *net, struct clusterip_config *c)
120 if (cn->procdir) 114 if (cn->procdir)
121 proc_remove(c->pde); 115 proc_remove(c->pde);
122#endif 116#endif
117 list_del_rcu(&c->list);
118 spin_unlock(&cn->lock);
119 local_bh_enable();
120
121 unregister_netdevice_notifier(&c->notifier);
122
123 return; 123 return;
124 } 124 }
125 local_bh_enable(); 125 local_bh_enable();
@@ -154,8 +154,12 @@ clusterip_config_find_get(struct net *net, __be32 clusterip, int entry)
154#endif 154#endif
155 if (unlikely(!refcount_inc_not_zero(&c->refcount))) 155 if (unlikely(!refcount_inc_not_zero(&c->refcount)))
156 c = NULL; 156 c = NULL;
157 else if (entry) 157 else if (entry) {
158 refcount_inc(&c->entries); 158 if (unlikely(!refcount_inc_not_zero(&c->entries))) {
159 clusterip_config_put(c);
160 c = NULL;
161 }
162 }
159 } 163 }
160 rcu_read_unlock_bh(); 164 rcu_read_unlock_bh();
161 165
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
index 270765236f5e..aaaf9a81fbc9 100644
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -98,17 +98,15 @@ static int ecn_tg_check(const struct xt_tgchk_param *par)
98 const struct ipt_ECN_info *einfo = par->targinfo; 98 const struct ipt_ECN_info *einfo = par->targinfo;
99 const struct ipt_entry *e = par->entryinfo; 99 const struct ipt_entry *e = par->entryinfo;
100 100
101 if (einfo->operation & IPT_ECN_OP_MASK) { 101 if (einfo->operation & IPT_ECN_OP_MASK)
102 pr_info("unsupported ECN operation %x\n", einfo->operation);
103 return -EINVAL; 102 return -EINVAL;
104 } 103
105 if (einfo->ip_ect & ~IPT_ECN_IP_MASK) { 104 if (einfo->ip_ect & ~IPT_ECN_IP_MASK)
106 pr_info("new ECT codepoint %x out of mask\n", einfo->ip_ect);
107 return -EINVAL; 105 return -EINVAL;
108 } 106
109 if ((einfo->operation & (IPT_ECN_OP_SET_ECE|IPT_ECN_OP_SET_CWR)) && 107 if ((einfo->operation & (IPT_ECN_OP_SET_ECE|IPT_ECN_OP_SET_CWR)) &&
110 (e->ip.proto != IPPROTO_TCP || (e->ip.invflags & XT_INV_PROTO))) { 108 (e->ip.proto != IPPROTO_TCP || (e->ip.invflags & XT_INV_PROTO))) {
111 pr_info("cannot use TCP operations on a non-tcp rule\n"); 109 pr_info_ratelimited("cannot use operation on non-tcp rule\n");
112 return -EINVAL; 110 return -EINVAL;
113 } 111 }
114 return 0; 112 return 0;
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index 8bd0d7b26632..e8bed3390e58 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -74,13 +74,13 @@ static int reject_tg_check(const struct xt_tgchk_param *par)
74 const struct ipt_entry *e = par->entryinfo; 74 const struct ipt_entry *e = par->entryinfo;
75 75
76 if (rejinfo->with == IPT_ICMP_ECHOREPLY) { 76 if (rejinfo->with == IPT_ICMP_ECHOREPLY) {
77 pr_info("ECHOREPLY no longer supported.\n"); 77 pr_info_ratelimited("ECHOREPLY no longer supported.\n");
78 return -EINVAL; 78 return -EINVAL;
79 } else if (rejinfo->with == IPT_TCP_RESET) { 79 } else if (rejinfo->with == IPT_TCP_RESET) {
80 /* Must specify that it's a TCP packet */ 80 /* Must specify that it's a TCP packet */
81 if (e->ip.proto != IPPROTO_TCP || 81 if (e->ip.proto != IPPROTO_TCP ||
82 (e->ip.invflags & XT_INV_PROTO)) { 82 (e->ip.invflags & XT_INV_PROTO)) {
83 pr_info("TCP_RESET invalid for non-tcp\n"); 83 pr_info_ratelimited("TCP_RESET invalid for non-tcp\n");
84 return -EINVAL; 84 return -EINVAL;
85 } 85 }
86 } 86 }
diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c
index 37fb9552e858..fd01f13c896a 100644
--- a/net/ipv4/netfilter/ipt_rpfilter.c
+++ b/net/ipv4/netfilter/ipt_rpfilter.c
@@ -105,14 +105,14 @@ static int rpfilter_check(const struct xt_mtchk_param *par)
105 const struct xt_rpfilter_info *info = par->matchinfo; 105 const struct xt_rpfilter_info *info = par->matchinfo;
106 unsigned int options = ~XT_RPFILTER_OPTION_MASK; 106 unsigned int options = ~XT_RPFILTER_OPTION_MASK;
107 if (info->flags & options) { 107 if (info->flags & options) {
108 pr_info("unknown options encountered"); 108 pr_info_ratelimited("unknown options\n");
109 return -EINVAL; 109 return -EINVAL;
110 } 110 }
111 111
112 if (strcmp(par->table, "mangle") != 0 && 112 if (strcmp(par->table, "mangle") != 0 &&
113 strcmp(par->table, "raw") != 0) { 113 strcmp(par->table, "raw") != 0) {
114 pr_info("match only valid in the \'raw\' " 114 pr_info_ratelimited("only valid in \'raw\' or \'mangle\' table, not \'%s\'\n",
115 "or \'mangle\' tables, not \'%s\'.\n", par->table); 115 par->table);
116 return -EINVAL; 116 return -EINVAL;
117 } 117 }
118 118
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 49cc1c1df1ba..a4f44d815a61 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1826,6 +1826,8 @@ int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
1826 return skb_get_hash_raw(skb) >> 1; 1826 return skb_get_hash_raw(skb) >> 1;
1827 memset(&hash_keys, 0, sizeof(hash_keys)); 1827 memset(&hash_keys, 0, sizeof(hash_keys));
1828 skb_flow_dissect_flow_keys(skb, &keys, flag); 1828 skb_flow_dissect_flow_keys(skb, &keys, flag);
1829
1830 hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
1829 hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src; 1831 hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src;
1830 hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst; 1832 hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst;
1831 hash_keys.ports.src = keys.ports.src; 1833 hash_keys.ports.src = keys.ports.src;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e9f985e42405..6818042cd8a9 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1730,7 +1730,7 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
1730 */ 1730 */
1731 segs = max_t(u32, bytes / mss_now, min_tso_segs); 1731 segs = max_t(u32, bytes / mss_now, min_tso_segs);
1732 1732
1733 return min_t(u32, segs, sk->sk_gso_max_segs); 1733 return segs;
1734} 1734}
1735EXPORT_SYMBOL(tcp_tso_autosize); 1735EXPORT_SYMBOL(tcp_tso_autosize);
1736 1736
@@ -1742,9 +1742,10 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now)
1742 const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; 1742 const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
1743 u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0; 1743 u32 tso_segs = ca_ops->tso_segs_goal ? ca_ops->tso_segs_goal(sk) : 0;
1744 1744
1745 return tso_segs ? : 1745 if (!tso_segs)
1746 tcp_tso_autosize(sk, mss_now, 1746 tso_segs = tcp_tso_autosize(sk, mss_now,
1747 sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); 1747 sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);
1748 return min_t(u32, tso_segs, sk->sk_gso_max_segs);
1748} 1749}
1749 1750
1750/* Returns the portion of skb which can be sent right away */ 1751/* Returns the portion of skb which can be sent right away */
@@ -2027,6 +2028,24 @@ static inline void tcp_mtu_check_reprobe(struct sock *sk)
2027 } 2028 }
2028} 2029}
2029 2030
2031static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len)
2032{
2033 struct sk_buff *skb, *next;
2034
2035 skb = tcp_send_head(sk);
2036 tcp_for_write_queue_from_safe(skb, next, sk) {
2037 if (len <= skb->len)
2038 break;
2039
2040 if (unlikely(TCP_SKB_CB(skb)->eor))
2041 return false;
2042
2043 len -= skb->len;
2044 }
2045
2046 return true;
2047}
2048
2030/* Create a new MTU probe if we are ready. 2049/* Create a new MTU probe if we are ready.
2031 * MTU probe is regularly attempting to increase the path MTU by 2050 * MTU probe is regularly attempting to increase the path MTU by
2032 * deliberately sending larger packets. This discovers routing 2051 * deliberately sending larger packets. This discovers routing
@@ -2099,6 +2118,9 @@ static int tcp_mtu_probe(struct sock *sk)
2099 return 0; 2118 return 0;
2100 } 2119 }
2101 2120
2121 if (!tcp_can_coalesce_send_queue_head(sk, probe_size))
2122 return -1;
2123
2102 /* We're allowed to probe. Build it now. */ 2124 /* We're allowed to probe. Build it now. */
2103 nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false); 2125 nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false);
2104 if (!nskb) 2126 if (!nskb)
@@ -2134,6 +2156,10 @@ static int tcp_mtu_probe(struct sock *sk)
2134 /* We've eaten all the data from this skb. 2156 /* We've eaten all the data from this skb.
2135 * Throw it away. */ 2157 * Throw it away. */
2136 TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags; 2158 TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags;
2159 /* If this is the last SKB we copy and eor is set
2160 * we need to propagate it to the new skb.
2161 */
2162 TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor;
2137 tcp_unlink_write_queue(skb, sk); 2163 tcp_unlink_write_queue(skb, sk);
2138 sk_wmem_free_skb(sk, skb); 2164 sk_wmem_free_skb(sk, skb);
2139 } else { 2165 } else {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index bfaefe560b5c..e5ef7c38c934 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2024,6 +2024,11 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
2024 err = udplite_checksum_init(skb, uh); 2024 err = udplite_checksum_init(skb, uh);
2025 if (err) 2025 if (err)
2026 return err; 2026 return err;
2027
2028 if (UDP_SKB_CB(skb)->partial_cov) {
2029 skb->csum = inet_compute_pseudo(skb, proto);
2030 return 0;
2031 }
2027 } 2032 }
2028 2033
2029 /* Note, we are only interested in != 0 or == 0, thus the 2034 /* Note, we are only interested in != 0 or == 0, thus the
diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c
index ec43d18b5ff9..547515e8450a 100644
--- a/net/ipv6/ip6_checksum.c
+++ b/net/ipv6/ip6_checksum.c
@@ -73,6 +73,11 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
73 err = udplite_checksum_init(skb, uh); 73 err = udplite_checksum_init(skb, uh);
74 if (err) 74 if (err)
75 return err; 75 return err;
76
77 if (UDP_SKB_CB(skb)->partial_cov) {
78 skb->csum = ip6_compute_pseudo(skb, proto);
79 return 0;
80 }
76 } 81 }
77 82
78 /* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) 83 /* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index d78d41fc4b1a..24535169663d 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -1367,10 +1367,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
1367 if (get_user(len, optlen)) 1367 if (get_user(len, optlen))
1368 return -EFAULT; 1368 return -EFAULT;
1369 1369
1370 lock_sock(sk); 1370 err = nf_getsockopt(sk, PF_INET6, optname, optval, &len);
1371 err = nf_getsockopt(sk, PF_INET6, optname, optval,
1372 &len);
1373 release_sock(sk);
1374 if (err >= 0) 1371 if (err >= 0)
1375 err = put_user(len, optlen); 1372 err = put_user(len, optlen);
1376 } 1373 }
@@ -1409,10 +1406,7 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
1409 if (get_user(len, optlen)) 1406 if (get_user(len, optlen))
1410 return -EFAULT; 1407 return -EFAULT;
1411 1408
1412 lock_sock(sk); 1409 err = compat_nf_getsockopt(sk, PF_INET6, optname, optval, &len);
1413 err = compat_nf_getsockopt(sk, PF_INET6,
1414 optname, optval, &len);
1415 release_sock(sk);
1416 if (err >= 0) 1410 if (err >= 0)
1417 err = put_user(len, optlen); 1411 err = put_user(len, optlen);
1418 } 1412 }
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index af4c917e0836..62358b93bbac 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -352,6 +352,10 @@ ip6t_do_table(struct sk_buff *skb,
352 } 352 }
353 if (table_base + v != ip6t_next_entry(e) && 353 if (table_base + v != ip6t_next_entry(e) &&
354 !(e->ipv6.flags & IP6T_F_GOTO)) { 354 !(e->ipv6.flags & IP6T_F_GOTO)) {
355 if (unlikely(stackidx >= private->stacksize)) {
356 verdict = NF_DROP;
357 break;
358 }
355 jumpstack[stackidx++] = e; 359 jumpstack[stackidx++] = e;
356 } 360 }
357 361
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index fa51a205918d..38dea8ff680f 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -85,14 +85,14 @@ static int reject_tg6_check(const struct xt_tgchk_param *par)
85 const struct ip6t_entry *e = par->entryinfo; 85 const struct ip6t_entry *e = par->entryinfo;
86 86
87 if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) { 87 if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) {
88 pr_info("ECHOREPLY is not supported.\n"); 88 pr_info_ratelimited("ECHOREPLY is not supported\n");
89 return -EINVAL; 89 return -EINVAL;
90 } else if (rejinfo->with == IP6T_TCP_RESET) { 90 } else if (rejinfo->with == IP6T_TCP_RESET) {
91 /* Must specify that it's a TCP packet */ 91 /* Must specify that it's a TCP packet */
92 if (!(e->ipv6.flags & IP6T_F_PROTO) || 92 if (!(e->ipv6.flags & IP6T_F_PROTO) ||
93 e->ipv6.proto != IPPROTO_TCP || 93 e->ipv6.proto != IPPROTO_TCP ||
94 (e->ipv6.invflags & XT_INV_PROTO)) { 94 (e->ipv6.invflags & XT_INV_PROTO)) {
95 pr_info("TCP_RESET illegal for non-tcp\n"); 95 pr_info_ratelimited("TCP_RESET illegal for non-tcp\n");
96 return -EINVAL; 96 return -EINVAL;
97 } 97 }
98 } 98 }
diff --git a/net/ipv6/netfilter/ip6t_rpfilter.c b/net/ipv6/netfilter/ip6t_rpfilter.c
index b12e61b7b16c..94deb69bbbda 100644
--- a/net/ipv6/netfilter/ip6t_rpfilter.c
+++ b/net/ipv6/netfilter/ip6t_rpfilter.c
@@ -103,14 +103,14 @@ static int rpfilter_check(const struct xt_mtchk_param *par)
103 unsigned int options = ~XT_RPFILTER_OPTION_MASK; 103 unsigned int options = ~XT_RPFILTER_OPTION_MASK;
104 104
105 if (info->flags & options) { 105 if (info->flags & options) {
106 pr_info("unknown options encountered"); 106 pr_info_ratelimited("unknown options\n");
107 return -EINVAL; 107 return -EINVAL;
108 } 108 }
109 109
110 if (strcmp(par->table, "mangle") != 0 && 110 if (strcmp(par->table, "mangle") != 0 &&
111 strcmp(par->table, "raw") != 0) { 111 strcmp(par->table, "raw") != 0) {
112 pr_info("match only valid in the \'raw\' " 112 pr_info_ratelimited("only valid in \'raw\' or \'mangle\' table, not \'%s\'\n",
113 "or \'mangle\' tables, not \'%s\'.\n", par->table); 113 par->table);
114 return -EINVAL; 114 return -EINVAL;
115 } 115 }
116 116
diff --git a/net/ipv6/netfilter/ip6t_srh.c b/net/ipv6/netfilter/ip6t_srh.c
index 9642164107ce..33719d5560c8 100644
--- a/net/ipv6/netfilter/ip6t_srh.c
+++ b/net/ipv6/netfilter/ip6t_srh.c
@@ -122,12 +122,14 @@ static int srh_mt6_check(const struct xt_mtchk_param *par)
122 const struct ip6t_srh *srhinfo = par->matchinfo; 122 const struct ip6t_srh *srhinfo = par->matchinfo;
123 123
124 if (srhinfo->mt_flags & ~IP6T_SRH_MASK) { 124 if (srhinfo->mt_flags & ~IP6T_SRH_MASK) {
125 pr_err("unknown srh match flags %X\n", srhinfo->mt_flags); 125 pr_info_ratelimited("unknown srh match flags %X\n",
126 srhinfo->mt_flags);
126 return -EINVAL; 127 return -EINVAL;
127 } 128 }
128 129
129 if (srhinfo->mt_invflags & ~IP6T_SRH_INV_MASK) { 130 if (srhinfo->mt_invflags & ~IP6T_SRH_INV_MASK) {
130 pr_err("unknown srh invflags %X\n", srhinfo->mt_invflags); 131 pr_info_ratelimited("unknown srh invflags %X\n",
132 srhinfo->mt_invflags);
131 return -EINVAL; 133 return -EINVAL;
132 } 134 }
133 135
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 3873d3877135..3a1775a62973 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -182,7 +182,7 @@ static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn)
182#ifdef CONFIG_IPV6_SIT_6RD 182#ifdef CONFIG_IPV6_SIT_6RD
183 struct ip_tunnel *t = netdev_priv(dev); 183 struct ip_tunnel *t = netdev_priv(dev);
184 184
185 if (t->dev == sitn->fb_tunnel_dev) { 185 if (dev == sitn->fb_tunnel_dev) {
186 ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0); 186 ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0);
187 t->ip6rd.relay_prefix = 0; 187 t->ip6rd.relay_prefix = 0;
188 t->ip6rd.prefixlen = 16; 188 t->ip6rd.prefixlen = 16;
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index a8b1616cec41..1f3188d03840 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -8,6 +8,7 @@
8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
9 * Copyright 2007-2010, Intel Corporation 9 * Copyright 2007-2010, Intel Corporation
10 * Copyright(c) 2015-2017 Intel Deutschland GmbH 10 * Copyright(c) 2015-2017 Intel Deutschland GmbH
11 * Copyright (C) 2018 Intel Corporation
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -304,9 +305,6 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
304 * driver so reject the timeout update. 305 * driver so reject the timeout update.
305 */ 306 */
306 status = WLAN_STATUS_REQUEST_DECLINED; 307 status = WLAN_STATUS_REQUEST_DECLINED;
307 ieee80211_send_addba_resp(sta->sdata, sta->sta.addr,
308 tid, dialog_token, status,
309 1, buf_size, timeout);
310 goto end; 308 goto end;
311 } 309 }
312 310
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 46028e12e216..f4195a0f0279 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2892,7 +2892,7 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
2892 } 2892 }
2893 if (beacon->probe_resp_len) { 2893 if (beacon->probe_resp_len) {
2894 new_beacon->probe_resp_len = beacon->probe_resp_len; 2894 new_beacon->probe_resp_len = beacon->probe_resp_len;
2895 beacon->probe_resp = pos; 2895 new_beacon->probe_resp = pos;
2896 memcpy(pos, beacon->probe_resp, beacon->probe_resp_len); 2896 memcpy(pos, beacon->probe_resp, beacon->probe_resp_len);
2897 pos += beacon->probe_resp_len; 2897 pos += beacon->probe_resp_len;
2898 } 2898 }
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 26900025de2f..ae9c33cd8ada 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1467,7 +1467,7 @@ struct ieee802_11_elems {
1467 const struct ieee80211_timeout_interval_ie *timeout_int; 1467 const struct ieee80211_timeout_interval_ie *timeout_int;
1468 const u8 *opmode_notif; 1468 const u8 *opmode_notif;
1469 const struct ieee80211_sec_chan_offs_ie *sec_chan_offs; 1469 const struct ieee80211_sec_chan_offs_ie *sec_chan_offs;
1470 const struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie; 1470 struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie;
1471 const struct ieee80211_bss_max_idle_period_ie *max_idle_period_ie; 1471 const struct ieee80211_bss_max_idle_period_ie *max_idle_period_ie;
1472 1472
1473 /* length of them, respectively */ 1473 /* length of them, respectively */
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 73ac607beb5d..6a381cbe1e33 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1255,13 +1255,12 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
1255} 1255}
1256 1256
1257static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, 1257static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata,
1258 struct ieee80211_mgmt *mgmt, size_t len) 1258 struct ieee80211_mgmt *mgmt, size_t len,
1259 struct ieee802_11_elems *elems)
1259{ 1260{
1260 struct ieee80211_mgmt *mgmt_fwd; 1261 struct ieee80211_mgmt *mgmt_fwd;
1261 struct sk_buff *skb; 1262 struct sk_buff *skb;
1262 struct ieee80211_local *local = sdata->local; 1263 struct ieee80211_local *local = sdata->local;
1263 u8 *pos = mgmt->u.action.u.chan_switch.variable;
1264 size_t offset_ttl;
1265 1264
1266 skb = dev_alloc_skb(local->tx_headroom + len); 1265 skb = dev_alloc_skb(local->tx_headroom + len);
1267 if (!skb) 1266 if (!skb)
@@ -1269,13 +1268,9 @@ static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata,
1269 skb_reserve(skb, local->tx_headroom); 1268 skb_reserve(skb, local->tx_headroom);
1270 mgmt_fwd = skb_put(skb, len); 1269 mgmt_fwd = skb_put(skb, len);
1271 1270
1272 /* offset_ttl is based on whether the secondary channel 1271 elems->mesh_chansw_params_ie->mesh_ttl--;
1273 * offset is available or not. Subtract 1 from the mesh TTL 1272 elems->mesh_chansw_params_ie->mesh_flags &=
1274 * and disable the initiator flag before forwarding. 1273 ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR;
1275 */
1276 offset_ttl = (len < 42) ? 7 : 10;
1277 *(pos + offset_ttl) -= 1;
1278 *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR;
1279 1274
1280 memcpy(mgmt_fwd, mgmt, len); 1275 memcpy(mgmt_fwd, mgmt, len);
1281 eth_broadcast_addr(mgmt_fwd->da); 1276 eth_broadcast_addr(mgmt_fwd->da);
@@ -1323,7 +1318,7 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata,
1323 1318
1324 /* forward or re-broadcast the CSA frame */ 1319 /* forward or re-broadcast the CSA frame */
1325 if (fwd_csa) { 1320 if (fwd_csa) {
1326 if (mesh_fwd_csa_frame(sdata, mgmt, len) < 0) 1321 if (mesh_fwd_csa_frame(sdata, mgmt, len, &elems) < 0)
1327 mcsa_dbg(sdata, "Failed to forward the CSA frame"); 1322 mcsa_dbg(sdata, "Failed to forward the CSA frame");
1328 } 1323 }
1329} 1324}
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index ee0181778a42..029334835747 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -8,6 +8,7 @@
8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
9 * Copyright 2007-2008, Intel Corporation 9 * Copyright 2007-2008, Intel Corporation
10 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> 10 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
11 * Copyright (C) 2018 Intel Corporation
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -27,7 +28,7 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
27 u32 sta_flags, u8 *bssid, 28 u32 sta_flags, u8 *bssid,
28 struct ieee80211_csa_ie *csa_ie) 29 struct ieee80211_csa_ie *csa_ie)
29{ 30{
30 enum nl80211_band new_band; 31 enum nl80211_band new_band = current_band;
31 int new_freq; 32 int new_freq;
32 u8 new_chan_no; 33 u8 new_chan_no;
33 struct ieee80211_channel *new_chan; 34 struct ieee80211_channel *new_chan;
@@ -55,15 +56,13 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
55 elems->ext_chansw_ie->new_operating_class, 56 elems->ext_chansw_ie->new_operating_class,
56 &new_band)) { 57 &new_band)) {
57 sdata_info(sdata, 58 sdata_info(sdata,
58 "cannot understand ECSA IE operating class %d, disconnecting\n", 59 "cannot understand ECSA IE operating class, %d, ignoring\n",
59 elems->ext_chansw_ie->new_operating_class); 60 elems->ext_chansw_ie->new_operating_class);
60 return -EINVAL;
61 } 61 }
62 new_chan_no = elems->ext_chansw_ie->new_ch_num; 62 new_chan_no = elems->ext_chansw_ie->new_ch_num;
63 csa_ie->count = elems->ext_chansw_ie->count; 63 csa_ie->count = elems->ext_chansw_ie->count;
64 csa_ie->mode = elems->ext_chansw_ie->mode; 64 csa_ie->mode = elems->ext_chansw_ie->mode;
65 } else if (elems->ch_switch_ie) { 65 } else if (elems->ch_switch_ie) {
66 new_band = current_band;
67 new_chan_no = elems->ch_switch_ie->new_ch_num; 66 new_chan_no = elems->ch_switch_ie->new_ch_num;
68 csa_ie->count = elems->ch_switch_ie->count; 67 csa_ie->count = elems->ch_switch_ie->count;
69 csa_ie->mode = elems->ch_switch_ie->mode; 68 csa_ie->mode = elems->ch_switch_ie->mode;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 0c5627f8a104..af0b608ee8ed 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -314,7 +314,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
314 314
315 if (ieee80211_hw_check(hw, USES_RSS)) { 315 if (ieee80211_hw_check(hw, USES_RSS)) {
316 sta->pcpu_rx_stats = 316 sta->pcpu_rx_stats =
317 alloc_percpu(struct ieee80211_sta_rx_stats); 317 alloc_percpu_gfp(struct ieee80211_sta_rx_stats, gfp);
318 if (!sta->pcpu_rx_stats) 318 if (!sta->pcpu_rx_stats)
319 goto free; 319 goto free;
320 } 320 }
@@ -433,6 +433,7 @@ free_txq:
433 if (sta->sta.txq[0]) 433 if (sta->sta.txq[0])
434 kfree(to_txq_info(sta->sta.txq[0])); 434 kfree(to_txq_info(sta->sta.txq[0]));
435free: 435free:
436 free_percpu(sta->pcpu_rx_stats);
436#ifdef CONFIG_MAC80211_MESH 437#ifdef CONFIG_MAC80211_MESH
437 kfree(sta->mesh); 438 kfree(sta->mesh);
438#endif 439#endif
diff --git a/net/netfilter/nf_nat_proto_common.c b/net/netfilter/nf_nat_proto_common.c
index fbce552a796e..7d7466dbf663 100644
--- a/net/netfilter/nf_nat_proto_common.c
+++ b/net/netfilter/nf_nat_proto_common.c
@@ -41,7 +41,7 @@ void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,
41 const struct nf_conn *ct, 41 const struct nf_conn *ct,
42 u16 *rover) 42 u16 *rover)
43{ 43{
44 unsigned int range_size, min, i; 44 unsigned int range_size, min, max, i;
45 __be16 *portptr; 45 __be16 *portptr;
46 u_int16_t off; 46 u_int16_t off;
47 47
@@ -71,7 +71,10 @@ void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,
71 } 71 }
72 } else { 72 } else {
73 min = ntohs(range->min_proto.all); 73 min = ntohs(range->min_proto.all);
74 range_size = ntohs(range->max_proto.all) - min + 1; 74 max = ntohs(range->max_proto.all);
75 if (unlikely(max < min))
76 swap(max, min);
77 range_size = max - min + 1;
75 } 78 }
76 79
77 if (range->flags & NF_NAT_RANGE_PROTO_RANDOM) { 80 if (range->flags & NF_NAT_RANGE_PROTO_RANDOM) {
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 2f685ee1f9c8..fa1655aff8d3 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -434,36 +434,35 @@ int xt_check_match(struct xt_mtchk_param *par,
434 * ebt_among is exempt from centralized matchsize checking 434 * ebt_among is exempt from centralized matchsize checking
435 * because it uses a dynamic-size data set. 435 * because it uses a dynamic-size data set.
436 */ 436 */
437 pr_err("%s_tables: %s.%u match: invalid size " 437 pr_err_ratelimited("%s_tables: %s.%u match: invalid size %u (kernel) != (user) %u\n",
438 "%u (kernel) != (user) %u\n", 438 xt_prefix[par->family], par->match->name,
439 xt_prefix[par->family], par->match->name, 439 par->match->revision,
440 par->match->revision, 440 XT_ALIGN(par->match->matchsize), size);
441 XT_ALIGN(par->match->matchsize), size);
442 return -EINVAL; 441 return -EINVAL;
443 } 442 }
444 if (par->match->table != NULL && 443 if (par->match->table != NULL &&
445 strcmp(par->match->table, par->table) != 0) { 444 strcmp(par->match->table, par->table) != 0) {
446 pr_err("%s_tables: %s match: only valid in %s table, not %s\n", 445 pr_info_ratelimited("%s_tables: %s match: only valid in %s table, not %s\n",
447 xt_prefix[par->family], par->match->name, 446 xt_prefix[par->family], par->match->name,
448 par->match->table, par->table); 447 par->match->table, par->table);
449 return -EINVAL; 448 return -EINVAL;
450 } 449 }
451 if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) { 450 if (par->match->hooks && (par->hook_mask & ~par->match->hooks) != 0) {
452 char used[64], allow[64]; 451 char used[64], allow[64];
453 452
454 pr_err("%s_tables: %s match: used from hooks %s, but only " 453 pr_info_ratelimited("%s_tables: %s match: used from hooks %s, but only valid from %s\n",
455 "valid from %s\n", 454 xt_prefix[par->family], par->match->name,
456 xt_prefix[par->family], par->match->name, 455 textify_hooks(used, sizeof(used),
457 textify_hooks(used, sizeof(used), par->hook_mask, 456 par->hook_mask, par->family),
458 par->family), 457 textify_hooks(allow, sizeof(allow),
459 textify_hooks(allow, sizeof(allow), par->match->hooks, 458 par->match->hooks,
460 par->family)); 459 par->family));
461 return -EINVAL; 460 return -EINVAL;
462 } 461 }
463 if (par->match->proto && (par->match->proto != proto || inv_proto)) { 462 if (par->match->proto && (par->match->proto != proto || inv_proto)) {
464 pr_err("%s_tables: %s match: only valid for protocol %u\n", 463 pr_info_ratelimited("%s_tables: %s match: only valid for protocol %u\n",
465 xt_prefix[par->family], par->match->name, 464 xt_prefix[par->family], par->match->name,
466 par->match->proto); 465 par->match->proto);
467 return -EINVAL; 466 return -EINVAL;
468 } 467 }
469 if (par->match->checkentry != NULL) { 468 if (par->match->checkentry != NULL) {
@@ -814,36 +813,35 @@ int xt_check_target(struct xt_tgchk_param *par,
814 int ret; 813 int ret;
815 814
816 if (XT_ALIGN(par->target->targetsize) != size) { 815 if (XT_ALIGN(par->target->targetsize) != size) {
817 pr_err("%s_tables: %s.%u target: invalid size " 816 pr_err_ratelimited("%s_tables: %s.%u target: invalid size %u (kernel) != (user) %u\n",
818 "%u (kernel) != (user) %u\n", 817 xt_prefix[par->family], par->target->name,
819 xt_prefix[par->family], par->target->name, 818 par->target->revision,
820 par->target->revision, 819 XT_ALIGN(par->target->targetsize), size);
821 XT_ALIGN(par->target->targetsize), size);
822 return -EINVAL; 820 return -EINVAL;
823 } 821 }
824 if (par->target->table != NULL && 822 if (par->target->table != NULL &&
825 strcmp(par->target->table, par->table) != 0) { 823 strcmp(par->target->table, par->table) != 0) {
826 pr_err("%s_tables: %s target: only valid in %s table, not %s\n", 824 pr_info_ratelimited("%s_tables: %s target: only valid in %s table, not %s\n",
827 xt_prefix[par->family], par->target->name, 825 xt_prefix[par->family], par->target->name,
828 par->target->table, par->table); 826 par->target->table, par->table);
829 return -EINVAL; 827 return -EINVAL;
830 } 828 }
831 if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) { 829 if (par->target->hooks && (par->hook_mask & ~par->target->hooks) != 0) {
832 char used[64], allow[64]; 830 char used[64], allow[64];
833 831
834 pr_err("%s_tables: %s target: used from hooks %s, but only " 832 pr_info_ratelimited("%s_tables: %s target: used from hooks %s, but only usable from %s\n",
835 "usable from %s\n", 833 xt_prefix[par->family], par->target->name,
836 xt_prefix[par->family], par->target->name, 834 textify_hooks(used, sizeof(used),
837 textify_hooks(used, sizeof(used), par->hook_mask, 835 par->hook_mask, par->family),
838 par->family), 836 textify_hooks(allow, sizeof(allow),
839 textify_hooks(allow, sizeof(allow), par->target->hooks, 837 par->target->hooks,
840 par->family)); 838 par->family));
841 return -EINVAL; 839 return -EINVAL;
842 } 840 }
843 if (par->target->proto && (par->target->proto != proto || inv_proto)) { 841 if (par->target->proto && (par->target->proto != proto || inv_proto)) {
844 pr_err("%s_tables: %s target: only valid for protocol %u\n", 842 pr_info_ratelimited("%s_tables: %s target: only valid for protocol %u\n",
845 xt_prefix[par->family], par->target->name, 843 xt_prefix[par->family], par->target->name,
846 par->target->proto); 844 par->target->proto);
847 return -EINVAL; 845 return -EINVAL;
848 } 846 }
849 if (par->target->checkentry != NULL) { 847 if (par->target->checkentry != NULL) {
@@ -1004,10 +1002,6 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
1004 if (sz < sizeof(*info)) 1002 if (sz < sizeof(*info))
1005 return NULL; 1003 return NULL;
1006 1004
1007 /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
1008 if ((size >> PAGE_SHIFT) + 2 > totalram_pages)
1009 return NULL;
1010
1011 /* __GFP_NORETRY is not fully supported by kvmalloc but it should 1005 /* __GFP_NORETRY is not fully supported by kvmalloc but it should
1012 * work reasonably well if sz is too large and bail out rather 1006 * work reasonably well if sz is too large and bail out rather
1013 * than shoot all processes down before realizing there is nothing 1007 * than shoot all processes down before realizing there is nothing
diff --git a/net/netfilter/xt_AUDIT.c b/net/netfilter/xt_AUDIT.c
index c502419d6306..f368ee6741db 100644
--- a/net/netfilter/xt_AUDIT.c
+++ b/net/netfilter/xt_AUDIT.c
@@ -120,8 +120,8 @@ static int audit_tg_check(const struct xt_tgchk_param *par)
120 const struct xt_audit_info *info = par->targinfo; 120 const struct xt_audit_info *info = par->targinfo;
121 121
122 if (info->type > XT_AUDIT_TYPE_MAX) { 122 if (info->type > XT_AUDIT_TYPE_MAX) {
123 pr_info("Audit type out of range (valid range: 0..%hhu)\n", 123 pr_info_ratelimited("Audit type out of range (valid range: 0..%hhu)\n",
124 XT_AUDIT_TYPE_MAX); 124 XT_AUDIT_TYPE_MAX);
125 return -ERANGE; 125 return -ERANGE;
126 } 126 }
127 127
diff --git a/net/netfilter/xt_CHECKSUM.c b/net/netfilter/xt_CHECKSUM.c
index 0f642ef8cd26..9f4151ec3e06 100644
--- a/net/netfilter/xt_CHECKSUM.c
+++ b/net/netfilter/xt_CHECKSUM.c
@@ -36,13 +36,13 @@ static int checksum_tg_check(const struct xt_tgchk_param *par)
36 const struct xt_CHECKSUM_info *einfo = par->targinfo; 36 const struct xt_CHECKSUM_info *einfo = par->targinfo;
37 37
38 if (einfo->operation & ~XT_CHECKSUM_OP_FILL) { 38 if (einfo->operation & ~XT_CHECKSUM_OP_FILL) {
39 pr_info("unsupported CHECKSUM operation %x\n", einfo->operation); 39 pr_info_ratelimited("unsupported CHECKSUM operation %x\n",
40 einfo->operation);
40 return -EINVAL; 41 return -EINVAL;
41 } 42 }
42 if (!einfo->operation) { 43 if (!einfo->operation)
43 pr_info("no CHECKSUM operation enabled\n");
44 return -EINVAL; 44 return -EINVAL;
45 } 45
46 return 0; 46 return 0;
47} 47}
48 48
diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index da56c06a443c..f3f1caac949b 100644
--- a/net/netfilter/xt_CONNSECMARK.c
+++ b/net/netfilter/xt_CONNSECMARK.c
@@ -91,8 +91,8 @@ static int connsecmark_tg_check(const struct xt_tgchk_param *par)
91 91
92 if (strcmp(par->table, "mangle") != 0 && 92 if (strcmp(par->table, "mangle") != 0 &&
93 strcmp(par->table, "security") != 0) { 93 strcmp(par->table, "security") != 0) {
94 pr_info("target only valid in the \'mangle\' " 94 pr_info_ratelimited("only valid in \'mangle\' or \'security\' table, not \'%s\'\n",
95 "or \'security\' tables, not \'%s\'.\n", par->table); 95 par->table);
96 return -EINVAL; 96 return -EINVAL;
97 } 97 }
98 98
@@ -102,14 +102,14 @@ static int connsecmark_tg_check(const struct xt_tgchk_param *par)
102 break; 102 break;
103 103
104 default: 104 default:
105 pr_info("invalid mode: %hu\n", info->mode); 105 pr_info_ratelimited("invalid mode: %hu\n", info->mode);
106 return -EINVAL; 106 return -EINVAL;
107 } 107 }
108 108
109 ret = nf_ct_netns_get(par->net, par->family); 109 ret = nf_ct_netns_get(par->net, par->family);
110 if (ret < 0) 110 if (ret < 0)
111 pr_info("cannot load conntrack support for proto=%u\n", 111 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
112 par->family); 112 par->family);
113 return ret; 113 return ret;
114} 114}
115 115
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 5a152e2acfd5..8790190c6feb 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -82,15 +82,14 @@ xt_ct_set_helper(struct nf_conn *ct, const char *helper_name,
82 82
83 proto = xt_ct_find_proto(par); 83 proto = xt_ct_find_proto(par);
84 if (!proto) { 84 if (!proto) {
85 pr_info("You must specify a L4 protocol, and not use " 85 pr_info_ratelimited("You must specify a L4 protocol and not use inversions on it\n");
86 "inversions on it.\n");
87 return -ENOENT; 86 return -ENOENT;
88 } 87 }
89 88
90 helper = nf_conntrack_helper_try_module_get(helper_name, par->family, 89 helper = nf_conntrack_helper_try_module_get(helper_name, par->family,
91 proto); 90 proto);
92 if (helper == NULL) { 91 if (helper == NULL) {
93 pr_info("No such helper \"%s\"\n", helper_name); 92 pr_info_ratelimited("No such helper \"%s\"\n", helper_name);
94 return -ENOENT; 93 return -ENOENT;
95 } 94 }
96 95
@@ -124,6 +123,7 @@ xt_ct_set_timeout(struct nf_conn *ct, const struct xt_tgchk_param *par,
124 const struct nf_conntrack_l4proto *l4proto; 123 const struct nf_conntrack_l4proto *l4proto;
125 struct ctnl_timeout *timeout; 124 struct ctnl_timeout *timeout;
126 struct nf_conn_timeout *timeout_ext; 125 struct nf_conn_timeout *timeout_ext;
126 const char *errmsg = NULL;
127 int ret = 0; 127 int ret = 0;
128 u8 proto; 128 u8 proto;
129 129
@@ -131,29 +131,29 @@ xt_ct_set_timeout(struct nf_conn *ct, const struct xt_tgchk_param *par,
131 timeout_find_get = rcu_dereference(nf_ct_timeout_find_get_hook); 131 timeout_find_get = rcu_dereference(nf_ct_timeout_find_get_hook);
132 if (timeout_find_get == NULL) { 132 if (timeout_find_get == NULL) {
133 ret = -ENOENT; 133 ret = -ENOENT;
134 pr_info("Timeout policy base is empty\n"); 134 errmsg = "Timeout policy base is empty";
135 goto out; 135 goto out;
136 } 136 }
137 137
138 proto = xt_ct_find_proto(par); 138 proto = xt_ct_find_proto(par);
139 if (!proto) { 139 if (!proto) {
140 ret = -EINVAL; 140 ret = -EINVAL;
141 pr_info("You must specify a L4 protocol, and not use " 141 errmsg = "You must specify a L4 protocol and not use inversions on it";
142 "inversions on it.\n");
143 goto out; 142 goto out;
144 } 143 }
145 144
146 timeout = timeout_find_get(par->net, timeout_name); 145 timeout = timeout_find_get(par->net, timeout_name);
147 if (timeout == NULL) { 146 if (timeout == NULL) {
148 ret = -ENOENT; 147 ret = -ENOENT;
149 pr_info("No such timeout policy \"%s\"\n", timeout_name); 148 pr_info_ratelimited("No such timeout policy \"%s\"\n",
149 timeout_name);
150 goto out; 150 goto out;
151 } 151 }
152 152
153 if (timeout->l3num != par->family) { 153 if (timeout->l3num != par->family) {
154 ret = -EINVAL; 154 ret = -EINVAL;
155 pr_info("Timeout policy `%s' can only be used by L3 protocol " 155 pr_info_ratelimited("Timeout policy `%s' can only be used by L%d protocol number %d\n",
156 "number %d\n", timeout_name, timeout->l3num); 156 timeout_name, 3, timeout->l3num);
157 goto err_put_timeout; 157 goto err_put_timeout;
158 } 158 }
159 /* Make sure the timeout policy matches any existing protocol tracker, 159 /* Make sure the timeout policy matches any existing protocol tracker,
@@ -162,9 +162,8 @@ xt_ct_set_timeout(struct nf_conn *ct, const struct xt_tgchk_param *par,
162 l4proto = __nf_ct_l4proto_find(par->family, proto); 162 l4proto = __nf_ct_l4proto_find(par->family, proto);
163 if (timeout->l4proto->l4proto != l4proto->l4proto) { 163 if (timeout->l4proto->l4proto != l4proto->l4proto) {
164 ret = -EINVAL; 164 ret = -EINVAL;
165 pr_info("Timeout policy `%s' can only be used by L4 protocol " 165 pr_info_ratelimited("Timeout policy `%s' can only be used by L%d protocol number %d\n",
166 "number %d\n", 166 timeout_name, 4, timeout->l4proto->l4proto);
167 timeout_name, timeout->l4proto->l4proto);
168 goto err_put_timeout; 167 goto err_put_timeout;
169 } 168 }
170 timeout_ext = nf_ct_timeout_ext_add(ct, timeout, GFP_ATOMIC); 169 timeout_ext = nf_ct_timeout_ext_add(ct, timeout, GFP_ATOMIC);
@@ -180,6 +179,8 @@ err_put_timeout:
180 __xt_ct_tg_timeout_put(timeout); 179 __xt_ct_tg_timeout_put(timeout);
181out: 180out:
182 rcu_read_unlock(); 181 rcu_read_unlock();
182 if (errmsg)
183 pr_info_ratelimited("%s\n", errmsg);
183 return ret; 184 return ret;
184#else 185#else
185 return -EOPNOTSUPP; 186 return -EOPNOTSUPP;
diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c
index 3f83d38c4e5b..098ed851b7a7 100644
--- a/net/netfilter/xt_DSCP.c
+++ b/net/netfilter/xt_DSCP.c
@@ -66,10 +66,8 @@ static int dscp_tg_check(const struct xt_tgchk_param *par)
66{ 66{
67 const struct xt_DSCP_info *info = par->targinfo; 67 const struct xt_DSCP_info *info = par->targinfo;
68 68
69 if (info->dscp > XT_DSCP_MAX) { 69 if (info->dscp > XT_DSCP_MAX)
70 pr_info("dscp %x out of range\n", info->dscp);
71 return -EDOM; 70 return -EDOM;
72 }
73 return 0; 71 return 0;
74} 72}
75 73
diff --git a/net/netfilter/xt_HL.c b/net/netfilter/xt_HL.c
index 1535e87ed9bd..4653b071bed4 100644
--- a/net/netfilter/xt_HL.c
+++ b/net/netfilter/xt_HL.c
@@ -105,10 +105,8 @@ static int ttl_tg_check(const struct xt_tgchk_param *par)
105{ 105{
106 const struct ipt_TTL_info *info = par->targinfo; 106 const struct ipt_TTL_info *info = par->targinfo;
107 107
108 if (info->mode > IPT_TTL_MAXMODE) { 108 if (info->mode > IPT_TTL_MAXMODE)
109 pr_info("TTL: invalid or unknown mode %u\n", info->mode);
110 return -EINVAL; 109 return -EINVAL;
111 }
112 if (info->mode != IPT_TTL_SET && info->ttl == 0) 110 if (info->mode != IPT_TTL_SET && info->ttl == 0)
113 return -EINVAL; 111 return -EINVAL;
114 return 0; 112 return 0;
@@ -118,15 +116,10 @@ static int hl_tg6_check(const struct xt_tgchk_param *par)
118{ 116{
119 const struct ip6t_HL_info *info = par->targinfo; 117 const struct ip6t_HL_info *info = par->targinfo;
120 118
121 if (info->mode > IP6T_HL_MAXMODE) { 119 if (info->mode > IP6T_HL_MAXMODE)
122 pr_info("invalid or unknown mode %u\n", info->mode);
123 return -EINVAL; 120 return -EINVAL;
124 } 121 if (info->mode != IP6T_HL_SET && info->hop_limit == 0)
125 if (info->mode != IP6T_HL_SET && info->hop_limit == 0) {
126 pr_info("increment/decrement does not "
127 "make sense with value 0\n");
128 return -EINVAL; 122 return -EINVAL;
129 }
130 return 0; 123 return 0;
131} 124}
132 125
diff --git a/net/netfilter/xt_HMARK.c b/net/netfilter/xt_HMARK.c
index 60e6dbe12460..9c75f419cd80 100644
--- a/net/netfilter/xt_HMARK.c
+++ b/net/netfilter/xt_HMARK.c
@@ -9,6 +9,8 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/module.h> 14#include <linux/module.h>
13#include <linux/skbuff.h> 15#include <linux/skbuff.h>
14#include <linux/icmp.h> 16#include <linux/icmp.h>
@@ -312,29 +314,30 @@ hmark_tg_v4(struct sk_buff *skb, const struct xt_action_param *par)
312static int hmark_tg_check(const struct xt_tgchk_param *par) 314static int hmark_tg_check(const struct xt_tgchk_param *par)
313{ 315{
314 const struct xt_hmark_info *info = par->targinfo; 316 const struct xt_hmark_info *info = par->targinfo;
317 const char *errmsg = "proto mask must be zero with L3 mode";
315 318
316 if (!info->hmodulus) { 319 if (!info->hmodulus)
317 pr_info("xt_HMARK: hash modulus can't be zero\n");
318 return -EINVAL; 320 return -EINVAL;
319 } 321
320 if (info->proto_mask && 322 if (info->proto_mask &&
321 (info->flags & XT_HMARK_FLAG(XT_HMARK_METHOD_L3))) { 323 (info->flags & XT_HMARK_FLAG(XT_HMARK_METHOD_L3)))
322 pr_info("xt_HMARK: proto mask must be zero with L3 mode\n"); 324 goto err;
323 return -EINVAL; 325
324 }
325 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI_MASK) && 326 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI_MASK) &&
326 (info->flags & (XT_HMARK_FLAG(XT_HMARK_SPORT_MASK) | 327 (info->flags & (XT_HMARK_FLAG(XT_HMARK_SPORT_MASK) |
327 XT_HMARK_FLAG(XT_HMARK_DPORT_MASK)))) { 328 XT_HMARK_FLAG(XT_HMARK_DPORT_MASK))))
328 pr_info("xt_HMARK: spi-mask and port-mask can't be combined\n");
329 return -EINVAL; 329 return -EINVAL;
330 } 330
331 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI) && 331 if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI) &&
332 (info->flags & (XT_HMARK_FLAG(XT_HMARK_SPORT) | 332 (info->flags & (XT_HMARK_FLAG(XT_HMARK_SPORT) |
333 XT_HMARK_FLAG(XT_HMARK_DPORT)))) { 333 XT_HMARK_FLAG(XT_HMARK_DPORT)))) {
334 pr_info("xt_HMARK: spi-set and port-set can't be combined\n"); 334 errmsg = "spi-set and port-set can't be combined";
335 return -EINVAL; 335 goto err;
336 } 336 }
337 return 0; 337 return 0;
338err:
339 pr_info_ratelimited("%s\n", errmsg);
340 return -EINVAL;
338} 341}
339 342
340static struct xt_target hmark_tg_reg[] __read_mostly = { 343static struct xt_target hmark_tg_reg[] __read_mostly = {
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index 6c2482b709b1..1ac6600bfafd 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -146,11 +146,11 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
146 timer_setup(&info->timer->timer, idletimer_tg_expired, 0); 146 timer_setup(&info->timer->timer, idletimer_tg_expired, 0);
147 info->timer->refcnt = 1; 147 info->timer->refcnt = 1;
148 148
149 INIT_WORK(&info->timer->work, idletimer_tg_work);
150
149 mod_timer(&info->timer->timer, 151 mod_timer(&info->timer->timer,
150 msecs_to_jiffies(info->timeout * 1000) + jiffies); 152 msecs_to_jiffies(info->timeout * 1000) + jiffies);
151 153
152 INIT_WORK(&info->timer->work, idletimer_tg_work);
153
154 return 0; 154 return 0;
155 155
156out_free_attr: 156out_free_attr:
@@ -191,7 +191,10 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)
191 pr_debug("timeout value is zero\n"); 191 pr_debug("timeout value is zero\n");
192 return -EINVAL; 192 return -EINVAL;
193 } 193 }
194 194 if (info->timeout >= INT_MAX / 1000) {
195 pr_debug("timeout value is too big\n");
196 return -EINVAL;
197 }
195 if (info->label[0] == '\0' || 198 if (info->label[0] == '\0' ||
196 strnlen(info->label, 199 strnlen(info->label,
197 MAX_IDLETIMER_LABEL_SIZE) == MAX_IDLETIMER_LABEL_SIZE) { 200 MAX_IDLETIMER_LABEL_SIZE) == MAX_IDLETIMER_LABEL_SIZE) {
diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c
index 1dcad893df78..19846445504d 100644
--- a/net/netfilter/xt_LED.c
+++ b/net/netfilter/xt_LED.c
@@ -111,10 +111,8 @@ static int led_tg_check(const struct xt_tgchk_param *par)
111 struct xt_led_info_internal *ledinternal; 111 struct xt_led_info_internal *ledinternal;
112 int err; 112 int err;
113 113
114 if (ledinfo->id[0] == '\0') { 114 if (ledinfo->id[0] == '\0')
115 pr_info("No 'id' parameter given.\n");
116 return -EINVAL; 115 return -EINVAL;
117 }
118 116
119 mutex_lock(&xt_led_mutex); 117 mutex_lock(&xt_led_mutex);
120 118
@@ -138,13 +136,14 @@ static int led_tg_check(const struct xt_tgchk_param *par)
138 136
139 err = led_trigger_register(&ledinternal->netfilter_led_trigger); 137 err = led_trigger_register(&ledinternal->netfilter_led_trigger);
140 if (err) { 138 if (err) {
141 pr_err("Trigger name is already in use.\n"); 139 pr_info_ratelimited("Trigger name is already in use.\n");
142 goto exit_alloc; 140 goto exit_alloc;
143 } 141 }
144 142
145 /* See if we need to set up a timer */ 143 /* Since the letinternal timer can be shared between multiple targets,
146 if (ledinfo->delay > 0) 144 * always set it up, even if the current target does not need it
147 timer_setup(&ledinternal->timer, led_timeout_callback, 0); 145 */
146 timer_setup(&ledinternal->timer, led_timeout_callback, 0);
148 147
149 list_add_tail(&ledinternal->list, &xt_led_triggers); 148 list_add_tail(&ledinternal->list, &xt_led_triggers);
150 149
@@ -181,8 +180,7 @@ static void led_tg_destroy(const struct xt_tgdtor_param *par)
181 180
182 list_del(&ledinternal->list); 181 list_del(&ledinternal->list);
183 182
184 if (ledinfo->delay > 0) 183 del_timer_sync(&ledinternal->timer);
185 del_timer_sync(&ledinternal->timer);
186 184
187 led_trigger_unregister(&ledinternal->netfilter_led_trigger); 185 led_trigger_unregister(&ledinternal->netfilter_led_trigger);
188 186
diff --git a/net/netfilter/xt_NFQUEUE.c b/net/netfilter/xt_NFQUEUE.c
index a360b99a958a..a9aca80a32ae 100644
--- a/net/netfilter/xt_NFQUEUE.c
+++ b/net/netfilter/xt_NFQUEUE.c
@@ -8,6 +8,8 @@
8 * 8 *
9 */ 9 */
10 10
11#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12
11#include <linux/module.h> 13#include <linux/module.h>
12#include <linux/skbuff.h> 14#include <linux/skbuff.h>
13 15
@@ -67,13 +69,13 @@ static int nfqueue_tg_check(const struct xt_tgchk_param *par)
67 init_hashrandom(&jhash_initval); 69 init_hashrandom(&jhash_initval);
68 70
69 if (info->queues_total == 0) { 71 if (info->queues_total == 0) {
70 pr_err("NFQUEUE: number of total queues is 0\n"); 72 pr_info_ratelimited("number of total queues is 0\n");
71 return -EINVAL; 73 return -EINVAL;
72 } 74 }
73 maxid = info->queues_total - 1 + info->queuenum; 75 maxid = info->queues_total - 1 + info->queuenum;
74 if (maxid > 0xffff) { 76 if (maxid > 0xffff) {
75 pr_err("NFQUEUE: number of queues (%u) out of range (got %u)\n", 77 pr_info_ratelimited("number of queues (%u) out of range (got %u)\n",
76 info->queues_total, maxid); 78 info->queues_total, maxid);
77 return -ERANGE; 79 return -ERANGE;
78 } 80 }
79 if (par->target->revision == 2 && info->flags > 1) 81 if (par->target->revision == 2 && info->flags > 1)
diff --git a/net/netfilter/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c
index 9faf5e050b79..4ad5fe27e08b 100644
--- a/net/netfilter/xt_SECMARK.c
+++ b/net/netfilter/xt_SECMARK.c
@@ -60,18 +60,20 @@ static int checkentry_lsm(struct xt_secmark_target_info *info)
60 &info->secid); 60 &info->secid);
61 if (err) { 61 if (err) {
62 if (err == -EINVAL) 62 if (err == -EINVAL)
63 pr_info("invalid security context \'%s\'\n", info->secctx); 63 pr_info_ratelimited("invalid security context \'%s\'\n",
64 info->secctx);
64 return err; 65 return err;
65 } 66 }
66 67
67 if (!info->secid) { 68 if (!info->secid) {
68 pr_info("unable to map security context \'%s\'\n", info->secctx); 69 pr_info_ratelimited("unable to map security context \'%s\'\n",
70 info->secctx);
69 return -ENOENT; 71 return -ENOENT;
70 } 72 }
71 73
72 err = security_secmark_relabel_packet(info->secid); 74 err = security_secmark_relabel_packet(info->secid);
73 if (err) { 75 if (err) {
74 pr_info("unable to obtain relabeling permission\n"); 76 pr_info_ratelimited("unable to obtain relabeling permission\n");
75 return err; 77 return err;
76 } 78 }
77 79
@@ -86,14 +88,14 @@ static int secmark_tg_check(const struct xt_tgchk_param *par)
86 88
87 if (strcmp(par->table, "mangle") != 0 && 89 if (strcmp(par->table, "mangle") != 0 &&
88 strcmp(par->table, "security") != 0) { 90 strcmp(par->table, "security") != 0) {
89 pr_info("target only valid in the \'mangle\' " 91 pr_info_ratelimited("only valid in \'mangle\' or \'security\' table, not \'%s\'\n",
90 "or \'security\' tables, not \'%s\'.\n", par->table); 92 par->table);
91 return -EINVAL; 93 return -EINVAL;
92 } 94 }
93 95
94 if (mode && mode != info->mode) { 96 if (mode && mode != info->mode) {
95 pr_info("mode already set to %hu cannot mix with " 97 pr_info_ratelimited("mode already set to %hu cannot mix with rules for mode %hu\n",
96 "rules for mode %hu\n", mode, info->mode); 98 mode, info->mode);
97 return -EINVAL; 99 return -EINVAL;
98 } 100 }
99 101
@@ -101,7 +103,7 @@ static int secmark_tg_check(const struct xt_tgchk_param *par)
101 case SECMARK_MODE_SEL: 103 case SECMARK_MODE_SEL:
102 break; 104 break;
103 default: 105 default:
104 pr_info("invalid mode: %hu\n", info->mode); 106 pr_info_ratelimited("invalid mode: %hu\n", info->mode);
105 return -EINVAL; 107 return -EINVAL;
106 } 108 }
107 109
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 99bb8e410f22..98efb202f8b4 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -273,8 +273,7 @@ static int tcpmss_tg4_check(const struct xt_tgchk_param *par)
273 (par->hook_mask & ~((1 << NF_INET_FORWARD) | 273 (par->hook_mask & ~((1 << NF_INET_FORWARD) |
274 (1 << NF_INET_LOCAL_OUT) | 274 (1 << NF_INET_LOCAL_OUT) |
275 (1 << NF_INET_POST_ROUTING))) != 0) { 275 (1 << NF_INET_POST_ROUTING))) != 0) {
276 pr_info("path-MTU clamping only supported in " 276 pr_info_ratelimited("path-MTU clamping only supported in FORWARD, OUTPUT and POSTROUTING hooks\n");
277 "FORWARD, OUTPUT and POSTROUTING hooks\n");
278 return -EINVAL; 277 return -EINVAL;
279 } 278 }
280 if (par->nft_compat) 279 if (par->nft_compat)
@@ -283,7 +282,7 @@ static int tcpmss_tg4_check(const struct xt_tgchk_param *par)
283 xt_ematch_foreach(ematch, e) 282 xt_ematch_foreach(ematch, e)
284 if (find_syn_match(ematch)) 283 if (find_syn_match(ematch))
285 return 0; 284 return 0;
286 pr_info("Only works on TCP SYN packets\n"); 285 pr_info_ratelimited("Only works on TCP SYN packets\n");
287 return -EINVAL; 286 return -EINVAL;
288} 287}
289 288
@@ -298,8 +297,7 @@ static int tcpmss_tg6_check(const struct xt_tgchk_param *par)
298 (par->hook_mask & ~((1 << NF_INET_FORWARD) | 297 (par->hook_mask & ~((1 << NF_INET_FORWARD) |
299 (1 << NF_INET_LOCAL_OUT) | 298 (1 << NF_INET_LOCAL_OUT) |
300 (1 << NF_INET_POST_ROUTING))) != 0) { 299 (1 << NF_INET_POST_ROUTING))) != 0) {
301 pr_info("path-MTU clamping only supported in " 300 pr_info_ratelimited("path-MTU clamping only supported in FORWARD, OUTPUT and POSTROUTING hooks\n");
302 "FORWARD, OUTPUT and POSTROUTING hooks\n");
303 return -EINVAL; 301 return -EINVAL;
304 } 302 }
305 if (par->nft_compat) 303 if (par->nft_compat)
@@ -308,7 +306,7 @@ static int tcpmss_tg6_check(const struct xt_tgchk_param *par)
308 xt_ematch_foreach(ematch, e) 306 xt_ematch_foreach(ematch, e)
309 if (find_syn_match(ematch)) 307 if (find_syn_match(ematch))
310 return 0; 308 return 0;
311 pr_info("Only works on TCP SYN packets\n"); 309 pr_info_ratelimited("Only works on TCP SYN packets\n");
312 return -EINVAL; 310 return -EINVAL;
313} 311}
314#endif 312#endif
diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c
index 17d7705e3bd4..8c89323c06af 100644
--- a/net/netfilter/xt_TPROXY.c
+++ b/net/netfilter/xt_TPROXY.c
@@ -540,8 +540,7 @@ static int tproxy_tg6_check(const struct xt_tgchk_param *par)
540 !(i->invflags & IP6T_INV_PROTO)) 540 !(i->invflags & IP6T_INV_PROTO))
541 return 0; 541 return 0;
542 542
543 pr_info("Can be used only in combination with " 543 pr_info_ratelimited("Can be used only with -p tcp or -p udp\n");
544 "either -p tcp or -p udp\n");
545 return -EINVAL; 544 return -EINVAL;
546} 545}
547#endif 546#endif
@@ -559,8 +558,7 @@ static int tproxy_tg4_check(const struct xt_tgchk_param *par)
559 && !(i->invflags & IPT_INV_PROTO)) 558 && !(i->invflags & IPT_INV_PROTO))
560 return 0; 559 return 0;
561 560
562 pr_info("Can be used only in combination with " 561 pr_info_ratelimited("Can be used only with -p tcp or -p udp\n");
563 "either -p tcp or -p udp\n");
564 return -EINVAL; 562 return -EINVAL;
565} 563}
566 564
diff --git a/net/netfilter/xt_addrtype.c b/net/netfilter/xt_addrtype.c
index 911a7c0da504..89e281b3bfc2 100644
--- a/net/netfilter/xt_addrtype.c
+++ b/net/netfilter/xt_addrtype.c
@@ -164,48 +164,47 @@ addrtype_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
164 164
165static int addrtype_mt_checkentry_v1(const struct xt_mtchk_param *par) 165static int addrtype_mt_checkentry_v1(const struct xt_mtchk_param *par)
166{ 166{
167 const char *errmsg = "both incoming and outgoing interface limitation cannot be selected";
167 struct xt_addrtype_info_v1 *info = par->matchinfo; 168 struct xt_addrtype_info_v1 *info = par->matchinfo;
168 169
169 if (info->flags & XT_ADDRTYPE_LIMIT_IFACE_IN && 170 if (info->flags & XT_ADDRTYPE_LIMIT_IFACE_IN &&
170 info->flags & XT_ADDRTYPE_LIMIT_IFACE_OUT) { 171 info->flags & XT_ADDRTYPE_LIMIT_IFACE_OUT)
171 pr_info("both incoming and outgoing " 172 goto err;
172 "interface limitation cannot be selected\n");
173 return -EINVAL;
174 }
175 173
176 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) | 174 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) |
177 (1 << NF_INET_LOCAL_IN)) && 175 (1 << NF_INET_LOCAL_IN)) &&
178 info->flags & XT_ADDRTYPE_LIMIT_IFACE_OUT) { 176 info->flags & XT_ADDRTYPE_LIMIT_IFACE_OUT) {
179 pr_info("output interface limitation " 177 errmsg = "output interface limitation not valid in PREROUTING and INPUT";
180 "not valid in PREROUTING and INPUT\n"); 178 goto err;
181 return -EINVAL;
182 } 179 }
183 180
184 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) | 181 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) |
185 (1 << NF_INET_LOCAL_OUT)) && 182 (1 << NF_INET_LOCAL_OUT)) &&
186 info->flags & XT_ADDRTYPE_LIMIT_IFACE_IN) { 183 info->flags & XT_ADDRTYPE_LIMIT_IFACE_IN) {
187 pr_info("input interface limitation " 184 errmsg = "input interface limitation not valid in POSTROUTING and OUTPUT";
188 "not valid in POSTROUTING and OUTPUT\n"); 185 goto err;
189 return -EINVAL;
190 } 186 }
191 187
192#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 188#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
193 if (par->family == NFPROTO_IPV6) { 189 if (par->family == NFPROTO_IPV6) {
194 if ((info->source | info->dest) & XT_ADDRTYPE_BLACKHOLE) { 190 if ((info->source | info->dest) & XT_ADDRTYPE_BLACKHOLE) {
195 pr_err("ipv6 BLACKHOLE matching not supported\n"); 191 errmsg = "ipv6 BLACKHOLE matching not supported";
196 return -EINVAL; 192 goto err;
197 } 193 }
198 if ((info->source | info->dest) >= XT_ADDRTYPE_PROHIBIT) { 194 if ((info->source | info->dest) >= XT_ADDRTYPE_PROHIBIT) {
199 pr_err("ipv6 PROHIBIT (THROW, NAT ..) matching not supported\n"); 195 errmsg = "ipv6 PROHIBIT (THROW, NAT ..) matching not supported";
200 return -EINVAL; 196 goto err;
201 } 197 }
202 if ((info->source | info->dest) & XT_ADDRTYPE_BROADCAST) { 198 if ((info->source | info->dest) & XT_ADDRTYPE_BROADCAST) {
203 pr_err("ipv6 does not support BROADCAST matching\n"); 199 errmsg = "ipv6 does not support BROADCAST matching";
204 return -EINVAL; 200 goto err;
205 } 201 }
206 } 202 }
207#endif 203#endif
208 return 0; 204 return 0;
205err:
206 pr_info_ratelimited("%s\n", errmsg);
207 return -EINVAL;
209} 208}
210 209
211static struct xt_match addrtype_mt_reg[] __read_mostly = { 210static struct xt_match addrtype_mt_reg[] __read_mostly = {
diff --git a/net/netfilter/xt_bpf.c b/net/netfilter/xt_bpf.c
index 06b090d8e901..a2cf8a6236d6 100644
--- a/net/netfilter/xt_bpf.c
+++ b/net/netfilter/xt_bpf.c
@@ -7,6 +7,8 @@
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 */ 8 */
9 9
10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11
10#include <linux/module.h> 12#include <linux/module.h>
11#include <linux/syscalls.h> 13#include <linux/syscalls.h>
12#include <linux/skbuff.h> 14#include <linux/skbuff.h>
@@ -34,7 +36,7 @@ static int __bpf_mt_check_bytecode(struct sock_filter *insns, __u16 len,
34 program.filter = insns; 36 program.filter = insns;
35 37
36 if (bpf_prog_create(ret, &program)) { 38 if (bpf_prog_create(ret, &program)) {
37 pr_info("bpf: check failed: parse error\n"); 39 pr_info_ratelimited("check failed: parse error\n");
38 return -EINVAL; 40 return -EINVAL;
39 } 41 }
40 42
diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c
index 891f4e7e8ea7..7df2dece57d3 100644
--- a/net/netfilter/xt_cgroup.c
+++ b/net/netfilter/xt_cgroup.c
@@ -12,6 +12,8 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16
15#include <linux/skbuff.h> 17#include <linux/skbuff.h>
16#include <linux/module.h> 18#include <linux/module.h>
17#include <linux/netfilter/x_tables.h> 19#include <linux/netfilter/x_tables.h>
@@ -48,7 +50,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
48 } 50 }
49 51
50 if (info->has_path && info->has_classid) { 52 if (info->has_path && info->has_classid) {
51 pr_info("xt_cgroup: both path and classid specified\n"); 53 pr_info_ratelimited("path and classid specified\n");
52 return -EINVAL; 54 return -EINVAL;
53 } 55 }
54 56
@@ -56,8 +58,8 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
56 if (info->has_path) { 58 if (info->has_path) {
57 cgrp = cgroup_get_from_path(info->path); 59 cgrp = cgroup_get_from_path(info->path);
58 if (IS_ERR(cgrp)) { 60 if (IS_ERR(cgrp)) {
59 pr_info("xt_cgroup: invalid path, errno=%ld\n", 61 pr_info_ratelimited("invalid path, errno=%ld\n",
60 PTR_ERR(cgrp)); 62 PTR_ERR(cgrp));
61 return -EINVAL; 63 return -EINVAL;
62 } 64 }
63 info->priv = cgrp; 65 info->priv = cgrp;
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c
index 57ef175dfbfa..0068688995c8 100644
--- a/net/netfilter/xt_cluster.c
+++ b/net/netfilter/xt_cluster.c
@@ -135,14 +135,12 @@ static int xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
135 struct xt_cluster_match_info *info = par->matchinfo; 135 struct xt_cluster_match_info *info = par->matchinfo;
136 136
137 if (info->total_nodes > XT_CLUSTER_NODES_MAX) { 137 if (info->total_nodes > XT_CLUSTER_NODES_MAX) {
138 pr_info("you have exceeded the maximum " 138 pr_info_ratelimited("you have exceeded the maximum number of cluster nodes (%u > %u)\n",
139 "number of cluster nodes (%u > %u)\n", 139 info->total_nodes, XT_CLUSTER_NODES_MAX);
140 info->total_nodes, XT_CLUSTER_NODES_MAX);
141 return -EINVAL; 140 return -EINVAL;
142 } 141 }
143 if (info->node_mask >= (1ULL << info->total_nodes)) { 142 if (info->node_mask >= (1ULL << info->total_nodes)) {
144 pr_info("this node mask cannot be " 143 pr_info_ratelimited("node mask cannot exceed total number of nodes\n");
145 "higher than the total number of nodes\n");
146 return -EDOM; 144 return -EDOM;
147 } 145 }
148 return 0; 146 return 0;
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index cad0b7b5eb35..93cb018c3055 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -112,8 +112,8 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par)
112 112
113 ret = nf_ct_netns_get(par->net, par->family); 113 ret = nf_ct_netns_get(par->net, par->family);
114 if (ret < 0) 114 if (ret < 0)
115 pr_info("cannot load conntrack support for proto=%u\n", 115 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
116 par->family); 116 par->family);
117 117
118 /* 118 /*
119 * This filter cannot function correctly unless connection tracking 119 * This filter cannot function correctly unless connection tracking
diff --git a/net/netfilter/xt_connlabel.c b/net/netfilter/xt_connlabel.c
index 23372879e6e3..4fa4efd24353 100644
--- a/net/netfilter/xt_connlabel.c
+++ b/net/netfilter/xt_connlabel.c
@@ -57,14 +57,15 @@ static int connlabel_mt_check(const struct xt_mtchk_param *par)
57 int ret; 57 int ret;
58 58
59 if (info->options & ~options) { 59 if (info->options & ~options) {
60 pr_err("Unknown options in mask %x\n", info->options); 60 pr_info_ratelimited("Unknown options in mask %x\n",
61 info->options);
61 return -EINVAL; 62 return -EINVAL;
62 } 63 }
63 64
64 ret = nf_ct_netns_get(par->net, par->family); 65 ret = nf_ct_netns_get(par->net, par->family);
65 if (ret < 0) { 66 if (ret < 0) {
66 pr_info("cannot load conntrack support for proto=%u\n", 67 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
67 par->family); 68 par->family);
68 return ret; 69 return ret;
69 } 70 }
70 71
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index ec377cc6a369..809639ce6f5a 100644
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -79,8 +79,8 @@ static int connmark_tg_check(const struct xt_tgchk_param *par)
79 79
80 ret = nf_ct_netns_get(par->net, par->family); 80 ret = nf_ct_netns_get(par->net, par->family);
81 if (ret < 0) 81 if (ret < 0)
82 pr_info("cannot load conntrack support for proto=%u\n", 82 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
83 par->family); 83 par->family);
84 return ret; 84 return ret;
85} 85}
86 86
@@ -109,8 +109,8 @@ static int connmark_mt_check(const struct xt_mtchk_param *par)
109 109
110 ret = nf_ct_netns_get(par->net, par->family); 110 ret = nf_ct_netns_get(par->net, par->family);
111 if (ret < 0) 111 if (ret < 0)
112 pr_info("cannot load conntrack support for proto=%u\n", 112 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
113 par->family); 113 par->family);
114 return ret; 114 return ret;
115} 115}
116 116
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
index 39cf1d019240..df80fe7d391c 100644
--- a/net/netfilter/xt_conntrack.c
+++ b/net/netfilter/xt_conntrack.c
@@ -272,8 +272,8 @@ static int conntrack_mt_check(const struct xt_mtchk_param *par)
272 272
273 ret = nf_ct_netns_get(par->net, par->family); 273 ret = nf_ct_netns_get(par->net, par->family);
274 if (ret < 0) 274 if (ret < 0)
275 pr_info("cannot load conntrack support for proto=%u\n", 275 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
276 par->family); 276 par->family);
277 return ret; 277 return ret;
278} 278}
279 279
diff --git a/net/netfilter/xt_dscp.c b/net/netfilter/xt_dscp.c
index 236ac8008909..a4c2b862f820 100644
--- a/net/netfilter/xt_dscp.c
+++ b/net/netfilter/xt_dscp.c
@@ -46,10 +46,8 @@ static int dscp_mt_check(const struct xt_mtchk_param *par)
46{ 46{
47 const struct xt_dscp_info *info = par->matchinfo; 47 const struct xt_dscp_info *info = par->matchinfo;
48 48
49 if (info->dscp > XT_DSCP_MAX) { 49 if (info->dscp > XT_DSCP_MAX)
50 pr_info("dscp %x out of range\n", info->dscp);
51 return -EDOM; 50 return -EDOM;
52 }
53 51
54 return 0; 52 return 0;
55} 53}
diff --git a/net/netfilter/xt_ecn.c b/net/netfilter/xt_ecn.c
index 3c831a8efebc..c7ad4afa5fb8 100644
--- a/net/netfilter/xt_ecn.c
+++ b/net/netfilter/xt_ecn.c
@@ -97,7 +97,7 @@ static int ecn_mt_check4(const struct xt_mtchk_param *par)
97 97
98 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) && 98 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&
99 (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) { 99 (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) {
100 pr_info("cannot match TCP bits in rule for non-tcp packets\n"); 100 pr_info_ratelimited("cannot match TCP bits for non-tcp packets\n");
101 return -EINVAL; 101 return -EINVAL;
102 } 102 }
103 103
@@ -139,7 +139,7 @@ static int ecn_mt_check6(const struct xt_mtchk_param *par)
139 139
140 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) && 140 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&
141 (ip->proto != IPPROTO_TCP || ip->invflags & IP6T_INV_PROTO)) { 141 (ip->proto != IPPROTO_TCP || ip->invflags & IP6T_INV_PROTO)) {
142 pr_info("cannot match TCP bits in rule for non-tcp packets\n"); 142 pr_info_ratelimited("cannot match TCP bits for non-tcp packets\n");
143 return -EINVAL; 143 return -EINVAL;
144 } 144 }
145 145
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index ca6847403ca2..66f5aca62a08 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -523,7 +523,8 @@ static u64 user2rate(u64 user)
523 if (user != 0) { 523 if (user != 0) {
524 return div64_u64(XT_HASHLIMIT_SCALE_v2, user); 524 return div64_u64(XT_HASHLIMIT_SCALE_v2, user);
525 } else { 525 } else {
526 pr_warn("invalid rate from userspace: %llu\n", user); 526 pr_info_ratelimited("invalid rate from userspace: %llu\n",
527 user);
527 return 0; 528 return 0;
528 } 529 }
529} 530}
@@ -774,7 +775,7 @@ hashlimit_mt_common(const struct sk_buff *skb, struct xt_action_param *par,
774 if (!dh->rateinfo.prev_window && 775 if (!dh->rateinfo.prev_window &&
775 (dh->rateinfo.current_rate <= dh->rateinfo.burst)) { 776 (dh->rateinfo.current_rate <= dh->rateinfo.burst)) {
776 spin_unlock(&dh->lock); 777 spin_unlock(&dh->lock);
777 rcu_read_unlock_bh(); 778 local_bh_enable();
778 return !(cfg->mode & XT_HASHLIMIT_INVERT); 779 return !(cfg->mode & XT_HASHLIMIT_INVERT);
779 } else { 780 } else {
780 goto overlimit; 781 goto overlimit;
@@ -865,33 +866,34 @@ static int hashlimit_mt_check_common(const struct xt_mtchk_param *par,
865 } 866 }
866 867
867 if (cfg->mode & ~XT_HASHLIMIT_ALL) { 868 if (cfg->mode & ~XT_HASHLIMIT_ALL) {
868 pr_info("Unknown mode mask %X, kernel too old?\n", 869 pr_info_ratelimited("Unknown mode mask %X, kernel too old?\n",
869 cfg->mode); 870 cfg->mode);
870 return -EINVAL; 871 return -EINVAL;
871 } 872 }
872 873
873 /* Check for overflow. */ 874 /* Check for overflow. */
874 if (revision >= 3 && cfg->mode & XT_HASHLIMIT_RATE_MATCH) { 875 if (revision >= 3 && cfg->mode & XT_HASHLIMIT_RATE_MATCH) {
875 if (cfg->avg == 0 || cfg->avg > U32_MAX) { 876 if (cfg->avg == 0 || cfg->avg > U32_MAX) {
876 pr_info("hashlimit invalid rate\n"); 877 pr_info_ratelimited("invalid rate\n");
877 return -ERANGE; 878 return -ERANGE;
878 } 879 }
879 880
880 if (cfg->interval == 0) { 881 if (cfg->interval == 0) {
881 pr_info("hashlimit invalid interval\n"); 882 pr_info_ratelimited("invalid interval\n");
882 return -EINVAL; 883 return -EINVAL;
883 } 884 }
884 } else if (cfg->mode & XT_HASHLIMIT_BYTES) { 885 } else if (cfg->mode & XT_HASHLIMIT_BYTES) {
885 if (user2credits_byte(cfg->avg) == 0) { 886 if (user2credits_byte(cfg->avg) == 0) {
886 pr_info("overflow, rate too high: %llu\n", cfg->avg); 887 pr_info_ratelimited("overflow, rate too high: %llu\n",
888 cfg->avg);
887 return -EINVAL; 889 return -EINVAL;
888 } 890 }
889 } else if (cfg->burst == 0 || 891 } else if (cfg->burst == 0 ||
890 user2credits(cfg->avg * cfg->burst, revision) < 892 user2credits(cfg->avg * cfg->burst, revision) <
891 user2credits(cfg->avg, revision)) { 893 user2credits(cfg->avg, revision)) {
892 pr_info("overflow, try lower: %llu/%llu\n", 894 pr_info_ratelimited("overflow, try lower: %llu/%llu\n",
893 cfg->avg, cfg->burst); 895 cfg->avg, cfg->burst);
894 return -ERANGE; 896 return -ERANGE;
895 } 897 }
896 898
897 mutex_lock(&hashlimit_mutex); 899 mutex_lock(&hashlimit_mutex);
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c
index 38a78151c0e9..fd077aeaaed9 100644
--- a/net/netfilter/xt_helper.c
+++ b/net/netfilter/xt_helper.c
@@ -61,8 +61,8 @@ static int helper_mt_check(const struct xt_mtchk_param *par)
61 61
62 ret = nf_ct_netns_get(par->net, par->family); 62 ret = nf_ct_netns_get(par->net, par->family);
63 if (ret < 0) { 63 if (ret < 0) {
64 pr_info("cannot load conntrack support for proto=%u\n", 64 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
65 par->family); 65 par->family);
66 return ret; 66 return ret;
67 } 67 }
68 info->name[sizeof(info->name) - 1] = '\0'; 68 info->name[sizeof(info->name) - 1] = '\0';
diff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c
index 7ca64a50db04..57f1df575701 100644
--- a/net/netfilter/xt_ipcomp.c
+++ b/net/netfilter/xt_ipcomp.c
@@ -72,7 +72,7 @@ static int comp_mt_check(const struct xt_mtchk_param *par)
72 72
73 /* Must specify no unknown invflags */ 73 /* Must specify no unknown invflags */
74 if (compinfo->invflags & ~XT_IPCOMP_INV_MASK) { 74 if (compinfo->invflags & ~XT_IPCOMP_INV_MASK) {
75 pr_err("unknown flags %X\n", compinfo->invflags); 75 pr_info_ratelimited("unknown flags %X\n", compinfo->invflags);
76 return -EINVAL; 76 return -EINVAL;
77 } 77 }
78 return 0; 78 return 0;
diff --git a/net/netfilter/xt_ipvs.c b/net/netfilter/xt_ipvs.c
index 42540d26c2b8..1d950a6100af 100644
--- a/net/netfilter/xt_ipvs.c
+++ b/net/netfilter/xt_ipvs.c
@@ -158,7 +158,8 @@ static int ipvs_mt_check(const struct xt_mtchk_param *par)
158 && par->family != NFPROTO_IPV6 158 && par->family != NFPROTO_IPV6
159#endif 159#endif
160 ) { 160 ) {
161 pr_info("protocol family %u not supported\n", par->family); 161 pr_info_ratelimited("protocol family %u not supported\n",
162 par->family);
162 return -EINVAL; 163 return -EINVAL;
163 } 164 }
164 165
diff --git a/net/netfilter/xt_l2tp.c b/net/netfilter/xt_l2tp.c
index 8aee572771f2..c43482bf48e6 100644
--- a/net/netfilter/xt_l2tp.c
+++ b/net/netfilter/xt_l2tp.c
@@ -216,7 +216,7 @@ static int l2tp_mt_check(const struct xt_mtchk_param *par)
216 /* Check for invalid flags */ 216 /* Check for invalid flags */
217 if (info->flags & ~(XT_L2TP_TID | XT_L2TP_SID | XT_L2TP_VERSION | 217 if (info->flags & ~(XT_L2TP_TID | XT_L2TP_SID | XT_L2TP_VERSION |
218 XT_L2TP_TYPE)) { 218 XT_L2TP_TYPE)) {
219 pr_info("unknown flags: %x\n", info->flags); 219 pr_info_ratelimited("unknown flags: %x\n", info->flags);
220 return -EINVAL; 220 return -EINVAL;
221 } 221 }
222 222
@@ -225,7 +225,8 @@ static int l2tp_mt_check(const struct xt_mtchk_param *par)
225 (!(info->flags & XT_L2TP_SID)) && 225 (!(info->flags & XT_L2TP_SID)) &&
226 ((!(info->flags & XT_L2TP_TYPE)) || 226 ((!(info->flags & XT_L2TP_TYPE)) ||
227 (info->type != XT_L2TP_TYPE_CONTROL))) { 227 (info->type != XT_L2TP_TYPE_CONTROL))) {
228 pr_info("invalid flags combination: %x\n", info->flags); 228 pr_info_ratelimited("invalid flags combination: %x\n",
229 info->flags);
229 return -EINVAL; 230 return -EINVAL;
230 } 231 }
231 232
@@ -234,19 +235,22 @@ static int l2tp_mt_check(const struct xt_mtchk_param *par)
234 */ 235 */
235 if (info->flags & XT_L2TP_VERSION) { 236 if (info->flags & XT_L2TP_VERSION) {
236 if ((info->version < 2) || (info->version > 3)) { 237 if ((info->version < 2) || (info->version > 3)) {
237 pr_info("wrong L2TP version: %u\n", info->version); 238 pr_info_ratelimited("wrong L2TP version: %u\n",
239 info->version);
238 return -EINVAL; 240 return -EINVAL;
239 } 241 }
240 242
241 if (info->version == 2) { 243 if (info->version == 2) {
242 if ((info->flags & XT_L2TP_TID) && 244 if ((info->flags & XT_L2TP_TID) &&
243 (info->tid > 0xffff)) { 245 (info->tid > 0xffff)) {
244 pr_info("v2 tid > 0xffff: %u\n", info->tid); 246 pr_info_ratelimited("v2 tid > 0xffff: %u\n",
247 info->tid);
245 return -EINVAL; 248 return -EINVAL;
246 } 249 }
247 if ((info->flags & XT_L2TP_SID) && 250 if ((info->flags & XT_L2TP_SID) &&
248 (info->sid > 0xffff)) { 251 (info->sid > 0xffff)) {
249 pr_info("v2 sid > 0xffff: %u\n", info->sid); 252 pr_info_ratelimited("v2 sid > 0xffff: %u\n",
253 info->sid);
250 return -EINVAL; 254 return -EINVAL;
251 } 255 }
252 } 256 }
@@ -268,13 +272,13 @@ static int l2tp_mt_check4(const struct xt_mtchk_param *par)
268 272
269 if ((ip->proto != IPPROTO_UDP) && 273 if ((ip->proto != IPPROTO_UDP) &&
270 (ip->proto != IPPROTO_L2TP)) { 274 (ip->proto != IPPROTO_L2TP)) {
271 pr_info("missing protocol rule (udp|l2tpip)\n"); 275 pr_info_ratelimited("missing protocol rule (udp|l2tpip)\n");
272 return -EINVAL; 276 return -EINVAL;
273 } 277 }
274 278
275 if ((ip->proto == IPPROTO_L2TP) && 279 if ((ip->proto == IPPROTO_L2TP) &&
276 (info->version == 2)) { 280 (info->version == 2)) {
277 pr_info("v2 doesn't support IP mode\n"); 281 pr_info_ratelimited("v2 doesn't support IP mode\n");
278 return -EINVAL; 282 return -EINVAL;
279 } 283 }
280 284
@@ -295,13 +299,13 @@ static int l2tp_mt_check6(const struct xt_mtchk_param *par)
295 299
296 if ((ip->proto != IPPROTO_UDP) && 300 if ((ip->proto != IPPROTO_UDP) &&
297 (ip->proto != IPPROTO_L2TP)) { 301 (ip->proto != IPPROTO_L2TP)) {
298 pr_info("missing protocol rule (udp|l2tpip)\n"); 302 pr_info_ratelimited("missing protocol rule (udp|l2tpip)\n");
299 return -EINVAL; 303 return -EINVAL;
300 } 304 }
301 305
302 if ((ip->proto == IPPROTO_L2TP) && 306 if ((ip->proto == IPPROTO_L2TP) &&
303 (info->version == 2)) { 307 (info->version == 2)) {
304 pr_info("v2 doesn't support IP mode\n"); 308 pr_info_ratelimited("v2 doesn't support IP mode\n");
305 return -EINVAL; 309 return -EINVAL;
306 } 310 }
307 311
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c
index 61403b77361c..55d18cd67635 100644
--- a/net/netfilter/xt_limit.c
+++ b/net/netfilter/xt_limit.c
@@ -106,8 +106,8 @@ static int limit_mt_check(const struct xt_mtchk_param *par)
106 /* Check for overflow. */ 106 /* Check for overflow. */
107 if (r->burst == 0 107 if (r->burst == 0
108 || user2credits(r->avg * r->burst) < user2credits(r->avg)) { 108 || user2credits(r->avg * r->burst) < user2credits(r->avg)) {
109 pr_info("Overflow, try lower: %u/%u\n", 109 pr_info_ratelimited("Overflow, try lower: %u/%u\n",
110 r->avg, r->burst); 110 r->avg, r->burst);
111 return -ERANGE; 111 return -ERANGE;
112 } 112 }
113 113
diff --git a/net/netfilter/xt_nat.c b/net/netfilter/xt_nat.c
index 0fd14d1eb09d..bdb689cdc829 100644
--- a/net/netfilter/xt_nat.c
+++ b/net/netfilter/xt_nat.c
@@ -8,6 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12
11#include <linux/module.h> 13#include <linux/module.h>
12#include <linux/skbuff.h> 14#include <linux/skbuff.h>
13#include <linux/netfilter.h> 15#include <linux/netfilter.h>
@@ -19,8 +21,7 @@ static int xt_nat_checkentry_v0(const struct xt_tgchk_param *par)
19 const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo; 21 const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
20 22
21 if (mr->rangesize != 1) { 23 if (mr->rangesize != 1) {
22 pr_info("%s: multiple ranges no longer supported\n", 24 pr_info_ratelimited("multiple ranges no longer supported\n");
23 par->target->name);
24 return -EINVAL; 25 return -EINVAL;
25 } 26 }
26 return nf_ct_netns_get(par->net, par->family); 27 return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_nfacct.c b/net/netfilter/xt_nfacct.c
index 6f92d25590a8..c8674deed4eb 100644
--- a/net/netfilter/xt_nfacct.c
+++ b/net/netfilter/xt_nfacct.c
@@ -6,6 +6,8 @@
6 * it under the terms of the GNU General Public License version 2 (or any 6 * it under the terms of the GNU General Public License version 2 (or any
7 * later at your option) as published by the Free Software Foundation. 7 * later at your option) as published by the Free Software Foundation.
8 */ 8 */
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
9#include <linux/module.h> 11#include <linux/module.h>
10#include <linux/skbuff.h> 12#include <linux/skbuff.h>
11 13
@@ -39,8 +41,8 @@ nfacct_mt_checkentry(const struct xt_mtchk_param *par)
39 41
40 nfacct = nfnl_acct_find_get(par->net, info->name); 42 nfacct = nfnl_acct_find_get(par->net, info->name);
41 if (nfacct == NULL) { 43 if (nfacct == NULL) {
42 pr_info("xt_nfacct: accounting object with name `%s' " 44 pr_info_ratelimited("accounting object `%s' does not exists\n",
43 "does not exists\n", info->name); 45 info->name);
44 return -ENOENT; 46 return -ENOENT;
45 } 47 }
46 info->nfacct = nfacct; 48 info->nfacct = nfacct;
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index bb33598e4530..9d6d67b953ac 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -107,9 +107,7 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)
107 info->invert & XT_PHYSDEV_OP_BRIDGED) && 107 info->invert & XT_PHYSDEV_OP_BRIDGED) &&
108 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) | 108 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
109 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) { 109 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
110 pr_info("using --physdev-out and --physdev-is-out are only " 110 pr_info_ratelimited("--physdev-out and --physdev-is-out only supported in the FORWARD and POSTROUTING chains with bridged traffic\n");
111 "supported in the FORWARD and POSTROUTING chains with "
112 "bridged traffic.\n");
113 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT)) 111 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
114 return -EINVAL; 112 return -EINVAL;
115 } 113 }
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index 5639fb03bdd9..13f8ccf946d6 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -132,26 +132,29 @@ policy_mt(const struct sk_buff *skb, struct xt_action_param *par)
132static int policy_mt_check(const struct xt_mtchk_param *par) 132static int policy_mt_check(const struct xt_mtchk_param *par)
133{ 133{
134 const struct xt_policy_info *info = par->matchinfo; 134 const struct xt_policy_info *info = par->matchinfo;
135 const char *errmsg = "neither incoming nor outgoing policy selected";
136
137 if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT)))
138 goto err;
135 139
136 if (!(info->flags & (XT_POLICY_MATCH_IN|XT_POLICY_MATCH_OUT))) {
137 pr_info("neither incoming nor outgoing policy selected\n");
138 return -EINVAL;
139 }
140 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) | 140 if (par->hook_mask & ((1 << NF_INET_PRE_ROUTING) |
141 (1 << NF_INET_LOCAL_IN)) && info->flags & XT_POLICY_MATCH_OUT) { 141 (1 << NF_INET_LOCAL_IN)) && info->flags & XT_POLICY_MATCH_OUT) {
142 pr_info("output policy not valid in PREROUTING and INPUT\n"); 142 errmsg = "output policy not valid in PREROUTING and INPUT";
143 return -EINVAL; 143 goto err;
144 } 144 }
145 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) | 145 if (par->hook_mask & ((1 << NF_INET_POST_ROUTING) |
146 (1 << NF_INET_LOCAL_OUT)) && info->flags & XT_POLICY_MATCH_IN) { 146 (1 << NF_INET_LOCAL_OUT)) && info->flags & XT_POLICY_MATCH_IN) {
147 pr_info("input policy not valid in POSTROUTING and OUTPUT\n"); 147 errmsg = "input policy not valid in POSTROUTING and OUTPUT";
148 return -EINVAL; 148 goto err;
149 } 149 }
150 if (info->len > XT_POLICY_MAX_ELEM) { 150 if (info->len > XT_POLICY_MAX_ELEM) {
151 pr_info("too many policy elements\n"); 151 errmsg = "too many policy elements";
152 return -EINVAL; 152 goto err;
153 } 153 }
154 return 0; 154 return 0;
155err:
156 pr_info_ratelimited("%s\n", errmsg);
157 return -EINVAL;
155} 158}
156 159
157static struct xt_match policy_mt_reg[] __read_mostly = { 160static struct xt_match policy_mt_reg[] __read_mostly = {
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 245fa350a7a8..6d232d18faff 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -342,8 +342,8 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
342 net_get_random_once(&hash_rnd, sizeof(hash_rnd)); 342 net_get_random_once(&hash_rnd, sizeof(hash_rnd));
343 343
344 if (info->check_set & ~XT_RECENT_VALID_FLAGS) { 344 if (info->check_set & ~XT_RECENT_VALID_FLAGS) {
345 pr_info("Unsupported user space flags (%08x)\n", 345 pr_info_ratelimited("Unsupported userspace flags (%08x)\n",
346 info->check_set); 346 info->check_set);
347 return -EINVAL; 347 return -EINVAL;
348 } 348 }
349 if (hweight8(info->check_set & 349 if (hweight8(info->check_set &
@@ -357,8 +357,8 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
357 if ((info->check_set & XT_RECENT_REAP) && !info->seconds) 357 if ((info->check_set & XT_RECENT_REAP) && !info->seconds)
358 return -EINVAL; 358 return -EINVAL;
359 if (info->hit_count >= XT_RECENT_MAX_NSTAMPS) { 359 if (info->hit_count >= XT_RECENT_MAX_NSTAMPS) {
360 pr_info("hitcount (%u) is larger than allowed maximum (%u)\n", 360 pr_info_ratelimited("hitcount (%u) is larger than allowed maximum (%u)\n",
361 info->hit_count, XT_RECENT_MAX_NSTAMPS - 1); 361 info->hit_count, XT_RECENT_MAX_NSTAMPS - 1);
362 return -EINVAL; 362 return -EINVAL;
363 } 363 }
364 if (info->name[0] == '\0' || 364 if (info->name[0] == '\0' ||
@@ -587,7 +587,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
587 add = true; 587 add = true;
588 break; 588 break;
589 default: 589 default:
590 pr_info("Need \"+ip\", \"-ip\" or \"/\"\n"); 590 pr_info_ratelimited("Need \"+ip\", \"-ip\" or \"/\"\n");
591 return -EINVAL; 591 return -EINVAL;
592 } 592 }
593 593
@@ -601,10 +601,8 @@ recent_mt_proc_write(struct file *file, const char __user *input,
601 succ = in4_pton(c, size, (void *)&addr, '\n', NULL); 601 succ = in4_pton(c, size, (void *)&addr, '\n', NULL);
602 } 602 }
603 603
604 if (!succ) { 604 if (!succ)
605 pr_info("illegal address written to procfs\n");
606 return -EINVAL; 605 return -EINVAL;
607 }
608 606
609 spin_lock_bh(&recent_lock); 607 spin_lock_bh(&recent_lock);
610 e = recent_entry_lookup(t, &addr, family, 0); 608 e = recent_entry_lookup(t, &addr, family, 0);
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c
index 16b6b11ee83f..6f4c5217d835 100644
--- a/net/netfilter/xt_set.c
+++ b/net/netfilter/xt_set.c
@@ -92,12 +92,12 @@ set_match_v0_checkentry(const struct xt_mtchk_param *par)
92 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); 92 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
93 93
94 if (index == IPSET_INVALID_ID) { 94 if (index == IPSET_INVALID_ID) {
95 pr_warn("Cannot find set identified by id %u to match\n", 95 pr_info_ratelimited("Cannot find set identified by id %u to match\n",
96 info->match_set.index); 96 info->match_set.index);
97 return -ENOENT; 97 return -ENOENT;
98 } 98 }
99 if (info->match_set.u.flags[IPSET_DIM_MAX - 1] != 0) { 99 if (info->match_set.u.flags[IPSET_DIM_MAX - 1] != 0) {
100 pr_warn("Protocol error: set match dimension is over the limit!\n"); 100 pr_info_ratelimited("set match dimension is over the limit!\n");
101 ip_set_nfnl_put(par->net, info->match_set.index); 101 ip_set_nfnl_put(par->net, info->match_set.index);
102 return -ERANGE; 102 return -ERANGE;
103 } 103 }
@@ -143,12 +143,12 @@ set_match_v1_checkentry(const struct xt_mtchk_param *par)
143 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index); 143 index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
144 144
145 if (index == IPSET_INVALID_ID) { 145 if (index == IPSET_INVALID_ID) {
146 pr_warn("Cannot find set identified by id %u to match\n", 146 pr_info_ratelimited("Cannot find set identified by id %u to match\n",
147 info->match_set.index); 147 info->match_set.index);
148 return -ENOENT; 148 return -ENOENT;
149 } 149 }
150 if (info->match_set.dim > IPSET_DIM_MAX) { 150 if (info->match_set.dim > IPSET_DIM_MAX) {
151 pr_warn("Protocol error: set match dimension is over the limit!\n"); 151 pr_info_ratelimited("set match dimension is over the limit!\n");
152 ip_set_nfnl_put(par->net, info->match_set.index); 152 ip_set_nfnl_put(par->net, info->match_set.index);
153 return -ERANGE; 153 return -ERANGE;
154 } 154 }
@@ -241,8 +241,8 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
241 if (info->add_set.index != IPSET_INVALID_ID) { 241 if (info->add_set.index != IPSET_INVALID_ID) {
242 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); 242 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
243 if (index == IPSET_INVALID_ID) { 243 if (index == IPSET_INVALID_ID) {
244 pr_warn("Cannot find add_set index %u as target\n", 244 pr_info_ratelimited("Cannot find add_set index %u as target\n",
245 info->add_set.index); 245 info->add_set.index);
246 return -ENOENT; 246 return -ENOENT;
247 } 247 }
248 } 248 }
@@ -250,8 +250,8 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
250 if (info->del_set.index != IPSET_INVALID_ID) { 250 if (info->del_set.index != IPSET_INVALID_ID) {
251 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); 251 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
252 if (index == IPSET_INVALID_ID) { 252 if (index == IPSET_INVALID_ID) {
253 pr_warn("Cannot find del_set index %u as target\n", 253 pr_info_ratelimited("Cannot find del_set index %u as target\n",
254 info->del_set.index); 254 info->del_set.index);
255 if (info->add_set.index != IPSET_INVALID_ID) 255 if (info->add_set.index != IPSET_INVALID_ID)
256 ip_set_nfnl_put(par->net, info->add_set.index); 256 ip_set_nfnl_put(par->net, info->add_set.index);
257 return -ENOENT; 257 return -ENOENT;
@@ -259,7 +259,7 @@ set_target_v0_checkentry(const struct xt_tgchk_param *par)
259 } 259 }
260 if (info->add_set.u.flags[IPSET_DIM_MAX - 1] != 0 || 260 if (info->add_set.u.flags[IPSET_DIM_MAX - 1] != 0 ||
261 info->del_set.u.flags[IPSET_DIM_MAX - 1] != 0) { 261 info->del_set.u.flags[IPSET_DIM_MAX - 1] != 0) {
262 pr_warn("Protocol error: SET target dimension is over the limit!\n"); 262 pr_info_ratelimited("SET target dimension over the limit!\n");
263 if (info->add_set.index != IPSET_INVALID_ID) 263 if (info->add_set.index != IPSET_INVALID_ID)
264 ip_set_nfnl_put(par->net, info->add_set.index); 264 ip_set_nfnl_put(par->net, info->add_set.index);
265 if (info->del_set.index != IPSET_INVALID_ID) 265 if (info->del_set.index != IPSET_INVALID_ID)
@@ -316,8 +316,8 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
316 if (info->add_set.index != IPSET_INVALID_ID) { 316 if (info->add_set.index != IPSET_INVALID_ID) {
317 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index); 317 index = ip_set_nfnl_get_byindex(par->net, info->add_set.index);
318 if (index == IPSET_INVALID_ID) { 318 if (index == IPSET_INVALID_ID) {
319 pr_warn("Cannot find add_set index %u as target\n", 319 pr_info_ratelimited("Cannot find add_set index %u as target\n",
320 info->add_set.index); 320 info->add_set.index);
321 return -ENOENT; 321 return -ENOENT;
322 } 322 }
323 } 323 }
@@ -325,8 +325,8 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
325 if (info->del_set.index != IPSET_INVALID_ID) { 325 if (info->del_set.index != IPSET_INVALID_ID) {
326 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index); 326 index = ip_set_nfnl_get_byindex(par->net, info->del_set.index);
327 if (index == IPSET_INVALID_ID) { 327 if (index == IPSET_INVALID_ID) {
328 pr_warn("Cannot find del_set index %u as target\n", 328 pr_info_ratelimited("Cannot find del_set index %u as target\n",
329 info->del_set.index); 329 info->del_set.index);
330 if (info->add_set.index != IPSET_INVALID_ID) 330 if (info->add_set.index != IPSET_INVALID_ID)
331 ip_set_nfnl_put(par->net, info->add_set.index); 331 ip_set_nfnl_put(par->net, info->add_set.index);
332 return -ENOENT; 332 return -ENOENT;
@@ -334,7 +334,7 @@ set_target_v1_checkentry(const struct xt_tgchk_param *par)
334 } 334 }
335 if (info->add_set.dim > IPSET_DIM_MAX || 335 if (info->add_set.dim > IPSET_DIM_MAX ||
336 info->del_set.dim > IPSET_DIM_MAX) { 336 info->del_set.dim > IPSET_DIM_MAX) {
337 pr_warn("Protocol error: SET target dimension is over the limit!\n"); 337 pr_info_ratelimited("SET target dimension over the limit!\n");
338 if (info->add_set.index != IPSET_INVALID_ID) 338 if (info->add_set.index != IPSET_INVALID_ID)
339 ip_set_nfnl_put(par->net, info->add_set.index); 339 ip_set_nfnl_put(par->net, info->add_set.index);
340 if (info->del_set.index != IPSET_INVALID_ID) 340 if (info->del_set.index != IPSET_INVALID_ID)
@@ -444,8 +444,8 @@ set_target_v3_checkentry(const struct xt_tgchk_param *par)
444 index = ip_set_nfnl_get_byindex(par->net, 444 index = ip_set_nfnl_get_byindex(par->net,
445 info->add_set.index); 445 info->add_set.index);
446 if (index == IPSET_INVALID_ID) { 446 if (index == IPSET_INVALID_ID) {
447 pr_warn("Cannot find add_set index %u as target\n", 447 pr_info_ratelimited("Cannot find add_set index %u as target\n",
448 info->add_set.index); 448 info->add_set.index);
449 return -ENOENT; 449 return -ENOENT;
450 } 450 }
451 } 451 }
@@ -454,8 +454,8 @@ set_target_v3_checkentry(const struct xt_tgchk_param *par)
454 index = ip_set_nfnl_get_byindex(par->net, 454 index = ip_set_nfnl_get_byindex(par->net,
455 info->del_set.index); 455 info->del_set.index);
456 if (index == IPSET_INVALID_ID) { 456 if (index == IPSET_INVALID_ID) {
457 pr_warn("Cannot find del_set index %u as target\n", 457 pr_info_ratelimited("Cannot find del_set index %u as target\n",
458 info->del_set.index); 458 info->del_set.index);
459 if (info->add_set.index != IPSET_INVALID_ID) 459 if (info->add_set.index != IPSET_INVALID_ID)
460 ip_set_nfnl_put(par->net, 460 ip_set_nfnl_put(par->net,
461 info->add_set.index); 461 info->add_set.index);
@@ -465,7 +465,7 @@ set_target_v3_checkentry(const struct xt_tgchk_param *par)
465 465
466 if (info->map_set.index != IPSET_INVALID_ID) { 466 if (info->map_set.index != IPSET_INVALID_ID) {
467 if (strncmp(par->table, "mangle", 7)) { 467 if (strncmp(par->table, "mangle", 7)) {
468 pr_warn("--map-set only usable from mangle table\n"); 468 pr_info_ratelimited("--map-set only usable from mangle table\n");
469 return -EINVAL; 469 return -EINVAL;
470 } 470 }
471 if (((info->flags & IPSET_FLAG_MAP_SKBPRIO) | 471 if (((info->flags & IPSET_FLAG_MAP_SKBPRIO) |
@@ -473,14 +473,14 @@ set_target_v3_checkentry(const struct xt_tgchk_param *par)
473 !(par->hook_mask & (1 << NF_INET_FORWARD | 473 !(par->hook_mask & (1 << NF_INET_FORWARD |
474 1 << NF_INET_LOCAL_OUT | 474 1 << NF_INET_LOCAL_OUT |
475 1 << NF_INET_POST_ROUTING))) { 475 1 << NF_INET_POST_ROUTING))) {
476 pr_warn("mapping of prio or/and queue is allowed only from OUTPUT/FORWARD/POSTROUTING chains\n"); 476 pr_info_ratelimited("mapping of prio or/and queue is allowed only from OUTPUT/FORWARD/POSTROUTING chains\n");
477 return -EINVAL; 477 return -EINVAL;
478 } 478 }
479 index = ip_set_nfnl_get_byindex(par->net, 479 index = ip_set_nfnl_get_byindex(par->net,
480 info->map_set.index); 480 info->map_set.index);
481 if (index == IPSET_INVALID_ID) { 481 if (index == IPSET_INVALID_ID) {
482 pr_warn("Cannot find map_set index %u as target\n", 482 pr_info_ratelimited("Cannot find map_set index %u as target\n",
483 info->map_set.index); 483 info->map_set.index);
484 if (info->add_set.index != IPSET_INVALID_ID) 484 if (info->add_set.index != IPSET_INVALID_ID)
485 ip_set_nfnl_put(par->net, 485 ip_set_nfnl_put(par->net,
486 info->add_set.index); 486 info->add_set.index);
@@ -494,7 +494,7 @@ set_target_v3_checkentry(const struct xt_tgchk_param *par)
494 if (info->add_set.dim > IPSET_DIM_MAX || 494 if (info->add_set.dim > IPSET_DIM_MAX ||
495 info->del_set.dim > IPSET_DIM_MAX || 495 info->del_set.dim > IPSET_DIM_MAX ||
496 info->map_set.dim > IPSET_DIM_MAX) { 496 info->map_set.dim > IPSET_DIM_MAX) {
497 pr_warn("Protocol error: SET target dimension is over the limit!\n"); 497 pr_info_ratelimited("SET target dimension over the limit!\n");
498 if (info->add_set.index != IPSET_INVALID_ID) 498 if (info->add_set.index != IPSET_INVALID_ID)
499 ip_set_nfnl_put(par->net, info->add_set.index); 499 ip_set_nfnl_put(par->net, info->add_set.index);
500 if (info->del_set.index != IPSET_INVALID_ID) 500 if (info->del_set.index != IPSET_INVALID_ID)
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index 575d2153e3b8..2ac7f674d19b 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -171,7 +171,8 @@ static int socket_mt_v1_check(const struct xt_mtchk_param *par)
171 return err; 171 return err;
172 172
173 if (info->flags & ~XT_SOCKET_FLAGS_V1) { 173 if (info->flags & ~XT_SOCKET_FLAGS_V1) {
174 pr_info("unknown flags 0x%x\n", info->flags & ~XT_SOCKET_FLAGS_V1); 174 pr_info_ratelimited("unknown flags 0x%x\n",
175 info->flags & ~XT_SOCKET_FLAGS_V1);
175 return -EINVAL; 176 return -EINVAL;
176 } 177 }
177 return 0; 178 return 0;
@@ -187,7 +188,8 @@ static int socket_mt_v2_check(const struct xt_mtchk_param *par)
187 return err; 188 return err;
188 189
189 if (info->flags & ~XT_SOCKET_FLAGS_V2) { 190 if (info->flags & ~XT_SOCKET_FLAGS_V2) {
190 pr_info("unknown flags 0x%x\n", info->flags & ~XT_SOCKET_FLAGS_V2); 191 pr_info_ratelimited("unknown flags 0x%x\n",
192 info->flags & ~XT_SOCKET_FLAGS_V2);
191 return -EINVAL; 193 return -EINVAL;
192 } 194 }
193 return 0; 195 return 0;
@@ -203,8 +205,8 @@ static int socket_mt_v3_check(const struct xt_mtchk_param *par)
203 if (err) 205 if (err)
204 return err; 206 return err;
205 if (info->flags & ~XT_SOCKET_FLAGS_V3) { 207 if (info->flags & ~XT_SOCKET_FLAGS_V3) {
206 pr_info("unknown flags 0x%x\n", 208 pr_info_ratelimited("unknown flags 0x%x\n",
207 info->flags & ~XT_SOCKET_FLAGS_V3); 209 info->flags & ~XT_SOCKET_FLAGS_V3);
208 return -EINVAL; 210 return -EINVAL;
209 } 211 }
210 return 0; 212 return 0;
diff --git a/net/netfilter/xt_state.c b/net/netfilter/xt_state.c
index 5fbd79194d21..0b41c0befe3c 100644
--- a/net/netfilter/xt_state.c
+++ b/net/netfilter/xt_state.c
@@ -44,8 +44,8 @@ static int state_mt_check(const struct xt_mtchk_param *par)
44 44
45 ret = nf_ct_netns_get(par->net, par->family); 45 ret = nf_ct_netns_get(par->net, par->family);
46 if (ret < 0) 46 if (ret < 0)
47 pr_info("cannot load conntrack support for proto=%u\n", 47 pr_info_ratelimited("cannot load conntrack support for proto=%u\n",
48 par->family); 48 par->family);
49 return ret; 49 return ret;
50} 50}
51 51
diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c
index 1b01eec1fbda..0160f505e337 100644
--- a/net/netfilter/xt_time.c
+++ b/net/netfilter/xt_time.c
@@ -235,13 +235,13 @@ static int time_mt_check(const struct xt_mtchk_param *par)
235 235
236 if (info->daytime_start > XT_TIME_MAX_DAYTIME || 236 if (info->daytime_start > XT_TIME_MAX_DAYTIME ||
237 info->daytime_stop > XT_TIME_MAX_DAYTIME) { 237 info->daytime_stop > XT_TIME_MAX_DAYTIME) {
238 pr_info("invalid argument - start or " 238 pr_info_ratelimited("invalid argument - start or stop time greater than 23:59:59\n");
239 "stop time greater than 23:59:59\n");
240 return -EDOM; 239 return -EDOM;
241 } 240 }
242 241
243 if (info->flags & ~XT_TIME_ALL_FLAGS) { 242 if (info->flags & ~XT_TIME_ALL_FLAGS) {
244 pr_info("unknown flags 0x%x\n", info->flags & ~XT_TIME_ALL_FLAGS); 243 pr_info_ratelimited("unknown flags 0x%x\n",
244 info->flags & ~XT_TIME_ALL_FLAGS);
245 return -EINVAL; 245 return -EINVAL;
246 } 246 }
247 247
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 2ad445c1d27c..07e8478068f0 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2308,7 +2308,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
2308 if (cb->start) { 2308 if (cb->start) {
2309 ret = cb->start(cb); 2309 ret = cb->start(cb);
2310 if (ret) 2310 if (ret)
2311 goto error_unlock; 2311 goto error_put;
2312 } 2312 }
2313 2313
2314 nlk->cb_running = true; 2314 nlk->cb_running = true;
@@ -2328,6 +2328,8 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
2328 */ 2328 */
2329 return -EINTR; 2329 return -EINTR;
2330 2330
2331error_put:
2332 module_put(control->module);
2331error_unlock: 2333error_unlock:
2332 sock_put(sk); 2334 sock_put(sk);
2333 mutex_unlock(nlk->cb_mutex); 2335 mutex_unlock(nlk->cb_mutex);
diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c
index 367d8c027101..2ceefa183cee 100644
--- a/net/nfc/llcp_commands.c
+++ b/net/nfc/llcp_commands.c
@@ -149,6 +149,10 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, char *uri,
149 149
150 pr_debug("uri: %s, len: %zu\n", uri, uri_len); 150 pr_debug("uri: %s, len: %zu\n", uri, uri_len);
151 151
152 /* sdreq->tlv_len is u8, takes uri_len, + 3 for header, + 1 for NULL */
153 if (WARN_ON_ONCE(uri_len > U8_MAX - 4))
154 return NULL;
155
152 sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL); 156 sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL);
153 if (sdreq == NULL) 157 if (sdreq == NULL)
154 return NULL; 158 return NULL;
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index c0b83dc9d993..f018eafc2a0d 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -61,7 +61,8 @@ static const struct nla_policy nfc_genl_policy[NFC_ATTR_MAX + 1] = {
61}; 61};
62 62
63static const struct nla_policy nfc_sdp_genl_policy[NFC_SDP_ATTR_MAX + 1] = { 63static const struct nla_policy nfc_sdp_genl_policy[NFC_SDP_ATTR_MAX + 1] = {
64 [NFC_SDP_ATTR_URI] = { .type = NLA_STRING }, 64 [NFC_SDP_ATTR_URI] = { .type = NLA_STRING,
65 .len = U8_MAX - 4 },
65 [NFC_SDP_ATTR_SAP] = { .type = NLA_U8 }, 66 [NFC_SDP_ATTR_SAP] = { .type = NLA_U8 },
66}; 67};
67 68
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 94e190febfdd..2da3176bf792 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -224,7 +224,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
224 if (rds_destroy_pending(conn)) 224 if (rds_destroy_pending(conn))
225 ret = -ENETDOWN; 225 ret = -ENETDOWN;
226 else 226 else
227 ret = trans->conn_alloc(conn, gfp); 227 ret = trans->conn_alloc(conn, GFP_ATOMIC);
228 if (ret) { 228 if (ret) {
229 rcu_read_unlock(); 229 rcu_read_unlock();
230 kfree(conn->c_path); 230 kfree(conn->c_path);
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index 42410e910aff..cf73dc006c3b 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -445,7 +445,7 @@ send_fragmentable:
445 (char *)&opt, sizeof(opt)); 445 (char *)&opt, sizeof(opt));
446 if (ret == 0) { 446 if (ret == 0) {
447 ret = kernel_sendmsg(conn->params.local->socket, &msg, 447 ret = kernel_sendmsg(conn->params.local->socket, &msg,
448 iov, 1, iov[0].iov_len); 448 iov, 2, len);
449 449
450 opt = IPV6_PMTUDISC_DO; 450 opt = IPV6_PMTUDISC_DO;
451 kernel_setsockopt(conn->params.local->socket, 451 kernel_setsockopt(conn->params.local->socket,
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c
index cc21e8db25b0..9d45d8b56744 100644
--- a/net/rxrpc/recvmsg.c
+++ b/net/rxrpc/recvmsg.c
@@ -517,9 +517,10 @@ try_again:
517 ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, 517 ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID,
518 sizeof(unsigned int), &id32); 518 sizeof(unsigned int), &id32);
519 } else { 519 } else {
520 unsigned long idl = call->user_call_ID;
521
520 ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, 522 ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID,
521 sizeof(unsigned long), 523 sizeof(unsigned long), &idl);
522 &call->user_call_ID);
523 } 524 }
524 if (ret < 0) 525 if (ret < 0)
525 goto error_unlock_call; 526 goto error_unlock_call;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 2bc1bc23d42e..247b7cc20c13 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -376,17 +376,12 @@ struct tcf_net {
376static unsigned int tcf_net_id; 376static unsigned int tcf_net_id;
377 377
378static int tcf_block_insert(struct tcf_block *block, struct net *net, 378static int tcf_block_insert(struct tcf_block *block, struct net *net,
379 u32 block_index, struct netlink_ext_ack *extack) 379 struct netlink_ext_ack *extack)
380{ 380{
381 struct tcf_net *tn = net_generic(net, tcf_net_id); 381 struct tcf_net *tn = net_generic(net, tcf_net_id);
382 int err;
383 382
384 err = idr_alloc_u32(&tn->idr, block, &block_index, block_index, 383 return idr_alloc_u32(&tn->idr, block, &block->index, block->index,
385 GFP_KERNEL); 384 GFP_KERNEL);
386 if (err)
387 return err;
388 block->index = block_index;
389 return 0;
390} 385}
391 386
392static void tcf_block_remove(struct tcf_block *block, struct net *net) 387static void tcf_block_remove(struct tcf_block *block, struct net *net)
@@ -397,6 +392,7 @@ static void tcf_block_remove(struct tcf_block *block, struct net *net)
397} 392}
398 393
399static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, 394static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,
395 u32 block_index,
400 struct netlink_ext_ack *extack) 396 struct netlink_ext_ack *extack)
401{ 397{
402 struct tcf_block *block; 398 struct tcf_block *block;
@@ -419,10 +415,13 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,
419 err = -ENOMEM; 415 err = -ENOMEM;
420 goto err_chain_create; 416 goto err_chain_create;
421 } 417 }
422 block->net = qdisc_net(q);
423 block->refcnt = 1; 418 block->refcnt = 1;
424 block->net = net; 419 block->net = net;
425 block->q = q; 420 block->index = block_index;
421
422 /* Don't store q pointer for blocks which are shared */
423 if (!tcf_block_shared(block))
424 block->q = q;
426 return block; 425 return block;
427 426
428err_chain_create: 427err_chain_create:
@@ -518,13 +517,12 @@ int tcf_block_get_ext(struct tcf_block **p_block, struct Qdisc *q,
518 } 517 }
519 518
520 if (!block) { 519 if (!block) {
521 block = tcf_block_create(net, q, extack); 520 block = tcf_block_create(net, q, ei->block_index, extack);
522 if (IS_ERR(block)) 521 if (IS_ERR(block))
523 return PTR_ERR(block); 522 return PTR_ERR(block);
524 created = true; 523 created = true;
525 if (ei->block_index) { 524 if (tcf_block_shared(block)) {
526 err = tcf_block_insert(block, net, 525 err = tcf_block_insert(block, net, extack);
527 ei->block_index, extack);
528 if (err) 526 if (err)
529 goto err_block_insert; 527 goto err_block_insert;
530 } 528 }
@@ -1399,13 +1397,18 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
1399 nla_get_u32(tca[TCA_CHAIN]) != chain->index) 1397 nla_get_u32(tca[TCA_CHAIN]) != chain->index)
1400 continue; 1398 continue;
1401 if (!tcf_chain_dump(chain, q, parent, skb, cb, 1399 if (!tcf_chain_dump(chain, q, parent, skb, cb,
1402 index_start, &index)) 1400 index_start, &index)) {
1401 err = -EMSGSIZE;
1403 break; 1402 break;
1403 }
1404 } 1404 }
1405 1405
1406 cb->args[0] = index; 1406 cb->args[0] = index;
1407 1407
1408out: 1408out:
1409 /* If we did no progress, the error (EMSGSIZE) is real */
1410 if (skb->len == 0 && err)
1411 return err;
1409 return skb->len; 1412 return skb->len;
1410} 1413}
1411 1414
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 6c7601a530e3..ed8b6a24b9e9 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -96,7 +96,7 @@ struct tc_u_hnode {
96 96
97struct tc_u_common { 97struct tc_u_common {
98 struct tc_u_hnode __rcu *hlist; 98 struct tc_u_hnode __rcu *hlist;
99 struct tcf_block *block; 99 void *ptr;
100 int refcnt; 100 int refcnt;
101 struct idr handle_idr; 101 struct idr handle_idr;
102 struct hlist_node hnode; 102 struct hlist_node hnode;
@@ -330,9 +330,25 @@ static struct hlist_head *tc_u_common_hash;
330#define U32_HASH_SHIFT 10 330#define U32_HASH_SHIFT 10
331#define U32_HASH_SIZE (1 << U32_HASH_SHIFT) 331#define U32_HASH_SIZE (1 << U32_HASH_SHIFT)
332 332
333static void *tc_u_common_ptr(const struct tcf_proto *tp)
334{
335 struct tcf_block *block = tp->chain->block;
336
337 /* The block sharing is currently supported only
338 * for classless qdiscs. In that case we use block
339 * for tc_u_common identification. In case the
340 * block is not shared, block->q is a valid pointer
341 * and we can use that. That works for classful qdiscs.
342 */
343 if (tcf_block_shared(block))
344 return block;
345 else
346 return block->q;
347}
348
333static unsigned int tc_u_hash(const struct tcf_proto *tp) 349static unsigned int tc_u_hash(const struct tcf_proto *tp)
334{ 350{
335 return hash_ptr(tp->chain->block, U32_HASH_SHIFT); 351 return hash_ptr(tc_u_common_ptr(tp), U32_HASH_SHIFT);
336} 352}
337 353
338static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) 354static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
@@ -342,7 +358,7 @@ static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
342 358
343 h = tc_u_hash(tp); 359 h = tc_u_hash(tp);
344 hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) { 360 hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) {
345 if (tc->block == tp->chain->block) 361 if (tc->ptr == tc_u_common_ptr(tp))
346 return tc; 362 return tc;
347 } 363 }
348 return NULL; 364 return NULL;
@@ -371,7 +387,7 @@ static int u32_init(struct tcf_proto *tp)
371 kfree(root_ht); 387 kfree(root_ht);
372 return -ENOBUFS; 388 return -ENOBUFS;
373 } 389 }
374 tp_c->block = tp->chain->block; 390 tp_c->ptr = tc_u_common_ptr(tp);
375 INIT_HLIST_NODE(&tp_c->hnode); 391 INIT_HLIST_NODE(&tp_c->hnode);
376 idr_init(&tp_c->handle_idr); 392 idr_init(&tp_c->handle_idr);
377 393
diff --git a/net/sctp/debug.c b/net/sctp/debug.c
index 291c97b07058..8f6c2e8c0953 100644
--- a/net/sctp/debug.c
+++ b/net/sctp/debug.c
@@ -81,6 +81,12 @@ const char *sctp_cname(const union sctp_subtype cid)
81 case SCTP_CID_RECONF: 81 case SCTP_CID_RECONF:
82 return "RECONF"; 82 return "RECONF";
83 83
84 case SCTP_CID_I_DATA:
85 return "I_DATA";
86
87 case SCTP_CID_I_FWD_TSN:
88 return "I_FWD_TSN";
89
84 default: 90 default:
85 break; 91 break;
86 } 92 }
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 141c9c466ec1..0247cc432e02 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t)
897 rhl_for_each_entry_rcu(transport, tmp, list, node) 897 rhl_for_each_entry_rcu(transport, tmp, list, node)
898 if (transport->asoc->ep == t->asoc->ep) { 898 if (transport->asoc->ep == t->asoc->ep) {
899 rcu_read_unlock(); 899 rcu_read_unlock();
900 err = -EEXIST; 900 return -EEXIST;
901 goto out;
902 } 901 }
903 rcu_read_unlock(); 902 rcu_read_unlock();
904 903
905 err = rhltable_insert_key(&sctp_transport_hashtable, &arg, 904 err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
906 &t->node, sctp_hash_params); 905 &t->node, sctp_hash_params);
907
908out:
909 if (err) 906 if (err)
910 pr_err_once("insert transport fail, errno %d\n", err); 907 pr_err_once("insert transport fail, errno %d\n", err);
911 908
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index cedf672487f9..f799043abec9 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * This file is part of the SCTP kernel implementation 7 * This file is part of the SCTP kernel implementation
8 * 8 *
9 * These functions manipulate sctp tsn mapping array. 9 * This file contains sctp stream maniuplation primitives and helpers.
10 * 10 *
11 * This SCTP implementation is free software; 11 * This SCTP implementation is free software;
12 * you can redistribute it and/or modify it under the terms of 12 * you can redistribute it and/or modify it under the terms of
diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
index 8c7cf8f08711..d3764c181299 100644
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -3,7 +3,8 @@
3 * 3 *
4 * This file is part of the SCTP kernel implementation 4 * This file is part of the SCTP kernel implementation
5 * 5 *
6 * These functions manipulate sctp stream queue/scheduling. 6 * These functions implement sctp stream message interleaving, mostly
7 * including I-DATA and I-FORWARD-TSN chunks process.
7 * 8 *
8 * This SCTP implementation is free software; 9 * This SCTP implementation is free software;
9 * you can redistribute it and/or modify it under the terms of 10 * you can redistribute it and/or modify it under the terms of
@@ -954,12 +955,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
954 __u32 freed = 0; 955 __u32 freed = 0;
955 __u16 needed; 956 __u16 needed;
956 957
957 if (chunk) { 958 needed = ntohs(chunk->chunk_hdr->length) -
958 needed = ntohs(chunk->chunk_hdr->length); 959 sizeof(struct sctp_idata_chunk);
959 needed -= sizeof(struct sctp_idata_chunk);
960 } else {
961 needed = SCTP_DEFAULT_MAXWINDOW;
962 }
963 960
964 if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) { 961 if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) {
965 freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed); 962 freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed);
@@ -971,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
971 needed); 968 needed);
972 } 969 }
973 970
974 if (chunk && freed >= needed) 971 if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
975 if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0) 972 sctp_intl_start_pd(ulpq, gfp);
976 sctp_intl_start_pd(ulpq, gfp);
977 973
978 sk_mem_reclaim(asoc->base.sk); 974 sk_mem_reclaim(asoc->base.sk);
979} 975}
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index c8001471da6c..3e3dce3d4c63 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -813,7 +813,7 @@ err_out:
813 return err; 813 return err;
814} 814}
815 815
816int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) 816int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
817{ 817{
818 int err; 818 int err;
819 char *name; 819 char *name;
@@ -835,20 +835,27 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
835 835
836 name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); 836 name = nla_data(attrs[TIPC_NLA_BEARER_NAME]);
837 837
838 rtnl_lock();
839 bearer = tipc_bearer_find(net, name); 838 bearer = tipc_bearer_find(net, name);
840 if (!bearer) { 839 if (!bearer)
841 rtnl_unlock();
842 return -EINVAL; 840 return -EINVAL;
843 }
844 841
845 bearer_disable(net, bearer); 842 bearer_disable(net, bearer);
846 rtnl_unlock();
847 843
848 return 0; 844 return 0;
849} 845}
850 846
851int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) 847int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
848{
849 int err;
850
851 rtnl_lock();
852 err = __tipc_nl_bearer_disable(skb, info);
853 rtnl_unlock();
854
855 return err;
856}
857
858int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
852{ 859{
853 int err; 860 int err;
854 char *bearer; 861 char *bearer;
@@ -890,15 +897,18 @@ int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
890 prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); 897 prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
891 } 898 }
892 899
900 return tipc_enable_bearer(net, bearer, domain, prio, attrs);
901}
902
903int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
904{
905 int err;
906
893 rtnl_lock(); 907 rtnl_lock();
894 err = tipc_enable_bearer(net, bearer, domain, prio, attrs); 908 err = __tipc_nl_bearer_enable(skb, info);
895 if (err) {
896 rtnl_unlock();
897 return err;
898 }
899 rtnl_unlock(); 909 rtnl_unlock();
900 910
901 return 0; 911 return err;
902} 912}
903 913
904int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) 914int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
@@ -944,7 +954,7 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
944 return 0; 954 return 0;
945} 955}
946 956
947int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) 957int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
948{ 958{
949 int err; 959 int err;
950 char *name; 960 char *name;
@@ -965,22 +975,17 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
965 return -EINVAL; 975 return -EINVAL;
966 name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); 976 name = nla_data(attrs[TIPC_NLA_BEARER_NAME]);
967 977
968 rtnl_lock();
969 b = tipc_bearer_find(net, name); 978 b = tipc_bearer_find(net, name);
970 if (!b) { 979 if (!b)
971 rtnl_unlock();
972 return -EINVAL; 980 return -EINVAL;
973 }
974 981
975 if (attrs[TIPC_NLA_BEARER_PROP]) { 982 if (attrs[TIPC_NLA_BEARER_PROP]) {
976 struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; 983 struct nlattr *props[TIPC_NLA_PROP_MAX + 1];
977 984
978 err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_BEARER_PROP], 985 err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_BEARER_PROP],
979 props); 986 props);
980 if (err) { 987 if (err)
981 rtnl_unlock();
982 return err; 988 return err;
983 }
984 989
985 if (props[TIPC_NLA_PROP_TOL]) 990 if (props[TIPC_NLA_PROP_TOL])
986 b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); 991 b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]);
@@ -989,11 +994,21 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
989 if (props[TIPC_NLA_PROP_WIN]) 994 if (props[TIPC_NLA_PROP_WIN])
990 b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); 995 b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
991 } 996 }
992 rtnl_unlock();
993 997
994 return 0; 998 return 0;
995} 999}
996 1000
1001int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
1002{
1003 int err;
1004
1005 rtnl_lock();
1006 err = __tipc_nl_bearer_set(skb, info);
1007 rtnl_unlock();
1008
1009 return err;
1010}
1011
997static int __tipc_nl_add_media(struct tipc_nl_msg *msg, 1012static int __tipc_nl_add_media(struct tipc_nl_msg *msg,
998 struct tipc_media *media, int nlflags) 1013 struct tipc_media *media, int nlflags)
999{ 1014{
@@ -1115,7 +1130,7 @@ err_out:
1115 return err; 1130 return err;
1116} 1131}
1117 1132
1118int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) 1133int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
1119{ 1134{
1120 int err; 1135 int err;
1121 char *name; 1136 char *name;
@@ -1133,22 +1148,17 @@ int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
1133 return -EINVAL; 1148 return -EINVAL;
1134 name = nla_data(attrs[TIPC_NLA_MEDIA_NAME]); 1149 name = nla_data(attrs[TIPC_NLA_MEDIA_NAME]);
1135 1150
1136 rtnl_lock();
1137 m = tipc_media_find(name); 1151 m = tipc_media_find(name);
1138 if (!m) { 1152 if (!m)
1139 rtnl_unlock();
1140 return -EINVAL; 1153 return -EINVAL;
1141 }
1142 1154
1143 if (attrs[TIPC_NLA_MEDIA_PROP]) { 1155 if (attrs[TIPC_NLA_MEDIA_PROP]) {
1144 struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; 1156 struct nlattr *props[TIPC_NLA_PROP_MAX + 1];
1145 1157
1146 err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_MEDIA_PROP], 1158 err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_MEDIA_PROP],
1147 props); 1159 props);
1148 if (err) { 1160 if (err)
1149 rtnl_unlock();
1150 return err; 1161 return err;
1151 }
1152 1162
1153 if (props[TIPC_NLA_PROP_TOL]) 1163 if (props[TIPC_NLA_PROP_TOL])
1154 m->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); 1164 m->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]);
@@ -1157,7 +1167,17 @@ int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
1157 if (props[TIPC_NLA_PROP_WIN]) 1167 if (props[TIPC_NLA_PROP_WIN])
1158 m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); 1168 m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
1159 } 1169 }
1160 rtnl_unlock();
1161 1170
1162 return 0; 1171 return 0;
1163} 1172}
1173
1174int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
1175{
1176 int err;
1177
1178 rtnl_lock();
1179 err = __tipc_nl_media_set(skb, info);
1180 rtnl_unlock();
1181
1182 return err;
1183}
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 42d6eeeb646d..a53613d95bc9 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -188,15 +188,19 @@ extern struct tipc_media udp_media_info;
188#endif 188#endif
189 189
190int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); 190int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info);
191int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info);
191int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info); 192int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info);
193int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info);
192int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb); 194int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb);
193int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info); 195int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info);
194int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info); 196int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info);
197int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info);
195int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info); 198int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info);
196 199
197int tipc_nl_media_dump(struct sk_buff *skb, struct netlink_callback *cb); 200int tipc_nl_media_dump(struct sk_buff *skb, struct netlink_callback *cb);
198int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info); 201int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info);
199int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info); 202int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info);
203int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info);
200 204
201int tipc_media_set_priority(const char *name, u32 new_value); 205int tipc_media_set_priority(const char *name, u32 new_value);
202int tipc_media_set_window(const char *name, u32 new_value); 206int tipc_media_set_window(const char *name, u32 new_value);
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 719c5924b638..1a2fde0d6f61 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -200,7 +200,7 @@ out:
200 return skb->len; 200 return skb->len;
201} 201}
202 202
203int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) 203int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
204{ 204{
205 struct net *net = sock_net(skb->sk); 205 struct net *net = sock_net(skb->sk);
206 struct tipc_net *tn = net_generic(net, tipc_net_id); 206 struct tipc_net *tn = net_generic(net, tipc_net_id);
@@ -241,10 +241,19 @@ int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
241 if (!tipc_addr_node_valid(addr)) 241 if (!tipc_addr_node_valid(addr))
242 return -EINVAL; 242 return -EINVAL;
243 243
244 rtnl_lock();
245 tipc_net_start(net, addr); 244 tipc_net_start(net, addr);
246 rtnl_unlock();
247 } 245 }
248 246
249 return 0; 247 return 0;
250} 248}
249
250int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
251{
252 int err;
253
254 rtnl_lock();
255 err = __tipc_nl_net_set(skb, info);
256 rtnl_unlock();
257
258 return err;
259}
diff --git a/net/tipc/net.h b/net/tipc/net.h
index c7c254902873..c0306aa2374b 100644
--- a/net/tipc/net.h
+++ b/net/tipc/net.h
@@ -47,5 +47,6 @@ void tipc_net_stop(struct net *net);
47 47
48int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb); 48int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb);
49int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info); 49int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info);
50int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info);
50 51
51#endif 52#endif
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index e48f0b2c01b9..4492cda45566 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -285,10 +285,6 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd,
285 if (!trans_buf) 285 if (!trans_buf)
286 return -ENOMEM; 286 return -ENOMEM;
287 287
288 err = (*cmd->transcode)(cmd, trans_buf, msg);
289 if (err)
290 goto trans_out;
291
292 attrbuf = kmalloc((tipc_genl_family.maxattr + 1) * 288 attrbuf = kmalloc((tipc_genl_family.maxattr + 1) *
293 sizeof(struct nlattr *), GFP_KERNEL); 289 sizeof(struct nlattr *), GFP_KERNEL);
294 if (!attrbuf) { 290 if (!attrbuf) {
@@ -296,27 +292,34 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd,
296 goto trans_out; 292 goto trans_out;
297 } 293 }
298 294
299 err = nla_parse(attrbuf, tipc_genl_family.maxattr,
300 (const struct nlattr *)trans_buf->data,
301 trans_buf->len, NULL, NULL);
302 if (err)
303 goto parse_out;
304
305 doit_buf = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 295 doit_buf = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
306 if (!doit_buf) { 296 if (!doit_buf) {
307 err = -ENOMEM; 297 err = -ENOMEM;
308 goto parse_out; 298 goto attrbuf_out;
309 } 299 }
310 300
311 doit_buf->sk = msg->dst_sk;
312
313 memset(&info, 0, sizeof(info)); 301 memset(&info, 0, sizeof(info));
314 info.attrs = attrbuf; 302 info.attrs = attrbuf;
315 303
304 rtnl_lock();
305 err = (*cmd->transcode)(cmd, trans_buf, msg);
306 if (err)
307 goto doit_out;
308
309 err = nla_parse(attrbuf, tipc_genl_family.maxattr,
310 (const struct nlattr *)trans_buf->data,
311 trans_buf->len, NULL, NULL);
312 if (err)
313 goto doit_out;
314
315 doit_buf->sk = msg->dst_sk;
316
316 err = (*cmd->doit)(doit_buf, &info); 317 err = (*cmd->doit)(doit_buf, &info);
318doit_out:
319 rtnl_unlock();
317 320
318 kfree_skb(doit_buf); 321 kfree_skb(doit_buf);
319parse_out: 322attrbuf_out:
320 kfree(attrbuf); 323 kfree(attrbuf);
321trans_out: 324trans_out:
322 kfree_skb(trans_buf); 325 kfree_skb(trans_buf);
@@ -722,13 +725,13 @@ static int tipc_nl_compat_link_set(struct tipc_nl_compat_cmd_doit *cmd,
722 725
723 media = tipc_media_find(lc->name); 726 media = tipc_media_find(lc->name);
724 if (media) { 727 if (media) {
725 cmd->doit = &tipc_nl_media_set; 728 cmd->doit = &__tipc_nl_media_set;
726 return tipc_nl_compat_media_set(skb, msg); 729 return tipc_nl_compat_media_set(skb, msg);
727 } 730 }
728 731
729 bearer = tipc_bearer_find(msg->net, lc->name); 732 bearer = tipc_bearer_find(msg->net, lc->name);
730 if (bearer) { 733 if (bearer) {
731 cmd->doit = &tipc_nl_bearer_set; 734 cmd->doit = &__tipc_nl_bearer_set;
732 return tipc_nl_compat_bearer_set(skb, msg); 735 return tipc_nl_compat_bearer_set(skb, msg);
733 } 736 }
734 737
@@ -1089,12 +1092,12 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
1089 return tipc_nl_compat_dumpit(&dump, msg); 1092 return tipc_nl_compat_dumpit(&dump, msg);
1090 case TIPC_CMD_ENABLE_BEARER: 1093 case TIPC_CMD_ENABLE_BEARER:
1091 msg->req_type = TIPC_TLV_BEARER_CONFIG; 1094 msg->req_type = TIPC_TLV_BEARER_CONFIG;
1092 doit.doit = tipc_nl_bearer_enable; 1095 doit.doit = __tipc_nl_bearer_enable;
1093 doit.transcode = tipc_nl_compat_bearer_enable; 1096 doit.transcode = tipc_nl_compat_bearer_enable;
1094 return tipc_nl_compat_doit(&doit, msg); 1097 return tipc_nl_compat_doit(&doit, msg);
1095 case TIPC_CMD_DISABLE_BEARER: 1098 case TIPC_CMD_DISABLE_BEARER:
1096 msg->req_type = TIPC_TLV_BEARER_NAME; 1099 msg->req_type = TIPC_TLV_BEARER_NAME;
1097 doit.doit = tipc_nl_bearer_disable; 1100 doit.doit = __tipc_nl_bearer_disable;
1098 doit.transcode = tipc_nl_compat_bearer_disable; 1101 doit.transcode = tipc_nl_compat_bearer_disable;
1099 return tipc_nl_compat_doit(&doit, msg); 1102 return tipc_nl_compat_doit(&doit, msg);
1100 case TIPC_CMD_SHOW_LINK_STATS: 1103 case TIPC_CMD_SHOW_LINK_STATS:
@@ -1148,12 +1151,12 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg)
1148 return tipc_nl_compat_dumpit(&dump, msg); 1151 return tipc_nl_compat_dumpit(&dump, msg);
1149 case TIPC_CMD_SET_NODE_ADDR: 1152 case TIPC_CMD_SET_NODE_ADDR:
1150 msg->req_type = TIPC_TLV_NET_ADDR; 1153 msg->req_type = TIPC_TLV_NET_ADDR;
1151 doit.doit = tipc_nl_net_set; 1154 doit.doit = __tipc_nl_net_set;
1152 doit.transcode = tipc_nl_compat_net_set; 1155 doit.transcode = tipc_nl_compat_net_set;
1153 return tipc_nl_compat_doit(&doit, msg); 1156 return tipc_nl_compat_doit(&doit, msg);
1154 case TIPC_CMD_SET_NETID: 1157 case TIPC_CMD_SET_NETID:
1155 msg->req_type = TIPC_TLV_UNSIGNED; 1158 msg->req_type = TIPC_TLV_UNSIGNED;
1156 doit.doit = tipc_nl_net_set; 1159 doit.doit = __tipc_nl_net_set;
1157 doit.transcode = tipc_nl_compat_net_set; 1160 doit.transcode = tipc_nl_compat_net_set;
1158 return tipc_nl_compat_doit(&doit, msg); 1161 return tipc_nl_compat_doit(&doit, msg);
1159 case TIPC_CMD_GET_NETID: 1162 case TIPC_CMD_GET_NETID:
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index b0d5fcea47e7..e9b4b53ab53e 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -308,8 +308,11 @@ static int do_tls_getsockopt_tx(struct sock *sk, char __user *optval,
308 goto out; 308 goto out;
309 } 309 }
310 lock_sock(sk); 310 lock_sock(sk);
311 memcpy(crypto_info_aes_gcm_128->iv, ctx->iv, 311 memcpy(crypto_info_aes_gcm_128->iv,
312 ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE,
312 TLS_CIPHER_AES_GCM_128_IV_SIZE); 313 TLS_CIPHER_AES_GCM_128_IV_SIZE);
314 memcpy(crypto_info_aes_gcm_128->rec_seq, ctx->rec_seq,
315 TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE);
313 release_sock(sk); 316 release_sock(sk);
314 if (copy_to_user(optval, 317 if (copy_to_user(optval,
315 crypto_info_aes_gcm_128, 318 crypto_info_aes_gcm_128,
@@ -375,7 +378,7 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval,
375 rc = copy_from_user(crypto_info, optval, sizeof(*crypto_info)); 378 rc = copy_from_user(crypto_info, optval, sizeof(*crypto_info));
376 if (rc) { 379 if (rc) {
377 rc = -EFAULT; 380 rc = -EFAULT;
378 goto out; 381 goto err_crypto_info;
379 } 382 }
380 383
381 /* check version */ 384 /* check version */
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d545e1d0dea2..2d465bdeccbc 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1825,7 +1825,7 @@ out:
1825} 1825}
1826 1826
1827/* We use paged skbs for stream sockets, and limit occupancy to 32768 1827/* We use paged skbs for stream sockets, and limit occupancy to 32768
1828 * bytes, and a minimun of a full page. 1828 * bytes, and a minimum of a full page.
1829 */ 1829 */
1830#define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768)) 1830#define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768))
1831 1831
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 51aa55618ef7..b12da6ef3c12 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -170,9 +170,28 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
170 enum nl80211_bss_scan_width scan_width; 170 enum nl80211_bss_scan_width scan_width;
171 struct ieee80211_supported_band *sband = 171 struct ieee80211_supported_band *sband =
172 rdev->wiphy.bands[setup->chandef.chan->band]; 172 rdev->wiphy.bands[setup->chandef.chan->band];
173 scan_width = cfg80211_chandef_to_scan_width(&setup->chandef); 173
174 setup->basic_rates = ieee80211_mandatory_rates(sband, 174 if (setup->chandef.chan->band == NL80211_BAND_2GHZ) {
175 scan_width); 175 int i;
176
177 /*
178 * Older versions selected the mandatory rates for
179 * 2.4 GHz as well, but were broken in that only
180 * 1 Mbps was regarded as a mandatory rate. Keep
181 * using just 1 Mbps as the default basic rate for
182 * mesh to be interoperable with older versions.
183 */
184 for (i = 0; i < sband->n_bitrates; i++) {
185 if (sband->bitrates[i].bitrate == 10) {
186 setup->basic_rates = BIT(i);
187 break;
188 }
189 }
190 } else {
191 scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
192 setup->basic_rates = ieee80211_mandatory_rates(sband,
193 scan_width);
194 }
176 } 195 }
177 196
178 err = cfg80211_chandef_dfs_required(&rdev->wiphy, 197 err = cfg80211_chandef_dfs_required(&rdev->wiphy,
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index fdb3646274a5..701cfd7acc1b 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -1032,6 +1032,8 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
1032 wdev->current_bss = NULL; 1032 wdev->current_bss = NULL;
1033 wdev->ssid_len = 0; 1033 wdev->ssid_len = 0;
1034 wdev->conn_owner_nlportid = 0; 1034 wdev->conn_owner_nlportid = 0;
1035 kzfree(wdev->connect_keys);
1036 wdev->connect_keys = NULL;
1035 1037
1036 nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap); 1038 nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap);
1037 1039
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index 0e349b80686e..ba942e3ead89 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -1,4 +1,5 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2ifndef CROSS_COMPILE
2hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct 3hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct
3 4
4HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include 5HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
@@ -16,7 +17,6 @@ HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
16bpf-direct-objs := bpf-direct.o 17bpf-direct-objs := bpf-direct.o
17 18
18# Try to match the kernel target. 19# Try to match the kernel target.
19ifndef CROSS_COMPILE
20ifndef CONFIG_64BIT 20ifndef CONFIG_64BIT
21 21
22# s390 has -m31 flag to build 31 bit binaries 22# s390 has -m31 flag to build 31 bit binaries
@@ -35,12 +35,4 @@ HOSTLOADLIBES_bpf-fancy += $(MFLAG)
35HOSTLOADLIBES_dropper += $(MFLAG) 35HOSTLOADLIBES_dropper += $(MFLAG)
36endif 36endif
37always := $(hostprogs-m) 37always := $(hostprogs-m)
38else
39# MIPS system calls are defined based on the -mabi that is passed
40# to the toolchain which may or may not be a valid option
41# for the host toolchain. So disable tests if target architecture
42# is MIPS but the host isn't.
43ifndef CONFIG_MIPS
44always := $(hostprogs-m)
45endif
46endif 38endif
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 47cddf32aeba..4f2b25d43ec9 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -256,6 +256,8 @@ __objtool_obj := $(objtree)/tools/objtool/objtool
256 256
257objtool_args = $(if $(CONFIG_UNWINDER_ORC),orc generate,check) 257objtool_args = $(if $(CONFIG_UNWINDER_ORC),orc generate,check)
258 258
259objtool_args += $(if $(part-of-module), --module,)
260
259ifndef CONFIG_FRAME_POINTER 261ifndef CONFIG_FRAME_POINTER
260objtool_args += --no-fp 262objtool_args += --no-fp
261endif 263endif
@@ -264,6 +266,12 @@ objtool_args += --no-unreachable
264else 266else
265objtool_args += $(call cc-ifversion, -lt, 0405, --no-unreachable) 267objtool_args += $(call cc-ifversion, -lt, 0405, --no-unreachable)
266endif 268endif
269ifdef CONFIG_RETPOLINE
270ifneq ($(RETPOLINE_CFLAGS),)
271 objtool_args += --retpoline
272endif
273endif
274
267 275
268ifdef CONFIG_MODVERSIONS 276ifdef CONFIG_MODVERSIONS
269objtool_o = $(@D)/.tmp_$(@F) 277objtool_o = $(@D)/.tmp_$(@F)
diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci
index 1249b727644b..8fd6437beda8 100644
--- a/scripts/coccinelle/api/memdup.cocci
+++ b/scripts/coccinelle/api/memdup.cocci
@@ -56,10 +56,10 @@ statement S;
56p << r.p; 56p << r.p;
57@@ 57@@
58 58
59coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep") 59coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup")
60 60
61@script:python depends on report@ 61@script:python depends on report@
62p << r.p; 62p << r.p;
63@@ 63@@
64 64
65coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep") 65coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup")
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 9ee9bf7fd1a2..65792650c630 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -595,7 +595,7 @@ static void optimize_result(void)
595 * original char code */ 595 * original char code */
596 if (!best_table_len[i]) { 596 if (!best_table_len[i]) {
597 597
598 /* find the token with the breates profit value */ 598 /* find the token with the best profit value */
599 best = find_best_token(); 599 best = find_best_token();
600 if (token_profit[best] == 0) 600 if (token_profit[best] == 0)
601 break; 601 break;
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 5c12dc91ef34..df26c7b0fe13 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -178,7 +178,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
178 case S_HEX: 178 case S_HEX:
179 done: 179 done:
180 if (sym_string_valid(sym, p)) { 180 if (sym_string_valid(sym, p)) {
181 sym->def[def].val = strdup(p); 181 sym->def[def].val = xstrdup(p);
182 sym->flags |= def_flags; 182 sym->flags |= def_flags;
183 } else { 183 } else {
184 if (def != S_DEF_AUTO) 184 if (def != S_DEF_AUTO)
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 2858738b22d5..240880a89111 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -101,7 +101,7 @@ static struct message *message__new(const char *msg, char *option,
101 if (self->files == NULL) 101 if (self->files == NULL)
102 goto out_fail; 102 goto out_fail;
103 103
104 self->msg = strdup(msg); 104 self->msg = xstrdup(msg);
105 if (self->msg == NULL) 105 if (self->msg == NULL)
106 goto out_fail_msg; 106 goto out_fail_msg;
107 107
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 4e23febbe4b2..2d5ec2d0e952 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -115,6 +115,7 @@ int file_write_dep(const char *name);
115void *xmalloc(size_t size); 115void *xmalloc(size_t size);
116void *xcalloc(size_t nmemb, size_t size); 116void *xcalloc(size_t nmemb, size_t size);
117void *xrealloc(void *p, size_t size); 117void *xrealloc(void *p, size_t size);
118char *xstrdup(const char *s);
118 119
119struct gstr { 120struct gstr {
120 size_t len; 121 size_t len;
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index a10bd9d6fafd..6c0bcd9c472d 100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -55,7 +55,8 @@ EOF
55 echo " *** required header files." 1>&2 55 echo " *** required header files." 1>&2
56 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 56 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
57 echo " *** " 1>&2 57 echo " *** " 1>&2
58 echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 58 echo " *** Install ncurses (ncurses-devel or libncurses-dev " 1>&2
59 echo " *** depending on your distribution) and try again." 1>&2
59 echo " *** " 1>&2 60 echo " *** " 1>&2
60 exit 1 61 exit 1
61 fi 62 fi
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 99222855544c..36cd3e1f1c28 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -212,6 +212,7 @@ void menu_add_option(int token, char *arg)
212 sym_defconfig_list = current_entry->sym; 212 sym_defconfig_list = current_entry->sym;
213 else if (sym_defconfig_list != current_entry->sym) 213 else if (sym_defconfig_list != current_entry->sym)
214 zconf_error("trying to redefine defconfig symbol"); 214 zconf_error("trying to redefine defconfig symbol");
215 sym_defconfig_list->flags |= SYMBOL_AUTO;
215 break; 216 break;
216 case T_OPT_ENV: 217 case T_OPT_ENV:
217 prop_add_env(arg); 218 prop_add_env(arg);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index cca9663be5dd..2220bc4b051b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -183,7 +183,7 @@ static void sym_validate_range(struct symbol *sym)
183 sprintf(str, "%lld", val2); 183 sprintf(str, "%lld", val2);
184 else 184 else
185 sprintf(str, "0x%llx", val2); 185 sprintf(str, "0x%llx", val2);
186 sym->curr.val = strdup(str); 186 sym->curr.val = xstrdup(str);
187} 187}
188 188
189static void sym_set_changed(struct symbol *sym) 189static void sym_set_changed(struct symbol *sym)
@@ -849,7 +849,7 @@ struct symbol *sym_lookup(const char *name, int flags)
849 : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) 849 : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
850 return symbol; 850 return symbol;
851 } 851 }
852 new_name = strdup(name); 852 new_name = xstrdup(name);
853 } else { 853 } else {
854 new_name = NULL; 854 new_name = NULL;
855 hash = 0; 855 hash = 0;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index b98a79e30e04..c6f6e21b809f 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -154,3 +154,14 @@ void *xrealloc(void *p, size_t size)
154 fprintf(stderr, "Out of memory.\n"); 154 fprintf(stderr, "Out of memory.\n");
155 exit(1); 155 exit(1);
156} 156}
157
158char *xstrdup(const char *s)
159{
160 char *p;
161
162 p = strdup(s);
163 if (p)
164 return p;
165 fprintf(stderr, "Out of memory.\n");
166 exit(1);
167}
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 02de6fe302a9..88b650eb9cc9 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -332,16 +332,12 @@ void zconf_nextfile(const char *name)
332 "Inclusion path:\n current file : '%s'\n", 332 "Inclusion path:\n current file : '%s'\n",
333 zconf_curname(), zconf_lineno(), 333 zconf_curname(), zconf_lineno(),
334 zconf_curname()); 334 zconf_curname());
335 iter = current_file->parent; 335 iter = current_file;
336 while (iter && \ 336 do {
337 strcmp(iter->name,current_file->name)) {
338 fprintf(stderr, " included from: '%s:%d'\n",
339 iter->name, iter->lineno-1);
340 iter = iter->parent; 337 iter = iter->parent;
341 }
342 if (iter)
343 fprintf(stderr, " included from: '%s:%d'\n", 338 fprintf(stderr, " included from: '%s:%d'\n",
344 iter->name, iter->lineno+1); 339 iter->name, iter->lineno - 1);
340 } while (strcmp(iter->name, current_file->name));
345 exit(1); 341 exit(1);
346 } 342 }
347 } 343 }
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 4be98050b961..ad6305b0f40c 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -127,7 +127,7 @@ no_mainmenu_stmt: /* empty */
127 * later regardless of whether it comes from the 'prompt' in 127 * later regardless of whether it comes from the 'prompt' in
128 * mainmenu_stmt or here 128 * mainmenu_stmt or here
129 */ 129 */
130 menu_add_prompt(P_MENU, strdup("Linux Kernel Configuration"), NULL); 130 menu_add_prompt(P_MENU, xstrdup("Linux Kernel Configuration"), NULL);
131}; 131};
132 132
133 133
@@ -276,6 +276,7 @@ choice: T_CHOICE word_opt T_EOL
276 sym->flags |= SYMBOL_AUTO; 276 sym->flags |= SYMBOL_AUTO;
277 menu_add_entry(sym); 277 menu_add_entry(sym);
278 menu_add_expr(P_CHOICE, NULL, NULL); 278 menu_add_expr(P_CHOICE, NULL, NULL);
279 free($2);
279 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); 280 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
280}; 281};
281 282
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index c0d129d7f430..be56a1153014 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -246,7 +246,7 @@ else
246fi; 246fi;
247 247
248# final build of init/ 248# final build of init/
249${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" 249${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init
250 250
251archive_builtin 251archive_builtin
252 252
diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index 6f9e4ce568cd..9bb0a7f2863e 100644
--- a/security/integrity/digsig.c
+++ b/security/integrity/digsig.c
@@ -18,6 +18,7 @@
18#include <linux/cred.h> 18#include <linux/cred.h>
19#include <linux/key-type.h> 19#include <linux/key-type.h>
20#include <linux/digsig.h> 20#include <linux/digsig.h>
21#include <linux/vmalloc.h>
21#include <crypto/public_key.h> 22#include <crypto/public_key.h>
22#include <keys/system_keyring.h> 23#include <keys/system_keyring.h>
23 24
diff --git a/security/keys/big_key.c b/security/keys/big_key.c
index 929e14978c42..fa728f662a6f 100644
--- a/security/keys/big_key.c
+++ b/security/keys/big_key.c
@@ -22,6 +22,13 @@
22#include <keys/big_key-type.h> 22#include <keys/big_key-type.h>
23#include <crypto/aead.h> 23#include <crypto/aead.h>
24 24
25struct big_key_buf {
26 unsigned int nr_pages;
27 void *virt;
28 struct scatterlist *sg;
29 struct page *pages[];
30};
31
25/* 32/*
26 * Layout of key payload words. 33 * Layout of key payload words.
27 */ 34 */
@@ -91,10 +98,9 @@ static DEFINE_MUTEX(big_key_aead_lock);
91/* 98/*
92 * Encrypt/decrypt big_key data 99 * Encrypt/decrypt big_key data
93 */ 100 */
94static int big_key_crypt(enum big_key_op op, u8 *data, size_t datalen, u8 *key) 101static int big_key_crypt(enum big_key_op op, struct big_key_buf *buf, size_t datalen, u8 *key)
95{ 102{
96 int ret; 103 int ret;
97 struct scatterlist sgio;
98 struct aead_request *aead_req; 104 struct aead_request *aead_req;
99 /* We always use a zero nonce. The reason we can get away with this is 105 /* We always use a zero nonce. The reason we can get away with this is
100 * because we're using a different randomly generated key for every 106 * because we're using a different randomly generated key for every
@@ -109,8 +115,7 @@ static int big_key_crypt(enum big_key_op op, u8 *data, size_t datalen, u8 *key)
109 return -ENOMEM; 115 return -ENOMEM;
110 116
111 memset(zero_nonce, 0, sizeof(zero_nonce)); 117 memset(zero_nonce, 0, sizeof(zero_nonce));
112 sg_init_one(&sgio, data, datalen + (op == BIG_KEY_ENC ? ENC_AUTHTAG_SIZE : 0)); 118 aead_request_set_crypt(aead_req, buf->sg, buf->sg, datalen, zero_nonce);
113 aead_request_set_crypt(aead_req, &sgio, &sgio, datalen, zero_nonce);
114 aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL); 119 aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL);
115 aead_request_set_ad(aead_req, 0); 120 aead_request_set_ad(aead_req, 0);
116 121
@@ -130,21 +135,81 @@ error:
130} 135}
131 136
132/* 137/*
138 * Free up the buffer.
139 */
140static void big_key_free_buffer(struct big_key_buf *buf)
141{
142 unsigned int i;
143
144 if (buf->virt) {
145 memset(buf->virt, 0, buf->nr_pages * PAGE_SIZE);
146 vunmap(buf->virt);
147 }
148
149 for (i = 0; i < buf->nr_pages; i++)
150 if (buf->pages[i])
151 __free_page(buf->pages[i]);
152
153 kfree(buf);
154}
155
156/*
157 * Allocate a buffer consisting of a set of pages with a virtual mapping
158 * applied over them.
159 */
160static void *big_key_alloc_buffer(size_t len)
161{
162 struct big_key_buf *buf;
163 unsigned int npg = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
164 unsigned int i, l;
165
166 buf = kzalloc(sizeof(struct big_key_buf) +
167 sizeof(struct page) * npg +
168 sizeof(struct scatterlist) * npg,
169 GFP_KERNEL);
170 if (!buf)
171 return NULL;
172
173 buf->nr_pages = npg;
174 buf->sg = (void *)(buf->pages + npg);
175 sg_init_table(buf->sg, npg);
176
177 for (i = 0; i < buf->nr_pages; i++) {
178 buf->pages[i] = alloc_page(GFP_KERNEL);
179 if (!buf->pages[i])
180 goto nomem;
181
182 l = min_t(size_t, len, PAGE_SIZE);
183 sg_set_page(&buf->sg[i], buf->pages[i], l, 0);
184 len -= l;
185 }
186
187 buf->virt = vmap(buf->pages, buf->nr_pages, VM_MAP, PAGE_KERNEL);
188 if (!buf->virt)
189 goto nomem;
190
191 return buf;
192
193nomem:
194 big_key_free_buffer(buf);
195 return NULL;
196}
197
198/*
133 * Preparse a big key 199 * Preparse a big key
134 */ 200 */
135int big_key_preparse(struct key_preparsed_payload *prep) 201int big_key_preparse(struct key_preparsed_payload *prep)
136{ 202{
203 struct big_key_buf *buf;
137 struct path *path = (struct path *)&prep->payload.data[big_key_path]; 204 struct path *path = (struct path *)&prep->payload.data[big_key_path];
138 struct file *file; 205 struct file *file;
139 u8 *enckey; 206 u8 *enckey;
140 u8 *data = NULL;
141 ssize_t written; 207 ssize_t written;
142 size_t datalen = prep->datalen; 208 size_t datalen = prep->datalen, enclen = datalen + ENC_AUTHTAG_SIZE;
143 int ret; 209 int ret;
144 210
145 ret = -EINVAL;
146 if (datalen <= 0 || datalen > 1024 * 1024 || !prep->data) 211 if (datalen <= 0 || datalen > 1024 * 1024 || !prep->data)
147 goto error; 212 return -EINVAL;
148 213
149 /* Set an arbitrary quota */ 214 /* Set an arbitrary quota */
150 prep->quotalen = 16; 215 prep->quotalen = 16;
@@ -157,13 +222,12 @@ int big_key_preparse(struct key_preparsed_payload *prep)
157 * 222 *
158 * File content is stored encrypted with randomly generated key. 223 * File content is stored encrypted with randomly generated key.
159 */ 224 */
160 size_t enclen = datalen + ENC_AUTHTAG_SIZE;
161 loff_t pos = 0; 225 loff_t pos = 0;
162 226
163 data = kmalloc(enclen, GFP_KERNEL); 227 buf = big_key_alloc_buffer(enclen);
164 if (!data) 228 if (!buf)
165 return -ENOMEM; 229 return -ENOMEM;
166 memcpy(data, prep->data, datalen); 230 memcpy(buf->virt, prep->data, datalen);
167 231
168 /* generate random key */ 232 /* generate random key */
169 enckey = kmalloc(ENC_KEY_SIZE, GFP_KERNEL); 233 enckey = kmalloc(ENC_KEY_SIZE, GFP_KERNEL);
@@ -176,7 +240,7 @@ int big_key_preparse(struct key_preparsed_payload *prep)
176 goto err_enckey; 240 goto err_enckey;
177 241
178 /* encrypt aligned data */ 242 /* encrypt aligned data */
179 ret = big_key_crypt(BIG_KEY_ENC, data, datalen, enckey); 243 ret = big_key_crypt(BIG_KEY_ENC, buf, datalen, enckey);
180 if (ret) 244 if (ret)
181 goto err_enckey; 245 goto err_enckey;
182 246
@@ -187,7 +251,7 @@ int big_key_preparse(struct key_preparsed_payload *prep)
187 goto err_enckey; 251 goto err_enckey;
188 } 252 }
189 253
190 written = kernel_write(file, data, enclen, &pos); 254 written = kernel_write(file, buf->virt, enclen, &pos);
191 if (written != enclen) { 255 if (written != enclen) {
192 ret = written; 256 ret = written;
193 if (written >= 0) 257 if (written >= 0)
@@ -202,7 +266,7 @@ int big_key_preparse(struct key_preparsed_payload *prep)
202 *path = file->f_path; 266 *path = file->f_path;
203 path_get(path); 267 path_get(path);
204 fput(file); 268 fput(file);
205 kzfree(data); 269 big_key_free_buffer(buf);
206 } else { 270 } else {
207 /* Just store the data in a buffer */ 271 /* Just store the data in a buffer */
208 void *data = kmalloc(datalen, GFP_KERNEL); 272 void *data = kmalloc(datalen, GFP_KERNEL);
@@ -220,7 +284,7 @@ err_fput:
220err_enckey: 284err_enckey:
221 kzfree(enckey); 285 kzfree(enckey);
222error: 286error:
223 kzfree(data); 287 big_key_free_buffer(buf);
224 return ret; 288 return ret;
225} 289}
226 290
@@ -298,15 +362,15 @@ long big_key_read(const struct key *key, char __user *buffer, size_t buflen)
298 return datalen; 362 return datalen;
299 363
300 if (datalen > BIG_KEY_FILE_THRESHOLD) { 364 if (datalen > BIG_KEY_FILE_THRESHOLD) {
365 struct big_key_buf *buf;
301 struct path *path = (struct path *)&key->payload.data[big_key_path]; 366 struct path *path = (struct path *)&key->payload.data[big_key_path];
302 struct file *file; 367 struct file *file;
303 u8 *data;
304 u8 *enckey = (u8 *)key->payload.data[big_key_data]; 368 u8 *enckey = (u8 *)key->payload.data[big_key_data];
305 size_t enclen = datalen + ENC_AUTHTAG_SIZE; 369 size_t enclen = datalen + ENC_AUTHTAG_SIZE;
306 loff_t pos = 0; 370 loff_t pos = 0;
307 371
308 data = kmalloc(enclen, GFP_KERNEL); 372 buf = big_key_alloc_buffer(enclen);
309 if (!data) 373 if (!buf)
310 return -ENOMEM; 374 return -ENOMEM;
311 375
312 file = dentry_open(path, O_RDONLY, current_cred()); 376 file = dentry_open(path, O_RDONLY, current_cred());
@@ -316,26 +380,26 @@ long big_key_read(const struct key *key, char __user *buffer, size_t buflen)
316 } 380 }
317 381
318 /* read file to kernel and decrypt */ 382 /* read file to kernel and decrypt */
319 ret = kernel_read(file, data, enclen, &pos); 383 ret = kernel_read(file, buf->virt, enclen, &pos);
320 if (ret >= 0 && ret != enclen) { 384 if (ret >= 0 && ret != enclen) {
321 ret = -EIO; 385 ret = -EIO;
322 goto err_fput; 386 goto err_fput;
323 } 387 }
324 388
325 ret = big_key_crypt(BIG_KEY_DEC, data, enclen, enckey); 389 ret = big_key_crypt(BIG_KEY_DEC, buf, enclen, enckey);
326 if (ret) 390 if (ret)
327 goto err_fput; 391 goto err_fput;
328 392
329 ret = datalen; 393 ret = datalen;
330 394
331 /* copy decrypted data to user */ 395 /* copy decrypted data to user */
332 if (copy_to_user(buffer, data, datalen) != 0) 396 if (copy_to_user(buffer, buf->virt, datalen) != 0)
333 ret = -EFAULT; 397 ret = -EFAULT;
334 398
335err_fput: 399err_fput:
336 fput(file); 400 fput(file);
337error: 401error:
338 kzfree(data); 402 big_key_free_buffer(buf);
339 } else { 403 } else {
340 ret = datalen; 404 ret = datalen;
341 if (copy_to_user(buffer, key->payload.data[big_key_data], 405 if (copy_to_user(buffer, key->payload.data[big_key_data],
diff --git a/sound/ac97/Kconfig b/sound/ac97/Kconfig
index f8a64e15e5bf..baa5f8ef89d2 100644
--- a/sound/ac97/Kconfig
+++ b/sound/ac97/Kconfig
@@ -5,7 +5,6 @@
5 5
6config AC97_BUS_NEW 6config AC97_BUS_NEW
7 tristate 7 tristate
8 select AC97
9 help 8 help
10 This is the new AC97 bus type, successor of AC97_BUS. The ported 9 This is the new AC97 bus type, successor of AC97_BUS. The ported
11 drivers which benefit from the AC97 automatic probing should "select" 10 drivers which benefit from the AC97 automatic probing should "select"
diff --git a/sound/core/control.c b/sound/core/control.c
index 0b3026d937b1..8a77620a3854 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -889,7 +889,7 @@ static int snd_ctl_elem_read(struct snd_card *card,
889 889
890 index_offset = snd_ctl_get_ioff(kctl, &control->id); 890 index_offset = snd_ctl_get_ioff(kctl, &control->id);
891 vd = &kctl->vd[index_offset]; 891 vd = &kctl->vd[index_offset];
892 if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) && kctl->get == NULL) 892 if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
893 return -EPERM; 893 return -EPERM;
894 894
895 snd_ctl_build_ioff(&control->id, kctl, index_offset); 895 snd_ctl_build_ioff(&control->id, kctl, index_offset);
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 60db32785f62..04d4db44fae5 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1003,7 +1003,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
1003{ 1003{
1004 struct snd_seq_client *client = file->private_data; 1004 struct snd_seq_client *client = file->private_data;
1005 int written = 0, len; 1005 int written = 0, len;
1006 int err = -EINVAL; 1006 int err;
1007 struct snd_seq_event event; 1007 struct snd_seq_event event;
1008 1008
1009 if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT)) 1009 if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT))
@@ -1018,11 +1018,15 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
1018 1018
1019 /* allocate the pool now if the pool is not allocated yet */ 1019 /* allocate the pool now if the pool is not allocated yet */
1020 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) { 1020 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) {
1021 if (snd_seq_pool_init(client->pool) < 0) 1021 mutex_lock(&client->ioctl_mutex);
1022 err = snd_seq_pool_init(client->pool);
1023 mutex_unlock(&client->ioctl_mutex);
1024 if (err < 0)
1022 return -ENOMEM; 1025 return -ENOMEM;
1023 } 1026 }
1024 1027
1025 /* only process whole events */ 1028 /* only process whole events */
1029 err = -EINVAL;
1026 while (count >= sizeof(struct snd_seq_event)) { 1030 while (count >= sizeof(struct snd_seq_event)) {
1027 /* Read in the event header from the user */ 1031 /* Read in the event header from the user */
1028 len = sizeof(event); 1032 len = sizeof(event);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c71dcacea807..96143df19b21 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -181,7 +181,7 @@ static const struct kernel_param_ops param_ops_xint = {
181}; 181};
182#define param_check_xint param_check_int 182#define param_check_xint param_check_int
183 183
184static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; 184static int power_save = -1;
185module_param(power_save, xint, 0644); 185module_param(power_save, xint, 0644);
186MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " 186MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
187 "(in second, 0 = disable)."); 187 "(in second, 0 = disable).");
@@ -2186,6 +2186,24 @@ out_free:
2186 return err; 2186 return err;
2187} 2187}
2188 2188
2189#ifdef CONFIG_PM
2190/* On some boards setting power_save to a non 0 value leads to clicking /
2191 * popping sounds when ever we enter/leave powersaving mode. Ideally we would
2192 * figure out how to avoid these sounds, but that is not always feasible.
2193 * So we keep a list of devices where we disable powersaving as its known
2194 * to causes problems on these devices.
2195 */
2196static struct snd_pci_quirk power_save_blacklist[] = {
2197 /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
2198 SND_PCI_QUIRK(0x1849, 0x0c0c, "Asrock B85M-ITX", 0),
2199 /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
2200 SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0),
2201 /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */
2202 SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0),
2203 {}
2204};
2205#endif /* CONFIG_PM */
2206
2189/* number of codec slots for each chipset: 0 = default slots (i.e. 4) */ 2207/* number of codec slots for each chipset: 0 = default slots (i.e. 4) */
2190static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = { 2208static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = {
2191 [AZX_DRIVER_NVIDIA] = 8, 2209 [AZX_DRIVER_NVIDIA] = 8,
@@ -2198,6 +2216,7 @@ static int azx_probe_continue(struct azx *chip)
2198 struct hdac_bus *bus = azx_bus(chip); 2216 struct hdac_bus *bus = azx_bus(chip);
2199 struct pci_dev *pci = chip->pci; 2217 struct pci_dev *pci = chip->pci;
2200 int dev = chip->dev_index; 2218 int dev = chip->dev_index;
2219 int val;
2201 int err; 2220 int err;
2202 2221
2203 hda->probe_continued = 1; 2222 hda->probe_continued = 1;
@@ -2278,7 +2297,22 @@ static int azx_probe_continue(struct azx *chip)
2278 2297
2279 chip->running = 1; 2298 chip->running = 1;
2280 azx_add_card_list(chip); 2299 azx_add_card_list(chip);
2281 snd_hda_set_power_save(&chip->bus, power_save * 1000); 2300
2301 val = power_save;
2302#ifdef CONFIG_PM
2303 if (val == -1) {
2304 const struct snd_pci_quirk *q;
2305
2306 val = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
2307 q = snd_pci_quirk_lookup(chip->pci, power_save_blacklist);
2308 if (q && val) {
2309 dev_info(chip->card->dev, "device %04x:%04x is on the power_save blacklist, forcing power_save to 0\n",
2310 q->subvendor, q->subdevice);
2311 val = 0;
2312 }
2313 }
2314#endif /* CONFIG_PM */
2315 snd_hda_set_power_save(&chip->bus, val * 1000);
2282 if (azx_has_pm_runtime(chip) || hda->use_vga_switcheroo) 2316 if (azx_has_pm_runtime(chip) || hda->use_vga_switcheroo)
2283 pm_runtime_put_autosuspend(&pci->dev); 2317 pm_runtime_put_autosuspend(&pci->dev);
2284 2318
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 23475888192b..b9c93fa0a51c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3465,6 +3465,19 @@ static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3465 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 3465 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3466} 3466}
3467 3467
3468static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3469 const struct hda_fixup *fix,
3470 int action)
3471{
3472 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3473 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3474
3475 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3476 snd_hda_codec_set_pincfg(codec, 0x19,
3477 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3478 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3479}
3480
3468static void alc269_fixup_hweq(struct hda_codec *codec, 3481static void alc269_fixup_hweq(struct hda_codec *codec,
3469 const struct hda_fixup *fix, int action) 3482 const struct hda_fixup *fix, int action)
3470{ 3483{
@@ -4972,6 +4985,29 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec,
4972 } 4985 }
4973} 4986}
4974 4987
4988static void alc_fixup_tpt470_dock(struct hda_codec *codec,
4989 const struct hda_fixup *fix, int action)
4990{
4991 static const struct hda_pintbl pincfgs[] = {
4992 { 0x17, 0x21211010 }, /* dock headphone */
4993 { 0x19, 0x21a11010 }, /* dock mic */
4994 { }
4995 };
4996 struct alc_spec *spec = codec->spec;
4997
4998 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4999 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5000 snd_hda_apply_pincfgs(codec, pincfgs);
5001 } else if (action == HDA_FIXUP_ACT_INIT) {
5002 /* Enable DOCK device */
5003 snd_hda_codec_write(codec, 0x17, 0,
5004 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5005 /* Enable DOCK device */
5006 snd_hda_codec_write(codec, 0x19, 0,
5007 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5008 }
5009}
5010
4975static void alc_shutup_dell_xps13(struct hda_codec *codec) 5011static void alc_shutup_dell_xps13(struct hda_codec *codec)
4976{ 5012{
4977 struct alc_spec *spec = codec->spec; 5013 struct alc_spec *spec = codec->spec;
@@ -5351,6 +5387,7 @@ enum {
5351 ALC269_FIXUP_LIFEBOOK_EXTMIC, 5387 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5352 ALC269_FIXUP_LIFEBOOK_HP_PIN, 5388 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5353 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, 5389 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5390 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5354 ALC269_FIXUP_AMIC, 5391 ALC269_FIXUP_AMIC,
5355 ALC269_FIXUP_DMIC, 5392 ALC269_FIXUP_DMIC,
5356 ALC269VB_FIXUP_AMIC, 5393 ALC269VB_FIXUP_AMIC,
@@ -5446,6 +5483,7 @@ enum {
5446 ALC700_FIXUP_INTEL_REFERENCE, 5483 ALC700_FIXUP_INTEL_REFERENCE,
5447 ALC274_FIXUP_DELL_BIND_DACS, 5484 ALC274_FIXUP_DELL_BIND_DACS,
5448 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 5485 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5486 ALC298_FIXUP_TPT470_DOCK,
5449}; 5487};
5450 5488
5451static const struct hda_fixup alc269_fixups[] = { 5489static const struct hda_fixup alc269_fixups[] = {
@@ -5556,6 +5594,10 @@ static const struct hda_fixup alc269_fixups[] = {
5556 .type = HDA_FIXUP_FUNC, 5594 .type = HDA_FIXUP_FUNC,
5557 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 5595 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5558 }, 5596 },
5597 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
5598 .type = HDA_FIXUP_FUNC,
5599 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
5600 },
5559 [ALC269_FIXUP_AMIC] = { 5601 [ALC269_FIXUP_AMIC] = {
5560 .type = HDA_FIXUP_PINS, 5602 .type = HDA_FIXUP_PINS,
5561 .v.pins = (const struct hda_pintbl[]) { 5603 .v.pins = (const struct hda_pintbl[]) {
@@ -6271,6 +6313,12 @@ static const struct hda_fixup alc269_fixups[] = {
6271 .chained = true, 6313 .chained = true,
6272 .chain_id = ALC274_FIXUP_DELL_BIND_DACS 6314 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6273 }, 6315 },
6316 [ALC298_FIXUP_TPT470_DOCK] = {
6317 .type = HDA_FIXUP_FUNC,
6318 .v.func = alc_fixup_tpt470_dock,
6319 .chained = true,
6320 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6321 },
6274}; 6322};
6275 6323
6276static const struct snd_pci_quirk alc269_fixup_tbl[] = { 6324static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6321,6 +6369,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6321 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), 6369 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
6322 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 6370 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
6323 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), 6371 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6372 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6373 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6324 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 6374 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6325 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 6375 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6326 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 6376 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -6422,6 +6472,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6422 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), 6472 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
6423 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), 6473 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6424 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), 6474 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6475 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
6425 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), 6476 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
6426 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), 6477 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
6427 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 6478 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
@@ -6450,8 +6501,16 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6450 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), 6501 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
6451 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 6502 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
6452 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 6503 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
6504 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6505 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6453 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), 6506 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
6454 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), 6507 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
6508 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
6509 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6510 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6511 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6512 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6513 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6455 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 6514 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6456 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 6515 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6457 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6516 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
@@ -6472,7 +6531,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6472 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), 6531 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
6473 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), 6532 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
6474 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), 6533 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
6534 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6535 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6536 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6475 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 6537 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6538 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6539 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6476 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 6540 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
6477 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 6541 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
6478 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ 6542 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
@@ -6735,6 +6799,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
6735 {0x14, 0x90170110}, 6799 {0x14, 0x90170110},
6736 {0x21, 0x02211020}), 6800 {0x21, 0x02211020}),
6737 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 6801 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6802 {0x12, 0x90a60130},
6803 {0x14, 0x90170110},
6804 {0x14, 0x01011020},
6805 {0x21, 0x0221101f}),
6806 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6738 ALC256_STANDARD_PINS), 6807 ALC256_STANDARD_PINS),
6739 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 6808 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
6740 {0x14, 0x90170110}, 6809 {0x14, 0x90170110},
@@ -6803,6 +6872,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
6803 {0x12, 0x90a60120}, 6872 {0x12, 0x90a60120},
6804 {0x14, 0x90170110}, 6873 {0x14, 0x90170110},
6805 {0x21, 0x0321101f}), 6874 {0x21, 0x0321101f}),
6875 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6876 {0x12, 0xb7a60130},
6877 {0x14, 0x90170110},
6878 {0x21, 0x04211020}),
6806 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 6879 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
6807 ALC290_STANDARD_PINS, 6880 ALC290_STANDARD_PINS,
6808 {0x15, 0x04211040}, 6881 {0x15, 0x04211040},
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 9afb8ab524c7..06b22624ab7a 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -347,17 +347,20 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request,
347 int validx, int *value_ret) 347 int validx, int *value_ret)
348{ 348{
349 struct snd_usb_audio *chip = cval->head.mixer->chip; 349 struct snd_usb_audio *chip = cval->head.mixer->chip;
350 unsigned char buf[4 + 3 * sizeof(__u32)]; /* enough space for one range */ 350 /* enough space for one range */
351 unsigned char buf[sizeof(__u16) + 3 * sizeof(__u32)];
351 unsigned char *val; 352 unsigned char *val;
352 int idx = 0, ret, size; 353 int idx = 0, ret, val_size, size;
353 __u8 bRequest; 354 __u8 bRequest;
354 355
356 val_size = uac2_ctl_value_size(cval->val_type);
357
355 if (request == UAC_GET_CUR) { 358 if (request == UAC_GET_CUR) {
356 bRequest = UAC2_CS_CUR; 359 bRequest = UAC2_CS_CUR;
357 size = uac2_ctl_value_size(cval->val_type); 360 size = val_size;
358 } else { 361 } else {
359 bRequest = UAC2_CS_RANGE; 362 bRequest = UAC2_CS_RANGE;
360 size = sizeof(buf); 363 size = sizeof(__u16) + 3 * val_size;
361 } 364 }
362 365
363 memset(buf, 0, sizeof(buf)); 366 memset(buf, 0, sizeof(buf));
@@ -390,16 +393,17 @@ error:
390 val = buf + sizeof(__u16); 393 val = buf + sizeof(__u16);
391 break; 394 break;
392 case UAC_GET_MAX: 395 case UAC_GET_MAX:
393 val = buf + sizeof(__u16) * 2; 396 val = buf + sizeof(__u16) + val_size;
394 break; 397 break;
395 case UAC_GET_RES: 398 case UAC_GET_RES:
396 val = buf + sizeof(__u16) * 3; 399 val = buf + sizeof(__u16) + val_size * 2;
397 break; 400 break;
398 default: 401 default:
399 return -EINVAL; 402 return -EINVAL;
400 } 403 }
401 404
402 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(val, sizeof(__u16))); 405 *value_ret = convert_signed_value(cval,
406 snd_usb_combine_bytes(val, val_size));
403 407
404 return 0; 408 return 0;
405} 409}
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index b9c9a19f9588..3cbfae6604f9 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -357,6 +357,15 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
357 357
358 alts = &iface->altsetting[1]; 358 alts = &iface->altsetting[1];
359 goto add_sync_ep; 359 goto add_sync_ep;
360 case USB_ID(0x1397, 0x0002):
361 ep = 0x81;
362 iface = usb_ifnum_to_if(dev, 1);
363
364 if (!iface || iface->num_altsetting == 0)
365 return -EINVAL;
366
367 alts = &iface->altsetting[1];
368 goto add_sync_ep;
360 369
361 } 370 }
362 if (attr == USB_ENDPOINT_SYNC_ASYNC && 371 if (attr == USB_ENDPOINT_SYNC_ASYNC &&
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 50252046b01d..754e632a27bd 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3325,4 +3325,51 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
3325 } 3325 }
3326}, 3326},
3327 3327
3328{
3329 /*
3330 * Bower's & Wilkins PX headphones only support the 48 kHz sample rate
3331 * even though it advertises more. The capture interface doesn't work
3332 * even on windows.
3333 */
3334 USB_DEVICE(0x19b5, 0x0021),
3335 .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
3336 .ifnum = QUIRK_ANY_INTERFACE,
3337 .type = QUIRK_COMPOSITE,
3338 .data = (const struct snd_usb_audio_quirk[]) {
3339 {
3340 .ifnum = 0,
3341 .type = QUIRK_AUDIO_STANDARD_MIXER,
3342 },
3343 /* Capture */
3344 {
3345 .ifnum = 1,
3346 .type = QUIRK_IGNORE_INTERFACE,
3347 },
3348 /* Playback */
3349 {
3350 .ifnum = 2,
3351 .type = QUIRK_AUDIO_FIXED_ENDPOINT,
3352 .data = &(const struct audioformat) {
3353 .formats = SNDRV_PCM_FMTBIT_S16_LE,
3354 .channels = 2,
3355 .iface = 2,
3356 .altsetting = 1,
3357 .altset_idx = 1,
3358 .attributes = UAC_EP_CS_ATTR_FILL_MAX |
3359 UAC_EP_CS_ATTR_SAMPLE_RATE,
3360 .endpoint = 0x03,
3361 .ep_attr = USB_ENDPOINT_XFER_ISOC,
3362 .rates = SNDRV_PCM_RATE_48000,
3363 .rate_min = 48000,
3364 .rate_max = 48000,
3365 .nr_rates = 1,
3366 .rate_table = (unsigned int[]) {
3367 48000
3368 }
3369 }
3370 },
3371 }
3372 }
3373},
3374
3328#undef USB_DEVICE_VENDOR_SPEC 3375#undef USB_DEVICE_VENDOR_SPEC
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a66ef5777887..ea8f3de92fa4 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1363,8 +1363,11 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
1363 return SNDRV_PCM_FMTBIT_DSD_U32_BE; 1363 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
1364 break; 1364 break;
1365 1365
1366 /* Amanero Combo384 USB interface with native DSD support */ 1366 /* Amanero Combo384 USB based DACs with native DSD support */
1367 case USB_ID(0x16d0, 0x071a): 1367 case USB_ID(0x16d0, 0x071a): /* Amanero - Combo384 */
1368 case USB_ID(0x2ab6, 0x0004): /* T+A DAC8DSD-V2.0, MP1000E-V2.0, MP2000R-V2.0, MP2500R-V2.0, MP3100HV-V2.0 */
1369 case USB_ID(0x2ab6, 0x0005): /* T+A USB HD Audio 1 */
1370 case USB_ID(0x2ab6, 0x0006): /* T+A USB HD Audio 2 */
1368 if (fp->altsetting == 2) { 1371 if (fp->altsetting == 2) {
1369 switch (le16_to_cpu(chip->dev->descriptor.bcdDevice)) { 1372 switch (le16_to_cpu(chip->dev->descriptor.bcdDevice)) {
1370 case 0x199: 1373 case 0x199:
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index a0951505c7f5..4ed9d0c41843 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -50,6 +50,7 @@
50/*standard module options for ALSA. This module supports only one card*/ 50/*standard module options for ALSA. This module supports only one card*/
51static int hdmi_card_index = SNDRV_DEFAULT_IDX1; 51static int hdmi_card_index = SNDRV_DEFAULT_IDX1;
52static char *hdmi_card_id = SNDRV_DEFAULT_STR1; 52static char *hdmi_card_id = SNDRV_DEFAULT_STR1;
53static bool single_port;
53 54
54module_param_named(index, hdmi_card_index, int, 0444); 55module_param_named(index, hdmi_card_index, int, 0444);
55MODULE_PARM_DESC(index, 56MODULE_PARM_DESC(index,
@@ -57,6 +58,9 @@ MODULE_PARM_DESC(index,
57module_param_named(id, hdmi_card_id, charp, 0444); 58module_param_named(id, hdmi_card_id, charp, 0444);
58MODULE_PARM_DESC(id, 59MODULE_PARM_DESC(id,
59 "ID string for INTEL Intel HDMI Audio controller."); 60 "ID string for INTEL Intel HDMI Audio controller.");
61module_param(single_port, bool, 0444);
62MODULE_PARM_DESC(single_port,
63 "Single-port mode (for compatibility)");
60 64
61/* 65/*
62 * ELD SA bits in the CEA Speaker Allocation data block 66 * ELD SA bits in the CEA Speaker Allocation data block
@@ -1579,7 +1583,11 @@ static irqreturn_t display_pipe_interrupt_handler(int irq, void *dev_id)
1579static void notify_audio_lpe(struct platform_device *pdev, int port) 1583static void notify_audio_lpe(struct platform_device *pdev, int port)
1580{ 1584{
1581 struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev); 1585 struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev);
1582 struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port]; 1586 struct snd_intelhad *ctx;
1587
1588 ctx = &card_ctx->pcm_ctx[single_port ? 0 : port];
1589 if (single_port)
1590 ctx->port = port;
1583 1591
1584 schedule_work(&ctx->hdmi_audio_wq); 1592 schedule_work(&ctx->hdmi_audio_wq);
1585} 1593}
@@ -1743,6 +1751,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
1743{ 1751{
1744 struct snd_card *card; 1752 struct snd_card *card;
1745 struct snd_intelhad_card *card_ctx; 1753 struct snd_intelhad_card *card_ctx;
1754 struct snd_intelhad *ctx;
1746 struct snd_pcm *pcm; 1755 struct snd_pcm *pcm;
1747 struct intel_hdmi_lpe_audio_pdata *pdata; 1756 struct intel_hdmi_lpe_audio_pdata *pdata;
1748 int irq; 1757 int irq;
@@ -1787,6 +1796,21 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
1787 1796
1788 platform_set_drvdata(pdev, card_ctx); 1797 platform_set_drvdata(pdev, card_ctx);
1789 1798
1799 card_ctx->num_pipes = pdata->num_pipes;
1800 card_ctx->num_ports = single_port ? 1 : pdata->num_ports;
1801
1802 for_each_port(card_ctx, port) {
1803 ctx = &card_ctx->pcm_ctx[port];
1804 ctx->card_ctx = card_ctx;
1805 ctx->dev = card_ctx->dev;
1806 ctx->port = single_port ? -1 : port;
1807 ctx->pipe = -1;
1808
1809 spin_lock_init(&ctx->had_spinlock);
1810 mutex_init(&ctx->mutex);
1811 INIT_WORK(&ctx->hdmi_audio_wq, had_audio_wq);
1812 }
1813
1790 dev_dbg(&pdev->dev, "%s: mmio_start = 0x%x, mmio_end = 0x%x\n", 1814 dev_dbg(&pdev->dev, "%s: mmio_start = 0x%x, mmio_end = 0x%x\n",
1791 __func__, (unsigned int)res_mmio->start, 1815 __func__, (unsigned int)res_mmio->start,
1792 (unsigned int)res_mmio->end); 1816 (unsigned int)res_mmio->end);
@@ -1816,19 +1840,12 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
1816 init_channel_allocations(); 1840 init_channel_allocations();
1817 1841
1818 card_ctx->num_pipes = pdata->num_pipes; 1842 card_ctx->num_pipes = pdata->num_pipes;
1819 card_ctx->num_ports = pdata->num_ports; 1843 card_ctx->num_ports = single_port ? 1 : pdata->num_ports;
1820 1844
1821 for_each_port(card_ctx, port) { 1845 for_each_port(card_ctx, port) {
1822 struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port];
1823 int i; 1846 int i;
1824 1847
1825 ctx->card_ctx = card_ctx; 1848 ctx = &card_ctx->pcm_ctx[port];
1826 ctx->dev = card_ctx->dev;
1827 ctx->port = port;
1828 ctx->pipe = -1;
1829
1830 INIT_WORK(&ctx->hdmi_audio_wq, had_audio_wq);
1831
1832 ret = snd_pcm_new(card, INTEL_HAD, port, MAX_PB_STREAMS, 1849 ret = snd_pcm_new(card, INTEL_HAD, port, MAX_PB_STREAMS,
1833 MAX_CAP_STREAMS, &pcm); 1850 MAX_CAP_STREAMS, &pcm);
1834 if (ret) 1851 if (ret)
diff --git a/tools/arch/powerpc/include/uapi/asm/kvm.h b/tools/arch/powerpc/include/uapi/asm/kvm.h
index 637b7263cb86..833ed9a16adf 100644
--- a/tools/arch/powerpc/include/uapi/asm/kvm.h
+++ b/tools/arch/powerpc/include/uapi/asm/kvm.h
@@ -632,6 +632,8 @@ struct kvm_ppc_cpu_char {
632#define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc) 632#define KVM_REG_PPC_TIDR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbc)
633#define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd) 633#define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
634 634
635#define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
636
635/* Transactional Memory checkpointed state: 637/* Transactional Memory checkpointed state:
636 * This is all GPRs, all VSX regs and a subset of SPRs 638 * This is all GPRs, all VSX regs and a subset of SPRs
637 */ 639 */
diff --git a/tools/arch/s390/include/uapi/asm/unistd.h b/tools/arch/s390/include/uapi/asm/unistd.h
deleted file mode 100644
index 725120939051..000000000000
--- a/tools/arch/s390/include/uapi/asm/unistd.h
+++ /dev/null
@@ -1,412 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 *
5 * Derived from "include/asm-i386/unistd.h"
6 */
7
8#ifndef _UAPI_ASM_S390_UNISTD_H_
9#define _UAPI_ASM_S390_UNISTD_H_
10
11/*
12 * This file contains the system call numbers.
13 */
14
15#define __NR_exit 1
16#define __NR_fork 2
17#define __NR_read 3
18#define __NR_write 4
19#define __NR_open 5
20#define __NR_close 6
21#define __NR_restart_syscall 7
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_mknod 14
28#define __NR_chmod 15
29#define __NR_lseek 19
30#define __NR_getpid 20
31#define __NR_mount 21
32#define __NR_umount 22
33#define __NR_ptrace 26
34#define __NR_alarm 27
35#define __NR_pause 29
36#define __NR_utime 30
37#define __NR_access 33
38#define __NR_nice 34
39#define __NR_sync 36
40#define __NR_kill 37
41#define __NR_rename 38
42#define __NR_mkdir 39
43#define __NR_rmdir 40
44#define __NR_dup 41
45#define __NR_pipe 42
46#define __NR_times 43
47#define __NR_brk 45
48#define __NR_signal 48
49#define __NR_acct 51
50#define __NR_umount2 52
51#define __NR_ioctl 54
52#define __NR_fcntl 55
53#define __NR_setpgid 57
54#define __NR_umask 60
55#define __NR_chroot 61
56#define __NR_ustat 62
57#define __NR_dup2 63
58#define __NR_getppid 64
59#define __NR_getpgrp 65
60#define __NR_setsid 66
61#define __NR_sigaction 67
62#define __NR_sigsuspend 72
63#define __NR_sigpending 73
64#define __NR_sethostname 74
65#define __NR_setrlimit 75
66#define __NR_getrusage 77
67#define __NR_gettimeofday 78
68#define __NR_settimeofday 79
69#define __NR_symlink 83
70#define __NR_readlink 85
71#define __NR_uselib 86
72#define __NR_swapon 87
73#define __NR_reboot 88
74#define __NR_readdir 89
75#define __NR_mmap 90
76#define __NR_munmap 91
77#define __NR_truncate 92
78#define __NR_ftruncate 93
79#define __NR_fchmod 94
80#define __NR_getpriority 96
81#define __NR_setpriority 97
82#define __NR_statfs 99
83#define __NR_fstatfs 100
84#define __NR_socketcall 102
85#define __NR_syslog 103
86#define __NR_setitimer 104
87#define __NR_getitimer 105
88#define __NR_stat 106
89#define __NR_lstat 107
90#define __NR_fstat 108
91#define __NR_lookup_dcookie 110
92#define __NR_vhangup 111
93#define __NR_idle 112
94#define __NR_wait4 114
95#define __NR_swapoff 115
96#define __NR_sysinfo 116
97#define __NR_ipc 117
98#define __NR_fsync 118
99#define __NR_sigreturn 119
100#define __NR_clone 120
101#define __NR_setdomainname 121
102#define __NR_uname 122
103#define __NR_adjtimex 124
104#define __NR_mprotect 125
105#define __NR_sigprocmask 126
106#define __NR_create_module 127
107#define __NR_init_module 128
108#define __NR_delete_module 129
109#define __NR_get_kernel_syms 130
110#define __NR_quotactl 131
111#define __NR_getpgid 132
112#define __NR_fchdir 133
113#define __NR_bdflush 134
114#define __NR_sysfs 135
115#define __NR_personality 136
116#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
117#define __NR_getdents 141
118#define __NR_flock 143
119#define __NR_msync 144
120#define __NR_readv 145
121#define __NR_writev 146
122#define __NR_getsid 147
123#define __NR_fdatasync 148
124#define __NR__sysctl 149
125#define __NR_mlock 150
126#define __NR_munlock 151
127#define __NR_mlockall 152
128#define __NR_munlockall 153
129#define __NR_sched_setparam 154
130#define __NR_sched_getparam 155
131#define __NR_sched_setscheduler 156
132#define __NR_sched_getscheduler 157
133#define __NR_sched_yield 158
134#define __NR_sched_get_priority_max 159
135#define __NR_sched_get_priority_min 160
136#define __NR_sched_rr_get_interval 161
137#define __NR_nanosleep 162
138#define __NR_mremap 163
139#define __NR_query_module 167
140#define __NR_poll 168
141#define __NR_nfsservctl 169
142#define __NR_prctl 172
143#define __NR_rt_sigreturn 173
144#define __NR_rt_sigaction 174
145#define __NR_rt_sigprocmask 175
146#define __NR_rt_sigpending 176
147#define __NR_rt_sigtimedwait 177
148#define __NR_rt_sigqueueinfo 178
149#define __NR_rt_sigsuspend 179
150#define __NR_pread64 180
151#define __NR_pwrite64 181
152#define __NR_getcwd 183
153#define __NR_capget 184
154#define __NR_capset 185
155#define __NR_sigaltstack 186
156#define __NR_sendfile 187
157#define __NR_getpmsg 188
158#define __NR_putpmsg 189
159#define __NR_vfork 190
160#define __NR_pivot_root 217
161#define __NR_mincore 218
162#define __NR_madvise 219
163#define __NR_getdents64 220
164#define __NR_readahead 222
165#define __NR_setxattr 224
166#define __NR_lsetxattr 225
167#define __NR_fsetxattr 226
168#define __NR_getxattr 227
169#define __NR_lgetxattr 228
170#define __NR_fgetxattr 229
171#define __NR_listxattr 230
172#define __NR_llistxattr 231
173#define __NR_flistxattr 232
174#define __NR_removexattr 233
175#define __NR_lremovexattr 234
176#define __NR_fremovexattr 235
177#define __NR_gettid 236
178#define __NR_tkill 237
179#define __NR_futex 238
180#define __NR_sched_setaffinity 239
181#define __NR_sched_getaffinity 240
182#define __NR_tgkill 241
183/* Number 242 is reserved for tux */
184#define __NR_io_setup 243
185#define __NR_io_destroy 244
186#define __NR_io_getevents 245
187#define __NR_io_submit 246
188#define __NR_io_cancel 247
189#define __NR_exit_group 248
190#define __NR_epoll_create 249
191#define __NR_epoll_ctl 250
192#define __NR_epoll_wait 251
193#define __NR_set_tid_address 252
194#define __NR_fadvise64 253
195#define __NR_timer_create 254
196#define __NR_timer_settime 255
197#define __NR_timer_gettime 256
198#define __NR_timer_getoverrun 257
199#define __NR_timer_delete 258
200#define __NR_clock_settime 259
201#define __NR_clock_gettime 260
202#define __NR_clock_getres 261
203#define __NR_clock_nanosleep 262
204/* Number 263 is reserved for vserver */
205#define __NR_statfs64 265
206#define __NR_fstatfs64 266
207#define __NR_remap_file_pages 267
208#define __NR_mbind 268
209#define __NR_get_mempolicy 269
210#define __NR_set_mempolicy 270
211#define __NR_mq_open 271
212#define __NR_mq_unlink 272
213#define __NR_mq_timedsend 273
214#define __NR_mq_timedreceive 274
215#define __NR_mq_notify 275
216#define __NR_mq_getsetattr 276
217#define __NR_kexec_load 277
218#define __NR_add_key 278
219#define __NR_request_key 279
220#define __NR_keyctl 280
221#define __NR_waitid 281
222#define __NR_ioprio_set 282
223#define __NR_ioprio_get 283
224#define __NR_inotify_init 284
225#define __NR_inotify_add_watch 285
226#define __NR_inotify_rm_watch 286
227#define __NR_migrate_pages 287
228#define __NR_openat 288
229#define __NR_mkdirat 289
230#define __NR_mknodat 290
231#define __NR_fchownat 291
232#define __NR_futimesat 292
233#define __NR_unlinkat 294
234#define __NR_renameat 295
235#define __NR_linkat 296
236#define __NR_symlinkat 297
237#define __NR_readlinkat 298
238#define __NR_fchmodat 299
239#define __NR_faccessat 300
240#define __NR_pselect6 301
241#define __NR_ppoll 302
242#define __NR_unshare 303
243#define __NR_set_robust_list 304
244#define __NR_get_robust_list 305
245#define __NR_splice 306
246#define __NR_sync_file_range 307
247#define __NR_tee 308
248#define __NR_vmsplice 309
249#define __NR_move_pages 310
250#define __NR_getcpu 311
251#define __NR_epoll_pwait 312
252#define __NR_utimes 313
253#define __NR_fallocate 314
254#define __NR_utimensat 315
255#define __NR_signalfd 316
256#define __NR_timerfd 317
257#define __NR_eventfd 318
258#define __NR_timerfd_create 319
259#define __NR_timerfd_settime 320
260#define __NR_timerfd_gettime 321
261#define __NR_signalfd4 322
262#define __NR_eventfd2 323
263#define __NR_inotify_init1 324
264#define __NR_pipe2 325
265#define __NR_dup3 326
266#define __NR_epoll_create1 327
267#define __NR_preadv 328
268#define __NR_pwritev 329
269#define __NR_rt_tgsigqueueinfo 330
270#define __NR_perf_event_open 331
271#define __NR_fanotify_init 332
272#define __NR_fanotify_mark 333
273#define __NR_prlimit64 334
274#define __NR_name_to_handle_at 335
275#define __NR_open_by_handle_at 336
276#define __NR_clock_adjtime 337
277#define __NR_syncfs 338
278#define __NR_setns 339
279#define __NR_process_vm_readv 340
280#define __NR_process_vm_writev 341
281#define __NR_s390_runtime_instr 342
282#define __NR_kcmp 343
283#define __NR_finit_module 344
284#define __NR_sched_setattr 345
285#define __NR_sched_getattr 346
286#define __NR_renameat2 347
287#define __NR_seccomp 348
288#define __NR_getrandom 349
289#define __NR_memfd_create 350
290#define __NR_bpf 351
291#define __NR_s390_pci_mmio_write 352
292#define __NR_s390_pci_mmio_read 353
293#define __NR_execveat 354
294#define __NR_userfaultfd 355
295#define __NR_membarrier 356
296#define __NR_recvmmsg 357
297#define __NR_sendmmsg 358
298#define __NR_socket 359
299#define __NR_socketpair 360
300#define __NR_bind 361
301#define __NR_connect 362
302#define __NR_listen 363
303#define __NR_accept4 364
304#define __NR_getsockopt 365
305#define __NR_setsockopt 366
306#define __NR_getsockname 367
307#define __NR_getpeername 368
308#define __NR_sendto 369
309#define __NR_sendmsg 370
310#define __NR_recvfrom 371
311#define __NR_recvmsg 372
312#define __NR_shutdown 373
313#define __NR_mlock2 374
314#define __NR_copy_file_range 375
315#define __NR_preadv2 376
316#define __NR_pwritev2 377
317#define __NR_s390_guarded_storage 378
318#define __NR_statx 379
319#define __NR_s390_sthyi 380
320#define NR_syscalls 381
321
322/*
323 * There are some system calls that are not present on 64 bit, some
324 * have a different name although they do the same (e.g. __NR_chown32
325 * is __NR_chown on 64 bit).
326 */
327#ifndef __s390x__
328
329#define __NR_time 13
330#define __NR_lchown 16
331#define __NR_setuid 23
332#define __NR_getuid 24
333#define __NR_stime 25
334#define __NR_setgid 46
335#define __NR_getgid 47
336#define __NR_geteuid 49
337#define __NR_getegid 50
338#define __NR_setreuid 70
339#define __NR_setregid 71
340#define __NR_getrlimit 76
341#define __NR_getgroups 80
342#define __NR_setgroups 81
343#define __NR_fchown 95
344#define __NR_ioperm 101
345#define __NR_setfsuid 138
346#define __NR_setfsgid 139
347#define __NR__llseek 140
348#define __NR__newselect 142
349#define __NR_setresuid 164
350#define __NR_getresuid 165
351#define __NR_setresgid 170
352#define __NR_getresgid 171
353#define __NR_chown 182
354#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
355#define __NR_mmap2 192
356#define __NR_truncate64 193
357#define __NR_ftruncate64 194
358#define __NR_stat64 195
359#define __NR_lstat64 196
360#define __NR_fstat64 197
361#define __NR_lchown32 198
362#define __NR_getuid32 199
363#define __NR_getgid32 200
364#define __NR_geteuid32 201
365#define __NR_getegid32 202
366#define __NR_setreuid32 203
367#define __NR_setregid32 204
368#define __NR_getgroups32 205
369#define __NR_setgroups32 206
370#define __NR_fchown32 207
371#define __NR_setresuid32 208
372#define __NR_getresuid32 209
373#define __NR_setresgid32 210
374#define __NR_getresgid32 211
375#define __NR_chown32 212
376#define __NR_setuid32 213
377#define __NR_setgid32 214
378#define __NR_setfsuid32 215
379#define __NR_setfsgid32 216
380#define __NR_fcntl64 221
381#define __NR_sendfile64 223
382#define __NR_fadvise64_64 264
383#define __NR_fstatat64 293
384
385#else
386
387#define __NR_select 142
388#define __NR_getrlimit 191 /* SuS compliant getrlimit */
389#define __NR_lchown 198
390#define __NR_getuid 199
391#define __NR_getgid 200
392#define __NR_geteuid 201
393#define __NR_getegid 202
394#define __NR_setreuid 203
395#define __NR_setregid 204
396#define __NR_getgroups 205
397#define __NR_setgroups 206
398#define __NR_fchown 207
399#define __NR_setresuid 208
400#define __NR_getresuid 209
401#define __NR_setresgid 210
402#define __NR_getresgid 211
403#define __NR_chown 212
404#define __NR_setuid 213
405#define __NR_setgid 214
406#define __NR_setfsuid 215
407#define __NR_setfsgid 216
408#define __NR_newfstatat 293
409
410#endif
411
412#endif /* _UAPI_ASM_S390_UNISTD_H_ */
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index 1d9199e1c2ad..0dfe4d3f74e2 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -210,6 +210,7 @@
210 210
211#define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */ 211#define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */
212#define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */ 212#define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */
213#define X86_FEATURE_SEV ( 7*32+20) /* AMD Secure Encrypted Virtualization */
213 214
214#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */ 215#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
215 216
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index 3a0396d87c42..185acfa229b5 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -244,7 +244,7 @@ static int do_batch(int argc, char **argv)
244 } 244 }
245 245
246 if (errno && errno != ENOENT) { 246 if (errno && errno != ENOENT) {
247 perror("reading batch file failed"); 247 p_err("reading batch file failed: %s", strerror(errno));
248 err = -1; 248 err = -1;
249 } else { 249 } else {
250 p_info("processed %d lines", lines); 250 p_info("processed %d lines", lines);
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index e8e2baaf93c2..e549e329be82 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -774,6 +774,9 @@ static int do_dump(int argc, char **argv)
774 n < 0 ? strerror(errno) : "short write"); 774 n < 0 ? strerror(errno) : "short write");
775 goto err_free; 775 goto err_free;
776 } 776 }
777
778 if (json_output)
779 jsonw_null(json_wtr);
777 } else { 780 } else {
778 if (member_len == &info.jited_prog_len) { 781 if (member_len == &info.jited_prog_len) {
779 const char *name = NULL; 782 const char *name = NULL;
diff --git a/tools/cgroup/Makefile b/tools/cgroup/Makefile
index 860fa151640a..ffca068e4a76 100644
--- a/tools/cgroup/Makefile
+++ b/tools/cgroup/Makefile
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# Makefile for cgroup tools 2# Makefile for cgroup tools
3 3
4CC = $(CROSS_COMPILE)gcc
5CFLAGS = -Wall -Wextra 4CFLAGS = -Wall -Wextra
6 5
7all: cgroup_event_listener 6all: cgroup_event_listener
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 805a2c0cf4cd..240eda014b37 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -12,8 +12,6 @@ endif
12# (this improves performance and avoids hard-to-debug behaviour); 12# (this improves performance and avoids hard-to-debug behaviour);
13MAKEFLAGS += -r 13MAKEFLAGS += -r
14 14
15CC = $(CROSS_COMPILE)gcc
16LD = $(CROSS_COMPILE)ld
17CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 15CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
18 16
19ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon 17ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon
diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 1139d71fa0cf..5db5e62cebda 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# Makefile for Hyper-V tools 2# Makefile for Hyper-V tools
3 3
4CC = $(CROSS_COMPILE)gcc
5WARNINGS = -Wall -Wextra 4WARNINGS = -Wall -Wextra
6CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) 5CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS)
7 6
diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index a08e7a47d6a3..332ed2f6c2c2 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -12,8 +12,6 @@ endif
12# (this improves performance and avoids hard-to-debug behaviour); 12# (this improves performance and avoids hard-to-debug behaviour);
13MAKEFLAGS += -r 13MAKEFLAGS += -r
14 14
15CC = $(CROSS_COMPILE)gcc
16LD = $(CROSS_COMPILE)ld
17CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 15CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
18 16
19ALL_TARGETS := iio_event_monitor lsiio iio_generic_buffer 17ALL_TARGETS := iio_event_monitor lsiio iio_generic_buffer
diff --git a/tools/include/uapi/drm/i915_drm.h b/tools/include/uapi/drm/i915_drm.h
index ac3c6503ca27..536ee4febd74 100644
--- a/tools/include/uapi/drm/i915_drm.h
+++ b/tools/include/uapi/drm/i915_drm.h
@@ -86,6 +86,62 @@ enum i915_mocs_table_index {
86 I915_MOCS_CACHED, 86 I915_MOCS_CACHED,
87}; 87};
88 88
89/*
90 * Different engines serve different roles, and there may be more than one
91 * engine serving each role. enum drm_i915_gem_engine_class provides a
92 * classification of the role of the engine, which may be used when requesting
93 * operations to be performed on a certain subset of engines, or for providing
94 * information about that group.
95 */
96enum drm_i915_gem_engine_class {
97 I915_ENGINE_CLASS_RENDER = 0,
98 I915_ENGINE_CLASS_COPY = 1,
99 I915_ENGINE_CLASS_VIDEO = 2,
100 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
101
102 I915_ENGINE_CLASS_INVALID = -1
103};
104
105/**
106 * DOC: perf_events exposed by i915 through /sys/bus/event_sources/drivers/i915
107 *
108 */
109
110enum drm_i915_pmu_engine_sample {
111 I915_SAMPLE_BUSY = 0,
112 I915_SAMPLE_WAIT = 1,
113 I915_SAMPLE_SEMA = 2
114};
115
116#define I915_PMU_SAMPLE_BITS (4)
117#define I915_PMU_SAMPLE_MASK (0xf)
118#define I915_PMU_SAMPLE_INSTANCE_BITS (8)
119#define I915_PMU_CLASS_SHIFT \
120 (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
121
122#define __I915_PMU_ENGINE(class, instance, sample) \
123 ((class) << I915_PMU_CLASS_SHIFT | \
124 (instance) << I915_PMU_SAMPLE_BITS | \
125 (sample))
126
127#define I915_PMU_ENGINE_BUSY(class, instance) \
128 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
129
130#define I915_PMU_ENGINE_WAIT(class, instance) \
131 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
132
133#define I915_PMU_ENGINE_SEMA(class, instance) \
134 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
135
136#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
137
138#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
139#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
140#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
141#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
142
143#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
144
89/* Each region is a minimum of 16k, and there are at most 255 of them. 145/* Each region is a minimum of 16k, and there are at most 255 of them.
90 */ 146 */
91#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use 147#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
@@ -450,6 +506,27 @@ typedef struct drm_i915_irq_wait {
450 */ 506 */
451#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49 507#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
452 508
509/*
510 * Query whether every context (both per-file default and user created) is
511 * isolated (insofar as HW supports). If this parameter is not true, then
512 * freshly created contexts may inherit values from an existing context,
513 * rather than default HW values. If true, it also ensures (insofar as HW
514 * supports) that all state set by this context will not leak to any other
515 * context.
516 *
517 * As not every engine across every gen support contexts, the returned
518 * value reports the support of context isolation for individual engines by
519 * returning a bitmask of each engine class set to true if that class supports
520 * isolation.
521 */
522#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
523
524/* Frequency of the command streamer timestamps given by the *_TIMESTAMP
525 * registers. This used to be fixed per platform but from CNL onwards, this
526 * might vary depending on the parts.
527 */
528#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
529
453typedef struct drm_i915_getparam { 530typedef struct drm_i915_getparam {
454 __s32 param; 531 __s32 param;
455 /* 532 /*
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h
index 8616131e2c61..6d9447700e18 100644
--- a/tools/include/uapi/linux/if_link.h
+++ b/tools/include/uapi/linux/if_link.h
@@ -163,6 +163,7 @@ enum {
163 IFLA_IF_NETNSID, 163 IFLA_IF_NETNSID,
164 IFLA_CARRIER_UP_COUNT, 164 IFLA_CARRIER_UP_COUNT,
165 IFLA_CARRIER_DOWN_COUNT, 165 IFLA_CARRIER_DOWN_COUNT,
166 IFLA_NEW_IFINDEX,
166 __IFLA_MAX 167 __IFLA_MAX
167}; 168};
168 169
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 8fb90a0819c3..0fb5ef939732 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1362,6 +1362,96 @@ struct kvm_s390_ucas_mapping {
1362/* Available with KVM_CAP_S390_CMMA_MIGRATION */ 1362/* Available with KVM_CAP_S390_CMMA_MIGRATION */
1363#define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log) 1363#define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log)
1364#define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log) 1364#define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log)
1365/* Memory Encryption Commands */
1366#define KVM_MEMORY_ENCRYPT_OP _IOWR(KVMIO, 0xba, unsigned long)
1367
1368struct kvm_enc_region {
1369 __u64 addr;
1370 __u64 size;
1371};
1372
1373#define KVM_MEMORY_ENCRYPT_REG_REGION _IOR(KVMIO, 0xbb, struct kvm_enc_region)
1374#define KVM_MEMORY_ENCRYPT_UNREG_REGION _IOR(KVMIO, 0xbc, struct kvm_enc_region)
1375
1376/* Secure Encrypted Virtualization command */
1377enum sev_cmd_id {
1378 /* Guest initialization commands */
1379 KVM_SEV_INIT = 0,
1380 KVM_SEV_ES_INIT,
1381 /* Guest launch commands */
1382 KVM_SEV_LAUNCH_START,
1383 KVM_SEV_LAUNCH_UPDATE_DATA,
1384 KVM_SEV_LAUNCH_UPDATE_VMSA,
1385 KVM_SEV_LAUNCH_SECRET,
1386 KVM_SEV_LAUNCH_MEASURE,
1387 KVM_SEV_LAUNCH_FINISH,
1388 /* Guest migration commands (outgoing) */
1389 KVM_SEV_SEND_START,
1390 KVM_SEV_SEND_UPDATE_DATA,
1391 KVM_SEV_SEND_UPDATE_VMSA,
1392 KVM_SEV_SEND_FINISH,
1393 /* Guest migration commands (incoming) */
1394 KVM_SEV_RECEIVE_START,
1395 KVM_SEV_RECEIVE_UPDATE_DATA,
1396 KVM_SEV_RECEIVE_UPDATE_VMSA,
1397 KVM_SEV_RECEIVE_FINISH,
1398 /* Guest status and debug commands */
1399 KVM_SEV_GUEST_STATUS,
1400 KVM_SEV_DBG_DECRYPT,
1401 KVM_SEV_DBG_ENCRYPT,
1402 /* Guest certificates commands */
1403 KVM_SEV_CERT_EXPORT,
1404
1405 KVM_SEV_NR_MAX,
1406};
1407
1408struct kvm_sev_cmd {
1409 __u32 id;
1410 __u64 data;
1411 __u32 error;
1412 __u32 sev_fd;
1413};
1414
1415struct kvm_sev_launch_start {
1416 __u32 handle;
1417 __u32 policy;
1418 __u64 dh_uaddr;
1419 __u32 dh_len;
1420 __u64 session_uaddr;
1421 __u32 session_len;
1422};
1423
1424struct kvm_sev_launch_update_data {
1425 __u64 uaddr;
1426 __u32 len;
1427};
1428
1429
1430struct kvm_sev_launch_secret {
1431 __u64 hdr_uaddr;
1432 __u32 hdr_len;
1433 __u64 guest_uaddr;
1434 __u32 guest_len;
1435 __u64 trans_uaddr;
1436 __u32 trans_len;
1437};
1438
1439struct kvm_sev_launch_measure {
1440 __u64 uaddr;
1441 __u32 len;
1442};
1443
1444struct kvm_sev_guest_status {
1445 __u32 handle;
1446 __u32 policy;
1447 __u32 state;
1448};
1449
1450struct kvm_sev_dbg {
1451 __u64 src_uaddr;
1452 __u64 dst_uaddr;
1453 __u32 len;
1454};
1365 1455
1366#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 1456#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1367#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) 1457#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index a5684d0968b4..5898c22ba310 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -33,7 +33,7 @@ import resource
33import struct 33import struct
34import re 34import re
35import subprocess 35import subprocess
36from collections import defaultdict 36from collections import defaultdict, namedtuple
37 37
38VMX_EXIT_REASONS = { 38VMX_EXIT_REASONS = {
39 'EXCEPTION_NMI': 0, 39 'EXCEPTION_NMI': 0,
@@ -228,6 +228,7 @@ IOCTL_NUMBERS = {
228} 228}
229 229
230ENCODING = locale.getpreferredencoding(False) 230ENCODING = locale.getpreferredencoding(False)
231TRACE_FILTER = re.compile(r'^[^\(]*$')
231 232
232 233
233class Arch(object): 234class Arch(object):
@@ -260,6 +261,11 @@ class Arch(object):
260 return ArchX86(SVM_EXIT_REASONS) 261 return ArchX86(SVM_EXIT_REASONS)
261 return 262 return
262 263
264 def tracepoint_is_child(self, field):
265 if (TRACE_FILTER.match(field)):
266 return None
267 return field.split('(', 1)[0]
268
263 269
264class ArchX86(Arch): 270class ArchX86(Arch):
265 def __init__(self, exit_reasons): 271 def __init__(self, exit_reasons):
@@ -267,6 +273,10 @@ class ArchX86(Arch):
267 self.ioctl_numbers = IOCTL_NUMBERS 273 self.ioctl_numbers = IOCTL_NUMBERS
268 self.exit_reasons = exit_reasons 274 self.exit_reasons = exit_reasons
269 275
276 def debugfs_is_child(self, field):
277 """ Returns name of parent if 'field' is a child, None otherwise """
278 return None
279
270 280
271class ArchPPC(Arch): 281class ArchPPC(Arch):
272 def __init__(self): 282 def __init__(self):
@@ -282,6 +292,10 @@ class ArchPPC(Arch):
282 self.ioctl_numbers['SET_FILTER'] = 0x80002406 | char_ptr_size << 16 292 self.ioctl_numbers['SET_FILTER'] = 0x80002406 | char_ptr_size << 16
283 self.exit_reasons = {} 293 self.exit_reasons = {}
284 294
295 def debugfs_is_child(self, field):
296 """ Returns name of parent if 'field' is a child, None otherwise """
297 return None
298
285 299
286class ArchA64(Arch): 300class ArchA64(Arch):
287 def __init__(self): 301 def __init__(self):
@@ -289,6 +303,10 @@ class ArchA64(Arch):
289 self.ioctl_numbers = IOCTL_NUMBERS 303 self.ioctl_numbers = IOCTL_NUMBERS
290 self.exit_reasons = AARCH64_EXIT_REASONS 304 self.exit_reasons = AARCH64_EXIT_REASONS
291 305
306 def debugfs_is_child(self, field):
307 """ Returns name of parent if 'field' is a child, None otherwise """
308 return None
309
292 310
293class ArchS390(Arch): 311class ArchS390(Arch):
294 def __init__(self): 312 def __init__(self):
@@ -296,6 +314,12 @@ class ArchS390(Arch):
296 self.ioctl_numbers = IOCTL_NUMBERS 314 self.ioctl_numbers = IOCTL_NUMBERS
297 self.exit_reasons = None 315 self.exit_reasons = None
298 316
317 def debugfs_is_child(self, field):
318 """ Returns name of parent if 'field' is a child, None otherwise """
319 if field.startswith('instruction_'):
320 return 'exit_instruction'
321
322
299ARCH = Arch.get_arch() 323ARCH = Arch.get_arch()
300 324
301 325
@@ -331,9 +355,6 @@ class perf_event_attr(ctypes.Structure):
331PERF_TYPE_TRACEPOINT = 2 355PERF_TYPE_TRACEPOINT = 2
332PERF_FORMAT_GROUP = 1 << 3 356PERF_FORMAT_GROUP = 1 << 3
333 357
334PATH_DEBUGFS_TRACING = '/sys/kernel/debug/tracing'
335PATH_DEBUGFS_KVM = '/sys/kernel/debug/kvm'
336
337 358
338class Group(object): 359class Group(object):
339 """Represents a perf event group.""" 360 """Represents a perf event group."""
@@ -376,8 +397,8 @@ class Event(object):
376 self.syscall = self.libc.syscall 397 self.syscall = self.libc.syscall
377 self.name = name 398 self.name = name
378 self.fd = None 399 self.fd = None
379 self.setup_event(group, trace_cpu, trace_pid, trace_point, 400 self._setup_event(group, trace_cpu, trace_pid, trace_point,
380 trace_filter, trace_set) 401 trace_filter, trace_set)
381 402
382 def __del__(self): 403 def __del__(self):
383 """Closes the event's file descriptor. 404 """Closes the event's file descriptor.
@@ -390,7 +411,7 @@ class Event(object):
390 if self.fd: 411 if self.fd:
391 os.close(self.fd) 412 os.close(self.fd)
392 413
393 def perf_event_open(self, attr, pid, cpu, group_fd, flags): 414 def _perf_event_open(self, attr, pid, cpu, group_fd, flags):
394 """Wrapper for the sys_perf_evt_open() syscall. 415 """Wrapper for the sys_perf_evt_open() syscall.
395 416
396 Used to set up performance events, returns a file descriptor or -1 417 Used to set up performance events, returns a file descriptor or -1
@@ -409,7 +430,7 @@ class Event(object):
409 ctypes.c_int(pid), ctypes.c_int(cpu), 430 ctypes.c_int(pid), ctypes.c_int(cpu),
410 ctypes.c_int(group_fd), ctypes.c_long(flags)) 431 ctypes.c_int(group_fd), ctypes.c_long(flags))
411 432
412 def setup_event_attribute(self, trace_set, trace_point): 433 def _setup_event_attribute(self, trace_set, trace_point):
413 """Returns an initialized ctype perf_event_attr struct.""" 434 """Returns an initialized ctype perf_event_attr struct."""
414 435
415 id_path = os.path.join(PATH_DEBUGFS_TRACING, 'events', trace_set, 436 id_path = os.path.join(PATH_DEBUGFS_TRACING, 'events', trace_set,
@@ -419,8 +440,8 @@ class Event(object):
419 event_attr.config = int(open(id_path).read()) 440 event_attr.config = int(open(id_path).read())
420 return event_attr 441 return event_attr
421 442
422 def setup_event(self, group, trace_cpu, trace_pid, trace_point, 443 def _setup_event(self, group, trace_cpu, trace_pid, trace_point,
423 trace_filter, trace_set): 444 trace_filter, trace_set):
424 """Sets up the perf event in Linux. 445 """Sets up the perf event in Linux.
425 446
426 Issues the syscall to register the event in the kernel and 447 Issues the syscall to register the event in the kernel and
@@ -428,7 +449,7 @@ class Event(object):
428 449
429 """ 450 """
430 451
431 event_attr = self.setup_event_attribute(trace_set, trace_point) 452 event_attr = self._setup_event_attribute(trace_set, trace_point)
432 453
433 # First event will be group leader. 454 # First event will be group leader.
434 group_leader = -1 455 group_leader = -1
@@ -437,8 +458,8 @@ class Event(object):
437 if group.events: 458 if group.events:
438 group_leader = group.events[0].fd 459 group_leader = group.events[0].fd
439 460
440 fd = self.perf_event_open(event_attr, trace_pid, 461 fd = self._perf_event_open(event_attr, trace_pid,
441 trace_cpu, group_leader, 0) 462 trace_cpu, group_leader, 0)
442 if fd == -1: 463 if fd == -1:
443 err = ctypes.get_errno() 464 err = ctypes.get_errno()
444 raise OSError(err, os.strerror(err), 465 raise OSError(err, os.strerror(err),
@@ -475,6 +496,10 @@ class Event(object):
475 496
476class Provider(object): 497class Provider(object):
477 """Encapsulates functionalities used by all providers.""" 498 """Encapsulates functionalities used by all providers."""
499 def __init__(self, pid):
500 self.child_events = False
501 self.pid = pid
502
478 @staticmethod 503 @staticmethod
479 def is_field_wanted(fields_filter, field): 504 def is_field_wanted(fields_filter, field):
480 """Indicate whether field is valid according to fields_filter.""" 505 """Indicate whether field is valid according to fields_filter."""
@@ -500,12 +525,12 @@ class TracepointProvider(Provider):
500 """ 525 """
501 def __init__(self, pid, fields_filter): 526 def __init__(self, pid, fields_filter):
502 self.group_leaders = [] 527 self.group_leaders = []
503 self.filters = self.get_filters() 528 self.filters = self._get_filters()
504 self.update_fields(fields_filter) 529 self.update_fields(fields_filter)
505 self.pid = pid 530 super(TracepointProvider, self).__init__(pid)
506 531
507 @staticmethod 532 @staticmethod
508 def get_filters(): 533 def _get_filters():
509 """Returns a dict of trace events, their filter ids and 534 """Returns a dict of trace events, their filter ids and
510 the values that can be filtered. 535 the values that can be filtered.
511 536
@@ -521,8 +546,8 @@ class TracepointProvider(Provider):
521 filters['kvm_exit'] = ('exit_reason', ARCH.exit_reasons) 546 filters['kvm_exit'] = ('exit_reason', ARCH.exit_reasons)
522 return filters 547 return filters
523 548
524 def get_available_fields(self): 549 def _get_available_fields(self):
525 """Returns a list of available event's of format 'event name(filter 550 """Returns a list of available events of format 'event name(filter
526 name)'. 551 name)'.
527 552
528 All available events have directories under 553 All available events have directories under
@@ -549,11 +574,12 @@ class TracepointProvider(Provider):
549 574
550 def update_fields(self, fields_filter): 575 def update_fields(self, fields_filter):
551 """Refresh fields, applying fields_filter""" 576 """Refresh fields, applying fields_filter"""
552 self.fields = [field for field in self.get_available_fields() 577 self.fields = [field for field in self._get_available_fields()
553 if self.is_field_wanted(fields_filter, field)] 578 if self.is_field_wanted(fields_filter, field) or
579 ARCH.tracepoint_is_child(field)]
554 580
555 @staticmethod 581 @staticmethod
556 def get_online_cpus(): 582 def _get_online_cpus():
557 """Returns a list of cpu id integers.""" 583 """Returns a list of cpu id integers."""
558 def parse_int_list(list_string): 584 def parse_int_list(list_string):
559 """Returns an int list from a string of comma separated integers and 585 """Returns an int list from a string of comma separated integers and
@@ -575,17 +601,17 @@ class TracepointProvider(Provider):
575 cpu_string = cpu_list.readline() 601 cpu_string = cpu_list.readline()
576 return parse_int_list(cpu_string) 602 return parse_int_list(cpu_string)
577 603
578 def setup_traces(self): 604 def _setup_traces(self):
579 """Creates all event and group objects needed to be able to retrieve 605 """Creates all event and group objects needed to be able to retrieve
580 data.""" 606 data."""
581 fields = self.get_available_fields() 607 fields = self._get_available_fields()
582 if self._pid > 0: 608 if self._pid > 0:
583 # Fetch list of all threads of the monitored pid, as qemu 609 # Fetch list of all threads of the monitored pid, as qemu
584 # starts a thread for each vcpu. 610 # starts a thread for each vcpu.
585 path = os.path.join('/proc', str(self._pid), 'task') 611 path = os.path.join('/proc', str(self._pid), 'task')
586 groupids = self.walkdir(path)[1] 612 groupids = self.walkdir(path)[1]
587 else: 613 else:
588 groupids = self.get_online_cpus() 614 groupids = self._get_online_cpus()
589 615
590 # The constant is needed as a buffer for python libs, std 616 # The constant is needed as a buffer for python libs, std
591 # streams and other files that the script opens. 617 # streams and other files that the script opens.
@@ -663,7 +689,7 @@ class TracepointProvider(Provider):
663 # The garbage collector will get rid of all Event/Group 689 # The garbage collector will get rid of all Event/Group
664 # objects and open files after removing the references. 690 # objects and open files after removing the references.
665 self.group_leaders = [] 691 self.group_leaders = []
666 self.setup_traces() 692 self._setup_traces()
667 self.fields = self._fields 693 self.fields = self._fields
668 694
669 def read(self, by_guest=0): 695 def read(self, by_guest=0):
@@ -671,8 +697,12 @@ class TracepointProvider(Provider):
671 ret = defaultdict(int) 697 ret = defaultdict(int)
672 for group in self.group_leaders: 698 for group in self.group_leaders:
673 for name, val in group.read().items(): 699 for name, val in group.read().items():
674 if name in self._fields: 700 if name not in self._fields:
675 ret[name] += val 701 continue
702 parent = ARCH.tracepoint_is_child(name)
703 if parent:
704 name += ' ' + parent
705 ret[name] += val
676 return ret 706 return ret
677 707
678 def reset(self): 708 def reset(self):
@@ -690,11 +720,11 @@ class DebugfsProvider(Provider):
690 self._baseline = {} 720 self._baseline = {}
691 self.do_read = True 721 self.do_read = True
692 self.paths = [] 722 self.paths = []
693 self.pid = pid 723 super(DebugfsProvider, self).__init__(pid)
694 if include_past: 724 if include_past:
695 self.restore() 725 self._restore()
696 726
697 def get_available_fields(self): 727 def _get_available_fields(self):
698 """"Returns a list of available fields. 728 """"Returns a list of available fields.
699 729
700 The fields are all available KVM debugfs files 730 The fields are all available KVM debugfs files
@@ -704,8 +734,9 @@ class DebugfsProvider(Provider):
704 734
705 def update_fields(self, fields_filter): 735 def update_fields(self, fields_filter):
706 """Refresh fields, applying fields_filter""" 736 """Refresh fields, applying fields_filter"""
707 self._fields = [field for field in self.get_available_fields() 737 self._fields = [field for field in self._get_available_fields()
708 if self.is_field_wanted(fields_filter, field)] 738 if self.is_field_wanted(fields_filter, field) or
739 ARCH.debugfs_is_child(field)]
709 740
710 @property 741 @property
711 def fields(self): 742 def fields(self):
@@ -758,7 +789,7 @@ class DebugfsProvider(Provider):
758 paths.append(dir) 789 paths.append(dir)
759 for path in paths: 790 for path in paths:
760 for field in self._fields: 791 for field in self._fields:
761 value = self.read_field(field, path) 792 value = self._read_field(field, path)
762 key = path + field 793 key = path + field
763 if reset == 1: 794 if reset == 1:
764 self._baseline[key] = value 795 self._baseline[key] = value
@@ -766,20 +797,21 @@ class DebugfsProvider(Provider):
766 self._baseline[key] = 0 797 self._baseline[key] = 0
767 if self._baseline.get(key, -1) == -1: 798 if self._baseline.get(key, -1) == -1:
768 self._baseline[key] = value 799 self._baseline[key] = value
769 increment = (results.get(field, 0) + value - 800 parent = ARCH.debugfs_is_child(field)
770 self._baseline.get(key, 0)) 801 if parent:
771 if by_guest: 802 field = field + ' ' + parent
772 pid = key.split('-')[0] 803 else:
773 if pid in results: 804 if by_guest:
774 results[pid] += increment 805 field = key.split('-')[0] # set 'field' to 'pid'
775 else: 806 increment = value - self._baseline.get(key, 0)
776 results[pid] = increment 807 if field in results:
808 results[field] += increment
777 else: 809 else:
778 results[field] = increment 810 results[field] = increment
779 811
780 return results 812 return results
781 813
782 def read_field(self, field, path): 814 def _read_field(self, field, path):
783 """Returns the value of a single field from a specific VM.""" 815 """Returns the value of a single field from a specific VM."""
784 try: 816 try:
785 return int(open(os.path.join(PATH_DEBUGFS_KVM, 817 return int(open(os.path.join(PATH_DEBUGFS_KVM,
@@ -794,12 +826,15 @@ class DebugfsProvider(Provider):
794 self._baseline = {} 826 self._baseline = {}
795 self.read(1) 827 self.read(1)
796 828
797 def restore(self): 829 def _restore(self):
798 """Reset field counters""" 830 """Reset field counters"""
799 self._baseline = {} 831 self._baseline = {}
800 self.read(2) 832 self.read(2)
801 833
802 834
835EventStat = namedtuple('EventStat', ['value', 'delta'])
836
837
803class Stats(object): 838class Stats(object):
804 """Manages the data providers and the data they provide. 839 """Manages the data providers and the data they provide.
805 840
@@ -808,13 +843,13 @@ class Stats(object):
808 843
809 """ 844 """
810 def __init__(self, options): 845 def __init__(self, options):
811 self.providers = self.get_providers(options) 846 self.providers = self._get_providers(options)
812 self._pid_filter = options.pid 847 self._pid_filter = options.pid
813 self._fields_filter = options.fields 848 self._fields_filter = options.fields
814 self.values = {} 849 self.values = {}
850 self._child_events = False
815 851
816 @staticmethod 852 def _get_providers(self, options):
817 def get_providers(options):
818 """Returns a list of data providers depending on the passed options.""" 853 """Returns a list of data providers depending on the passed options."""
819 providers = [] 854 providers = []
820 855
@@ -826,7 +861,7 @@ class Stats(object):
826 861
827 return providers 862 return providers
828 863
829 def update_provider_filters(self): 864 def _update_provider_filters(self):
830 """Propagates fields filters to providers.""" 865 """Propagates fields filters to providers."""
831 # As we reset the counters when updating the fields we can 866 # As we reset the counters when updating the fields we can
832 # also clear the cache of old values. 867 # also clear the cache of old values.
@@ -847,7 +882,7 @@ class Stats(object):
847 def fields_filter(self, fields_filter): 882 def fields_filter(self, fields_filter):
848 if fields_filter != self._fields_filter: 883 if fields_filter != self._fields_filter:
849 self._fields_filter = fields_filter 884 self._fields_filter = fields_filter
850 self.update_provider_filters() 885 self._update_provider_filters()
851 886
852 @property 887 @property
853 def pid_filter(self): 888 def pid_filter(self):
@@ -861,16 +896,33 @@ class Stats(object):
861 for provider in self.providers: 896 for provider in self.providers:
862 provider.pid = self._pid_filter 897 provider.pid = self._pid_filter
863 898
899 @property
900 def child_events(self):
901 return self._child_events
902
903 @child_events.setter
904 def child_events(self, val):
905 self._child_events = val
906 for provider in self.providers:
907 provider.child_events = val
908
864 def get(self, by_guest=0): 909 def get(self, by_guest=0):
865 """Returns a dict with field -> (value, delta to last value) of all 910 """Returns a dict with field -> (value, delta to last value) of all
866 provider data.""" 911 provider data.
912 Key formats:
913 * plain: 'key' is event name
914 * child-parent: 'key' is in format '<child> <parent>'
915 * pid: 'key' is the pid of the guest, and the record contains the
916 aggregated event data
917 These formats are generated by the providers, and handled in class TUI.
918 """
867 for provider in self.providers: 919 for provider in self.providers:
868 new = provider.read(by_guest=by_guest) 920 new = provider.read(by_guest=by_guest)
869 for key in new if by_guest else provider.fields: 921 for key in new:
870 oldval = self.values.get(key, (0, 0))[0] 922 oldval = self.values.get(key, EventStat(0, 0)).value
871 newval = new.get(key, 0) 923 newval = new.get(key, 0)
872 newdelta = newval - oldval 924 newdelta = newval - oldval
873 self.values[key] = (newval, newdelta) 925 self.values[key] = EventStat(newval, newdelta)
874 return self.values 926 return self.values
875 927
876 def toggle_display_guests(self, to_pid): 928 def toggle_display_guests(self, to_pid):
@@ -899,10 +951,10 @@ class Stats(object):
899 self.get(to_pid) 951 self.get(to_pid)
900 return 0 952 return 0
901 953
954
902DELAY_DEFAULT = 3.0 955DELAY_DEFAULT = 3.0
903MAX_GUEST_NAME_LEN = 48 956MAX_GUEST_NAME_LEN = 48
904MAX_REGEX_LEN = 44 957MAX_REGEX_LEN = 44
905DEFAULT_REGEX = r'^[^\(]*$'
906SORT_DEFAULT = 0 958SORT_DEFAULT = 0
907 959
908 960
@@ -969,7 +1021,7 @@ class Tui(object):
969 1021
970 return res 1022 return res
971 1023
972 def print_all_gnames(self, row): 1024 def _print_all_gnames(self, row):
973 """Print a list of all running guests along with their pids.""" 1025 """Print a list of all running guests along with their pids."""
974 self.screen.addstr(row, 2, '%8s %-60s' % 1026 self.screen.addstr(row, 2, '%8s %-60s' %
975 ('Pid', 'Guest Name (fuzzy list, might be ' 1027 ('Pid', 'Guest Name (fuzzy list, might be '
@@ -1032,19 +1084,13 @@ class Tui(object):
1032 1084
1033 return name 1085 return name
1034 1086
1035 def update_drilldown(self): 1087 def _update_pid(self, pid):
1036 """Sets or removes a filter that only allows fields without braces."""
1037 if not self.stats.fields_filter:
1038 self.stats.fields_filter = DEFAULT_REGEX
1039
1040 elif self.stats.fields_filter == DEFAULT_REGEX:
1041 self.stats.fields_filter = None
1042
1043 def update_pid(self, pid):
1044 """Propagates pid selection to stats object.""" 1088 """Propagates pid selection to stats object."""
1089 self.screen.addstr(4, 1, 'Updating pid filter...')
1090 self.screen.refresh()
1045 self.stats.pid_filter = pid 1091 self.stats.pid_filter = pid
1046 1092
1047 def refresh_header(self, pid=None): 1093 def _refresh_header(self, pid=None):
1048 """Refreshes the header.""" 1094 """Refreshes the header."""
1049 if pid is None: 1095 if pid is None:
1050 pid = self.stats.pid_filter 1096 pid = self.stats.pid_filter
@@ -1059,8 +1105,7 @@ class Tui(object):
1059 .format(pid, gname), curses.A_BOLD) 1105 .format(pid, gname), curses.A_BOLD)
1060 else: 1106 else:
1061 self.screen.addstr(0, 0, 'kvm statistics - summary', curses.A_BOLD) 1107 self.screen.addstr(0, 0, 'kvm statistics - summary', curses.A_BOLD)
1062 if self.stats.fields_filter and self.stats.fields_filter \ 1108 if self.stats.fields_filter:
1063 != DEFAULT_REGEX:
1064 regex = self.stats.fields_filter 1109 regex = self.stats.fields_filter
1065 if len(regex) > MAX_REGEX_LEN: 1110 if len(regex) > MAX_REGEX_LEN:
1066 regex = regex[:MAX_REGEX_LEN] + '...' 1111 regex = regex[:MAX_REGEX_LEN] + '...'
@@ -1075,56 +1120,99 @@ class Tui(object):
1075 self.screen.addstr(4, 1, 'Collecting data...') 1120 self.screen.addstr(4, 1, 'Collecting data...')
1076 self.screen.refresh() 1121 self.screen.refresh()
1077 1122
1078 def refresh_body(self, sleeptime): 1123 def _refresh_body(self, sleeptime):
1124 def is_child_field(field):
1125 return field.find('(') != -1
1126
1127 def insert_child(sorted_items, child, values, parent):
1128 num = len(sorted_items)
1129 for i in range(0, num):
1130 # only add child if parent is present
1131 if parent.startswith(sorted_items[i][0]):
1132 sorted_items.insert(i + 1, (' ' + child, values))
1133
1134 def get_sorted_events(self, stats):
1135 """ separate parent and child events """
1136 if self._sorting == SORT_DEFAULT:
1137 def sortkey((_k, v)):
1138 # sort by (delta value, overall value)
1139 return (v.delta, v.value)
1140 else:
1141 def sortkey((_k, v)):
1142 # sort by overall value
1143 return v.value
1144
1145 childs = []
1146 sorted_items = []
1147 # we can't rule out child events to appear prior to parents even
1148 # when sorted - separate out all children first, and add in later
1149 for key, values in sorted(stats.items(), key=sortkey,
1150 reverse=True):
1151 if values == (0, 0):
1152 continue
1153 if key.find(' ') != -1:
1154 if not self.stats.child_events:
1155 continue
1156 childs.insert(0, (key, values))
1157 else:
1158 sorted_items.append((key, values))
1159 if self.stats.child_events:
1160 for key, values in childs:
1161 (child, parent) = key.split(' ')
1162 insert_child(sorted_items, child, values, parent)
1163
1164 return sorted_items
1165
1079 row = 3 1166 row = 3
1080 self.screen.move(row, 0) 1167 self.screen.move(row, 0)
1081 self.screen.clrtobot() 1168 self.screen.clrtobot()
1082 stats = self.stats.get(self._display_guests) 1169 stats = self.stats.get(self._display_guests)
1083 1170 total = 0.
1084 def sortCurAvg(x): 1171 ctotal = 0.
1085 # sort by current events if available 1172 for key, values in stats.items():
1086 if stats[x][1]: 1173 if self._display_guests:
1087 return (-stats[x][1], -stats[x][0]) 1174 if self.get_gname_from_pid(key):
1175 total += values.value
1176 continue
1177 if not key.find(' ') != -1:
1178 total += values.value
1088 else: 1179 else:
1089 return (0, -stats[x][0]) 1180 ctotal += values.value
1181 if total == 0.:
1182 # we don't have any fields, or all non-child events are filtered
1183 total = ctotal
1090 1184
1091 def sortTotal(x): 1185 # print events
1092 # sort by totals
1093 return (0, -stats[x][0])
1094 total = 0.
1095 for key in stats.keys():
1096 if key.find('(') is -1:
1097 total += stats[key][0]
1098 if self._sorting == SORT_DEFAULT:
1099 sortkey = sortCurAvg
1100 else:
1101 sortkey = sortTotal
1102 tavg = 0 1186 tavg = 0
1103 for key in sorted(stats.keys(), key=sortkey): 1187 tcur = 0
1104 if row >= self.screen.getmaxyx()[0] - 1: 1188 for key, values in get_sorted_events(self, stats):
1105 break 1189 if row >= self.screen.getmaxyx()[0] - 1 or values == (0, 0):
1106 values = stats[key]
1107 if not values[0] and not values[1]:
1108 break 1190 break
1109 if values[0] is not None: 1191 if self._display_guests:
1110 cur = int(round(values[1] / sleeptime)) if values[1] else '' 1192 key = self.get_gname_from_pid(key)
1111 if self._display_guests: 1193 if not key:
1112 key = self.get_gname_from_pid(key) 1194 continue
1113 self.screen.addstr(row, 1, '%-40s %10d%7.1f %8s' % 1195 cur = int(round(values.delta / sleeptime)) if values.delta else ''
1114 (key, values[0], values[0] * 100 / total, 1196 if key[0] != ' ':
1115 cur)) 1197 if values.delta:
1116 if cur is not '' and key.find('(') is -1: 1198 tcur += values.delta
1117 tavg += cur 1199 ptotal = values.value
1200 ltotal = total
1201 else:
1202 ltotal = ptotal
1203 self.screen.addstr(row, 1, '%-40s %10d%7.1f %8s' % (key,
1204 values.value,
1205 values.value * 100 / float(ltotal), cur))
1118 row += 1 1206 row += 1
1119 if row == 3: 1207 if row == 3:
1120 self.screen.addstr(4, 1, 'No matching events reported yet') 1208 self.screen.addstr(4, 1, 'No matching events reported yet')
1121 else: 1209 if row > 4:
1210 tavg = int(round(tcur / sleeptime)) if tcur > 0 else ''
1122 self.screen.addstr(row, 1, '%-40s %10d %8s' % 1211 self.screen.addstr(row, 1, '%-40s %10d %8s' %
1123 ('Total', total, tavg if tavg else ''), 1212 ('Total', total, tavg), curses.A_BOLD)
1124 curses.A_BOLD)
1125 self.screen.refresh() 1213 self.screen.refresh()
1126 1214
1127 def show_msg(self, text): 1215 def _show_msg(self, text):
1128 """Display message centered text and exit on key press""" 1216 """Display message centered text and exit on key press"""
1129 hint = 'Press any key to continue' 1217 hint = 'Press any key to continue'
1130 curses.cbreak() 1218 curses.cbreak()
@@ -1139,16 +1227,16 @@ class Tui(object):
1139 curses.A_STANDOUT) 1227 curses.A_STANDOUT)
1140 self.screen.getkey() 1228 self.screen.getkey()
1141 1229
1142 def show_help_interactive(self): 1230 def _show_help_interactive(self):
1143 """Display help with list of interactive commands""" 1231 """Display help with list of interactive commands"""
1144 msg = (' b toggle events by guests (debugfs only, honors' 1232 msg = (' b toggle events by guests (debugfs only, honors'
1145 ' filters)', 1233 ' filters)',
1146 ' c clear filter', 1234 ' c clear filter',
1147 ' f filter by regular expression', 1235 ' f filter by regular expression',
1148 ' g filter by guest name', 1236 ' g filter by guest name/PID',
1149 ' h display interactive commands reference', 1237 ' h display interactive commands reference',
1150 ' o toggle sorting order (Total vs CurAvg/s)', 1238 ' o toggle sorting order (Total vs CurAvg/s)',
1151 ' p filter by PID', 1239 ' p filter by guest name/PID',
1152 ' q quit', 1240 ' q quit',
1153 ' r reset stats', 1241 ' r reset stats',
1154 ' s set update interval', 1242 ' s set update interval',
@@ -1165,14 +1253,15 @@ class Tui(object):
1165 self.screen.addstr(row, 0, line) 1253 self.screen.addstr(row, 0, line)
1166 row += 1 1254 row += 1
1167 self.screen.getkey() 1255 self.screen.getkey()
1168 self.refresh_header() 1256 self._refresh_header()
1169 1257
1170 def show_filter_selection(self): 1258 def _show_filter_selection(self):
1171 """Draws filter selection mask. 1259 """Draws filter selection mask.
1172 1260
1173 Asks for a valid regex and sets the fields filter accordingly. 1261 Asks for a valid regex and sets the fields filter accordingly.
1174 1262
1175 """ 1263 """
1264 msg = ''
1176 while True: 1265 while True:
1177 self.screen.erase() 1266 self.screen.erase()
1178 self.screen.addstr(0, 0, 1267 self.screen.addstr(0, 0,
@@ -1181,61 +1270,25 @@ class Tui(object):
1181 self.screen.addstr(2, 0, 1270 self.screen.addstr(2, 0,
1182 "Current regex: {0}" 1271 "Current regex: {0}"
1183 .format(self.stats.fields_filter)) 1272 .format(self.stats.fields_filter))
1273 self.screen.addstr(5, 0, msg)
1184 self.screen.addstr(3, 0, "New regex: ") 1274 self.screen.addstr(3, 0, "New regex: ")
1185 curses.echo() 1275 curses.echo()
1186 regex = self.screen.getstr().decode(ENCODING) 1276 regex = self.screen.getstr().decode(ENCODING)
1187 curses.noecho() 1277 curses.noecho()
1188 if len(regex) == 0: 1278 if len(regex) == 0:
1189 self.stats.fields_filter = DEFAULT_REGEX 1279 self.stats.fields_filter = ''
1190 self.refresh_header() 1280 self._refresh_header()
1191 return 1281 return
1192 try: 1282 try:
1193 re.compile(regex) 1283 re.compile(regex)
1194 self.stats.fields_filter = regex 1284 self.stats.fields_filter = regex
1195 self.refresh_header() 1285 self._refresh_header()
1196 return 1286 return
1197 except re.error: 1287 except re.error:
1288 msg = '"' + regex + '": Not a valid regular expression'
1198 continue 1289 continue
1199 1290
1200 def show_vm_selection_by_pid(self): 1291 def _show_set_update_interval(self):
1201 """Draws PID selection mask.
1202
1203 Asks for a pid until a valid pid or 0 has been entered.
1204
1205 """
1206 msg = ''
1207 while True:
1208 self.screen.erase()
1209 self.screen.addstr(0, 0,
1210 'Show statistics for specific pid.',
1211 curses.A_BOLD)
1212 self.screen.addstr(1, 0,
1213 'This might limit the shown data to the trace '
1214 'statistics.')
1215 self.screen.addstr(5, 0, msg)
1216 self.print_all_gnames(7)
1217
1218 curses.echo()
1219 self.screen.addstr(3, 0, "Pid [0 or pid]: ")
1220 pid = self.screen.getstr().decode(ENCODING)
1221 curses.noecho()
1222
1223 try:
1224 if len(pid) > 0:
1225 pid = int(pid)
1226 if pid != 0 and not os.path.isdir(os.path.join('/proc/',
1227 str(pid))):
1228 msg = '"' + str(pid) + '": Not a running process'
1229 continue
1230 else:
1231 pid = 0
1232 self.refresh_header(pid)
1233 self.update_pid(pid)
1234 break
1235 except ValueError:
1236 msg = '"' + str(pid) + '": Not a valid pid'
1237
1238 def show_set_update_interval(self):
1239 """Draws update interval selection mask.""" 1292 """Draws update interval selection mask."""
1240 msg = '' 1293 msg = ''
1241 while True: 1294 while True:
@@ -1265,60 +1318,67 @@ class Tui(object):
1265 1318
1266 except ValueError: 1319 except ValueError:
1267 msg = '"' + str(val) + '": Invalid value' 1320 msg = '"' + str(val) + '": Invalid value'
1268 self.refresh_header() 1321 self._refresh_header()
1269 1322
1270 def show_vm_selection_by_guest_name(self): 1323 def _show_vm_selection_by_guest(self):
1271 """Draws guest selection mask. 1324 """Draws guest selection mask.
1272 1325
1273 Asks for a guest name until a valid guest name or '' is entered. 1326 Asks for a guest name or pid until a valid guest name or '' is entered.
1274 1327
1275 """ 1328 """
1276 msg = '' 1329 msg = ''
1277 while True: 1330 while True:
1278 self.screen.erase() 1331 self.screen.erase()
1279 self.screen.addstr(0, 0, 1332 self.screen.addstr(0, 0,
1280 'Show statistics for specific guest.', 1333 'Show statistics for specific guest or pid.',
1281 curses.A_BOLD) 1334 curses.A_BOLD)
1282 self.screen.addstr(1, 0, 1335 self.screen.addstr(1, 0,
1283 'This might limit the shown data to the trace ' 1336 'This might limit the shown data to the trace '
1284 'statistics.') 1337 'statistics.')
1285 self.screen.addstr(5, 0, msg) 1338 self.screen.addstr(5, 0, msg)
1286 self.print_all_gnames(7) 1339 self._print_all_gnames(7)
1287 curses.echo() 1340 curses.echo()
1288 self.screen.addstr(3, 0, "Guest [ENTER or guest]: ") 1341 curses.curs_set(1)
1289 gname = self.screen.getstr().decode(ENCODING) 1342 self.screen.addstr(3, 0, "Guest or pid [ENTER exits]: ")
1343 guest = self.screen.getstr().decode(ENCODING)
1290 curses.noecho() 1344 curses.noecho()
1291 1345
1292 if not gname: 1346 pid = 0
1293 self.refresh_header(0) 1347 if not guest or guest == '0':
1294 self.update_pid(0)
1295 break 1348 break
1296 else: 1349 if guest.isdigit():
1297 pids = [] 1350 if not os.path.isdir(os.path.join('/proc/', guest)):
1298 try: 1351 msg = '"' + guest + '": Not a running process'
1299 pids = self.get_pid_from_gname(gname)
1300 except:
1301 msg = '"' + gname + '": Internal error while searching, ' \
1302 'use pid filter instead'
1303 continue
1304 if len(pids) == 0:
1305 msg = '"' + gname + '": Not an active guest'
1306 continue 1352 continue
1307 if len(pids) > 1: 1353 pid = int(guest)
1308 msg = '"' + gname + '": Multiple matches found, use pid ' \
1309 'filter instead'
1310 continue
1311 self.refresh_header(pids[0])
1312 self.update_pid(pids[0])
1313 break 1354 break
1355 pids = []
1356 try:
1357 pids = self.get_pid_from_gname(guest)
1358 except:
1359 msg = '"' + guest + '": Internal error while searching, ' \
1360 'use pid filter instead'
1361 continue
1362 if len(pids) == 0:
1363 msg = '"' + guest + '": Not an active guest'
1364 continue
1365 if len(pids) > 1:
1366 msg = '"' + guest + '": Multiple matches found, use pid ' \
1367 'filter instead'
1368 continue
1369 pid = pids[0]
1370 break
1371 curses.curs_set(0)
1372 self._refresh_header(pid)
1373 self._update_pid(pid)
1314 1374
1315 def show_stats(self): 1375 def show_stats(self):
1316 """Refreshes the screen and processes user input.""" 1376 """Refreshes the screen and processes user input."""
1317 sleeptime = self._delay_initial 1377 sleeptime = self._delay_initial
1318 self.refresh_header() 1378 self._refresh_header()
1319 start = 0.0 # result based on init value never appears on screen 1379 start = 0.0 # result based on init value never appears on screen
1320 while True: 1380 while True:
1321 self.refresh_body(time.time() - start) 1381 self._refresh_body(time.time() - start)
1322 curses.halfdelay(int(sleeptime * 10)) 1382 curses.halfdelay(int(sleeptime * 10))
1323 start = time.time() 1383 start = time.time()
1324 sleeptime = self._delay_regular 1384 sleeptime = self._delay_regular
@@ -1327,47 +1387,39 @@ class Tui(object):
1327 if char == 'b': 1387 if char == 'b':
1328 self._display_guests = not self._display_guests 1388 self._display_guests = not self._display_guests
1329 if self.stats.toggle_display_guests(self._display_guests): 1389 if self.stats.toggle_display_guests(self._display_guests):
1330 self.show_msg(['Command not available with tracepoints' 1390 self._show_msg(['Command not available with '
1331 ' enabled', 'Restart with debugfs only ' 1391 'tracepoints enabled', 'Restart with '
1332 '(see option \'-d\') and try again!']) 1392 'debugfs only (see option \'-d\') and '
1393 'try again!'])
1333 self._display_guests = not self._display_guests 1394 self._display_guests = not self._display_guests
1334 self.refresh_header() 1395 self._refresh_header()
1335 if char == 'c': 1396 if char == 'c':
1336 self.stats.fields_filter = DEFAULT_REGEX 1397 self.stats.fields_filter = ''
1337 self.refresh_header(0) 1398 self._refresh_header(0)
1338 self.update_pid(0) 1399 self._update_pid(0)
1339 if char == 'f': 1400 if char == 'f':
1340 curses.curs_set(1) 1401 curses.curs_set(1)
1341 self.show_filter_selection() 1402 self._show_filter_selection()
1342 curses.curs_set(0) 1403 curses.curs_set(0)
1343 sleeptime = self._delay_initial 1404 sleeptime = self._delay_initial
1344 if char == 'g': 1405 if char == 'g' or char == 'p':
1345 curses.curs_set(1) 1406 self._show_vm_selection_by_guest()
1346 self.show_vm_selection_by_guest_name()
1347 curses.curs_set(0)
1348 sleeptime = self._delay_initial 1407 sleeptime = self._delay_initial
1349 if char == 'h': 1408 if char == 'h':
1350 self.show_help_interactive() 1409 self._show_help_interactive()
1351 if char == 'o': 1410 if char == 'o':
1352 self._sorting = not self._sorting 1411 self._sorting = not self._sorting
1353 if char == 'p':
1354 curses.curs_set(1)
1355 self.show_vm_selection_by_pid()
1356 curses.curs_set(0)
1357 sleeptime = self._delay_initial
1358 if char == 'q': 1412 if char == 'q':
1359 break 1413 break
1360 if char == 'r': 1414 if char == 'r':
1361 self.stats.reset() 1415 self.stats.reset()
1362 if char == 's': 1416 if char == 's':
1363 curses.curs_set(1) 1417 curses.curs_set(1)
1364 self.show_set_update_interval() 1418 self._show_set_update_interval()
1365 curses.curs_set(0) 1419 curses.curs_set(0)
1366 sleeptime = self._delay_initial 1420 sleeptime = self._delay_initial
1367 if char == 'x': 1421 if char == 'x':
1368 self.update_drilldown() 1422 self.stats.child_events = not self.stats.child_events
1369 # prevents display of current values on next refresh
1370 self.stats.get(self._display_guests)
1371 except KeyboardInterrupt: 1423 except KeyboardInterrupt:
1372 break 1424 break
1373 except curses.error: 1425 except curses.error:
@@ -1380,9 +1432,9 @@ def batch(stats):
1380 s = stats.get() 1432 s = stats.get()
1381 time.sleep(1) 1433 time.sleep(1)
1382 s = stats.get() 1434 s = stats.get()
1383 for key in sorted(s.keys()): 1435 for key, values in sorted(s.items()):
1384 values = s[key] 1436 print('%-42s%10d%10d' % (key.split(' ')[0], values.value,
1385 print('%-42s%10d%10d' % (key, values[0], values[1])) 1437 values.delta))
1386 except KeyboardInterrupt: 1438 except KeyboardInterrupt:
1387 pass 1439 pass
1388 1440
@@ -1392,14 +1444,14 @@ def log(stats):
1392 keys = sorted(stats.get().keys()) 1444 keys = sorted(stats.get().keys())
1393 1445
1394 def banner(): 1446 def banner():
1395 for k in keys: 1447 for key in keys:
1396 print(k, end=' ') 1448 print(key.split(' ')[0], end=' ')
1397 print() 1449 print()
1398 1450
1399 def statline(): 1451 def statline():
1400 s = stats.get() 1452 s = stats.get()
1401 for k in keys: 1453 for key in keys:
1402 print(' %9d' % s[k][1], end=' ') 1454 print(' %9d' % s[key].delta, end=' ')
1403 print() 1455 print()
1404 line = 0 1456 line = 0
1405 banner_repeat = 20 1457 banner_repeat = 20
@@ -1504,7 +1556,7 @@ Press any other key to refresh statistics immediately.
1504 ) 1556 )
1505 optparser.add_option('-f', '--fields', 1557 optparser.add_option('-f', '--fields',
1506 action='store', 1558 action='store',
1507 default=DEFAULT_REGEX, 1559 default='',
1508 dest='fields', 1560 dest='fields',
1509 help='''fields to display (regex) 1561 help='''fields to display (regex)
1510 "-f help" for a list of available events''', 1562 "-f help" for a list of available events''',
@@ -1539,17 +1591,6 @@ Press any other key to refresh statistics immediately.
1539 1591
1540def check_access(options): 1592def check_access(options):
1541 """Exits if the current user can't access all needed directories.""" 1593 """Exits if the current user can't access all needed directories."""
1542 if not os.path.exists('/sys/kernel/debug'):
1543 sys.stderr.write('Please enable CONFIG_DEBUG_FS in your kernel.')
1544 sys.exit(1)
1545
1546 if not os.path.exists(PATH_DEBUGFS_KVM):
1547 sys.stderr.write("Please make sure, that debugfs is mounted and "
1548 "readable by the current user:\n"
1549 "('mount -t debugfs debugfs /sys/kernel/debug')\n"
1550 "Also ensure, that the kvm modules are loaded.\n")
1551 sys.exit(1)
1552
1553 if not os.path.exists(PATH_DEBUGFS_TRACING) and (options.tracepoints or 1594 if not os.path.exists(PATH_DEBUGFS_TRACING) and (options.tracepoints or
1554 not options.debugfs): 1595 not options.debugfs):
1555 sys.stderr.write("Please enable CONFIG_TRACING in your kernel " 1596 sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
@@ -1567,7 +1608,33 @@ def check_access(options):
1567 return options 1608 return options
1568 1609
1569 1610
1611def assign_globals():
1612 global PATH_DEBUGFS_KVM
1613 global PATH_DEBUGFS_TRACING
1614
1615 debugfs = ''
1616 for line in file('/proc/mounts'):
1617 if line.split(' ')[0] == 'debugfs':
1618 debugfs = line.split(' ')[1]
1619 break
1620 if debugfs == '':
1621 sys.stderr.write("Please make sure that CONFIG_DEBUG_FS is enabled in "
1622 "your kernel, mounted and\nreadable by the current "
1623 "user:\n"
1624 "('mount -t debugfs debugfs /sys/kernel/debug')\n")
1625 sys.exit(1)
1626
1627 PATH_DEBUGFS_KVM = os.path.join(debugfs, 'kvm')
1628 PATH_DEBUGFS_TRACING = os.path.join(debugfs, 'tracing')
1629
1630 if not os.path.exists(PATH_DEBUGFS_KVM):
1631 sys.stderr.write("Please make sure that CONFIG_KVM is enabled in "
1632 "your kernel and that the modules are loaded.\n")
1633 sys.exit(1)
1634
1635
1570def main(): 1636def main():
1637 assign_globals()
1571 options = get_options() 1638 options = get_options()
1572 options = check_access(options) 1639 options = check_access(options)
1573 1640
diff --git a/tools/kvm/kvm_stat/kvm_stat.txt b/tools/kvm/kvm_stat/kvm_stat.txt
index b5b3810c9e94..0811d860fe75 100644
--- a/tools/kvm/kvm_stat/kvm_stat.txt
+++ b/tools/kvm/kvm_stat/kvm_stat.txt
@@ -35,13 +35,13 @@ INTERACTIVE COMMANDS
35 35
36*f*:: filter by regular expression 36*f*:: filter by regular expression
37 37
38*g*:: filter by guest name 38*g*:: filter by guest name/PID
39 39
40*h*:: display interactive commands reference 40*h*:: display interactive commands reference
41 41
42*o*:: toggle sorting order (Total vs CurAvg/s) 42*o*:: toggle sorting order (Total vs CurAvg/s)
43 43
44*p*:: filter by PID 44*p*:: filter by guest name/PID
45 45
46*q*:: quit 46*q*:: quit
47 47
diff --git a/tools/laptop/freefall/Makefile b/tools/laptop/freefall/Makefile
index 5f758c489a20..b572d94255f6 100644
--- a/tools/laptop/freefall/Makefile
+++ b/tools/laptop/freefall/Makefile
@@ -2,7 +2,6 @@
2PREFIX ?= /usr 2PREFIX ?= /usr
3SBINDIR ?= sbin 3SBINDIR ?= sbin
4INSTALL ?= install 4INSTALL ?= install
5CC = $(CROSS_COMPILE)gcc
6 5
7TARGET = freefall 6TARGET = freefall
8 7
diff --git a/tools/leds/Makefile b/tools/leds/Makefile
index c379af003807..7b6bed13daaa 100644
--- a/tools/leds/Makefile
+++ b/tools/leds/Makefile
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# Makefile for LEDs tools 2# Makefile for LEDs tools
3 3
4CC = $(CROSS_COMPILE)gcc
5CFLAGS = -Wall -Wextra -g -I../../include/uapi 4CFLAGS = -Wall -Wextra -g -I../../include/uapi
6 5
7all: uledmon led_hw_brightness_mon 6all: uledmon led_hw_brightness_mon
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 97073d649c1a..5bbbf285af74 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1060,11 +1060,12 @@ bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj,
1060 prog->insns = new_insn; 1060 prog->insns = new_insn;
1061 prog->main_prog_cnt = prog->insns_cnt; 1061 prog->main_prog_cnt = prog->insns_cnt;
1062 prog->insns_cnt = new_cnt; 1062 prog->insns_cnt = new_cnt;
1063 pr_debug("added %zd insn from %s to prog %s\n",
1064 text->insns_cnt, text->section_name,
1065 prog->section_name);
1063 } 1066 }
1064 insn = &prog->insns[relo->insn_idx]; 1067 insn = &prog->insns[relo->insn_idx];
1065 insn->imm += prog->main_prog_cnt - relo->insn_idx; 1068 insn->imm += prog->main_prog_cnt - relo->insn_idx;
1066 pr_debug("added %zd insn from %s to prog %s\n",
1067 text->insns_cnt, text->section_name, prog->section_name);
1068 return 0; 1069 return 0;
1069} 1070}
1070 1071
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 57254f5b2779..694abc628e9b 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -29,7 +29,7 @@
29#include "builtin.h" 29#include "builtin.h"
30#include "check.h" 30#include "check.h"
31 31
32bool no_fp, no_unreachable; 32bool no_fp, no_unreachable, retpoline, module;
33 33
34static const char * const check_usage[] = { 34static const char * const check_usage[] = {
35 "objtool check [<options>] file.o", 35 "objtool check [<options>] file.o",
@@ -39,6 +39,8 @@ static const char * const check_usage[] = {
39const struct option check_options[] = { 39const struct option check_options[] = {
40 OPT_BOOLEAN('f', "no-fp", &no_fp, "Skip frame pointer validation"), 40 OPT_BOOLEAN('f', "no-fp", &no_fp, "Skip frame pointer validation"),
41 OPT_BOOLEAN('u', "no-unreachable", &no_unreachable, "Skip 'unreachable instruction' warnings"), 41 OPT_BOOLEAN('u', "no-unreachable", &no_unreachable, "Skip 'unreachable instruction' warnings"),
42 OPT_BOOLEAN('r', "retpoline", &retpoline, "Validate retpoline assumptions"),
43 OPT_BOOLEAN('m', "module", &module, "Indicates the object will be part of a kernel module"),
42 OPT_END(), 44 OPT_END(),
43}; 45};
44 46
@@ -53,5 +55,5 @@ int cmd_check(int argc, const char **argv)
53 55
54 objname = argv[0]; 56 objname = argv[0];
55 57
56 return check(objname, no_fp, no_unreachable, false); 58 return check(objname, false);
57} 59}
diff --git a/tools/objtool/builtin-orc.c b/tools/objtool/builtin-orc.c
index 91e8e19ff5e0..77ea2b97117d 100644
--- a/tools/objtool/builtin-orc.c
+++ b/tools/objtool/builtin-orc.c
@@ -25,7 +25,6 @@
25 */ 25 */
26 26
27#include <string.h> 27#include <string.h>
28#include <subcmd/parse-options.h>
29#include "builtin.h" 28#include "builtin.h"
30#include "check.h" 29#include "check.h"
31 30
@@ -36,9 +35,6 @@ static const char *orc_usage[] = {
36 NULL, 35 NULL,
37}; 36};
38 37
39extern const struct option check_options[];
40extern bool no_fp, no_unreachable;
41
42int cmd_orc(int argc, const char **argv) 38int cmd_orc(int argc, const char **argv)
43{ 39{
44 const char *objname; 40 const char *objname;
@@ -54,7 +50,7 @@ int cmd_orc(int argc, const char **argv)
54 50
55 objname = argv[0]; 51 objname = argv[0];
56 52
57 return check(objname, no_fp, no_unreachable, true); 53 return check(objname, true);
58 } 54 }
59 55
60 if (!strcmp(argv[0], "dump")) { 56 if (!strcmp(argv[0], "dump")) {
diff --git a/tools/objtool/builtin.h b/tools/objtool/builtin.h
index dd526067fed5..28ff40e19a14 100644
--- a/tools/objtool/builtin.h
+++ b/tools/objtool/builtin.h
@@ -17,6 +17,11 @@
17#ifndef _BUILTIN_H 17#ifndef _BUILTIN_H
18#define _BUILTIN_H 18#define _BUILTIN_H
19 19
20#include <subcmd/parse-options.h>
21
22extern const struct option check_options[];
23extern bool no_fp, no_unreachable, retpoline, module;
24
20extern int cmd_check(int argc, const char **argv); 25extern int cmd_check(int argc, const char **argv);
21extern int cmd_orc(int argc, const char **argv); 26extern int cmd_orc(int argc, const char **argv);
22 27
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index b00b1896547e..46c1d239cc1b 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -18,6 +18,7 @@
18#include <string.h> 18#include <string.h>
19#include <stdlib.h> 19#include <stdlib.h>
20 20
21#include "builtin.h"
21#include "check.h" 22#include "check.h"
22#include "elf.h" 23#include "elf.h"
23#include "special.h" 24#include "special.h"
@@ -33,7 +34,6 @@ struct alternative {
33}; 34};
34 35
35const char *objname; 36const char *objname;
36static bool no_fp;
37struct cfi_state initial_func_cfi; 37struct cfi_state initial_func_cfi;
38 38
39struct instruction *find_insn(struct objtool_file *file, 39struct instruction *find_insn(struct objtool_file *file,
@@ -497,6 +497,7 @@ static int add_jump_destinations(struct objtool_file *file)
497 * disguise, so convert them accordingly. 497 * disguise, so convert them accordingly.
498 */ 498 */
499 insn->type = INSN_JUMP_DYNAMIC; 499 insn->type = INSN_JUMP_DYNAMIC;
500 insn->retpoline_safe = true;
500 continue; 501 continue;
501 } else { 502 } else {
502 /* sibling call */ 503 /* sibling call */
@@ -548,7 +549,8 @@ static int add_call_destinations(struct objtool_file *file)
548 if (!insn->call_dest && !insn->ignore) { 549 if (!insn->call_dest && !insn->ignore) {
549 WARN_FUNC("unsupported intra-function call", 550 WARN_FUNC("unsupported intra-function call",
550 insn->sec, insn->offset); 551 insn->sec, insn->offset);
551 WARN("If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE."); 552 if (retpoline)
553 WARN("If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE.");
552 return -1; 554 return -1;
553 } 555 }
554 556
@@ -852,8 +854,14 @@ static int add_switch_table(struct objtool_file *file, struct symbol *func,
852 * This is a fairly uncommon pattern which is new for GCC 6. As of this 854 * This is a fairly uncommon pattern which is new for GCC 6. As of this
853 * writing, there are 11 occurrences of it in the allmodconfig kernel. 855 * writing, there are 11 occurrences of it in the allmodconfig kernel.
854 * 856 *
857 * As of GCC 7 there are quite a few more of these and the 'in between' code
858 * is significant. Esp. with KASAN enabled some of the code between the mov
859 * and jmpq uses .rodata itself, which can confuse things.
860 *
855 * TODO: Once we have DWARF CFI and smarter instruction decoding logic, 861 * TODO: Once we have DWARF CFI and smarter instruction decoding logic,
856 * ensure the same register is used in the mov and jump instructions. 862 * ensure the same register is used in the mov and jump instructions.
863 *
864 * NOTE: RETPOLINE made it harder still to decode dynamic jumps.
857 */ 865 */
858static struct rela *find_switch_table(struct objtool_file *file, 866static struct rela *find_switch_table(struct objtool_file *file,
859 struct symbol *func, 867 struct symbol *func,
@@ -875,12 +883,25 @@ static struct rela *find_switch_table(struct objtool_file *file,
875 text_rela->addend + 4); 883 text_rela->addend + 4);
876 if (!rodata_rela) 884 if (!rodata_rela)
877 return NULL; 885 return NULL;
886
878 file->ignore_unreachables = true; 887 file->ignore_unreachables = true;
879 return rodata_rela; 888 return rodata_rela;
880 } 889 }
881 890
882 /* case 3 */ 891 /* case 3 */
883 func_for_each_insn_continue_reverse(file, func, insn) { 892 /*
893 * Backward search using the @first_jump_src links, these help avoid
894 * much of the 'in between' code. Which avoids us getting confused by
895 * it.
896 */
897 for (insn = list_prev_entry(insn, list);
898
899 &insn->list != &file->insn_list &&
900 insn->sec == func->sec &&
901 insn->offset >= func->offset;
902
903 insn = insn->first_jump_src ?: list_prev_entry(insn, list)) {
904
884 if (insn->type == INSN_JUMP_DYNAMIC) 905 if (insn->type == INSN_JUMP_DYNAMIC)
885 break; 906 break;
886 907
@@ -904,20 +925,42 @@ static struct rela *find_switch_table(struct objtool_file *file,
904 if (find_symbol_containing(file->rodata, text_rela->addend)) 925 if (find_symbol_containing(file->rodata, text_rela->addend))
905 continue; 926 continue;
906 927
907 return find_rela_by_dest(file->rodata, text_rela->addend); 928 rodata_rela = find_rela_by_dest(file->rodata, text_rela->addend);
929 if (!rodata_rela)
930 continue;
931
932 return rodata_rela;
908 } 933 }
909 934
910 return NULL; 935 return NULL;
911} 936}
912 937
938
913static int add_func_switch_tables(struct objtool_file *file, 939static int add_func_switch_tables(struct objtool_file *file,
914 struct symbol *func) 940 struct symbol *func)
915{ 941{
916 struct instruction *insn, *prev_jump = NULL; 942 struct instruction *insn, *last = NULL, *prev_jump = NULL;
917 struct rela *rela, *prev_rela = NULL; 943 struct rela *rela, *prev_rela = NULL;
918 int ret; 944 int ret;
919 945
920 func_for_each_insn(file, func, insn) { 946 func_for_each_insn(file, func, insn) {
947 if (!last)
948 last = insn;
949
950 /*
951 * Store back-pointers for unconditional forward jumps such
952 * that find_switch_table() can back-track using those and
953 * avoid some potentially confusing code.
954 */
955 if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->jump_dest &&
956 insn->offset > last->offset &&
957 insn->jump_dest->offset > insn->offset &&
958 !insn->jump_dest->first_jump_src) {
959
960 insn->jump_dest->first_jump_src = insn;
961 last = insn->jump_dest;
962 }
963
921 if (insn->type != INSN_JUMP_DYNAMIC) 964 if (insn->type != INSN_JUMP_DYNAMIC)
922 continue; 965 continue;
923 966
@@ -1071,6 +1114,54 @@ static int read_unwind_hints(struct objtool_file *file)
1071 return 0; 1114 return 0;
1072} 1115}
1073 1116
1117static int read_retpoline_hints(struct objtool_file *file)
1118{
1119 struct section *sec, *relasec;
1120 struct instruction *insn;
1121 struct rela *rela;
1122 int i;
1123
1124 sec = find_section_by_name(file->elf, ".discard.retpoline_safe");
1125 if (!sec)
1126 return 0;
1127
1128 relasec = sec->rela;
1129 if (!relasec) {
1130 WARN("missing .rela.discard.retpoline_safe section");
1131 return -1;
1132 }
1133
1134 if (sec->len % sizeof(unsigned long)) {
1135 WARN("retpoline_safe size mismatch: %d %ld", sec->len, sizeof(unsigned long));
1136 return -1;
1137 }
1138
1139 for (i = 0; i < sec->len / sizeof(unsigned long); i++) {
1140 rela = find_rela_by_dest(sec, i * sizeof(unsigned long));
1141 if (!rela) {
1142 WARN("can't find rela for retpoline_safe[%d]", i);
1143 return -1;
1144 }
1145
1146 insn = find_insn(file, rela->sym->sec, rela->addend);
1147 if (!insn) {
1148 WARN("can't find insn for retpoline_safe[%d]", i);
1149 return -1;
1150 }
1151
1152 if (insn->type != INSN_JUMP_DYNAMIC &&
1153 insn->type != INSN_CALL_DYNAMIC) {
1154 WARN_FUNC("retpoline_safe hint not a indirect jump/call",
1155 insn->sec, insn->offset);
1156 return -1;
1157 }
1158
1159 insn->retpoline_safe = true;
1160 }
1161
1162 return 0;
1163}
1164
1074static int decode_sections(struct objtool_file *file) 1165static int decode_sections(struct objtool_file *file)
1075{ 1166{
1076 int ret; 1167 int ret;
@@ -1109,6 +1200,10 @@ static int decode_sections(struct objtool_file *file)
1109 if (ret) 1200 if (ret)
1110 return ret; 1201 return ret;
1111 1202
1203 ret = read_retpoline_hints(file);
1204 if (ret)
1205 return ret;
1206
1112 return 0; 1207 return 0;
1113} 1208}
1114 1209
@@ -1854,6 +1949,38 @@ static int validate_unwind_hints(struct objtool_file *file)
1854 return warnings; 1949 return warnings;
1855} 1950}
1856 1951
1952static int validate_retpoline(struct objtool_file *file)
1953{
1954 struct instruction *insn;
1955 int warnings = 0;
1956
1957 for_each_insn(file, insn) {
1958 if (insn->type != INSN_JUMP_DYNAMIC &&
1959 insn->type != INSN_CALL_DYNAMIC)
1960 continue;
1961
1962 if (insn->retpoline_safe)
1963 continue;
1964
1965 /*
1966 * .init.text code is ran before userspace and thus doesn't
1967 * strictly need retpolines, except for modules which are
1968 * loaded late, they very much do need retpoline in their
1969 * .init.text
1970 */
1971 if (!strcmp(insn->sec->name, ".init.text") && !module)
1972 continue;
1973
1974 WARN_FUNC("indirect %s found in RETPOLINE build",
1975 insn->sec, insn->offset,
1976 insn->type == INSN_JUMP_DYNAMIC ? "jump" : "call");
1977
1978 warnings++;
1979 }
1980
1981 return warnings;
1982}
1983
1857static bool is_kasan_insn(struct instruction *insn) 1984static bool is_kasan_insn(struct instruction *insn)
1858{ 1985{
1859 return (insn->type == INSN_CALL && 1986 return (insn->type == INSN_CALL &&
@@ -1899,13 +2026,19 @@ static bool ignore_unreachable_insn(struct instruction *insn)
1899 if (is_kasan_insn(insn) || is_ubsan_insn(insn)) 2026 if (is_kasan_insn(insn) || is_ubsan_insn(insn))
1900 return true; 2027 return true;
1901 2028
1902 if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->jump_dest) { 2029 if (insn->type == INSN_JUMP_UNCONDITIONAL) {
1903 insn = insn->jump_dest; 2030 if (insn->jump_dest &&
1904 continue; 2031 insn->jump_dest->func == insn->func) {
2032 insn = insn->jump_dest;
2033 continue;
2034 }
2035
2036 break;
1905 } 2037 }
1906 2038
1907 if (insn->offset + insn->len >= insn->func->offset + insn->func->len) 2039 if (insn->offset + insn->len >= insn->func->offset + insn->func->len)
1908 break; 2040 break;
2041
1909 insn = list_next_entry(insn, list); 2042 insn = list_next_entry(insn, list);
1910 } 2043 }
1911 2044
@@ -1979,13 +2112,12 @@ static void cleanup(struct objtool_file *file)
1979 elf_close(file->elf); 2112 elf_close(file->elf);
1980} 2113}
1981 2114
1982int check(const char *_objname, bool _no_fp, bool no_unreachable, bool orc) 2115int check(const char *_objname, bool orc)
1983{ 2116{
1984 struct objtool_file file; 2117 struct objtool_file file;
1985 int ret, warnings = 0; 2118 int ret, warnings = 0;
1986 2119
1987 objname = _objname; 2120 objname = _objname;
1988 no_fp = _no_fp;
1989 2121
1990 file.elf = elf_open(objname, orc ? O_RDWR : O_RDONLY); 2122 file.elf = elf_open(objname, orc ? O_RDWR : O_RDONLY);
1991 if (!file.elf) 2123 if (!file.elf)
@@ -2009,6 +2141,13 @@ int check(const char *_objname, bool _no_fp, bool no_unreachable, bool orc)
2009 if (list_empty(&file.insn_list)) 2141 if (list_empty(&file.insn_list))
2010 goto out; 2142 goto out;
2011 2143
2144 if (retpoline) {
2145 ret = validate_retpoline(&file);
2146 if (ret < 0)
2147 return ret;
2148 warnings += ret;
2149 }
2150
2012 ret = validate_functions(&file); 2151 ret = validate_functions(&file);
2013 if (ret < 0) 2152 if (ret < 0)
2014 goto out; 2153 goto out;
diff --git a/tools/objtool/check.h b/tools/objtool/check.h
index dbadb304a410..c6b68fcb926f 100644
--- a/tools/objtool/check.h
+++ b/tools/objtool/check.h
@@ -45,8 +45,10 @@ struct instruction {
45 unsigned char type; 45 unsigned char type;
46 unsigned long immediate; 46 unsigned long immediate;
47 bool alt_group, visited, dead_end, ignore, hint, save, restore, ignore_alts; 47 bool alt_group, visited, dead_end, ignore, hint, save, restore, ignore_alts;
48 bool retpoline_safe;
48 struct symbol *call_dest; 49 struct symbol *call_dest;
49 struct instruction *jump_dest; 50 struct instruction *jump_dest;
51 struct instruction *first_jump_src;
50 struct list_head alts; 52 struct list_head alts;
51 struct symbol *func; 53 struct symbol *func;
52 struct stack_op stack_op; 54 struct stack_op stack_op;
@@ -62,7 +64,7 @@ struct objtool_file {
62 bool ignore_unreachables, c_file, hints; 64 bool ignore_unreachables, c_file, hints;
63}; 65};
64 66
65int check(const char *objname, bool no_fp, bool no_unreachable, bool orc); 67int check(const char *objname, bool orc);
66 68
67struct instruction *find_insn(struct objtool_file *file, 69struct instruction *find_insn(struct objtool_file *file,
68 struct section *sec, unsigned long offset); 70 struct section *sec, unsigned long offset);
diff --git a/tools/perf/Documentation/perf-data.txt b/tools/perf/Documentation/perf-data.txt
index f0796a47dfa3..90bb4aabe4f8 100644
--- a/tools/perf/Documentation/perf-data.txt
+++ b/tools/perf/Documentation/perf-data.txt
@@ -30,6 +30,10 @@ OPTIONS for 'convert'
30-i:: 30-i::
31 Specify input perf data file path. 31 Specify input perf data file path.
32 32
33-f::
34--force::
35 Don't complain, do it.
36
33-v:: 37-v::
34--verbose:: 38--verbose::
35 Be more verbose (show counter open errors, etc). 39 Be more verbose (show counter open errors, etc).
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 9b0351d3ce34..012328038594 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -146,12 +146,6 @@ define allow-override
146 $(eval $(1) = $(2))) 146 $(eval $(1) = $(2)))
147endef 147endef
148 148
149# Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix.
150$(call allow-override,CC,$(CROSS_COMPILE)gcc)
151$(call allow-override,AR,$(CROSS_COMPILE)ar)
152$(call allow-override,LD,$(CROSS_COMPILE)ld)
153$(call allow-override,CXX,$(CROSS_COMPILE)g++)
154
155LD += $(EXTRA_LDFLAGS) 149LD += $(EXTRA_LDFLAGS)
156 150
157HOSTCC ?= gcc 151HOSTCC ?= gcc
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 48228de415d0..dfa6e3103437 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -10,15 +10,19 @@ PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
10 10
11out := $(OUTPUT)arch/s390/include/generated/asm 11out := $(OUTPUT)arch/s390/include/generated/asm
12header := $(out)/syscalls_64.c 12header := $(out)/syscalls_64.c
13sysdef := $(srctree)/tools/arch/s390/include/uapi/asm/unistd.h 13syskrn := $(srctree)/arch/s390/kernel/syscalls/syscall.tbl
14sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls/ 14sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls
15sysdef := $(sysprf)/syscall.tbl
15systbl := $(sysprf)/mksyscalltbl 16systbl := $(sysprf)/mksyscalltbl
16 17
17# Create output directory if not already present 18# Create output directory if not already present
18_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') 19_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
19 20
20$(header): $(sysdef) $(systbl) 21$(header): $(sysdef) $(systbl)
21 $(Q)$(SHELL) '$(systbl)' '$(CC)' $(sysdef) > $@ 22 @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \
23 (diff -B $(sysdef) $(syskrn) >/dev/null) \
24 || echo "Warning: Kernel ABI header at '$(sysdef)' differs from latest version at '$(syskrn)'" >&2 )) || true
25 $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@
22 26
23clean:: 27clean::
24 $(call QUIET_CLEAN, s390) $(RM) $(header) 28 $(call QUIET_CLEAN, s390) $(RM) $(header)
diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl
index 7fa0d0abd419..72ecbb676370 100755
--- a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl
@@ -3,25 +3,23 @@
3# 3#
4# Generate system call table for perf 4# Generate system call table for perf
5# 5#
6# 6# Copyright IBM Corp. 2017, 2018
7# Copyright IBM Corp. 2017
8# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 7# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
9# 8#
10 9
11gcc=$1 10SYSCALL_TBL=$1
12input=$2
13 11
14if ! test -r $input; then 12if ! test -r $SYSCALL_TBL; then
15 echo "Could not read input file" >&2 13 echo "Could not read input file" >&2
16 exit 1 14 exit 1
17fi 15fi
18 16
19create_table() 17create_table()
20{ 18{
21 local max_nr 19 local max_nr nr abi sc discard
22 20
23 echo 'static const char *syscalltbl_s390_64[] = {' 21 echo 'static const char *syscalltbl_s390_64[] = {'
24 while read sc nr; do 22 while read nr abi sc discard; do
25 printf '\t[%d] = "%s",\n' $nr $sc 23 printf '\t[%d] = "%s",\n' $nr $sc
26 max_nr=$nr 24 max_nr=$nr
27 done 25 done
@@ -29,8 +27,6 @@ create_table()
29 echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr" 27 echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr"
30} 28}
31 29
32 30grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \
33$gcc -m64 -E -dM -x c $input \ 31 |sort -k1 -n \
34 |sed -ne 's/^#define __NR_//p' \
35 |sort -t' ' -k2 -nu \
36 |create_table 32 |create_table
diff --git a/tools/perf/arch/s390/entry/syscalls/syscall.tbl b/tools/perf/arch/s390/entry/syscalls/syscall.tbl
new file mode 100644
index 000000000000..b38d48464368
--- /dev/null
+++ b/tools/perf/arch/s390/entry/syscalls/syscall.tbl
@@ -0,0 +1,390 @@
1# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2#
3# System call table for s390
4#
5# Format:
6#
7# <nr> <abi> <syscall> <entry-64bit> <compat-entry>
8#
9# where <abi> can be common, 64, or 32
10
111 common exit sys_exit sys_exit
122 common fork sys_fork sys_fork
133 common read sys_read compat_sys_s390_read
144 common write sys_write compat_sys_s390_write
155 common open sys_open compat_sys_open
166 common close sys_close sys_close
177 common restart_syscall sys_restart_syscall sys_restart_syscall
188 common creat sys_creat compat_sys_creat
199 common link sys_link compat_sys_link
2010 common unlink sys_unlink compat_sys_unlink
2111 common execve sys_execve compat_sys_execve
2212 common chdir sys_chdir compat_sys_chdir
2313 32 time - compat_sys_time
2414 common mknod sys_mknod compat_sys_mknod
2515 common chmod sys_chmod compat_sys_chmod
2616 32 lchown - compat_sys_s390_lchown16
2719 common lseek sys_lseek compat_sys_lseek
2820 common getpid sys_getpid sys_getpid
2921 common mount sys_mount compat_sys_mount
3022 common umount sys_oldumount compat_sys_oldumount
3123 32 setuid - compat_sys_s390_setuid16
3224 32 getuid - compat_sys_s390_getuid16
3325 32 stime - compat_sys_stime
3426 common ptrace sys_ptrace compat_sys_ptrace
3527 common alarm sys_alarm sys_alarm
3629 common pause sys_pause sys_pause
3730 common utime sys_utime compat_sys_utime
3833 common access sys_access compat_sys_access
3934 common nice sys_nice sys_nice
4036 common sync sys_sync sys_sync
4137 common kill sys_kill sys_kill
4238 common rename sys_rename compat_sys_rename
4339 common mkdir sys_mkdir compat_sys_mkdir
4440 common rmdir sys_rmdir compat_sys_rmdir
4541 common dup sys_dup sys_dup
4642 common pipe sys_pipe compat_sys_pipe
4743 common times sys_times compat_sys_times
4845 common brk sys_brk compat_sys_brk
4946 32 setgid - compat_sys_s390_setgid16
5047 32 getgid - compat_sys_s390_getgid16
5148 common signal sys_signal compat_sys_signal
5249 32 geteuid - compat_sys_s390_geteuid16
5350 32 getegid - compat_sys_s390_getegid16
5451 common acct sys_acct compat_sys_acct
5552 common umount2 sys_umount compat_sys_umount
5654 common ioctl sys_ioctl compat_sys_ioctl
5755 common fcntl sys_fcntl compat_sys_fcntl
5857 common setpgid sys_setpgid sys_setpgid
5960 common umask sys_umask sys_umask
6061 common chroot sys_chroot compat_sys_chroot
6162 common ustat sys_ustat compat_sys_ustat
6263 common dup2 sys_dup2 sys_dup2
6364 common getppid sys_getppid sys_getppid
6465 common getpgrp sys_getpgrp sys_getpgrp
6566 common setsid sys_setsid sys_setsid
6667 common sigaction sys_sigaction compat_sys_sigaction
6770 32 setreuid - compat_sys_s390_setreuid16
6871 32 setregid - compat_sys_s390_setregid16
6972 common sigsuspend sys_sigsuspend compat_sys_sigsuspend
7073 common sigpending sys_sigpending compat_sys_sigpending
7174 common sethostname sys_sethostname compat_sys_sethostname
7275 common setrlimit sys_setrlimit compat_sys_setrlimit
7376 32 getrlimit - compat_sys_old_getrlimit
7477 common getrusage sys_getrusage compat_sys_getrusage
7578 common gettimeofday sys_gettimeofday compat_sys_gettimeofday
7679 common settimeofday sys_settimeofday compat_sys_settimeofday
7780 32 getgroups - compat_sys_s390_getgroups16
7881 32 setgroups - compat_sys_s390_setgroups16
7983 common symlink sys_symlink compat_sys_symlink
8085 common readlink sys_readlink compat_sys_readlink
8186 common uselib sys_uselib compat_sys_uselib
8287 common swapon sys_swapon compat_sys_swapon
8388 common reboot sys_reboot compat_sys_reboot
8489 common readdir - compat_sys_old_readdir
8590 common mmap sys_old_mmap compat_sys_s390_old_mmap
8691 common munmap sys_munmap compat_sys_munmap
8792 common truncate sys_truncate compat_sys_truncate
8893 common ftruncate sys_ftruncate compat_sys_ftruncate
8994 common fchmod sys_fchmod sys_fchmod
9095 32 fchown - compat_sys_s390_fchown16
9196 common getpriority sys_getpriority sys_getpriority
9297 common setpriority sys_setpriority sys_setpriority
9399 common statfs sys_statfs compat_sys_statfs
94100 common fstatfs sys_fstatfs compat_sys_fstatfs
95101 32 ioperm - -
96102 common socketcall sys_socketcall compat_sys_socketcall
97103 common syslog sys_syslog compat_sys_syslog
98104 common setitimer sys_setitimer compat_sys_setitimer
99105 common getitimer sys_getitimer compat_sys_getitimer
100106 common stat sys_newstat compat_sys_newstat
101107 common lstat sys_newlstat compat_sys_newlstat
102108 common fstat sys_newfstat compat_sys_newfstat
103110 common lookup_dcookie sys_lookup_dcookie compat_sys_lookup_dcookie
104111 common vhangup sys_vhangup sys_vhangup
105112 common idle - -
106114 common wait4 sys_wait4 compat_sys_wait4
107115 common swapoff sys_swapoff compat_sys_swapoff
108116 common sysinfo sys_sysinfo compat_sys_sysinfo
109117 common ipc sys_s390_ipc compat_sys_s390_ipc
110118 common fsync sys_fsync sys_fsync
111119 common sigreturn sys_sigreturn compat_sys_sigreturn
112120 common clone sys_clone compat_sys_clone
113121 common setdomainname sys_setdomainname compat_sys_setdomainname
114122 common uname sys_newuname compat_sys_newuname
115124 common adjtimex sys_adjtimex compat_sys_adjtimex
116125 common mprotect sys_mprotect compat_sys_mprotect
117126 common sigprocmask sys_sigprocmask compat_sys_sigprocmask
118127 common create_module - -
119128 common init_module sys_init_module compat_sys_init_module
120129 common delete_module sys_delete_module compat_sys_delete_module
121130 common get_kernel_syms - -
122131 common quotactl sys_quotactl compat_sys_quotactl
123132 common getpgid sys_getpgid sys_getpgid
124133 common fchdir sys_fchdir sys_fchdir
125134 common bdflush sys_bdflush compat_sys_bdflush
126135 common sysfs sys_sysfs compat_sys_sysfs
127136 common personality sys_s390_personality sys_s390_personality
128137 common afs_syscall - -
129138 32 setfsuid - compat_sys_s390_setfsuid16
130139 32 setfsgid - compat_sys_s390_setfsgid16
131140 32 _llseek - compat_sys_llseek
132141 common getdents sys_getdents compat_sys_getdents
133142 32 _newselect - compat_sys_select
134142 64 select sys_select -
135143 common flock sys_flock sys_flock
136144 common msync sys_msync compat_sys_msync
137145 common readv sys_readv compat_sys_readv
138146 common writev sys_writev compat_sys_writev
139147 common getsid sys_getsid sys_getsid
140148 common fdatasync sys_fdatasync sys_fdatasync
141149 common _sysctl sys_sysctl compat_sys_sysctl
142150 common mlock sys_mlock compat_sys_mlock
143151 common munlock sys_munlock compat_sys_munlock
144152 common mlockall sys_mlockall sys_mlockall
145153 common munlockall sys_munlockall sys_munlockall
146154 common sched_setparam sys_sched_setparam compat_sys_sched_setparam
147155 common sched_getparam sys_sched_getparam compat_sys_sched_getparam
148156 common sched_setscheduler sys_sched_setscheduler compat_sys_sched_setscheduler
149157 common sched_getscheduler sys_sched_getscheduler sys_sched_getscheduler
150158 common sched_yield sys_sched_yield sys_sched_yield
151159 common sched_get_priority_max sys_sched_get_priority_max sys_sched_get_priority_max
152160 common sched_get_priority_min sys_sched_get_priority_min sys_sched_get_priority_min
153161 common sched_rr_get_interval sys_sched_rr_get_interval compat_sys_sched_rr_get_interval
154162 common nanosleep sys_nanosleep compat_sys_nanosleep
155163 common mremap sys_mremap compat_sys_mremap
156164 32 setresuid - compat_sys_s390_setresuid16
157165 32 getresuid - compat_sys_s390_getresuid16
158167 common query_module - -
159168 common poll sys_poll compat_sys_poll
160169 common nfsservctl - -
161170 32 setresgid - compat_sys_s390_setresgid16
162171 32 getresgid - compat_sys_s390_getresgid16
163172 common prctl sys_prctl compat_sys_prctl
164173 common rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn
165174 common rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction
166175 common rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask
167176 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending
168177 common rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait
169178 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo
170179 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend
171180 common pread64 sys_pread64 compat_sys_s390_pread64
172181 common pwrite64 sys_pwrite64 compat_sys_s390_pwrite64
173182 32 chown - compat_sys_s390_chown16
174183 common getcwd sys_getcwd compat_sys_getcwd
175184 common capget sys_capget compat_sys_capget
176185 common capset sys_capset compat_sys_capset
177186 common sigaltstack sys_sigaltstack compat_sys_sigaltstack
178187 common sendfile sys_sendfile64 compat_sys_sendfile
179188 common getpmsg - -
180189 common putpmsg - -
181190 common vfork sys_vfork sys_vfork
182191 32 ugetrlimit - compat_sys_getrlimit
183191 64 getrlimit sys_getrlimit -
184192 32 mmap2 - compat_sys_s390_mmap2
185193 32 truncate64 - compat_sys_s390_truncate64
186194 32 ftruncate64 - compat_sys_s390_ftruncate64
187195 32 stat64 - compat_sys_s390_stat64
188196 32 lstat64 - compat_sys_s390_lstat64
189197 32 fstat64 - compat_sys_s390_fstat64
190198 32 lchown32 - compat_sys_lchown
191198 64 lchown sys_lchown -
192199 32 getuid32 - sys_getuid
193199 64 getuid sys_getuid -
194200 32 getgid32 - sys_getgid
195200 64 getgid sys_getgid -
196201 32 geteuid32 - sys_geteuid
197201 64 geteuid sys_geteuid -
198202 32 getegid32 - sys_getegid
199202 64 getegid sys_getegid -
200203 32 setreuid32 - sys_setreuid
201203 64 setreuid sys_setreuid -
202204 32 setregid32 - sys_setregid
203204 64 setregid sys_setregid -
204205 32 getgroups32 - compat_sys_getgroups
205205 64 getgroups sys_getgroups -
206206 32 setgroups32 - compat_sys_setgroups
207206 64 setgroups sys_setgroups -
208207 32 fchown32 - sys_fchown
209207 64 fchown sys_fchown -
210208 32 setresuid32 - sys_setresuid
211208 64 setresuid sys_setresuid -
212209 32 getresuid32 - compat_sys_getresuid
213209 64 getresuid sys_getresuid -
214210 32 setresgid32 - sys_setresgid
215210 64 setresgid sys_setresgid -
216211 32 getresgid32 - compat_sys_getresgid
217211 64 getresgid sys_getresgid -
218212 32 chown32 - compat_sys_chown
219212 64 chown sys_chown -
220213 32 setuid32 - sys_setuid
221213 64 setuid sys_setuid -
222214 32 setgid32 - sys_setgid
223214 64 setgid sys_setgid -
224215 32 setfsuid32 - sys_setfsuid
225215 64 setfsuid sys_setfsuid -
226216 32 setfsgid32 - sys_setfsgid
227216 64 setfsgid sys_setfsgid -
228217 common pivot_root sys_pivot_root compat_sys_pivot_root
229218 common mincore sys_mincore compat_sys_mincore
230219 common madvise sys_madvise compat_sys_madvise
231220 common getdents64 sys_getdents64 compat_sys_getdents64
232221 32 fcntl64 - compat_sys_fcntl64
233222 common readahead sys_readahead compat_sys_s390_readahead
234223 32 sendfile64 - compat_sys_sendfile64
235224 common setxattr sys_setxattr compat_sys_setxattr
236225 common lsetxattr sys_lsetxattr compat_sys_lsetxattr
237226 common fsetxattr sys_fsetxattr compat_sys_fsetxattr
238227 common getxattr sys_getxattr compat_sys_getxattr
239228 common lgetxattr sys_lgetxattr compat_sys_lgetxattr
240229 common fgetxattr sys_fgetxattr compat_sys_fgetxattr
241230 common listxattr sys_listxattr compat_sys_listxattr
242231 common llistxattr sys_llistxattr compat_sys_llistxattr
243232 common flistxattr sys_flistxattr compat_sys_flistxattr
244233 common removexattr sys_removexattr compat_sys_removexattr
245234 common lremovexattr sys_lremovexattr compat_sys_lremovexattr
246235 common fremovexattr sys_fremovexattr compat_sys_fremovexattr
247236 common gettid sys_gettid sys_gettid
248237 common tkill sys_tkill sys_tkill
249238 common futex sys_futex compat_sys_futex
250239 common sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity
251240 common sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity
252241 common tgkill sys_tgkill sys_tgkill
253243 common io_setup sys_io_setup compat_sys_io_setup
254244 common io_destroy sys_io_destroy compat_sys_io_destroy
255245 common io_getevents sys_io_getevents compat_sys_io_getevents
256246 common io_submit sys_io_submit compat_sys_io_submit
257247 common io_cancel sys_io_cancel compat_sys_io_cancel
258248 common exit_group sys_exit_group sys_exit_group
259249 common epoll_create sys_epoll_create sys_epoll_create
260250 common epoll_ctl sys_epoll_ctl compat_sys_epoll_ctl
261251 common epoll_wait sys_epoll_wait compat_sys_epoll_wait
262252 common set_tid_address sys_set_tid_address compat_sys_set_tid_address
263253 common fadvise64 sys_fadvise64_64 compat_sys_s390_fadvise64
264254 common timer_create sys_timer_create compat_sys_timer_create
265255 common timer_settime sys_timer_settime compat_sys_timer_settime
266256 common timer_gettime sys_timer_gettime compat_sys_timer_gettime
267257 common timer_getoverrun sys_timer_getoverrun sys_timer_getoverrun
268258 common timer_delete sys_timer_delete sys_timer_delete
269259 common clock_settime sys_clock_settime compat_sys_clock_settime
270260 common clock_gettime sys_clock_gettime compat_sys_clock_gettime
271261 common clock_getres sys_clock_getres compat_sys_clock_getres
272262 common clock_nanosleep sys_clock_nanosleep compat_sys_clock_nanosleep
273264 32 fadvise64_64 - compat_sys_s390_fadvise64_64
274265 common statfs64 sys_statfs64 compat_sys_statfs64
275266 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64
276267 common remap_file_pages sys_remap_file_pages compat_sys_remap_file_pages
277268 common mbind sys_mbind compat_sys_mbind
278269 common get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy
279270 common set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy
280271 common mq_open sys_mq_open compat_sys_mq_open
281272 common mq_unlink sys_mq_unlink compat_sys_mq_unlink
282273 common mq_timedsend sys_mq_timedsend compat_sys_mq_timedsend
283274 common mq_timedreceive sys_mq_timedreceive compat_sys_mq_timedreceive
284275 common mq_notify sys_mq_notify compat_sys_mq_notify
285276 common mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr
286277 common kexec_load sys_kexec_load compat_sys_kexec_load
287278 common add_key sys_add_key compat_sys_add_key
288279 common request_key sys_request_key compat_sys_request_key
289280 common keyctl sys_keyctl compat_sys_keyctl
290281 common waitid sys_waitid compat_sys_waitid
291282 common ioprio_set sys_ioprio_set sys_ioprio_set
292283 common ioprio_get sys_ioprio_get sys_ioprio_get
293284 common inotify_init sys_inotify_init sys_inotify_init
294285 common inotify_add_watch sys_inotify_add_watch compat_sys_inotify_add_watch
295286 common inotify_rm_watch sys_inotify_rm_watch sys_inotify_rm_watch
296287 common migrate_pages sys_migrate_pages compat_sys_migrate_pages
297288 common openat sys_openat compat_sys_openat
298289 common mkdirat sys_mkdirat compat_sys_mkdirat
299290 common mknodat sys_mknodat compat_sys_mknodat
300291 common fchownat sys_fchownat compat_sys_fchownat
301292 common futimesat sys_futimesat compat_sys_futimesat
302293 32 fstatat64 - compat_sys_s390_fstatat64
303293 64 newfstatat sys_newfstatat -
304294 common unlinkat sys_unlinkat compat_sys_unlinkat
305295 common renameat sys_renameat compat_sys_renameat
306296 common linkat sys_linkat compat_sys_linkat
307297 common symlinkat sys_symlinkat compat_sys_symlinkat
308298 common readlinkat sys_readlinkat compat_sys_readlinkat
309299 common fchmodat sys_fchmodat compat_sys_fchmodat
310300 common faccessat sys_faccessat compat_sys_faccessat
311301 common pselect6 sys_pselect6 compat_sys_pselect6
312302 common ppoll sys_ppoll compat_sys_ppoll
313303 common unshare sys_unshare compat_sys_unshare
314304 common set_robust_list sys_set_robust_list compat_sys_set_robust_list
315305 common get_robust_list sys_get_robust_list compat_sys_get_robust_list
316306 common splice sys_splice compat_sys_splice
317307 common sync_file_range sys_sync_file_range compat_sys_s390_sync_file_range
318308 common tee sys_tee compat_sys_tee
319309 common vmsplice sys_vmsplice compat_sys_vmsplice
320310 common move_pages sys_move_pages compat_sys_move_pages
321311 common getcpu sys_getcpu compat_sys_getcpu
322312 common epoll_pwait sys_epoll_pwait compat_sys_epoll_pwait
323313 common utimes sys_utimes compat_sys_utimes
324314 common fallocate sys_fallocate compat_sys_s390_fallocate
325315 common utimensat sys_utimensat compat_sys_utimensat
326316 common signalfd sys_signalfd compat_sys_signalfd
327317 common timerfd - -
328318 common eventfd sys_eventfd sys_eventfd
329319 common timerfd_create sys_timerfd_create sys_timerfd_create
330320 common timerfd_settime sys_timerfd_settime compat_sys_timerfd_settime
331321 common timerfd_gettime sys_timerfd_gettime compat_sys_timerfd_gettime
332322 common signalfd4 sys_signalfd4 compat_sys_signalfd4
333323 common eventfd2 sys_eventfd2 sys_eventfd2
334324 common inotify_init1 sys_inotify_init1 sys_inotify_init1
335325 common pipe2 sys_pipe2 compat_sys_pipe2
336326 common dup3 sys_dup3 sys_dup3
337327 common epoll_create1 sys_epoll_create1 sys_epoll_create1
338328 common preadv sys_preadv compat_sys_preadv
339329 common pwritev sys_pwritev compat_sys_pwritev
340330 common rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo
341331 common perf_event_open sys_perf_event_open compat_sys_perf_event_open
342332 common fanotify_init sys_fanotify_init sys_fanotify_init
343333 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark
344334 common prlimit64 sys_prlimit64 compat_sys_prlimit64
345335 common name_to_handle_at sys_name_to_handle_at compat_sys_name_to_handle_at
346336 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at
347337 common clock_adjtime sys_clock_adjtime compat_sys_clock_adjtime
348338 common syncfs sys_syncfs sys_syncfs
349339 common setns sys_setns sys_setns
350340 common process_vm_readv sys_process_vm_readv compat_sys_process_vm_readv
351341 common process_vm_writev sys_process_vm_writev compat_sys_process_vm_writev
352342 common s390_runtime_instr sys_s390_runtime_instr sys_s390_runtime_instr
353343 common kcmp sys_kcmp compat_sys_kcmp
354344 common finit_module sys_finit_module compat_sys_finit_module
355345 common sched_setattr sys_sched_setattr compat_sys_sched_setattr
356346 common sched_getattr sys_sched_getattr compat_sys_sched_getattr
357347 common renameat2 sys_renameat2 compat_sys_renameat2
358348 common seccomp sys_seccomp compat_sys_seccomp
359349 common getrandom sys_getrandom compat_sys_getrandom
360350 common memfd_create sys_memfd_create compat_sys_memfd_create
361351 common bpf sys_bpf compat_sys_bpf
362352 common s390_pci_mmio_write sys_s390_pci_mmio_write compat_sys_s390_pci_mmio_write
363353 common s390_pci_mmio_read sys_s390_pci_mmio_read compat_sys_s390_pci_mmio_read
364354 common execveat sys_execveat compat_sys_execveat
365355 common userfaultfd sys_userfaultfd sys_userfaultfd
366356 common membarrier sys_membarrier sys_membarrier
367357 common recvmmsg sys_recvmmsg compat_sys_recvmmsg
368358 common sendmmsg sys_sendmmsg compat_sys_sendmmsg
369359 common socket sys_socket sys_socket
370360 common socketpair sys_socketpair compat_sys_socketpair
371361 common bind sys_bind compat_sys_bind
372362 common connect sys_connect compat_sys_connect
373363 common listen sys_listen sys_listen
374364 common accept4 sys_accept4 compat_sys_accept4
375365 common getsockopt sys_getsockopt compat_sys_getsockopt
376366 common setsockopt sys_setsockopt compat_sys_setsockopt
377367 common getsockname sys_getsockname compat_sys_getsockname
378368 common getpeername sys_getpeername compat_sys_getpeername
379369 common sendto sys_sendto compat_sys_sendto
380370 common sendmsg sys_sendmsg compat_sys_sendmsg
381371 common recvfrom sys_recvfrom compat_sys_recvfrom
382372 common recvmsg sys_recvmsg compat_sys_recvmsg
383373 common shutdown sys_shutdown sys_shutdown
384374 common mlock2 sys_mlock2 compat_sys_mlock2
385375 common copy_file_range sys_copy_file_range compat_sys_copy_file_range
386376 common preadv2 sys_preadv2 compat_sys_preadv2
387377 common pwritev2 sys_pwritev2 compat_sys_pwritev2
388378 common s390_guarded_storage sys_s390_guarded_storage compat_sys_s390_guarded_storage
389379 common statx sys_statx compat_sys_statx
390380 common s390_sthyi sys_s390_sthyi compat_sys_s390_sthyi
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index c0815a37fdb5..539c3d460158 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2245,7 +2245,7 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he)
2245 c2c_browser__update_nr_entries(browser); 2245 c2c_browser__update_nr_entries(browser);
2246 2246
2247 while (1) { 2247 while (1) {
2248 key = hist_browser__run(browser, "? - help"); 2248 key = hist_browser__run(browser, "? - help", true);
2249 2249
2250 switch (key) { 2250 switch (key) {
2251 case 's': 2251 case 's':
@@ -2314,7 +2314,7 @@ static int perf_c2c__hists_browse(struct hists *hists)
2314 c2c_browser__update_nr_entries(browser); 2314 c2c_browser__update_nr_entries(browser);
2315 2315
2316 while (1) { 2316 while (1) {
2317 key = hist_browser__run(browser, "? - help"); 2317 key = hist_browser__run(browser, "? - help", true);
2318 2318
2319 switch (key) { 2319 switch (key) {
2320 case 'q': 2320 case 'q':
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 42a52dcc41cd..4ad5dc649716 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -530,7 +530,8 @@ static int report__browse_hists(struct report *rep)
530 case 1: 530 case 1:
531 ret = perf_evlist__tui_browse_hists(evlist, help, NULL, 531 ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
532 rep->min_percent, 532 rep->min_percent,
533 &session->header.env); 533 &session->header.env,
534 true);
534 /* 535 /*
535 * Usually "ret" is the last pressed key, and we only 536 * Usually "ret" is the last pressed key, and we only
536 * care if the key notifies us to switch data file. 537 * care if the key notifies us to switch data file.
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c6ccda52117d..b7c823ba8374 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -283,8 +283,9 @@ static void perf_top__print_sym_table(struct perf_top *top)
283 283
284 printf("%-*.*s\n", win_width, win_width, graph_dotted_line); 284 printf("%-*.*s\n", win_width, win_width, graph_dotted_line);
285 285
286 if (hists->stats.nr_lost_warned != 286 if (!top->record_opts.overwrite &&
287 hists->stats.nr_events[PERF_RECORD_LOST]) { 287 (hists->stats.nr_lost_warned !=
288 hists->stats.nr_events[PERF_RECORD_LOST])) {
288 hists->stats.nr_lost_warned = 289 hists->stats.nr_lost_warned =
289 hists->stats.nr_events[PERF_RECORD_LOST]; 290 hists->stats.nr_events[PERF_RECORD_LOST];
290 color_fprintf(stdout, PERF_COLOR_RED, 291 color_fprintf(stdout, PERF_COLOR_RED,
@@ -611,7 +612,8 @@ static void *display_thread_tui(void *arg)
611 612
612 perf_evlist__tui_browse_hists(top->evlist, help, &hbt, 613 perf_evlist__tui_browse_hists(top->evlist, help, &hbt,
613 top->min_percent, 614 top->min_percent,
614 &top->session->header.env); 615 &top->session->header.env,
616 !top->record_opts.overwrite);
615 617
616 done = 1; 618 done = 1;
617 return NULL; 619 return NULL;
@@ -807,15 +809,23 @@ static void perf_event__process_sample(struct perf_tool *tool,
807 809
808static void perf_top__mmap_read_idx(struct perf_top *top, int idx) 810static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
809{ 811{
812 struct record_opts *opts = &top->record_opts;
813 struct perf_evlist *evlist = top->evlist;
810 struct perf_sample sample; 814 struct perf_sample sample;
811 struct perf_evsel *evsel; 815 struct perf_evsel *evsel;
816 struct perf_mmap *md;
812 struct perf_session *session = top->session; 817 struct perf_session *session = top->session;
813 union perf_event *event; 818 union perf_event *event;
814 struct machine *machine; 819 struct machine *machine;
820 u64 end, start;
815 int ret; 821 int ret;
816 822
817 while ((event = perf_evlist__mmap_read(top->evlist, idx)) != NULL) { 823 md = opts->overwrite ? &evlist->overwrite_mmap[idx] : &evlist->mmap[idx];
818 ret = perf_evlist__parse_sample(top->evlist, event, &sample); 824 if (perf_mmap__read_init(md, opts->overwrite, &start, &end) < 0)
825 return;
826
827 while ((event = perf_mmap__read_event(md, opts->overwrite, &start, end)) != NULL) {
828 ret = perf_evlist__parse_sample(evlist, event, &sample);
819 if (ret) { 829 if (ret) {
820 pr_err("Can't parse sample, err = %d\n", ret); 830 pr_err("Can't parse sample, err = %d\n", ret);
821 goto next_event; 831 goto next_event;
@@ -869,16 +879,120 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
869 } else 879 } else
870 ++session->evlist->stats.nr_unknown_events; 880 ++session->evlist->stats.nr_unknown_events;
871next_event: 881next_event:
872 perf_evlist__mmap_consume(top->evlist, idx); 882 perf_mmap__consume(md, opts->overwrite);
873 } 883 }
884
885 perf_mmap__read_done(md);
874} 886}
875 887
876static void perf_top__mmap_read(struct perf_top *top) 888static void perf_top__mmap_read(struct perf_top *top)
877{ 889{
890 bool overwrite = top->record_opts.overwrite;
891 struct perf_evlist *evlist = top->evlist;
892 unsigned long long start, end;
878 int i; 893 int i;
879 894
895 start = rdclock();
896 if (overwrite)
897 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_DATA_PENDING);
898
880 for (i = 0; i < top->evlist->nr_mmaps; i++) 899 for (i = 0; i < top->evlist->nr_mmaps; i++)
881 perf_top__mmap_read_idx(top, i); 900 perf_top__mmap_read_idx(top, i);
901
902 if (overwrite) {
903 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_EMPTY);
904 perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING);
905 }
906 end = rdclock();
907
908 if ((end - start) > (unsigned long long)top->delay_secs * NSEC_PER_SEC)
909 ui__warning("Too slow to read ring buffer.\n"
910 "Please try increasing the period (-c) or\n"
911 "decreasing the freq (-F) or\n"
912 "limiting the number of CPUs (-C)\n");
913}
914
915/*
916 * Check per-event overwrite term.
917 * perf top should support consistent term for all events.
918 * - All events don't have per-event term
919 * E.g. "cpu/cpu-cycles/,cpu/instructions/"
920 * Nothing change, return 0.
921 * - All events have same per-event term
922 * E.g. "cpu/cpu-cycles,no-overwrite/,cpu/instructions,no-overwrite/
923 * Using the per-event setting to replace the opts->overwrite if
924 * they are different, then return 0.
925 * - Events have different per-event term
926 * E.g. "cpu/cpu-cycles,overwrite/,cpu/instructions,no-overwrite/"
927 * Return -1
928 * - Some of the event set per-event term, but some not.
929 * E.g. "cpu/cpu-cycles/,cpu/instructions,no-overwrite/"
930 * Return -1
931 */
932static int perf_top__overwrite_check(struct perf_top *top)
933{
934 struct record_opts *opts = &top->record_opts;
935 struct perf_evlist *evlist = top->evlist;
936 struct perf_evsel_config_term *term;
937 struct list_head *config_terms;
938 struct perf_evsel *evsel;
939 int set, overwrite = -1;
940
941 evlist__for_each_entry(evlist, evsel) {
942 set = -1;
943 config_terms = &evsel->config_terms;
944 list_for_each_entry(term, config_terms, list) {
945 if (term->type == PERF_EVSEL__CONFIG_TERM_OVERWRITE)
946 set = term->val.overwrite ? 1 : 0;
947 }
948
949 /* no term for current and previous event (likely) */
950 if ((overwrite < 0) && (set < 0))
951 continue;
952
953 /* has term for both current and previous event, compare */
954 if ((overwrite >= 0) && (set >= 0) && (overwrite != set))
955 return -1;
956
957 /* no term for current event but has term for previous one */
958 if ((overwrite >= 0) && (set < 0))
959 return -1;
960
961 /* has term for current event */
962 if ((overwrite < 0) && (set >= 0)) {
963 /* if it's first event, set overwrite */
964 if (evsel == perf_evlist__first(evlist))
965 overwrite = set;
966 else
967 return -1;
968 }
969 }
970
971 if ((overwrite >= 0) && (opts->overwrite != overwrite))
972 opts->overwrite = overwrite;
973
974 return 0;
975}
976
977static int perf_top_overwrite_fallback(struct perf_top *top,
978 struct perf_evsel *evsel)
979{
980 struct record_opts *opts = &top->record_opts;
981 struct perf_evlist *evlist = top->evlist;
982 struct perf_evsel *counter;
983
984 if (!opts->overwrite)
985 return 0;
986
987 /* only fall back when first event fails */
988 if (evsel != perf_evlist__first(evlist))
989 return 0;
990
991 evlist__for_each_entry(evlist, counter)
992 counter->attr.write_backward = false;
993 opts->overwrite = false;
994 ui__warning("fall back to non-overwrite mode\n");
995 return 1;
882} 996}
883 997
884static int perf_top__start_counters(struct perf_top *top) 998static int perf_top__start_counters(struct perf_top *top)
@@ -888,12 +1002,33 @@ static int perf_top__start_counters(struct perf_top *top)
888 struct perf_evlist *evlist = top->evlist; 1002 struct perf_evlist *evlist = top->evlist;
889 struct record_opts *opts = &top->record_opts; 1003 struct record_opts *opts = &top->record_opts;
890 1004
1005 if (perf_top__overwrite_check(top)) {
1006 ui__error("perf top only support consistent per-event "
1007 "overwrite setting for all events\n");
1008 goto out_err;
1009 }
1010
891 perf_evlist__config(evlist, opts, &callchain_param); 1011 perf_evlist__config(evlist, opts, &callchain_param);
892 1012
893 evlist__for_each_entry(evlist, counter) { 1013 evlist__for_each_entry(evlist, counter) {
894try_again: 1014try_again:
895 if (perf_evsel__open(counter, top->evlist->cpus, 1015 if (perf_evsel__open(counter, top->evlist->cpus,
896 top->evlist->threads) < 0) { 1016 top->evlist->threads) < 0) {
1017
1018 /*
1019 * Specially handle overwrite fall back.
1020 * Because perf top is the only tool which has
1021 * overwrite mode by default, support
1022 * both overwrite and non-overwrite mode, and
1023 * require consistent mode for all events.
1024 *
1025 * May move it to generic code with more tools
1026 * have similar attribute.
1027 */
1028 if (perf_missing_features.write_backward &&
1029 perf_top_overwrite_fallback(top, counter))
1030 goto try_again;
1031
897 if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) { 1032 if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) {
898 if (verbose > 0) 1033 if (verbose > 0)
899 ui__warning("%s\n", msg); 1034 ui__warning("%s\n", msg);
@@ -1033,7 +1168,7 @@ static int __cmd_top(struct perf_top *top)
1033 1168
1034 perf_top__mmap_read(top); 1169 perf_top__mmap_read(top);
1035 1170
1036 if (hits == top->samples) 1171 if (opts->overwrite || (hits == top->samples))
1037 ret = perf_evlist__poll(top->evlist, 100); 1172 ret = perf_evlist__poll(top->evlist, 100);
1038 1173
1039 if (resize) { 1174 if (resize) {
@@ -1127,6 +1262,7 @@ int cmd_top(int argc, const char **argv)
1127 .uses_mmap = true, 1262 .uses_mmap = true,
1128 }, 1263 },
1129 .proc_map_timeout = 500, 1264 .proc_map_timeout = 500,
1265 .overwrite = 1,
1130 }, 1266 },
1131 .max_stack = sysctl_perf_event_max_stack, 1267 .max_stack = sysctl_perf_event_max_stack,
1132 .sym_pcnt_filter = 5, 1268 .sym_pcnt_filter = 5,
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 51abdb0a4047..790ec25919a0 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -33,7 +33,6 @@ arch/s390/include/uapi/asm/kvm.h
33arch/s390/include/uapi/asm/kvm_perf.h 33arch/s390/include/uapi/asm/kvm_perf.h
34arch/s390/include/uapi/asm/ptrace.h 34arch/s390/include/uapi/asm/ptrace.h
35arch/s390/include/uapi/asm/sie.h 35arch/s390/include/uapi/asm/sie.h
36arch/s390/include/uapi/asm/unistd.h
37arch/arm/include/uapi/asm/kvm.h 36arch/arm/include/uapi/asm/kvm.h
38arch/arm64/include/uapi/asm/kvm.h 37arch/arm64/include/uapi/asm/kvm.h
39arch/alpha/include/uapi/asm/errno.h 38arch/alpha/include/uapi/asm/errno.h
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/branch.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/branch.json
new file mode 100644
index 000000000000..3b6208763e50
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/branch.json
@@ -0,0 +1,27 @@
1[
2 {,
3 "EventCode": "0x7A",
4 "EventName": "BR_INDIRECT_SPEC",
5 "BriefDescription": "Branch speculatively executed - Indirect branch"
6 },
7 {,
8 "EventCode": "0xC9",
9 "EventName": "BR_COND",
10 "BriefDescription": "Conditional branch executed"
11 },
12 {,
13 "EventCode": "0xCA",
14 "EventName": "BR_INDIRECT_MISPRED",
15 "BriefDescription": "Indirect branch mispredicted"
16 },
17 {,
18 "EventCode": "0xCB",
19 "EventName": "BR_INDIRECT_MISPRED_ADDR",
20 "BriefDescription": "Indirect branch mispredicted because of address miscompare"
21 },
22 {,
23 "EventCode": "0xCC",
24 "EventName": "BR_COND_MISPRED",
25 "BriefDescription": "Conditional branch mispredicted"
26 }
27]
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/bus.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/bus.json
new file mode 100644
index 000000000000..480d9f7460ab
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/bus.json
@@ -0,0 +1,22 @@
1[
2 {,
3 "EventCode": "0x60",
4 "EventName": "BUS_ACCESS_LD",
5 "BriefDescription": "Bus access - Read"
6 },
7 {,
8 "EventCode": "0x61",
9 "EventName": "BUS_ACCESS_ST",
10 "BriefDescription": "Bus access - Write"
11 },
12 {,
13 "EventCode": "0xC0",
14 "EventName": "EXT_MEM_REQ",
15 "BriefDescription": "External memory request"
16 },
17 {,
18 "EventCode": "0xC1",
19 "EventName": "EXT_MEM_REQ_NC",
20 "BriefDescription": "Non-cacheable external memory request"
21 }
22]
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/cache.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/cache.json
new file mode 100644
index 000000000000..11baad6344b9
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/cache.json
@@ -0,0 +1,27 @@
1[
2 {,
3 "EventCode": "0xC2",
4 "EventName": "PREFETCH_LINEFILL",
5 "BriefDescription": "Linefill because of prefetch"
6 },
7 {,
8 "EventCode": "0xC3",
9 "EventName": "PREFETCH_LINEFILL_DROP",
10 "BriefDescription": "Instruction Cache Throttle occurred"
11 },
12 {,
13 "EventCode": "0xC4",
14 "EventName": "READ_ALLOC_ENTER",
15 "BriefDescription": "Entering read allocate mode"
16 },
17 {,
18 "EventCode": "0xC5",
19 "EventName": "READ_ALLOC",
20 "BriefDescription": "Read allocate mode"
21 },
22 {,
23 "EventCode": "0xC8",
24 "EventName": "EXT_SNOOP",
25 "BriefDescription": "SCU Snooped data from another CPU for this CPU"
26 }
27]
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/memory.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/memory.json
new file mode 100644
index 000000000000..480d9f7460ab
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/memory.json
@@ -0,0 +1,22 @@
1[
2 {,
3 "EventCode": "0x60",
4 "EventName": "BUS_ACCESS_LD",
5 "BriefDescription": "Bus access - Read"
6 },
7 {,
8 "EventCode": "0x61",
9 "EventName": "BUS_ACCESS_ST",
10 "BriefDescription": "Bus access - Write"
11 },
12 {,
13 "EventCode": "0xC0",
14 "EventName": "EXT_MEM_REQ",
15 "BriefDescription": "External memory request"
16 },
17 {,
18 "EventCode": "0xC1",
19 "EventName": "EXT_MEM_REQ_NC",
20 "BriefDescription": "Non-cacheable external memory request"
21 }
22]
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/other.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/other.json
new file mode 100644
index 000000000000..73a22402d003
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/other.json
@@ -0,0 +1,32 @@
1[
2 {,
3 "EventCode": "0x86",
4 "EventName": "EXC_IRQ",
5 "BriefDescription": "Exception taken, IRQ"
6 },
7 {,
8 "EventCode": "0x87",
9 "EventName": "EXC_FIQ",
10 "BriefDescription": "Exception taken, FIQ"
11 },
12 {,
13 "EventCode": "0xC6",
14 "EventName": "PRE_DECODE_ERR",
15 "BriefDescription": "Pre-decode error"
16 },
17 {,
18 "EventCode": "0xD0",
19 "EventName": "L1I_CACHE_ERR",
20 "BriefDescription": "L1 Instruction Cache (data or tag) memory error"
21 },
22 {,
23 "EventCode": "0xD1",
24 "EventName": "L1D_CACHE_ERR",
25 "BriefDescription": "L1 Data Cache (data, tag or dirty) memory error, correctable or non-correctable"
26 },
27 {,
28 "EventCode": "0xD2",
29 "EventName": "TLB_ERR",
30 "BriefDescription": "TLB memory error"
31 }
32]
diff --git a/tools/perf/pmu-events/arch/arm64/cortex-a53/pipeline.json b/tools/perf/pmu-events/arch/arm64/cortex-a53/pipeline.json
new file mode 100644
index 000000000000..3149fb90555a
--- /dev/null
+++ b/tools/perf/pmu-events/arch/arm64/cortex-a53/pipeline.json
@@ -0,0 +1,52 @@
1[
2 {,
3 "EventCode": "0xC7",
4 "EventName": "STALL_SB_FULL",
5 "BriefDescription": "Data Write operation that stalls the pipeline because the store buffer is full"
6 },
7 {,
8 "EventCode": "0xE0",
9 "EventName": "OTHER_IQ_DEP_STALL",
10 "BriefDescription": "Cycles that the DPU IQ is empty and that is not because of a recent micro-TLB miss, instruction cache miss or pre-decode error"
11 },
12 {,
13 "EventCode": "0xE1",
14 "EventName": "IC_DEP_STALL",
15 "BriefDescription": "Cycles the DPU IQ is empty and there is an instruction cache miss being processed"
16 },
17 {,
18 "EventCode": "0xE2",
19 "EventName": "IUTLB_DEP_STALL",
20 "BriefDescription": "Cycles the DPU IQ is empty and there is an instruction micro-TLB miss being processed"
21 },
22 {,
23 "EventCode": "0xE3",
24 "EventName": "DECODE_DEP_STALL",
25 "BriefDescription": "Cycles the DPU IQ is empty and there is a pre-decode error being processed"
26 },
27 {,
28 "EventCode": "0xE4",
29 "EventName": "OTHER_INTERLOCK_STALL",
30 "BriefDescription": "Cycles there is an interlock other than Advanced SIMD/Floating-point instructions or load/store instruction"
31 },
32 {,
33 "EventCode": "0xE5",
34 "EventName": "AGU_DEP_STALL",
35 "BriefDescription": "Cycles there is an interlock for a load/store instruction waiting for data to calculate the address in the AGU"
36 },
37 {,
38 "EventCode": "0xE6",
39 "EventName": "SIMD_DEP_STALL",
40 "BriefDescription": "Cycles there is an interlock for an Advanced SIMD/Floating-point operation."
41 },
42 {,
43 "EventCode": "0xE7",
44 "EventName": "LD_DEP_STALL",
45 "BriefDescription": "Cycles there is a stall in the Wr stage because of a load miss"
46 },
47 {,
48 "EventCode": "0xE8",
49 "EventName": "ST_DEP_STALL",
50 "BriefDescription": "Cycles there is a stall in the Wr stage because of a store"
51 }
52]
diff --git a/tools/perf/pmu-events/arch/arm64/mapfile.csv b/tools/perf/pmu-events/arch/arm64/mapfile.csv
index 219d6756134e..e61c9ca6cf9e 100644
--- a/tools/perf/pmu-events/arch/arm64/mapfile.csv
+++ b/tools/perf/pmu-events/arch/arm64/mapfile.csv
@@ -13,3 +13,4 @@
13# 13#
14#Family-model,Version,Filename,EventType 14#Family-model,Version,Filename,EventType
150x00000000420f5160,v1,cavium,core 150x00000000420f5160,v1,cavium,core
160x00000000410fd03[[:xdigit:]],v1,cortex-a53,core
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 4035d43523c3..e0b1b414d466 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -31,10 +31,12 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
31 int i; 31 int i;
32 32
33 for (i = 0; i < evlist->nr_mmaps; i++) { 33 for (i = 0; i < evlist->nr_mmaps; i++) {
34 struct perf_mmap *map = &evlist->overwrite_mmap[i];
34 union perf_event *event; 35 union perf_event *event;
36 u64 start, end;
35 37
36 perf_mmap__read_catchup(&evlist->overwrite_mmap[i]); 38 perf_mmap__read_init(map, true, &start, &end);
37 while ((event = perf_mmap__read_backward(&evlist->overwrite_mmap[i])) != NULL) { 39 while ((event = perf_mmap__read_event(map, true, &start, end)) != NULL) {
38 const u32 type = event->header.type; 40 const u32 type = event->header.type;
39 41
40 switch (type) { 42 switch (type) {
@@ -49,6 +51,7 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
49 return TEST_FAIL; 51 return TEST_FAIL;
50 } 52 }
51 } 53 }
54 perf_mmap__read_done(map);
52 } 55 }
53 return TEST_OK; 56 return TEST_OK;
54} 57}
diff --git a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
index 8b3da21a08f1..c446c894b297 100755
--- a/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/trace+probe_libc_inet_pton.sh
@@ -22,10 +22,23 @@ trace_libc_inet_pton_backtrace() {
22 expected[4]="rtt min.*" 22 expected[4]="rtt min.*"
23 expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)" 23 expected[5]="[0-9]+\.[0-9]+[[:space:]]+probe_libc:inet_pton:\([[:xdigit:]]+\)"
24 expected[6]=".*inet_pton[[:space:]]\($libc\)$" 24 expected[6]=".*inet_pton[[:space:]]\($libc\)$"
25 expected[7]="getaddrinfo[[:space:]]\($libc\)$" 25 case "$(uname -m)" in
26 expected[8]=".*\(.*/bin/ping.*\)$" 26 s390x)
27 27 eventattr='call-graph=dwarf'
28 perf trace --no-syscalls -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do 28 expected[7]="gaih_inet[[:space:]]\(inlined\)$"
29 expected[8]="__GI_getaddrinfo[[:space:]]\(inlined\)$"
30 expected[9]="main[[:space:]]\(.*/bin/ping.*\)$"
31 expected[10]="__libc_start_main[[:space:]]\($libc\)$"
32 expected[11]="_start[[:space:]]\(.*/bin/ping.*\)$"
33 ;;
34 *)
35 eventattr='max-stack=3'
36 expected[7]="getaddrinfo[[:space:]]\($libc\)$"
37 expected[8]=".*\(.*/bin/ping.*\)$"
38 ;;
39 esac
40
41 perf trace --no-syscalls -e probe_libc:inet_pton/$eventattr/ ping -6 -c 1 ::1 2>&1 | grep -v ^$ | while read line ; do
29 echo $line 42 echo $line
30 echo "$line" | egrep -q "${expected[$idx]}" 43 echo "$line" | egrep -q "${expected[$idx]}"
31 if [ $? -ne 0 ] ; then 44 if [ $? -ne 0 ] ; then
@@ -33,7 +46,7 @@ trace_libc_inet_pton_backtrace() {
33 exit 1 46 exit 1
34 fi 47 fi
35 let idx+=1 48 let idx+=1
36 [ $idx -eq 9 ] && break 49 [ -z "${expected[$idx]}" ] && break
37 done 50 done
38} 51}
39 52
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 68146f4620a5..6495ee55d9c3 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -608,7 +608,8 @@ static int hist_browser__title(struct hist_browser *browser, char *bf, size_t si
608 return browser->title ? browser->title(browser, bf, size) : 0; 608 return browser->title ? browser->title(browser, bf, size) : 0;
609} 609}
610 610
611int hist_browser__run(struct hist_browser *browser, const char *help) 611int hist_browser__run(struct hist_browser *browser, const char *help,
612 bool warn_lost_event)
612{ 613{
613 int key; 614 int key;
614 char title[160]; 615 char title[160];
@@ -638,8 +639,9 @@ int hist_browser__run(struct hist_browser *browser, const char *help)
638 nr_entries = hist_browser__nr_entries(browser); 639 nr_entries = hist_browser__nr_entries(browser);
639 ui_browser__update_nr_entries(&browser->b, nr_entries); 640 ui_browser__update_nr_entries(&browser->b, nr_entries);
640 641
641 if (browser->hists->stats.nr_lost_warned != 642 if (warn_lost_event &&
642 browser->hists->stats.nr_events[PERF_RECORD_LOST]) { 643 (browser->hists->stats.nr_lost_warned !=
644 browser->hists->stats.nr_events[PERF_RECORD_LOST])) {
643 browser->hists->stats.nr_lost_warned = 645 browser->hists->stats.nr_lost_warned =
644 browser->hists->stats.nr_events[PERF_RECORD_LOST]; 646 browser->hists->stats.nr_events[PERF_RECORD_LOST];
645 ui_browser__warn_lost_events(&browser->b); 647 ui_browser__warn_lost_events(&browser->b);
@@ -2763,7 +2765,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
2763 bool left_exits, 2765 bool left_exits,
2764 struct hist_browser_timer *hbt, 2766 struct hist_browser_timer *hbt,
2765 float min_pcnt, 2767 float min_pcnt,
2766 struct perf_env *env) 2768 struct perf_env *env,
2769 bool warn_lost_event)
2767{ 2770{
2768 struct hists *hists = evsel__hists(evsel); 2771 struct hists *hists = evsel__hists(evsel);
2769 struct hist_browser *browser = perf_evsel_browser__new(evsel, hbt, env); 2772 struct hist_browser *browser = perf_evsel_browser__new(evsel, hbt, env);
@@ -2844,7 +2847,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
2844 2847
2845 nr_options = 0; 2848 nr_options = 0;
2846 2849
2847 key = hist_browser__run(browser, helpline); 2850 key = hist_browser__run(browser, helpline,
2851 warn_lost_event);
2848 2852
2849 if (browser->he_selection != NULL) { 2853 if (browser->he_selection != NULL) {
2850 thread = hist_browser__selected_thread(browser); 2854 thread = hist_browser__selected_thread(browser);
@@ -3184,7 +3188,8 @@ static void perf_evsel_menu__write(struct ui_browser *browser,
3184 3188
3185static int perf_evsel_menu__run(struct perf_evsel_menu *menu, 3189static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
3186 int nr_events, const char *help, 3190 int nr_events, const char *help,
3187 struct hist_browser_timer *hbt) 3191 struct hist_browser_timer *hbt,
3192 bool warn_lost_event)
3188{ 3193{
3189 struct perf_evlist *evlist = menu->b.priv; 3194 struct perf_evlist *evlist = menu->b.priv;
3190 struct perf_evsel *pos; 3195 struct perf_evsel *pos;
@@ -3203,7 +3208,9 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
3203 case K_TIMER: 3208 case K_TIMER:
3204 hbt->timer(hbt->arg); 3209 hbt->timer(hbt->arg);
3205 3210
3206 if (!menu->lost_events_warned && menu->lost_events) { 3211 if (!menu->lost_events_warned &&
3212 menu->lost_events &&
3213 warn_lost_event) {
3207 ui_browser__warn_lost_events(&menu->b); 3214 ui_browser__warn_lost_events(&menu->b);
3208 menu->lost_events_warned = true; 3215 menu->lost_events_warned = true;
3209 } 3216 }
@@ -3224,7 +3231,8 @@ browse_hists:
3224 key = perf_evsel__hists_browse(pos, nr_events, help, 3231 key = perf_evsel__hists_browse(pos, nr_events, help,
3225 true, hbt, 3232 true, hbt,
3226 menu->min_pcnt, 3233 menu->min_pcnt,
3227 menu->env); 3234 menu->env,
3235 warn_lost_event);
3228 ui_browser__show_title(&menu->b, title); 3236 ui_browser__show_title(&menu->b, title);
3229 switch (key) { 3237 switch (key) {
3230 case K_TAB: 3238 case K_TAB:
@@ -3282,7 +3290,8 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist,
3282 int nr_entries, const char *help, 3290 int nr_entries, const char *help,
3283 struct hist_browser_timer *hbt, 3291 struct hist_browser_timer *hbt,
3284 float min_pcnt, 3292 float min_pcnt,
3285 struct perf_env *env) 3293 struct perf_env *env,
3294 bool warn_lost_event)
3286{ 3295{
3287 struct perf_evsel *pos; 3296 struct perf_evsel *pos;
3288 struct perf_evsel_menu menu = { 3297 struct perf_evsel_menu menu = {
@@ -3309,13 +3318,15 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist,
3309 menu.b.width = line_len; 3318 menu.b.width = line_len;
3310 } 3319 }
3311 3320
3312 return perf_evsel_menu__run(&menu, nr_entries, help, hbt); 3321 return perf_evsel_menu__run(&menu, nr_entries, help,
3322 hbt, warn_lost_event);
3313} 3323}
3314 3324
3315int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, 3325int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
3316 struct hist_browser_timer *hbt, 3326 struct hist_browser_timer *hbt,
3317 float min_pcnt, 3327 float min_pcnt,
3318 struct perf_env *env) 3328 struct perf_env *env,
3329 bool warn_lost_event)
3319{ 3330{
3320 int nr_entries = evlist->nr_entries; 3331 int nr_entries = evlist->nr_entries;
3321 3332
@@ -3325,7 +3336,7 @@ single_entry:
3325 3336
3326 return perf_evsel__hists_browse(first, nr_entries, help, 3337 return perf_evsel__hists_browse(first, nr_entries, help,
3327 false, hbt, min_pcnt, 3338 false, hbt, min_pcnt,
3328 env); 3339 env, warn_lost_event);
3329 } 3340 }
3330 3341
3331 if (symbol_conf.event_group) { 3342 if (symbol_conf.event_group) {
@@ -3342,5 +3353,6 @@ single_entry:
3342 } 3353 }
3343 3354
3344 return __perf_evlist__tui_browse_hists(evlist, nr_entries, help, 3355 return __perf_evlist__tui_browse_hists(evlist, nr_entries, help,
3345 hbt, min_pcnt, env); 3356 hbt, min_pcnt, env,
3357 warn_lost_event);
3346} 3358}
diff --git a/tools/perf/ui/browsers/hists.h b/tools/perf/ui/browsers/hists.h
index ba431777f559..9428bee076f2 100644
--- a/tools/perf/ui/browsers/hists.h
+++ b/tools/perf/ui/browsers/hists.h
@@ -28,7 +28,8 @@ struct hist_browser {
28 28
29struct hist_browser *hist_browser__new(struct hists *hists); 29struct hist_browser *hist_browser__new(struct hists *hists);
30void hist_browser__delete(struct hist_browser *browser); 30void hist_browser__delete(struct hist_browser *browser);
31int hist_browser__run(struct hist_browser *browser, const char *help); 31int hist_browser__run(struct hist_browser *browser, const char *help,
32 bool warn_lost_event);
32void hist_browser__init(struct hist_browser *browser, 33void hist_browser__init(struct hist_browser *browser,
33 struct hists *hists); 34 struct hists *hists);
34#endif /* _PERF_UI_BROWSER_HISTS_H_ */ 35#endif /* _PERF_UI_BROWSER_HISTS_H_ */
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index ac35cd214feb..e5fc14e53c05 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -715,28 +715,11 @@ union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, int
715 return perf_mmap__read_forward(md); 715 return perf_mmap__read_forward(md);
716} 716}
717 717
718union perf_event *perf_evlist__mmap_read_backward(struct perf_evlist *evlist, int idx)
719{
720 struct perf_mmap *md = &evlist->mmap[idx];
721
722 /*
723 * No need to check messup for backward ring buffer:
724 * We can always read arbitrary long data from a backward
725 * ring buffer unless we forget to pause it before reading.
726 */
727 return perf_mmap__read_backward(md);
728}
729
730union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx) 718union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)
731{ 719{
732 return perf_evlist__mmap_read_forward(evlist, idx); 720 return perf_evlist__mmap_read_forward(evlist, idx);
733} 721}
734 722
735void perf_evlist__mmap_read_catchup(struct perf_evlist *evlist, int idx)
736{
737 perf_mmap__read_catchup(&evlist->mmap[idx]);
738}
739
740void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx) 723void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx)
741{ 724{
742 perf_mmap__consume(&evlist->mmap[idx], false); 725 perf_mmap__consume(&evlist->mmap[idx], false);
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 75f8e0ad5d76..336b838e6957 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -133,10 +133,6 @@ union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx);
133 133
134union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, 134union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist,
135 int idx); 135 int idx);
136union perf_event *perf_evlist__mmap_read_backward(struct perf_evlist *evlist,
137 int idx);
138void perf_evlist__mmap_read_catchup(struct perf_evlist *evlist, int idx);
139
140void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx); 136void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx);
141 137
142int perf_evlist__open(struct perf_evlist *evlist); 138int perf_evlist__open(struct perf_evlist *evlist);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ff359c9ece2e..ef351688b797 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -41,17 +41,7 @@
41 41
42#include "sane_ctype.h" 42#include "sane_ctype.h"
43 43
44static struct { 44struct perf_missing_features perf_missing_features;
45 bool sample_id_all;
46 bool exclude_guest;
47 bool mmap2;
48 bool cloexec;
49 bool clockid;
50 bool clockid_wrong;
51 bool lbr_flags;
52 bool write_backward;
53 bool group_read;
54} perf_missing_features;
55 45
56static clockid_t clockid; 46static clockid_t clockid;
57 47
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 846e41644525..a7487c6d1866 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -149,6 +149,20 @@ union u64_swap {
149 u32 val32[2]; 149 u32 val32[2];
150}; 150};
151 151
152struct perf_missing_features {
153 bool sample_id_all;
154 bool exclude_guest;
155 bool mmap2;
156 bool cloexec;
157 bool clockid;
158 bool clockid_wrong;
159 bool lbr_flags;
160 bool write_backward;
161 bool group_read;
162};
163
164extern struct perf_missing_features perf_missing_features;
165
152struct cpu_map; 166struct cpu_map;
153struct target; 167struct target;
154struct thread_map; 168struct thread_map;
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index f6630cb95eff..02721b579746 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -430,7 +430,8 @@ int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
430int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, 430int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
431 struct hist_browser_timer *hbt, 431 struct hist_browser_timer *hbt,
432 float min_pcnt, 432 float min_pcnt,
433 struct perf_env *env); 433 struct perf_env *env,
434 bool warn_lost_event);
434int script_browse(const char *script_opt); 435int script_browse(const char *script_opt);
435#else 436#else
436static inline 437static inline
@@ -438,7 +439,8 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
438 const char *help __maybe_unused, 439 const char *help __maybe_unused,
439 struct hist_browser_timer *hbt __maybe_unused, 440 struct hist_browser_timer *hbt __maybe_unused,
440 float min_pcnt __maybe_unused, 441 float min_pcnt __maybe_unused,
441 struct perf_env *env __maybe_unused) 442 struct perf_env *env __maybe_unused,
443 bool warn_lost_event __maybe_unused)
442{ 444{
443 return 0; 445 return 0;
444} 446}
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 05076e683938..91531a7c8fbf 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -22,29 +22,27 @@ size_t perf_mmap__mmap_len(struct perf_mmap *map)
22 22
23/* When check_messup is true, 'end' must points to a good entry */ 23/* When check_messup is true, 'end' must points to a good entry */
24static union perf_event *perf_mmap__read(struct perf_mmap *map, 24static union perf_event *perf_mmap__read(struct perf_mmap *map,
25 u64 start, u64 end, u64 *prev) 25 u64 *startp, u64 end)
26{ 26{
27 unsigned char *data = map->base + page_size; 27 unsigned char *data = map->base + page_size;
28 union perf_event *event = NULL; 28 union perf_event *event = NULL;
29 int diff = end - start; 29 int diff = end - *startp;
30 30
31 if (diff >= (int)sizeof(event->header)) { 31 if (diff >= (int)sizeof(event->header)) {
32 size_t size; 32 size_t size;
33 33
34 event = (union perf_event *)&data[start & map->mask]; 34 event = (union perf_event *)&data[*startp & map->mask];
35 size = event->header.size; 35 size = event->header.size;
36 36
37 if (size < sizeof(event->header) || diff < (int)size) { 37 if (size < sizeof(event->header) || diff < (int)size)
38 event = NULL; 38 return NULL;
39 goto broken_event;
40 }
41 39
42 /* 40 /*
43 * Event straddles the mmap boundary -- header should always 41 * Event straddles the mmap boundary -- header should always
44 * be inside due to u64 alignment of output. 42 * be inside due to u64 alignment of output.
45 */ 43 */
46 if ((start & map->mask) + size != ((start + size) & map->mask)) { 44 if ((*startp & map->mask) + size != ((*startp + size) & map->mask)) {
47 unsigned int offset = start; 45 unsigned int offset = *startp;
48 unsigned int len = min(sizeof(*event), size), cpy; 46 unsigned int len = min(sizeof(*event), size), cpy;
49 void *dst = map->event_copy; 47 void *dst = map->event_copy;
50 48
@@ -59,20 +57,19 @@ static union perf_event *perf_mmap__read(struct perf_mmap *map,
59 event = (union perf_event *)map->event_copy; 57 event = (union perf_event *)map->event_copy;
60 } 58 }
61 59
62 start += size; 60 *startp += size;
63 } 61 }
64 62
65broken_event:
66 if (prev)
67 *prev = start;
68
69 return event; 63 return event;
70} 64}
71 65
66/*
67 * legacy interface for mmap read.
68 * Don't use it. Use perf_mmap__read_event().
69 */
72union perf_event *perf_mmap__read_forward(struct perf_mmap *map) 70union perf_event *perf_mmap__read_forward(struct perf_mmap *map)
73{ 71{
74 u64 head; 72 u64 head;
75 u64 old = map->prev;
76 73
77 /* 74 /*
78 * Check if event was unmapped due to a POLLHUP/POLLERR. 75 * Check if event was unmapped due to a POLLHUP/POLLERR.
@@ -82,13 +79,26 @@ union perf_event *perf_mmap__read_forward(struct perf_mmap *map)
82 79
83 head = perf_mmap__read_head(map); 80 head = perf_mmap__read_head(map);
84 81
85 return perf_mmap__read(map, old, head, &map->prev); 82 return perf_mmap__read(map, &map->prev, head);
86} 83}
87 84
88union perf_event *perf_mmap__read_backward(struct perf_mmap *map) 85/*
86 * Read event from ring buffer one by one.
87 * Return one event for each call.
88 *
89 * Usage:
90 * perf_mmap__read_init()
91 * while(event = perf_mmap__read_event()) {
92 * //process the event
93 * perf_mmap__consume()
94 * }
95 * perf_mmap__read_done()
96 */
97union perf_event *perf_mmap__read_event(struct perf_mmap *map,
98 bool overwrite,
99 u64 *startp, u64 end)
89{ 100{
90 u64 head, end; 101 union perf_event *event;
91 u64 start = map->prev;
92 102
93 /* 103 /*
94 * Check if event was unmapped due to a POLLHUP/POLLERR. 104 * Check if event was unmapped due to a POLLHUP/POLLERR.
@@ -96,40 +106,19 @@ union perf_event *perf_mmap__read_backward(struct perf_mmap *map)
96 if (!refcount_read(&map->refcnt)) 106 if (!refcount_read(&map->refcnt))
97 return NULL; 107 return NULL;
98 108
99 head = perf_mmap__read_head(map); 109 if (startp == NULL)
100 if (!head)
101 return NULL; 110 return NULL;
102 111
103 /* 112 /* non-overwirte doesn't pause the ringbuffer */
104 * 'head' pointer starts from 0. Kernel minus sizeof(record) form 113 if (!overwrite)
105 * it each time when kernel writes to it, so in fact 'head' is 114 end = perf_mmap__read_head(map);
106 * negative. 'end' pointer is made manually by adding the size of
107 * the ring buffer to 'head' pointer, means the validate data can
108 * read is the whole ring buffer. If 'end' is positive, the ring
109 * buffer has not fully filled, so we must adjust 'end' to 0.
110 *
111 * However, since both 'head' and 'end' is unsigned, we can't
112 * simply compare 'end' against 0. Here we compare '-head' and
113 * the size of the ring buffer, where -head is the number of bytes
114 * kernel write to the ring buffer.
115 */
116 if (-head < (u64)(map->mask + 1))
117 end = 0;
118 else
119 end = head + map->mask + 1;
120
121 return perf_mmap__read(map, start, end, &map->prev);
122}
123 115
124void perf_mmap__read_catchup(struct perf_mmap *map) 116 event = perf_mmap__read(map, startp, end);
125{
126 u64 head;
127 117
128 if (!refcount_read(&map->refcnt)) 118 if (!overwrite)
129 return; 119 map->prev = *startp;
130 120
131 head = perf_mmap__read_head(map); 121 return event;
132 map->prev = head;
133} 122}
134 123
135static bool perf_mmap__empty(struct perf_mmap *map) 124static bool perf_mmap__empty(struct perf_mmap *map)
@@ -267,41 +256,60 @@ static int overwrite_rb_find_range(void *buf, int mask, u64 head, u64 *start, u6
267 return -1; 256 return -1;
268} 257}
269 258
270int perf_mmap__push(struct perf_mmap *md, bool overwrite, 259/*
271 void *to, int push(void *to, void *buf, size_t size)) 260 * Report the start and end of the available data in ringbuffer
261 */
262int perf_mmap__read_init(struct perf_mmap *md, bool overwrite,
263 u64 *startp, u64 *endp)
272{ 264{
273 u64 head = perf_mmap__read_head(md); 265 u64 head = perf_mmap__read_head(md);
274 u64 old = md->prev; 266 u64 old = md->prev;
275 u64 end = head, start = old;
276 unsigned char *data = md->base + page_size; 267 unsigned char *data = md->base + page_size;
277 unsigned long size; 268 unsigned long size;
278 void *buf;
279 int rc = 0;
280 269
281 start = overwrite ? head : old; 270 *startp = overwrite ? head : old;
282 end = overwrite ? old : head; 271 *endp = overwrite ? old : head;
283 272
284 if (start == end) 273 if (*startp == *endp)
285 return 0; 274 return -EAGAIN;
286 275
287 size = end - start; 276 size = *endp - *startp;
288 if (size > (unsigned long)(md->mask) + 1) { 277 if (size > (unsigned long)(md->mask) + 1) {
289 if (!overwrite) { 278 if (!overwrite) {
290 WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n"); 279 WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n");
291 280
292 md->prev = head; 281 md->prev = head;
293 perf_mmap__consume(md, overwrite); 282 perf_mmap__consume(md, overwrite);
294 return 0; 283 return -EAGAIN;
295 } 284 }
296 285
297 /* 286 /*
298 * Backward ring buffer is full. We still have a chance to read 287 * Backward ring buffer is full. We still have a chance to read
299 * most of data from it. 288 * most of data from it.
300 */ 289 */
301 if (overwrite_rb_find_range(data, md->mask, head, &start, &end)) 290 if (overwrite_rb_find_range(data, md->mask, head, startp, endp))
302 return -1; 291 return -EINVAL;
303 } 292 }
304 293
294 return 0;
295}
296
297int perf_mmap__push(struct perf_mmap *md, bool overwrite,
298 void *to, int push(void *to, void *buf, size_t size))
299{
300 u64 head = perf_mmap__read_head(md);
301 u64 end, start;
302 unsigned char *data = md->base + page_size;
303 unsigned long size;
304 void *buf;
305 int rc = 0;
306
307 rc = perf_mmap__read_init(md, overwrite, &start, &end);
308 if (rc < 0)
309 return (rc == -EAGAIN) ? 0 : -1;
310
311 size = end - start;
312
305 if ((start & md->mask) + size != (end & md->mask)) { 313 if ((start & md->mask) + size != (end & md->mask)) {
306 buf = &data[start & md->mask]; 314 buf = &data[start & md->mask];
307 size = md->mask + 1 - (start & md->mask); 315 size = md->mask + 1 - (start & md->mask);
@@ -327,3 +335,14 @@ int perf_mmap__push(struct perf_mmap *md, bool overwrite,
327out: 335out:
328 return rc; 336 return rc;
329} 337}
338
339/*
340 * Mandatory for overwrite mode
341 * The direction of overwrite mode is backward.
342 * The last perf_mmap__read() will set tail to map->prev.
343 * Need to correct the map->prev to head which is the end of next read.
344 */
345void perf_mmap__read_done(struct perf_mmap *map)
346{
347 map->prev = perf_mmap__read_head(map);
348}
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
index e43d7b55a55f..ec7d3a24e276 100644
--- a/tools/perf/util/mmap.h
+++ b/tools/perf/util/mmap.h
@@ -65,8 +65,6 @@ void perf_mmap__put(struct perf_mmap *map);
65 65
66void perf_mmap__consume(struct perf_mmap *map, bool overwrite); 66void perf_mmap__consume(struct perf_mmap *map, bool overwrite);
67 67
68void perf_mmap__read_catchup(struct perf_mmap *md);
69
70static inline u64 perf_mmap__read_head(struct perf_mmap *mm) 68static inline u64 perf_mmap__read_head(struct perf_mmap *mm)
71{ 69{
72 struct perf_event_mmap_page *pc = mm->base; 70 struct perf_event_mmap_page *pc = mm->base;
@@ -87,11 +85,17 @@ static inline void perf_mmap__write_tail(struct perf_mmap *md, u64 tail)
87} 85}
88 86
89union perf_event *perf_mmap__read_forward(struct perf_mmap *map); 87union perf_event *perf_mmap__read_forward(struct perf_mmap *map);
90union perf_event *perf_mmap__read_backward(struct perf_mmap *map); 88
89union perf_event *perf_mmap__read_event(struct perf_mmap *map,
90 bool overwrite,
91 u64 *startp, u64 end);
91 92
92int perf_mmap__push(struct perf_mmap *md, bool backward, 93int perf_mmap__push(struct perf_mmap *md, bool backward,
93 void *to, int push(void *to, void *buf, size_t size)); 94 void *to, int push(void *to, void *buf, size_t size));
94 95
95size_t perf_mmap__mmap_len(struct perf_mmap *map); 96size_t perf_mmap__mmap_len(struct perf_mmap *map);
96 97
98int perf_mmap__read_init(struct perf_mmap *md, bool overwrite,
99 u64 *startp, u64 *endp);
100void perf_mmap__read_done(struct perf_mmap *map);
97#endif /*__PERF_MMAP_H */ 101#endif /*__PERF_MMAP_H */
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 443892dabedb..1019bbc5dbd8 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -340,35 +340,15 @@ size_t hex_width(u64 v)
340 return n; 340 return n;
341} 341}
342 342
343static int hex(char ch)
344{
345 if ((ch >= '0') && (ch <= '9'))
346 return ch - '0';
347 if ((ch >= 'a') && (ch <= 'f'))
348 return ch - 'a' + 10;
349 if ((ch >= 'A') && (ch <= 'F'))
350 return ch - 'A' + 10;
351 return -1;
352}
353
354/* 343/*
355 * While we find nice hex chars, build a long_val. 344 * While we find nice hex chars, build a long_val.
356 * Return number of chars processed. 345 * Return number of chars processed.
357 */ 346 */
358int hex2u64(const char *ptr, u64 *long_val) 347int hex2u64(const char *ptr, u64 *long_val)
359{ 348{
360 const char *p = ptr; 349 char *p;
361 *long_val = 0;
362
363 while (*p) {
364 const int hex_val = hex(*p);
365 350
366 if (hex_val < 0) 351 *long_val = strtoull(ptr, &p, 16);
367 break;
368
369 *long_val = (*long_val << 4) | hex_val;
370 p++;
371 }
372 352
373 return p - ptr; 353 return p - ptr;
374} 354}
diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config
index a1883bbb0144..2cccbba64418 100644
--- a/tools/power/acpi/Makefile.config
+++ b/tools/power/acpi/Makefile.config
@@ -56,9 +56,6 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM}
56# to compile vs uClibc, that can be done here as well. 56# to compile vs uClibc, that can be done here as well.
57CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- 57CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
58CROSS_COMPILE ?= $(CROSS) 58CROSS_COMPILE ?= $(CROSS)
59CC = $(CROSS_COMPILE)gcc
60LD = $(CROSS_COMPILE)gcc
61STRIP = $(CROSS_COMPILE)strip
62HOSTCC = gcc 59HOSTCC = gcc
63 60
64# check if compiler option is supported 61# check if compiler option is supported
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index fcb3ed0be5f8..dd614463d4d6 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -42,6 +42,24 @@ EXTRA_WARNINGS += -Wformat
42 42
43CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?) 43CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
44 44
45# Makefiles suck: This macro sets a default value of $(2) for the
46# variable named by $(1), unless the variable has been set by
47# environment or command line. This is necessary for CC and AR
48# because make sets default values, so the simpler ?= approach
49# won't work as expected.
50define allow-override
51 $(if $(or $(findstring environment,$(origin $(1))),\
52 $(findstring command line,$(origin $(1)))),,\
53 $(eval $(1) = $(2)))
54endef
55
56# Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix.
57$(call allow-override,CC,$(CROSS_COMPILE)gcc)
58$(call allow-override,AR,$(CROSS_COMPILE)ar)
59$(call allow-override,LD,$(CROSS_COMPILE)ld)
60$(call allow-override,CXX,$(CROSS_COMPILE)g++)
61$(call allow-override,STRIP,$(CROSS_COMPILE)strip)
62
45ifeq ($(CC_NO_CLANG), 1) 63ifeq ($(CC_NO_CLANG), 1)
46EXTRA_WARNINGS += -Wstrict-aliasing=3 64EXTRA_WARNINGS += -Wstrict-aliasing=3
47endif 65endif
diff --git a/tools/spi/Makefile b/tools/spi/Makefile
index 90615e10c79a..815d15589177 100644
--- a/tools/spi/Makefile
+++ b/tools/spi/Makefile
@@ -11,8 +11,6 @@ endif
11# (this improves performance and avoids hard-to-debug behaviour); 11# (this improves performance and avoids hard-to-debug behaviour);
12MAKEFLAGS += -r 12MAKEFLAGS += -r
13 13
14CC = $(CROSS_COMPILE)gcc
15LD = $(CROSS_COMPILE)ld
16CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include 14CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
17 15
18ALL_TARGETS := spidev_test spidev_fdx 16ALL_TARGETS := spidev_test spidev_fdx
diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c
index 44ef9eba5a7a..6c645eb77d42 100644
--- a/tools/testing/radix-tree/idr-test.c
+++ b/tools/testing/radix-tree/idr-test.c
@@ -178,6 +178,55 @@ void idr_get_next_test(int base)
178 idr_destroy(&idr); 178 idr_destroy(&idr);
179} 179}
180 180
181int idr_u32_cb(int id, void *ptr, void *data)
182{
183 BUG_ON(id < 0);
184 BUG_ON(ptr != DUMMY_PTR);
185 return 0;
186}
187
188void idr_u32_test1(struct idr *idr, u32 handle)
189{
190 static bool warned = false;
191 u32 id = handle;
192 int sid = 0;
193 void *ptr;
194
195 BUG_ON(idr_alloc_u32(idr, DUMMY_PTR, &id, id, GFP_KERNEL));
196 BUG_ON(id != handle);
197 BUG_ON(idr_alloc_u32(idr, DUMMY_PTR, &id, id, GFP_KERNEL) != -ENOSPC);
198 BUG_ON(id != handle);
199 if (!warned && id > INT_MAX)
200 printk("vvv Ignore these warnings\n");
201 ptr = idr_get_next(idr, &sid);
202 if (id > INT_MAX) {
203 BUG_ON(ptr != NULL);
204 BUG_ON(sid != 0);
205 } else {
206 BUG_ON(ptr != DUMMY_PTR);
207 BUG_ON(sid != id);
208 }
209 idr_for_each(idr, idr_u32_cb, NULL);
210 if (!warned && id > INT_MAX) {
211 printk("^^^ Warnings over\n");
212 warned = true;
213 }
214 BUG_ON(idr_remove(idr, id) != DUMMY_PTR);
215 BUG_ON(!idr_is_empty(idr));
216}
217
218void idr_u32_test(int base)
219{
220 DEFINE_IDR(idr);
221 idr_init_base(&idr, base);
222 idr_u32_test1(&idr, 10);
223 idr_u32_test1(&idr, 0x7fffffff);
224 idr_u32_test1(&idr, 0x80000000);
225 idr_u32_test1(&idr, 0x80000001);
226 idr_u32_test1(&idr, 0xffe00000);
227 idr_u32_test1(&idr, 0xffffffff);
228}
229
181void idr_checks(void) 230void idr_checks(void)
182{ 231{
183 unsigned long i; 232 unsigned long i;
@@ -248,6 +297,9 @@ void idr_checks(void)
248 idr_get_next_test(0); 297 idr_get_next_test(0);
249 idr_get_next_test(1); 298 idr_get_next_test(1);
250 idr_get_next_test(4); 299 idr_get_next_test(4);
300 idr_u32_test(4);
301 idr_u32_test(1);
302 idr_u32_test(0);
251} 303}
252 304
253/* 305/*
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
index 6903ccf35595..44a0d1ad4408 100644
--- a/tools/testing/radix-tree/linux.c
+++ b/tools/testing/radix-tree/linux.c
@@ -29,7 +29,7 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
29{ 29{
30 struct radix_tree_node *node; 30 struct radix_tree_node *node;
31 31
32 if (flags & __GFP_NOWARN) 32 if (!(flags & __GFP_DIRECT_RECLAIM))
33 return NULL; 33 return NULL;
34 34
35 pthread_mutex_lock(&cachep->lock); 35 pthread_mutex_lock(&cachep->lock);
@@ -73,10 +73,17 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
73 73
74void *kmalloc(size_t size, gfp_t gfp) 74void *kmalloc(size_t size, gfp_t gfp)
75{ 75{
76 void *ret = malloc(size); 76 void *ret;
77
78 if (!(gfp & __GFP_DIRECT_RECLAIM))
79 return NULL;
80
81 ret = malloc(size);
77 uatomic_inc(&nr_allocated); 82 uatomic_inc(&nr_allocated);
78 if (kmalloc_verbose) 83 if (kmalloc_verbose)
79 printf("Allocating %p from malloc\n", ret); 84 printf("Allocating %p from malloc\n", ret);
85 if (gfp & __GFP_ZERO)
86 memset(ret, 0, size);
80 return ret; 87 return ret;
81} 88}
82 89
diff --git a/tools/testing/radix-tree/linux/compiler_types.h b/tools/testing/radix-tree/linux/compiler_types.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tools/testing/radix-tree/linux/compiler_types.h
diff --git a/tools/testing/radix-tree/linux/gfp.h b/tools/testing/radix-tree/linux/gfp.h
index e9fff59dfd8a..e3201ccf54c3 100644
--- a/tools/testing/radix-tree/linux/gfp.h
+++ b/tools/testing/radix-tree/linux/gfp.h
@@ -11,6 +11,7 @@
11#define __GFP_IO 0x40u 11#define __GFP_IO 0x40u
12#define __GFP_FS 0x80u 12#define __GFP_FS 0x80u
13#define __GFP_NOWARN 0x200u 13#define __GFP_NOWARN 0x200u
14#define __GFP_ZERO 0x8000u
14#define __GFP_ATOMIC 0x80000u 15#define __GFP_ATOMIC 0x80000u
15#define __GFP_ACCOUNT 0x100000u 16#define __GFP_ACCOUNT 0x100000u
16#define __GFP_DIRECT_RECLAIM 0x400000u 17#define __GFP_DIRECT_RECLAIM 0x400000u
diff --git a/tools/testing/radix-tree/linux/slab.h b/tools/testing/radix-tree/linux/slab.h
index 979baeec7e70..a037def0dec6 100644
--- a/tools/testing/radix-tree/linux/slab.h
+++ b/tools/testing/radix-tree/linux/slab.h
@@ -3,6 +3,7 @@
3#define SLAB_H 3#define SLAB_H
4 4
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/gfp.h>
6 7
7#define SLAB_HWCACHE_ALIGN 1 8#define SLAB_HWCACHE_ALIGN 1
8#define SLAB_PANIC 2 9#define SLAB_PANIC 2
@@ -11,6 +12,11 @@
11void *kmalloc(size_t size, gfp_t); 12void *kmalloc(size_t size, gfp_t);
12void kfree(void *); 13void kfree(void *);
13 14
15static inline void *kzalloc(size_t size, gfp_t gfp)
16{
17 return kmalloc(size, gfp | __GFP_ZERO);
18}
19
14void *kmem_cache_alloc(struct kmem_cache *cachep, int flags); 20void *kmem_cache_alloc(struct kmem_cache *cachep, int flags);
15void kmem_cache_free(struct kmem_cache *cachep, void *objp); 21void kmem_cache_free(struct kmem_cache *cachep, void *objp);
16 22
diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile
index 1a7492268993..f6304d2be90c 100644
--- a/tools/testing/selftests/android/Makefile
+++ b/tools/testing/selftests/android/Makefile
@@ -11,11 +11,11 @@ all:
11 BUILD_TARGET=$(OUTPUT)/$$DIR; \ 11 BUILD_TARGET=$(OUTPUT)/$$DIR; \
12 mkdir $$BUILD_TARGET -p; \ 12 mkdir $$BUILD_TARGET -p; \
13 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ 13 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
14 #SUBDIR test prog name should be in the form: SUBDIR_test.sh 14 #SUBDIR test prog name should be in the form: SUBDIR_test.sh \
15 TEST=$$DIR"_test.sh"; \ 15 TEST=$$DIR"_test.sh"; \
16 if [ -e $$DIR/$$TEST ]; then 16 if [ -e $$DIR/$$TEST ]; then \
17 rsync -a $$DIR/$$TEST $$BUILD_TARGET/; 17 rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \
18 fi 18 fi \
19 done 19 done
20 20
21override define RUN_TESTS 21override define RUN_TESTS
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index cc15af2e54fe..9cf83f895d98 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -11,3 +11,4 @@ test_progs
11test_tcpbpf_user 11test_tcpbpf_user
12test_verifier_log 12test_verifier_log
13feature 13feature
14test_libbpf_open
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 436c4c72414f..9e03a4c356a4 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -126,6 +126,8 @@ static void test_hashmap_sizes(int task, void *data)
126 fd = bpf_create_map(BPF_MAP_TYPE_HASH, i, j, 126 fd = bpf_create_map(BPF_MAP_TYPE_HASH, i, j,
127 2, map_flags); 127 2, map_flags);
128 if (fd < 0) { 128 if (fd < 0) {
129 if (errno == ENOMEM)
130 return;
129 printf("Failed to create hashmap key=%d value=%d '%s'\n", 131 printf("Failed to create hashmap key=%d value=%d '%s'\n",
130 i, j, strerror(errno)); 132 i, j, strerror(errno));
131 exit(1); 133 exit(1);
diff --git a/tools/testing/selftests/bpf/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/test_tcpbpf_kern.c
index 57119ad57a3f..3e645ee41ed5 100644
--- a/tools/testing/selftests/bpf/test_tcpbpf_kern.c
+++ b/tools/testing/selftests/bpf/test_tcpbpf_kern.c
@@ -5,7 +5,6 @@
5#include <linux/if_ether.h> 5#include <linux/if_ether.h>
6#include <linux/if_packet.h> 6#include <linux/if_packet.h>
7#include <linux/ip.h> 7#include <linux/ip.h>
8#include <linux/in6.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/socket.h> 9#include <linux/socket.h>
11#include <linux/tcp.h> 10#include <linux/tcp.h>
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index c0f16e93f9bd..c73592fa3d41 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -2587,6 +2587,32 @@ static struct bpf_test tests[] = {
2587 .result = ACCEPT, 2587 .result = ACCEPT,
2588 }, 2588 },
2589 { 2589 {
2590 "runtime/jit: pass negative index to tail_call",
2591 .insns = {
2592 BPF_MOV64_IMM(BPF_REG_3, -1),
2593 BPF_LD_MAP_FD(BPF_REG_2, 0),
2594 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
2595 BPF_FUNC_tail_call),
2596 BPF_MOV64_IMM(BPF_REG_0, 0),
2597 BPF_EXIT_INSN(),
2598 },
2599 .fixup_prog = { 1 },
2600 .result = ACCEPT,
2601 },
2602 {
2603 "runtime/jit: pass > 32bit index to tail_call",
2604 .insns = {
2605 BPF_LD_IMM64(BPF_REG_3, 0x100000000ULL),
2606 BPF_LD_MAP_FD(BPF_REG_2, 0),
2607 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
2608 BPF_FUNC_tail_call),
2609 BPF_MOV64_IMM(BPF_REG_0, 0),
2610 BPF_EXIT_INSN(),
2611 },
2612 .fixup_prog = { 2 },
2613 .result = ACCEPT,
2614 },
2615 {
2590 "stack pointer arithmetic", 2616 "stack pointer arithmetic",
2591 .insns = { 2617 .insns = {
2592 BPF_MOV64_IMM(BPF_REG_1, 4), 2618 BPF_MOV64_IMM(BPF_REG_1, 4),
diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index cea4adcd42b8..a63e8453984d 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile
@@ -12,9 +12,9 @@ all:
12 BUILD_TARGET=$(OUTPUT)/$$DIR; \ 12 BUILD_TARGET=$(OUTPUT)/$$DIR; \
13 mkdir $$BUILD_TARGET -p; \ 13 mkdir $$BUILD_TARGET -p; \
14 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ 14 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
15 if [ -e $$DIR/$(TEST_PROGS) ]; then 15 if [ -e $$DIR/$(TEST_PROGS) ]; then \
16 rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; 16 rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
17 fi 17 fi \
18 done 18 done
19 19
20override define RUN_TESTS 20override define RUN_TESTS
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index a5276a91dfbf..0862e6f47a38 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -5,6 +5,7 @@ CFLAGS += -I../../../../include/
5CFLAGS += -I../../../../usr/include/ 5CFLAGS += -I../../../../usr/include/
6 6
7TEST_PROGS := run_tests.sh 7TEST_PROGS := run_tests.sh
8TEST_FILES := run_fuse_test.sh
8TEST_GEN_FILES := memfd_test fuse_mnt fuse_test 9TEST_GEN_FILES := memfd_test fuse_mnt fuse_test
9 10
10fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags) 11fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
diff --git a/tools/testing/selftests/memfd/config b/tools/testing/selftests/memfd/config
new file mode 100644
index 000000000000..835c7f4dadcd
--- /dev/null
+++ b/tools/testing/selftests/memfd/config
@@ -0,0 +1 @@
CONFIG_FUSE_FS=m
diff --git a/tools/testing/selftests/memory-hotplug/Makefile b/tools/testing/selftests/memory-hotplug/Makefile
index 86636d207adf..183b46883875 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -4,7 +4,7 @@ all:
4include ../lib.mk 4include ../lib.mk
5 5
6TEST_PROGS := mem-on-off-test.sh 6TEST_PROGS := mem-on-off-test.sh
7override RUN_TESTS := ./mem-on-off-test.sh -r 2 && echo "selftests: memory-hotplug [PASS]" || echo "selftests: memory-hotplug [FAIL]" 7override RUN_TESTS := @./mem-on-off-test.sh -r 2 && echo "selftests: memory-hotplug [PASS]" || echo "selftests: memory-hotplug [FAIL]"
8override EMIT_TESTS := echo "$(RUN_TESTS)" 8override EMIT_TESTS := echo "$(RUN_TESTS)"
9 9
10run_full_test: 10run_full_test:
diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
index 39fd362415cf..0f2698f9fd6d 100644
--- a/tools/testing/selftests/powerpc/alignment/alignment_handler.c
+++ b/tools/testing/selftests/powerpc/alignment/alignment_handler.c
@@ -57,7 +57,7 @@ volatile int gotsig;
57 57
58void sighandler(int sig, siginfo_t *info, void *ctx) 58void sighandler(int sig, siginfo_t *info, void *ctx)
59{ 59{
60 struct ucontext *ucp = ctx; 60 ucontext_t *ucp = ctx;
61 61
62 if (!testing) { 62 if (!testing) {
63 signal(sig, SIG_DFL); 63 signal(sig, SIG_DFL);
diff --git a/tools/testing/selftests/pstore/config b/tools/testing/selftests/pstore/config
index 6a8e5a9bfc10..d148f9f89fb6 100644
--- a/tools/testing/selftests/pstore/config
+++ b/tools/testing/selftests/pstore/config
@@ -2,3 +2,4 @@ CONFIG_MISC_FILESYSTEMS=y
2CONFIG_PSTORE=y 2CONFIG_PSTORE=y
3CONFIG_PSTORE_PMSG=y 3CONFIG_PSTORE_PMSG=y
4CONFIG_PSTORE_CONSOLE=y 4CONFIG_PSTORE_CONSOLE=y
5CONFIG_PSTORE_RAM=m
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 0b457e8e0f0c..5df609950a66 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -141,6 +141,15 @@ struct seccomp_data {
141#define SECCOMP_FILTER_FLAG_LOG 2 141#define SECCOMP_FILTER_FLAG_LOG 2
142#endif 142#endif
143 143
144#ifndef PTRACE_SECCOMP_GET_METADATA
145#define PTRACE_SECCOMP_GET_METADATA 0x420d
146
147struct seccomp_metadata {
148 __u64 filter_off; /* Input: which filter */
149 __u64 flags; /* Output: filter's flags */
150};
151#endif
152
144#ifndef seccomp 153#ifndef seccomp
145int seccomp(unsigned int op, unsigned int flags, void *args) 154int seccomp(unsigned int op, unsigned int flags, void *args)
146{ 155{
@@ -2845,6 +2854,58 @@ TEST(get_action_avail)
2845 EXPECT_EQ(errno, EOPNOTSUPP); 2854 EXPECT_EQ(errno, EOPNOTSUPP);
2846} 2855}
2847 2856
2857TEST(get_metadata)
2858{
2859 pid_t pid;
2860 int pipefd[2];
2861 char buf;
2862 struct seccomp_metadata md;
2863
2864 ASSERT_EQ(0, pipe(pipefd));
2865
2866 pid = fork();
2867 ASSERT_GE(pid, 0);
2868 if (pid == 0) {
2869 struct sock_filter filter[] = {
2870 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
2871 };
2872 struct sock_fprog prog = {
2873 .len = (unsigned short)ARRAY_SIZE(filter),
2874 .filter = filter,
2875 };
2876
2877 /* one with log, one without */
2878 ASSERT_EQ(0, seccomp(SECCOMP_SET_MODE_FILTER,
2879 SECCOMP_FILTER_FLAG_LOG, &prog));
2880 ASSERT_EQ(0, seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog));
2881
2882 ASSERT_EQ(0, close(pipefd[0]));
2883 ASSERT_EQ(1, write(pipefd[1], "1", 1));
2884 ASSERT_EQ(0, close(pipefd[1]));
2885
2886 while (1)
2887 sleep(100);
2888 }
2889
2890 ASSERT_EQ(0, close(pipefd[1]));
2891 ASSERT_EQ(1, read(pipefd[0], &buf, 1));
2892
2893 ASSERT_EQ(0, ptrace(PTRACE_ATTACH, pid));
2894 ASSERT_EQ(pid, waitpid(pid, NULL, 0));
2895
2896 md.filter_off = 0;
2897 ASSERT_EQ(sizeof(md), ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md));
2898 EXPECT_EQ(md.flags, SECCOMP_FILTER_FLAG_LOG);
2899 EXPECT_EQ(md.filter_off, 0);
2900
2901 md.filter_off = 1;
2902 ASSERT_EQ(sizeof(md), ptrace(PTRACE_SECCOMP_GET_METADATA, pid, sizeof(md), &md));
2903 EXPECT_EQ(md.flags, 0);
2904 EXPECT_EQ(md.filter_off, 1);
2905
2906 ASSERT_EQ(0, kill(pid, SIGKILL));
2907}
2908
2848/* 2909/*
2849 * TODO: 2910 * TODO:
2850 * - add microbenchmarks 2911 * - add microbenchmarks
diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile
index b3c8ba3cb668..d0121a8a3523 100644
--- a/tools/testing/selftests/sync/Makefile
+++ b/tools/testing/selftests/sync/Makefile
@@ -30,7 +30,7 @@ $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS)
30 $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS) 30 $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS)
31 31
32$(OBJS): $(OUTPUT)/%.o: %.c 32$(OBJS): $(OUTPUT)/%.o: %.c
33 $(CC) -c $^ -o $@ 33 $(CC) -c $^ -o $@ $(CFLAGS)
34 34
35$(TESTS): $(OUTPUT)/%.o: %.c 35$(TESTS): $(OUTPUT)/%.o: %.c
36 $(CC) -c $^ -o $@ 36 $(CC) -c $^ -o $@
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 3d5a62ff7d31..f5d7a7851e21 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -1,4 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2include ../lib.mk
3
2ifndef CROSS_COMPILE 4ifndef CROSS_COMPILE
3CFLAGS := -std=gnu99 5CFLAGS := -std=gnu99
4CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector 6CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
@@ -6,16 +8,14 @@ ifeq ($(CONFIG_X86_32),y)
6LDLIBS += -lgcc_s 8LDLIBS += -lgcc_s
7endif 9endif
8 10
9TEST_PROGS := vdso_test vdso_standalone_test_x86 11TEST_PROGS := $(OUTPUT)/vdso_test $(OUTPUT)/vdso_standalone_test_x86
10 12
11all: $(TEST_PROGS) 13all: $(TEST_PROGS)
12vdso_test: parse_vdso.c vdso_test.c 14$(OUTPUT)/vdso_test: parse_vdso.c vdso_test.c
13vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c 15$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
14 $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \ 16 $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
15 vdso_standalone_test_x86.c parse_vdso.c \ 17 vdso_standalone_test_x86.c parse_vdso.c \
16 -o vdso_standalone_test_x86 18 -o $@
17 19
18include ../lib.mk 20EXTRA_CLEAN := $(TEST_PROGS)
19clean:
20 rm -fr $(TEST_PROGS)
21endif 21endif
diff --git a/tools/testing/selftests/vm/.gitignore b/tools/testing/selftests/vm/.gitignore
index 63c94d776e89..342c7bc9dc8c 100644
--- a/tools/testing/selftests/vm/.gitignore
+++ b/tools/testing/selftests/vm/.gitignore
@@ -11,3 +11,4 @@ mlock-intersect-test
11mlock-random-test 11mlock-random-test
12virtual_address_range 12virtual_address_range
13gup_benchmark 13gup_benchmark
14va_128TBswitch
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 10ca46df1449..d744991c0f4f 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -5,16 +5,26 @@ include ../lib.mk
5 5
6.PHONY: all all_32 all_64 warn_32bit_failure clean 6.PHONY: all all_32 all_64 warn_32bit_failure clean
7 7
8TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt ptrace_syscall test_mremap_vdso \ 8UNAME_M := $(shell uname -m)
9 check_initial_reg_state sigreturn ldt_gdt iopl mpx-mini-test ioperm \ 9CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32)
10CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c)
11
12TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt test_mremap_vdso \
13 check_initial_reg_state sigreturn iopl mpx-mini-test ioperm \
10 protection_keys test_vdso test_vsyscall 14 protection_keys test_vdso test_vsyscall
11TARGETS_C_32BIT_ONLY := entry_from_vm86 syscall_arg_fault test_syscall_vdso unwind_vdso \ 15TARGETS_C_32BIT_ONLY := entry_from_vm86 syscall_arg_fault test_syscall_vdso unwind_vdso \
12 test_FCMOV test_FCOMI test_FISTTP \ 16 test_FCMOV test_FCOMI test_FISTTP \
13 vdso_restorer 17 vdso_restorer
14TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip 5lvl 18TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip
19# Some selftests require 32bit support enabled also on 64bit systems
20TARGETS_C_32BIT_NEEDED := ldt_gdt ptrace_syscall
15 21
16TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) 22TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) $(TARGETS_C_32BIT_NEEDED)
17TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) 23TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY)
24ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),11)
25TARGETS_C_64BIT_ALL += $(TARGETS_C_32BIT_NEEDED)
26endif
27
18BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) 28BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32)
19BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) 29BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64)
20 30
@@ -23,10 +33,6 @@ BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
23 33
24CFLAGS := -O2 -g -std=gnu99 -pthread -Wall -no-pie 34CFLAGS := -O2 -g -std=gnu99 -pthread -Wall -no-pie
25 35
26UNAME_M := $(shell uname -m)
27CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32)
28CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c)
29
30define gen-target-rule-32 36define gen-target-rule-32
31$(1) $(1)_32: $(OUTPUT)/$(1)_32 37$(1) $(1)_32: $(OUTPUT)/$(1)_32
32.PHONY: $(1) $(1)_32 38.PHONY: $(1) $(1)_32
@@ -40,12 +46,14 @@ endef
40ifeq ($(CAN_BUILD_I386),1) 46ifeq ($(CAN_BUILD_I386),1)
41all: all_32 47all: all_32
42TEST_PROGS += $(BINARIES_32) 48TEST_PROGS += $(BINARIES_32)
49EXTRA_CFLAGS += -DCAN_BUILD_32
43$(foreach t,$(TARGETS_C_32BIT_ALL),$(eval $(call gen-target-rule-32,$(t)))) 50$(foreach t,$(TARGETS_C_32BIT_ALL),$(eval $(call gen-target-rule-32,$(t))))
44endif 51endif
45 52
46ifeq ($(CAN_BUILD_X86_64),1) 53ifeq ($(CAN_BUILD_X86_64),1)
47all: all_64 54all: all_64
48TEST_PROGS += $(BINARIES_64) 55TEST_PROGS += $(BINARIES_64)
56EXTRA_CFLAGS += -DCAN_BUILD_64
49$(foreach t,$(TARGETS_C_64BIT_ALL),$(eval $(call gen-target-rule-64,$(t)))) 57$(foreach t,$(TARGETS_C_64BIT_ALL),$(eval $(call gen-target-rule-64,$(t))))
50endif 58endif
51 59
diff --git a/tools/testing/selftests/x86/mpx-mini-test.c b/tools/testing/selftests/x86/mpx-mini-test.c
index ec0f6b45ce8b..9c0325e1ea68 100644
--- a/tools/testing/selftests/x86/mpx-mini-test.c
+++ b/tools/testing/selftests/x86/mpx-mini-test.c
@@ -315,11 +315,39 @@ static inline void *__si_bounds_upper(siginfo_t *si)
315 return si->si_upper; 315 return si->si_upper;
316} 316}
317#else 317#else
318
319/*
320 * This deals with old version of _sigfault in some distros:
321 *
322
323old _sigfault:
324 struct {
325 void *si_addr;
326 } _sigfault;
327
328new _sigfault:
329 struct {
330 void __user *_addr;
331 int _trapno;
332 short _addr_lsb;
333 union {
334 struct {
335 void __user *_lower;
336 void __user *_upper;
337 } _addr_bnd;
338 __u32 _pkey;
339 };
340 } _sigfault;
341 *
342 */
343
318static inline void **__si_bounds_hack(siginfo_t *si) 344static inline void **__si_bounds_hack(siginfo_t *si)
319{ 345{
320 void *sigfault = &si->_sifields._sigfault; 346 void *sigfault = &si->_sifields._sigfault;
321 void *end_sigfault = sigfault + sizeof(si->_sifields._sigfault); 347 void *end_sigfault = sigfault + sizeof(si->_sifields._sigfault);
322 void **__si_lower = end_sigfault; 348 int *trapno = (int*)end_sigfault;
349 /* skip _trapno and _addr_lsb */
350 void **__si_lower = (void**)(trapno + 2);
323 351
324 return __si_lower; 352 return __si_lower;
325} 353}
@@ -331,7 +359,7 @@ static inline void *__si_bounds_lower(siginfo_t *si)
331 359
332static inline void *__si_bounds_upper(siginfo_t *si) 360static inline void *__si_bounds_upper(siginfo_t *si)
333{ 361{
334 return (*__si_bounds_hack(si)) + sizeof(void *); 362 return *(__si_bounds_hack(si) + 1);
335} 363}
336#endif 364#endif
337 365
diff --git a/tools/testing/selftests/x86/protection_keys.c b/tools/testing/selftests/x86/protection_keys.c
index bc1b0735bb50..f15aa5a76fe3 100644
--- a/tools/testing/selftests/x86/protection_keys.c
+++ b/tools/testing/selftests/x86/protection_keys.c
@@ -393,34 +393,6 @@ pid_t fork_lazy_child(void)
393 return forkret; 393 return forkret;
394} 394}
395 395
396void davecmp(void *_a, void *_b, int len)
397{
398 int i;
399 unsigned long *a = _a;
400 unsigned long *b = _b;
401
402 for (i = 0; i < len / sizeof(*a); i++) {
403 if (a[i] == b[i])
404 continue;
405
406 dprintf3("[%3d]: a: %016lx b: %016lx\n", i, a[i], b[i]);
407 }
408}
409
410void dumpit(char *f)
411{
412 int fd = open(f, O_RDONLY);
413 char buf[100];
414 int nr_read;
415
416 dprintf2("maps fd: %d\n", fd);
417 do {
418 nr_read = read(fd, &buf[0], sizeof(buf));
419 write(1, buf, nr_read);
420 } while (nr_read > 0);
421 close(fd);
422}
423
424#define PKEY_DISABLE_ACCESS 0x1 396#define PKEY_DISABLE_ACCESS 0x1
425#define PKEY_DISABLE_WRITE 0x2 397#define PKEY_DISABLE_WRITE 0x2
426 398
diff --git a/tools/testing/selftests/x86/single_step_syscall.c b/tools/testing/selftests/x86/single_step_syscall.c
index a48da95c18fd..ddfdd635de16 100644
--- a/tools/testing/selftests/x86/single_step_syscall.c
+++ b/tools/testing/selftests/x86/single_step_syscall.c
@@ -119,7 +119,9 @@ static void check_result(void)
119 119
120int main() 120int main()
121{ 121{
122#ifdef CAN_BUILD_32
122 int tmp; 123 int tmp;
124#endif
123 125
124 sethandler(SIGTRAP, sigtrap, 0); 126 sethandler(SIGTRAP, sigtrap, 0);
125 127
@@ -139,12 +141,13 @@ int main()
139 : : "c" (post_nop) : "r11"); 141 : : "c" (post_nop) : "r11");
140 check_result(); 142 check_result();
141#endif 143#endif
142 144#ifdef CAN_BUILD_32
143 printf("[RUN]\tSet TF and check int80\n"); 145 printf("[RUN]\tSet TF and check int80\n");
144 set_eflags(get_eflags() | X86_EFLAGS_TF); 146 set_eflags(get_eflags() | X86_EFLAGS_TF);
145 asm volatile ("int $0x80" : "=a" (tmp) : "a" (SYS_getpid) 147 asm volatile ("int $0x80" : "=a" (tmp) : "a" (SYS_getpid)
146 : INT80_CLOBBERS); 148 : INT80_CLOBBERS);
147 check_result(); 149 check_result();
150#endif
148 151
149 /* 152 /*
150 * This test is particularly interesting if fast syscalls use 153 * This test is particularly interesting if fast syscalls use
diff --git a/tools/testing/selftests/x86/test_mremap_vdso.c b/tools/testing/selftests/x86/test_mremap_vdso.c
index bf0d687c7db7..64f11c8d9b76 100644
--- a/tools/testing/selftests/x86/test_mremap_vdso.c
+++ b/tools/testing/selftests/x86/test_mremap_vdso.c
@@ -90,8 +90,12 @@ int main(int argc, char **argv, char **envp)
90 vdso_size += PAGE_SIZE; 90 vdso_size += PAGE_SIZE;
91 } 91 }
92 92
93#ifdef __i386__
93 /* Glibc is likely to explode now - exit with raw syscall */ 94 /* Glibc is likely to explode now - exit with raw syscall */
94 asm volatile ("int $0x80" : : "a" (__NR_exit), "b" (!!ret)); 95 asm volatile ("int $0x80" : : "a" (__NR_exit), "b" (!!ret));
96#else /* __x86_64__ */
97 syscall(SYS_exit, ret);
98#endif
95 } else { 99 } else {
96 int status; 100 int status;
97 101
diff --git a/tools/testing/selftests/x86/test_vdso.c b/tools/testing/selftests/x86/test_vdso.c
index 29973cde06d3..235259011704 100644
--- a/tools/testing/selftests/x86/test_vdso.c
+++ b/tools/testing/selftests/x86/test_vdso.c
@@ -26,20 +26,59 @@
26# endif 26# endif
27#endif 27#endif
28 28
29/* max length of lines in /proc/self/maps - anything longer is skipped here */
30#define MAPS_LINE_LEN 128
31
29int nerrs = 0; 32int nerrs = 0;
30 33
34typedef long (*getcpu_t)(unsigned *, unsigned *, void *);
35
36getcpu_t vgetcpu;
37getcpu_t vdso_getcpu;
38
39static void *vsyscall_getcpu(void)
40{
31#ifdef __x86_64__ 41#ifdef __x86_64__
32# define VSYS(x) (x) 42 FILE *maps;
43 char line[MAPS_LINE_LEN];
44 bool found = false;
45
46 maps = fopen("/proc/self/maps", "r");
47 if (!maps) /* might still be present, but ignore it here, as we test vDSO not vsyscall */
48 return NULL;
49
50 while (fgets(line, MAPS_LINE_LEN, maps)) {
51 char r, x;
52 void *start, *end;
53 char name[MAPS_LINE_LEN];
54
55 /* sscanf() is safe here as strlen(name) >= strlen(line) */
56 if (sscanf(line, "%p-%p %c-%cp %*x %*x:%*x %*u %s",
57 &start, &end, &r, &x, name) != 5)
58 continue;
59
60 if (strcmp(name, "[vsyscall]"))
61 continue;
62
63 /* assume entries are OK, as we test vDSO here not vsyscall */
64 found = true;
65 break;
66 }
67
68 fclose(maps);
69
70 if (!found) {
71 printf("Warning: failed to find vsyscall getcpu\n");
72 return NULL;
73 }
74 return (void *) (0xffffffffff600800);
33#else 75#else
34# define VSYS(x) 0 76 return NULL;
35#endif 77#endif
78}
36 79
37typedef long (*getcpu_t)(unsigned *, unsigned *, void *);
38
39const getcpu_t vgetcpu = (getcpu_t)VSYS(0xffffffffff600800);
40getcpu_t vdso_getcpu;
41 80
42void fill_function_pointers() 81static void fill_function_pointers()
43{ 82{
44 void *vdso = dlopen("linux-vdso.so.1", 83 void *vdso = dlopen("linux-vdso.so.1",
45 RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); 84 RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
@@ -54,6 +93,8 @@ void fill_function_pointers()
54 vdso_getcpu = (getcpu_t)dlsym(vdso, "__vdso_getcpu"); 93 vdso_getcpu = (getcpu_t)dlsym(vdso, "__vdso_getcpu");
55 if (!vdso_getcpu) 94 if (!vdso_getcpu)
56 printf("Warning: failed to find getcpu in vDSO\n"); 95 printf("Warning: failed to find getcpu in vDSO\n");
96
97 vgetcpu = (getcpu_t) vsyscall_getcpu();
57} 98}
58 99
59static long sys_getcpu(unsigned * cpu, unsigned * node, 100static long sys_getcpu(unsigned * cpu, unsigned * node,
diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c
index 7a744fa7b786..be81621446f0 100644
--- a/tools/testing/selftests/x86/test_vsyscall.c
+++ b/tools/testing/selftests/x86/test_vsyscall.c
@@ -33,6 +33,9 @@
33# endif 33# endif
34#endif 34#endif
35 35
36/* max length of lines in /proc/self/maps - anything longer is skipped here */
37#define MAPS_LINE_LEN 128
38
36static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), 39static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *),
37 int flags) 40 int flags)
38{ 41{
@@ -98,7 +101,7 @@ static int init_vsys(void)
98#ifdef __x86_64__ 101#ifdef __x86_64__
99 int nerrs = 0; 102 int nerrs = 0;
100 FILE *maps; 103 FILE *maps;
101 char line[128]; 104 char line[MAPS_LINE_LEN];
102 bool found = false; 105 bool found = false;
103 106
104 maps = fopen("/proc/self/maps", "r"); 107 maps = fopen("/proc/self/maps", "r");
@@ -108,10 +111,12 @@ static int init_vsys(void)
108 return 0; 111 return 0;
109 } 112 }
110 113
111 while (fgets(line, sizeof(line), maps)) { 114 while (fgets(line, MAPS_LINE_LEN, maps)) {
112 char r, x; 115 char r, x;
113 void *start, *end; 116 void *start, *end;
114 char name[128]; 117 char name[MAPS_LINE_LEN];
118
119 /* sscanf() is safe here as strlen(name) >= strlen(line) */
115 if (sscanf(line, "%p-%p %c-%cp %*x %*x:%*x %*u %s", 120 if (sscanf(line, "%p-%p %c-%cp %*x %*x:%*x %*u %s",
116 &start, &end, &r, &x, name) != 5) 121 &start, &end, &r, &x, name) != 5)
117 continue; 122 continue;
diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index 4e6506078494..01d758d73b6d 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# Makefile for USB tools 2# Makefile for USB tools
3 3
4CC = $(CROSS_COMPILE)gcc
5PTHREAD_LIBS = -lpthread 4PTHREAD_LIBS = -lpthread
6WARNINGS = -Wall -Wextra 5WARNINGS = -Wall -Wextra
7CFLAGS = $(WARNINGS) -g -I../include 6CFLAGS = $(WARNINGS) -g -I../include
diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index be320b905ea7..20f6cf04377f 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -6,7 +6,6 @@ TARGETS=page-types slabinfo page_owner_sort
6LIB_DIR = ../lib/api 6LIB_DIR = ../lib/api
7LIBS = $(LIB_DIR)/libapi.a 7LIBS = $(LIB_DIR)/libapi.a
8 8
9CC = $(CROSS_COMPILE)gcc
10CFLAGS = -Wall -Wextra -I../lib/ 9CFLAGS = -Wall -Wextra -I../lib/
11LDFLAGS = $(LIBS) 10LDFLAGS = $(LIBS)
12 11
diff --git a/tools/wmi/Makefile b/tools/wmi/Makefile
index e664f1167388..e0e87239126b 100644
--- a/tools/wmi/Makefile
+++ b/tools/wmi/Makefile
@@ -2,7 +2,6 @@ PREFIX ?= /usr
2SBINDIR ?= sbin 2SBINDIR ?= sbin
3INSTALL ?= install 3INSTALL ?= install
4CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 4CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
5CC = $(CROSS_COMPILE)gcc
6 5
7TARGET = dell-smbios-example 6TARGET = dell-smbios-example
8 7
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 70268c0bec79..70f4c30918eb 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -36,6 +36,8 @@ static struct timecounter *timecounter;
36static unsigned int host_vtimer_irq; 36static unsigned int host_vtimer_irq;
37static u32 host_vtimer_irq_flags; 37static u32 host_vtimer_irq_flags;
38 38
39static DEFINE_STATIC_KEY_FALSE(has_gic_active_state);
40
39static const struct kvm_irq_level default_ptimer_irq = { 41static const struct kvm_irq_level default_ptimer_irq = {
40 .irq = 30, 42 .irq = 30,
41 .level = 1, 43 .level = 1,
@@ -56,6 +58,12 @@ u64 kvm_phys_timer_read(void)
56 return timecounter->cc->read(timecounter->cc); 58 return timecounter->cc->read(timecounter->cc);
57} 59}
58 60
61static inline bool userspace_irqchip(struct kvm *kvm)
62{
63 return static_branch_unlikely(&userspace_irqchip_in_use) &&
64 unlikely(!irqchip_in_kernel(kvm));
65}
66
59static void soft_timer_start(struct hrtimer *hrt, u64 ns) 67static void soft_timer_start(struct hrtimer *hrt, u64 ns)
60{ 68{
61 hrtimer_start(hrt, ktime_add_ns(ktime_get(), ns), 69 hrtimer_start(hrt, ktime_add_ns(ktime_get(), ns),
@@ -69,25 +77,6 @@ static void soft_timer_cancel(struct hrtimer *hrt, struct work_struct *work)
69 cancel_work_sync(work); 77 cancel_work_sync(work);
70} 78}
71 79
72static void kvm_vtimer_update_mask_user(struct kvm_vcpu *vcpu)
73{
74 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
75
76 /*
77 * When using a userspace irqchip with the architected timers, we must
78 * prevent continuously exiting from the guest, and therefore mask the
79 * physical interrupt by disabling it on the host interrupt controller
80 * when the virtual level is high, such that the guest can make
81 * forward progress. Once we detect the output level being
82 * de-asserted, we unmask the interrupt again so that we exit from the
83 * guest when the timer fires.
84 */
85 if (vtimer->irq.level)
86 disable_percpu_irq(host_vtimer_irq);
87 else
88 enable_percpu_irq(host_vtimer_irq, 0);
89}
90
91static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id) 80static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
92{ 81{
93 struct kvm_vcpu *vcpu = *(struct kvm_vcpu **)dev_id; 82 struct kvm_vcpu *vcpu = *(struct kvm_vcpu **)dev_id;
@@ -106,9 +95,9 @@ static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
106 if (kvm_timer_should_fire(vtimer)) 95 if (kvm_timer_should_fire(vtimer))
107 kvm_timer_update_irq(vcpu, true, vtimer); 96 kvm_timer_update_irq(vcpu, true, vtimer);
108 97
109 if (static_branch_unlikely(&userspace_irqchip_in_use) && 98 if (userspace_irqchip(vcpu->kvm) &&
110 unlikely(!irqchip_in_kernel(vcpu->kvm))) 99 !static_branch_unlikely(&has_gic_active_state))
111 kvm_vtimer_update_mask_user(vcpu); 100 disable_percpu_irq(host_vtimer_irq);
112 101
113 return IRQ_HANDLED; 102 return IRQ_HANDLED;
114} 103}
@@ -290,8 +279,7 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level,
290 trace_kvm_timer_update_irq(vcpu->vcpu_id, timer_ctx->irq.irq, 279 trace_kvm_timer_update_irq(vcpu->vcpu_id, timer_ctx->irq.irq,
291 timer_ctx->irq.level); 280 timer_ctx->irq.level);
292 281
293 if (!static_branch_unlikely(&userspace_irqchip_in_use) || 282 if (!userspace_irqchip(vcpu->kvm)) {
294 likely(irqchip_in_kernel(vcpu->kvm))) {
295 ret = kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, 283 ret = kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id,
296 timer_ctx->irq.irq, 284 timer_ctx->irq.irq,
297 timer_ctx->irq.level, 285 timer_ctx->irq.level,
@@ -350,12 +338,6 @@ static void kvm_timer_update_state(struct kvm_vcpu *vcpu)
350 phys_timer_emulate(vcpu); 338 phys_timer_emulate(vcpu);
351} 339}
352 340
353static void __timer_snapshot_state(struct arch_timer_context *timer)
354{
355 timer->cnt_ctl = read_sysreg_el0(cntv_ctl);
356 timer->cnt_cval = read_sysreg_el0(cntv_cval);
357}
358
359static void vtimer_save_state(struct kvm_vcpu *vcpu) 341static void vtimer_save_state(struct kvm_vcpu *vcpu)
360{ 342{
361 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; 343 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
@@ -367,8 +349,10 @@ static void vtimer_save_state(struct kvm_vcpu *vcpu)
367 if (!vtimer->loaded) 349 if (!vtimer->loaded)
368 goto out; 350 goto out;
369 351
370 if (timer->enabled) 352 if (timer->enabled) {
371 __timer_snapshot_state(vtimer); 353 vtimer->cnt_ctl = read_sysreg_el0(cntv_ctl);
354 vtimer->cnt_cval = read_sysreg_el0(cntv_cval);
355 }
372 356
373 /* Disable the virtual timer */ 357 /* Disable the virtual timer */
374 write_sysreg_el0(0, cntv_ctl); 358 write_sysreg_el0(0, cntv_ctl);
@@ -460,23 +444,43 @@ static void set_cntvoff(u64 cntvoff)
460 kvm_call_hyp(__kvm_timer_set_cntvoff, low, high); 444 kvm_call_hyp(__kvm_timer_set_cntvoff, low, high);
461} 445}
462 446
463static void kvm_timer_vcpu_load_vgic(struct kvm_vcpu *vcpu) 447static inline void set_vtimer_irq_phys_active(struct kvm_vcpu *vcpu, bool active)
448{
449 int r;
450 r = irq_set_irqchip_state(host_vtimer_irq, IRQCHIP_STATE_ACTIVE, active);
451 WARN_ON(r);
452}
453
454static void kvm_timer_vcpu_load_gic(struct kvm_vcpu *vcpu)
464{ 455{
465 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu); 456 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
466 bool phys_active; 457 bool phys_active;
467 int ret;
468 458
469 phys_active = kvm_vgic_map_is_active(vcpu, vtimer->irq.irq); 459 if (irqchip_in_kernel(vcpu->kvm))
470 460 phys_active = kvm_vgic_map_is_active(vcpu, vtimer->irq.irq);
471 ret = irq_set_irqchip_state(host_vtimer_irq, 461 else
472 IRQCHIP_STATE_ACTIVE, 462 phys_active = vtimer->irq.level;
473 phys_active); 463 set_vtimer_irq_phys_active(vcpu, phys_active);
474 WARN_ON(ret);
475} 464}
476 465
477static void kvm_timer_vcpu_load_user(struct kvm_vcpu *vcpu) 466static void kvm_timer_vcpu_load_nogic(struct kvm_vcpu *vcpu)
478{ 467{
479 kvm_vtimer_update_mask_user(vcpu); 468 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
469
470 /*
471 * When using a userspace irqchip with the architected timers and a
472 * host interrupt controller that doesn't support an active state, we
473 * must still prevent continuously exiting from the guest, and
474 * therefore mask the physical interrupt by disabling it on the host
475 * interrupt controller when the virtual level is high, such that the
476 * guest can make forward progress. Once we detect the output level
477 * being de-asserted, we unmask the interrupt again so that we exit
478 * from the guest when the timer fires.
479 */
480 if (vtimer->irq.level)
481 disable_percpu_irq(host_vtimer_irq);
482 else
483 enable_percpu_irq(host_vtimer_irq, host_vtimer_irq_flags);
480} 484}
481 485
482void kvm_timer_vcpu_load(struct kvm_vcpu *vcpu) 486void kvm_timer_vcpu_load(struct kvm_vcpu *vcpu)
@@ -487,10 +491,10 @@ void kvm_timer_vcpu_load(struct kvm_vcpu *vcpu)
487 if (unlikely(!timer->enabled)) 491 if (unlikely(!timer->enabled))
488 return; 492 return;
489 493
490 if (unlikely(!irqchip_in_kernel(vcpu->kvm))) 494 if (static_branch_likely(&has_gic_active_state))
491 kvm_timer_vcpu_load_user(vcpu); 495 kvm_timer_vcpu_load_gic(vcpu);
492 else 496 else
493 kvm_timer_vcpu_load_vgic(vcpu); 497 kvm_timer_vcpu_load_nogic(vcpu);
494 498
495 set_cntvoff(vtimer->cntvoff); 499 set_cntvoff(vtimer->cntvoff);
496 500
@@ -555,18 +559,24 @@ static void unmask_vtimer_irq_user(struct kvm_vcpu *vcpu)
555{ 559{
556 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu); 560 struct arch_timer_context *vtimer = vcpu_vtimer(vcpu);
557 561
558 if (unlikely(!irqchip_in_kernel(vcpu->kvm))) { 562 if (!kvm_timer_should_fire(vtimer)) {
559 __timer_snapshot_state(vtimer); 563 kvm_timer_update_irq(vcpu, false, vtimer);
560 if (!kvm_timer_should_fire(vtimer)) { 564 if (static_branch_likely(&has_gic_active_state))
561 kvm_timer_update_irq(vcpu, false, vtimer); 565 set_vtimer_irq_phys_active(vcpu, false);
562 kvm_vtimer_update_mask_user(vcpu); 566 else
563 } 567 enable_percpu_irq(host_vtimer_irq, host_vtimer_irq_flags);
564 } 568 }
565} 569}
566 570
567void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) 571void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu)
568{ 572{
569 unmask_vtimer_irq_user(vcpu); 573 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
574
575 if (unlikely(!timer->enabled))
576 return;
577
578 if (unlikely(!irqchip_in_kernel(vcpu->kvm)))
579 unmask_vtimer_irq_user(vcpu);
570} 580}
571 581
572int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu) 582int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu)
@@ -753,6 +763,8 @@ int kvm_timer_hyp_init(bool has_gic)
753 kvm_err("kvm_arch_timer: error setting vcpu affinity\n"); 763 kvm_err("kvm_arch_timer: error setting vcpu affinity\n");
754 goto out_free_irq; 764 goto out_free_irq;
755 } 765 }
766
767 static_branch_enable(&has_gic_active_state);
756 } 768 }
757 769
758 kvm_info("virtual timer IRQ%d\n", host_vtimer_irq); 770 kvm_info("virtual timer IRQ%d\n", host_vtimer_irq);
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4501e658e8d6..65dea3ffef68 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -969,8 +969,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
969 /* Check for overlaps */ 969 /* Check for overlaps */
970 r = -EEXIST; 970 r = -EEXIST;
971 kvm_for_each_memslot(slot, __kvm_memslots(kvm, as_id)) { 971 kvm_for_each_memslot(slot, __kvm_memslots(kvm, as_id)) {
972 if ((slot->id >= KVM_USER_MEM_SLOTS) || 972 if (slot->id == id)
973 (slot->id == id))
974 continue; 973 continue;
975 if (!((base_gfn + npages <= slot->base_gfn) || 974 if (!((base_gfn + npages <= slot->base_gfn) ||
976 (base_gfn >= slot->base_gfn + slot->npages))) 975 (base_gfn >= slot->base_gfn + slot->npages)))